@arcgis/core 4.33.0-next.20250507 → 4.33.0-next.20250509
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WebLinkChart.js +1 -1
- package/applications/SceneViewer/sceneViewerUtils.d.ts +2 -0
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/arcade/batchExec.js +5 -0
- package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
- package/arcade/functions/aiServices.js +1 -1
- package/arcade.js +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ar.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.bg.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.bs.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ca.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.cs.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.da.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.de.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.el.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.en.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.es.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.et.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.fi.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.fr.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.he.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.hr.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.hu.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.id.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.it.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ja.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ko.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.lt.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.lv.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.nl.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.no.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.pl.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.pt-BR.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.pt-PT.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ro.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.ru.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.sk.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.sl.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.sr.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.sv.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.th.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.tr.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.uk.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.vi.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.zh-CN.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.zh-HK.json +1 -1
- package/assets/components/assets/input-time-picker/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/029a118e6dfb3f544a5c.js +1 -0
- package/assets/esri/core/workers/chunks/0516bd18334d3af6c555.js +1 -0
- package/assets/esri/core/workers/chunks/0766ecb677d667e5fb83.js +2 -0
- package/assets/esri/core/workers/chunks/{543eb46b55cacd6e1dbc.js.LICENSE.txt → 0766ecb677d667e5fb83.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{c607d618b64d3accecc4.js → 0aca29f7156b2b412f2e.js} +1 -1
- package/assets/esri/core/workers/chunks/0bbb38f59f37c51c72f0.js +1 -0
- package/assets/esri/core/workers/chunks/10e6dffa57aa1a626708.js +1 -0
- package/assets/esri/core/workers/chunks/1abd026ed12c863e1d94.js +1 -0
- package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +1 -0
- package/assets/esri/core/workers/chunks/218a66d53f7cf4f285aa.js +2 -0
- package/assets/esri/core/workers/chunks/{d8dc922f7466300b668f.js.LICENSE.txt → 218a66d53f7cf4f285aa.js.LICENSE.txt} +2 -2
- package/assets/esri/core/workers/chunks/243dc74ec62891ba1ef7.js +1 -0
- package/assets/esri/core/workers/chunks/{7cd32b10ed0e18e44ef2.js → 2b01e3bce78541620a86.js} +1 -1
- package/assets/esri/core/workers/chunks/{f74b5659b6496a5c4c0c.js → 2e0af748eba93f3ea6cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{cd81df932b87583b7e4c.js → 306e262f148b3057b11b.js} +1 -1
- package/assets/esri/core/workers/chunks/352b7dcd1633e0c98194.js +1 -0
- package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +2 -0
- package/assets/esri/core/workers/chunks/{7b4523ab392966624d97.js.LICENSE.txt → 3596540ef49e5330ceb2.js.LICENSE.txt} +1 -7
- package/assets/esri/core/workers/chunks/391b1c3e736a62befbaf.js +1 -0
- package/assets/esri/core/workers/chunks/{cbec01223d51cdb9ee79.js → 3c45603af279ad7fed8c.js} +1 -1
- package/assets/esri/core/workers/chunks/{a22c88b0a525e602dce0.js → 3d0e09ef78dc2fd6957a.js} +1 -1
- package/assets/esri/core/workers/chunks/40e556a0645af8658658.js +1 -0
- package/assets/esri/core/workers/chunks/4402336db7210cd583e0.js +1 -0
- package/assets/esri/core/workers/chunks/46104db7f77952bb6c12.js +1 -0
- package/assets/esri/core/workers/chunks/{5383dc4814b0ba42e871.js → 47cd99ab3ed11a931084.js} +1 -1
- package/assets/esri/core/workers/chunks/47f64a340b5d56bf9e59.js +1 -0
- package/assets/esri/core/workers/chunks/49f0e53b3c9ba8451442.js +1 -0
- package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +1 -0
- package/assets/esri/core/workers/chunks/515e3295495d0958db7e.js +1 -0
- package/assets/esri/core/workers/chunks/{ee1d104e2bcc5d808fa4.js → 5228fc7fcdf57f44781e.js} +1 -1
- package/assets/esri/core/workers/chunks/5371df31553626528c69.js +1 -0
- package/assets/esri/core/workers/chunks/54f4a1131f99468db076.js +1 -0
- package/assets/esri/core/workers/chunks/{49c968e91c3c48aaa110.js → 5583d18032ed8bc17c74.js} +1 -1
- package/assets/esri/core/workers/chunks/5ddf463c85c33428e807.js +1 -0
- package/assets/esri/core/workers/chunks/5e7f35bf1aab93cb1c52.js +1 -0
- package/assets/esri/core/workers/chunks/61c74a733718d667b071.js +1 -0
- package/assets/esri/core/workers/chunks/{69f7fe6c58e4931597f6.js → 631205dc4d73d49ec9ed.js} +1 -1
- package/assets/esri/core/workers/chunks/{875a0e2d023094c8e15e.js → 66e79aa02b3aa12b3778.js} +1 -1
- package/assets/esri/core/workers/chunks/{a5a43d54684747561aa9.js → 6b42bcfbb60432e3ed1f.js} +1 -1
- package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +1 -0
- package/assets/esri/core/workers/chunks/6e5d8a6b29c06a27998c.js +1 -0
- package/assets/esri/core/workers/chunks/6eabced7123a65d47292.js +1 -0
- package/assets/esri/core/workers/chunks/6f506303017903b9a06f.js +1 -0
- package/assets/esri/core/workers/chunks/6f6bf67a7960b7e9b03e.js +1 -0
- package/assets/esri/core/workers/chunks/{52a3d0e041717da7697e.js → 736cb9f74bf050b70f4c.js} +1 -1
- package/assets/esri/core/workers/chunks/7c49a8877bd744daa3d5.js +1 -0
- package/assets/esri/core/workers/chunks/7e8f78b96d43c224c7b6.js +1 -0
- package/assets/esri/core/workers/chunks/7ed9a9c33a08ebba5570.js +346 -0
- package/assets/esri/core/workers/chunks/83fcc6f770ad084b8ab9.js +1 -0
- package/assets/esri/core/workers/chunks/85efb318cda7260221ae.js +1 -0
- package/assets/esri/core/workers/chunks/86138c297095af1ac604.js +1 -0
- package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/8b74b609de4f70e1a75c.js +1 -0
- package/assets/esri/core/workers/chunks/90ae15ce22a49bd84876.js +2 -0
- package/assets/esri/core/workers/chunks/{ac9c6779771ec855da79.js.LICENSE.txt → 90ae15ce22a49bd84876.js.LICENSE.txt} +3 -3
- package/assets/esri/core/workers/chunks/90f93091fe088875f80f.js +1 -0
- package/assets/esri/core/workers/chunks/91a02ee91f61cf841111.js +1 -0
- package/assets/esri/core/workers/chunks/93cc26e5636040fdc0b8.js +1 -0
- package/assets/esri/core/workers/chunks/9ca480eb8b2312381ccf.js +1 -0
- package/assets/esri/core/workers/chunks/{77c7b7c4426c2b1a5b42.js → 9fc35ec8185beba96715.js} +1 -1
- package/assets/esri/core/workers/chunks/a0d2bd5d4ed3c90f6b1c.js +1 -0
- package/assets/esri/core/workers/chunks/{4f627eb62caee760215a.js → a1f27c4f4b5ef3e359f7.js} +1 -1
- package/assets/esri/core/workers/chunks/a31658f544ac6e1801d6.js +1 -0
- package/assets/esri/core/workers/chunks/{3a205f87f100832ef9f5.js → a5e746e10239a3bfe237.js} +1 -1
- package/assets/esri/core/workers/chunks/a6bcae413e62cd879b46.js +1 -0
- package/assets/esri/core/workers/chunks/a73c6b4bc5baf440f85a.js +1 -0
- package/assets/esri/core/workers/chunks/{59d4c41172e921922cac.js → a8b42d8c0b76c234c09f.js} +100 -62
- package/assets/esri/core/workers/chunks/{3a517393619af3639b83.js → ad9bcd9dae45cdf90cbb.js} +1 -1
- package/assets/esri/core/workers/chunks/{e46c05ef7272c7f1f70c.js → b1035bf4a016b1199236.js} +1 -1
- package/assets/esri/core/workers/chunks/b4f38fe9cc948a39ad87.js +2 -0
- package/assets/esri/core/workers/chunks/{ce9de24cb96b56d20562.js.LICENSE.txt → b4f38fe9cc948a39ad87.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/b5d68d8460b7c15001dd.js +1 -0
- package/assets/esri/core/workers/chunks/b816b608f31954128246.js +1 -0
- package/assets/esri/core/workers/chunks/bd7b54db7fd278b15500.js +1 -0
- package/assets/esri/core/workers/chunks/c1175477dfcdee90a453.js +1 -0
- package/assets/esri/core/workers/chunks/{85d87cd1bf7eecd54100.js → c16e0da7a19310c71e8b.js} +1 -1
- package/assets/esri/core/workers/chunks/c17c269cc30e7e1d0bfb.js +1 -0
- package/assets/esri/core/workers/chunks/c28d4717ed588c0d8bf1.js +1 -0
- package/assets/esri/core/workers/chunks/c2f925167a43f63289a7.js +1 -0
- package/assets/esri/core/workers/chunks/c9ab067b07d1eab974d1.js +1 -0
- package/assets/esri/core/workers/chunks/cb80b7ddc9acf625d754.js +1 -0
- package/assets/esri/core/workers/chunks/{812d8554144ef5a7cd4b.js → cd4fb107489594c57438.js} +1 -1
- package/assets/esri/core/workers/chunks/cd5c380196db7fb55242.js +1 -0
- package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +1 -0
- package/assets/esri/core/workers/chunks/d7b640f7a181bd26c7c7.js +1 -0
- package/assets/esri/core/workers/chunks/d874d24568b1acedebc4.js +1 -0
- package/assets/esri/core/workers/chunks/{2bdbf678d4f013543dbb.js → d971571a957de70d5a8d.js} +1 -1
- package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +1 -0
- package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +2 -0
- package/assets/esri/core/workers/chunks/{670a66617249f2d15a62.js.LICENSE.txt → e0dc8794343c2a949ffb.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/e3c1aea34ece8336dae1.js +1 -0
- package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +1 -0
- package/assets/esri/core/workers/chunks/e662c86b8bafc5512d3d.js +1 -0
- package/assets/esri/core/workers/chunks/e697dd4508f02dcfe329.js +1 -0
- package/assets/esri/core/workers/chunks/{a50cb1fc8c4c585c0e11.js → ec8e8048b3df2c92008d.js} +1 -1
- package/assets/esri/core/workers/chunks/ed6d0fea159dea638c2f.js +1 -0
- package/assets/esri/core/workers/chunks/f7ab3511f6627f467796.js +1 -0
- package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
- package/assets/esri/core/workers/chunks/fb2e28e6a87956267d1c.js +66 -0
- package/assets/esri/core/workers/chunks/fbcd94f60f92257a7303.js +2 -0
- package/assets/esri/core/workers/chunks/{c2594024d72133d3ed7b.js.LICENSE.txt → fbcd94f60f92257a7303.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/fda48126f67e80034404.js +1 -0
- package/assets/esri/themes/base/widgets/_Daylight.scss +0 -4
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +1 -0
- package/assets/esri/themes/base/widgets/_ShadowCast.scss +27 -28
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ar.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bg.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_bs.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ca.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_cs.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_da.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_de.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_el.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_es.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_et.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fi.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_fr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_he.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_hu.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_id.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_it.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ja.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ko.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lt.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_lv.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_nl.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_no.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pl.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-BR.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_pt-PT.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ro.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_ru.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sk.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sl.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_sv.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_th.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_tr.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_uk.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_vi.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-CN.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-HK.json +1 -1
- package/assets/esri/widgets/ShadowCast/t9n/ShadowCast_zh-TW.json +1 -1
- package/chunks/HUDMaterial.glsl.js +1 -1
- package/chunks/Laserlines.glsl.js +2 -2
- package/chunks/aiServices.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec32.js +1 -1
- package/core/libs/gl-matrix-2/math/mat4.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/mapCollectionUtils.js +1 -1
- package/core/perspectiveUtils.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/circleUtils.js +1 -1
- package/geometry/support/curves/curveExtent.js +5 -0
- package/geometry/support/curves/curveLength.js +5 -0
- package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
- package/geometry/support/curves/ellipticArc4Utils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/geometry/support/curves/mathUtils.js +1 -1
- package/geometry/support/curves/splitCurveAtPoint.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/primitives.js +1 -1
- package/geometry/support/meshUtils/projection.js +1 -1
- package/geometry/support/meshUtils/rotate.js +1 -1
- package/geometry/support/meshUtils/scale.js +1 -1
- package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
- package/geometry/support/meshVertexSpaceUtils.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +111 -6
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/MapImageLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/graphics/sources/MemorySource.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/video/VideoCameraSensorModel.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/layers/voxel/voxelPlaneUtils.js +1 -1
- package/package.json +1 -1
- package/rest/print.js +1 -1
- package/rest/support/JobInfo.js +1 -1
- package/rest/support/TranslateContent.js +1 -1
- package/rest/support/TranslateParameters.js +1 -1
- package/rest/support/TranslateResult.js +1 -1
- package/support/loadArcade.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/engine/webgl/AFeatureTile.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/constants.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/DimensionTool.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/intersectionUtils.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/dragEventPipeline3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SGeometryUtil.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/Intersector.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/InteractiveController.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/controllers/PointToPointAnimationController.js +1 -1
- package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
- package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/orientedBoundingBox.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/Intersector.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl/ManagedDepthTexture.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ElevationAgnosticBVH.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/HUDIntersectorResult.js +5 -0
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorResult.js +5 -0
- package/views/3d/webgl-engine/lib/IntersectorTarget.js +1 -1
- package/views/3d/webgl-engine/lib/IntersectorType.js +5 -0
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/ObjectIntersectorResult.js +5 -0
- package/views/3d/webgl-engine/lib/ObjectTarget.js +5 -0
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtils.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
- package/views/3d/webgl-engine/lighting/SphericalHarmonics.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/pbrUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/FocusArea.js +1 -1
- package/views/FocusAreaOutline.js +5 -0
- package/views/FocusAreaOutlineItem.js +5 -0
- package/views/FocusAreas.js +1 -1
- package/views/FocusAreasUtils.js +5 -0
- package/views/FocusAreasView.js +5 -0
- package/views/SceneView.js +1 -1
- package/views/analysis/DimensionAnalysisView.js +1 -1
- package/views/draw/support/surfaceCoordinateSystems.js +1 -1
- package/views/interactive/ToolIntersector.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/layers/DimensionLayerView.js +1 -1
- package/views/support/angularMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Daylight/css.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
- package/widgets/ShadowCast/css.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/SketchTooltipControls.js +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/00e49ed684cc167c4481.js +0 -1
- package/assets/esri/core/workers/chunks/02e1332e91393ee985e8.js +0 -1
- package/assets/esri/core/workers/chunks/0366d46c78aa3b4a0523.js +0 -1
- package/assets/esri/core/workers/chunks/076a205298026e926d70.js +0 -1
- package/assets/esri/core/workers/chunks/07adf428f5fdba5c7cdf.js +0 -1
- package/assets/esri/core/workers/chunks/0c338364cb55afdbd580.js +0 -1
- package/assets/esri/core/workers/chunks/1349d4ea29fbf41e22bc.js +0 -1
- package/assets/esri/core/workers/chunks/2934fd7ec0c07371c4fe.js +0 -1
- package/assets/esri/core/workers/chunks/2a72f272051721767ca1.js +0 -319
- package/assets/esri/core/workers/chunks/2a9f206c23f69045d3f2.js +0 -1
- package/assets/esri/core/workers/chunks/2ac2c9cb88a7d1249b56.js +0 -1
- package/assets/esri/core/workers/chunks/2ad47c0ba1680f7d5e03.js +0 -1
- package/assets/esri/core/workers/chunks/2b3aa568356f4b70afe8.js +0 -1
- package/assets/esri/core/workers/chunks/2da01fe20200b6d74851.js +0 -1
- package/assets/esri/core/workers/chunks/35002d23c5b9f37c6331.js +0 -1
- package/assets/esri/core/workers/chunks/35b138f6d0687c5bee4f.js +0 -1
- package/assets/esri/core/workers/chunks/45d64b72b7e93e9c64d7.js +0 -1
- package/assets/esri/core/workers/chunks/4957450197305498d327.js +0 -1
- package/assets/esri/core/workers/chunks/4b63f36189730396721b.js +0 -1
- package/assets/esri/core/workers/chunks/543eb46b55cacd6e1dbc.js +0 -2
- package/assets/esri/core/workers/chunks/55def679b9f1c7c4d4d3.js +0 -1
- package/assets/esri/core/workers/chunks/598fade09fa4da759ac2.js +0 -1
- package/assets/esri/core/workers/chunks/60f7cd05e88701f43d3f.js +0 -1
- package/assets/esri/core/workers/chunks/6118144588af9cd8e49b.js +0 -1
- package/assets/esri/core/workers/chunks/62c5030557595c9a7c37.js +0 -1
- package/assets/esri/core/workers/chunks/62d1e6e7d8685ffc152f.js +0 -1
- package/assets/esri/core/workers/chunks/670a66617249f2d15a62.js +0 -2
- package/assets/esri/core/workers/chunks/687a11f49772bf5e1f5a.js +0 -1
- package/assets/esri/core/workers/chunks/6b554b42e16ad32b433d.js +0 -1
- package/assets/esri/core/workers/chunks/6fc39a58f3011291c602.js +0 -1
- package/assets/esri/core/workers/chunks/7978b66cdfe078960ddd.js +0 -1
- package/assets/esri/core/workers/chunks/7b4523ab392966624d97.js +0 -2
- package/assets/esri/core/workers/chunks/7c2ec96749972e0b8a13.js +0 -1
- package/assets/esri/core/workers/chunks/7fa70851868f80eaccfc.js +0 -1
- package/assets/esri/core/workers/chunks/8d09cc782dae1dcfc6c4.js +0 -1
- package/assets/esri/core/workers/chunks/8ec0a762ec73d1f91fce.js +0 -1
- package/assets/esri/core/workers/chunks/919673d958045ab94c95.js +0 -1
- package/assets/esri/core/workers/chunks/9321e3244ccb1ee9985a.js +0 -1
- package/assets/esri/core/workers/chunks/97a4f8504e76c877893b.js +0 -1
- package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +0 -1
- package/assets/esri/core/workers/chunks/a1278a1c4a913c671989.js +0 -1
- package/assets/esri/core/workers/chunks/a2452958b0ced28fc1e5.js +0 -1
- package/assets/esri/core/workers/chunks/ac9c6779771ec855da79.js +0 -2
- package/assets/esri/core/workers/chunks/aed72cbac8d463b1d2e0.js +0 -1
- package/assets/esri/core/workers/chunks/af44ba2ee6c7670ddcc1.js +0 -1
- package/assets/esri/core/workers/chunks/b2f1d1721a9dd88a1adf.js +0 -1
- package/assets/esri/core/workers/chunks/b52a738ca2b5c39f8e15.js +0 -1
- package/assets/esri/core/workers/chunks/b60504e6326464a512df.js +0 -1
- package/assets/esri/core/workers/chunks/b79e8d1e3f2c214549b7.js +0 -1
- package/assets/esri/core/workers/chunks/ba4aafa8dfa76006c3e7.js +0 -1
- package/assets/esri/core/workers/chunks/bbcc5c5ef7cb92c2e213.js +0 -39
- package/assets/esri/core/workers/chunks/bbff052a991a2dc36960.js +0 -1
- package/assets/esri/core/workers/chunks/bceb837623aa79fcfbed.js +0 -1
- package/assets/esri/core/workers/chunks/bf190d672dcbaedc1a41.js +0 -1
- package/assets/esri/core/workers/chunks/bfd39cd1d83291ba014b.js +0 -1
- package/assets/esri/core/workers/chunks/c255c9279815359fdce5.js +0 -1
- package/assets/esri/core/workers/chunks/c2594024d72133d3ed7b.js +0 -2
- package/assets/esri/core/workers/chunks/ca8c631172902c6623fa.js +0 -1
- package/assets/esri/core/workers/chunks/ce9de24cb96b56d20562.js +0 -2
- package/assets/esri/core/workers/chunks/cf008faa999e8d07116f.js +0 -1
- package/assets/esri/core/workers/chunks/d8dc922f7466300b668f.js +0 -2
- package/assets/esri/core/workers/chunks/dbf6011dd7933f02d41d.js +0 -66
- package/assets/esri/core/workers/chunks/dcb9ab790e694328d02c.js +0 -1
- package/assets/esri/core/workers/chunks/e4e9dd635bdef18d0bd5.js +0 -1
- package/assets/esri/core/workers/chunks/e69f2e3c2d5e71fbb42f.js +0 -1
- package/assets/esri/core/workers/chunks/e93222c65bd28203ddf7.js +0 -1
- package/assets/esri/core/workers/chunks/ea70cabea50960dc8167.js +0 -1
- package/assets/esri/core/workers/chunks/f07b3aecff90a6a400d8.js +0 -1
- package/assets/esri/core/workers/chunks/f61632c06c05b72e7017.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[788,2470,3186,3515,4342,4697],{10407:(e,t,r)=>{r.d(t,{It:()=>p,LG:()=>a,OM:()=>u,Sm:()=>c,Y:()=>l,bK:()=>o,mm:()=>h,sQ:()=>d});var i=r(80586),s=r(16930),n=r(28735);function a(e,t){if(!l(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function l(e,t){return!!e.typeKeywords?.includes(t)}function o(e){return l(e,h.HOSTED_SERVICE)}function u(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function c(e,t,r){r?a(e,t):u(e,t)}async function d(e){const t=e.clone().normalize();let r;if(t.length>1)for(const e of t)r?e.width>r.width&&(r=e):r=e;else r=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,n.ci)(e);const r=s.A.WGS84;return await(0,i.initializeProjection)(t,r),(0,i.project)(e,r)}(r)}const h={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function p(e){const{portal:t,isOrgItem:r,itemControl:i}=e,s=t.user?.privileges;let n=!s||s.includes("features:user:edit"),a=!!r&&!!s?.includes("features:user:fullEdit");const l="update"===i||"admin"===i;return l?a=n=!0:a&&(n=!0),{features:{edit:n,fullEdit:a},content:{updateItem:l}}}},17311:(e,t,r)=>{r.d(t,{A:()=>d});var i=r(90237),s=r(69622),n=r(60999),a=r(5503),l=r(10107),o=(r(44208),r(53966),r(87811),r(40608)),u=r(30524),c=r(43668);let d=class extends s.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,n.UT)((()=>(0,c.l)())):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??r.e(9926).then(r.bind(r,29926)).then((e=>this._featureUtils=e))}get calculatedExpressions(){const e=new a.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter((t=>e.includes(`{expression/${t.name.toLowerCase()}}`)))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some((e=>!0===e.invalid))}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),i=this.fieldsIndex.get(r.at(-1)??"");i&&e.add(i.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){try{const{attributes:i}=t,s=r?.timeZone??"system",[{substituteFieldsInLinksAndAttributes:n}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);if(r.fetchMissingFields&&(t=await this._checkAndReQueryGraphic(e,t)),this.workingTitle&&this.fieldInfoMap){const r=this._createFormattedAttributes(e,t,s).global;return n({attributes:i,expressionAttributes:null,fieldInfoMap:this.fieldInfoMap,globalAttributes:r,layer:e,text:this.workingTitle})}return""}catch{}return""}async _checkAndReQueryGraphic(e,t){const r=t.getObjectId();if(null==r)return t;if(!(0,u.Kl)(this.requiredFields,t)){const t=e.createQuery();t.where="1=1",t.outFields=[...this.requiredFields],t.objectIds=[r];const i=await e.queryFeatures(t);if(1===i?.features.length)return i.features[0]}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),i=e?.name??r.fieldName;r.fieldName=i,t.set(i.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const i=this.effectivePopupTemplate?.fieldInfos??[],s={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{s[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const n={...t.attributes,...s};return{global:this._featureUtils.formatAttributes({fieldInfos:i,attributes:n,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,u.nw)(e).filter((e=>!(0===e.indexOf("relationships/")||0===e.indexOf("expression/"))))}};(0,i._)([(0,l.MZ)({readOnly:!0})],d.prototype,"_arcadeTask",null),(0,i._)([(0,l.MZ)()],d.prototype,"_featureUtils",void 0),(0,i._)([(0,l.MZ)({readOnly:!0})],d.prototype,"featureUtilsPromise",null),(0,i._)([(0,l.MZ)({readOnly:!0})],d.prototype,"calculatedExpressions",null),(0,i._)([(0,l.MZ)()],d.prototype,"displayField",void 0),(0,i._)([(0,l.MZ)()],d.prototype,"effectivePopupTemplate",void 0),(0,i._)([(0,l.MZ)()],d.prototype,"expressionsUsedInTitle",null),(0,i._)([(0,l.MZ)()],d.prototype,"fieldsIndex",void 0),(0,i._)([(0,l.MZ)()],d.prototype,"fieldInfoMap",null),(0,i._)([(0,l.MZ)()],d.prototype,"fields",void 0),(0,i._)([(0,l.MZ)()],d.prototype,"objectIdField",void 0),(0,i._)([(0,l.MZ)()],d.prototype,"requiredFields",null),d=(0,i._)([(0,o.$)("esri.layers.support.TitleCreator")],d)},22671:(e,t,r)=>{r.d(t,{A:()=>m});var i,s=r(90237),n=r(52106),a=r(66552),l=r(25482),o=r(4718),u=r(10107),c=(r(44208),r(53966),r(36005)),d=r(40608),h=r(43937),p=r(16930),f=r(65864),y=r(50498),_=r(20437);const g=new a.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let m=i=class extends l.A{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,n.A)}writeGeometryType(e,t,r,i){if(e)return void g.write(e,t,r,i);const{features:s}=this;if(s)for(const e of s)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,f.rS)(e);return i&&!r&&t.spatialReference&&(i.spatialReference=p.A.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,o.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e?.[r];i.geometry=t?.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,s]}=e,n=this.features,a=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-i)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=n.length;e<t;e++)a?.(n[e].geometry)||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,s],scale:[n,a]}=r;let l=null,o=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;l=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;o=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*n+i),(e=>s-e*a),l,o);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const i=p.A.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){const n=e[t],a=r.fromJSON(n),l=n.geometry?.spatialReference;null==a.geometry||l||(a.geometry.spatialReference=i);const o=n.aggregateGeometries,u=a.aggregateGeometries;if(o&&null!=u)for(const e in u){const t=u[e],r=o[e],s=r?.spatialReference;null==t||s||(t.spatialReference=i)}s.push(a)}return s}_quantizePoints(e,t,r){let i,s;const n=[];for(let a=0,l=e.length;a<l;a++){const l=e[a];if(a>0){const e=t(l[0]),a=r(l[1]);e===i&&a===s||(n.push([e-i,a-s]),i=e,s=a)}else i=t(l[0]),s=r(l[1]),n.push([i,s])}return n.length>0?n:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,f.Bi)(e)?e.rings:e.paths,s=[];for(let e=0,n=i.length;e<n;e++){const n=i[e],a=this._quantizePoints(n,t,r);a&&s.push(a)}return s.length>0?((0,f.Bi)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i&&i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,i,s){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),i&&(e.z=i(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,f.Bi)(e)?e.rings:e.paths;let a,l;for(let e=0,i=n.length;e<i;e++){const i=n[e];for(let e=0,s=i.length;e<s;e++){const s=i[e];e>0?(a+=s[0],l+=s[1]):(a=s[0],l=s[1]),s[0]=t(a),s[1]=r(l)}}if(i&&s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2]),r[3]=s(r[3])}}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),i&&null!=e.zmax&&null!=e.zmin&&(e.zmax=i(e.zmax),e.zmin=i(e.zmin)),s&&null!=e.mmax&&null!=e.mmin&&(e.mmax=s(e.mmax),e.mmin=s(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let a,l;for(let e=0,i=n.length;e<i;e++){const i=n[e];e>0?(a+=i[0],l+=i[1]):(a=i[0],l=i[1]),i[0]=t(a),i[1]=r(l)}if(i&&s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2]),t[3]=s(t[3])}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2])}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=s(t[2])}}:null}};(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],m.prototype,"displayFieldName",void 0),(0,s._)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,u.MZ)({type:[n.A],json:{write:!0}})],m.prototype,"features",void 0),(0,s._)([(0,c.w)("features")],m.prototype,"readFeatures",null),(0,s._)([(0,u.MZ)({type:[_.A],json:{write:!0}})],m.prototype,"fields",void 0),(0,s._)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],m.prototype,"geometryType",void 0),(0,s._)([(0,h.K)("geometryType")],m.prototype,"writeGeometryType",null),(0,s._)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"hasM",void 0),(0,s._)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"hasZ",void 0),(0,s._)([(0,u.MZ)({types:y.yR,json:{write:!0}})],m.prototype,"queryGeometry",void 0),(0,s._)([(0,c.w)("queryGeometry")],m.prototype,"readQueryGeometry",null),(0,s._)([(0,u.MZ)({type:p.A,json:{write:!0}})],m.prototype,"spatialReference",void 0),(0,s._)([(0,h.K)("spatialReference")],m.prototype,"writeSpatialReference",null),(0,s._)([(0,u.MZ)({json:{write:!0}})],m.prototype,"transform",void 0),m=i=(0,s._)([(0,d.$)("esri.rest.support.FeatureSet")],m),m.prototype.toJSON.isDefaultToJSON=!0},30235:(e,t,r)=>{r.d(t,{A:()=>f});var i=r(52106),s=r(87449),n=r(11221),a=r(89169),l=r(33325),o=r(80609),u=r(39516),c=r(91075),d=r(13600),h=r(33143),p=r(20437);class f extends n.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return l.gO}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const r of this.fields)if("oid"===r.type||this._layer.objectIdField===r.name)e.push(r),t.push(r.name);else for(const i of this._overrideFields)if(i.toLowerCase()===r.name.toLowerCase()){e.push(r),t.push(r.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._databaseType=l.zl.Standardised,this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}_isInFeatureSet(){return l.J6.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,e.outFields=this._overrideFields??["*"],e.returnGeometry=!this._removeGeometry,e}_changeFeature(e){const t={};for(const r of this.fields)t[r.name]=e.attributes[r.name];return new i.A({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,r,i,s){let n="",c=!1;if(null!==i&&(n=i.constructClause(),c=!0),this.isTable()&&t&&null!==e&&""!==e)return new a.A([],[],!0,null);const d=this._createQuery();d.where=(0,u.mA)(d.where,null===r?null===t?"1=1":"":(0,o.YY)(r,l.zl.Standardised)),d.spatialRelationship=this._makeRelationshipEnum(e),d.outSpatialReference=this.spatialReference,d.orderByFields=""!==n?n.split(","):null,d.geometry=null===t?null:t,d.relationParameter=this._makeRelationshipParam(e);const h=await this._layer.queryFeatures(d);if(null===h)return new a.A([],[],c,null);this._checkCancelled(s);const p=[];return h.features.forEach((e=>{const t=e.attributes[this._layer.objectIdField];p.push(t),this._featureCache[t]=this._changeFeature(e)})),new a.A([],p,c,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;if(await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const e=[];return this._layer.source.items.forEach((t=>{const r=t.attributes[this._layer.objectIdField];e.push(r),this._featureCache[r]=this._changeFeature(t)})),this._wset=new a.A([],e,!1,null),this._wset}const e=this._createQuery();e.where="1=1";const t=await this._layer.queryFeatures(e),r=[];return t.features.forEach((e=>{const t=e.attributes[this._layer.objectIdField];r.push(t),this._featureCache[t]=this._changeFeature(e)})),this._wset=new a.A([],r,!1,null),this._wset}async _getFeatures(e,t,r){const i=[];-1!==t&&void 0===this._featureCache[t]&&i.push(t);for(let s=e._lastFetchedIndex;s<e._known.length&&(e._lastFetchedIndex+=1,!(void 0===this._featureCache[e._known[s]]&&(e._known[s]!==t&&i.push(e._known[s]),i.length>r)));s++);if(0===i.length)return"success";throw new s.dr(s.D_.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const r in e)t[r]=e[r];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let r=e.layerDefinition.objectIdField;const i=e.layerDefinition.typeIdField??"",s=[];if(e.layerDefinition.types)for(const t of e.layerDefinition.types)s.push(h.A.fromJSON(t));let n=e.layerDefinition.geometryType;void 0===n&&(n=e.featureSet.geometryType||"");let a=e.featureSet.features;const l=t.toJSON();if(!r){let t=!1;for(const i of e.layerDefinition.fields)if("oid"===i.type||"esriFieldTypeOID"===i.type){r=i.name,t=!0;break}if(!1===t){let t="FID",i=!0,s=0;for(;i;){let r=!0;for(const i of e.layerDefinition.fields)if(i.name===t){r=!1;break}!0===r?i=!1:(s++,t="FID"+s.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const n=[];for(let r=0;r<a.length;r++)n.push({geometry:e.featureSet.features[r].geometry,attributes:e.featureSet.features[r].attributes?this._cloneAttr(e.featureSet.features[r].attributes):{}}),n[r].attributes[t]=r;a=n,r=t}}const o=[];for(const t of e.layerDefinition.fields)t instanceof p.A?o.push(t):o.push(p.A.fromJSON(t));let u=n;switch(u||(u=""),u){case"esriGeometryPoint":u="point";break;case"esriGeometryPolyline":u="polyline";break;case"esriGeometryPolygon":u="polygon";break;case"esriGeometryEnvelope":u="extent";break;case"esriGeometryMultipoint":u="multipoint";break;case"":case"esriGeometryNull":u="esriGeometryNull"}if("esriGeometryNull"!==u)for(const e of a)e.geometry&&e.geometry instanceof c.A==0&&(e.geometry.type=u,void 0===e.geometry.spatialReference&&(e.geometry.spatialReference=l));else for(const e of a)e.geometry&&(e.geometry=null);const y={outFields:["*"],source:a,fields:o,hasZ:!0===e?.layerDefinition?.hasZ||!0===e?.featureSet?.hasZ,hasM:!0===e?.layerDefinition?.hasM||!0===e?.featureSet?.hasM,types:s,typeIdField:i,objectIdField:r,spatialReference:t},_="esriGeometryNull"===u||null===u;_||(y.geometryType=u);const g=new d.default(y);return e?.layerDefinition?.subtypeField&&e?.layerDefinition?.subtypes&&g.read({subtypes:e.layerDefinition.subtypes,subtypeField:e.layerDefinition.subtypeField}),new f({layer:g,spatialReference:t,isTable:_})}async queryAttachments(){return[]}async getFeatureByObjectId(e){const t=this._createQuery();t.where=this.objectIdField+"="+e.toString();const r=await this._layer.queryFeatures(t);return 1===r.features.length?r.features[0]:null}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return"preferredTimeZone"in this._layer?this._layer.preferredTimeZone:null}get dateFieldsTimeZone(){return"dateFieldsTimeZone"in this._layer?this._layer.dateFieldsTimeZone:null}get datesInUnknownTimezone(){return"datesInUnknownTimezone"in this._layer&&this._layer.datesInUnknownTimezone}get editFieldsInfo(){return"editFieldsInfo"in this._layer?this._layer.editFieldsInfo:null}get timeInfo(){return this._layer?.timeInfo}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return this.fsetInfo??{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}},32730:(e,t,r)=>{r.d(t,{BI:()=>_,D3:()=>f,XJ:()=>y,lc:()=>p,mX:()=>m,rU:()=>g,tH:()=>I});var i=r(799);const s="__begin__",n="__end__",a=new RegExp(s,"ig"),l=new RegExp(n,"ig"),o=new RegExp("^"+s,"i"),u=new RegExp(n+"$","i"),c='"',d=c+" + ",h=" + "+c;function p(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function f(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function y(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=p(e.labelExpression),t.type="conventional"),t}function _(e){const t=y(e);if(!t)return null;switch(t.type){case"conventional":return m(t.expression);case"arcade":return t.expression}return null}function g(e){const t=y(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(w);return t?.[1].trim()||null}(t.expression);case"arcade":return I(t.expression)}return null}function m(e){let t;return e?(t=(0,i.HC)(e,(e=>s+'$feature["'+e+'"]'+n)),t=o.test(t)?t.replace(o,""):c+t,t=u.test(t)?t.replace(u,""):t+c,t=t.replaceAll(a,d).replaceAll(l,h)):t='""',t}const w=/^\s*\{([^}]+)\}\s*$/i,F=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,S=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function I(e){if(!e)return null;let t=F.exec(e)||b.exec(e);return t?t[1]||t[3]:(t=S.exec(e),t?t[2]:null)}},32756:(e,t,r)=>{r.d(t,{Rr:()=>o,fY:()=>c,ne:()=>u});var i=r(90237),s=r(93637),n=r(10107),a=(r(44208),r(53966),r(87811),r(40608)),l=r(91880);function o(e,t,r){if(!e)return null;const i=e.find((e=>!!e.field));if(!i)return null;const s=new l.A;return s.read(i,r),[s]}const u={type:[l.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:o},write:{writer:function(e,t,r,i){const n=e.find((e=>!!e.field));n&&(0,s.sM)(r,[n.toJSON()],t)}}}},c=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return(0,i._)([(0,n.MZ)(u)],t.prototype,"orderBy",void 0),t=(0,i._)([(0,a.$)("esri.layers.mixins.OrderedLayer")],t),t}},33143:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(90237),s=r(69540),n=r(25482),a=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),o=r(40608),u=r(43937),c=r(80451),d=r(29005);let h=class extends(s.A.ClonableMixin(n.A)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,c.rS)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,i._)([(0,a.MZ)({json:{write:!0}})],h.prototype,"id",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],h.prototype,"name",void 0),(0,i._)([(0,a.MZ)({json:{write:!0}})],h.prototype,"domains",void 0),(0,i._)([(0,l.w)("domains")],h.prototype,"readDomains",null),(0,i._)([(0,u.K)("domains")],h.prototype,"writeDomains",null),(0,i._)([(0,a.MZ)({type:[d.A],json:{write:!0}})],h.prototype,"templates",void 0),h=(0,i._)([(0,o.$)("esri.layers.support.FeatureType")],h)},35704:(e,t,r)=>{r.d(t,{A:()=>d});var i=r(87449),s=r(11221),n=r(89169),a=r(33325),l=r(80609),o=r(74887),u=r(88368),c=r(16930);class d extends s.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof u.A?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new c.A({wkid:4326}),this.geometryType=a.ik.point)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),null!==this._whereClauseFunction?this._wset=new n.A(t._candidates.slice().concat(t._known.slice()),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new n.A(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent?._isInFeatureSet(e);return t===a.J6.NotInFeatureSet?t:(t=this._idstates[e],void 0===t?a.J6.Unknown:t)}_getFeature(e,t,r){return this._parent._getFeature(e,t,r)}_getFeatures(e,t,r,i){return this._parent._getFeatures(e,t,r,i)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){return this._whereclause?.testFeature(e)??!1}async executeWhereClauseDeferred(e){if(null!==this._whereClauseFunction){const t=this._whereClauseFunction(e);return(0,o.$X)(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,r){const i=new n.A([],e,!1,null),s=Math.min(t,e.length);if(await(this._parent?._getFeatures(i,-1,s,r)),this._checkCancelled(r),null==this._whereClauseFunction){for(let t=0;t<s;t++){const r=this._parent?._featureFromCache(e[t]);!0===this.executeWhereClause(r)?this._idstates[e[t]]=a.J6.InFeatureSet:this._idstates[e[t]]=a.J6.NotInFeatureSet}return"success"}const l=[];for(let t=0;t<s;t++){const r=this._parent?._featureFromCache(e[t]);l.push(await this.executeWhereClauseDeferred(r))}for(let r=0;r<t;r++)!0===l[r]?this._idstates[e[r]]=a.J6.InFeatureSet:this._idstates[e[r]]=a.J6.NotInFeatureSet;return"success"}async _getFilteredSet(e,t,r,i,s){null!==this._whereClauseFunction||(null!==r?null!==this._whereclause&&(r=(0,l.kg)(this._whereclause,r)):r=this._whereclause),await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,r,i,s);let o;return this._checkCancelled(s),o=null!==this._whereClauseFunction?new n.A(a._candidates.slice().concat(a._known.slice()),[],a._ordered,this._clonePageDefinition(a.pagesDefinition)):new n.A(a._candidates.slice(),a._known.slice(),a._ordered,this._clonePageDefinition(a.pagesDefinition)),o}async _stat(e,t,r,i,s,n,a){if(null!==this._whereClauseFunction)return null===s&&""===r&&null===i?this._manualStat(e,t,n,a):{calculated:!1};let o=this._whereclause;null!==s&&null!==this._whereclause&&(o=(0,l.kg)(this._whereclause,s));const u=await this._parent._stat(e,t,r,i,o,n,a);return!1===u.calculated?null===s&&""===r&&null===i?this._manualStat(e,t,n,a):{calculated:!1}:u}async _canDoAggregates(e,t,r,i,s){return null===this._whereClauseFunction&&(null!==s?null!==this._whereclause&&(s=(0,l.kg)(this._whereclause,s)):s=this._whereclause,null!==this._parent&&this._parent._canDoAggregates(e,t,r,i,s))}async _getAggregatePagesDataSourceDefinition(e,t,r,s,n,a,o){if(null===this._parent)throw new i.dr(i.D_.NeverReach);return null!==n?null!==this._whereclause&&(n=(0,l.kg)(this._whereclause,n)):n=this._whereclause,this._parent._getAggregatePagesDataSourceDefinition(e,t,r,s,n,a,o)}static registerAction(){s.A._featuresetFunctions.filter=function(e){if("function"==typeof e)return new d({parentfeatureset:this,whereclause:e});let t=null;return e instanceof u.A&&(t=e),new d({parentfeatureset:this,whereclause:t})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},36708:(e,t,r)=>{r.d(t,{C_:()=>h,OH:()=>y,Vh:()=>_,on:()=>d,pc:()=>g,wB:()=>o,z7:()=>u});var i=r(37955),s=r(36563),n=r(97768),a=r(74887),l=r(14012);function o(e,t,r={}){return c(e,t,r,p)}function u(e,t,r={}){return c(e,t,r,f)}function c(e,t,r={},i){let s=null;const a=r.once?(e,r)=>{i(e)&&((0,n.xt)(s),t(e,r))}:(e,r)=>{i(e)&&t(e,r)};if(s=(0,l.Cn)(e,a,r.sync,r.equals),r.initial){const t=e();a(t,t)}return s}function d(e,t,r,a={}){let l=null,u=null,c=null;function d(){l&&u&&(u.remove(),a.onListenerRemove?.(l),l=null,u=null)}function h(e){a.once&&a.once&&(0,n.xt)(c),r(e)}const p=o(e,((e,r)=>{d(),(0,i.wb)(e)&&(l=e,u=(0,i.on)(e,t,h),a.onListenerAdd?.(e))}),{sync:a.sync,initial:!0});return c=(0,s.hA)((()=>{p.remove(),d()})),c}function h(e,t){return function(e,t,r){if((0,a.G4)(r))return Promise.reject((0,a.NK)());const i=e();if(t?.(i))return Promise.resolve(i);let l=null;function o(){l=(0,n.xt)(l)}return new Promise(((i,n)=>{l=(0,s.vE)([(0,a.u7)(r,(()=>{o(),n((0,a.NK)())})),c(e,(e=>{o(),i(e)}),{sync:!1,once:!0},t??p)])}))}(e,f,t)}function p(e){return!0}function f(e){return!!e}r(80559);const y={sync:!0},_={initial:!0},g={sync:!0,initial:!0}},39516:(e,t,r)=>{let i;async function s(){return null==i&&(i=Promise.all([r.e(8368),r.e(4123)]).then(r.bind(r,44123)).then((e=>new e.WhereClauseCache(500,500)))),i}async function n(e,t){const r=await s(),i=r.get(e,t);if(null==i)throw r.getError(e,t);return i}function a(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function l(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}r.d(t,{GP:()=>n,IW:()=>l,mA:()=>a})},40334:(e,t,r)=>{r.r(t),r.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>te,constructFeatureSet:()=>X,constructFeatureSetFromPortalItem:()=>oe,constructFeatureSetFromRelationship:()=>re,constructFeatureSetFromUrl:()=>H,convertToFeatureSet:()=>le,createFeatureSetCollectionFromMap:()=>ne,createFeatureSetCollectionFromService:()=>ae,initialiseMetaDataCache:()=>Y});var i=r(78888);class s{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,r){this._layerById[t]=r,this._layerByName[e]=r}async featureSetByName(e,t=!0,r=["*"]){return void 0===this._layerByName[e]?null:this._layerByName[e]}async featureSetById(e,t=!0,r=["*"]){return void 0===this._layerById[e]?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}}var n=r(78878),a=r(35704),l=r(52106),o=r(68423),u=r(86691),c=r(87449),d=r(11221),h=r(89169),p=r(87594),f=r(33325),y=r(80609),_=r(1262),g=r(88368);class m{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new m;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,r,i){const s=new m;s.field=e;const n=g.A.create(t,{fieldsIndex:r,timeZone:i}),a=function(e){if("function"===e.parseTree.type){if(0===e.parseTree.args.value.length)return{name:e.parseTree.name,expr:null};if(e.parseTree.args.value.length>1)throw new _.L8(_.Z7.MissingStatisticParameters);const t=g.A.create((0,y.Mi)(e.parseTree.args.value[0],f.zl.Standardised,e.parameters),{fieldsIndex:e.fieldsIndex,timeZone:e.timeZone,currentUser:e.currentUser});return{name:e.parseTree.name,expr:t}}return null}(n);if(null===a)throw new _.L8(_.Z7.UnsupportedSqlFunction,{function:""});const l=a.name.toUpperCase().trim();if("MIN"===l){if(s.typeofstat="MIN",s.workingexpr=a.expr,null===n)throw new _.L8(_.Z7.InvalidFunctionParameters,{function:"min"})}else if("MAX"===l){if(s.typeofstat="MAX",s.workingexpr=a.expr,null===n)throw new _.L8(_.Z7.InvalidFunctionParameters,{function:"max"})}else if("COUNT"===l)s.typeofstat="COUNT",s.workingexpr=a.expr;else if("STDEV"===l){if(s.typeofstat="STDDEV",s.workingexpr=a.expr,null===n)throw new _.L8(_.Z7.InvalidFunctionParameters,{function:"stdev"})}else if("SUM"===l){if(s.typeofstat="SUM",s.workingexpr=a.expr,null===n)throw new _.L8(_.Z7.InvalidFunctionParameters,{function:"sum"})}else if("MEAN"===l){if(s.typeofstat="AVG",s.workingexpr=a.expr,null===n)throw new _.L8(_.Z7.InvalidFunctionParameters,{function:l})}else if("AVG"===l){if(s.typeofstat="AVG",s.workingexpr=a.expr,null===n)throw new _.L8(_.Z7.InvalidFunctionParameters,{function:"avg"})}else{if("VAR"!==l)throw new _.L8(_.Z7.UnsupportedSqlFunction,{function:l});if(s.typeofstat="VAR",s.workingexpr=a.expr,null===n)throw new _.L8(_.Z7.InvalidFunctionParameters,{function:"var"})}return s}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}}var w=r(80200),F=r(74639),b=r(44729),S=r(55612),I=r(15032),v=r(16930),A=r(20437),T=r(95466);function x(e){if(!e)return"COUNT";switch(e.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}class C extends d.A{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(null===this._wset){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return f.J6.InFeatureSet}_nextUniqueName(e){for(;1===e["T"+this._uniqueIds.toString()];)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,r=1;const i=this._parent?this._parent.getFieldsIndex():new T.A([]);for(this.objectIdField="ROW__ID",this.globalIdField="";!1===t;){let e=!1;for(let t=0;t<this._config.groupbyfields.length;t++)if(this._config.groupbyfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}if(!1===e)for(let t=0;t<this._config.statsfields.length;t++)if(this._config.statsfields[t].name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}!1===e?t=!0:(this.objectIdField="ROW__ID"+r.toString(),r++)}for(const e of this._config.statsfields){const t=new m;t.field=e.name,t.tofieldname=e.name,t.workingexpr=e.expression instanceof g.A?e.expression:g.A.create(e.expression,{fieldsIndex:i,timeZone:this.dateFieldsTimeZoneDefaultUTC}),t.typeofstat=x(e.statistic),this._decodedStatsfield.push(t)}this._decodedGroupbyfield=[];for(const e of this._config.groupbyfields){const t={name:e.name,singlefield:null,tofieldname:e.name,expression:e.expression instanceof g.A?e.expression:g.A.create(e.expression,{fieldsIndex:i,timeZone:this.dateFieldsTimeZoneDefaultUTC}),sqlType:null};this._decodedGroupbyfield.push(t)}if(null!==this._parent){this.geometryType=this._parent.geometryType,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField="";for(const t of this._parent.fields)e[t.name.toUpperCase()]=1;this.types=null,this.subtypes=null,this.subtypeField=""}else this.geometryType=f.ik.point,this.typeIdField="",this.types=null,this.subtypes=null,this.subtypeField="",this.spatialReference=new v.A({wkid:4326});this.fields=[];const s=new m;s.field=this._nextUniqueName(e),s.tofieldname=this.objectIdField,s.workingexpr=g.A.create(this._parent.objectIdField,{fieldsIndex:this._parent.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),s.typeofstat="MIN",this._decodedStatsfield.push(s);for(const t of this._decodedGroupbyfield){const r=new A.A;if(t.name=this._nextUniqueName(e),r.name=t.tofieldname,r.alias=r.name,(0,y.DA)(t.expression)){const e=this._parent.getField((0,y.YY)(t.expression,f.zl.Standardised));if(!e)throw new c.dr(c.D_.AggregationFieldNotFound);t.name=e.name,t.singlefield=e.name,this.phsyicalgroupbyfields.push(e.name),r.type=e.type,t.sqlType=e.type}else{r.type=this._convertToEsriFieldType((0,y.IY)(t.expression,this._parent.fields));const e=new A.A;e.name=t.name,e.alias=e.name,this.phsyicalgroupbyfields.push(t.name),this._adaptedFields.push(new o.Gr(e,t.expression)),this._candosimplegroupby=!1,t.sqlType=r.type}this.fields.push(r)}if(this._adaptedFields.length>0)for(const e of this._parent.fields)this._adaptedFields.push(new o.IO(e));for(let t=0;t<this._decodedStatsfield.length;t++){const r=new A.A;let i=null;const s=this._decodedStatsfield[t];s.field=this._nextUniqueName(e),s.tofieldname===this.objectIdField&&(this._internalObjectIdField=s.field),r.name=s.tofieldname,r.alias=r.name;const n=null!==s.workingexpr&&(0,y.DA)(s.workingexpr)?(0,y.YY)(s.workingexpr,f.zl.Standardised):"";switch(this._decodedStatsfield[t].typeofstat){case"SUM":if(""!==n){if(i=this._parent.getField(n),!i)throw new c.dr(c.D_.AggregationFieldNotFound);r.type=i.type}else r.type="double";break;case"MIN":case"MAX":if(""!==n){if(i=this._parent.getField(n),!i)throw new c.dr(c.D_.AggregationFieldNotFound);r.type=i.type}else r.type="double";break;case"COUNT":r.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==n&&(i=this._parent.getField(n),!i))throw new c.dr(c.D_.AggregationFieldNotFound);r.type="double"}this.fields.push(r)}}async _canDoAggregates(){return!1}async _getFeatures(e,t,r,i){-1!==t&&this._featureCache[t];const s=this._maxQuery;return!0===this._checkIfNeedToExpandKnownPage(e,s)?(await this._expandPagedSet(e,s,0,0,i),this._getFeatures(e,t,r,i)):"success"}async _getFilteredSet(e,t,r,i,s){if(""!==e)return new h.A([],[],!0,null);let n=null;const l={ordered:!1,nowhereclause:!1};if(await this._ensureLoaded(),null!==r)for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===(0,y.Ju)(r,this._decodedStatsfield[e].tofieldname)){l.nowhereclause=!0,r=null;break}if(null!==i){l.ordered=!0;for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===i.scanForField(this._decodedStatsfield[e].tofieldname)){i=null,l.ordered=!1;break}if(null!==i)for(const e of this._decodedGroupbyfield)if(null===e.singlefield&&!0===i.scanForField(e.tofieldname)){i=null,l.ordered=!1;break}}if(!1!==this._candosimplegroupby&&await this._parent._canDoAggregates(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,null)){let e=null;r&&(e=this._reformulateWhereClauseWithoutGroupByFields(r));let t=null;i&&(t=this._reformulateOrderClauseWithoutGroupByFields(i));const a=await this._parent._getAggregatePagesDataSourceDefinition(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,e,t,this._internalObjectIdField);return this._checkCancelled(s),n=!0===l.nowhereclause?new h.A(a._candidates.slice().concat(a._known.slice()),[],!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)):new h.A(a._candidates.slice(),a._known.slice(),!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)),n}let c=this._parent;if(this._adaptedFields.length>0&&(c=new o.a({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),!0===l.nowhereclause)n=new h.A(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new u.A({parentfeatureset:c,orderbyclause:new p.A(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let e=c;if(null!==r){let t=null;r&&(t=this._reformulateWhereClauseWithoutGroupByFields(r)),e=new a.A({parentfeatureset:e,whereclause:t})}n=new h.A(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new u.A({parentfeatureset:e,orderbyclause:new p.A(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return n}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=(0,y.bD)(e,t.tofieldname,(0,y.YY)(t.workingexpr,f.zl.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=(0,y.bD)(e,t.tofieldname,(0,y.YY)(t.expression,f.zl.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const e of this._decodedGroupbyfield)e.tofieldname!==e.name&&t.push({field:e.tofieldname,newfield:e.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return null===e?null:!0===e.aggregatefeaturesetpagedefinition?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,r){return!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)?(await this._expandPagedSet(e,this._maxQuery,0,0,r),this._refineSetBlock(e,t,r)):(this._checkCancelled(r),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,r,i,s){return this._expandPagedSetFeatureSet(e,t,r,i,s)}async _getPhysicalPage(e,t,r){if(!0===e.pagesDefinition.aggregatefeaturesetpagedefinition)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,r,[]);const i=await this._getAgregagtePhysicalPage(e,t,r);for(const e of i){const t={geometry:e.geometry,attributes:{}},r={};for(const t in e.attributes)r[t.toLowerCase()]=e.attributes[t];for(const e of this._decodedGroupbyfield)t.attributes[e.tofieldname]=r[e.name.toLowerCase()];for(const e of this._decodedStatsfield)t.attributes[e.tofieldname]=r[e.field.toLowerCase()];this._featureCache[t.attributes[this.objectIdField]]=new l.A(t)}return i.length}_sequentialGetPhysicalItem(e,t,r,i){return new Promise(((s,n)=>{null===e.pagesDefinition.internal.iterator&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(r)),!0===e.pagesDefinition.internal.fullyResolved||0===t?s(i.length):this._nextAggregateItem(e,t,r,i,(n=>{null===n?s(i.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,r,i)))}),n)}))}_nextAggregateItem(e,t,r,i,s,a){try{(0,n.a0)(e.pagesDefinition.internal.iterator.next()).then((n=>{if(null===n)if(null!==e.pagesDefinition.internal.workingItem){const t=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);i.push(t),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(t.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,s(null)}else e.pagesDefinition.internal.fullyResolved=!0,s(null);else{const l=this._generateAggregateHash(n);if(null===e.pagesDefinition.internal.workingItem)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const r=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return i.push(r),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(r.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void s(r)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,r,i,s,a)}}),a)}catch(e){a(e)}}_calculateFieldStat(e,t,r){const i=[];for(const r of e.features)if(null!==t.workingexpr){const e=t.workingexpr.calculateValue(r);null!==e&&(e instanceof b.n||e instanceof I.k?i.push(e.toNumber()):e instanceof S.g?i.push(e.toMilliseconds()):i.push(e))}else i.push(null);r.attributes[t.tofieldname]=(0,F.s)(t.typeofstat,[i])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const r of this._decodedGroupbyfield){const i=r.singlefield?e.features[0].attributes[r.singlefield]:g.A.convertValueToStorageFormat(r.expression.calculateValue(e.features[0]),r.sqlType);t.attributes[r.tofieldname]=i}for(const r of this._decodedStatsfield)this._calculateFieldStat(e,r,t);const r=[];for(let i=0;i<this._decodedStatsfield.length;i++)r.push(this._calculateFieldStat(e,this._decodedStatsfield[i],t));return this._featureCache[t.attributes[this.objectIdField]]=new l.A({attributes:t.attributes,geometry:t.geometry}),t}_generateAggregateHash(e){let t="";for(const r of this._decodedGroupbyfield){const i=r.singlefield?e.attributes[r.singlefield]:r.expression.calculateValue(e);t+=null==i?":":":"+i.toString()}return(0,w.d)(t,w.T.String)}async _stat(){return{calculated:!1}}async getFeatureByObjectId(){return null}static registerAction(){d.A._featuresetFunctions.groupby=function(e,t){return new C({parentfeatureset:this,groupbyfields:e,statsfields:t})}}}var D=r(54784),R=r(54461),k=r(70333),L=r(61454),N=r(66395),E=r(50145),P=r(39516),O=r(65864),M=r(21325),j=r(13600),G=r(54546),U=r(61956),B=r(7562);class q extends d.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return f.gO}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+(0,f.JB)(e.toJSON());return(0,w.d)(t,w.T.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer?.capabilities?.data?.supportsZ,this.hasM=!0===this._layer?.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const r of this.fields)if("oid"===r.type)e.push(r),t.push(r.name);else for(const i of this._overrideFields)if(i.toLowerCase()===r.name.toLowerCase()){e.push(r),t.push(r.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=f.zl.StandardisedNoInterval,null!=e&&e>=10.61&&(this._databaseType=f.zl.Standardised)):null!=e&&(e>=10.5&&(this._databaseType=f.zl.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=f.zl.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}_isInFeatureSet(){return f.J6.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new U.A;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch(e){return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?"subtype-group"===this._layer.type&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const r="execute"===t?this._layer.queryFeatures.bind(this._layer):"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let i=null;if(this.recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);i=this.recentlyUsedQueries.getFromCache(t),null===i&&(i=r(e),this.recentlyUsedQueries.addToCache(t,i),i=i.catch((e=>{throw this.recentlyUsedQueries?.removeFromCache(t),e})))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===i&&(i=r(e)),i}async _getFilteredSet(e,t,r,i,s){const n=await this.databaseType();if(this.isTable()&&t&&null!==e&&""!==e)return new h.A([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,r,i,s);let a="",l=!1;null!==i&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(a=i.constructClause(),l=!0);const o=this._createQuery();o.where=(0,P.mA)(o.where,null===r?null===t?"1=1":"":(0,y.YY)(r,n)),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==a?a.split(","):null,o.geometry=null===t?null:t,o.relationParameter=this._makeRelationshipParam(e);let u=await this.executeQuery(o,"executeForIds");return null===u&&(u=[]),this._checkCancelled(s),new h.A([],u,l,null)}_expandPagedSet(e,t,r,i,s){return this._expandPagedSetFeatureSet(e,t,r,i,s)}async _getFilteredSetUsingPaging(e,t,r,i,s){let n="",a=!1;null!==i&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(n=i.constructClause(),a=!0);const l=await this.databaseType(),o=null===r?null===t?"1=1":"":(0,y.YY)(r,l);let u=this._maxQueryRate();const c=this._layer.capabilities?.query.maxRecordCount;null!=c&&c<u&&(u=c);let d=null;if(!0===this._pageJustIds)d=new h.A([],["GETPAGES"],a,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:this._layer.objectIdField,resultRecordCount:u,resultOffset:0,geometry:null===t?null:t,where:o,orderByFields:n,returnGeometry:!1,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}});else{let r=!0;!0===this._removeGeometry&&(r=!1);const i=this._overrideFields??this._fieldsIncludingObjectId(["*"]);d=new h.A([],["GETPAGES"],a,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:i.join(","),resultRecordCount:u,resultOffset:0,geometry:null===t?null:t,where:o,orderByFields:n,returnGeometry:r,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}})}return await this._expandPagedSet(d,u,0,1,s),d}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,spatialRel:e.spatialRel,relationParam:e.relationParam,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,r){const i=e.pagesDefinition.internal.lastRetrieved,s=i,n=e.pagesDefinition.internal.lastPage,a=this._createQuery();a.spatialRelationship=e.pagesDefinition.spatialRel,a.relationParameter=e.pagesDefinition.relationParam,a.outFields=e.pagesDefinition.outFields.split(","),a.num=e.pagesDefinition.resultRecordCount,a.start=e.pagesDefinition.internal.lastPage,a.geometry=e.pagesDefinition.geometry,a.where=(0,P.mA)(a.where,e.pagesDefinition.where),a.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,a.returnGeometry=e.pagesDefinition.returnGeometry,a.outSpatialReference=this.spatialReference;const l=await this.executeQuery(a,"execute");if(this._checkCancelled(r),e.pagesDefinition.internal.lastPage!==n)return"done";const o=this._layer.objectIdField;for(let t=0;t<l.features.length;t++)e.pagesDefinition.internal.set[s+t]=l.features[t].attributes[o];if(!1===this._pageJustIds)for(let e=0;e<l.features.length;e++)this._featureCache[l.features[e].attributes[o]]=l.features[e];return(void 0===l.exceededTransferLimit&&l.features.length!==e.pagesDefinition.resultRecordCount||!1===l.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=i+l.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,"done"}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return!1===r&&t.push(this.objectIdField),t}async _getFeatures(e,t,r,i){const s=[];if(-1!==t&&void 0===this._featureCache[t]&&s.push(t),!0===this._checkIfNeedToExpandKnownPage(e,this._maxProcessingRate()))return await this._expandPagedSet(e,this._maxProcessingRate(),0,0,i),this._getFeatures(e,t,r,i);let n=0;for(let i=e._lastFetchedIndex;i<e._known.length;i++){if(e._lastFetchedIndex+=1,n++,void 0===this._featureCache[e._known[i]]){let r=!1;if(null!==this._layer._mode&&void 0!==this._layer._mode){const t=this._layer._mode;if(void 0!==t._featureMap[e._known[i]]){const s=t._featureMap[e._known[i]];null!==s&&(r=!0,this._featureCache[e._known[i]]=s)}}if(!1===r&&(e._known[i]!==t&&s.push(e._known[i]),s.length>=this._maxProcessingRate()-1))break}if(n>=r&&0===s.length)break}if(0===s.length)return"success";const a=this._createQuery();a.objectIds=s,a.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),a.returnGeometry=!0,!0===this._removeGeometry&&(a.returnGeometry=!1),a.outSpatialReference=this.spatialReference;const l=await this.executeQuery(a,"execute");if(this._checkCancelled(i),void 0!==l.error)throw new c.dr(c.D_.RequestFailed,{reason:l.error});const o=this._layer.objectIdField;for(let e=0;e<l.features.length;e++)this._featureCache[l.features[e].attributes[o]]=l.features[e];return"success"}async _getDistinctPages(e,t,r,i,s,n,a,l,o){await this._ensureLoaded();const u=await this.databaseType();let d=r.parseTree.column;const h=this._layer.fields??[];for(let e=0;e<h.length;e++)if(h[e].name.toLowerCase()===d.toLowerCase()){d=h[e].name;break}const p=this._createQuery();p.where=(0,P.mA)(p.where,null===n?null===s?"1=1":"":(0,y.YY)(n,u)),p.spatialRelationship=this._makeRelationshipEnum(i),p.relationParameter=this._makeRelationshipParam(i),p.geometry=null===s?null:s,p.returnDistinctValues=!0,p.returnGeometry=!1,p.outFields=[d];const f=await this.executeQuery(p,"execute");if(this._checkCancelled(o),!f.hasOwnProperty("features"))throw new c.dr(c.D_.InvalidStatResponse);let _=!1;for(let e=0;e<h.length;e++)if(h[e].name===d){"date"===h[e].type&&(_=!0);break}for(let e=0;e<f.features.length;e++){if(_){const t=f.features[e].attributes[d];null!==t?l.push(new Date(t)):l.push(t)}else l.push(f.features[e].attributes[d]);if(l.length>=a)break}return 0===f.features.length?l:f.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length<a?{calculated:!0,result:await this._getDistinctPages(e+f.features.length,t,r,i,s,n,a,l,o)}:l}async _distinctStat(e,t,r,i,s,n,a){return{calculated:!0,result:await this._getDistinctPages(0,e,t,r,i,s,n,[],a)}}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}async _countstat(e,t,r,i){const s=await this.databaseType();if(this.isTable()&&r&&null!==t&&""!==t)return{calculated:!0,result:0};const n=this._createQuery();return n.where=(0,P.mA)(n.where,null===i?null===r?"1=1":"":(0,y.YY)(i,s)),n.spatialRelationship=this._makeRelationshipEnum(t),n.relationParameter=this._makeRelationshipParam(t),n.geometry=null===r?null:r,n.returnGeometry=!1,{calculated:!0,result:await this.executeQuery(n,"executeForCount")}}async _stats(e,t,r,i,s,n,a){await this._ensureLoaded();const l=this._layer.capabilities?.query,o=!!l?.supportsSqlExpression,u=!!l?.supportsStatistics,d=!!l?.supportsDistinct;if("count"===e)return d?this._countstat(e,r,i,s):{calculated:!1};if(!1===u||!1===(0,y.DA)(t)&&!1===o||!1===t.isStandardized)return""!==r||null!==s?{calculated:!1}:this._manualStat(e,t,n,a);if("distinct"===e)return!1===d?""!==r||null!==s?{calculated:!1}:this._manualStat(e,t,n,a):this._distinctStat(e,t,r,i,s,n,a);const h=await this.databaseType();if(this.isTable()&&i&&null!==r&&""!==r)return{calculated:!0,result:null};const p=this._createQuery();p.where=(0,P.mA)(p.where,null===s?null===i?"1=1":"":(0,y.YY)(s,h)),p.spatialRelationship=this._makeRelationshipEnum(r),p.relationParameter=this._makeRelationshipParam(r),p.geometry=null===i?null:i;const f=new B.A;f.statisticType=(0,E.Dp)(e),f.onStatisticField=(0,y.YY)(t,h),f.outStatisticFieldName="ARCADE_STAT_RESULT",p.returnGeometry=!1;let _="ARCADE_STAT_RESULT";p.outStatistics=[f];const g=await this.executeQuery(p,"execute");if(!g.hasOwnProperty("features")||0===g.features.length)throw new c.dr(c.D_.InvalidStatResponse);let m=!1;const w=g.fields??[];for(let e=0;e<w.length;e++)if("ARCADE_STAT_RESULT"===w[e].name.toUpperCase()){_=w[e].name,"date"===w[e].type&&(m=!0);break}if(m){let e=g.features[0].attributes[_];return null!==e&&(e=new Date(g.features[0].attributes[_])),{calculated:!0,result:e}}return{calculated:!0,result:g.features[0].attributes[_]}}_stat(e,t,r,i,s,n,a){return this._stats(e,t,r,i,s,n,a)}async _canDoAggregates(e,t){await this._ensureLoaded();let r=!1;const i=this._layer.capabilities?.query,s=!0===i?.supportsSqlExpression;if(null!=i&&!0===i.supportsStatistics&&!0===i.supportsOrderBy&&(r=!0),r)for(let e=0;e<t.length-1;e++)(!1===t[e].workingexpr?.isStandardized||!1===(0,y.DA)(t[e].workingexpr)&&!1===s)&&(r=!1);return!1!==r}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _getAggregatePagesDataSourceDefinition(e,t,r,i,s,n,a){await this._ensureLoaded();const l=await this.databaseType();let o="",u=!1,c=!1;null!==n&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(o=n.constructClause(),c=!0),this._layer.capabilities&&this._layer.capabilities.query&&!1===this._layer.capabilities.query.supportsPagination&&(c=!1,u=!0,o=this._layer.objectIdField);const d=[];for(let e=0;e<t.length;e++){const r=new B.A;r.onStatisticField=null!==t[e].workingexpr?(0,y.YY)(t[e].workingexpr,l):"",r.outStatisticFieldName=t[e].field,r.statisticType=t[e].toStatisticsName(),d.push(r)}""===o&&(o=e.join(","));let p=this._maxQueryRate();const f=this._layer.capabilities?.query.maxRecordCount;null!=f&&f<p&&(p=f);const _=null===s?null===i?"1=1":"":(0,y.YY)(s,l);return new h.A([],["GETPAGES"],c,{groupbypage:!0,spatialRel:this._makeRelationshipEnum(r),relationParam:this._makeRelationshipParam(r),outFields:["*"],useOIDpagination:u,generatedOid:a,resultRecordCount:p,resultOffset:0,groupByFieldsForStatistics:e,outStatistics:d,geometry:null===i?null:i,where:_,orderByFields:o,returnGeometry:!1,returnIdsOnly:!1,internal:{lastMaxId:-1,set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}})}async _getAgregagtePhysicalPage(e,t,r){let i=e.pagesDefinition.where;!0===e.pagesDefinition.useOIDpagination&&(i=(0,P.mA)(i,e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString()));const s=e.pagesDefinition.internal.lastRetrieved,n=s,a=e.pagesDefinition.internal.lastPage,o=this._createQuery();if(o.where=(0,P.mA)(o.where,i),o.spatialRelationship=e.pagesDefinition.spatialRel,o.relationParameter=e.pagesDefinition.relationParam,o.outFields=e.pagesDefinition.outFields,o.outStatistics=e.pagesDefinition.outStatistics,o.geometry=e.pagesDefinition.geometry,o.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,o.num=e.pagesDefinition.resultRecordCount,o.start=e.pagesDefinition.internal.lastPage,o.returnGeometry=e.pagesDefinition.returnGeometry,o.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&o.geometry&&o.spatialRelationship)return[];const u=await this.executeQuery(o,"execute");if(this._checkCancelled(r),!u.hasOwnProperty("features"))throw new c.dr(c.D_.InvalidStatResponse);const d=[];if(e.pagesDefinition.internal.lastPage!==a)return[];u.features.length>0&&void 0===u.features[0].attributes[e.pagesDefinition.generatedOid]&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let t=0;t<u.features.length;t++)e.pagesDefinition.internal.set[n+t]=u.features[t].attributes[e.pagesDefinition.generatedOid];for(let e=0;e<u.features.length;e++)d.push(new l.A({attributes:u.features[e].attributes,geometry:null}));return!0===e.pagesDefinition.useOIDpagination?0===u.features.length?e.pagesDefinition.internal.fullyResolved=!0:e.pagesDefinition.internal.lastMaxId=u.features[u.features.length-1].attributes[e.pagesDefinition.generatedOid]:(void 0===u.exceededTransferLimit&&u.features.length!==e.pagesDefinition.resultRecordCount||!1===u.exceededTransferLimit)&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=s+u.features.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,d}static create(e,t,r,i,s){const n=new j.default({url:e,outFields:null===t?["*"]:t});return new q({layer:n,spatialReference:r,lrucache:i,interceptor:s})}relationshipMetaData(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,f.Qi)(this._layer.parsedUrl.path)}async queryAttachments(e,t,r,i,s){const n=this._layer;if(function(e){const t=e.capabilities;return t?.data.supportsAttachment&&t?.operations.supportsQueryAttachments}(n)){const a={objectIds:[e],returnMetadata:s};(t&&t>0||r&&r>0)&&(a.size=[t&&t>0?t:0,r&&r>0?r:t+1]),i&&i.length>0&&(a.attachmentTypes=i),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:n,query:a,method:"attachments"});const l=await n.queryAttachments(new G.A(a)),o=[];return l&&l[e]&&l[e].forEach((t=>{const r=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+t.id.toString();let i=null;s&&t.exifInfo&&(i=N.A.convertJsonToArcade(t.exifInfo,"system",!0)),o.push(new L.A(t.id,t.name,t.contentType,t.size,r,i,t.keywords??null))})),o}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.join(","),returnGeometry:e.returnGeometry.toString()};void 0!==e.resultOffset&&null!==e.resultOffset&&(t.resultOffset=e.resultOffset.toString()),void 0!==e.resultRecordCount&&null!==e.resultRecordCount&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=(0,M.YX)(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const r=await(0,i.A)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(r.data){const e={},t=r.data;if(t?.relatedRecordGroups){const r=t.spatialReference;for(const i of t.relatedRecordGroups){const s=i.objectId,n=[];for(const e of i.relatedRecords){e.geometry&&(e.geometry.spatialReference=r);const t=new l.A({geometry:e.geometry?(0,O.rS)(e.geometry):null,attributes:e.attributes});n.push(t)}e[s]={features:n,exceededTransferLimit:!0===t.exceededTransferLimit}}}return e}throw new c.dr(c.D_.InvalidRequest)}async getFeatureByObjectId(e,t){const r=this._createQuery();r.outFields=t,r.returnGeometry=!1,r.outSpatialReference=this.spatialReference,r.where=(0,P.mA)(r.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:r,method:"execute"});const i=await this._layer.queryFeatures(r);return 1===i.features.length?i.features[0]:null}async getIdentityUser(){await this.load();const e=k.id?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=k.id?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const r=t.toLowerCase().indexOf("/rest/services");if(t=r>-1?t.slice(0,r):t,t){t+="/rest/info";try{const e=await(0,i.A)(t,{query:{f:"json"}});let r="";return e.data?.owningSystemUrl&&(r=e.data.owningSystemUrl),r}catch(e){return""}}return""}getDataSourceFeatureSet(){const e=new q({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const r=this._layer.parsedUrl?.path??null;if(r){const s=await(0,i.A)(r,{responseType:"json",query:{f:"json"}});e=s?.data?.name??null,t=s?.data?.serviceItemId??null}const s=this._layer.title&&null!==(this._layer.parent??null);return this.featureSetInfo={layerId:this._layer.layerId,layerName:""===e?null:e,itemId:""===t?null:t,serviceLayerUrl:""===r?null:r,webMapLayerId:s?this._layer.id??null:null,webMapLayerTitle:s?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}var Z=r(30235),W=r(26591);class Q extends d.A{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._findObjectId=-1,this._requestStandardised=!1,this._removeGeometry=!1,this._overrideFields=null,this.featureObjectId=null,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,this._findObjectId=e.objectId,this.featureObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return f.gO}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer?.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=[],t=[];for(const r of this.fields)if("oid"===r.type)e.push(r),t.push(r.name);else for(const i of this._overrideFields)if(i.toLowerCase()===r.name.toLowerCase()){e.push(r),t.push(r.name);break}this.fields=e,this._overrideFields=t}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType,this._requestStandardised=e.requestStandardised),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types,this.subtypeField=this._relatedLayer.subtypeField,this.subtypes=this._relatedLayer.subtypes}async databaseType(){return await this._relatedLayer.databaseType(),this._databaseType=this._relatedLayer._databaseType,this._databaseType}isTable(){return this._relatedLayer.isTable()}_isInFeatureSet(){return f.J6.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const r of this.fields)t[r.name]=e.attributes[r.name];return new l.A({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,r,i,s){if(await this.databaseType(),this.isTable()&&t&&null!==e&&""!==e)return new h.A([],[],!0,null);const n=this._layer.nativeCapabilities();if(!1===n.canQueryRelated)return new h.A([],[],!0,null);if(n.capabilities?.queryRelated.supportsPagination)return this._getFilteredSetUsingPaging(e,t,r,i,s);let a="",l=!1;null!==i&&!0===n.capabilities?.queryRelated.supportsOrderBy&&(a=i.constructClause(),l=!0);const o=new W.default;o.objectIds=[this._findObjectId];const u=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map((e=>e.name)):["*"]);o.outFields=u,o.relationshipId=this.relationship.id,o.where="1=1";let c=!0;!0===this._removeGeometry&&(c=!1),o.returnGeometry=c,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=""!==a?a.split(","):null;const d=await n.source.queryRelatedFeatures(o);this._checkCancelled(s);const p=d[this._findObjectId]?d[this._findObjectId].features:[],f=[];for(let e=0;e<p.length;e++)this._featureCache[p[e].attributes[this._relatedLayer.objectIdField]]=p[e],f.push(p[e].attributes[this._relatedLayer.objectIdField]);const y=t&&null!==e&&""!==e,_=null!=r;return new h.A(y||_?f:[],y||_?[]:f,l,null)}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return!1===r&&t.push(this.objectIdField),t}async _getFilteredSetUsingPaging(e,t,r,i,s){let n="",a=!1;const l=this._layer.nativeCapabilities();null!==i&&!0===l.capabilities?.queryRelated.supportsOrderBy&&(n=i.constructClause(),a=!0),await this.databaseType();let o=this._maxQueryRate();const u=l.capabilities?.query.maxRecordCount;null!=u&&u<o&&(o=u);const c=t&&null!==e&&""!==e,d=null!=r;let p=null,f=!0;!0===this._removeGeometry&&(f=!1);const y=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map((e=>e.name)):["*"]);return p=new h.A(c||d?["GETPAGES"]:[],c||d?[]:["GETPAGES"],a,{outFields:y.join(","),resultRecordCount:o,resultOffset:0,objectIds:[this._findObjectId],where:"1=1",orderByFields:n,returnGeometry:f,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,o,0,0,s),p}_expandPagedSet(e,t,r,i,s){return this._expandPagedSetFeatureSet(e,t,r,i,s)}_clonePageDefinition(e){return null===e?null:!0!==e.groupbypage?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,r){const i=e.pagesDefinition.internal.lastRetrieved,s=i,n=e.pagesDefinition.internal.lastPage,a=this._layer.nativeCapabilities(),l=new W.default;!0===this._requestStandardised&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=""!==e.pagesDefinition.orderByFields?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const o=await a.source.queryRelatedFeatures(l);if(this._checkCancelled(r),e.pagesDefinition.internal.lastPage!==n)return 0;const u=o[this._findObjectId]?o[this._findObjectId].features:[];for(let t=0;t<u.length;t++)e.pagesDefinition.internal.set[s+t]=u[t].attributes[this._relatedLayer.objectIdField];for(let e=0;e<u.length;e++)this._featureCache[u[e].attributes[this._relatedLayer.objectIdField]]=u[e];const c=!o[this._findObjectId]||!1===o[this._findObjectId].exceededTransferLimit;return u.length!==e.pagesDefinition.resultRecordCount&&c&&(e.pagesDefinition.internal.fullyResolved=!0),e.pagesDefinition.internal.lastRetrieved=i+u.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,u.length}async _getFeatures(e,t,r,i){const s=[];-1!==t&&void 0===this._featureCache[t]&&s.push(t);const n=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,n))return await this._expandPagedSet(e,n,0,0,i),this._getFeatures(e,t,r,i);let a=0;for(let i=e._lastFetchedIndex;i<e._known.length&&(a++,a<=r&&(e._lastFetchedIndex+=1),!("GETPAGES"!==e._known[i]&&void 0===this._featureCache[e._known[i]]&&(e._known[i]!==t&&s.push(e._known[i]),s.length>r)))&&!(a>=r&&0===s.length);i++);if(0===s.length)return"success";throw new c.dr(c.D_.MissingFeatures)}async _refineSetBlock(e,t,r){return e}async _stat(e,t,r,i,s,n,a){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,r,i,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,r,i,s){return this._relatedLayer.queryAttachments(e,t,r,i,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}var V=r(23732),J=r(92474),z=r(4146),$=r(80812);function Y(){null===V.A.applicationCache&&(V.A.applicationCache=new V.A)}async function K(e,t,r){if(V.A.applicationCache){const r=V.A.applicationCache.getLayerInfo(e);if(r){const i=await r;return new j.default({url:e,outFields:t,sourceJSON:i})}const i=new j.default({url:e,outFields:t}),s=(async()=>(await i.load(),i.sourceJSON))();if(V.A.applicationCache){V.A.applicationCache.setLayerInfo(e,s);try{return await s,i}catch(t){throw V.A.applicationCache.clearLayerInfo(e),t}}return await s,i}if(null!=r){const i=r.getCachedLayerMetadata(e);if(i){const r=await i;return new j.default({url:e,outFields:t,sourceJSON:r})}const s=new j.default({url:e,outFields:t}),n=(async()=>(await s.load(),s.sourceJSON))();r.setCachedLayerMetadata(e,n);try{return await n,s}catch(t){throw r.removeCachedLayerMetadata(e,n),t}}return new j.default({url:e,outFields:t})}async function H(e,t,r,i,s,n=null){return X(await K(e,["*"],s),t,r,i,s,n)}function X(e,t=null,r=null,i=!0,s=null,n=null){switch(e.type){case"catalog-footprint":return X(e.parent,t,r,i,s,n);case"subtype-sublayer":{const a=X(e.parent,t,r,i,s,n);return a.filter(g.A.create(e.parent.subtypeField+"="+e.subtypeCode.toString(),{fieldsIndex:e.parent.fieldsIndex,timeZone:a.dateFieldsTimeZoneDefaultUTC}))}case"csv":case"geojson":case"knowledge-graph-sublayer":case"wfs":return new Z.A({layer:e,spatialReference:t,outFields:r,includeGeometry:i,lrucache:s,interceptor:n});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:e,spatialReference:t,outFields:r,includeGeometry:i,lrucache:s,interceptor:n};return!e.url&&e.source?new Z.A(a):new q(a)}default:throw new Error(`Unsupported layer type: ${e.type}`)}}async function ee(e,t){if(null!==V.A.applicationCache){const t=V.A.applicationCache.getLayerInfo(e);if(null!==t)return t}if(null!=t){const r=t.getCachedServiceMetadata(e);if(null!=r)return r}const r=(async()=>{const t=await(0,i.A)(e,{responseType:"json",query:{f:"json"}});if(t.data){const e=t.data;return e.layers||(e.layers=[]),e.tables||(e.tables=[]),e}return{layers:[],tables:[]}})();if(null!==V.A.applicationCache){V.A.applicationCache.setLayerInfo(e,r);try{return await r}catch(t){throw V.A.applicationCache.clearLayerInfo(e),t}}if(null!=t){t.setCachedServiceMetadata(e,r);try{return await r}catch(i){throw t.removeCachedServiceMetadata(e,r),i}}return r}async function te(e,t,r){const s={metadata:null,networkId:-1,unVersion:3,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map,queryelem:null,layerNameLkp:{},lkp:null},n=await ee(e,null);if(s.metadata=n,void 0!==n.controllerDatasetLayers?.utilityNetworkLayerId&&null!==n.controllerDatasetLayers.utilityNetworkLayerId){if(n.layers)for(const e of n.layers)s.layerNameLkp[e.id]=e.name;if(n.tables)for(const e of n.tables)s.layerNameLkp[e.id]=e.name;const a=n.controllerDatasetLayers.utilityNetworkLayerId;s.networkId=a;const l=await async function(e,t){const r="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==V.A.applicationCache){const e=V.A.applicationCache.getLayerInfo(r);if(null!==e)return e}const s=(async()=>{const r=await(0,i.A)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}});if(r.data){const e=r.data;if(e.layerDataElements?.[0])return e.layerDataElements[0]}throw new c.dr(c.D_.DataElementsNotFound)})();if(null!==V.A.applicationCache){V.A.applicationCache.setLayerInfo(r,s);try{return await s}catch(e){throw V.A.applicationCache.clearLayerInfo(r),e}}return s}(e,a);if(l){s.queryelem=l,s.queryelem?.dataElement&&void 0!==s.queryelem.dataElement.schemaGeneration&&(s.unVersion=s.queryelem.dataElement.schemaGeneration),s.lkp={},s.queryelem.dataElement.domainNetworks||(s.queryelem.dataElement.domainNetworks=[]);for(const e of s.queryelem.dataElement.domainNetworks){for(const t of e.edgeSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:s.layerNameLkp[t.layerId]??null};s.layerIdLookup.set(e.layerId,e),s.sourceIdLookup.set(e.sourceId,e),e.className&&(s.lkp[e.className]=e)}for(const t of e.junctionSources??[]){const e={layerId:t.layerId,sourceId:t.sourceId,className:s.layerNameLkp[t.layerId]??null};s.layerIdLookup.set(e.layerId,e),s.sourceIdLookup.set(e.sourceId,e),e.className&&(s.lkp[e.className]=e)}}if(s.queryelem.dataElement.terminalConfigurations)for(const e of s.queryelem.dataElement.terminalConfigurations)for(const t of e.terminals)s.terminals.push({terminalId:t.terminalId,terminalName:t.terminalName});const n=await async function(e){if(null!==V.A.applicationCache){const t=V.A.applicationCache.getLayerInfo(e);if(null!==t)return t}const t=(async()=>{const t=await(0,i.A)(e,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(null!==V.A.applicationCache){V.A.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw V.A.applicationCache.clearLayerInfo(e),t}}return t}(e+"/"+a);if(void 0!==n.systemLayers?.associationsTableId&&null!==n.systemLayers.associationsTableId){let i=null;if(r&&s.unVersion<8){const r=[];s.unVersion>=4&&(r.push("STATUS"),r.push("PERCENTALONG")),i=await H(e+"/"+n.systemLayers.associationsTableId,t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...r],!1,null,null),await i.load(),s.unVersion>=4&&(i=i.filter(g.A.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC})),await i.load())}return{lkp:s.lkp,associations:i,unVersion:s.unVersion,terminals:s.terminals,layerIdLookup:s.layerIdLookup,sourceIdLookup:s.sourceIdLookup}}return{associations:null,unVersion:s.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:s.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}return{associations:null,unVersion:s.unVersion,lkp:null,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map}}async function re(e,t,r,i=null,s=null,n=!0,a=null,l=null){let o=e.serviceUrl();if(!o)return null;o="/"===o.charAt(o.length-1)?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString();const u=await H(o,i,s,n,a,l);return new Q({layer:e,relatedLayer:u,relationship:t,objectId:r,spatialReference:i,outFields:s,includeGeometry:n,lrucache:a,interceptor:l})}a.A.registerAction(),C.registerAction(),u.A.registerAction(),D.A.registerAction(),R.A.registerAction();class ie extends s{constructor(e,t=null,r=null,i=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=i,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,r=null){const i=X(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),i}async featureSetByName(e,t=!0,r=null){if(J.A.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const s=this._instantLayers[r];if(s.opitem.title===e&&s.includeGeometry===t&&s.outFields===i)return this._instantLayers[r].featureset}const s=this._map.allLayers.find((t=>(0,f.eB)(t)&&t.title===e));if(null!=s)return this._makeAndAddFeatureSet(s,t,r);if(this._map.allTables){const i=this._map.allTables.find((t=>(0,f.eB)(t)&&t.title===e));if(null!=i)return this._makeAndAddFeatureSet(i,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){if(J.A.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,r);null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const s=this._instantLayers[r];if(s.opitem.id===e&&s.includeGeometry===t&&s.outFields===i)return this._instantLayers[r].featureset}const s=this._map.allLayers.find((t=>(0,f.eB)(t)&&t.id===e));if(s)return this._makeAndAddFeatureSet(s,t,r);if(this._map.allTables){const i=this._map.allTables.find((t=>(0,f.eB)(t)&&t.id===e));if(null!=i)return this._makeAndAddFeatureSet(i,t,r)}return null}}class se extends s{constructor(e,t=null,r=null,i=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=r,this._interceptor=i,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,r=null){const i=X(e,this._overrideSpatialReference,null===r?["*"]:r,t,this._lrucache);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(r)}),i}async _loadMetaData(){const e=await ee(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new se(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,r=null){null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);for(let r=0;r<this._instantLayers.length;r++){const s=this._instantLayers[r];if(s.opitem.title===e&&s.includeGeometry===t&&s.outFields===i)return this._instantLayers[r].featureset}const s=await this._loadMetaData();let n=null;for(const t of s.layers??[])t.name===e&&(n=t);if(!n)for(const t of s.tables??[])t.name===e&&(n=t);if(n){const e=await K(this._url+"/"+n.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}async featureSetById(e,t=!0,r=["*"]){null===r&&(r=["*"]),r=(r=r.slice()).sort();const i=JSON.stringify(r);e=null!=e?e.toString():"";for(let r=0;r<this._instantLayers.length;r++){const s=this._instantLayers[r];if(s.opitem.id===e&&s.includeGeometry===t&&s.outFields===i)return this._instantLayers[r].featureset}const s=await this._loadMetaData();let n=null;for(const t of s.layers??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(n=t);if(!n)for(const t of s.tables??[])null!==t.id&&void 0!==t.id&&t.id.toString()===e&&(n=t);if(n){const e=await K(this._url+"/"+n.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,r)}return null}}function ne(e,t,r=null,i=null){return new ie(e,t,r,i)}function ae(e,t,r=null,i=null){return new se(e,t,r,i)}function le(e,t,r,i,s){if(null===e)return null;if((0,n.p)(e)){switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}if(e instanceof z.A&&(0,f.NI)(e)){const n=e;switch(t){case"datasource":return X(n,s,"outFields"in n?n.outFields:null,!0,r,i).getDataSourceFeatureSet();case"parent":case"root":return X(n,s,"outFields"in n?n.outFields:null,!0,r,i)}return null}if((0,n.$)(e)){switch(t){case"datasource":return X(e.parent,s,e.parent.outFields,!0,r,i).getDataSourceFeatureSet();case"parent":case"root":return X(e,s,e.parent.outFields,!0,r,i)}return null}return null}async function oe(e,t,r,i,s,n,a,l=null){if(V.A.applicationCache){const o=V.A.applicationCache.getLayerInfo(e+":"+n.url);if(o)return ue(await o,t,r,i,s,a,l)}if(null!=a){const o=a.getCachedPortalItem(n.url,e);if(null!=o)return await ue(await o,t,r,i,s,a,l)}const o=new $.default({id:e,portal:n}).load();V.A.applicationCache?V.A.applicationCache.setLayerInfo(e+":"+n.url,o):null!=a&&a.setCachedPortalItem(n.url,e,o);try{return await ue(await o,t,r,i,s,a,l)}catch(t){throw V.A.applicationCache&&V.A.applicationCache.clearLayerInfo(e+":"+n.url),null!=a&&a.removeCachedPortalItem(n.url,e,o),t}}async function ue(e,t,r,i,s,n,a){let l;if("Feature Service"===e.type||"Map Service"===e.type)l=await K((0,f.Qi)(e.url??"")+"/"+t,["*"],n);else{if(t)throw new Error(`layerId=${t} provided for ${e.type} item`);if(null!=n){const t=n.getCachedPortalItemLayer(e.portal.url,e.id);if(null!=t)l=await t;else{const t=z.A.fromPortalItem(e);n.setCachedPortalItemLayer(e.portal.url,e.id,t);try{l=await t}catch(r){throw n.removeCachedPortalItemLayer(e.portal.url,e.id,t),r}}}else l=await z.A.fromPortalItem(e)}return X(l,r,i,s,n,a)}},41366:(e,t,r)=>{r.d(t,{K:()=>h,Q:()=>u});var i=r(90237),s=r(66552),n=r(53966),a=r(10107),l=(r(44208),r(87811),r(93223)),o=r(40608);const u=(0,s.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",d="field",h=e=>{let t=class extends e{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&d||r&&c||null,t&&r&&n.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==d&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,i._)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],t.prototype,"normalizationField",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],t.prototype,"normalizationMaxValue",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],t.prototype,"normalizationMinValue",void 0),(0,i._)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],t.prototype,"normalizationTotal",void 0),(0,i._)([(0,l.e)(u,{name:"parameters.normalizationType"})],t.prototype,"normalizationType",null),t=(0,i._)([(0,o.$)("esri.rest.support.NormalizationBinParametersMixin")],t),t}},41560:(e,t,r)=>{r.d(t,{Ch:()=>a,mW:()=>n});var i=r(34727),s=r(39516);function n(e,t){return{...t,filterMode:e.mode}}function a(e,t,r){const n=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:r,maxScale:i}of e.filters)t[0]=Math.max(t[0],c(r)),t[1]=Math.min(t[1],d(i));return t}(e);if(n&&((0,i.gg)(t,n[0])||(0,i.ZH)(r,n[1])))return"";const a=Array.from(l(e,t,r)),o=function(e,t,r){if(0===e.length)return!0;const s=c(e.at(0)?.minScale),n=d(e.at(-1)?.maxScale);if((0,i.ZH)(s,t)||(0,i.gg)(n,r))return!0;for(let t=0;t<e.length-1;t++){const r=e[t],s=e[t+1];if((0,i.ZH)(c(s.minScale),d(r.maxScale)))return!0}return!1}(a,t,r)?"1=1":a.map((e=>e.where||"1=1")).reduce(((e,t)=>(0,s.IW)(e,t)),"");return o&&"1=1"!==o?o:""}function*l(e,t,r){if("manual"===u(e)){const t=e.filters.find((t=>t.id===e.activeFilterId));t&&(yield t)}else{"object"==typeof t&&(t=t.scale);for(const i of e.filters)o(i.minScale,i.maxScale,t,r)&&(yield i)}}function o(e,t,r,s){return e=c(e),r=c(r),t=d(t),!(!(0,i.Sp)(r,e)&&(s??r)>e||(0,i.Hx)(t,r)||void 0!==s&&(0,i.Sp)(s,e))}function u(e){return"mode"in e?e.mode:e.filterMode}function c(e){return e||Number.POSITIVE_INFINITY}function d(e){return e||0}},46140:(e,t,r)=>{r.d(t,{R:()=>s});var i=r(49186);let s=class e{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}greaterEqual(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 i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[s,n]=t.split("."),a=/^\s*\d+\s*$/;if(!s?.match||!a.test(s))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!a.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const l=parseInt(s,10),o=parseInt(n,10);return new e(l,o,r)}}},54461:(e,t,r)=>{r.d(t,{A:()=>l});var i=r(87449),s=r(11221),n=r(89169),a=r(33325);class l extends s.A{constructor(e){super(e),this._topnum=0,this.declaredClass="esri.arcade.featureset.actions.Top",this._countedin=0,this._maxProcessing=100,this._topnum=e.topnum,this._parent=e.parentfeatureset}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._parent._getSet(e);return this._wset=new n.A(t._candidates.slice(),t._known.slice(),!1,this._clonePageDefinition(t.pagesDefinition)),this._setKnownLength(this._wset)>this._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&"GETPAGES"===e._known[e._known.length-1]?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===a.J6.NotInFeatureSet)return t;const r=this._idstates[e];return r===a.J6.InFeatureSet||r===a.J6.NotInFeatureSet?r:t===a.J6.InFeatureSet&&void 0===r?this._countedin<this._topnum?(this._idstates[e]=a.J6.InFeatureSet,this._countedin++,a.J6.InFeatureSet):(this._idstates[e]=a.J6.NotInFeatureSet,a.J6.NotInFeatureSet):a.J6.Unknown}async _expandPagedSet(e,t,r,s,n){if(null===this._parent)throw new i.dr(i.D_.NotImplemented);if(t>this._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let t=e._known.length;return t>0&&"GETPAGES"===e._known[t-1]&&(e._known.length=t-1),t=e._candidates.length,t>0&&"GETPAGES"===e._candidates[t-1]&&(e._candidates.length=t-1),"success"}const a=await this._parent._expandPagedSet(e,t,r,s,n);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),a}async _getFeatures(e,t,r,i){const s=[],a=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,a))return await this._expandPagedSet(e,a,0,0,i),this._getFeatures(e,t,r,i);-1!==t&&void 0===this._featureCache[t]&&s.push(t);let l=0;for(let i=e._lastFetchedIndex;i<e._known.length&&(l++,l<=r&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[i]]&&(e._known[i]!==t&&s.push(e._known[i]),s.length>a)));i++);if(0===s.length)return"success";const o=new n.A([],s,!1,null),u=Math.min(s.length,r);await this._parent._getFeatures(o,-1,u,i);for(let e=0;e<u;e++){const t=this._parent._featureFromCache(s[e]);void 0!==t&&(this._featureCache[s[e]]=t)}return"success"}async _getFilteredSet(e,t,r,i,s){await this._ensureLoaded();const a=await this._getSet(s);return new n.A(a._candidates.slice().concat(a._known.slice()),[],!1,this._clonePageDefinition(a.pagesDefinition))}_refineKnowns(e,t){let r=0,i=null;const s=[];for(let n=0;n<e._candidates.length;n++){const l=this._isInFeatureSet(e._candidates[n]);if(l===a.J6.InFeatureSet){if(e._known.push(e._candidates[n]),r+=1,null===i?i={start:n,end:n}:i.end===n-1?i.end=n:(s.push(i),i={start:n,end:n}),e._known.length>=this._topnum)break}else if(l===a.J6.NotInFeatureSet)null===i?i={start:n,end:n}:i.end===n-1?i.end=n:(s.push(i),i={start:n,end:n}),r+=1;else if(l===a.J6.Unknown)break;if(r>=t)break}null!==i&&s.push(i);for(let t=s.length-1;t>=0;t--)e._candidates.splice(s[t].start,s[t].end-s[t].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){s.A._featuresetFunctions.top=function(e){return new l({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},55674:(e,t,r)=>{r.d(t,{Ad:()=>p,Gj:()=>_,QY:()=>h,lL:()=>g,xR:()=>f});var i=r(66131),s=r(49186),n=(r(44208),r(44729)),a=r(15032),l=r(65864),o=r(95466),u=r(43668),c=r(98623);const d=["geometry","scale","timeProperties"];function h(e,t){if(null!=t)for(const r of d)t.hasArcadeDependency(r)&&e.add(r);return e}function p(e,t){return y.create(e,t,null,["$feature","$view"])}function f(e,t,r){return y.create(e,t,r,["$feature","$view","$config"])}class y{static async create(e,t,r,i){const{arcade:n,Dictionary:a}=await(0,u.l)();let l;try{l=n.parseScript(e)}catch(t){throw new s.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const o=n.scriptUsesGeometryEngine(l);o&&await n.enableGeometrySupport(),await n.loadDependentModules(new Set,l,null,!1,o);const c={vars:i.reduce(((e,t)=>({...e,[t]:null})),{}),spatialReference:t,useAsync:!1},d=n.compileScript(l,c);let h=null;null!=r&&(h=new a(r),h.immutable=!0);const p=new a;return p.immutable=!1,p.setField("scale",0),new y(e,n,l,d,t,p,h,a)}constructor(e,t,r,i,s,n,a,l){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=s,this._viewDict=n,this._configDict=a,this._dictionaryCtor=l,this._dependencies=new Map,this._featureReader=new _,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:s,currentEnd:n}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=s?null!=r?i.lY.epochToArcadeDate(s,r):i.lY.unknownEpochToArcadeDate(s):void 0,currentEnd:null!=n?null!=r?i.lY.epochToArcadeDate(n,r):i.lY.unknownEpochToArcadeDate(n):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class _{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const i=t??new o.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,l.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const r=this._getField(e);if(r)switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return n.n.fromReader(this._boundTarget.attributes[r.name]);case"time-only":case"esriFieldTypeTimeOnly":return a.k.fromReader(this._boundTarget.attributes[r.name]);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(this._boundTarget.attributes[r.name]);case"date":case"esriFieldTypeDate":{const t=this._boundTarget.attributes[r.name];return this.isUnknownDateTimeField(e)?i.lY.unknownEpochToArcadeDate(t):i.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU)}default:return this._boundTarget.attributes[r.name]}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map((e=>e.name))}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,r)=>{r.d(t,{q:()=>s});var i=r(62815);function s(e,t,r){if(!r?.features||!r.hasZ)return;const s=(0,i.N)(r.geometryType,t,e.outSpatialReference);if(null!=s)for(const e of r.features)s(e.geometry)}},60999:(e,t,r)=>{r.d(t,{DZ:()=>f,Ke:()=>p,Tj:()=>c,UT:()=>y,jJ:()=>u});var i=r(90237),s=r(69622),n=r(97768),a=r(74887),l=r(10107),o=r(40608);function u(e,t,r){return(0,a.Lx)(e.map(((e,i)=>t.apply(r,[e,i]))))}async function c(e,t,r){return(await(0,a.Lx)(e.map(((e,i)=>t.apply(r,[e,i]))))).map((e=>e.value))}function d(e){return{ok:!0,value:e}}function h(e){return{ok:!1,error:e}}async function p(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return d(await e)}catch(e){return h(e)}}async function f(e){try{return d(await e)}catch(e){return(0,a.QP)(e),h(e)}}function y(e,t){return new _(e,t)}let _=class extends s.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,n.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then((e=>{this._result=d(e),this._cleanup()}),(e=>{this._result=h(e),this._cleanup()})),this._abortHandle=(0,a.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.xt)(this._abortHandle),this._abortController=null}};(0,i._)([(0,l.MZ)()],_.prototype,"value",null),(0,i._)([(0,l.MZ)()],_.prototype,"error",null),(0,i._)([(0,l.MZ)()],_.prototype,"finished",null),(0,i._)([(0,l.MZ)()],_.prototype,"promise",void 0),(0,i._)([(0,l.MZ)()],_.prototype,"_result",void 0),_=(0,i._)([(0,o.$)("esri.core.asyncUtils.ReactiveTask")],_)},68423:(e,t,r)=>{r.d(t,{Gr:()=>m,IO:()=>y,a:()=>w,bV:()=>g,p8:()=>_});var i=r(52106),s=r(78502),n=r(87449),a=r(11221),l=r(89169),o=r(33325),u=r(80609),c=r(97768),d=r(1262),h=r(88368),p=r(16930);class f{constructor(e){this.field=e,this.sqlRewritable=!1}postInitialization(e,t){}}class y extends f{constructor(e){super(e),this.sqlRewritable=!0}extractValue(e){return e.attributes[this.field.name]}rewriteSql(e){return{rewritten:this.sqlRewritable,where:e}}}class _ extends f{constructor(e,t,r){super((0,o.ke)(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=r}rewriteSql(e,t){return{rewritten:this.sqlRewritable,where:(0,u.bD)(e,this.field.name,this.originalField.name,t.getFieldsIndex())}}extractValue(e){return e.attributes[this.originalField.name]}}class g extends f{constructor(e,t,r){super(e),this.codefield=t,this.lkp=r,this.reverseLkp={};for(const e in r)this.reverseLkp[r[e]]=e;this.sqlRewritable=!0}static{this.BADNESS="_!!!_BAD_LKP_!!!!"}rewriteSql(e,t){const r=this.evaluateNodeToWhereClause(e.parseTree,o.zl.Standardised,this.field.name,this.codefield instanceof h.A?(0,u.YY)(this.codefield,o.zl.Standardised):this.codefield,e.parameters);return r.includes(g.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:h.A.create(r,{fieldsIndex:t._parent.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})}}evaluateNodeToWhereClause(e,t,r=null,i=null,s){let n,a,l,c;switch(e.type){case"interval":return(0,u.oj)(this.evaluateNodeToWhereClause(e.value,t,r,i,s),e.qualifier,e.op);case"case-expression":{let i=" CASE ";"simple"===e.format&&(i+=this.evaluateNodeToWhereClause(e.operand,t,r,g.BADNESS,s));for(let n=0;n<e.clauses.length;n++)i+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[n].operand,t,r,g.BADNESS,s)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[n].value,t,r,g.BADNESS,s);return null!==e.else&&(i+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,r,g.BADNESS,s)),i+=" END ",i}case"parameter":{const r=s[e.value.toLowerCase()];if("string"==typeof r)return"'"+r.toString().replaceAll("'","''")+"'";if((0,o.$P)(r))return(0,u.bm)(r,t);if((0,o.Lk)(r))return(0,u.bm)(r,t);if((0,o.eg)(r))return(0,u.F1)(r,t);if((0,o.rX)(r))return(0,u.R8)(r,t);if((0,o.f0)(r))return(0,u.Nf)(r,t);if(Array.isArray(r)){const e=[];for(let i=0;i<r.length;i++)"string"==typeof r[i]?e.push("'"+r[i].toString().replaceAll("'","''")+"'"):(0,o.$P)(r[i])||(0,o.Lk)(r[i])?e.push((0,u.bm)(r[i],t)):(0,o.eg)(r[i])?e.push((0,u.F1)(r[i],t)):(0,o.rX)(r[i])?e.push((0,u.R8)(r[i],t)):(0,o.f0)(r[i])?e.push((0,u.Nf)(r[i],t)):e.push(r[i].toString());return e}return r.toString()}case"expression-list":a=[];for(const n of e.value)a.push(this.evaluateNodeToWhereClause(n,t,r,i,s));return a;case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,r,g.BADNESS,s)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" AND "+this.evaluateNodeToWhereClause(e.right,t,r,i,s)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" OR "+this.evaluateNodeToWhereClause(e.right,t,r,i,s)+") ";case"IS":if("null"!==e.right.type)throw new d.L8(d.Z7.UnsupportedIsRhs);return" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new d.L8(d.Z7.UnsupportedIsRhs);return" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" IS NOT NULL )";case"IN":if(n=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const n=[];let a=!0;for(const t of e.right.value){if("string"!==t.type){a=!1;break}if(void 0===this.lkp[t.value]){a=!1;break}n.push(this.lkp[t.value].toString())}if(a)return" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" IN ("+n.join(",")+")) "}return n=this.evaluateNodeToWhereClause(e.right,t,r,i,s)," ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" IN ("+n.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,r,i,s),Array.isArray(c)?" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" IN ("+c+")) ";case"NOT IN":if(n=[],"expression-list"===e.right.type){if("column-reference"===e.left.type&&e.left.column.toUpperCase()===this.field.name.toUpperCase()){const n=[];let a=!0;for(const t of e.right.value){if("string"!==t.type){a=!1;break}if(void 0===this.lkp[t.value]){a=!1;break}n.push(this.lkp[t.value].toString())}if(a)return" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" NOT IN ("+n.join(",")+")) "}return n=this.evaluateNodeToWhereClause(e.right,t,r,i,s)," ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" NOT IN ("+n.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,r,i,s),Array.isArray(c)?" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" NOT IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,i,s)+" NOT IN ("+c+")) ";case"BETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,r,g.BADNESS,s)," ("+this.evaluateNodeToWhereClause(e.left,t,r,g.BADNESS,s)+" BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"NOTBETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,r,g.BADNESS,s)," ("+this.evaluateNodeToWhereClause(e.left,t,r,g.BADNESS,s)+" NOT BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,r,g.BADNESS,s)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,g.BADNESS,s)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,g.BADNESS,s)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,g.BADNESS,s)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,r,g.BADNESS,s)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,g.BADNESS,s)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,r,g.BADNESS,s)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,r,g.BADNESS,s)+") ";case"<>":case"=":if("column-reference"===e.left.type&&"string"===e.right.type){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&void 0!==this.lkp[e.right.value.toString()])return" ("+i+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if("column-reference"===e.right.type&&"string"===e.left.type&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+i+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,r,g.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,r,g.BADNESS,s)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,r,g.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,r,g.BADNESS,s)+") "}case"null":return"null";case"boolean":return!0===e.value?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return(0,u.C6)(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return r&&r.toLowerCase()===e.column.toLowerCase()?"("+i+")":(0,u.Kb)(e.column);case"data-type":return e.value;case"function":{const i=this.evaluateNodeToWhereClause(e.args,t,r,g.BADNESS,s);return(0,u.F6)(e.name,i,t)}}throw new d.L8(d.Z7.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof h.A?this.reverseLkp[h.A.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}}class m extends f{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:(0,u.bD)(e,this.field.name,(0,u.YY)(this._sql,o.zl.Standardised),t.getFieldsIndex())}}extractValue(e){return h.A.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}class w extends a.A{static findField(e,t){for(const r of e)if(r.name.toLowerCase()===t.toString().toLowerCase())return r;return null}constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){null!==this._parent?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new p.A({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=o.ik.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){if(null===this._wset){await this._ensureLoaded();let t=null;return t=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await(this._parent?._getSet(e)),this._checkCancelled(e),(0,c.Lw)(t),this._wset=new l.A(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}async _getFeatures(e,t,r,n){const a=[];-1!==t&&void 0===this._featureCache[t]&&a.push(t);const o=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,o))return await this._expandPagedSet(e,o,0,0,n),this._getFeatures(e,t,r,n);let u=0;for(let i=e._lastFetchedIndex;i<e._known.length&&(u++,u<=r&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[i]]&&(e._known[i]!==t&&a.push(e._known[i]),a.length>=o)));i++);if(0===a.length)return"success";e=new l.A([],a,e._ordered,null);const c=Math.min(a.length,r);await(this._parent?._getFeatures(e,-1,c,n)),this._checkCancelled(n);const d=[];for(let e=0;e<c;e++){const t=this._parent?._featureFromCache(a[e]);void 0!==t&&d.push({geometry:t.geometry,attributes:t.attributes,id:a[e]})}for(const e of d){const t=[];for(const r of this.adaptedFields)t[r.field.name]=r.extractValue(e);this._featureCache[e.id]=new i.A({attributes:t,geometry:(0,s.Yq)(e.geometry)})}return"success"}async _fetchAndRefineFeatures(){throw new n.dr(n.D_.NeverReach)}async _getFilteredSet(e,t,r,i,s){let n=!1;const a=this._reformulateWithoutAdaptions(r);n=a.cannot,r=a.where;let o=!1;if(null!==i){o=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof y)&&!0===i.scanForField(t.field.name)){if(!(t instanceof _)){i=null,o=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}i&&e.length>0&&(i=i.replaceFields(e))}null!==r?null!==this._extraFilter&&(r=(0,u.kg)(this._extraFilter,r)):r=this._extraFilter,await this._ensureLoaded();const c=await this._parent._getFilteredSet(e,t,r,i,s);let d;return this._checkCancelled(s),d=!0===n?new l.A(c._candidates.slice().concat(c._known.slice()),[],!0===o&&c._ordered,this._clonePageDefinition(c.pagesDefinition)):new l.A(c._candidates.slice(),c._known.slice(),!0===o&&c._ordered,this._clonePageDefinition(c.pagesDefinition)),d}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(null!==e)for(const r of this.adaptedFields)if(!0===(0,u.Ju)(e,r.field.name)){const i=r.rewriteSql(e,this);if(!0!==i.rewritten){t.cannot=!0,t.where=null;break}t.where=i.where}return t}async _stat(e,t,r,i,s,n,a){let l=!1,o=this._reformulateWithoutAdaptions(t);if(l=o.cannot,t=o.where,o=this._reformulateWithoutAdaptions(s),l=l||o.cannot,null!==(s=o.where)?null!==this._extraFilter&&(s=(0,u.kg)(this._extraFilter,s)):s=this._extraFilter,!0===l)return null===s&&""===r&&null===i?this._manualStat(e,t,n,a):{calculated:!1};const c=await this._parent._stat(e,t,r,i,s,n,a);return!1===c.calculated?null===s&&""===r&&null===i?this._manualStat(e,t,n,a):{calculated:!1}:c}async _canDoAggregates(e,t,r,i,s){if(null===this._parent)return!1;for(let t=0;t<e.length;t++)for(const r of this.adaptedFields)if(e[t].toLowerCase()===r.field.name.toLowerCase()&&!(r instanceof y))return!1;const n=[];for(let e=0;e<t.length;e++){const r=t[e];if(null!==r.workingexpr){const e=this._reformulateWithoutAdaptions(r.workingexpr);if(e.cannot)return!1;const t=r.clone();t.workingexpr=e.where,n.push(t)}else n.push(r)}const a=this._reformulateWithoutAdaptions(s);return!a.cannot&&(null!==(s=a.where)?null!==this._extraFilter&&(s=(0,u.kg)(this._extraFilter,s)):s=this._extraFilter,this._parent._canDoAggregates(e,n,r,i,s))}async _getAggregatePagesDataSourceDefinition(e,t,r,i,s,a,l){if(null===this._parent)throw new n.dr(n.D_.NeverReach);const o=[];for(let e=0;e<t.length;e++){const r=t[e];if(null!==r.workingexpr){const e=this._reformulateWithoutAdaptions(r.workingexpr);if(e.cannot)throw new n.dr(n.D_.NeverReach);const t=r.clone();t.workingexpr=e.where,o.push(t)}else o.push(r)}const c=this._reformulateWithoutAdaptions(s);if(c.cannot)throw new n.dr(n.D_.NeverReach);return null!==(s=c.where)?null!==this._extraFilter&&(s=(0,u.kg)(this._extraFilter,s)):s=this._extraFilter,this._parent._getAggregatePagesDataSourceDefinition(e,o,r,i,s,a,l)}}},73681:(e,t,r)=>{r.d(t,{n:()=>o});var i=r(49186),s=r(53966),n=r(46140),a=r(95466),l=r(55674);class o{static async from(e,t,r){const a=e.dictionary_version?n.R.parse(e.dictionary_version):null,c=new Set(e.itemsNames),d={};if(t)for(const e in t)d[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)d.hasOwnProperty(t.name)||(d[t.name]=t.value);const h=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))h.delete(e);h.size&&s.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:h});const p=await(0,l.xR)(e.expression,null,d);if(!p)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const f=!a||!a.greaterEqual(4,0);f&&s.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:a});const y=new u(r,f);return new o(f,c,p,y)}constructor(e,t,r,i){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=i}get itemNames(){return this._itemNames}evaluate(e,t,r,i){try{return this._reader.bind(e,r,i),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){s.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new a.A(e);const t=e.map((e=>({...e,type:"esriFieldTypeString"})));return new a.A(t)}}class u extends l.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t?"":""+this._boundTarget.attributes[t.name]}}},77548:(e,t,r)=>{r.d(t,{tk:()=>d,BR:()=>c,wI:()=>u,Ov:()=>l,W_:()=>o,TU:()=>a,XX:()=>n});var i=r(70333),s=r(78888);r(5503),r(36563),r(36708),new WeakMap;const n={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function a(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function l(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function o(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function u(e,t){const r=i.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const n=e.toLowerCase().indexOf("/rest/services");if(-1===n)return null;const a=`${e.slice(0,n)}/rest/info`,l=null!=t?t.signal:null,{data:o}=await(0,s.A)(a,{query:{f:"json"},responseType:"json",signal:l});return o?.owningSystemUrl||null}function c(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function d(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}},86691:(e,t,r)=>{r.d(t,{A:()=>o});var i=r(78878),s=r(87449),n=r(11221),a=r(89169),l=r(87594);class o extends n.A{constructor(e){super(e),this._orderbyclause=null,this.declaredClass="esri.arcade.featureset.actions.OrderBy",this._maxProcessing=100,this._orderbyclause=e.orderbyclause,this._parent=e.parentfeatureset}async _getSet(e){if(null===this._wset){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,this._orderbyclause,e);return this._checkCancelled(e),this._wset=t,this._wset}return this._wset}async manualOrderSet(e,t){const r=await this.getIdColumnDictionary(e,[],-1,t);this._orderbyclause?.order(r);const i=new a.A([],[],!0,null);for(let e=0;e<r.length;e++)i._known.push(r[e].id);return i}async getIdColumnDictionary(e,t,r,s){if(r<e._known.length-1){const n=this._maxQueryRate();if("GETPAGES"===e._known[r+1])return await(0,i.a0)(this._parent._expandPagedSet(e,n,0,0,s)),this.getIdColumnDictionary(e,t,r,s);let a=r+1;const l=[];for(;a<e._known.length&&"GETPAGES"!==e._known[a];)l.push(e._known[a]),a++;r+=l.length;const o=await(0,i.a0)(this._parent._getFeatureBatch(l,s));this._checkCancelled(s);for(const e of o)t.push({id:e.attributes[this.objectIdField],feature:e});return this.getIdColumnDictionary(e,t,r,s)}return e._candidates.length>0?(await(0,i.a0)(this._refineSetBlock(e,this._maxProcessingRate(),s)),this._checkCancelled(s),this.getIdColumnDictionary(e,t,r,s)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,r,i){return this._parent._getFeatures(e,t,r,i)}_featureFromCache(e){if(void 0===this._featureCache[e]){const t=this._parent._featureFromCache(e);if(void 0===t)return;return null===t?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new s.dr(s.D_.NeverReach)}async _getFilteredSet(e,t,r,i,s){await this._ensureLoaded();const n=await this._parent._getFilteredSet(e,t,r,null===i?this._orderbyclause:i,s);this._checkCancelled(s);const l=new a.A(n._candidates.slice(),n._known.slice(),n._ordered,this._clonePageDefinition(n.pagesDefinition));let o=!0;if(n._candidates.length>0&&(o=!1),!1===l._ordered){let e=await this.manualOrderSet(l,s);return!1===o&&(null===t&&null===r||(e=new a.A(e._candidates.slice().concat(e._known.slice()),[],e._ordered,this._clonePageDefinition(e.pagesDefinition)))),e}return l}static registerAction(){n.A._featuresetFunctions.orderBy=function(e){return""===e?this:new o({parentfeatureset:this,orderbyclause:new l.A(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},87594:(e,t,r)=>{function i(e,t){return e===t?0:null===e?-1:null===t?1:e<t?-1:1}r.d(t,{A:()=>s});class s{constructor(e){const t=e.split(",");this._fields=[],this._directions=[];for(let e=0;e<t.length;e++){const r=t[e].match(/\S+/g);this._fields.push(r[0]),2===r.length?"asc"===r[1].toLowerCase()?this._directions.push(1):this._directions.push(0):this._directions.push(1)}}constructClause(){let e="";for(let t=0;t<this._fields.length;t++)0!==t&&(e+=","),e+=this._fields[t],1===this._directions[t]?e+=" ASC":e+=" DESC";return e}order(e){e.sort(((e,t)=>{for(let r=0;r<this._fields.length;r++){const s=this.featureValue(e.feature,this._fields[r],r),n=this.featureValue(t.feature,this._fields[r],r);let a=0;if(a=1===this._directions[r]?i(s,n):-1*i(s,n),0!==a)return a}return 0}))}scanForField(e){for(let t=0;t<this._fields.length;t++)if(this._fields[t].toLowerCase().trim()===e.toLowerCase().trim())return!0;return!1}replaceFields(e){let t="";for(let r=0;r<this._fields.length;r++){0!==r&&(t+=",");let i=this._fields[r];for(const t of e)if(i.toLowerCase()===t.field.toLowerCase()){i=t.newfield;break}t+=i,1===this._directions[r]?t+=" ASC":t+=" DESC"}return new s(t)}featureValue(e,t,r){const i=e.attributes[t];if(void 0!==i)return i;for(const i in e.attributes)if(t.toLowerCase()===i.toLowerCase())return this._fields[r]=i,e.attributes[i];return null}}},91880:(e,t,r)=>{r.d(t,{A:()=>c});var i,s=r(90237),n=r(66552),a=r(25482),l=r(10107),o=(r(44208),r(53966),r(87811),r(40608));const u=new n.J({asc:"ascending",desc:"descending"});let c=class extends a.A{static{i=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new i({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,s._)([(0,l.MZ)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,s._)([(0,l.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],c.prototype,"valueExpression",void 0),(0,s._)([(0,l.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],c.prototype,"order",void 0),c=i=(0,s._)([(0,o.$)("esri.layers.support.OrderByInfo")],c)},92935:(e,t,r)=>{var i;r.d(t,{X:()=>i}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(i||(i={}))}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3747],{13069:(e,t,r)=>{r.d(t,{AG:()=>a,lk:()=>i,vD:()=>o,yS:()=>n});const s="randomUUID"in crypto;function i(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${i().toUpperCase()}}`}function o(){return`{${i()}}`}function a(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},18047:(e,t,r)=>{r.d(t,{ZV:()=>l,yx:()=>a});var s=r(73444);const i={ar:"ar-u-nu-latn",nn:"no-NN"};let n=new WeakMap,o={};function a(e={}){const t={};return null!=e.digitSeparator&&(t.useGrouping=e.digitSeparator),null!=e.places&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function l(e,t){return Object.is(e,-0)&&(e=0),function(e){const t=e||o;if(!n.has(t)){const r=(0,s.JK)(),o=(0,s.ZS)(r)?.language,a=o&&i[o]||r;n.set(t,new Intl.NumberFormat(a,e))}return n.get(t)}(t).format(e)}(0,s.Ml)((()=>{n=new WeakMap,o={}})),new Map},36708:(e,t,r)=>{r.d(t,{C_:()=>u,OH:()=>_,Vh:()=>g,on:()=>d,pc:()=>m,wB:()=>l,z7:()=>h});var s=r(37955),i=r(36563),n=r(97768),o=r(74887),a=r(14012);function l(e,t,r={}){return c(e,t,r,p)}function h(e,t,r={}){return c(e,t,r,f)}function c(e,t,r={},s){let i=null;const o=r.once?(e,r)=>{s(e)&&((0,n.xt)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.Cn)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function d(e,t,r,o={}){let a=null,h=null,c=null;function d(){a&&h&&(h.remove(),o.onListenerRemove?.(a),a=null,h=null)}function u(e){o.once&&o.once&&(0,n.xt)(c),r(e)}const p=l(e,((e,r)=>{d(),(0,s.wb)(e)&&(a=e,h=(0,s.on)(e,t,u),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return c=(0,i.hA)((()=>{p.remove(),d()})),c}function u(e,t){return function(e,t,r){if((0,o.G4)(r))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,n.xt)(a)}return new Promise(((s,n)=>{a=(0,i.vE)([(0,o.u7)(r,(()=>{l(),n((0,o.NK)())})),c(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??p)])}))}(e,f,t)}function p(e){return!0}function f(e){return!!e}r(80559);const _={sync:!0},g={initial:!0},m={sync:!0,initial:!0}},47566:(e,t,r)=>{r(97770),r(18047),r(71754),r(73444);var s=r(10838),i=r(78888),n=r(49186);async function o(e){if(null!=l.fetchBundleAsset)return l.fetchBundleAsset(e);const t=await(0,i.A)(e,{responseType:"text"});return JSON.parse(t.data)}class a{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let s;s="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=s,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)\\/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,i){const a=t.exec(r);if(!a)throw new n.A("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",h=a[2],c=(0,s.xO)(i),d=`${l}${h}.json`,u=c?`${l}${h}_${c}.json`:d;let p;try{p=await o(e(u))}catch(t){if(u===d)throw new n.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{p=await o(e(d))}catch(e){throw new n.A("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return p}(this.getAssetUrl,this.matcher,e,t)}}const l={};var h,c=r(2741);(0,s.ao)((h={pattern:"esri/",location:c.s},new a(h)))},61893:(e,t,r)=>{r.d(t,{A:()=>d});var s,i,n=r(90237),o=r(69622),a=r(74887),l=r(40608);(i=s||(s={}))[i.PENDING=0]="PENDING",i[i.RESOLVED=1]="RESOLVED",i[i.REJECTED=2]="REJECTED";class h{constructor(){this._resolver=(0,a.Tw)(),this._status=s.PENDING,this._resolvingPromises=[],this._resolver.promise.then((()=>{this._status=s.RESOLVED,this._cleanUp()}),(()=>{this._status=s.REJECTED,this._cleanUp()})),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===s.RESOLVED}isRejected(){return this._status===s.REJECTED}isFulfilled(){return this._status!==s.PENDING}abort(){this._resolver.reject((0,a.NK)())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=(0,a.Tw)(),t=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(t);r.then((()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()}),(e=>{this.isFulfilled()||this._allPromise!==r||(0,a.zf)(e)||this._resolver.reject(e)})),e.resolve()}}const c=e=>{let t=class extends e{constructor(...e){super(...e),this._promiseProps=new h,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(e,t){return this._promiseProps.promise.then((()=>this)).then(e,t)}catch(e){return this.when(null,e)}addResolvingPromise(e){e&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in e?e.when():e)}};return t=(0,n._)([(0,l.$)("esri.core.Promise")],t),t};let d=class extends(c(o.A)){};d=(0,n._)([(0,l.$)("esri.core.Promise")],d),function(e){e.EsriPromiseMixin=c}(d||(d={}))},71754:(e,t,r)=>{r.d(t,{V:()=>h});var s=r(53966),i=r(93637),n=r(799),o=r(97770),a=r(18047);const l=()=>s.A.getLogger("esri.intl.substitute");function h(e,t,r={}){const{format:s={}}=r;return(0,n.HC)(e,(e=>function(e,t,r){let s,n;const o=e.indexOf(":");if(-1===o?s=e.trim():(s=e.slice(0,o).trim(),n=e.slice(o+1).trim()),!s)return"";const a=(0,i.wc)(s,t);if(null==a)return"";const l=(n?r?.[n]:null)??r?.[s];return l?c(a,l):n?d(a,n):u(a)}(e,t,s)))}function c(e,t){switch(t.type){case"date":return(0,o.Yq)(e,t.intlOptions);case"number":return(0,a.ZV)(e,t.intlOptions);default:return l().warn("missing format descriptor for key {key}"),u(e)}}function d(e,t){switch(t.toLowerCase()){case"dateformat":return(0,o.Yq)(e);case"numberformat":return(0,a.ZV)(e);default:return l().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,o.Yq)(e):/^numberformat/i.test(t)?(0,a.ZV)(e):u(e)}}function u(e){switch(typeof e){case"string":return e;case"number":return(0,a.ZV)(e);case"boolean":return""+e;default:return e instanceof Date?(0,o.Yq)(e):""}}},73747:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ut});var s=r(70333),i=r(90237),n=r(92602),o=r(78888),a=r(49186),l=r(65529),h=r(37955),c=r(4718),d=r(93637),u=r(74887),p=r(84952),f=r(10107),_=(r(44208),r(53966)),g=r(40608);r(47566),r(87811);var m=r(97768),v=r(61893),w=r(36708),y=r(13069),S=r(79901),I=r(62788),A=r(71429),k=r(37330),U=r(98291),P=r(36563),b=r(11932);const T=new Map;function x(){T.clear()}function R(e){T.delete(e)}function O(...e){const t=U.A.acquire();for(let r=0;r<e.length;r++){const s=e[r],i=typeof s;if("string"===i)t.push(s);else if(Array.isArray(s))t.push.apply(t,s);else if("object"===i)for(const e in s)s[e]&&t.push(e)}const r=t.join(" ");return U.A.release(t),r}(()=>{const e=new Map;new ResizeObserver((t=>{x();for(const r of t)e.get(r.target)?.(r)}))})();const C=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce(((e,t)=>(e[t]=[],e)),{}),N=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],E=new k.I({whiteList:C,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(N.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),M="http://www.w3.org/",D=`${M}2000/svg`,j=`${M}1999/xlink`;let L=[],q=(e,t)=>{let r={};return Object.keys(e).forEach((t=>{r[t]=e[t]})),t&&Object.keys(t).forEach((e=>{r[e]=t[e]})),r},$=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),Z=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},V=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if($(e[s],t))return s;return-1},F=(e,t,r,s)=>{let i=e[t];if(""===i.vnodeSelector)return;let n=i.properties;if(!(n?void 0===n.key?n.bind:n.key:void 0))for(let n=0;n<e.length;n++)if(n!==t){let t=e[n];if($(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===s?s:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},B=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},H=[],z=!1,J=e=>{(e.children||[]).forEach(J),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},G=()=>{z=!1,H.forEach(J),H.length=0},W=e=>{H.push(e),z||(z=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(G,{timeout:16}):setTimeout(G,16))},X=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let s=()=>{t.parentNode&&(t.parentNode.removeChild(t),W(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),W(e))},Y=(e,t,r)=>{if(!t)return;let s=r.eventHandlerInterceptor,i=Object.keys(t),n=i.length;for(let o=0;o<n;o++){let n=i[o],a=t[n];if("className"===n)throw new Error('Property "className" is not supported, use "class".');if("class"===n)re(e,a,!0);else if("classes"===n){let t=Object.keys(a),r=t.length;for(let s=0;s<r;s++){let r=t[s];a[r]&&e.classList.add(r)}}else if("styles"===n){let t=Object.keys(a),s=t.length;for(let i=0;i<s;i++){let s=t[i],n=a[s];n&&(Z(n),r.styleApplyer(e,s,n))}}else if("key"!==n&&null!=a){let i=typeof a;"function"===i?(0===n.lastIndexOf("on",0)&&(s&&(a=s(n,a,e,t)),"oninput"===n&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[n]=a):r.namespace===D?"href"===n?e.setAttributeNS(j,n,a):e.setAttribute(n,a):"string"===i&&"value"!==n?"innerHTML"===n?e[n]=E.sanitize(a):K(e)&&n in e?e[n]=a:e.setAttribute(n,a):e[n]=a}}};function K(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let Q,ee=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)te(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),Y(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},te=(e,t,r,s)=>{let i,n=0,o=e.vnodeSelector,a=t.ownerDocument;if(""===o)i=e.domNode=a.createTextNode(e.text),void 0!==r?t.insertBefore(i,r):t.appendChild(i);else{for(let l=0;l<=o.length;++l){let h=o.charAt(l);if(l===o.length||"."===h||"#"===h){let h=o.charAt(n-1),c=o.slice(n,l);"."===h?i.classList.add(c):"#"===h?i.id=c:("svg"===c&&(s=q(s,{namespace:D})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,c):(i=e.domNode=e.domNode||a.createElement(c),"input"===c&&e.properties&&void 0!==e.properties.type&&i.setAttribute("type",e.properties.type)),void 0!==r?t.insertBefore(i,r):i.parentNode!==t&&t.appendChild(i)),n=l+1}}ee(i,e,s)}},re=(e,t,r)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,r)}))},se=(e,t,r,s,i)=>{if(r===s)return!1;s=s||L;let n,o=(r=r||L).length,a=s.length,l=0,h=0,c=!1;for(;h<a;){let a=l<o?r[l]:void 0,d=s[h];if(void 0!==a&&$(a,d))c=Q(a,d,i)||c,l++;else{let a=V(r,d,l+1);if(a>=0){for(n=l;n<a;n++)X(r[n]),F(r,n,e,"removed");c=Q(r[a],d,i)||c,l=a+1}else te(d,t,l<o?r[l].domNode:void 0,i),B(d),F(s,h,e,"added")}h++}if(o>l)for(n=l;n<o;n++)X(r[n]),F(r,n,e,"removed");return c};Q=(e,t,r)=>{let s=e.domNode,i=!1;if(e===t)return!1;let n=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=s.ownerDocument.createTextNode(t.text);return s.parentNode.replaceChild(e,s),t.domNode=e,i=!0,i}t.domNode=s}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(r=q(r,{namespace:D})),e.text!==t.text&&(n=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,n=se(t,s,e.children,t.children,r)||n,n=((e,t,r,s)=>{if(!r)return;let i=!1,n=Object.keys(r),o=n.length;for(let a=0;a<o;a++){let o=n[a],l=r[o],h=t[o];if("class"===o)h!==l&&(re(e,h,!1),re(e,l,!0));else if("classes"===o){let t=e.classList,r=Object.keys(l),s=r.length;for(let e=0;e<s;e++){let s=r[e],n=!!l[s];n!==!!h[s]&&(i=!0,n?t.add(s):t.remove(s))}}else if("styles"===o){let t=Object.keys(l),r=t.length;for(let n=0;n<r;n++){let r=t[n],o=l[r];o!==h[r]&&(i=!0,o?(Z(o),s.styleApplyer(e,r,o)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==o||K(e)){if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===D?"href"===o?e.setAttributeNS(j,o,l):e.setAttribute(o,l):"string"===t?"innerHTML"===o?e[o]=E.sanitize(l):"role"===o&&""===l?e.removeAttribute(o):K(e)&&o in e?e[o]=l:e.setAttribute(o,l):e[o]!==l&&(e[o]=l),i=!0)}}else{let t=e[o];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[o]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}}return i})(s,e.properties,t.properties,r)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[s,r,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(s,t.properties,e.properties),i};let ie=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let s=e;e=r,Q(s,r,t)},domNode:e.domNode});const ne={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let oe,ae=e=>q(ne,e),le=(e,t,r)=>(r=ae(r),te(t,e,void 0,r),ie(t,r)),he=(e,t,r)=>(r=ae(r),te(t,e.parentNode,e,r),ie(t,r)),ce=(e,t,r)=>(r=ae(r),t.domNode=e,ee(e,t,r),ie(t,r)),de=(e,t,r)=>(r=ae(r),te(t,e.parentNode,e,r),e.parentNode.removeChild(e),ie(t,r));oe=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const ue={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},pe={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}},fe=(e,t,r=!1)=>{let s=e;return t.forEach(((e,i)=>{const n=s?.children?((e,t)=>e.find(t))(s.children,(t=>t.domNode===e)):void 0;r&&!n&&i!==t.length-1||(s=n)})),s};var _e=r(14813),ge=r(2741);let me;me="components/assets";const ve=Symbol("widget"),we=Symbol("widget-test-data"),ye=[],Se={},Ie=new WeakMap;function Ae(e,t){let r=t.children;if(r?.length)for(let t=0;t<r.length;++t)r[t]=Ae(e,r[t]);else r=ye;const s=t.vnodeSelector;if(be(s)){const i=t.properties||Se,n=i.key||s,o={key:n,afterCreate:ke,afterUpdate:Ue,afterRemoved:Pe,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:n,children:r}};return{vnodeSelector:s.vnodeSelector,properties:o,children:void 0,text:void 0,domNode:null}}return t}function ke(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:n}){const o=new i(n);o.container=e,Ie.set(e,o),o.afterCreate?.(o,e),s.addHandles((0,P.hA)((()=>Pe(e)))),queueMicrotask((()=>{o[we].projector.renderNow()}))}function Ue(e,t,r,{widgetProperties:s}){const i=Ie.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function Pe(e){const t=Ie.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),Ie.delete(e))}function be(e){return"function"==typeof e&&e[ve]}const Te=new Set;new Map;var xe,Re=r(10838),Oe=r(73444);let Ce=0;function Ne(e,t){const r=Object.prototype.hasOwnProperty;for(const s in t)r.call(t,s)&&r.call(e,s)&&(null!=e[s]&&null!=t[s]&&"object"==typeof e[s]&&"object"==typeof t[s]?Ne(e[s],t[s]):e[s]=t[s]);return e}const Ee=(e=>{let t;const r={...ue,...e},s=(n=r,{...pe,...n}),i=s.performanceLogger;var n;let o,a=!0,l=!1;const h=[],c=[],d=(e,n,o)=>{let a;s.eventHandlerInterceptor=(e,s,n,o)=>function(e){let s;i("domEvent",e);const n=((e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r})(e.currentTarget,a.domNode),o=n.some((e=>customElements.get(e?.tagName?.toLowerCase())));if(e.eventPhase!==Event.CAPTURING_PHASE&&o){const t=e.composedPath(),r=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).reverse();s=fe(a.getLastRender(),r,!0)}else n.reverse(),s=fe(a.getLastRender(),n);let l;return s&&(l=r.handleInterceptedEvent(t,s,this,e)),i("domEventProcessed",e),l},r.postProcessProjectionOptions?.(s);const l=o();a=e(n,l,s),s.eventHandlerInterceptor=void 0,h.push(a),c.push(o),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(a,l)};let u=()=>{if(o=void 0,a){a=!1,i("renderStart",void 0);for(let e=0;e<h.length;e++){const t=c[e]();i("rendered",void 0);try{h[e].update(t)}catch(e){console.error(e)}i("patched",void 0)}i("renderDone",void 0),a=!0}};return r.modifyDoRenderImplementation&&(u=r.modifyDoRenderImplementation(u,h,c)),t={renderNow:u,scheduleRender:()=>{o||l||(o=requestAnimationFrame(u))},stop:()=>{o&&(cancelAnimationFrame(o),o=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{d(le,e,t)},insertBefore:(e,t)=>{d(he,e,t)},merge:(e,t)=>{d(ce,e,t)},replace:(e,t)=>{d(de,e,t)},detach:e=>{for(let t=0;t<c.length;t++)if(c[t]===e)return c.splice(t,1),h.splice(t,1)[0];throw new Error("renderFunction was not found")}},t})({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,s,i,n)=>{const o=t?.(e,s,i,n),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>o?.call(i,e);i.addEventListener(t,r,a);const s=()=>i.removeEventListener(t,r,a),l=n.afterRemoved;n.afterRemoved=e=>{l?.(e),s()}}return o}},handleInterceptedEvent(e,t,r,s){const{eventPhase:i,type:n}=s,o=i===Event.CAPTURING_PHASE;let a=`on${n}${o?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${n[0].toUpperCase()}${n.slice(1)}${o?"Capture":""}`,l&&a in l))&&(x(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let Me=!1,De=class extends(v.A.EsriPromiseMixin(l.A.EventedAccessor)){static{this[xe]=!0}constructor(e,t){super(e,t),this._attached=!1,this._projector=Ee,this._readyForTrueRender=!1,this.key=this,this.autoRenderingEnabled=!0,this._loadLocale=(0,u.sg)((async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,Re.ud)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=Ne((0,c.o8)(r),this.uiStrings)),this[t]=r})));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&_.A.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()})),this.addHandles((0,P.hA)()),_e.qu||(0,_e.Qu)((0,p.s2)((0,ge.s)("components/assets")));const r="esri-widget-uid-"+(0,y.lk)(),s=this.render.bind(this);this._trackingTarget=new A.r((()=>{this.autoRenderingEnabled&&this.scheduleRender()}));const i=()=>({vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}),n=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=s()??i(),t=e.properties??={};if(t.key??=r,be(e.vnodeSelector)){if(!this.visible)return i()}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display??="";let n=0;return e.children?.forEach((e=>{be(e.vnodeSelector)||(e.properties??={},e.properties.key??=`${this.id}--${n++}`)})),Ae(this,e)};this.render=()=>{if(Me)return n();let e=function(e){return T.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),Me=!0;try{e=(0,I.a)(this._trackingTarget,n)}catch(e){throw _.A.getLogger(this).error(e),e}finally{Me=!1}return e&&function(e,t){T.set(e,t)}(this,e),e};const o=this.beforeFirstRender();o?this._resourcesFetch=o.then((()=>{this._readyForTrueRender=!0,this._postInitialize()})):(this._resourcesFetch=Promise.resolve().then((()=>{this._postInitialize()})),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),function(e){Te.add(e),e.finally((()=>Te.delete(e)))}(this._resourcesFetch)}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then((()=>{})).catch(u.jH):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,m.pR)(this._trackingTarget),(0,m.pR)(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,R(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return"string"==typeof(t=e)?document.getElementById(t):t??null;var t}get domNode(){return this.container}set domNode(e){this.container=e}get icon(){return null}set icon(e){this._overrideIfSome("icon",e)}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+Ce++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(xe=ve,we)](){return{projector:this._projector}}static{this.vnodeSelector="div"}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(R(this),this._projector.scheduleRender())}classes(...e){return O.apply(this,e)}renderNow(){R(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,w.wB)((()=>this.viewModel),((e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,h.wb)(e)&&this.addHandles(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),w.pc)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(u.jH),this.scheduleRender()};this.addHandles([(0,Oe.oQ)(e),(0,w.wB)((()=>this.uiStrings),e)]),this.addHandles((0,w.z7)((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0}))}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};(0,i._)([(0,f.MZ)()],De.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,f.MZ)({value:null})],De.prototype,"container",null),(0,i._)([(0,S.w)("container")],De.prototype,"castContainer",null),(0,i._)([(0,f.MZ)()],De.prototype,"icon",null),(0,i._)([(0,f.MZ)()],De.prototype,"id",null),(0,i._)([(0,f.MZ)()],De.prototype,"label",null),(0,i._)([(0,f.MZ)()],De.prototype,"renderable",null),(0,i._)([(0,f.MZ)()],De.prototype,"uiStrings",void 0),(0,i._)([(0,f.MZ)()],De.prototype,"viewModel",void 0),(0,i._)([(0,f.MZ)({value:!0})],De.prototype,"visible",null),(0,i._)([(0,f.MZ)()],De.prototype,"key",void 0),(0,i._)([(0,f.MZ)()],De.prototype,"children",void 0),(0,i._)([(0,f.MZ)()],De.prototype,"afterCreate",void 0),(0,i._)([(0,f.MZ)()],De.prototype,"afterUpdate",void 0),(0,i._)([(0,f.MZ)()],De.prototype,"afterRemoved",void 0),De=(0,i._)([(0,g.$)("esri.widgets.Widget")],De);const je=De;function Le(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var qe=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},$e=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?$e(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=qe(i)),t.push(i))}};function Ze(e,t,...r){return"function"!=typeof e||be(e)?function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(1===r.length&&"string"==typeof r[0])return{vnodeSelector:e,properties:t||void 0,children:void 0,text:r[0],domNode:null};var i=[];return $e(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t??null,...r):e(t,...r)}const Ve=/\W/g;function Fe(){const e=getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll(Ve,"").toLowerCase();switch(e){case"dark":case"light":return`calcite-mode-${e}`;default:return null}}var Be=r(71754);const He="esri-identity-modal",ze={base:He,info:`${He}__info`,notice:`${He}__notice`};let Je=class extends je{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return function(e){const t=[];for(const r of Object.keys(e))customElements.get(`calcite-${r}`)||t.push(e[r]?.());return t.length>0?Promise.all(t):null}({button:()=>Promise.all([r.e(9e3),r.e(9402),r.e(7836)]).then(r.bind(r,37836)),dialog:()=>Promise.all([r.e(9e3),r.e(9402),r.e(2893)]).then(r.bind(r,52893)),input:()=>Promise.all([r.e(9e3),r.e(9402),r.e(2165)]).then(r.bind(r,2165)),label:()=>Promise.all([r.e(9e3),r.e(224)]).then(r.bind(r,87843)),notice:()=>Promise.all([r.e(9e3),r.e(9402),r.e(8098)]).then(r.bind(r,48098))})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:e,title:t,messages:r,signingIn:s,oAuthPrompt:i,server:n,resource:o,error:a}=this,{info:l,oAuthInfo:h,lblItem:c,invalidUser:d,noAuthService:u,lblUser:p,lblPwd:f,lblCancel:_,lblSigning:g,lblOk:m}=r;return Ze("div",{class:this.classes(ze.base,Fe())},Ze("form",{bind:this,onsubmit:this._submit},Ze("calcite-dialog",{bind:this,heading:t,modal:!0,open:e,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},Ze("div",{class:ze.info},(0,Be.V)(i?h:l,{server:n&&/\.arcgis\.com/i.test(n)?"ArcGIS Online":n,resource:`(${o||c})`})),a?Ze("calcite-notice",{class:ze.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},Ze("div",{slot:"message"},a.details?.httpStatus?d:u)):null,i?null:[Ze("calcite-label",null,p,Ze("calcite-input",{afterCreate:e=>this._usernameInputNode=e,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),Ze("calcite-label",null,f,Ze("calcite-input",{afterCreate:e=>this._passwordInputNode=e,bind:this,name:"password",required:!0,type:"password",value:""}))],Ze("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},_),Ze("calcite-button",{loading:!!s,slot:"footer-end",type:"submit"},s?g:m))))}_focusUsernameInput(){return async function(e){await(0,b.$m)((0,u.Mq)(void 0));const t=e();t&&("setFocus"in t&&"function"==typeof t.setFocus?await t.setFocus():t instanceof HTMLElement&&t.focus())}((()=>this._usernameInputNode))}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",t)}};(0,i._)([(0,f.MZ)({readOnly:!0})],Je.prototype,"container",void 0),(0,i._)([(0,f.MZ)(),Le("esri/t9n/common")],Je.prototype,"commonMessages",void 0),(0,i._)([(0,f.MZ)()],Je.prototype,"error",void 0),(0,i._)([(0,f.MZ)(),Le("esri/identity/t9n/identity")],Je.prototype,"messages",void 0),(0,i._)([(0,f.MZ)()],Je.prototype,"oAuthPrompt",void 0),(0,i._)([(0,f.MZ)()],Je.prototype,"open",void 0),(0,i._)([(0,f.MZ)()],Je.prototype,"signingIn",void 0),(0,i._)([(0,f.MZ)()],Je.prototype,"server",void 0),(0,i._)([(0,f.MZ)({readOnly:!0})],Je.prototype,"title",null),(0,i._)([(0,f.MZ)()],Je.prototype,"resource",void 0),Je=(0,i._)([(0,g.$)("esri.identity.IdentityModal")],Je);const Ge=Je,We="esriJSAPIOAuth";class Xe{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(We,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t?.appId&&t?.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const e=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",t.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(e,r);else{const t=new XMLHttpRequest;t.open("POST",e),t.send(r)}}if(t?.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(We,JSON.stringify(e))}catch(e){console.log(e)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t?.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(We);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}Xe.prototype.declaredClass="esri.identity.OAuthCredential";var Ye,Ke=r(25482);let Qe=class extends Ke.A{static{Ye=this}constructor(e){super(e),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Ye.fromJSON(this.toJSON())}};(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"appId",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"authNamespace",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"expiration",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"flowType",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"forceLogin",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"forceUserId",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"locale",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"popup",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"portalUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"preserveUrlHash",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],Qe.prototype,"userId",void 0),Qe=Ye=(0,i._)([(0,g.$)("esri.identity.OAuthInfo")],Qe);const et=Qe;let tt=class extends Ke.A{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"currentVersion",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"hasPortal",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"hasServer",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"owningSystemUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"owningTenant",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"server",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,f.MZ)({json:{write:!0}})],tt.prototype,"webTierAuth",void 0),tt=(0,i._)([(0,g.$)("esri.identity.ServerInfo")],tt);const rt=tt;var st=r(39131);const it={},nt=e=>{const t=new p.s0(e.owningSystemUrl).host,r=new p.s0(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},ot=(e,t)=>!!(nt(e)&&t&&t.some((t=>t.test(e.server))));let at=null,lt=null;try{at=window.localStorage,lt=window.sessionStorage}catch{}class ht extends l.A{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,p.An)(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",(e=>{this._pageShowHandler(e)}))}registerServers(e){const t=this.serverInfos;t?(e=e.filter((e=>!this.findServerInfo(e.server))),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach((e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)}))}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),n=!0;i||(i=new rt,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),n=!1):(s=new ct({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),n||s.refreshServerTokens()}toJSON(){return(0,c.oy)({serverInfos:this.serverInfos.map((e=>e.toJSON())),oAuthInfos:this.oAuthInfos.map((e=>e.toJSON())),credentials:this.credentials.map((e=>e.toJSON()))})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach((t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new rt(t))})),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new et(t))})),e.length&&this.registerOAuthInfos(e)}s&&s.forEach((e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new ct(e)).emitTokenChange(),this.credentials.push(e))}))}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const t of this.credentials)if(this._hasSameServerInstance(t.server,e)&&-1!==this._getIdenticalSvcIdx(e,t)&&t.scope===s){r=t;break}return r}getCredential(e,t){let r,s=!1,i=!0;t&&(s=!(!t.token&&!t.credential),r=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,o=(0,u.Tw)();if(t.signal&&(0,u.u7)(t.signal,(()=>{n.abort()})),(0,u.u7)(n,(()=>{o.reject(new a.A("identity-manager:user-aborted","ABORTED"))})),(0,u.G4)(n))return o.promise;t.signal=n.signal;const l=this._isAdminResource(e),h=s?this.findCredential(e):null;let c;if(h&&498===r?.details?.httpStatus)h.destroy();else if(h)return c=new a.A("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:r}),o.reject(c),o.promise;const d=this._findCredential(e,t);if(d)return o.resolve(d),o.promise;let f=this.findServerInfo(e);if(f)!f.hasPortal&&f.server&&f.owningSystemUrl&&this._hasSameServerInstance(f.server,f.owningSystemUrl)&&(f.hasPortal=!0),!f.hasServer&&this._isServerRsrc(e)&&(f._restInfoPms=this._getTokenSvcUrl(e),f.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return c=new a.A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),o.reject(c),o.promise;f=new rt,f.server=this._getServerInstanceRoot(e),"string"==typeof t?(f.tokenServiceUrl=t,f.hasPortal=!0):(f._restInfoPms=t,f.hasServer=!0),this.registerServers([f])}return f.hasPortal&&void 0===f._selfReq&&(i||(0,p.FX)(f.tokenServiceUrl,this._appOrigin)||this._gwDomains.some((e=>e.tokenServiceUrl===f.tokenServiceUrl)))&&(f._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(f.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,f,t,o,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const s=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new p.s0(this._appOrigin),n=e.shortLivedTokenValidity;let l,h,c,d,u,f,_,g;t&&(g=this.tokenValidity||n||this._defaultTokenValidity,g>n&&n>0&&(g=n)),r&&(l=r.isAdmin,h=r.serverUrl,c=r.token,f=r.signal,_=r.ssl,e.customParameters=r.customParameters),l?d=e.adminTokenServiceUrl:(d=e.tokenServiceUrl,u=new p.s0(d.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!_&&"http"===i.scheme&&((0,p.FX)(i.uri,d,!0)||"https"===u.scheme&&i.host===u.host&&"7080"===i.port&&"7443"===u.port)&&(d=d.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const m={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:c,expiration:g,referer:l||s?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:f,...r?.ioArgs};return s||(m.withCredentials=!1),(0,o.A)(d,m).then((r=>{const s=r.data;if(!s?.token)return new a.A("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return it[i]||(it[i]={}),t&&(it[i][t.username]=t.password),s.validity=g,s}))}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,t,r){let s=!1;return this.getCredential(e,{prompt:!1}).then((i=>{let n;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,o.A)(n,{query:l,authMode:"anonymous"}).then((e=>{if(!1===e.data.valid)throw new a.A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,e.data);return s=!!e.data.viewOnlyUserTypeApp,{credential:i}})).catch((e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details?.httpStatus;if(498===t)throw i.destroy(),new a.A("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new a.A("identity-manager:invalid-request","Bad request");return{credential:i}}))})).then((e=>({credential:e.credential,viewOnly:s})))}setOAuthResponseHash(e){e&&("#"===e.charAt(0)&&(e=e.slice(1)),this._processOAuthPopupParams((0,p.zf)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=(0,u.Tw)(),i=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=l=h=null},n=()=>{i(),this._oAuthDfd=null,s.reject(new a.A("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,u.u7)(r.signal,(()=>{n()}));const o=new Ge({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=o,this.emit("dialog-create");let l=o.on("cancel",n),h=o.on("submit",(e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then((n=>{i();const o=new ct({userId:e.username,server:t.server??void 0,token:n.token,expires:null!=n.expires?Number(n.expires):null,ssl:!!n.ssl,isAdmin:r.isAdmin,validity:n.validity});s.resolve(o)})).catch((e=>{o.error=e,o.signingIn=!1}))}));return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=(0,u.Tw)();const i=this._oAuthDfd;let n;s?.signal&&(0,u.u7)(s.signal,(()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&c()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const o=r._oAuthCred;if(o.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));n=(0,p.$1)(e),o.codeVerifier=n,e=crypto.getRandomValues(new Uint8Array(32)),o.stateUID=(0,p.$1)(e),o.save()||(o.codeVerifier=n=null)}else o.codeVerifier=null;let l,h;this._getCodeChallenge(n).then((i=>{const n=!s||!1!==s.oAuthPopupConfirmation;if(!r.popup||!n)return void this._doOAuthSignIn(e,t,r,i);const o=new Ge({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=o,this.emit("dialog-create"),l=o.on("cancel",c),h=o.on("submit",(()=>{d(),this._doOAuthSignIn(e,t,r,i)}))}));const c=()=>{d(),this._oAuthDfd=null,i.reject(new a.A("identity-manager:user-aborted","ABORTED"))},d=()=>{l?.remove(),h?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach((e=>{e.destroy()})),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=(0,h.on)(window,"message",(t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then((e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)})).catch((e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)}))}}))}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){"#"===e.charAt(0)&&(e=e.slice(1));const t=(0,p.zf)(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){"?"===t.charAt(0)&&(t=t.slice(1));const e=(0,p.zf)(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach((e=>{delete t[e]}));const r=(0,p.x0)(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,s,i){return e=e.replace(/^http:/i,"https:"),(0,o.A)(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:s&&i?{grant_type:"authorization_code",code:t,redirect_uri:s,client_id:r,code_verifier:i}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then((e=>e.data))}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t);return(0,p.$1)(new Uint8Array(r))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new a.A("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,n,o=-1;const a=t?.token,l=t?.resource,h=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter((t=>this._hasSameServerInstance(t.server,e)&&t.scope===h));if(e=l||e,c.length)if(1===c.length){if(r=c[0],i=this.findServerInfo(r.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,r.userId):void 0,o=this._getIdenticalSvcIdx(e,r),!a)return-1===o&&r.resources.push(e),this._addResource(e,n),r;-1!==o&&(r.resources.splice(o,1),this._removeResource(e,n))}else{let t,r;if(c.some((a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i?.owningSystemUrl,n=s?this.findCredential(s,t.userId):void 0,o=r,!0)))),a)t&&(t.resources.splice(o,1),this._removeResource(e,n));else if(t)return this._addResource(e,n),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!(0,p.FX)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,p.FX)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new p.s0(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==r||(0,st.$E)(t)||(r=t.indexOf("/sharing")),-1===r&&t.endsWith("/")&&(r=t.length-1),r>-1?e.slice(0,r):e}_hasSameServerInstance(e,t){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=(0,st.qG)(e),t=(0,st.qG)(t),(e=e.slice(Math.max(0,e.indexOf(":"))))===t.slice(Math.max(0,t.indexOf(":")))}_sanitizeUrl(e){const t=(n.A.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.slice(r+t.length+1)),e=(0,p.S8)(e),(0,p.An)(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new p.s0(e.toLowerCase()),r=this._portalConfig;let s=this._gwDomains.some((e=>e.regex.test(t.uri)));return!s&&r&&(s=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),s||n.A.portalUrl&&(s=(0,p.FX)(t,n.A.portalUrl,!0)),s||(s=this._portals.some((e=>this._hasSameServerInstance(e,t.uri)))),s=s||this._agsPortal.test(t.path),s}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach(((i,n)=>{-1===r&&i.regex.test(e)&&(r=n),-1===s&&i.regex.test(t)&&(s=n)}));let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r?.owningSystemUrl;s&&nt(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,s;if(this._isRESTService(e)||this._isAdminResource(e)){const s=this._getServerInstanceRoot(e);return t=s+"/admin/generateToken",r=(0,o.A)(e=s+"/rest/info",{query:{f:"json"}}).then((e=>e.data)),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some((r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t))),t||this._portals.some((r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t))),t||(s=e.toLowerCase().indexOf("/sharing"),-1!==s&&(t=e.slice(0,s)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new p.s0(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then((i=>{const n=new ct({userId:i.username,server:r.server??void 0,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=n.userId,s.storage=i.persist?at:lt,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=n.userId,s.ssl=n.ssl,s.save(),n}))}const i=new ct({userId:e.username,server:r.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?at:lt,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new a.A(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then((e=>{t.resolve(e)})).catch((e=>{t.reject(e)}))}_setOAuthResponseQueryString(e){e&&("?"===e.charAt(0)&&(e=e.slice(1)),this._processOAuthPopupParams((0,p.zf)(e)))}async _exchangeToken(e,t,r){return(await(0,o.A)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}})).data.token}async _getPlatformSelf(e,t){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const r=await(0,o.A)(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,r.data}catch(e){throw"OAUTH_0066"===e.details?.messageCode&&(this._getPlatformSelfError=[e,Date.now()]),e}}_getPortalSelf(e,t){let r;return this._gwDomains.some((t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r))),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),(0,o.A)(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then((e=>e.data)))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||(0,p.FX)(r,e,!0)))}_checkProtocol(e,t,r,s){let i=!0;const n=s?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,p.zs)(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&r(new a.A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,t,r,s,i,n){return s||(s=(0,u.Tw)()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_?.resource,s=e.resUrl_,i=e.refresh_;let n=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,n=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const o=this._soReqs,a={};this._soReqs=[],o.forEach((e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}})),e.resolve(t),o.forEach((e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)})),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,n||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(i,n,o,l)=>{const c=e.sinfo_,d=!e.options_||!1!==e.options_.prompt,f=c.hasPortal&&this._findOAuthInfo(e.resUrl_);let _,g;if(i)t(new ct({userId:i,server:c.server??void 0,token:o??void 0,expires:null!=l?Number(l):null,ssl:!!n}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=(0,h.on)(window,"message",(e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new a.A("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new ct(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new a.A("identity-manager:credential-request-failed","Parent application's token has expired.")):r(a.A.fromJSON(e.data.error))))}));(0,u.u7)(e.options_?.signal,(()=>{s.remove()}))}else if(f){let i=f._oAuthCred;if(!i){const e=new Xe(f,at),t=new Xe(f,lt);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,f._oAuthCred=i}if(i.isValid()){_=new ct({userId:i.userId??void 0,server:c.server??void 0,token:i.token??void 0,expires:i.expires,ssl:i.ssl??void 0,_oAuthCred:i});const n=f.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);n||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(c.server,i.refreshToken,i.appId).then((e=>(_.expires=Date.now()+1e3*e.expires_in,_.token=e.access_token,_))):Promise.resolve(_),e._pendingDfd.then((e=>n?this._exchangeToken(e.server,f.appId,e.token).then((t=>(e.token=t,e))).catch((()=>e)):e)).then((e=>{t(e)})).catch((e=>{const t=e.details?.httpStatus;t>0&&404!==t?(i.destroy(),s()):r(e)}))):t(_)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(f.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===i.stateUID&&i.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,f,c).then((e=>{t(e)})).catch(r)}else{const s=()=>{d?e._pendingDfd=this.oAuthSignIn(e.resUrl_,c,f,e.options_).then(t,r):(g=new a.A("identity-manager:not-authenticated","User is not signed in."),r(g))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(c.server,f.appId).then((e=>{(0,p.FX)(e.portalUrl,this._appOrigin,!0)?(_=new ct({userId:e.username,server:c.server??void 0,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(_)):s()})).catch(s):s()}}else if(d){if(this._checkProtocol(e.resUrl_,c,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,c,s).then(t,r)}}else g=new a.A("identity-manager:not-authenticated","User is not signed in."),r(g)},i=()=>{const s=e.sinfo_,i=s.owningSystemUrl,n=e.options_;let o,a,l,h;if(n&&(o=n.token,a=n.error,l=n.prompt),h=this._findCredential(i,{token:o,resource:e.resUrl_}),!h)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){h=e;break}if(h){const i=this.findCredential(e.resUrl_,h.userId);if(i)t(i);else if(ot(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new ct(e))}else(e._pendingDfd=this.generateToken(this.findServerInfo(h.server),null,{serverUrl:e.resUrl_,token:h.token,signal:e.options_.signal,ssl:h.ssl})).then((r=>{t(new ct({userId:h?.userId,server:s.server??void 0,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))}),r)}else this._busy=null,o&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:o,error:a,prompt:l})).then((()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)}),(t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)}))};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,o=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then((t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=((0,d.wc)("authInfo.tokenServicesUrl",t)||(0,d.wc)("authInfo.tokenServiceUrl",t)||(0,d.wc)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,d.wc)("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}o&&r.owningSystemUrl?i():s()}),(()=>{e.sinfo_._restInfoPms=null;const t=new a.A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)})):o&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then((t=>{const r={};let s,i,n,o;return t&&(s=t.user?.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,o=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(n=t.customBaseUrl),e.sinfo_.currentVersion=o),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch((()=>null)).then((e=>(r.portalToken=e?.token,r.tokenExpiration=e?.expires,r))):!s&&i&&o>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:n,owningTenant:e.sinfo_._selfReq.owningTenant}).catch((()=>null)).then((()=>r)):r})).catch((()=>null)).then((t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()})):s()}_generateOAuthInfo(e){let t,r=null,s=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=this._appUrlObj.path;const e=r.search(/\/(apps|home)\//);r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=(0,o.A)(r+"/sharing/rest",{query:{f:"json"}}).then((()=>{this._defaultOAuthInfo=new et({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})}))):t=Promise.resolve(),t.then((()=>{if(this._defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,o.A)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,p.s2)(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then((e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&i?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+i:t.portalUrl=s,t.popup=window!==window.top||!((0,p.FX)(s,this._appOrigin)||this._gwDomains.some((e=>e.regex.test(s)&&e.regex.test(this._appOrigin)))),this.oAuthInfos.push(t)}}))}))}_doOAuthSignIn(e,t,r,s){const i=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const o={client_id:r.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!i.codeVerifier)};r.forceLogin&&(o.force_login=!0),r.forceUserId&&r.userId&&(o.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(o.redirectToUserOrgUrl=!0),i.codeVerifier&&(o.code_challenge=s||i.codeVerifier,o.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",c=l+"?"+(0,p.x0)(o);if(r.popup){const e=window.open(c,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval((()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new a.A("identity-manager:user-aborted","ABORTED");e.reject(t)}}}),500),this._oAuthOnPopupHandle=(0,h.on)(window,["arcgis:auth:hash","arcgis:auth:location:search"],(e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)}));else{const e=new a.A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:o,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=c}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,p.s2)(e.popupCallbackUrl);if(t){const e=(0,p.An)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach((t=>{delete e.query[t]})),(0,p.a6)(e.path,e.query)}return r}}ht.prototype.declaredClass="esri.identity.IdentityManagerBase";let ct=class extends l.A.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=s.id,t=e.findServerInfo(this.server),r=t?.owningSystemUrl,i=!!r&&"server"===this.scope,n=i&&ot(t,e._legacyFed),o=t.webTierAuth,a=o&&e.normalizeWebTierAuth,l=it[this.server],h=l?.[this.userId];let c,d=this.resources&&this.resources[0],u=i?e.findServerInfo(r):null,p={username:this.userId,password:h};if(o&&!a)return;i&&!u&&e.serverInfos.some((t=>(e._isIdProvider(r,t.server)&&(u=t),!!u)));const f=u?e.findCredential(u.server,this.userId):null;if(!i||f){if(!n){if(i)c={serverUrl:d,token:f?.token,ssl:f?.ssl};else if(a)p=null,c={ssl:this.ssl};else{if(!h){let r;return d&&(d=e._sanitizeUrl(d),this._enqueued=1,r=e._enqueue(d,t,null,null,this.isAdmin,this),r.then((()=>{this._enqueued=0,this.refreshServerTokens()})).catch((()=>{this._enqueued=0}))),r}this.isAdmin&&(c={isAdmin:!0})}return e.generateToken(i?u:t,i?null:p,c).then((e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()})).catch((()=>{}))}f?.refreshToken()}}refreshServerTokens(){if("portal"===this.scope){const e=s.id;e.credentials.forEach((t=>{const r=e.findServerInfo(t.server),s=r?.owningSystemUrl;t!==this&&t.userId===this.userId&&s&&"server"===t.scope&&(e._hasSameServerInstance(this.server,s)||e._isIdProvider(s,this.server))&&(ot(r,e._legacyFed)?(t.token=this.token,t.expires=this.expires,t.creationTime=this.creationTime,t.validity=this.validity,t.emitTokenChange()):t.refreshToken())}))}}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=s.id,r=this.server?t.findServerInfo(this.server):null,i=r?.owningSystemUrl,n=i?t.findServerInfo(i):null;!1===e||i&&"portal"!==this.scope&&(!n?.webTierAuth||t.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=s.id,t=e.credentials.indexOf(this);t>-1&&e.credentials.splice(t,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,c.oy)({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};(0,i._)([(0,f.MZ)()],ct.prototype,"creationTime",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"expires",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"isAdmin",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"oAuthState",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"resources",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"scope",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"server",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"ssl",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"token",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"userId",void 0),(0,i._)([(0,f.MZ)()],ct.prototype,"validity",void 0),ct=(0,i._)([(0,g.$)("esri.identity.Credential")],ct);class dt extends ht{}dt.prototype.declaredClass="esri.identity.IdentityManager";const ut=new dt;(0,s.Aq)(ut)}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2603],{34304:(t,n,a)=>{a.d(n,{DF:()=>c,FD:()=>o,Ov:()=>e,ct:()=>i});let r=1e-6;function o(){return r}const e=Math.random,u=Math.PI/180,s=180/Math.PI;function c(t){return t*u}function i(t){return t*s}Object.freeze(Object.defineProperty({__proto__:null,RANDOM:e,equals:function(t,n){return Math.abs(t-n)<=r*Math.max(1,Math.abs(t),Math.abs(n))},getEpsilon:o,setEpsilon:function(t){r=t},toDegree:i,toRadian:c},Symbol.toStringTag,{value:"Module"}))},51850:(t,n,a)=>{function r(){return[0,0,0]}function o(t){return[t[0],t[1],t[2]]}function e(t,n,a){return[t,n,a]}function u(t,n,a){return[t,n,a]}function s(t,n=[0,0,0]){const a=Math.min(3,t.length);for(let r=0;r<a;++r)n[r]=t[r];return n}function c(){return e(1,1,1)}function i(){return e(1,0,0)}function h(){return e(0,1,0)}function M(){return e(0,0,1)}a.d(n,{CN:()=>u,Cb:()=>d,Cw:()=>b,JP:()=>m,Un:()=>l,ci:()=>s,fA:()=>e,o8:()=>o,uY:()=>f,vt:()=>r});const f=[0,0,0],l=c(),b=i(),m=h(),d=M();Object.freeze(Object.defineProperty({__proto__:null,ONES:l,UNIT_X:b,UNIT_Y:m,UNIT_Z:d,ZEROS:f,clone:o,create:r,freeze:u,fromArray:s,fromValues:e,ones:c,unitX:i,unitY:h,unitZ:M,zeros:function(){return[0,0,0]}},Symbol.toStringTag,{value:"Module"}))},58083:(t,n,a)=>{a.d(n,{$0:()=>m,B8:()=>i,C:()=>e,D_:()=>s,O7:()=>y,Tl:()=>M,X_:()=>q,e$:()=>l,hM:()=>d,hZ:()=>u,hs:()=>f,kN:()=>b,l:()=>x,lw:()=>h,mg:()=>c,o1:()=>v,sC:()=>_,t2:()=>S,tZ:()=>D,ut:()=>T});var r=a(51850),o=a(34304);function e(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function u(t,n,a,r,o,e,u,s,c,i,h,M,f,l,b,m,d){return t[0]=n,t[1]=a,t[2]=r,t[3]=o,t[4]=e,t[5]=u,t[6]=s,t[7]=c,t[8]=i,t[9]=h,t[10]=M,t[11]=f,t[12]=l,t[13]=b,t[14]=m,t[15]=d,t}function s(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t,n){if(t===n){const a=n[1],r=n[2],o=n[3],e=n[6],u=n[7],s=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=a,t[6]=n[9],t[7]=n[13],t[8]=r,t[9]=e,t[11]=n[14],t[12]=o,t[13]=u,t[14]=s}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],t[14]=n[11],t[15]=n[15];return t}function i(t,n){const a=n[0],r=n[1],o=n[2],e=n[3],u=n[4],s=n[5],c=n[6],i=n[7],h=n[8],M=n[9],f=n[10],l=n[11],b=n[12],m=n[13],d=n[14],g=n[15],p=a*s-r*u,_=a*c-o*u,q=a*i-e*u,x=r*c-o*s,v=r*i-e*s,y=o*i-e*c,O=h*m-M*b,S=h*d-f*b,T=h*g-l*b,D=M*d-f*m,I=M*g-l*m,R=f*g-l*d;let N=p*R-_*I+q*D+x*T-v*S+y*O;return N?(N=1/N,t[0]=(s*R-c*I+i*D)*N,t[1]=(o*I-r*R-e*D)*N,t[2]=(m*y-d*v+g*x)*N,t[3]=(f*v-M*y-l*x)*N,t[4]=(c*T-u*R-i*S)*N,t[5]=(a*R-o*T+e*S)*N,t[6]=(d*q-b*y-g*_)*N,t[7]=(h*y-f*q+l*_)*N,t[8]=(u*I-s*T+i*O)*N,t[9]=(r*T-a*I-e*O)*N,t[10]=(b*v-m*q+g*p)*N,t[11]=(M*q-h*v-l*p)*N,t[12]=(s*S-u*D-c*O)*N,t[13]=(a*D-r*S+o*O)*N,t[14]=(m*_-b*x-d*p)*N,t[15]=(h*x-M*_+f*p)*N,t):null}function h(t,n,a){const r=n[0],o=n[1],e=n[2],u=n[3],s=n[4],c=n[5],i=n[6],h=n[7],M=n[8],f=n[9],l=n[10],b=n[11],m=n[12],d=n[13],g=n[14],p=n[15];let _=a[0],q=a[1],x=a[2],v=a[3];return t[0]=_*r+q*s+x*M+v*m,t[1]=_*o+q*c+x*f+v*d,t[2]=_*e+q*i+x*l+v*g,t[3]=_*u+q*h+x*b+v*p,_=a[4],q=a[5],x=a[6],v=a[7],t[4]=_*r+q*s+x*M+v*m,t[5]=_*o+q*c+x*f+v*d,t[6]=_*e+q*i+x*l+v*g,t[7]=_*u+q*h+x*b+v*p,_=a[8],q=a[9],x=a[10],v=a[11],t[8]=_*r+q*s+x*M+v*m,t[9]=_*o+q*c+x*f+v*d,t[10]=_*e+q*i+x*l+v*g,t[11]=_*u+q*h+x*b+v*p,_=a[12],q=a[13],x=a[14],v=a[15],t[12]=_*r+q*s+x*M+v*m,t[13]=_*o+q*c+x*f+v*d,t[14]=_*e+q*i+x*l+v*g,t[15]=_*u+q*h+x*b+v*p,t}function M(t,n,a){const r=a[0],o=a[1],e=a[2];if(n===t)t[12]=n[0]*r+n[4]*o+n[8]*e+n[12],t[13]=n[1]*r+n[5]*o+n[9]*e+n[13],t[14]=n[2]*r+n[6]*o+n[10]*e+n[14],t[15]=n[3]*r+n[7]*o+n[11]*e+n[15];else{const a=n[0],u=n[1],s=n[2],c=n[3],i=n[4],h=n[5],M=n[6],f=n[7],l=n[8],b=n[9],m=n[10],d=n[11];t[0]=a,t[1]=u,t[2]=s,t[3]=c,t[4]=i,t[5]=h,t[6]=M,t[7]=f,t[8]=l,t[9]=b,t[10]=m,t[11]=d,t[12]=a*r+i*o+l*e+n[12],t[13]=u*r+h*o+b*e+n[13],t[14]=s*r+M*o+m*e+n[14],t[15]=c*r+f*o+d*e+n[15]}return t}function f(t,n,a){const r=a[0],o=a[1],e=a[2];return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*o,t[5]=n[5]*o,t[6]=n[6]*o,t[7]=n[7]*o,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function l(t,n,a,r){let u=r[0],s=r[1],c=r[2],i=Math.sqrt(u*u+s*s+c*c);if(i<=(0,o.FD)())return void e(t,n);i=1/i,u*=i,s*=i,c*=i;const h=Math.sin(a),M=Math.cos(a),f=1-M,l=n[0],b=n[1],m=n[2],d=n[3],g=n[4],p=n[5],_=n[6],q=n[7],x=n[8],v=n[9],y=n[10],O=n[11],S=u*u*f+M,T=s*u*f+c*h,D=c*u*f-s*h,I=u*s*f-c*h,R=s*s*f+M,N=c*s*f+u*h,j=u*c*f+s*h,P=s*c*f-u*h,z=c*c*f+M;t[0]=l*S+g*T+x*D,t[1]=b*S+p*T+v*D,t[2]=m*S+_*T+y*D,t[3]=d*S+q*T+O*D,t[4]=l*I+g*R+x*N,t[5]=b*I+p*R+v*N,t[6]=m*I+_*R+y*N,t[7]=d*I+q*R+O*N,t[8]=l*j+g*P+x*z,t[9]=b*j+p*P+v*z,t[10]=m*j+_*P+y*z,t[11]=d*j+q*P+O*z,n!==t&&(t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15])}function b(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function m(t,n,a){if(0===n)return s(t);let r=a[0],e=a[1],u=a[2],c=Math.sqrt(r*r+e*e+u*u);if(c<=(0,o.FD)())return null;c=1/c,r*=c,e*=c,u*=c;const i=Math.sin(n),h=Math.cos(n),M=1-h;return t[0]=r*r*M+h,t[1]=e*r*M+u*i,t[2]=u*r*M-e*i,t[3]=0,t[4]=r*e*M-u*i,t[5]=e*e*M+h,t[6]=u*e*M+r*i,t[7]=0,t[8]=r*u*M+e*i,t[9]=e*u*M-r*i,t[10]=u*u*M+h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function d(t,n){const a=Math.sin(n),r=Math.cos(n);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=a,t[7]=0,t[8]=0,t[9]=-a,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g(t,n,a){const r=n[0],o=n[1],e=n[2],u=n[3],s=r+r,c=o+o,i=e+e,h=r*s,M=r*c,f=r*i,l=o*c,b=o*i,m=e*i,d=u*s,g=u*c,p=u*i;return t[0]=1-(l+m),t[1]=M+p,t[2]=f-g,t[3]=0,t[4]=M-p,t[5]=1-(h+m),t[6]=b+d,t[7]=0,t[8]=f+g,t[9]=b-d,t[10]=1-(h+l),t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t}const p=(0,r.vt)();function _(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function q(t,n){const a=n[0],r=n[1],o=n[2],e=n[4],u=n[5],s=n[6],c=n[8],i=n[9],h=n[10];return t[0]=Math.sqrt(a*a+r*r+o*o),t[1]=Math.sqrt(e*e+u*u+s*s),t[2]=Math.sqrt(c*c+i*i+h*h),t}function x(t,n){const a=n[0]+n[5]+n[10];let r=0;return a>0?(r=2*Math.sqrt(a+1),t[3]=.25*r,t[0]=(n[6]-n[9])/r,t[1]=(n[8]-n[2])/r,t[2]=(n[1]-n[4])/r):n[0]>n[5]&&n[0]>n[10]?(r=2*Math.sqrt(1+n[0]-n[5]-n[10]),t[3]=(n[6]-n[9])/r,t[0]=.25*r,t[1]=(n[1]+n[4])/r,t[2]=(n[8]+n[2])/r):n[5]>n[10]?(r=2*Math.sqrt(1+n[5]-n[0]-n[10]),t[3]=(n[8]-n[2])/r,t[0]=(n[1]+n[4])/r,t[1]=.25*r,t[2]=(n[6]+n[9])/r):(r=2*Math.sqrt(1+n[10]-n[0]-n[5]),t[3]=(n[1]-n[4])/r,t[0]=(n[8]+n[2])/r,t[1]=(n[6]+n[9])/r,t[2]=.25*r),t}function v(t,n,a,r){const o=n[0],e=n[1],u=n[2],s=n[3],c=o+o,i=e+e,h=u+u,M=o*c,f=o*i,l=o*h,b=e*i,m=e*h,d=u*h,g=s*c,p=s*i,_=s*h,q=r[0],x=r[1],v=r[2];return t[0]=(1-(b+d))*q,t[1]=(f+_)*q,t[2]=(l-p)*q,t[3]=0,t[4]=(f-_)*x,t[5]=(1-(M+d))*x,t[6]=(m+g)*x,t[7]=0,t[8]=(l+p)*v,t[9]=(m-g)*v,t[10]=(1-(M+b))*v,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t}function y(t,n,a,r,o){const e=n[0],u=n[1],s=n[2],c=n[3],i=e+e,h=u+u,M=s+s,f=e*i,l=e*h,b=e*M,m=u*h,d=u*M,g=s*M,p=c*i,_=c*h,q=c*M,x=r[0],v=r[1],y=r[2],O=o[0],S=o[1],T=o[2],D=(1-(m+g))*x,I=(l+q)*x,R=(b-_)*x,N=(l-q)*v,j=(1-(f+g))*v,P=(d+p)*v,z=(b+_)*y,A=(d-p)*y,C=(1-(f+m))*y;return t[0]=D,t[1]=I,t[2]=R,t[3]=0,t[4]=N,t[5]=j,t[6]=P,t[7]=0,t[8]=z,t[9]=A,t[10]=C,t[11]=0,t[12]=a[0]+O-(D*O+N*S+z*T),t[13]=a[1]+S-(I*O+j*S+A*T),t[14]=a[2]+T-(R*O+P*S+C*T),t[15]=1,t}function O(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t[6]=n[6]-a[6],t[7]=n[7]-a[7],t[8]=n[8]-a[8],t[9]=n[9]-a[9],t[10]=n[10]-a[10],t[11]=n[11]-a[11],t[12]=n[12]-a[12],t[13]=n[13]-a[13],t[14]=n[14]-a[14],t[15]=n[15]-a[15],t}function S(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]}function T(t){const n=(0,o.FD)(),a=t[0],r=t[1],e=t[2],u=t[4],s=t[5],c=t[6],i=t[8],h=t[9],M=t[10];return Math.abs(1-(a*a+u*u+i*i))<=n&&Math.abs(1-(r*r+s*s+h*h))<=n&&Math.abs(1-(e*e+c*c+M*M))<=n}function D(t){return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[8]&&0===t[9]&&1===t[10]}const I=h,R=O;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t[6]=n[6]+a[6],t[7]=n[7]+a[7],t[8]=n[8]+a[8],t[9]=n[9]+a[9],t[10]=n[10]+a[10],t[11]=n[11]+a[11],t[12]=n[12]+a[12],t[13]=n[13]+a[13],t[14]=n[14]+a[14],t[15]=n[15]+a[15],t},adjoint:function(t,n){const a=n[0],r=n[1],o=n[2],e=n[3],u=n[4],s=n[5],c=n[6],i=n[7],h=n[8],M=n[9],f=n[10],l=n[11],b=n[12],m=n[13],d=n[14],g=n[15];return t[0]=s*(f*g-l*d)-M*(c*g-i*d)+m*(c*l-i*f),t[1]=-(r*(f*g-l*d)-M*(o*g-e*d)+m*(o*l-e*f)),t[2]=r*(c*g-i*d)-s*(o*g-e*d)+m*(o*i-e*c),t[3]=-(r*(c*l-i*f)-s*(o*l-e*f)+M*(o*i-e*c)),t[4]=-(u*(f*g-l*d)-h*(c*g-i*d)+b*(c*l-i*f)),t[5]=a*(f*g-l*d)-h*(o*g-e*d)+b*(o*l-e*f),t[6]=-(a*(c*g-i*d)-u*(o*g-e*d)+b*(o*i-e*c)),t[7]=a*(c*l-i*f)-u*(o*l-e*f)+h*(o*i-e*c),t[8]=u*(M*g-l*m)-h*(s*g-i*m)+b*(s*l-i*M),t[9]=-(a*(M*g-l*m)-h*(r*g-e*m)+b*(r*l-e*M)),t[10]=a*(s*g-i*m)-u*(r*g-e*m)+b*(r*i-e*s),t[11]=-(a*(s*l-i*M)-u*(r*l-e*M)+h*(r*i-e*s)),t[12]=-(u*(M*d-f*m)-h*(s*d-c*m)+b*(s*f-c*M)),t[13]=a*(M*d-f*m)-h*(r*d-o*m)+b*(r*f-o*M),t[14]=-(a*(s*d-c*m)-u*(r*d-o*m)+b*(r*c-o*s)),t[15]=a*(s*f-c*M)-u*(r*f-o*M)+h*(r*c-o*s),t},copy:e,determinant:function(t){const n=t[0],a=t[1],r=t[2],o=t[3],e=t[4],u=t[5],s=t[6],c=t[7],i=t[8],h=t[9],M=t[10],f=t[11],l=t[12],b=t[13],m=t[14],d=t[15];return(n*u-a*e)*(M*d-f*m)-(n*s-r*e)*(h*d-f*b)+(n*c-o*e)*(h*m-M*b)+(a*s-r*u)*(i*d-f*l)-(a*c-o*u)*(i*m-M*l)+(r*c-o*s)*(i*b-h*l)},equals:function(t,n){if(t===n)return!0;const a=t[0],r=t[1],e=t[2],u=t[3],s=t[4],c=t[5],i=t[6],h=t[7],M=t[8],f=t[9],l=t[10],b=t[11],m=t[12],d=t[13],g=t[14],p=t[15],_=n[0],q=n[1],x=n[2],v=n[3],y=n[4],O=n[5],S=n[6],T=n[7],D=n[8],I=n[9],R=n[10],N=n[11],j=n[12],P=n[13],z=n[14],A=n[15],C=(0,o.FD)();return Math.abs(a-_)<=C*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(r-q)<=C*Math.max(1,Math.abs(r),Math.abs(q))&&Math.abs(e-x)<=C*Math.max(1,Math.abs(e),Math.abs(x))&&Math.abs(u-v)<=C*Math.max(1,Math.abs(u),Math.abs(v))&&Math.abs(s-y)<=C*Math.max(1,Math.abs(s),Math.abs(y))&&Math.abs(c-O)<=C*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(i-S)<=C*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(h-T)<=C*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(M-D)<=C*Math.max(1,Math.abs(M),Math.abs(D))&&Math.abs(f-I)<=C*Math.max(1,Math.abs(f),Math.abs(I))&&Math.abs(l-R)<=C*Math.max(1,Math.abs(l),Math.abs(R))&&Math.abs(b-N)<=C*Math.max(1,Math.abs(b),Math.abs(N))&&Math.abs(m-j)<=C*Math.max(1,Math.abs(m),Math.abs(j))&&Math.abs(d-P)<=C*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(g-z)<=C*Math.max(1,Math.abs(g),Math.abs(z))&&Math.abs(p-A)<=C*Math.max(1,Math.abs(p),Math.abs(A))},exactEquals:S,frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2+t[9]**2+t[10]**2+t[11]**2+t[12]**2+t[13]**2+t[14]**2+t[15]**2)},fromQuat:function(t,n){const a=n[0],r=n[1],o=n[2],e=n[3],u=a+a,s=r+r,c=o+o,i=a*u,h=r*u,M=r*s,f=o*u,l=o*s,b=o*c,m=e*u,d=e*s,g=e*c;return t[0]=1-M-b,t[1]=h+g,t[2]=f-d,t[3]=0,t[4]=h-g,t[5]=1-i-b,t[6]=l+m,t[7]=0,t[8]=f+d,t[9]=l-m,t[10]=1-i-M,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromQuat2:function(t,n){const a=p,r=-n[0],o=-n[1],e=-n[2],u=n[3],s=n[4],c=n[5],i=n[6],h=n[7],M=r*r+o*o+e*e+u*u;return M>0?(a[0]=2*(s*u+h*r+c*e-i*o)/M,a[1]=2*(c*u+h*o+i*r-s*e)/M,a[2]=2*(i*u+h*e+s*o-c*r)/M):(a[0]=2*(s*u+h*r+c*e-i*o),a[1]=2*(c*u+h*o+i*r-s*e),a[2]=2*(i*u+h*e+s*o-c*r)),g(t,n,a),t},fromRotation:m,fromRotationTranslation:g,fromRotationTranslationScale:v,fromRotationTranslationScaleOrigin:y,fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=n[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromTranslation:b,fromXRotation:d,fromYRotation:function(t,n){const a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=a,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,n){const a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=0,t[3]=0,t[4]=-a,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},frustum:function(t,n,a,r,o,e,u){const s=1/(a-n),c=1/(o-r),i=1/(e-u);return t[0]=2*e*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*e*c,t[6]=0,t[7]=0,t[8]=(a+n)*s,t[9]=(o+r)*c,t[10]=(u+e)*i,t[11]=-1,t[12]=0,t[13]=0,t[14]=u*e*2*i,t[15]=0,t},getRotation:x,getScale:q,getTranslation:_,hasIdentityRotation:D,identity:s,invert:i,invertOrIdentity:function(t,n){return i(t,n)||s(t),t},isOrthoNormal:T,lookAt:function(t,n,a,r){const e=n[0],u=n[1],c=n[2];let i=e-a[0],h=u-a[1],M=c-a[2];const f=(0,o.FD)();if(Math.abs(i)<f&&Math.abs(h)<f&&Math.abs(M)<f)return void s(t);let l=1/Math.sqrt(i*i+h*h+M*M);i*=l,h*=l,M*=l;const b=r[0],m=r[1],d=r[2];let g=m*M-d*h,p=d*i-b*M,_=b*h-m*i;l=Math.sqrt(g*g+p*p+_*_),l?(l=1/l,g*=l,p*=l,_*=l):(g=0,p=0,_=0);let q=h*_-M*p,x=M*g-i*_,v=i*p-h*g;l=Math.sqrt(q*q+x*x+v*v),l?(l=1/l,q*=l,x*=l,v*=l):(q=0,x=0,v=0),t[0]=g,t[1]=q,t[2]=i,t[3]=0,t[4]=p,t[5]=x,t[6]=h,t[7]=0,t[8]=_,t[9]=v,t[10]=M,t[11]=0,t[12]=-(g*e+p*u+_*c),t[13]=-(q*e+x*u+v*c),t[14]=-(i*e+h*u+M*c),t[15]=1},mul:I,multiply:h,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=n[11]*a,t[12]=n[12]*a,t[13]=n[13]*a,t[14]=n[14]*a,t[15]=n[15]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t[6]=n[6]+a[6]*r,t[7]=n[7]+a[7]*r,t[8]=n[8]+a[8]*r,t[9]=n[9]+a[9]*r,t[10]=n[10]+a[10]*r,t[11]=n[11]+a[11]*r,t[12]=n[12]+a[12]*r,t[13]=n[13]+a[13]*r,t[14]=n[14]+a[14]*r,t[15]=n[15]+a[15]*r,t},ortho:function(t,n,a,r,o,e,u){const s=1/(n-a),c=1/(r-o),i=1/(e-u);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*i,t[11]=0,t[12]=(n+a)*s,t[13]=(o+r)*c,t[14]=(u+e)*i,t[15]=1,t},perspective:function(t,n,a,r,o){const e=1/Math.tan(n/2);let u;return t[0]=e/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=o&&o!==1/0?(u=1/(r-o),t[10]=(o+r)*u,t[14]=2*o*r*u):(t[10]=-1,t[14]=-2*r),t},perspectiveFromFieldOfView:function(t,n,a,r){const o=Math.tan(n.upDegrees*Math.PI/180),e=Math.tan(n.downDegrees*Math.PI/180),u=Math.tan(n.leftDegrees*Math.PI/180),s=Math.tan(n.rightDegrees*Math.PI/180),c=2/(u+s),i=2/(o+e);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=i,t[6]=0,t[7]=0,t[8]=-(u-s)*c*.5,t[9]=(o-e)*i*.5,t[10]=r/(a-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*a/(a-r),t[15]=0,t},rotate:l,rotateX:function(t,n,a){const r=Math.sin(a),o=Math.cos(a),e=n[4],u=n[5],s=n[6],c=n[7],i=n[8],h=n[9],M=n[10],f=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=e*o+i*r,t[5]=u*o+h*r,t[6]=s*o+M*r,t[7]=c*o+f*r,t[8]=i*o-e*r,t[9]=h*o-u*r,t[10]=M*o-s*r,t[11]=f*o-c*r,t},rotateY:function(t,n,a){const r=Math.sin(a),o=Math.cos(a),e=n[0],u=n[1],s=n[2],c=n[3],i=n[8],h=n[9],M=n[10],f=n[11];return n!==t&&(t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=e*o-i*r,t[1]=u*o-h*r,t[2]=s*o-M*r,t[3]=c*o-f*r,t[8]=e*r+i*o,t[9]=u*r+h*o,t[10]=s*r+M*o,t[11]=c*r+f*o,t},rotateZ:function(t,n,a){const r=Math.sin(a),o=Math.cos(a),e=n[0],u=n[1],s=n[2],c=n[3],i=n[4],h=n[5],M=n[6],f=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=e*o+i*r,t[1]=u*o+h*r,t[2]=s*o+M*r,t[3]=c*o+f*r,t[4]=i*o-e*r,t[5]=h*o-u*r,t[6]=M*o-s*r,t[7]=f*o-c*r,t},scale:f,set:u,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:R,subtract:O,targetTo:function(t,n,a,r){const o=n[0],e=n[1],u=n[2],s=r[0],c=r[1],i=r[2];let h=o-a[0],M=e-a[1],f=u-a[2],l=h*h+M*M+f*f;l>0&&(l=1/Math.sqrt(l),h*=l,M*=l,f*=l);let b=c*f-i*M,m=i*h-s*f,d=s*M-c*h;return l=b*b+m*m+d*d,l>0&&(l=1/Math.sqrt(l),b*=l,m*=l,d*=l),t[0]=b,t[1]=m,t[2]=d,t[3]=0,t[4]=M*d-f*m,t[5]=f*b-h*d,t[6]=h*m-M*b,t[7]=0,t[8]=h,t[9]=M,t[10]=f,t[11]=0,t[12]=o,t[13]=e,t[14]=u,t[15]=1,t},translate:M,transpose:c},Symbol.toStringTag,{value:"Module"}))},87317:(t,n,a)=>{a.d(n,{a:()=>_,b:()=>h,c:()=>o,e:()=>q,f:()=>b,g:()=>u,h:()=>d,j:()=>l,l:()=>g,n:()=>m,s:()=>e,t:()=>p});var r=a(34304);function o(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t}function e(t,n,a,r,o){return t[0]=n,t[1]=a,t[2]=r,t[3]=o,t}function u(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t}function s(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}function c(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t[3]=n[3]*a[3],t}function i(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[2],t[3]=n[3]/a[3],t}function h(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t}function M(t,n){const a=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],e=n[3]-t[3];return Math.sqrt(a*a+r*r+o*o+e*e)}function f(t,n){const a=n[0]-t[0],r=n[1]-t[1],o=n[2]-t[2],e=n[3]-t[3];return a*a+r*r+o*o+e*e}function l(t){const n=t[0],a=t[1],r=t[2],o=t[3];return Math.sqrt(n*n+a*a+r*r+o*o)}function b(t){const n=t[0],a=t[1],r=t[2],o=t[3];return n*n+a*a+r*r+o*o}function m(t,n){const a=n[0],r=n[1],o=n[2],e=n[3];let u=a*a+r*r+o*o+e*e;return u>0&&(u=1/Math.sqrt(u),t[0]=a*u,t[1]=r*u,t[2]=o*u,t[3]=e*u),t}function d(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function g(t,n,a,r){const o=n[0],e=n[1],u=n[2],s=n[3];return t[0]=o+r*(a[0]-o),t[1]=e+r*(a[1]-e),t[2]=u+r*(a[2]-u),t[3]=s+r*(a[3]-s),t}function p(t,n,a){const r=n[0],o=n[1],e=n[2],u=n[3];return t[0]=a[0]*r+a[4]*o+a[8]*e+a[12]*u,t[1]=a[1]*r+a[5]*o+a[9]*e+a[13]*u,t[2]=a[2]*r+a[6]*o+a[10]*e+a[14]*u,t[3]=a[3]*r+a[7]*o+a[11]*e+a[15]*u,t}function _(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function q(t,n){const a=t[0],o=t[1],e=t[2],u=t[3],s=n[0],c=n[1],i=n[2],h=n[3],M=(0,r.FD)();return Math.abs(a-s)<=M*Math.max(1,Math.abs(a),Math.abs(s))&&Math.abs(o-c)<=M*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(e-i)<=M*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(u-h)<=M*Math.max(1,Math.abs(u),Math.abs(h))}const x=s,v=c,y=i,O=M,S=f,T=l,D=b;Object.freeze(Object.defineProperty({__proto__:null,add:u,ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3]=Math.ceil(n[3]),t},copy:o,copyVec3:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t},dist:O,distance:M,div:y,divide:i,dot:d,equals:q,exactEquals:_,floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t},inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t},len:T,length:l,lerp:g,max:function(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t[3]=Math.max(n[3],a[3]),t},min:function(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t[3]=Math.min(n[3],a[3]),t},mul:v,multiply:c,negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t},normalize:m,random:function(t,n=1){const a=r.Ov;let o,e,u,s,c,i;do{o=2*a()-1,e=2*a()-1,c=o*o+e*e}while(c>=1);do{u=2*a()-1,s=2*a()-1,i=u*u+s*s}while(i>=1);const h=Math.sqrt((1-c)/i);return t[0]=n*o,t[1]=n*e,t[2]=n*u*h,t[3]=n*s*h,t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t[3]=Math.round(n[3]),t},scale:h,scaleAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t},set:e,sqrDist:S,sqrLen:D,squaredDistance:f,squaredLength:b,str:function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},sub:x,subtract:s,transformMat4:p,transformQuat:function(t,n,a){const r=n[0],o=n[1],e=n[2],u=a[0],s=a[1],c=a[2],i=a[3],h=i*r+s*e-c*o,M=i*o+c*r-u*e,f=i*e+u*o-s*r,l=-u*r-s*o-c*e;return t[0]=h*i+l*-u+M*-c-f*-s,t[1]=M*i+l*-s+f*-u-h*-c,t[2]=f*i+l*-c+h*-s-M*-u,t[3]=n[3],t}},Symbol.toStringTag,{value:"Module"}))},91829:(t,n,a)=>{function r(){return[0,0,0,0]}function o(t){return[t[0],t[1],t[2],t[3]]}function e(t,n,a,r){return[t,n,a,r]}function u(t,n,a,r){return[t,n,a,r]}function s(t,n=[0,0,0,0]){const a=Math.min(4,t.length);for(let r=0;r<a;++r)n[r]=t[r];return n}function c(){return e(1,1,1,1)}function i(){return e(1,0,0,0)}function h(){return e(0,1,0,0)}function M(){return e(0,0,1,0)}function f(){return e(0,0,0,1)}a.d(n,{CN:()=>u,Un:()=>b,ci:()=>s,fA:()=>e,o8:()=>o,uY:()=>l,vt:()=>r});const l=[0,0,0,0],b=c(),m=i(),d=h(),g=M(),p=f();Object.freeze(Object.defineProperty({__proto__:null,ONES:b,UNIT_W:p,UNIT_X:m,UNIT_Y:d,UNIT_Z:g,ZEROS:l,clone:o,create:r,freeze:u,fromArray:s,fromValues:e,ones:c,unitW:f,unitX:i,unitY:h,unitZ:M,zeros:function(){return[0,0,0,0]}},Symbol.toStringTag,{value:"Module"}))}}]);
|