import { I, e as e4, r as r3 } from "./chunk-RMZNH22Z.js"; import { t as t3 } from "./chunk-A22ACVMF.js"; import { e as e2 } from "./chunk-44FMXGSC.js"; import { e as e3 } from "./chunk-XFDO4CMR.js"; import { e } from "./chunk-GHN7C53L.js"; import { Ze } from "./chunk-WM52QDLS.js"; import { n as n2, r as r2 } from "./chunk-C7742RNZ.js"; import { u as u2 } from "./chunk-2H5MD622.js"; import { x } from "./chunk-YUA3AHKR.js"; import { j } from "./chunk-LU5IJZB4.js"; import { n, t as t2 } from "./chunk-TJNOJH33.js"; import { U } from "./chunk-DVUG3KID.js"; import { s } from "./chunk-FWSQEIAR.js"; import { E, w } from "./chunk-V6P2MAQQ.js"; import { f, u2 as u } from "./chunk-2TIUKVZN.js"; import { r, t } from "./chunk-YXWMMD76.js"; // node_modules/@arcgis/core/layers/support/capabilities.js var t4 = { analytics: { supportsCacheHint: false }, attachment: { supportsContentType: false, supportsExifInfo: false, supportsKeywords: false, supportsName: false, supportsSize: false, supportsCacheHint: false, supportsResize: false }, data: { isVersioned: false, supportsAttachment: false, supportsM: false, supportsZ: false }, editing: { supportsDeleteByAnonymous: false, supportsDeleteByOthers: false, supportsGeometryUpdate: false, supportsGlobalId: false, supportsReturnServiceEditsInSourceSpatialReference: false, supportsRollbackOnFailure: false, supportsUpdateByAnonymous: false, supportsUpdateByOthers: false, supportsUpdateWithoutM: false, supportsUploadWithItemId: false }, metadata: { supportsAdvancedFieldProperties: false }, operations: { supportsCalculate: false, supportsTruncate: false, supportsValidateSql: false, supportsAdd: false, supportsDelete: false, supportsEditing: false, supportsChangeTracking: false, supportsQuery: false, supportsQueryAnalytics: false, supportsQueryAttachments: false, supportsQueryTopFeatures: false, supportsResizeAttachments: false, supportsSync: false, supportsUpdate: false, supportsExceedsLimitStatistics: false }, queryRelated: { supportsCount: false, supportsOrderBy: false, supportsPagination: false, supportsCacheHint: false }, queryTopFeatures: { supportsCacheHint: false }, query: { maxRecordCount: 0, maxRecordCountFactor: 0, standardMaxRecordCount: 0, supportsCacheHint: false, supportsCentroid: false, supportsCompactGeometry: false, supportsDefaultSpatialReference: false, supportsFullTextSearch: false, supportsDisjointSpatialRelationship: false, supportsDistance: false, supportsDistinct: false, supportsExtent: false, supportsFormatPBF: false, supportsGeometryProperties: false, supportsHavingClause: false, supportsHistoricMoment: false, supportsMaxRecordCountFactor: false, supportsOrderBy: false, supportsPagination: false, supportsPercentileStatistics: false, supportsQuantization: false, supportsQuantizationEditMode: false, supportsQueryByOthers: false, supportsQueryGeometry: false, supportsResultType: false, supportsSqlExpression: false, supportsStandardizedQueriesOnly: false, supportsTopFeaturesQuery: false, supportsSpatialAggregationStatistics: false, supportedSpatialAggregationStatistics: { envelope: false, centroid: false, convexHull: false }, supportsStatistics: false, tileMaxRecordCount: 0 } }; // node_modules/@arcgis/core/views/3d/layers/i3s/I3SProjectionUtil.js var s2 = 1; var c = 5 - s2; // node_modules/@arcgis/core/views/3d/webgl-engine/lib/edgeRendering/interfaces.js var A; !function(A3) { A3[A3.INVISIBLE = 0] = "INVISIBLE", A3[A3.TRANSPARENT = 1] = "TRANSPARENT", A3[A3.OPAQUE = 2] = "OPAQUE"; }(A || (A = {})); // node_modules/@arcgis/core/views/3d/layers/support/edgeUtils.js function m(e9) { return { ...g, ...e9, type: "solid" }; } var g = { color: r2(0, 0, 0, 0.2), size: 1, extensionLength: 0, opacity: 1, objectTransparency: A.OPAQUE, hasSlicePlane: false }; var d = { color: r2(0, 0, 0, 0.2), size: 1, extensionLength: 0, opacity: 1, objectTransparency: A.OPAQUE, hasSlicePlane: false }; // node_modules/@arcgis/core/views/3d/support/orientedBoundingBox.js var w3 = e3(); var A2 = n(); var B2 = n(); var I2 = n2(); var C = e(); function E3(t6 = [0, 0, 0], e9 = [-1, -1, -1], a3 = [0, 0, 0, 1]) { return { center: t2(t6), halfSize: t3(e9), quaternion: r3(a3) }; } var T = (() => { const t6 = new Int8Array(162); let e9 = 0; const a3 = (a4) => { for (let n5 = 0; n5 < a4.length; n5++) t6[e9 + n5] = a4[n5]; e9 += 6; }; return a3([6, 2, 3, 1, 5, 4]), a3([0, 2, 3, 1, 5, 4]), a3([0, 2, 3, 7, 5, 4]), a3([0, 1, 3, 2, 6, 4]), a3([0, 1, 3, 2, 0, 0]), a3([0, 1, 5, 7, 3, 2]), a3([0, 1, 3, 7, 6, 4]), a3([0, 1, 3, 7, 6, 2]), a3([0, 1, 5, 7, 6, 2]), a3([0, 1, 5, 4, 6, 2]), a3([0, 1, 5, 4, 0, 0]), a3([0, 1, 3, 7, 5, 4]), a3([0, 2, 6, 4, 0, 0]), a3([0, 0, 0, 0, 0, 0]), a3([1, 3, 7, 5, 0, 0]), a3([2, 3, 7, 6, 4, 0]), a3([2, 3, 7, 6, 0, 0]), a3([2, 3, 1, 5, 7, 6]), a3([0, 1, 5, 7, 6, 2]), a3([0, 1, 5, 7, 6, 4]), a3([0, 1, 3, 7, 6, 4]), a3([4, 5, 7, 6, 2, 0]), a3([4, 5, 7, 6, 0, 0]), a3([4, 5, 1, 3, 7, 6]), a3([0, 2, 3, 7, 5, 4]), a3([6, 2, 3, 7, 5, 4]), a3([6, 2, 3, 1, 5, 4]), t6; })(); // node_modules/@arcgis/core/views/3d/layers/i3s/I3SUtil.js var ie = u2(); var ce; function ye(t6, r6, n5, o2, a3) { const s5 = []; for (const e9 of r6) if (e9 && a3.includes(e9.name)) { const r7 = `${t6}/nodes/${n5}/attributes/${e9.key}/0`; s5.push({ url: r7, storageInfo: e9 }); } return E(s5.map((t7) => U(t7.url, { responseType: "array-buffer" }).then((e9) => I(t7.storageInfo, e9.data)))).then((e9) => { const t7 = []; for (const r7 of o2) { const n6 = {}; for (let t8 = 0; t8 < e9.length; t8++) null != e9[t8].value && (n6[s5[t8].storageInfo.name] = be(e9[t8].value, r7)); t7.push(n6); } return t7; }); } !function(e9) { e9[e9.OUTSIDE = 0] = "OUTSIDE", e9[e9.INTERSECTS_CENTER_OUTSIDE = 1] = "INTERSECTS_CENTER_OUTSIDE", e9[e9.INTERSECTS_CENTER_INSIDE = 2] = "INTERSECTS_CENTER_INSIDE", e9[e9.INSIDE = 3] = "INSIDE"; }(ce || (ce = {})); var Se = -32768; var ge = -(2 ** 31); function be(e9, t6) { if (!e9) return null; const r6 = e9[t6]; if (u(e9)) return r6 === Se ? null : r6; if (f(e9)) return r6 === ge ? null : r6; return r6 != r6 ? null : r6; } var We = m({ color: [0, 0, 0, 0], opacity: 0 }); var Ge = n(); var Ke = n(); var Le = n(); var Be = e3(); var $e = new Float64Array(24); var Ve = n(); var Ze2 = n(); var He = e(); var it = e2(); var st = e4(); var lt = u2(); var ft = u2(); var ut = E3(); var ht = { data: new Array(72), size: 3 }; var mt = e2(); // node_modules/@arcgis/core/layers/support/FetchAssociatedFeatureLayer.js var l4 = class { constructor(t6, r6, e9, a3) { var _a; this._parsedUrl = t6, this._portalItem = r6, this._apiKey = e9, this.signal = a3, this._rootDocument = null; const i2 = (_a = this._parsedUrl) == null ? void 0 : _a.path.match(/^(.*)\/SceneServer\/layers\/([\d]*)\/?$/i); i2 && (this._urlParts = { root: i2[1], layerId: parseInt(i2[2], 10) }); } async fetch() { var _a; if (!this._urlParts) return null; const t6 = (_a = this._portalItem) != null ? _a : await this._portalItemFromServiceItemId(); if (t(t6)) return this._loadFromUrl(); const r6 = await this._findAndLoadRelatedPortalItem(t6); return t(r6) ? null : this._loadFeatureLayerFromPortalItem(r6); } async fetchPortalItem() { var _a; if (!this._urlParts) return null; const t6 = (_a = this._portalItem) != null ? _a : await this._portalItemFromServiceItemId(); return t(t6) ? null : this._findAndLoadRelatedPortalItem(t6); } async _fetchRootDocument() { if (r(this._rootDocument)) return this._rootDocument; if (t(this._urlParts)) return this._rootDocument = {}, {}; const t6 = { query: { f: "json", token: this._apiKey }, responseType: "json", signal: this.signal }, i2 = `${this._urlParts.root}/SceneServer`; try { const e9 = await U(i2, t6); this._rootDocument = e9.data; } catch { this._rootDocument = {}; } return this._rootDocument; } async _fetchServiceOwningPortalUrl() { var _a, _b; const e9 = (_a = this._parsedUrl) == null ? void 0 : _a.path, a3 = e9 ? (_b = s) == null ? void 0 : _b.findServerInfo(e9) : null; if (a3 == null ? void 0 : a3.owningSystemUrl) return a3.owningSystemUrl; const s5 = e9 ? e9.replace(/(.*\/rest)\/.*/i, "$1") + "/info" : null; try { const t6 = (await U(s5, { query: { f: "json" }, responseType: "json", signal: this.signal })).data.owningSystemUrl; if (t6) return t6; } catch (n5) { w(n5); } return null; } async _findAndLoadRelatedPortalItem(t6) { try { return (await t6.fetchRelatedItems({ relationshipType: "Service2Service", direction: "reverse" }, { signal: this.signal })).find((t7) => "Feature Service" === t7.type) || null; } catch (r6) { return w(r6), null; } } async _loadFeatureLayerFromPortalItem(t6) { var _a; await t6.load({ signal: this.signal }); const r6 = await this._findMatchingAssociatedSublayerUrl((_a = t6.url) != null ? _a : ""); return new Ze({ url: r6, portalItem: t6 }).load({ signal: this.signal }); } async _loadFromUrl() { var _a; const t6 = await this._findMatchingAssociatedSublayerUrl(`${(_a = this._urlParts) == null ? void 0 : _a.root}/FeatureServer`); return new Ze({ url: t6 }).load({ signal: this.signal }); } async _findMatchingAssociatedSublayerUrl(t6) { var _a; const e9 = t6.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i, "$1"), a3 = { query: { f: "json" }, responseType: "json", authMode: "no-prompt", signal: this.signal }, i2 = (_a = this._urlParts) == null ? void 0 : _a.layerId, s5 = this._fetchRootDocument(), n5 = U(e9, a3), [o2, l5] = await Promise.all([n5, s5]), c3 = l5 && l5.layers, u7 = o2.data && o2.data.layers; if (!Array.isArray(u7)) throw new Error("expected layers array"); if (Array.isArray(c3)) for (let r6 = 0; r6 < Math.min(c3.length, u7.length); r6++) { if (c3[r6].id === i2) return `${e9}/${u7[r6].id}`; } else if (null != i2 && i2 < u7.length) return `${e9}/${u7[i2].id}`; throw new Error("could not find matching associated sublayer"); } async _portalItemFromServiceItemId() { const t6 = (await this._fetchRootDocument()).serviceItemId; if (!t6) return null; const r6 = new x({ id: t6, apiKey: this._apiKey }), e9 = await this._fetchServiceOwningPortalUrl(); r(e9) && (r6.portal = new j({ url: e9 })); try { return r6.load({ signal: this.signal }); } catch (s5) { return w(s5), null; } } }; export { t4 as t, ye, l4 as l }; //# sourceMappingURL=chunk-F2ZAJBUD.js.map