(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [1348],
  {
    21348: (e, t, s) => {
      'use strict';
      s.r(t), s.d(t, { default: () => S });
      var r = s(29768),
        a = (s(74569), s(23761)),
        u = s(82058),
        i = s(93314),
        n = s(60991),
        o = s(76506),
        l = s(57251),
        d = s(22739),
        c = s(71552),
        p = s(32101),
        h = s(34250),
        y = (s(91306), s(92143), s(17533)),
        m = s(21801),
        R = s(32422),
        F = s(4571),
        f = s(91171),
        g = s(92847),
        b = s(15528),
        q = s(60947);
      s(73796),
        s(74673),
        s(21972),
        s(23639),
        s(86656),
        s(22723),
        s(91055),
        s(27794),
        s(6906),
        s(50406),
        s(81172),
        s(31450),
        s(40642),
        s(26341),
        s(97714),
        s(2906),
        s(84069),
        s(91597),
        s(86787),
        s(35132),
        s(89623),
        s(44567),
        s(98380),
        s(92896),
        s(22781),
        s(86748),
        s(15324),
        s(76996),
        s(14249),
        s(9801),
        s(53523),
        s(59465),
        s(42911),
        s(46826),
        s(45433),
        s(60217),
        s(29107),
        s(30574),
        s(2157),
        s(25977),
        s(7471),
        s(54414),
        s(1648),
        s(8925),
        s(33921),
        s(3482),
        s(45154),
        s(16769),
        s(55531),
        s(30582),
        s(593),
        s(85699),
        s(63136),
        s(96055),
        s(47776),
        s(18033),
        s(6331),
        s(62048),
        s(4292),
        s(75626),
        s(72652),
        s(29641),
        s(30493),
        s(70821),
        s(82673),
        s(34229),
        s(37029),
        s(96467),
        s(63571),
        s(30776),
        s(48027),
        s(54174),
        s(82426),
        s(63130),
        s(25696),
        s(66396),
        s(42775),
        s(95834),
        s(34394),
        s(57150),
        s(76726),
        s(20444),
        s(76393),
        s(78548),
        s(2497),
        s(49906),
        s(46527),
        s(48649),
        s(9960),
        s(3101),
        s(5853),
        s(39141),
        s(38742),
        s(48243),
        s(34635),
        s(10401),
        s(49900),
        s(66284),
        s(73173),
        s(88762),
        s(67477),
        s(78533),
        s(74653),
        s(91091),
        s(58943),
        s(20543),
        s(70737),
        s(8487),
        s(17817),
        s(90814),
        s(15459),
        s(61847),
        s(16796),
        s(16955),
        s(22401),
        s(77894),
        s(55187),
        s(8586),
        s(44509),
        s(69814),
        s(11305),
        s(62259),
        s(44790),
        s(5909),
        s(60669),
        s(48208),
        s(51589),
        s(35197),
        s(89219),
        s(6941),
        s(81731),
        s(53426),
        s(49214),
        s(95533),
        s(94751),
        s(76733),
        s(11385),
        s(53785),
        s(95587),
        s(55823),
        s(34446),
        s(31292),
        s(69218),
        s(97546),
        s(54732),
        s(27207),
        s(87258),
        s(48190),
        s(40267),
        s(46646),
        s(39210),
        s(90549),
        s(658);
      const _ = new l.J({
          originalAndCurrentFeatures: 'original-and-current-features',
          none: 'none',
        }),
        I = new Set(['Feature Layer', 'Table']);
      let O = class extends d.L {
        constructor() {
          super(...arguments), (this.type = 'feature-layer');
        }
        load(e) {
          const t = (0, o.i)(e) ? e.signal : null;
          return this.addResolvingPromise(this._fetchService(t)), Promise.resolve(this);
        }
        get queryTask() {
          const {
              capabilities: {
                query: { supportsFormatPBF: e },
              },
              parsedUrl: t,
              dynamicDataSource: s,
              infoFor3D: r,
              gdbVersion: a,
              spatialReference: u,
              fieldsIndex: i,
            } = this.layer,
            n = (0, o.h)('featurelayer-pbf') && e && (0, o.b)(r) ? 'pbf' : 'json';
          return new b.Z({
            url: t.path,
            format: n,
            fieldsIndex: i,
            infoFor3D: r,
            dynamicDataSource: s,
            gdbVersion: a,
            sourceSpatialReference: u,
          });
        }
        async addAttachment(e, t) {
          await this.load();
          const s = e.attributes[this.layer.objectIdField],
            r = this.layer.parsedUrl.path + '/' + s + '/addAttachment',
            a = this._getLayerRequestOptions(),
            i = this._getFormDataForAttachment(t, a.query);
          try {
            const e = await (0, u.default)(r, { body: i });
            return this._createFeatureEditResult(e.data.addAttachmentResult);
          } catch (e) {
            throw this._createAttachmentErrorResult(s, e);
          }
        }
        async updateAttachment(e, t, s) {
          await this.load();
          const r = e.attributes[this.layer.objectIdField],
            a = this.layer.parsedUrl.path + '/' + r + '/updateAttachment',
            i = this._getLayerRequestOptions({ query: { attachmentId: t } }),
            n = this._getFormDataForAttachment(s, i.query);
          try {
            const e = await (0, u.default)(a, { body: n });
            return this._createFeatureEditResult(e.data.updateAttachmentResult);
          } catch (e) {
            throw this._createAttachmentErrorResult(r, e);
          }
        }
        async applyEdits(e, t) {
          await this.load();
          const s = e.addFeatures.map(this._serializeFeature, this),
            r = e.updateFeatures.map(this._serializeFeature, this),
            a = this._getFeatureIds(e.deleteFeatures, null == t ? void 0 : t.globalIdUsed);
          (0, g.u)(s, r, this.layer.spatialReference);
          const i = [],
            n = [],
            o = [...e.deleteAttachments];
          for (const t of e.addAttachments) i.push(await this._serializeAttachment(t));
          for (const t of e.updateAttachments) n.push(await this._serializeAttachment(t));
          const l = i.length || n.length || o.length ? { adds: i, updates: n, deletes: o } : null,
            d = {
              gdbVersion: (null == t ? void 0 : t.gdbVersion) || this.layer.gdbVersion,
              rollbackOnFailure: null == t ? void 0 : t.rollbackOnFailureEnabled,
              useGlobalIds: null == t ? void 0 : t.globalIdUsed,
              returnEditMoment: null == t ? void 0 : t.returnEditMoment,
              usePreviousEditMoment: null == t ? void 0 : t.usePreviousEditMoment,
              sessionId: null == t ? void 0 : t.sessionId,
            };
          null != t && t.returnServiceEditsOption
            ? ((d.edits = JSON.stringify([
                { id: this.layer.layerId, adds: s, updates: r, deletes: a, attachments: l },
              ])),
              (d.returnServiceEditsOption = _.toJSON(
                null == t ? void 0 : t.returnServiceEditsOption,
              )),
              (d.returnServiceEditsInSourceSR =
                null == t ? void 0 : t.returnServiceEditsInSourceSR))
            : ((d.adds = s.length ? JSON.stringify(s) : null),
              (d.updates = r.length ? JSON.stringify(r) : null),
              (d.deletes = a.length
                ? null != t && t.globalIdUsed
                  ? JSON.stringify(a)
                  : a.join(',')
                : null),
              (d.attachments = l && JSON.stringify(l)));
          const c = this._getLayerRequestOptions({ method: 'post', query: d }),
            p =
              null != t && t.returnServiceEditsOption ? this.layer.url : this.layer.parsedUrl.path,
            h = await (0, u.default)(p + '/applyEdits', c);
          return this._createEditsResult(h);
        }
        async deleteAttachments(e, t) {
          await this.load();
          const s = e.attributes[this.layer.objectIdField],
            r = this.layer.parsedUrl.path + '/' + s + '/deleteAttachments';
          try {
            return (
              await (0, u.default)(
                r,
                this._getLayerRequestOptions({
                  query: { attachmentIds: t.join(',') },
                  method: 'post',
                }),
              )
            ).data.deleteAttachmentResults.map(this._createFeatureEditResult);
          } catch (e) {
            throw this._createAttachmentErrorResult(s, e);
          }
        }
        fetchRecomputedExtents(e = {}) {
          const t = e.signal;
          return this.load({ signal: t }).then(async () => {
            const t = this._getLayerRequestOptions({ ...e, query: { returnUpdates: !0 } }),
              { layerId: s, url: r } = this.layer,
              { data: a } = await (0, u.default)(`${r}/${s}`, t),
              { id: n, extent: o, fullExtent: l, timeExtent: d } = a,
              c = o || l;
            return {
              id: n,
              fullExtent: c && m.Z.fromJSON(c),
              timeExtent: d && i.Z.fromJSON({ start: d[0], end: d[1] }),
            };
          });
        }
        async queryAttachments(e, t = {}) {
          const { parsedUrl: s } = this.layer,
            r = s.path;
          await this.load();
          const a = this._getLayerRequestOptions(t);
          if (!this.layer.get('capabilities.operations.supportsQueryAttachments')) {
            const { objectIds: t } = e,
              s = [];
            for (const e of t) {
              const t = r + '/' + e + '/attachments';
              s.push((0, u.default)(t, a));
            }
            return Promise.all(s)
              .then((e) =>
                t.map((t, s) => ({
                  parentObjectId: t,
                  attachmentInfos: e[s].data.attachmentInfos,
                })),
              )
              .then((e) => (0, f.p)(e, r));
          }
          return this.queryTask.executeAttachmentQuery(e, a);
        }
        async queryFeatures(e, t) {
          return (
            await this.load(),
            this.queryTask.execute(e, { ...t, query: this._createRequestQueryOptions(t) })
          );
        }
        async queryFeaturesJSON(e, t) {
          return (
            await this.load(),
            this.queryTask.executeJSON(e, { ...t, query: this._createRequestQueryOptions(t) })
          );
        }
        async queryObjectIds(e, t) {
          return (
            await this.load(),
            this.queryTask.executeForIds(e, { ...t, query: this._createRequestQueryOptions(t) })
          );
        }
        async queryFeatureCount(e, t) {
          return (
            await this.load(),
            this.queryTask.executeForCount(e, { ...t, query: this._createRequestQueryOptions(t) })
          );
        }
        async queryExtent(e, t) {
          return (
            await this.load(),
            this.queryTask.executeForExtent(e, { ...t, query: this._createRequestQueryOptions(t) })
          );
        }
        async queryRelatedFeatures(e, t) {
          return (
            await this.load(),
            this.queryTask.executeRelationshipQuery(e, {
              ...t,
              query: this._createRequestQueryOptions(t),
            })
          );
        }
        async queryRelatedFeaturesCount(e, t) {
          return (
            await this.load(),
            this.queryTask.executeRelationshipQueryForCount(e, {
              ...t,
              query: this._createRequestQueryOptions(t),
            })
          );
        }
        async queryTopFeatures(e, t) {
          return (
            await this.load(),
            this.queryTask.executeTopFeaturesQuery(e, {
              ...t,
              query: this._createRequestQueryOptions(t),
            })
          );
        }
        async queryTopObjectIds(e, t) {
          return (
            await this.load(),
            this.queryTask.executeForTopIds(e, { ...t, query: this._createRequestQueryOptions(t) })
          );
        }
        async queryTopExtents(e, t) {
          return (
            await this.load(),
            this.queryTask.executeForTopExtents(e, {
              ...t,
              query: this._createRequestQueryOptions(t),
            })
          );
        }
        async queryTopCount(e, t) {
          return (
            await this.load(),
            this.queryTask.executeForTopCount(e, {
              ...t,
              query: this._createRequestQueryOptions(t),
            })
          );
        }
        _createRequestQueryOptions(e) {
          return {
            ...this.layer.customParameters,
            token: this.layer.apiKey,
            ...(null == e ? void 0 : e.query),
          };
        }
        async _fetchService(e) {
          let t = this.layer.sourceJSON;
          if (!t) {
            const { data: s } = await (0, u.default)(
              this.layer.parsedUrl.path,
              this._getLayerRequestOptions({
                query: (0, o.h)('featurelayer-advanced-symbols')
                  ? { returnAdvancedSymbols: !0 }
                  : {},
                signal: e,
              }),
            );
            t = s;
          }
          this.sourceJSON = this._patchServiceJSON(t);
          const s = t.type;
          if (!I.has(s))
            throw new n.Z(
              'feature-layer-source:unsupported-type',
              `Source type "${s}" is not supported`,
            );
        }
        _patchServiceJSON(e) {
          var t;
          if (
            'Table' !== e.type &&
            e.geometryType &&
            (null == e || null == (t = e.drawingInfo) || !t.renderer) &&
            !e.defaultSymbol
          ) {
            const t = (0, F.a)(e.geometryType).renderer;
            (0, c.s)('drawingInfo.renderer', t, e);
          }
          return (
            'esriGeometryMultiPatch' === e.geometryType && e.infoFor3D && (e.geometryType = 'mesh'),
            e
          );
        }
        _serializeFeature(e) {
          const { geometry: t, attributes: s } = e;
          return (0, o.b)(t)
            ? { attributes: s }
            : 'mesh' === t.type || 'extent' === t.type
            ? null
            : { geometry: t.toJSON(), attributes: s };
        }
        async _serializeAttachment(e) {
          const { feature: t, attachment: s } = e,
            { globalId: r, name: a, contentType: u, data: i, uploadId: n } = s,
            o = {
              globalId: r,
              parentGlobalId: null,
              contentType: null,
              name: null,
              uploadId: null,
              data: null,
            };
          if (
            (t &&
              (o.parentGlobalId =
                'attributes' in t
                  ? t.attributes && t.attributes[this.layer.globalIdField]
                  : t.globalId),
            n)
          )
            o.uploadId = n;
          else if (i) {
            const e = await (async function (e) {
              return 'string' == typeof e
                ? (0, p.sJ)(e) || { data: e }
                : new Promise((t, s) => {
                    const r = new FileReader();
                    r.readAsDataURL(e),
                      (r.onload = () => t((0, p.sJ)(r.result))),
                      (r.onerror = (e) => s(e));
                  });
            })(i);
            (o.contentType = e.mediaType),
              (o.data = e.data),
              i instanceof File && (o.name = i.name);
          }
          return a && (o.name = a), u && (o.contentType = u), o;
        }
        _getFeatureIds(e, t) {
          const s = e[0];
          return s
            ? this._canUseGlobalIds(t, e)
              ? this._getGlobalIdsFromFeatureIdentifier(e)
              : 'objectId' in s
              ? this._getObjectIdsFromFeatureIdentifier(e)
              : this._getIdsFromFeatures(e)
            : [];
        }
        _getIdsFromFeatures(e) {
          const t = this.layer.objectIdField;
          return e.map((e) => e.attributes && e.attributes[t]);
        }
        _canUseGlobalIds(e, t) {
          return e && 'globalId' in t[0];
        }
        _getObjectIdsFromFeatureIdentifier(e) {
          return e.map((e) => e.objectId);
        }
        _getGlobalIdsFromFeatureIdentifier(e) {
          return e.map((e) => e.globalId);
        }
        _createEditsResult(e) {
          var t;
          const s = e.data,
            { layerId: r } = this.layer,
            a = [];
          let u = null;
          if (Array.isArray(s))
            for (const e of s)
              a.push({ id: e.id, editedFeatures: e.editedFeatures }),
                e.id === r &&
                  (u = {
                    addResults: e.addResults,
                    updateResults: e.updateResults,
                    deleteResults: e.deleteResults,
                    attachments: e.attachments,
                    editMoment: e.editMoment,
                  });
          else u = s;
          const i = null == (t = u) ? void 0 : t.attachments,
            n = {
              addFeatureResults: u.addResults
                ? u.addResults.map(this._createFeatureEditResult, this)
                : [],
              updateFeatureResults: u.updateResults
                ? u.updateResults.map(this._createFeatureEditResult, this)
                : [],
              deleteFeatureResults: u.deleteResults
                ? u.deleteResults.map(this._createFeatureEditResult, this)
                : [],
              addAttachmentResults:
                i && i.addResults ? i.addResults.map(this._createFeatureEditResult, this) : [],
              updateAttachmentResults:
                i && i.updateResults
                  ? i.updateResults.map(this._createFeatureEditResult, this)
                  : [],
              deleteAttachmentResults:
                i && i.deleteResults
                  ? i.deleteResults.map(this._createFeatureEditResult, this)
                  : [],
            };
          if ((u.editMoment && (n.editMoment = u.editMoment), a.length > 0)) {
            n.editedFeatureResults = [];
            for (const e of a) {
              const { adds: t, updates: s, deletes: r, spatialReference: a } = e.editedFeatures,
                u = a ? new q.Z(a) : null;
              n.editedFeatureResults.push({
                layerId: e.id,
                editedFeatures: {
                  adds: (null == t ? void 0 : t.map((e) => this._createEditedFeature(e, u))) || [],
                  updates:
                    (null == s
                      ? void 0
                      : s.map((e) => ({
                          original: this._createEditedFeature(e[0], u),
                          current: this._createEditedFeature(e[1], u),
                        }))) || [],
                  deletes:
                    (null == r ? void 0 : r.map((e) => this._createEditedFeature(e, u))) || [],
                  spatialReference: u,
                },
              });
            }
          }
          return n;
        }
        _createEditedFeature(e, t) {
          return new a.Z({
            attributes: e.attributes,
            geometry: (0, R.im)({ ...e.geometry, spatialReference: t }),
          });
        }
        _createFeatureEditResult(e) {
          const t = !0 === e.success ? null : e.error || { code: void 0, description: void 0 };
          return {
            objectId: e.objectId,
            globalId: e.globalId,
            error: t
              ? new n.Z('feature-layer-source:edit-failure', t.description, { code: t.code })
              : null,
          };
        }
        _createAttachmentErrorResult(e, t) {
          const s = (t.details.messages && t.details.messages[0]) || t.message,
            r = t.details.httpStatus || t.details.messageCode;
          return {
            objectId: e,
            globalId: null,
            error: new n.Z('feature-layer-source:attachment-failure', s, { code: r }),
          };
        }
        _getFormDataForAttachment(e, t) {
          const s = e instanceof FormData ? e : e && e.elements ? new FormData(e) : null;
          if (s)
            for (const e in t) {
              const r = t[e];
              null != r && (s.set ? s.set(e, r) : s.append(e, r));
            }
          return s;
        }
        _getLayerRequestOptions(e = {}) {
          const { parsedUrl: t, gdbVersion: s, dynamicDataSource: r } = this.layer;
          return {
            ...e,
            query: {
              gdbVersion: s,
              layer: r ? JSON.stringify({ source: r }) : void 0,
              ...t.query,
              f: 'json',
              ...this._createRequestQueryOptions(e),
            },
            responseType: 'json',
          };
        }
      };
      (0, r._)([(0, h.Cb)()], O.prototype, 'type', void 0),
        (0, r._)([(0, h.Cb)({ constructOnly: !0 })], O.prototype, 'layer', void 0),
        (0, r._)([(0, h.Cb)({ readOnly: !0 })], O.prototype, 'queryTask', null),
        (O = (0, r._)([(0, y.j)('esri.layers.graphics.sources.FeatureLayerSource')], O));
      const S = O;
    },
    89219: (e, t, s) => {
      'use strict';
      s.d(t, { q: () => r });
      const r = {
        supportsStatistics: !0,
        supportsPercentileStatistics: !0,
        supportsCentroid: !0,
        supportsCacheHint: !1,
        supportsDistance: !0,
        supportsDistinct: !0,
        supportsExtent: !0,
        supportsGeometryProperties: !1,
        supportsHavingClause: !0,
        supportsOrderBy: !0,
        supportsPagination: !0,
        supportsQuantization: !0,
        supportsQuantizationEditMode: !1,
        supportsQueryGeometry: !0,
        supportsResultType: !1,
        supportsSqlExpression: !0,
        supportsMaxRecordCountFactor: !1,
        supportsStandardizedQueriesOnly: !0,
        supportsTopFeaturesQuery: !1,
        supportsQueryByOthers: !0,
        supportsHistoricMoment: !1,
        supportsFormatPBF: !1,
        supportsDisjointSpatialRelationship: !0,
        maxRecordCountFactor: void 0,
        maxRecordCount: void 0,
        standardMaxRecordCount: void 0,
        tileMaxRecordCount: void 0,
      };
    },
    4571: (e, t, s) => {
      'use strict';
      s.d(t, { a: () => i, b: () => o, c: () => l, d: () => n });
      var r = s(76506),
        a = s(89219),
        u = s(6941);
      function i(e) {
        return {
          renderer: {
            type: 'simple',
            symbol:
              'esriGeometryPoint' === e || 'esriGeometryMultipoint' === e
                ? u.d
                : 'esriGeometryPolyline' === e
                ? u.a
                : u.b,
          },
        };
      }
      function n(e, t) {
        if ((0, r.h)('csp-restrictions')) return () => ({ [t]: null, ...e });
        try {
          let s = `this.${t} = null;`;
          for (const t in e)
            s += `this${t.indexOf('.') ? `["${t}"]` : `.${t}`} = ${JSON.stringify(e[t])};`;
          const r = new Function(s);
          return () => new r();
        } catch (s) {
          return () => ({ [t]: null, ...e });
        }
      }
      function o(e = {}) {
        return [{ name: 'New Feature', description: '', prototype: { attributes: (0, r.d9)(e) } }];
      }
      function l(e, t) {
        return {
          attachment: null,
          data: { isVersioned: !1, supportsAttachment: !1, supportsM: !1, supportsZ: e },
          metadata: { supportsAdvancedFieldProperties: !1 },
          operations: {
            supportsCalculate: !1,
            supportsTruncate: !1,
            supportsValidateSql: !1,
            supportsAdd: t,
            supportsDelete: t,
            supportsEditing: t,
            supportsChangeTracking: !1,
            supportsQuery: !0,
            supportsQueryAttachments: !1,
            supportsResizeAttachments: !1,
            supportsSync: !1,
            supportsUpdate: t,
            supportsExceedsLimitStatistics: !0,
          },
          query: a.q,
          queryRelated: { supportsCount: !0, supportsOrderBy: !0, supportsPagination: !0 },
          editing: {
            supportsGeometryUpdate: t,
            supportsGlobalId: !1,
            supportsReturnServiceEditsInSourceSpatialReference: !1,
            supportsRollbackOnFailure: !1,
            supportsUpdateWithoutM: !1,
            supportsUploadWithItemId: !1,
            supportsDeleteByAnonymous: !1,
            supportsDeleteByOthers: !1,
            supportsUpdateByAnonymous: !1,
            supportsUpdateByOthers: !1,
          },
        };
      }
    },
  },
]);
