(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [779],
  {
    90779: (e, t, r) => {
      'use strict';
      r.d(t, {
        C: () => se,
        D: () => B,
        a: () => U,
        b: () => ne,
        c: () => A,
        d: () => re,
        e: () => te,
        f: () => I,
        g: () => v,
        h: () => C,
        l: () => J,
        n: () => S,
        s: () => T,
        t: () => g,
      });
      var n = r(72836),
        s = r(27726),
        o = r(82058),
        i = r(41864),
        a = r(60991),
        u = r(76506),
        c = r(50406),
        f = r(32101),
        l = r(57532),
        d = r(92143),
        h = r(48190),
        p = r(10738),
        m = r(65775),
        y = r(35861),
        b = r(45087),
        w = r(40167),
        x = r(14049);
      function g(e, t, r) {
        if (e.count !== t.count)
          return void n.l.error(
            'source and destination buffers need to have the same number of elements',
          );
        const s = e.count,
          o = r[0],
          i = r[1],
          a = r[2],
          u = r[3],
          c = r[4],
          f = r[5],
          l = r[6],
          d = r[7],
          h = r[8],
          p = e.typedBuffer,
          m = e.typedBufferStride,
          y = t.typedBuffer,
          b = t.typedBufferStride;
        for (let e = 0; e < s; e++) {
          const t = e * m,
            r = e * b,
            n = y[r],
            s = y[r + 1],
            w = y[r + 2],
            x = y[r + 3];
          (p[t] = o * n + u * s + l * w),
            (p[t + 1] = i * n + c * s + d * w),
            (p[t + 2] = a * n + f * s + h * w),
            (p[t + 3] = x);
        }
      }
      function T(e, t, r) {
        const n = Math.min(e.count, t.count),
          s = e.typedBuffer,
          o = e.typedBufferStride,
          i = t.typedBuffer,
          a = t.typedBufferStride;
        for (let e = 0; e < n; e++) {
          const t = e * o,
            n = e * a;
          (s[t] = r * i[n]),
            (s[t + 1] = r * i[n + 1]),
            (s[t + 2] = r * i[n + 2]),
            (s[t + 3] = r * i[n + 3]);
        }
      }
      function C(e, t, r) {
        const n = Math.min(e.count, t.count),
          s = e.typedBuffer,
          o = e.typedBufferStride,
          i = t.typedBuffer,
          a = t.typedBufferStride;
        for (let e = 0; e < n; e++) {
          const t = e * o,
            n = e * a;
          (s[t] = i[n] >> r),
            (s[t + 1] = i[n + 1] >> r),
            (s[t + 2] = i[n + 2] >> r),
            (s[t + 3] = i[n + 3] >> r);
        }
      }
      function O(e, t) {
        const r = e.count;
        t || (t = new e.TypedArrayConstructor(r));
        for (let n = 0; n < r; n++) t[n] = e.get(n);
        return t;
      }
      function S(e, t, r) {
        const n = e.typedBuffer,
          o = e.typedBufferStride,
          i = t.typedBuffer,
          a = t.typedBufferStride,
          u = r ? r.count : t.count;
        let c = (r && r.dstIndex ? r.dstIndex : 0) * o,
          f = (r && r.srcIndex ? r.srcIndex : 0) * a;
        if ((0, s.i)(t.elementType)) {
          const e = (0, s.m)(t.elementType);
          if ((0, s.a)(t.elementType))
            for (let t = 0; t < u; ++t)
              (n[c] = Math.max(i[f] / e, -1)),
                (n[c + 1] = Math.max(i[f + 1] / e, -1)),
                (c += o),
                (f += a);
          else
            for (let t = 0; t < u; ++t)
              (n[c] = i[f] / e), (n[c + 1] = i[f + 1] / e), (c += o), (f += a);
        } else
          !(function (e, t, r) {
            const n = e.typedBuffer,
              s = e.typedBufferStride,
              o = t.typedBuffer,
              i = t.typedBufferStride,
              a = r ? r.count : t.count;
            let u = (r && r.dstIndex ? r.dstIndex : 0) * s,
              c = (r && r.srcIndex ? r.srcIndex : 0) * i;
            for (let e = 0; e < a; ++e) (n[u] = o[c]), (n[u + 1] = o[c + 1]), (u += s), (c += i);
          })(e, t, r);
        return e;
      }
      function v(e, t, r, n) {
        var s, o;
        const i = e.typedBuffer,
          a = e.typedBufferStride,
          u = null != (s = null == n ? void 0 : n.count) ? s : e.count;
        let c = (null != (o = null == n ? void 0 : n.dstIndex) ? o : 0) * a;
        for (let e = 0; e < u; ++e) (i[c] = t), (i[c + 1] = r), (c += a);
      }
      function U(e, t, r) {
        const n = e.typedBuffer,
          s = e.typedBufferStride,
          o = t.typedBuffer,
          i = t.typedBufferStride,
          a = r ? r.count : t.count;
        let u = (r && r.dstIndex ? r.dstIndex : 0) * s,
          c = (r && r.srcIndex ? r.srcIndex : 0) * i;
        for (let e = 0; e < a; ++e)
          (n[u] = o[c]),
            (n[u + 1] = o[c + 1]),
            (n[u + 2] = o[c + 2]),
            (n[u + 3] = o[c + 3]),
            (u += s),
            (c += i);
      }
      function I(e, t, r, n, s, o) {
        var i, a;
        const u = e.typedBuffer,
          c = e.typedBufferStride,
          f = null != (i = null == o ? void 0 : o.count) ? i : e.count;
        let l = (null != (a = null == o ? void 0 : o.dstIndex) ? a : 0) * c;
        for (let e = 0; e < f; ++e)
          (u[l] = t), (u[l + 1] = r), (u[l + 2] = n), (u[l + 3] = s), (l += c);
      }
      function A(e, t) {
        return new e(new ArrayBuffer(t * e.ElementCount * (0, s.e)(e.ElementType)));
      }
      class B {
        constructor(e) {
          this.streamDataRequester = e;
        }
        async loadJSON(e, t) {
          return this.load('json', e, t);
        }
        async loadBinary(e, t) {
          return (0, f.HK)(e) ? ((0, c.k_)(t), (0, f.AH)(e)) : this.load('binary', e, t);
        }
        async loadImage(e, t) {
          return this.load('image', e, t);
        }
        async load(e, t, r) {
          if ((0, u.b)(this.streamDataRequester))
            return (await (0, o.default)(t, { responseType: R[e] })).data;
          const n = await (0, i.r)(this.streamDataRequester.request(t, e, r));
          if (!0 === n.ok) return n.value;
          throw ((0, c.r9)(n.error), new a.Z('', `Request for resource failed: ${n.error}`));
        }
      }
      const R = { image: 'image', binary: 'array-buffer', json: 'json' },
        M = d.L.getLogger('esri.views.3d.glTF');
      class N {
        constructor(e) {
          (this.data = e),
            (this.offset4 = 0),
            (this.dataUint32 = new Uint32Array(this.data, 0, Math.floor(this.data.byteLength / 4)));
        }
        readUint32() {
          const e = this.offset4;
          return (this.offset4 += 1), this.dataUint32[e];
        }
        readUint8Array(e) {
          const t = 4 * this.offset4;
          return (this.offset4 += e / 4), new Uint8Array(this.data, t, e);
        }
        remainingBytes() {
          return this.data.byteLength - 4 * this.offset4;
        }
      }
      const E = { baseColorFactor: [1, 1, 1, 1], metallicFactor: 1, roughnessFactor: 1 },
        L = {
          pbrMetallicRoughness: E,
          emissiveFactor: [0, 0, 0],
          alphaMode: 'OPAQUE',
          alphaCutoff: 0.5,
          doubleSided: !1,
        },
        P = { ESRI_externalColorMixMode: 'tint' },
        F = (e = {}) => {
          const t = { ...E, ...e.pbrMetallicRoughness },
            r = (function (e) {
              switch (e.ESRI_externalColorMixMode) {
                case 'multiply':
                case 'tint':
                case 'ignore':
                case 'replace':
                  break;
                default:
                  (0, h.n)(e.ESRI_externalColorMixMode), (e.ESRI_externalColorMixMode = 'tint');
              }
              return e;
            })({ ...P, ...e.extras });
          return { ...L, ...e, pbrMetallicRoughness: t, extras: r };
        },
        _ = { magFilter: 9729, minFilter: 9987, wrapS: 10497, wrapT: 10497 },
        D = 1179937895;
      class j {
        constructor(e, t, r, n, s) {
          (this.context = e),
            (this.errorContext = t),
            (this.uri = r),
            (this.json = n),
            (this.glbBuffer = s),
            (this.bufferCache = new Map()),
            (this.textureCache = new Map()),
            (this.materialCache = new Map()),
            (this.nodeParentMap = new Map()),
            (this.nodeTransformCache = new Map()),
            (this.baseUri = (function (e) {
              let t, r;
              return (
                e.replace(/^(.*\/)?([^/]*)$/, (e, n, s) => ((t = n || ''), (r = s || ''), '')),
                { dirPart: t, filePart: r }
              );
            })(this.uri).dirPart),
            this.checkVersionSupported(),
            this.checkRequiredExtensionsSupported(),
            t.errorUnsupportedIf(null == n.scenes, 'Scenes must be defined.'),
            t.errorUnsupportedIf(null == n.meshes, 'Meshes must be defined'),
            t.errorUnsupportedIf(null == n.nodes, 'Nodes must be defined.'),
            this.computeNodeParents();
        }
        static async load(e, t, r, n) {
          if ((0, f.HK)(r)) {
            const n = (0, f.sJ)(r);
            if ('model/gltf-binary' !== n.mediaType)
              try {
                const s = JSON.parse(n.isBase64 ? atob(n.data) : n.data);
                return new j(e, t, r, s);
              } catch {}
            const s = (0, f.AH)(r);
            if (j.isGLBData(s)) return this.fromGLBData(e, t, r, s);
          }
          if (r.endsWith('.gltf')) {
            const s = await e.loadJSON(r, n);
            return new j(e, t, r, s);
          }
          const s = await e.loadBinary(r, n);
          if (j.isGLBData(s)) return this.fromGLBData(e, t, r, s);
          const o = await e.loadJSON(r, n);
          return new j(e, t, r, o);
        }
        static isGLBData(e) {
          const t = new N(e);
          return t.remainingBytes() >= 4 && t.readUint32() === D;
        }
        static async fromGLBData(e, t, r, n) {
          const s = await j.parseGLBData(t, n);
          return new j(e, t, r, s.json, s.binaryData);
        }
        static async parseGLBData(e, t) {
          const r = new N(t);
          e.assert(r.remainingBytes() >= 12, 'GLB binary data is insufficiently large.');
          const n = r.readUint32(),
            s = r.readUint32(),
            o = r.readUint32();
          e.assert(n === D, 'Magic first 4 bytes do not fit to expected GLB value.'),
            e.assert(t.byteLength >= o, 'GLB binary data is smaller than header specifies.'),
            e.errorUnsupportedIf(
              2 !== s,
              'An unsupported GLB container version was detected. Only version 2 is supported.',
            );
          let i,
            a,
            u = 0;
          for (; r.remainingBytes() >= 8; ) {
            const t = r.readUint32(),
              n = r.readUint32();
            0 === u
              ? (e.assert(1313821514 === n, 'First GLB chunk must be JSON.'),
                e.assert(t >= 0, 'No JSON data found.'),
                (i = await q(r.readUint8Array(t))))
              : 1 === u
              ? (e.errorUnsupportedIf(5130562 !== n, 'Second GLB chunk expected to be BIN.'),
                (a = r.readUint8Array(t)))
              : e.warnUnsupported('More than 2 GLB chunks detected. Skipping.'),
              (u += 1);
          }
          return i || e.error('No GLB JSON chunk detected.'), { json: i, binaryData: a };
        }
        async getBuffer(e, t) {
          const r = this.json.buffers[e],
            n = this.errorContext;
          if (null == r.uri)
            return n.assert(null != this.glbBuffer, 'GLB buffer not present'), this.glbBuffer;
          let s = this.bufferCache.get(e);
          if (!s) {
            const o = await this.context.loadBinary(this.resolveUri(r.uri), t);
            (s = new Uint8Array(o)),
              this.bufferCache.set(e, s),
              n.assert(s.byteLength === r.byteLength, 'Buffer byte lengths should match.');
          }
          return s;
        }
        async getAccessor(e, t) {
          const r = this.json.accessors[e],
            n = this.errorContext;
          n.errorUnsupportedIf(
            null == r.bufferView,
            'Some accessor does not specify a bufferView.',
          ),
            n.errorUnsupportedIf(
              r.type in ['MAT2', 'MAT3', 'MAT4'],
              `AttributeType ${r.type} is not supported`,
            );
          const s = this.json.bufferViews[r.bufferView],
            o = await this.getBuffer(s.buffer, t),
            i = $[r.type],
            a = H[r.componentType],
            u = i * a,
            c = s.byteStride || u;
          return {
            raw: o.buffer,
            byteStride: c,
            byteOffset: o.byteOffset + (s.byteOffset || 0) + (r.byteOffset || 0),
            entryCount: r.count,
            isDenselyPacked: c === u,
            componentCount: i,
            componentByteSize: a,
            componentType: r.componentType,
            min: r.min,
            max: r.max,
            normalized: !!r.normalized,
          };
        }
        async getIndexData(e, t) {
          if (null == e.indices) return null;
          const r = await this.getAccessor(e.indices, t);
          if (r.isDenselyPacked)
            switch (r.componentType) {
              case 5121:
                return new Uint8Array(r.raw, r.byteOffset, r.entryCount);
              case 5123:
                return new Uint16Array(r.raw, r.byteOffset, r.entryCount);
              case 5125:
                return new Uint32Array(r.raw, r.byteOffset, r.entryCount);
            }
          else
            switch (r.componentType) {
              case 5121:
                return O(this.wrapAccessor(w.h, r));
              case 5123:
                return O(this.wrapAccessor(w.k, r));
              case 5125:
                return O(this.wrapAccessor(w.j, r));
            }
        }
        async getPositionData(e, t) {
          const r = this.errorContext;
          r.errorUnsupportedIf(null == e.attributes.POSITION, 'No POSITION vertex data found.');
          const n = await this.getAccessor(e.attributes.POSITION, t);
          return (
            r.errorUnsupportedIf(
              5126 !== n.componentType,
              'Expected type FLOAT for POSITION vertex attribute, but found ' + z[n.componentType],
            ),
            r.errorUnsupportedIf(
              3 !== n.componentCount,
              'POSITION vertex attribute must have 3 components, but found ' +
                n.componentCount.toFixed(),
            ),
            this.wrapAccessor(w.a, n)
          );
        }
        async getNormalData(e, t) {
          const r = this.errorContext;
          r.assert(null != e.attributes.NORMAL, 'No NORMAL vertex data found.');
          const n = await this.getAccessor(e.attributes.NORMAL, t);
          return (
            r.errorUnsupportedIf(
              5126 !== n.componentType,
              'Expected type FLOAT for NORMAL vertex attribute, but found ' + z[n.componentType],
            ),
            r.errorUnsupportedIf(
              3 !== n.componentCount,
              'NORMAL vertex attribute must have 3 components, but found ' +
                n.componentCount.toFixed(),
            ),
            this.wrapAccessor(w.a, n)
          );
        }
        async getTangentData(e, t) {
          const r = this.errorContext;
          r.assert(null != e.attributes.TANGENT, 'No TANGENT vertex data found.');
          const n = await this.getAccessor(e.attributes.TANGENT, t);
          return (
            r.errorUnsupportedIf(
              5126 !== n.componentType,
              'Expected type FLOAT for TANGENT vertex attribute, but found ' + z[n.componentType],
            ),
            r.errorUnsupportedIf(
              4 !== n.componentCount,
              'TANGENT vertex attribute must have 4 components, but found ' +
                n.componentCount.toFixed(),
            ),
            new w.g(n.raw, n.byteOffset, n.byteStride, n.byteOffset + n.byteStride * n.entryCount)
          );
        }
        async getTextureCoordinates(e, t) {
          const r = this.errorContext;
          r.assert(null != e.attributes.TEXCOORD_0, 'No TEXCOORD_0 vertex data found.');
          const n = await this.getAccessor(e.attributes.TEXCOORD_0, t);
          return (
            r.errorUnsupportedIf(
              2 !== n.componentCount,
              'TEXCOORD_0 vertex attribute must have 2 components, but found ' +
                n.componentCount.toFixed(),
            ),
            5126 === n.componentType
              ? this.wrapAccessor(w.e, n)
              : (r.errorUnsupportedIf(
                  !n.normalized,
                  'Integer component types are only supported for a normalized accessor for TEXCOORD_0.',
                ),
                (function (e) {
                  switch (e.componentType) {
                    case 5120:
                      return new w.s(
                        e.raw,
                        e.byteOffset,
                        e.byteStride,
                        e.byteOffset + e.byteStride * e.entryCount,
                      );
                    case 5121:
                      return new w.r(
                        e.raw,
                        e.byteOffset,
                        e.byteStride,
                        e.byteOffset + e.byteStride * e.entryCount,
                      );
                    case 5122:
                      return new w.q(
                        e.raw,
                        e.byteOffset,
                        e.byteStride,
                        e.byteOffset + e.byteStride * e.entryCount,
                      );
                    case 5123:
                      return new w.p(
                        e.raw,
                        e.byteOffset,
                        e.byteStride,
                        e.byteOffset + e.byteStride * e.entryCount,
                      );
                    case 5125:
                      return new w.o(
                        e.raw,
                        e.byteOffset,
                        e.byteStride,
                        e.byteOffset + e.byteStride * e.entryCount,
                      );
                    case 5126:
                      return new w.e(
                        e.raw,
                        e.byteOffset,
                        e.byteStride,
                        e.byteOffset + e.byteStride * e.entryCount,
                      );
                    default:
                      return void (0, h.n)(e.componentType);
                  }
                })(n))
          );
        }
        async getVertexColors(e, t) {
          const r = this.errorContext;
          r.assert(null != e.attributes.COLOR_0, 'No COLOR_0 vertex data found.');
          const n = await this.getAccessor(e.attributes.COLOR_0, t);
          if (
            (r.errorUnsupportedIf(
              4 !== n.componentCount && 3 !== n.componentCount,
              'COLOR_0 attribute must have 3 or 4 components, but found ' +
                n.componentCount.toFixed(),
            ),
            4 === n.componentCount)
          ) {
            if (5126 === n.componentType) return this.wrapAccessor(w.g, n);
            if (5121 === n.componentType) return this.wrapAccessor(w.b, n);
            if (5123 === n.componentType) return this.wrapAccessor(w.l, n);
          } else if (3 === n.componentCount) {
            if (5126 === n.componentType) return this.wrapAccessor(w.a, n);
            if (5121 === n.componentType) return this.wrapAccessor(w.m, n);
            if (5123 === n.componentType) return this.wrapAccessor(w.n, n);
          }
          r.errorUnsupported(
            'Unsupported component type for COLOR_0 attribute: ' + z[n.componentType],
          );
        }
        hasPositions(e) {
          return void 0 !== e.attributes.POSITION;
        }
        hasNormals(e) {
          return void 0 !== e.attributes.NORMAL;
        }
        hasVertexColors(e) {
          return void 0 !== e.attributes.COLOR_0;
        }
        hasTextureCoordinates(e) {
          return void 0 !== e.attributes.TEXCOORD_0;
        }
        hasTangents(e) {
          return void 0 !== e.attributes.TANGENT;
        }
        async getMaterial(e, t, r) {
          const n = this.errorContext;
          let s = this.materialCache.get(e.material);
          if (!s) {
            const o = null != e.material ? F(this.json.materials[e.material]) : F(),
              i = o.pbrMetallicRoughness,
              a = this.hasVertexColors(e);
            let u, c, f, l, d;
            i.baseColorTexture &&
              (n.errorUnsupportedIf(
                0 !== (i.baseColorTexture.texCoord || 0),
                'Only TEXCOORD with index 0 is supported.',
              ),
              (u = await this.getTexture(i.baseColorTexture.index, t))),
              o.normalTexture &&
                (0 !== (o.normalTexture.texCoord || 0)
                  ? n.warnUnsupported(
                      'Only TEXCOORD with index 0 is supported for the normal map texture.',
                    )
                  : (c = await this.getTexture(o.normalTexture.index, t))),
              o.occlusionTexture &&
                r &&
                (0 !== (o.occlusionTexture.texCoord || 0)
                  ? n.warnUnsupported(
                      'Only TEXCOORD with index 0 is supported for the occlusion texture.',
                    )
                  : (f = await this.getTexture(o.occlusionTexture.index, t))),
              o.emissiveTexture &&
                r &&
                (0 !== (o.emissiveTexture.texCoord || 0)
                  ? n.warnUnsupported(
                      'Only TEXCOORD with index 0 is supported for the emissive texture.',
                    )
                  : (l = await this.getTexture(o.emissiveTexture.index, t))),
              i.metallicRoughnessTexture &&
                r &&
                (0 !== (i.metallicRoughnessTexture.texCoord || 0)
                  ? n.warnUnsupported(
                      'Only TEXCOORD with index 0 is supported for the metallicRoughness texture.',
                    )
                  : (d = await this.getTexture(i.metallicRoughnessTexture.index, t)));
            const h = null != e.material ? e.material : -1;
            s = {
              alphaMode: o.alphaMode,
              alphaCutoff: o.alphaCutoff,
              color: i.baseColorFactor,
              doubleSided: !!o.doubleSided,
              colorTexture: u,
              normalTexture: c,
              name: o.name,
              id: h,
              occlusionTexture: f,
              emissiveTexture: l,
              emissiveFactor: o.emissiveFactor,
              metallicFactor: i.metallicFactor,
              roughnessFactor: i.roughnessFactor,
              metallicRoughnessTexture: d,
              vertexColors: a,
              ESRI_externalColorMixMode: o.extras.ESRI_externalColorMixMode,
            };
          }
          return s;
        }
        async getTexture(e, t) {
          const r = this.errorContext,
            n = this.json.textures[e],
            s = ((e) => ({ ..._, ...e }))(null != n.sampler ? this.json.samplers[n.sampler] : {});
          r.errorUnsupportedIf(null == n.source, 'Source is expected to be defined for a texture.');
          const o = this.json.images[n.source];
          let i = this.textureCache.get(e);
          if (!i) {
            let n;
            if (o.uri) n = await this.context.loadImage(this.resolveUri(o.uri), t);
            else {
              r.errorUnsupportedIf(null == o.bufferView, 'Image bufferView must be defined.'),
                r.errorUnsupportedIf(null == o.mimeType, 'Image mimeType must be defined.');
              const e = this.json.bufferViews[o.bufferView],
                s = await this.getBuffer(e.buffer, t);
              r.errorUnsupportedIf(
                null != e.byteStride,
                'byteStride not supported for image buffer',
              ),
                (n = await (async function (e, t) {
                  return new Promise((r, n) => {
                    const s = new Blob([e], { type: t }),
                      o = URL.createObjectURL(s),
                      i = new Image();
                    i.addEventListener('load', () => {
                      URL.revokeObjectURL(o),
                        'decode' in i
                          ? i.decode().then(
                              () => r(i),
                              () => r(i),
                            )
                          : r(i);
                    }),
                      i.addEventListener('error', (e) => {
                        URL.revokeObjectURL(o), n(e);
                      }),
                      (i.src = o);
                  });
                })(
                  new Uint8Array(s.buffer, s.byteOffset + (e.byteOffset || 0), e.byteLength),
                  o.mimeType,
                ));
            }
            const a = (e) => 33071 === e || 33648 === e || 10497 === e,
              u = (e) => (
                r.error(`Unexpected TextureSampler WrapMode: ${e}. Using default REPEAT(10497).`),
                10497
              );
            (i = {
              data: n,
              wrapS: a(s.wrapS) ? s.wrapS : u(s.wrapS),
              wrapT: a(s.wrapT) ? s.wrapT : u(s.wrapT),
              minFilter: s.minFilter,
              name: o.name,
              id: e,
            }),
              this.textureCache.set(e, i);
          }
          return i;
        }
        getNodeTransform(e) {
          if (void 0 === e) return G;
          let t = this.nodeTransformCache.get(e);
          if (!t) {
            const r = this.getNodeTransform(this.getNodeParent(e)),
              n = this.json.nodes[e];
            n.matrix
              ? (t = (0, m.m)((0, l.c)(), r, n.matrix))
              : n.translation || n.rotation || n.scale
              ? ((t = (0, l.b)(r)),
                n.translation && (0, m.t)(t, t, n.translation),
                n.rotation && ((V[3] = (0, y.g)(V, n.rotation)), (0, m.b)(t, t, V[3], V)),
                n.scale && (0, m.s)(t, t, n.scale))
              : (t = r),
              this.nodeTransformCache.set(e, t);
          }
          return t;
        }
        wrapAccessor(e, t) {
          return new e(
            t.raw,
            t.byteOffset,
            t.byteStride,
            t.byteOffset +
              t.byteStride * (t.entryCount - 1) +
              t.componentByteSize * t.componentCount,
          );
        }
        resolveUri(e) {
          return (0, f.hF)(e, this.baseUri);
        }
        getNodeParent(e) {
          return this.nodeParentMap.get(e);
        }
        checkVersionSupported() {
          const e = p.V.parse(this.json.asset.version, 'glTF');
          k.validate(e);
        }
        checkRequiredExtensionsSupported() {
          const e = this.json,
            t = this.errorContext;
          e.extensionsRequired &&
            0 !== e.extensionsRequired.length &&
            t.errorUnsupported(
              'gltf loader was not able to load unsupported feature. Required extensions: ' +
                e.extensionsRequired.join(', '),
            );
        }
        computeNodeParents() {
          this.json.nodes.forEach((e, t) => {
            e.children &&
              e.children.forEach((e) => {
                this.nodeParentMap.set(e, t);
              });
          });
        }
      }
      const k = new p.V(2, 0, 'glTF'),
        G = (0, m.n)((0, l.c)(), Math.PI / 2),
        V = (0, b.d)(),
        $ = { SCALAR: 1, VEC2: 2, VEC3: 3, VEC4: 4 },
        H = { 5120: 1, 5121: 1, 5122: 2, 5123: 2, 5126: 4, 5125: 4 };
      async function q(e) {
        return new Promise((t, r) => {
          const n = new Blob([e]),
            s = new FileReader();
          (s.onload = () => {
            const e = s.result;
            t(JSON.parse(e));
          }),
            (s.onerror = (e) => {
              r(e);
            }),
            s.readAsText(n);
        });
      }
      const z = {
        5120: 'BYTE',
        5121: 'UNSIGNED_BYTE',
        5122: 'SHORT',
        5123: 'UNSIGNED_SHORT',
        5125: 'UNSIGNED_INT',
        5126: 'FLOAT',
      };
      let X = 0;
      async function J(e, t, r = {}, n = !0) {
        const s = await j.load(e, W, t, r),
          o = 'gltf_' + X++,
          i = { lods: [], materials: new Map(), textures: new Map(), meta: Z(s) },
          a = !(!s.json.asset.extras || 'symbolResource' !== s.json.asset.extras.ESRI_type);
        return (
          await (async function (e, t) {
            const r = e.json,
              n = r.scenes[r.scene || 0].nodes,
              s = n.length > 1;
            for (const e of n) {
              const t = r.nodes[e],
                n = [o(e, 0)];
              if (Q(t) && !s) {
                const e = t.extensions.MSFT_lod.ids;
                n.push(...e.map((e, t) => o(e, t + 1)));
              }
              await Promise.all(n);
            }
            async function o(n, s) {
              const i = r.nodes[n],
                a = e.getNodeTransform(n);
              if (
                (W.warnUnsupportedIf(null != i.weights, 'Morph targets are not supported.'),
                null != i.mesh)
              ) {
                const e = r.meshes[i.mesh];
                for (const r of e.primitives) await t(r, a, s, e.name);
              }
              for (const e of i.children || []) await o(e, s);
            }
          })(s, async (e, t, a, c) => {
            const f = void 0 !== e.mode ? e.mode : 4,
              d = 4 === f || 5 === f || 6 === f ? f : null;
            if ((0, u.b)(d))
              return void W.warnUnsupported(
                'Unsupported primitive mode (' + ee[f] + '). Skipping primitive.',
              );
            if (!s.hasPositions(e))
              return void W.warn('Skipping primitive without POSITION vertex attribute.');
            const h = await s.getMaterial(e, r, n),
              p = {
                transform: (0, l.b)(t),
                attributes: {
                  position: await s.getPositionData(e, r),
                  normal: null,
                  texCoord0: null,
                  color: null,
                  tangent: null,
                },
                indices: await s.getIndexData(e, r),
                primitiveType: d,
                material: K(i, h, o),
              };
            s.hasNormals(e) && (p.attributes.normal = await s.getNormalData(e, r)),
              s.hasTangents(e) && (p.attributes.tangent = await s.getTangentData(e, r)),
              s.hasTextureCoordinates(e) &&
                (p.attributes.texCoord0 = await s.getTextureCoordinates(e, r)),
              s.hasVertexColors(e) && (p.attributes.color = await s.getVertexColors(e, r));
            let m = null;
            (0, u.i)(i.meta) &&
              (0, u.i)(i.meta.ESRI_lod) &&
              'screenSpaceRadius' === i.meta.ESRI_lod.metric &&
              (m = i.meta.ESRI_lod.thresholds[a]),
              (i.lods[a] = i.lods[a] || { parts: [], name: c, lodThreshold: m }),
              i.lods[a].parts.push(p);
          }),
          { model: i, meta: { isEsriSymbolResource: a, uri: s.uri }, customMeta: {} }
        );
      }
      function Z(e) {
        const t = e.json;
        let r = null;
        return (
          t.nodes.forEach((e) => {
            const t = e.extras;
            (0, u.i)(t) && (t.ESRI_proxyEllipsoid || t.ESRI_lod) && (r = t);
          }),
          r
        );
      }
      function Q(e) {
        return e.extensions && e.extensions.MSFT_lod && Array.isArray(e.extensions.MSFT_lod.ids);
      }
      function K(e, t, r) {
        const n = (t) => {
            const n = `${r}_tex_${t && t.id}${t && t.name ? '_' + t.name : ''}`;
            if (t && !e.textures.has(n)) {
              const r = (function (e, t = {}) {
                return {
                  data: e,
                  parameters: {
                    wrap: { s: 10497, t: 10497, ...t.wrap },
                    noUnpackFlip: !0,
                    mipmap: !1,
                    ...t,
                  },
                };
              })(t.data, {
                wrap: { s: t.wrapS, t: t.wrapT },
                mipmap: Y.some((e) => e === t.minFilter),
                noUnpackFlip: !0,
              });
              e.textures.set(n, r);
            }
            return n;
          },
          s = `${r}_mat_${t.id}_${t.name}`;
        if (!e.materials.has(s)) {
          const r = (function (e = {}) {
            return {
              color: [1, 1, 1],
              opacity: 1,
              alphaMode: 'OPAQUE',
              alphaCutoff: 0.5,
              doubleSided: !1,
              castShadows: !0,
              receiveShadows: !0,
              receiveAmbientOcclustion: !0,
              textureColor: null,
              textureNormal: null,
              textureOcclusion: null,
              textureEmissive: null,
              textureMetallicRoughness: null,
              emissiveFactor: [0, 0, 0],
              metallicFactor: 1,
              roughnessFactor: 1,
              colorMixMode: 'multiply',
              ...e,
            };
          })({
            color: [t.color[0], t.color[1], t.color[2]],
            opacity: t.color[3],
            alphaMode: t.alphaMode,
            alphaCutoff: t.alphaCutoff,
            doubleSided: t.doubleSided,
            colorMixMode: t.ESRI_externalColorMixMode,
            textureColor: t.colorTexture ? n(t.colorTexture) : void 0,
            textureNormal: t.normalTexture ? n(t.normalTexture) : void 0,
            textureOcclusion: t.occlusionTexture ? n(t.occlusionTexture) : void 0,
            textureEmissive: t.emissiveTexture ? n(t.emissiveTexture) : void 0,
            textureMetallicRoughness: t.metallicRoughnessTexture
              ? n(t.metallicRoughnessTexture)
              : void 0,
            emissiveFactor: [t.emissiveFactor[0], t.emissiveFactor[1], t.emissiveFactor[2]],
            metallicFactor: t.metallicFactor,
            roughnessFactor: t.roughnessFactor,
          });
          e.materials.set(s, r);
        }
        return s;
      }
      const W = new (class {
          error(e) {
            throw new a.Z('gltf-loader-error', e);
          }
          errorUnsupported(e) {
            throw new a.Z('gltf-loader-unsupported-feature', e);
          }
          errorUnsupportedIf(e, t) {
            e && this.errorUnsupported(t);
          }
          assert(e, t) {
            e || this.error(t);
          }
          warn(e) {
            M.warn(e);
          }
          warnUnsupported(e) {
            this.warn('[Unsupported Feature] ' + e);
          }
          warnUnsupportedIf(e, t) {
            e && this.warnUnsupported(t);
          }
        })(),
        Y = [9987, 9985],
        ee = [
          'POINTS',
          'LINES',
          'LINE_LOOP',
          'LINE_STRIP',
          'TRIANGLES',
          'TRIANGLE_STRIP',
          'TRIANGLE_FAN',
        ];
      function te(e, t = x.g) {
        return 'number' == typeof e ? t(e) : (0, u.q)(e) || (0, u.y)(e) ? new Uint32Array(e) : e;
      }
      function re(e) {
        const t = 'number' == typeof e ? e : e.length;
        if (t < 3) return new Uint16Array(0);
        const r = t - 2,
          n = r <= 65536 ? new Uint16Array(3 * r) : new Uint32Array(3 * r);
        if ('number' == typeof e) {
          let e = 0;
          for (let t = 0; t < r; t += 1)
            t % 2 == 0
              ? ((n[e++] = t), (n[e++] = t + 1), (n[e++] = t + 2))
              : ((n[e++] = t + 1), (n[e++] = t), (n[e++] = t + 2));
        } else {
          let t = 0;
          for (let s = 0; s < r; s += 1)
            if (s % 2 == 0) {
              const r = e[s],
                o = e[s + 1],
                i = e[s + 2];
              (n[t++] = r), (n[t++] = o), (n[t++] = i);
            } else {
              const r = e[s + 1],
                o = e[s],
                i = e[s + 2];
              (n[t++] = r), (n[t++] = o), (n[t++] = i);
            }
        }
        return n;
      }
      function ne(e) {
        const t = 'number' == typeof e ? e : e.length;
        if (t < 3) return new Uint16Array(0);
        const r = t - 2,
          n = r <= 65536 ? new Uint16Array(3 * r) : new Uint32Array(3 * r);
        if ('number' == typeof e) {
          let e = 0;
          for (let t = 0; t < r; ++t) (n[e++] = 0), (n[e++] = t + 1), (n[e++] = t + 2);
          return n;
        }
        {
          const t = e[0];
          let s = e[1],
            o = 0;
          for (let i = 0; i < r; ++i) {
            const r = e[i + 2];
            (n[o++] = t), (n[o++] = s), (n[o++] = r), (s = r);
          }
          return n;
        }
      }
      const se = 2.1;
    },
    10738: (e, t, r) => {
      'use strict';
      r.d(t, { V: () => s });
      var n = r(60991);
      class s {
        constructor(e, t, r = '') {
          (this.major = e), (this.minor = t), (this._context = r);
        }
        lessThan(e, t) {
          return this.major < e || (e === this.major && this.minor < t);
        }
        since(e, t) {
          return !this.lessThan(e, t);
        }
        validate(e) {
          if (this.major !== e.major) {
            const t = this._context && this._context + ':',
              r = this._context && this._context + ' ';
            throw new n.Z(
              t + 'unsupported-version',
              `Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,
              { version: e },
            );
          }
        }
        clone() {
          return new s(this.major, this.minor, this._context);
        }
        static parse(e, t = '') {
          const [r, o] = e.split('.'),
            i = /^\s*\d+\s*$/;
          if (!r || !r.match || !r.match(i))
            throw new n.Z(
              (t && t + ':') + 'invalid-version',
              "Expected major version to be a number, but got '${version}'",
              { version: e },
            );
          if (!o || !o.match || !o.match(i))
            throw new n.Z(
              (t && t + ':') + 'invalid-version',
              "Expected minor version to be a number, but got '${version}'",
              { version: e },
            );
          const a = parseInt(r, 10),
            u = parseInt(o, 10);
          return new s(a, u, t);
        }
      }
    },
    14049: (e, t, r) => {
      'use strict';
      r.d(t, { a: () => f, b: () => l, d: () => c, g: () => u });
      var n = r(82426),
        s = r(50766);
      let o = (() => {
        const e = new Uint32Array(131072);
        for (let t = 0; t < e.length; ++t) e[t] = t;
        return e;
      })();
      const i = new Uint16Array([0]),
        a = (() => {
          const e = new Uint16Array(65536);
          for (let t = 0; t < e.length; ++t) e[t] = t;
          return e;
        })();
      function u(e) {
        if (1 === e) return i;
        if (e < a.length) return new Uint16Array(a.buffer, 0, e);
        if (e > o.length) {
          const t = Math.max(2 * o.length, e);
          o = new Uint32Array(t);
          for (let e = 0; e < o.length; e++) o[e] = e;
        }
        return new Uint32Array(o.buffer, 0, e);
      }
      function c(e) {
        if (1 === e) return new Uint16Array(i);
        if (e < a.length) return new Uint16Array(a.slice(0, e));
        if (e > o.length) {
          const t = new Uint32Array(e);
          for (let e = 0; e < t.length; e++) t[e] = e;
          return t;
        }
        return new Uint32Array(o.slice(0, e));
      }
      function f(e, t, r) {
        if (!e) return !1;
        const { size: o, data: i } = e;
        (0, n.e)(r, 0, 0, 0), (0, n.e)(m, 0, 0, 0);
        let a = 0,
          u = 0;
        for (let e = 0; e < t.length - 2; e += 3) {
          const c = t[e + 0] * o,
            f = t[e + 1] * o,
            l = t[e + 2] * o;
          (0, n.e)(d, i[c + 0], i[c + 1], i[c + 2]),
            (0, n.e)(h, i[f + 0], i[f + 1], i[f + 2]),
            (0, n.e)(p, i[l + 0], i[l + 1], i[l + 2]);
          const y = (0, s.b)(d, h, p);
          y
            ? ((0, n.g)(d, d, h),
              (0, n.g)(d, d, p),
              (0, n.f)(d, d, (1 / 3) * y),
              (0, n.g)(r, r, d),
              (a += y))
            : ((0, n.g)(m, m, d), (0, n.g)(m, m, h), (0, n.g)(m, m, p), (u += 3));
        }
        return !(
          (0 === u && 0 === a) ||
          (0 !== a ? ((0, n.f)(r, r, 1 / a), 0) : 0 === u || ((0, n.f)(r, m, 1 / u), 0))
        );
      }
      function l(e, t, r) {
        if (!e || !t) return !1;
        const { size: s, data: o } = e;
        (0, n.e)(r, 0, 0, 0);
        let i = -1,
          a = 0;
        for (let e = 0; e < t.length; e++) {
          const n = t[e] * s;
          i !== n && ((r[0] += o[n + 0]), (r[1] += o[n + 1]), (r[2] += o[n + 2]), a++), (i = n);
        }
        return a > 1 && (0, n.f)(r, r, 1 / a), a > 0;
      }
      const d = (0, n.b)(),
        h = (0, n.b)(),
        p = (0, n.b)(),
        m = (0, n.b)();
    },
    94446: (e, t, r) => {
      'use strict';
      r.d(t, { c: () => o });
      var n = r(82426),
        s = r(2484);
      function o(e) {
        return e
          ? { origin: (0, n.u)(e.origin), vector: (0, n.u)(e.vector) }
          : { origin: (0, n.b)(), vector: (0, n.b)() };
      }
      (0, n.b)(), (0, n.b)(), new s.O(() => ({ origin: null, vector: null }));
    },
    50766: (e, t, r) => {
      'use strict';
      r.d(t, { b: () => i });
      var n = r(2484),
        s = r(82426),
        o = r(94446);
      function i(e, t, r) {
        return (0, s.s)(a, t, e), (0, s.s)(u, r, e), (0, s.l)((0, s.a)(a, a, u)) / 2;
      }
      new n.O(o.c), new n.O(() => ({ p0: null, p1: null, p2: null }));
      const a = (0, s.b)(),
        u = (0, s.b)();
    },
    27726: (e, t, r) => {
      'use strict';
      function n(e) {
        switch (e) {
          case 'u8':
            return 1;
          case 'u16':
            return 2;
          case 'u32':
            return 4;
          case 'i8':
            return 1;
          case 'i16':
            return 2;
          case 'i32':
          case 'f32':
            return 4;
          case 'f64':
            return 8;
          default:
            return;
        }
      }
      function s(e) {
        switch (e) {
          case 'u8':
          case 'u16':
          case 'u32':
            return !1;
          case 'i8':
          case 'i16':
          case 'i32':
          case 'f32':
          case 'f64':
            return !0;
          default:
            return;
        }
      }
      function o(e) {
        switch (e) {
          case 'u8':
          case 'u16':
          case 'u32':
          case 'i8':
          case 'i16':
          case 'i32':
            return !0;
          case 'f32':
          case 'f64':
            return !1;
          default:
            return;
        }
      }
      function i(e) {
        switch (e) {
          case 'u8':
            return 255;
          case 'u16':
            return 65535;
          case 'u32':
            return 4294967295;
          case 'i8':
            return 127;
          case 'i16':
            return 32767;
          case 'i32':
            return 2147483647;
          case 'f32':
            return 3402823e32;
          case 'f64':
            return 179769e303;
          default:
            return;
        }
      }
      r.d(t, { a: () => s, e: () => n, i: () => o, m: () => i }), r(76506);
    },
    68681: (e, t, r) => {
      'use strict';
      function n() {
        return [0, 0, 0, 0];
      }
      function s(e, t, r, n) {
        return [e, t, r, n];
      }
      function o(e, t) {
        return new Float64Array(e, t, 4);
      }
      r.d(t, { a: () => n, c: () => o, f: () => s }), s(1, 1, 1, 1);
    },
    2484: (e, t, r) => {
      'use strict';
      r.d(t, { O: () => f, b: () => p, s: () => m });
      var n = r(76506),
        s = r(6906),
        o = r(45087),
        i = r(57532);
      function a(e, t) {
        return new Float64Array(e, t, 2);
      }
      var u = r(82426),
        c = r(68681);
      class f {
        constructor(e) {
          (this.allocator = e),
            (this.items = []),
            (this.itemsPtr = 0),
            (this.tickHandle = s.n.before(() => this.reset())),
            this.grow();
        }
        destroy() {
          this.tickHandle &&
            (this.tickHandle.remove(), (this.tickHandle = (0, n.n)(this.tickHandle))),
            (this.items = (0, n.n)(this.items));
        }
        get() {
          return (
            0 === this.itemsPtr && (0, s.n)(() => {}),
            this.itemsPtr === this.items.length && this.grow(),
            this.items[this.itemsPtr++]
          );
        }
        reset() {
          const e = Math.min(3 * Math.max(8, this.itemsPtr), this.itemsPtr + 3 * l);
          (this.items.length = Math.min(e, this.items.length)), (this.itemsPtr = 0);
        }
        grow() {
          for (let e = 0; e < Math.max(8, Math.min(this.items.length, l)); e++)
            this.items.push(this.allocator());
        }
      }
      const l = 1024;
      class d {
        constructor(e, t, r) {
          (this.itemByteSize = e),
            (this.itemCreate = t),
            (this.buffers = []),
            (this.items = []),
            (this.itemsPerBuffer = 0),
            (this.itemsPtr = 0),
            (this.itemsPerBuffer = Math.ceil(r / this.itemByteSize)),
            (this.tickHandle = s.n.before(() => this.reset()));
        }
        destroy() {
          this.tickHandle &&
            (this.tickHandle.remove(), (this.tickHandle = (0, n.n)(this.tickHandle))),
            (this.itemsPtr = 0),
            (this.items = (0, n.n)(this.items)),
            (this.buffers = (0, n.n)(this.buffers));
        }
        get() {
          0 === this.itemsPtr && (0, s.n)(() => {});
          const e = Math.floor(this.itemsPtr / this.itemsPerBuffer);
          for (; this.buffers.length <= e; ) {
            const e = new ArrayBuffer(this.itemsPerBuffer * this.itemByteSize);
            for (let t = 0; t < this.itemsPerBuffer; ++t)
              this.items.push(this.itemCreate(e, t * this.itemByteSize));
            this.buffers.push(e);
          }
          return this.items[this.itemsPtr++];
        }
        reset() {
          const e = 2 * (Math.floor(this.itemsPtr / this.itemsPerBuffer) + 1);
          for (; this.buffers.length > e; )
            this.buffers.pop(), (this.items.length = this.buffers.length * this.itemsPerBuffer);
          this.itemsPtr = 0;
        }
        static createVec2f64(e = h) {
          return new d(16, a, e);
        }
        static createVec3f64(e = h) {
          return new d(24, u.y, e);
        }
        static createVec4f64(e = h) {
          return new d(32, c.c, e);
        }
        static createMat3f64(e = h) {
          return new d(72, o.a, e);
        }
        static createMat4f64(e = h) {
          return new d(128, i.a, e);
        }
        static createQuatf64(e = h) {
          return new d(32, o.b, e);
        }
        get test() {
          return { size: this.buffers.length * this.itemsPerBuffer * this.itemByteSize };
        }
      }
      const h = 4096,
        p = (d.createVec2f64(), d.createVec3f64());
      d.createVec4f64(), d.createMat3f64();
      const m = d.createMat4f64();
      d.createQuatf64();
    },
  },
]);
