@arcgis/core 4.34.0-next.110 → 4.34.0-next.112

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.
Files changed (264) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  3. package/arcade/functions/knowledgegraph.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/07fd94b1d5f39356565b.js +1 -0
  6. package/assets/esri/core/workers/chunks/{49c1e69793d49a0fe1fd.js → 16d66770ef841564ee3f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/17103e6542aae53c7301.js +1 -0
  8. package/assets/esri/core/workers/chunks/188272af9a6470ccfe31.js +1 -0
  9. package/assets/esri/core/workers/chunks/1d807057327ba90ab770.js +1 -0
  10. package/assets/esri/core/workers/chunks/{509392131ec473d6b988.js → 1dfca37f95f2b968aa54.js} +1 -1
  11. package/assets/esri/core/workers/chunks/2248c3040e2f9a8b5cbc.js +1 -0
  12. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +1 -0
  13. package/assets/esri/core/workers/chunks/297b11752f9c251cd7be.js +1 -0
  14. package/assets/esri/core/workers/chunks/2bbe8277578b033f92d4.js +1 -0
  15. package/assets/esri/core/workers/chunks/2ca8b0c1ca399fd5dc2f.js +1 -0
  16. package/assets/esri/core/workers/chunks/2f9e79a67eae746d55d3.js +1 -0
  17. package/assets/esri/core/workers/chunks/{91edfa6f93ffba500853.js → 3116b35a92cc0afd9fd3.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3495162f4608f5205d87.js +1 -0
  19. package/assets/esri/core/workers/chunks/36fe6b8228e622407ec2.js +1 -0
  20. package/assets/esri/core/workers/chunks/374831c7e3d88bc473b8.js +1 -0
  21. package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
  22. package/assets/esri/core/workers/chunks/3ffdf73aaecc42448f8a.js +1 -0
  23. package/assets/esri/core/workers/chunks/4239572007ecfac49dc1.js +1 -0
  24. package/assets/esri/core/workers/chunks/441ead5bce80f639934e.js +1 -0
  25. package/assets/esri/core/workers/chunks/4470a3fff217f2bfeec5.js +1 -0
  26. package/assets/esri/core/workers/chunks/44c3b5a507814103f4b4.js +1 -0
  27. package/assets/esri/core/workers/chunks/44e40484acb577039c82.js +1 -0
  28. package/assets/esri/core/workers/chunks/4a73622445536b8c55f1.js +1 -0
  29. package/assets/esri/core/workers/chunks/524293f92791c55f6e2c.js +1 -0
  30. package/assets/esri/core/workers/chunks/5e60542f80bdacb6e7af.js +1 -0
  31. package/assets/esri/core/workers/chunks/616e3d1947eda575a25a.js +1 -0
  32. package/assets/esri/core/workers/chunks/620a94b54be3ed78350d.js +1 -0
  33. package/assets/esri/core/workers/chunks/{fe690be68faf6985d4b5.js → 740e6d2831dcb01ee96a.js} +1 -1
  34. package/assets/esri/core/workers/chunks/75535e2e487ed2616acf.js +1 -0
  35. package/assets/esri/core/workers/chunks/7698f4f4471b6e1c12ef.js +1 -0
  36. package/assets/esri/core/workers/chunks/7786fc1b3779df832e0a.js +1 -0
  37. package/assets/esri/core/workers/chunks/7810f870d71f80ca4f41.js +1 -0
  38. package/assets/esri/core/workers/chunks/78b35a19332e58c8c279.js +1 -0
  39. package/assets/esri/core/workers/chunks/7a9a0fcf78a1863c5dea.js +1 -0
  40. package/assets/esri/core/workers/chunks/80c492f8fdab7698596a.js +1 -0
  41. package/assets/esri/core/workers/chunks/80d2182dac1a49cfd923.js +1 -0
  42. package/assets/esri/core/workers/chunks/81501abaabf10e9bef1b.js +1 -0
  43. package/assets/esri/core/workers/chunks/82f1cd3896401c85df35.js +1 -0
  44. package/assets/esri/core/workers/chunks/868ee8f429e7caddc045.js +1 -0
  45. package/assets/esri/core/workers/chunks/{11e96a312f1294d34c50.js → 881df4fd1dc594576457.js} +1 -1
  46. package/assets/esri/core/workers/chunks/8cf2669900bb45cb094a.js +1 -0
  47. package/assets/esri/core/workers/chunks/8ec6ad6d76b4755a4cf6.js +1 -0
  48. package/assets/esri/core/workers/chunks/92c306d02569e7cd9af3.js +1 -0
  49. package/assets/esri/core/workers/chunks/98dbafa4d45fdf790fff.js +1 -0
  50. package/assets/esri/core/workers/chunks/9c571ff94911f7c4459a.js +1 -0
  51. package/assets/esri/core/workers/chunks/9dc6eeaac94aff385cf9.js +1 -0
  52. package/assets/esri/core/workers/chunks/9e4f37367d61a2e13053.js +1 -0
  53. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  54. package/assets/esri/core/workers/chunks/a16526adc0dbffdc1ffc.js +1 -0
  55. package/assets/esri/core/workers/chunks/a1c4509a3865139eb570.js +1 -0
  56. package/assets/esri/core/workers/chunks/a33a0b6700a860153a67.js +1 -0
  57. package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +1 -0
  58. package/assets/esri/core/workers/chunks/aea8553a2aa54cfd694b.js +1 -0
  59. package/assets/esri/core/workers/chunks/af0f82f7efa6e983eca5.js +1 -0
  60. package/assets/esri/core/workers/chunks/bd02e9d6c7ba491dd35f.js +1 -0
  61. package/assets/esri/core/workers/chunks/{6d97aa70848cd9bad680.js → bf9b2949894cc2a1e6b3.js} +1 -1
  62. package/assets/esri/core/workers/chunks/bfc1e8aec7aace3ff30e.js +1 -0
  63. package/assets/esri/core/workers/chunks/c55c096669677321a227.js +1 -0
  64. package/assets/esri/core/workers/chunks/cd3b843ffd4010038c74.js +1 -0
  65. package/assets/esri/core/workers/chunks/d0767001601412f17ada.js +1 -0
  66. package/assets/esri/core/workers/chunks/d5fa879de92da4441771.js +1 -0
  67. package/assets/esri/core/workers/chunks/dec0ed841f9ff1ceff43.js +1 -0
  68. package/assets/esri/core/workers/chunks/e7b96da2a615086d91a7.js +1 -0
  69. package/assets/esri/core/workers/chunks/e7c9d9e1205a8e246bfa.js +1 -0
  70. package/assets/esri/core/workers/chunks/f06d185e7defc4272ae7.js +1 -0
  71. package/assets/esri/core/workers/chunks/f2f3ce7a0f3e394d27c4.js +1 -0
  72. package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
  73. package/assets/esri/core/workers/chunks/{498331263094c442d11f.js → fd410a56286f9b8a5903.js} +15 -15
  74. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  75. package/assets/esri/themes/base/widgets/_Editor.scss +35 -2
  76. package/assets/esri/themes/base/widgets/_FeatureTable.scss +2 -0
  77. package/assets/esri/themes/dark/main.css +1 -1
  78. package/assets/esri/themes/light/main.css +1 -1
  79. package/assets/esri/themes/light/view.css +1 -1
  80. package/chunks/Envelope.js +1 -1
  81. package/chunks/Geometry.js +1 -1
  82. package/chunks/MultiPathImpl.js +1 -1
  83. package/chunks/Point2D.js +1 -1
  84. package/chunks/UnitFactory.js +1 -1
  85. package/chunks/containsOperator.js +1 -1
  86. package/chunks/densifyOperator.js +1 -1
  87. package/chunks/differenceOperator.js +1 -1
  88. package/chunks/intersectsOperator.js +1 -1
  89. package/chunks/persistableUrlUtils.js +1 -1
  90. package/config.js +1 -1
  91. package/core/SetUtils.js +1 -1
  92. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  93. package/core/unitUtils.js +1 -1
  94. package/editing/fieldUtils.js +5 -0
  95. package/geometry/Extent.js +1 -1
  96. package/geometry/Geometry.js +1 -1
  97. package/geometry/Point.js +1 -1
  98. package/geometry/SpatialReference.js +1 -1
  99. package/geometry/ellipsoidUtils.js +1 -1
  100. package/geometry/operators/support/jsonConverter.js +1 -1
  101. package/geometry/support/MeshTransform.js +1 -1
  102. package/geometry/support/axisAngleDegrees.js +1 -1
  103. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  104. package/geometry/support/meshUtils/rotate.js +1 -1
  105. package/geometry/support/meshUtils/scale.js +1 -1
  106. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  107. package/geometry/support/plane.js +1 -1
  108. package/geometry/support/polygonUtils.js +1 -1
  109. package/interfaces.d.ts +100 -9
  110. package/kernel.js +1 -1
  111. package/layers/Layer.js +1 -1
  112. package/layers/MapNotesLayer.js +1 -1
  113. package/layers/graphics/data/QueryEngine.js +1 -1
  114. package/layers/save/groupLayerUtils.js +1 -1
  115. package/layers/support/DateTimeFieldFormat.js +1 -1
  116. package/layers/support/FieldFormat.js +1 -1
  117. package/layers/support/NumberFieldFormat.js +1 -1
  118. package/layers/support/arcgisLayerUrl.js +1 -1
  119. package/layers/support/fieldFormatUtils.js +1 -1
  120. package/layers/support/fieldUtils.js +1 -1
  121. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  122. package/package.json +1 -1
  123. package/popup/ExpressionInfo.js +1 -1
  124. package/popup/FieldInfo.js +1 -1
  125. package/popup/content/AttachmentsContent.js +1 -1
  126. package/popup/content/BarChartMediaInfo.js +1 -1
  127. package/popup/content/ColumnChartMediaInfo.js +1 -1
  128. package/popup/content/Content.js +1 -1
  129. package/popup/content/CustomContent.js +1 -1
  130. package/popup/content/ExpressionContent.js +1 -1
  131. package/popup/content/FieldsContent.js +1 -1
  132. package/popup/content/ImageMediaInfo.js +1 -1
  133. package/popup/content/LineChartMediaInfo.js +1 -1
  134. package/popup/content/MediaContent.js +1 -1
  135. package/popup/content/PieChartMediaInfo.js +1 -1
  136. package/popup/content/RelationshipContent.js +1 -1
  137. package/popup/content/TextContent.js +1 -1
  138. package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
  139. package/popup/content/mixins/ChartMediaInfo.js +1 -1
  140. package/popup/content/mixins/MediaInfo.js +1 -1
  141. package/popup/content.js +1 -1
  142. package/popup/support/FieldInfoFormat.js +1 -1
  143. package/rest/geometryService/utils.js +1 -1
  144. package/rest/knowledgeGraphService.d.ts +1 -0
  145. package/support/popupUtils.js +1 -1
  146. package/support/revision.js +1 -1
  147. package/symbols/support/symbolUtils.js +1 -1
  148. package/time/TimeExtent.js +1 -1
  149. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  150. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  151. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  152. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  153. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  154. package/views/3d/environment/CloudsRenderer.js +1 -1
  155. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  156. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  157. package/views/3d/layers/FlowSubView3D.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  159. package/views/3d/support/flow/geometryUtils.js +1 -1
  160. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  161. package/views/3d/terrain/TerrainSurface.js +1 -1
  162. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  163. package/views/draw/DrawOperation.js +1 -1
  164. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  165. package/webdoc/support/webdocSaveUtils.js +1 -1
  166. package/widgets/BasemapLayerList.js +1 -1
  167. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  168. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  169. package/widgets/Editor/EditorViewModel.js +1 -1
  170. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  171. package/widgets/Editor/MergeFeaturesWorkflowData.js +1 -1
  172. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  173. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  174. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  175. package/widgets/Editor/UpdateWorkflow.js +1 -1
  176. package/widgets/Editor/Workflow.js +1 -1
  177. package/widgets/Editor/components/FeatureList.js +1 -1
  178. package/widgets/Editor/components/MergeFeaturesList.js +5 -0
  179. package/widgets/Editor/components/Notices.js +1 -1
  180. package/widgets/Editor/components/PanelContent.js +1 -1
  181. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  182. package/widgets/Editor/css.js +1 -1
  183. package/widgets/Editor/support/EditorItem.js +1 -1
  184. package/widgets/Editor/support/SketchController.js +1 -1
  185. package/widgets/Editor/support/errors.js +1 -1
  186. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  187. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  188. package/widgets/Editor/workflowUtils.js +1 -1
  189. package/widgets/Editor.js +1 -1
  190. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  191. package/widgets/FeatureForm/FieldInput.js +1 -1
  192. package/widgets/FeatureForm.js +1 -1
  193. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  194. package/widgets/FeatureTable/FieldColumn.js +1 -1
  195. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  196. package/widgets/LayerList.js +1 -1
  197. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  198. package/widgets/Legend/support/utils.js +1 -1
  199. package/widgets/PanoramicVideoViewer.js +1 -1
  200. package/widgets/support/FilterCondition.js +1 -1
  201. package/assets/esri/core/workers/chunks/09cdb05dc054fe3523f9.js +0 -1
  202. package/assets/esri/core/workers/chunks/0d34a4bb52ce17c4275c.js +0 -1
  203. package/assets/esri/core/workers/chunks/0f934d73ebb90a4a4481.js +0 -1
  204. package/assets/esri/core/workers/chunks/1c3a1dff1c3719e37a0d.js +0 -1
  205. package/assets/esri/core/workers/chunks/2059c930ed8a9a7c93ff.js +0 -1
  206. package/assets/esri/core/workers/chunks/20ecaa7a007ee398eea7.js +0 -1
  207. package/assets/esri/core/workers/chunks/25d8e37561d0c8601e52.js +0 -1
  208. package/assets/esri/core/workers/chunks/25f64be34a92472c9a78.js +0 -1
  209. package/assets/esri/core/workers/chunks/266f84f11befdc0484ce.js +0 -1
  210. package/assets/esri/core/workers/chunks/28ce35e349dd79c26741.js +0 -1
  211. package/assets/esri/core/workers/chunks/2da9bfe51b1969db092d.js +0 -1
  212. package/assets/esri/core/workers/chunks/2ffb4531294ca7a975cd.js +0 -1
  213. package/assets/esri/core/workers/chunks/36a855002674616d9b48.js +0 -1
  214. package/assets/esri/core/workers/chunks/36fd2bb614f32cdaf6c3.js +0 -1
  215. package/assets/esri/core/workers/chunks/38a055b62f75b0a1b4a6.js +0 -1
  216. package/assets/esri/core/workers/chunks/420b75a64c7c60ef17ae.js +0 -1
  217. package/assets/esri/core/workers/chunks/48e03a72a3f4c2d43d54.js +0 -1
  218. package/assets/esri/core/workers/chunks/49fa1c48ea21029b4fd7.js +0 -1
  219. package/assets/esri/core/workers/chunks/4ef84c9dd600a03cc569.js +0 -1
  220. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +0 -1
  221. package/assets/esri/core/workers/chunks/55cbb11be12f94d3b492.js +0 -1
  222. package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +0 -1
  223. package/assets/esri/core/workers/chunks/5cbccd233f2deda1a3ba.js +0 -1
  224. package/assets/esri/core/workers/chunks/5f892d771592c88dee30.js +0 -1
  225. package/assets/esri/core/workers/chunks/6b12eba0b2d5e226ad73.js +0 -1
  226. package/assets/esri/core/workers/chunks/827ecfa9ac52518b99fb.js +0 -1
  227. package/assets/esri/core/workers/chunks/863f2de7068e2b420c5d.js +0 -1
  228. package/assets/esri/core/workers/chunks/87a8f839575d58d0ea33.js +0 -1
  229. package/assets/esri/core/workers/chunks/8978ca7f51d41ffa80cf.js +0 -1
  230. package/assets/esri/core/workers/chunks/8f05eb08948cd7e37326.js +0 -1
  231. package/assets/esri/core/workers/chunks/91a51effd465c40ad5d5.js +0 -1
  232. package/assets/esri/core/workers/chunks/92c1ddecb8ddec5e564f.js +0 -1
  233. package/assets/esri/core/workers/chunks/aa1e6154ef7abee76778.js +0 -1
  234. package/assets/esri/core/workers/chunks/aa255bdeabe558f1cd9a.js +0 -1
  235. package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +0 -1
  236. package/assets/esri/core/workers/chunks/abedf3b4fdf1fef28661.js +0 -1
  237. package/assets/esri/core/workers/chunks/ac033e23ddf1abf468b2.js +0 -1
  238. package/assets/esri/core/workers/chunks/af1d7a17f59eb115edb8.js +0 -1
  239. package/assets/esri/core/workers/chunks/b1e67b68658f3b87e9d5.js +0 -1
  240. package/assets/esri/core/workers/chunks/b56899501876a183a5ad.js +0 -1
  241. package/assets/esri/core/workers/chunks/b5dbb20edffd705bbf8d.js +0 -1
  242. package/assets/esri/core/workers/chunks/c490d9397ec99ef17645.js +0 -1
  243. package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +0 -1
  244. package/assets/esri/core/workers/chunks/c9c1f1c97097c9f4abca.js +0 -1
  245. package/assets/esri/core/workers/chunks/c9cf90bba5790dade955.js +0 -1
  246. package/assets/esri/core/workers/chunks/cac13cf937e18303624a.js +0 -1
  247. package/assets/esri/core/workers/chunks/d19d69d48f88aed1e385.js +0 -1
  248. package/assets/esri/core/workers/chunks/d2a99b85928a10ca2a36.js +0 -1
  249. package/assets/esri/core/workers/chunks/dce632e4f3b944ea9947.js +0 -1
  250. package/assets/esri/core/workers/chunks/ddfaa05725c27b449a3e.js +0 -1
  251. package/assets/esri/core/workers/chunks/de12fd5cfa0238266f91.js +0 -1
  252. package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +0 -1
  253. package/assets/esri/core/workers/chunks/dfcc0941ab30bf157175.js +0 -1
  254. package/assets/esri/core/workers/chunks/e31356965b90e9187b56.js +0 -1
  255. package/assets/esri/core/workers/chunks/e38ac1bbe8dcfeec5032.js +0 -1
  256. package/assets/esri/core/workers/chunks/e7acd87ef8de5e38fdc7.js +0 -1
  257. package/assets/esri/core/workers/chunks/e9b2f4d7026b67054bbc.js +0 -1
  258. package/assets/esri/core/workers/chunks/eb3a267c83924ff73464.js +0 -1
  259. package/assets/esri/core/workers/chunks/ef70f450c5875b86c535.js +0 -1
  260. package/assets/esri/core/workers/chunks/f36dc774b9866b70627e.js +0 -1
  261. package/assets/esri/core/workers/chunks/ff515bf0b5485abe8397.js +0 -1
  262. package/assets/esri/core/workers/chunks/ffac85e7d504a4a026f1.js +0 -1
  263. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +0 -5
  264. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +0 -5
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4322],{13043:(e,t,n)=>{function r(e,t){if(e&&t)for(const n of e.children)if(n.localName in t){const e=t[n.localName];if("function"==typeof e){const t=e(n);t&&r(n,t)}else r(n,e)}}function*o(e,t){for(const n of e.children)if(n.localName in t){const e=t[n.localName];"function"==typeof e?yield e(n):yield*o(n,e)}}n.d(t,{i:()=>o,p:()=>r})},20437:(e,t,n)=>{n.d(t,{A:()=>m});var r,o=n(31635),i=n(66552),a=n(25482),s=n(10107),l=n(56507),u=(n(44208),n(87811),n(93223)),c=n(36005),p=n(64108),d=n(80451),y=n(98453);const f=new i.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let m=class extends a.o{static{r=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let n=null;try{n=t?JSON.parse(t):null}catch(e){}return n?.value??null}readValueType(e,{description:t}){let n=null;try{n=t?JSON.parse(t):null}catch(e){}return n?f.fromJSON(n.fieldValueType):null}clone(){return new r({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,o.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],m.prototype,"alias",void 0),(0,o.Cg)([(0,s.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),(0,o.Cg)([(0,s.MZ)()],m.prototype,"description",void 0),(0,o.Cg)([(0,c.w)("description")],m.prototype,"readDescription",null),(0,o.Cg)([(0,s.MZ)({types:d.gK,json:{read:{reader:d.rS},write:!0}})],m.prototype,"domain",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),(0,o.Cg)([(0,s.MZ)({type:l.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),(0,o.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],m.prototype,"name",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),(0,o.Cg)([(0,u.e)(y.m)],m.prototype,"type",void 0),(0,o.Cg)([(0,s.MZ)()],m.prototype,"valueType",void 0),(0,o.Cg)([(0,c.w)("valueType",["description"])],m.prototype,"readValueType",null),(0,o.Cg)([(0,s.MZ)({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=r=(0,o.Cg)([(0,p.$)("esri.layers.support.Field")],m)},34322:(e,t,n)=>{n.d(t,{E:()=>q,Fu:()=>R,O8:()=>O,UH:()=>z,YW:()=>D,i5:()=>b,mG:()=>V,x$:()=>U});var r=n(78888),o=n(49186),i=n(5479),a=n(84952),s=n(5443),l=n(91218),u=n(16930),c=n(21325),p=n(50498),d=n(85113),y=n(13043),f=n(60694),m=n(20437),g=n(30524);const h="xlink:href",w="2.0.0",b="__esri_wfs_id__",S="wfs-layer:getWFSLayerTypeInfo-error",T="wfs-layer:empty-service",C="wfs-layer:feature-type-not-found",A="wfs-layer:geojson-not-supported",v="wfs-layer:kvp-encoding-not-supported",F="wfs-layer:malformed-json",x="wfs-layer:unknown-geometry-type",P="wfs-layer:unknown-field-type",N="wfs-layer:unsupported-spatial-reference",k="wfs-layer:unsupported-wfs-version";async function R(e,t){const n=function(e){const t=J(e);(function(e){const t=e.firstElementChild?.getAttribute("version");if(t&&t!==w)throw new o.A(k,`Unsupported WFS version ${t}. Supported version: ${w}`)})(t),Y(t);const n=t.firstElementChild,r=(0,i.PP)(function(e){return(0,y.i)(e,{FeatureTypeList:{FeatureType:e=>{const t={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},n=new Set;return(0,y.p)(e,{Name:e=>{const{name:n,prefix:r}=W(e.textContent);t.typeName=`${r}:${n}`,t.name=n,t.namespacePrefix=r,t.namespaceUri=e.lookupNamespaceURI(r)},Abstract:e=>{t.description=e.textContent},Title:e=>{t.title=e.textContent},WGS84BoundingBox:e=>{t.extent=s.A.fromJSON(function(e){let t,n,r,o;for(const i of e.children)switch(i.localName){case"LowerCorner":[t,n]=i.textContent.split(" ").map(e=>Number.parseFloat(e));break;case"UpperCorner":[r,o]=i.textContent.split(" ").map(e=>Number.parseFloat(e))}return{xmin:t,ymin:n,xmax:r,ymax:o,spatialReference:c.KK}}(e))},DefaultCRS:e=>{const r=G(e);r&&(t.defaultSpatialReference=r,n.add(r))},OtherCRS:e=>{const t=G(e);t&&n.add(t)}}),t.title||(t.title=t.name),n.add(4326),t.supportedSpatialReferences.push(...n),t}}})}(n));return{operations:E(n),get featureTypes(){return Array.from(r())},readFeatureTypes:r}}((await(0,r.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:w,...t?.customParameters},signal:t?.signal})).data);return function(e,t){(0,a.m3)(e)&&((0,a.FX)(e,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=(0,a.lM)(t.operations.DescribeFeatureType.url)),(0,a.FX)(e,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=(0,a.lM)(t.operations.GetFeature.url)))}(e,n),n}const M=["json","application/json; subtype=geojson; charset=utf-8","application/json; subtype=geojson","application/json","geojson","application/geo+json"];function j(e){for(const t of M){const n=e.findIndex(e=>e.toLowerCase()===t);if(n>=0)return e[n]}return null}function E(e){let t=!0;const n={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}},r=[],i=[];if((0,y.p)(e,{OperationsMetadata:{Parameter:e=>{if("outputformat"===e.getAttribute("name")?.toLowerCase())return{AllowedValues:{Value:({textContent:e})=>{e&&r.push(e)}}}},Operation:e=>{switch(e.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:e=>{n.GetCapabilities.url=e.getAttribute(h)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:e=>{n.DescribeFeatureType.url=e.getAttribute(h)}}}};case"GetFeature":return{DCP:{HTTP:{Get:e=>{n.GetFeature.url=e.getAttribute(h)}}},Parameter:e=>{if("outputformat"===e.getAttribute("name")?.toLowerCase())return{AllowedValues:{Value:({textContent:e})=>{e&&i.push(e)}}}}}}},Constraint:e=>{switch(e.getAttribute("name")){case"KVPEncoding":return{DefaultValue:e=>{t="true"===e.textContent.toLowerCase()}};case"ImplementsResultPaging":return{DefaultValue:e=>{n.GetFeature.supportsPagination="true"===e.textContent.toLowerCase()}}}}}}),n.GetFeature.outputFormat=j(i)??j(r),!t)throw new o.A(v,"WFS service doesn't support key/value pair (KVP) encoding");if(null==n.GetFeature.outputFormat)throw new o.A(A,"WFS service doesn't support GeoJSON output format");return n}function G(e){const t=parseInt(e.textContent?.match(/(?<wkid>\d+$)/i)?.groups?.wkid??"",10);if(!Number.isNaN(t))return t}function V(e,t,n){return(0,i.I6)(e,e=>n?e.name===t&&e.namespaceUri===n:e.typeName===t||e.name===t)}async function O(e,t,n,r={}){const{featureType:i,extent:a}=await async function(e,t,n,r={}){const i=e.readFeatureTypes(),a=t?V(i,t,n):i.next().value,{spatialReference:s=new u.A({wkid:a?.defaultSpatialReference})}=r;if(null==a)throw t?new o.A(C,`The type '${t}' could not be found in the service`):new o.A(T,"The service is empty");let p=a.extent;if(p&&!(0,c.aI)(p.spatialReference,s))try{await(0,l.initializeProjection)(p.spatialReference,s,void 0,r),p=(0,l.project)(p,s)}catch{throw new o.A(N,"Projection not supported")}return{extent:p,spatialReference:s,featureType:a}}(e,t,n,r),{spatialReference:s}=z(e.operations.GetFeature.url,i,r.spatialReference),{fields:p,geometryType:d,swapXY:y,objectIdField:f,geometryField:m}=await async function(e,t,n,r={}){const{typeName:i}=t,[a,s]=await Promise.allSettled([$(e.operations.DescribeFeatureType.url,i,r),I(e,i,n,r)]),l=e=>new o.A(S,`An error occurred while getting info about the feature type '${i}'`,{error:e});if("rejected"===a.status)throw l(a.reason);if("rejected"===s.status)throw l(s.reason);const{fields:u,errors:c}=a.value??{},p=a.value?.geometryType||s.value?.geometryType,d=s.value?.swapXY??!1;if(null==p)throw new o.A(x,`The geometry type could not be determined for type '${i}`,{typeName:i,geometryType:p,fields:u,errors:c});return{...D(u??[]),geometryType:p,swapXY:d}}(e,i,s,r);return{url:e.operations.GetCapabilities.url,name:i.name,namespaceUri:i.namespaceUri,fields:p,geometryField:m,geometryType:d,objectIdField:f,spatialReference:r.spatialReference??new u.A({wkid:i.defaultSpatialReference}),extent:a,swapXY:y,wfsCapabilities:e,customParameters:r.customParameters}}function D(e){const t=e.find(e=>"geometry"===e.type);let n=e.find(e=>"oid"===e.type);return e=e.filter(e=>"geometry"!==e.type),n||(n=new m.A({name:b,type:"oid",alias:b}),e.unshift(n)),{geometryField:t?.name??null,objectIdField:n.name,fields:e}}async function I(e,t,n,o={}){let i,a=!1;const[s,l]=await Promise.all([U(e.operations.GetFeature.url,t,n,e.operations.GetFeature.outputFormat,{...o,count:1}),(0,r.A)(e.operations.GetFeature.url,{responseType:"text",query:Z(t,n,void 0,{...o,count:1}),signal:o?.signal})]),u="FeatureCollection"===s.type&&s.features[0]?.geometry;if(u){let e;switch(i=p.gy.fromJSON((0,d.xD)(u.type)),u.type){case"Point":e=u.coordinates;break;case"LineString":case"MultiPoint":e=u.coordinates[0];break;case"MultiLineString":case"Polygon":e=u.coordinates[0][0];break;case"MultiPolygon":e=u.coordinates[0][0][0]}const t=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(l.data);if(t){const n=e[0].toFixed(3),r=e[1].toFixed(3),o=parseFloat(t[1]).toFixed(3);n===parseFloat(t[2]).toFixed(3)&&r===o&&(a=!0)}}return{geometryType:i,swapXY:a}}async function $(e,t,n){return function(e,t){const{name:n}=W(e),r=J(t);Y(r);const a=(0,i.I6)((0,y.i)(r.firstElementChild,{element:e=>e}),e=>e.getAttribute("name")===n);if(null!=a){const e=a.getAttribute("type"),t=e?(0,i.I6)((0,y.i)(r.firstElementChild,{complexType:e=>e}),t=>t.getAttribute("name")===W(e).name):(0,i.I6)((0,y.i)(a,{complexType:e=>e}),()=>!0);if(t)return function(e){const t=[],n=[];let r;const i=(0,y.i)(e,{complexContent:{extension:{sequence:{element:e=>e}}}});for(const a of i){const i=a.getAttribute("name");if(!i)continue;let s,l;if(a.hasAttribute("type")?s=W(a.getAttribute("type")).name:(0,y.p)(a,{simpleType:{restriction:e=>(s=W(e.getAttribute("base")).name,{maxLength:e=>{l=+e.getAttribute("value")}})}}),!s)continue;const u="true"===a.getAttribute("nillable");let c=!1;switch(s.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":n.push(new m.A({name:i,alias:i,type:"integer",nullable:u,length:(0,g._b)("integer")}));break;case"float":case"double":case"decimal":n.push(new m.A({name:i,alias:i,type:"double",nullable:u,length:(0,g._b)("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":n.push(new m.A({name:i,alias:i,type:"string",nullable:u,length:l??(0,g._b)("string")}));break;case"datetime":case"date":n.push(new m.A({name:i,alias:i,type:"date",nullable:u,length:l??(0,g._b)("date")}));break;case"pointpropertytype":r="point",c=!0;break;case"multipointpropertytype":r="multipoint",c=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":r="polyline",c=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":r="polygon",c=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":c=!0,t.push(new o.A(x,`geometry type '${s}' is not supported`,{type:(new XMLSerializer).serializeToString(e)}));break;default:t.push(new o.A(P,`Unknown field type '${s}'`,{type:(new XMLSerializer).serializeToString(e)}))}c&&n.push(new m.A({name:i,alias:i,type:"geometry",nullable:u}))}for(const e of n)if("integer"===e.type&&!e.nullable&&L.has(e.name.toLowerCase())){e.type="oid";break}return{geometryType:r,fields:n,errors:t}}(t)}throw new o.A(C,`Type '${e}' not found in document`,{document:(new XMLSerializer).serializeToString(r)})}(t,(await(0,r.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:w,TYPENAME:t,TYPENAMES:t,...n?.customParameters},signal:n?.signal})).data)}const L=new Set(["objectid","fid"]);async function U(e,t,n,i,a){let{data:s}=await(0,r.A)(e,{responseType:"text",query:Z(t,n,i,a),signal:a?.signal});s=s.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(s)}catch(e){throw new o.A(F,"Error while parsing the response",{response:s,error:e})}}function Z(e,t,n,r){const o="number"==typeof t?t:t.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:w,TYPENAMES:e,OUTPUTFORMAT:n,SRSNAME:"EPSG:"+o,STARTINDEX:r?.startIndex,COUNT:r?.count,...r?.customParameters}}async function q(e,t,n){const o=await(0,r.A)(e,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:w,TYPENAMES:t,RESULTTYPE:"hits",...n?.customParameters},signal:n?.signal}),i=/numberMatched=["'](?<numberMatched>\d+)["']/gi.exec(o.data);if(i?.groups)return+i.groups.numberMatched}function J(e){return(new DOMParser).parseFromString(e.trim(),"text/xml")}function W(e){const[t,n]=e.split(":");return{prefix:n?t:"",name:n??t}}function Y(e){let t="",n="";if((0,y.p)(e.firstElementChild,{Exception:e=>(t=e.getAttribute("exceptionCode"),{ExceptionText:e=>{n=e.textContent}})}),t)throw new o.A(`wfs-layer:${t}`,n)}function z(e,t,n){const r={wkid:t.defaultSpatialReference},o=null!=n?.wkid?{wkid:n.wkid}:r;return{spatialReference:o,getFeatureSpatialReference:(0,f.Fi)(e)||o.wkid&&t.supportedSpatialReferences.includes(o.wkid)?{wkid:o.wkid}:{wkid:t.defaultSpatialReference}}}},39357:(e,t,n)=>{n.d(t,{H:()=>l});var r,o=n(31635),i=n(25482),a=n(10107),s=(n(44208),n(53966),n(87811),n(64108));let l=r=class extends i.o{constructor(e){super(e),this.name=null,this.code=null}clone(){return new r({name:this.name,code:this.code})}};(0,o.Cg)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],l.prototype,"name",void 0),(0,o.Cg)([(0,a.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],l.prototype,"code",void 0),l=r=(0,o.Cg)([(0,s.$)("esri.layers.support.CodedValue")],l)},50498:(e,t,n)=>{n.d(t,{Ye:()=>p,gy:()=>c,yR:()=>d});var r=n(66552),o=n(5443),i=n(91075),a=n(48526),s=n(86738),l=n(39829),u=n(82799);const c=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),p=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),d={base:i.A,key:"type",typeMap:{extent:o.A,multipoint:a.A,point:s.A,polyline:u.A,polygon:l.A}}},53177:(e,t,n)=>{n.d(t,{A:()=>p});var r,o=n(31635),i=n(4718),a=n(10107),s=(n(44208),n(53966),n(93223)),l=n(64108),u=n(39357),c=n(76357);let p=class extends c.A{static{r=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const n=String(e);this.codedValues.some(e=>(String(e.code)===n&&(t=e.name),!!t))}return t}clone(){return new r({codedValues:(0,i.o8)(this.codedValues),name:this.name})}};(0,o.Cg)([(0,a.MZ)({type:[u.H],json:{write:{isRequired:!0}}})],p.prototype,"codedValues",void 0),(0,o.Cg)([(0,s.e)({codedValue:"coded-value"})],p.prototype,"type",void 0),p=r=(0,o.Cg)([(0,l.$)("esri.layers.support.CodedValueDomain")],p)},67482:(e,t,n)=>{function r(e){return null!=s(e)||null!=a(e)}function o(e){return l.test(e)}function i(e){return s(e)??a(e)}function a(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let n=!0;if(c&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,r=0;for(;!t&&r<=e.length;)t=!u.test(e[r]),r++;n=!t}}return n}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function s(e){const t=l.exec(e);if(!t?.groups)return null;const n=t.groups,r=+n.year,o=+n.month-1,i=+n.day,a=+(n.hours??"0"),s=+(n.minutes??"0"),u=+(n.seconds??"0");if(a>23)return null;if(s>59)return null;if(u>59)return null;const c=n.ms??"0",p=c?+c.padEnd(3,"0").slice(0,3):0;let d;if(n.isUTC||!n.offsetSign)d=Date.UTC(r,o,i,a,s,u,p);else{const e=+n.offsetHours,t=+n.offsetMinutes;d=6e4*("+"===n.offsetSign?-1:1)*(60*e+t)+Date.UTC(r,o,i,a,s,u,p)}return Number.isNaN(d)?null:d}n.d(t,{Br:()=>o,Cq:()=>r,_U:()=>i});const l=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,u=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,c=!Number.isNaN(new Date("technology 10").getTime())},76357:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(31635),o=n(66552),i=n(25482),a=n(10107),s=(n(44208),n(53966),n(87811),n(93223)),l=n(64108);const u=new o.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends i.o{constructor(e){super(e),this.name=null,this.type=null}};(0,r.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,r.Cg)([(0,s.e)(u),(0,a.MZ)({json:{write:{isRequired:!0}}})],c.prototype,"type",void 0),c=(0,r.Cg)([(0,l.$)("esri.layers.support.Domain")],c)},80451:(e,t,n)=>{n.d(t,{rS:()=>f,gK:()=>y}),n(44208);var r,o=n(53177),i=n(76357),a=n(31635),s=(n(53966),n(87811),n(49186),n(93223)),l=n(64108);let u=class extends i.A{static{r=this}constructor(e){super(e),this.type="inherited"}clone(){return new r}};(0,a.Cg)([(0,s.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=r=(0,a.Cg)([(0,l.$)("esri.layers.support.InheritedDomain")],u);var c,p=n(10107);let d=class extends i.A{static{c=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new c({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,a.Cg)([(0,p.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,n){t[n]=[this.minValue||0,e]},isRequired:!0}}})],d.prototype,"maxValue",void 0),(0,a.Cg)([(0,p.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,n){t[n]=[e,this.maxValue||0]},isRequired:!0}}})],d.prototype,"minValue",void 0),(0,a.Cg)([(0,s.e)({range:"range"})],d.prototype,"type",void 0),d=c=(0,a.Cg)([(0,l.$)("esri.layers.support.RangeDomain")],d);const y={key:"type",base:i.A,typeMap:{range:d,"coded-value":o.A,inherited:u}};function f(e){if(!e?.type)return null;switch(e.type){case"range":return d.fromJSON(e);case"codedValue":return o.A.fromJSON(e);case"inherited":return u.fromJSON(e)}return null}},85113:(e,t,n)=>{n.d(t,{BM:()=>v,bd:()=>F,sO:()=>A,xD:()=>c});var r=n(67482),o=n(49186),i=n(21325),a=n(43334),s=n(92722),l=n(30524);const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function c(e){return u[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*d(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function y(e){for(const t of e)if(t.length>2)return!0;return!1}function f(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n],o=e[(n+1)%e.length];t+=r[0]*o[1]-o[0]*r[1]}return t<=0}function m(e){const t=e[0],n=e[e.length-1];return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]||e.push(t),e}function g(e,t,n){switch(t.type){case"LineString":case"MultiPoint":return function(e,t,n){return b(e,t.coordinates,n),e}(e,t,n);case"MultiLineString":return function(e,t,n){for(const r of t.coordinates)b(e,r,n);return e}(e,t,n);case"MultiPolygon":return function(e,t,n){for(const r of t.coordinates){h(e,r[0],n);for(let t=1;t<r.length;t++)w(e,r[t],n)}return e}(e,t,n);case"Point":return function(e,t,n){return T(e,t.coordinates,n),e}(e,t,n);case"Polygon":return function(e,t,n){const r=t.coordinates;h(e,r[0],n);for(let t=1;t<r.length;t++)w(e,r[t],n);return e}(e,t,n)}}function h(e,t,n){const r=m(t);!function(e){return!f(e)}(r)?b(e,r,n):S(e,r,n)}function w(e,t,n){const r=m(t);!function(e){return f(e)}(r)?b(e,r,n):S(e,r,n)}function b(e,t,n){for(const r of t)T(e,r,n);e.lengths.push(t.length)}function S(e,t,n){for(let r=t.length-1;r>=0;r--)T(e,t[r],n);e.lengths.push(t.length)}function T(e,t,n){const[r,o,i]=t;e.coords.push(r,o),n.hasZ&&e.coords.push(i||0)}function C(e){switch(typeof e){case"string":return(0,r.Br)(e)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function A(e,t=4326){if(!e)throw new o.A("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new o.A("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:n}=e;if(!n)return;const r="string"==typeof n?n:"name"===n.type?n.properties.name:"EPSG"===n.type?n.properties.code:null,a=(0,i.oT)({wkid:t})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${t})$`,"i");if(!r||!a.test(r))throw new o.A("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:n})}function v(e,t={}){const n=[],r=new Set,o=new Set;let i,a=!1,s=null,u=!1,{geometryType:f=null}=t;for(const t of p(e)){const{geometry:e,properties:p,id:m}=t;if((!e||(f||(f=c(e.type)),c(e.type)===f))&&(a||(a=y(d(e))),u||(u=null!=m,u&&(i=typeof m,p&&(s=Object.keys(p).filter(e=>p[e]===m)))),p&&s&&u&&null!=m&&(s.length>1?s=s.filter(e=>p[e]===m):1===s.length&&(s=p[s[0]]===m?s:[])),p))for(const e in p){if(r.has(e))continue;const t=C(p[e]);if("unknown"===t){o.add(e);continue}o.delete(e),r.add(e);const i=(0,l.rS)(e);i&&n.push({name:i,alias:e,type:t})}}const m=(0,l.rS)(1===s?.length&&s[0]||null)??void 0;if(m)for(const e of n)if(e.name===m&&(0,l.WA)(e)){e.type="esriFieldTypeOID";break}return{fields:n,geometryType:f,hasZ:a,objectIdFieldName:m,objectIdFieldType:i,unknownFields:Array.from(o)}}function F(e,t){return Array.from(function*(e,t={}){const{geometryType:n,objectIdField:r}=t;for(const o of e){const{geometry:e,properties:i,id:l}=o;if(e&&c(e.type)!==n)continue;const u=i||{};let p;r&&(p=u[r],null==l||p||(u[r]=p=l));const d=new a.Om(e?g(new s.A,e,t):null,u,null,p);yield d}}(p(e),t))}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4755,7136,8628],{2272:(e,t,n)=>{n.d(t,{Dl:()=>u,gf:()=>p,jV:()=>l,lF:()=>d});var r=n(92602),a=n(70333),s=n(4718),i=n(84952),o=n(926);function l(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function u(e){return"string"==typeof e?(0,i.An)(e):(0,s.o8)(e)}function d(e,t,n){const r={};for(const a in e){if("declaredClass"===a)continue;const s=e[a];if(null!=s&&"function"!=typeof s)if(Array.isArray(s))r[a]=s.map(e=>d(e));else if("object"==typeof s)if(s.toJSON){const e=s.toJSON(n?.[a]);r[a]=t?e:JSON.stringify(e)}else r[a]=t?s:JSON.stringify(s);else r[a]=s}return r}async function p(e,t,s){const i=function(e,t){return e?t&&(0,o.Qc)(e)?t:(0,o.CG)(e)??a.id?.findCredential(e)?.token:null}(e,t);if(i)return i;!a.id&&r.A.request.useIdentity&&await Promise.all([n.e(7330),n.e(168),n.e(3747)]).then(n.bind(n,73747));const l=await a.id.getCredential(e,s);return l?.token}},17136:(e,t,n)=>{n.d(t,{Y_:()=>E,O7:()=>R,el:()=>S});var r=n(92602),a=n(69052),s=n(49186),i=n(53966),o=n(39829),l=n(82799),u=n(16930),d=n(80754),p=n(21325),c=n(28735),f=n(78888),h=n(65864),y=n(2272),m=n(84952),g=n(92300);const A=()=>i.A.getLogger("esri.geometry.support.normalizeUtils");function b(e){return"polygon"===e[0].type}function w(e){return"polyline"===e[0].type}function F(e,t,n){if(t){const t=function(e,t){if(!(e instanceof l.A||e instanceof o.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw A().error(e),new s.A("internal:geometry",e)}const n=(0,d.r8)(e),r=[];for(const e of n){const n=[];r.push(n),n.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const a=e[r][0],s=e[r][1],i=e[r+1][0],o=e[r+1][1],l=Math.sqrt((i-a)*(i-a)+(o-s)*(o-s)),u=(o-s)/l,d=(i-a)/l,p=l/t;if(p>1){for(let e=1;e<=p-1;e++){const r=e*t,i=d*r+a,o=u*r+s;n.push([i,o])}const e=(l+Math.floor(p-1)*t)/2,r=d*e+a,i=u*e+s;n.push([r,i])}n.push([i,o])}}return function(e){return"polygon"===e.type}(e)?new o.A({rings:r,spatialReference:e.spatialReference}):new l.A({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,c.ci)(t,!0)}return n&&(e=(0,d.kS)(e,n)),e}function v(e,t,n){if(Array.isArray(e)){const r=e[0];if(r>t){const n=(0,d.kd)(r,t);e[0]=r+n*(-2*t)}else if(r<n){const t=(0,d.kd)(r,n);e[0]=r+t*(-2*n)}}else{const r=e.x;if(r>t){const n=(0,d.kd)(r,t);e=e.clone().offset(n*(-2*t),0)}else if(r<n){const t=(0,d.kd)(r,n);e=e.clone().offset(t*(-2*n),0)}}return e}function I(e,t){let n=-1;for(let r=0;r<t.cutIndexes.length;r++){const a=t.cutIndexes[r],s=t.geometries[r],i=(0,d.r8)(s);for(let e=0;e<i.length;e++){const t=i[e];t.some(n=>{if(n[0]<180)return!0;{let n=0;for(let e=0;e<t.length;e++){const r=t[e][0];n=r>n?r:n}n=Number(n.toFixed(9));const r=-360*(0,d.kd)(n,180);for(let n=0;n<t.length;n++){const t=s.getPoint(e,n);s.setPoint(e,n,t.clone().offset(r,0))}return!0}})}if(a===n){if(b(e))for(const t of(0,d.r8)(s))e[a]=e[a].addRing(t);else if(w(e))for(const t of(0,d.r8)(s))e[a]=e[a].addPath(t)}else n=a,e[a]=s}return e}async function S(e,t,n){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&A().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const a="string"==typeof t?t:t?.url??r.A.geometryServiceUrl;let s,i,u,b,w,R,$,E,k=0;const M=[],O=[];for(const t of e)if(null!=t)if(s||(s=t.spatialReference,i=(0,p.Vp)(s),u=s.isWebMercator,R=u?102100:4326,b=d.j7[R].maxX,w=d.j7[R].minX,$=d.j7[R].plus180Line,E=d.j7[R].minus180Line),i)if("mesh"===t.type)O.push(t);else if("point"===t.type)O.push(v(t.clone(),b,w));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>v(e,b,w)),O.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,i);O.push(e.rings?new o.A(e):e)}else if(t.extent){const e=t.extent,n=(0,d.kd)(e.xmin,w)*(2*b);let r=0===n?t.clone():(0,d.kS)(t.clone(),n);e.offset(n,0);let{xmin:a,xmax:s}=e;a=Number(a.toFixed(9)),s=Number(s.toFixed(9)),e.intersects($)&&s!==b?(k=s>k?s:k,r=F(r,u),M.push(r),O.push("cut")):e.intersects(E)&&a!==w?(k=s*(2*b)>k?s*(2*b):k,r=F(r,u,360),M.push(r),O.push("cut")):O.push(r)}else O.push(t.clone());else O.push(t);else O.push(t);let x=(0,d.kd)(k,b),L=-90;const j=x,T=new l.A;for(;x>0;){const e=360*x-180;T.addPath([[e,L],[e,-1*L]]),L*=-1,x--}if(M.length>0&&j>0){const t=I(M,await async function(e,t,n,r){const a=(0,y.Dl)(e),s=t[0].spatialReference,i={...r,responseType:"json",query:{...a.query,f:"json",sr:(0,p.YX)(s),target:JSON.stringify({geometryType:(0,h.$B)(t[0]),geometries:t}),cutter:JSON.stringify(n)}},o=await(0,f.A)(a.path+"/cut",i),{cutIndexes:l,geometries:u=[]}=o.data;return{cutIndexes:l,geometries:u.map(e=>{const t=(0,h.rS)(e);return t.spatialReference=s,t})}}(a,M,T,n)),r=[],s=[];for(let n=0;n<O.length;n++){const a=O[n];if("cut"!==a)s.push(a);else{const a=t.shift(),i=e[n];null!=i&&"polygon"===i.type&&i.rings&&i.rings.length>1&&a.rings.length>=i.rings.length?(r.push(a),s.push("simplify")):s.push(u?(0,c.Gh)(a):a)}}if(!r.length)return s;const i=await async function(e,t,n){const r="string"==typeof e?(0,m.An)(e):e,a=t[0].spatialReference,s=(0,h.$B)(t[0]),i={...n,query:{...r.query,f:"json",sr:(0,p.YX)(a),geometries:JSON.stringify((0,g.X)(t))}},{data:o}=await(0,f.A)(r.path+"/simplify",i);return(0,g.V)(o.geometries,s,a)}(a,r,n),o=[];for(let e=0;e<s.length;e++){const t=s[e];"simplify"!==t?o.push(t):o.push(u?(0,c.Gh)(i.shift()):i.shift())}return o}const B=[];for(let e=0;e<O.length;e++){const t=O[e];if("cut"!==t)B.push(t);else{const e=M.shift();B.push(!0===u?(0,c.Gh)(e):e)}}return B}function R(e,t,n){const r=(0,p.Vp)(n);if(null==r)return e;const[a,s]=r.valid,i=2*s;let o=0,l=0;t>s?o=Math.ceil(Math.abs(t-s)/i):t<a&&(o=-Math.ceil(Math.abs(t-a)/i)),e>s?l=Math.ceil(Math.abs(e-s)/i):e<a&&(l=-Math.ceil(Math.abs(e-a)/i));let u=e+(o-l)*i;const d=u-t;return d>s?u-=i:d<a&&(u+=i),u}function $(e){const t=(0,p.Vp)(e);if(null==t)return null;const[n,r]=t.valid;return new a.hr(n,r)}const E=$(u.A.WGS84);$(u.A.WebMercator)},69052:(e,t,n)=>{n.d(t,{hr:()=>a,ie:()=>l,uC:()=>o});var r=n(34727);class a{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,n=!1){return s(this.range,this.min,this.max,e,t,n)}clamp(e,t=0){return(0,r.qE)(e-t,this.min,this.max)+t}monotonic(e,t,n){return e<t?t:t+i(this.range,e-t,n)}minimalMonotonic(e,t,n){return s(this.range,e,e+this.range,t,n)}center(e,t,n){return t=this.monotonic(e,t,n),this.normalize((e+t)/2,n)}diff(e,t,n){return this.monotonic(e,t,n)-e}shortestSignedDiff(e,t){e=this.normalize(e);const n=(t=this.normalize(t))-e,r=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(n)<Math.abs(r)?n:r}contains(e,t,n){return t=this.minimalMonotonic(e,t),(n=this.minimalMonotonic(e,n))>e&&n<t}}function s(e,t,n,r,a=0,s=!1){return(r-=a)<t?r+=i(e,t-r):r>n&&(r-=i(e,r-n)),s&&r===n&&(r=t),r+a}function i(e,t,n=0){return Math.ceil((t-n)/e)*e+n}const o=new a(0,2*Math.PI),l=(new a(-Math.PI,Math.PI),new a(0,360))},78628:(e,t,n)=>{n.d(t,{applyEdits:()=>v,r3:()=>b,uploadAssets:()=>M,zp:()=>F});var r=n(52106),a=n(7762),s=n(49186),i=n(4718),o=n(53966),l=n(74887),u=n(84952),d=n(13069),p=n(17136),c=n(21325),f=n(47685),h=n(30524),y=n(20557),m=n(77548);function g(e){return null!=e?.applyEdits}function A(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function b(e){return e.every(A)}function w(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function F(e){return e.every(w)}async function v(e,t,n,r={}){let u;const p="gdbVersion"in e?e.gdbVersion:null,c=r.gdbVersion??p;if((0,f.Mk)(e)&&e.url)u=(0,f.Zk)(e.url,e.layerId,c,"original-and-current-features"===r.returnServiceEditsOption);else{u=(0,l.Tw)(),u.promise.then(t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)});const t={result:u.promise};e.emit("apply-edits",t)}try{const{results:l,edits:p}=await async function(e,t,n,r){if(await e.load(),!g(t))throw new s.A(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!(0,m.tk)(e))throw new s.A(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:l}=await async function(e,t,n){const r=(0,m.BR)(e),i=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),l=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),u=null!=e.infoFor3D;if(function(e,t,n,r,a,i){if(!(e&&(r||a)||n?.usingTelecomOperations))throw new s.A(`${i}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&n?.globalIdUsed&&!n.usingFeatureServiceEndpoint)throw new s.A(`${i}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&a)throw new s.A(`${i}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!n?.globalIdUsed&&a)throw new s.A(`${i}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}(t,r,n,!!i,!!l,`${e.type}-layer`),!r.data.isVersioned&&n?.gdbVersion)throw new s.A(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!r.editing.supportsRollbackOnFailure&&n?.rollbackOnFailureEnabled)throw new s.A(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const p={...n};if(null!=p.rollbackOnFailureEnabled||r.editing.supportsRollbackOnFailure||(p.rollbackOnFailureEnabled=!0),p.rollbackOnFailureEnabled||"original-and-current-features"!==p.returnServiceEditsOption||(!1===p.rollbackOnFailureEnabled&&o.A.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),p.rollbackOnFailureEnabled=!0),!r.editing.supportsReturnServiceEditsInSourceSpatialReference&&p.returnServiceEditsInSourceSR)throw new s.A(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(p.returnServiceEditsInSourceSR&&"original-and-current-features"!==p.returnServiceEditsOption)throw new s.A(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const c=function(e,t,n){const r=function(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&a.A.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}(e);if(r.addFeatures?.length&&!t.operations.supportsAdd)throw new s.A(`${n}:unsupported-operation`,"Layer does not support adding features.");if(r.updateFeatures?.length&&!t.operations.supportsUpdate)throw new s.A(`${n}:unsupported-operation`,"Layer does not support updating features.");if(r.deleteFeatures?.length&&!t.operations.supportsDelete)throw new s.A(`${n}:unsupported-operation`,"Layer does not support deleting features.");return r.addFeatures=r.addFeatures.map(E),r.updateFeatures=r.updateFeatures.map(E),r.addAssetFeatures=[],r}(t,r,`${e.type}-layer`),f=n?.globalIdUsed||u,h=e.fields.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(f){const{globalIdField:t}=e;if(null==t)throw new s.A(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");c.addFeatures.forEach(e=>function(e,t){const{attributes:n}=e;null==n[t]&&(n[t]=(0,d.yS)())}(e,t))}return c.addFeatures.forEach(t=>function(e,t,n,r){I(e,t,n,r),S(e,t)}(t,e,f,h)),c.updateFeatures.forEach(t=>function(e,t,n,r){I(e,t,n,r),S(e,t);const a=(0,m.BR)(t);if("geometry"in e&&null!=e.geometry&&!a?.editing.supportsGeometryUpdate)throw new s.A(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}(t,e,f,h)),c.deleteFeatures.forEach(t=>function(e,t,n,r){I(e,t,n,r)}(t,e,f,h)),c.addAttachments.forEach(t=>R(t,e)),c.updateAttachments.forEach(t=>R(t,e)),u&&await async function(e,t){const{infoFor3D:n}=t;if(null==n)return;if(!(0,y.JQ)(n))throw new s.A(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:r}=e;for(const t of e.addFeatures??[])k(t)&&r.push(t);for(const t of e.updateFeatures??[])k(t)&&r.push(t)}(c,e),{edits:await $(c),options:p}}(e,n,r);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,l)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}(e,t,n,r),c=e=>e.filter(e=>!e.error).map(i.o8),f={edits:p,addedFeatures:c(l.addFeatureResults),updatedFeatures:c(l.updateFeatureResults),deletedFeatures:c(l.deleteFeatureResults),addedAttachments:c(l.addAttachmentResults),updatedAttachments:c(l.updateAttachmentResults),deletedAttachments:c(l.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:l.editMoment?new Date(l.editMoment):null,globalIdToObjectId:r.globalIdToObjectId};return l.editedFeatureResults?.length&&(f.editedFeatures=l.editedFeatureResults),u.resolve(f),l}catch(e){throw u.reject(e),e}}function I(e,t,n,r){if(n){if("attributes"in e&&!e.attributes[t.globalIdField])throw new s.A(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new s.A(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(r.length&&"attributes"in e)for(const n of r){const r=e.attributes[n.name];if(void 0!==r&&!(0,h.OG)(n,r))throw new s.A(`${t.type}-layer:invalid-parameter`,`Big-integer field '${n.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new s.A(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new s.A(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function S(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:n}=e,{spatialReference:r,vertexSpace:a}=n,i=t.spatialReference,o="local"===a.type,l=(0,c.EA)(i),u=(0,c.aI)(i,r),d=u||(0,c.oT)(i)&&((0,c.oT)(r)||(0,c.K8)(r));if(!(o&&l&&d||!o&&!l&&u))throw new s.A(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${a.type} vertex space and a spatial reference wkid:${r.wkid} to a layer with a spatial reference wkid:${i.wkid} is not supported.`)}}function R(e,t){const{feature:n,attachment:r}=e;if(!n||"attributes"in n&&!n.attributes[t.globalIdField])throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in n)&&!n.globalId)throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name||r.name))throw new s.A(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&r.uploadId)throw new s.A(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof r.data){const e=(0,u.r$)(r.data);if(e&&!e.isBase64)throw new s.A(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function $(e){const t=e.addFeatures??[],n=e.updateFeatures??[],r=t.concat(n).map(e=>e.geometry),a=await(0,p.el)(r),s=t.length,i=n.length;return a.slice(0,s).forEach((e,n)=>t[n].geometry=e),a.slice(s,s+i).forEach((e,t)=>n[t].geometry=e),e}function E(e){const t=new r.A;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}function k(e){return"mesh"===e?.geometry?.type}function M(e,t,n,r){if(!g(t))throw new s.A(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new s.A(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(n,r)}},80754:(e,t,n)=>{n.d(t,{j7:()=>i,kS:()=>l,kd:()=>o,r8:()=>u});var r=n(82799),a=n(16930),s=n(65864);const i={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator}),minus180Line:new r.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:a.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.A({paths:[[[180,-180],[180,180]]],spatialReference:a.A.WGS84}),minus180Line:new r.A({paths:[[[-180,-180],[-180,180]]],spatialReference:a.A.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const n=u(e);for(const e of n)for(const n of e)n[0]+=t;return e}function u(e){return(0,s.Bi)(e)?e.rings:e.paths}},92300:(e,t,n)=>{n.d(t,{V:()=>s,X:()=>a});var r=n(65864);function a(e){return{geometryType:(0,r.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function s(e,t,n){const a=(0,r.xD)(t);return e.map(e=>{const t=a.fromJSON(e);return t.spatialReference=n,t})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[433,2342,3301,4342,7694],{159:(e,t,i)=>{i.d(t,{A:()=>u});var r,s=i(31635),n=i(65008),a=i(10107),l=(i(44208),i(53966),i(87811),i(64108)),o=i(99157);let u=r=class extends n.A{constructor(e){super(e),this.steps=[]}getInverse(){const e=new r;for(let t=this.steps.length-1;t>=0;t--){const i=this.steps[t];e.steps.push(i.getInverse())}return e}};(0,s.Cg)([(0,a.MZ)({type:[o.A],nonNullable:!0})],u.prototype,"steps",void 0),u=r=(0,s.Cg)([(0,l.$)("esri.geometry.operators.support.GeographicTransformation")],u)},6797:(e,t,i)=>{i.d(t,{Ui:()=>h});var r=i(65008),s=i(7762),n=i(88620);const a=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function l(e){return e instanceof r.A}function o(e){return e instanceof s.A?Object.keys(e.items):l(e)?(0,n.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof s.A?e.items[t]:e[t]}function c(e){return e?e.declaredClass:null}function d(e,t){const i=e.diff;if(i&&"function"==typeof i)return i(e,t);const r=o(e),s=o(t);if(0===r.length&&0===s.length)return;if(!r.length||!s.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const n=s.filter(e=>!r.includes(e)),h=r.filter(e=>!s.includes(e)),p=r.filter(i=>s.includes(i)&&u(e,i)!==u(t,i)).concat(n,h).sort(),f=c(e);if(f&&a.has(f)&&p.length)return{type:"complete",oldValue:e,newValue:t};let y;const g=l(e)&&l(t);for(const r of p){const s=u(e,r),n=u(t,r);let a;if((g||"function"!=typeof s&&"function"!=typeof n)&&s!==n&&(null!=s||null!=n)){if(i&&i[r]&&"function"==typeof i[r])a=i[r]?.(s,n);else if(s instanceof Date&&n instanceof Date){if(s.getTime()===n.getTime())continue;a={type:"complete",oldValue:s,newValue:n}}else a="object"==typeof s&&"object"==typeof n&&c(s)===c(n)?d(s,n):{type:"complete",oldValue:s,newValue:n};null!=a&&(null!=y?y.diff[r]=a:y={type:"partial",diff:{[r]:a}})}}return y}function h(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&c(e)!==c(t)?{type:"complete",oldValue:e,newValue:t}:d(e,t)}},9762:(e,t,i)=>{i.r(t),i.d(t,{projectBuffer:()=>s});var r=i(37539);function s(e,t,i,s,n,a,l=Math.floor(e.length/3)){const o=(0,r.jd)(t,n);if(null==o)return!1;if(o===r.pO){if(e===s&&i===a)return!0;const t=i+3*l;for(let r=i,n=a;r<t;r++,n++)s[n]=e[r];return!0}const u=i+3*l;for(let t=i,r=a;t<u;t+=3,r+=3)o(e,t,s,r);return!0}},16494:(e,t,i)=>{i.d(t,{Nd:()=>l,W5:()=>a});var r=i(37330);const s=["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"],a=new r.I({whiteList:s,onTagAttr:(e,t,i)=>{const r=`${t}="${i}"`;if(n.includes(t))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),l=new r.I({whiteList:{br:[]},stripIgnoreTag:!0,escapeHtml:e=>e},!1)},17311:(e,t,i)=>{i.d(t,{A:()=>f});var r=i(31635),s=i(65008),n=i(4576),a=i(60999),l=i(7762),o=i(16494),u=i(10107),c=(i(44208),i(53966),i(64108)),d=i(30524),h=i(43668);const p=/<br\s*\/*>/gi;let f=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,a.UT)(()=>(0,h.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??i.e(9926).then(i.bind(i,29926)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new l.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 i=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(i.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:i,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(i,{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 i=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of i){const i=t.split("."),r=this.fieldsIndex.get(i.at(-1)??"");r&&e.add(r.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const i of t){const t=this.fieldsIndex.get(i);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),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,i){const r=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],i)).get(r)??""}async getTitles(e,t,i){const r=new Map,s=i?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:n}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);i?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:a,workingTitle:l}=this,u=l&&a;t.forEach(t=>{const c=t.getObjectId()??t.attributes[e.objectIdField];let d=u?n({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:a,globalAttributes:this._createFormattedAttributes(e,t,s).global,layer:e,text:l}):"";i?.removeHTML&&(d=o.Nd.sanitize(d).replaceAll(p," ")),r.set(c,d)})}catch{}return r}async _checkAndReQueryGraphics(e,t){const i=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(n.Ru);if(i.length!==t.length)return t;if(t.some(e=>!(0,d.Kl)(e,this.requiredFields))){const r=e.createQuery();r.where="1=1",r.outFields=[...this.requiredFields],r.objectIds=i;const s=await e.queryFeatures(r);if(s?.features.length===t.length)return s.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const i of e){if(!i.fieldName)continue;const e=this.fieldsIndex.get(i.fieldName),r=e?.name??i.fieldName;i.fieldName=r,t.set(r.toLowerCase(),i)}return t}_createFormattedAttributes(e,t,i="system"){const r=this.effectivePopupTemplate?.fieldInfos??[],s={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const i=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:i}})}catch{}}const n={...t.attributes,...s};return{global:this._featureUtils.formatAttributes({fieldInfos:r,attributes:n,graphic:t,timeZone:i,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,d.nw)(e).filter(e=>!(e.startsWith("relationships/")||e.startsWith("expression/")))}};(0,r.Cg)([(0,u.MZ)({readOnly:!0})],f.prototype,"_arcadeTask",null),(0,r.Cg)([(0,u.MZ)()],f.prototype,"_featureUtils",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],f.prototype,"featureUtilsPromise",null),(0,r.Cg)([(0,u.MZ)({readOnly:!0})],f.prototype,"calculatedExpressions",null),(0,r.Cg)([(0,u.MZ)()],f.prototype,"displayField",void 0),(0,r.Cg)([(0,u.MZ)()],f.prototype,"effectivePopupTemplate",void 0),(0,r.Cg)([(0,u.MZ)()],f.prototype,"expressionsUsedInTitle",null),(0,r.Cg)([(0,u.MZ)()],f.prototype,"fieldsIndex",void 0),(0,r.Cg)([(0,u.MZ)()],f.prototype,"fieldInfoMap",null),(0,r.Cg)([(0,u.MZ)()],f.prototype,"fields",void 0),(0,r.Cg)([(0,u.MZ)()],f.prototype,"objectIdField",void 0),(0,r.Cg)([(0,u.MZ)()],f.prototype,"requiredFields",null),f=(0,r.Cg)([(0,c.$)("esri.layers.support.TitleCreator")],f)},22671:(e,t,i)=>{i.d(t,{A:()=>m});var r,s=i(31635),n=i(52106),a=i(66552),l=i(25482),o=i(4718),u=i(10107),c=(i(44208),i(53966),i(36005)),d=i(64108),h=i(43937),p=i(16930),f=i(65864),y=i(50498),g=i(20437);const _=new a.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let m=r=class extends l.o{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,i,r){if(e)return void _.write(e,t,i,r);const{features:s}=this;if(s)for(const e of s)if(null!=e?.geometry)return void _.write(e.geometry.type,t,i,r)}readQueryGeometry(e,t){if(!e)return null;const i=!!e.spatialReference,r=(0,f.rS)(e);return r&&!i&&t.spatialReference&&(r.spatialReference=p.A.fromJSON(t.spatialReference)),r}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:i}=this;if(i)for(const e of i)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new r(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 i=0;i<t.features.length;i++){const r=t.features[i];if(r.geometry){const t=e?.[i];r.geometry=t?.toJSON()||r.geometry}}return t}quantize(e){const{scale:[t,i],translate:[r,s]}=e,n=this.features,a=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-r)/t),e=>Math.round((s-e)/i));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:i}=this;if(!i)return this;const{translate:[r,s],scale:[n,a]}=i;let l=null,o=null;if(this.hasZ&&null!=i?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=i;l=i=>i*t+e}if(this.hasM&&null!=i?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=i;o=i=>null==i?i:i*t+e}const u=this._getHydrationFunction(e,e=>e*n+r,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,i){const r=p.A.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){const n=e[t],a=i.fromJSON(n),l=n.geometry?.spatialReference;null==a.geometry||l||(a.geometry.spatialReference=r);const o=n.aggregateGeometries,u=a.aggregateGeometries;if(o&&null!=u)for(const e in u){const t=u[e],i=o[e],s=i?.spatialReference;null==t||s||(t.spatialReference=r)}s.push(a)}return s}_quantizePoints(e,t,i){let r,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=i(l[1]);e===r&&a===s||(n.push([e-r,a-s]),r=e,s=a)}else r=t(l[0]),s=i(l[1]),n.push([r,s])}return n.length>0?n:null}_getQuantizationFunction(e,t,i){return"point"===e?e=>(e.x=t(e.x),e.y=i(e.y),e):"polyline"===e||"polygon"===e?e=>{const r=(0,f.Bi)(e)?e.rings:e.paths,s=[];for(let e=0,n=r.length;e<n;e++){const n=r[e],a=this._quantizePoints(n,t,i);a&&s.push(a)}return s.length>0?((0,f.Bi)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const r=this._quantizePoints(e.points,t,i);return r&&r.length>0?(e.points=r,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,i,r,s){return"point"===e?e=>{e.x=t(e.x),e.y=i(e.y),r&&(e.z=r(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,f.Bi)(e)?e.rings:e.paths;let a,l;for(let e=0,r=n.length;e<r;e++){const r=n[e];for(let e=0,s=r.length;e<s;e++){const s=r[e];e>0?(a+=s[0],l+=s[1]):(a=s[0],l=s[1]),s[0]=t(a),s[1]=i(l)}}if(r&&s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=r(i[2]),i[3]=s(i[3])}}else if(r)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=r(i[2])}}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,i=t.length;e<i;e++){const i=t[e];i[2]=s(i[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=i(e.ymin),e.xmax=t(e.xmax),e.ymax=i(e.ymax),r&&null!=e.zmax&&null!=e.zmin&&(e.zmax=r(e.zmax),e.zmin=r(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,r=n.length;e<r;e++){const r=n[e];e>0?(a+=r[0],l+=r[1]):(a=r[0],l=r[1]),r[0]=t(a),r[1]=i(l)}if(r&&s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=r(t[2]),t[3]=s(t[3])}else if(r)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=r(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.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],m.prototype,"displayFieldName",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"exceededTransferLimit",void 0),(0,s.Cg)([(0,u.MZ)({type:[n.A],json:{write:!0}})],m.prototype,"features",void 0),(0,s.Cg)([(0,c.w)("features")],m.prototype,"readFeatures",null),(0,s.Cg)([(0,u.MZ)({type:[g.A],json:{write:!0}})],m.prototype,"fields",void 0),(0,s.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:_.read}}})],m.prototype,"geometryType",void 0),(0,s.Cg)([(0,h.K)("geometryType")],m.prototype,"writeGeometryType",null),(0,s.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"hasM",void 0),(0,s.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"hasZ",void 0),(0,s.Cg)([(0,u.MZ)({types:y.yR,json:{write:!0}})],m.prototype,"queryGeometry",void 0),(0,s.Cg)([(0,c.w)("queryGeometry")],m.prototype,"readQueryGeometry",null),(0,s.Cg)([(0,u.MZ)({type:p.A,json:{write:!0}})],m.prototype,"spatialReference",void 0),(0,s.Cg)([(0,h.K)("spatialReference")],m.prototype,"writeSpatialReference",null),(0,s.Cg)([(0,u.MZ)({json:{write:!0}})],m.prototype,"transform",void 0),m=r=(0,s.Cg)([(0,d.$)("esri.rest.support.FeatureSet")],m),m.prototype.toJSON.isDefaultToJSON=!0},29005:(e,t,i)=>{i.d(t,{A:()=>c});var r=i(31635),s=i(69540),n=i(66552),a=i(25482),l=i(10107),o=(i(44208),i(53966),i(87811),i(64108));const u=new n.J({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let c=class extends((0,s.OU)(a.o)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,r.Cg)([(0,l.MZ)({json:{write:!0}})],c.prototype,"name",void 0),(0,r.Cg)([(0,l.MZ)({json:{write:!0}})],c.prototype,"description",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:u.read,write:u.write}})],c.prototype,"drawingTool",void 0),(0,r.Cg)([(0,l.MZ)({json:{write:!0}})],c.prototype,"prototype",void 0),(0,r.Cg)([(0,l.MZ)({json:{write:!0}})],c.prototype,"thumbnail",void 0),c=(0,r.Cg)([(0,o.$)("esri.layers.support.FeatureTemplate")],c)},30235:(e,t,i)=>{i.d(t,{A:()=>f});var r=i(52106),s=i(87449),n=i(11221),a=i(89169),l=i(33325),o=i(80609),u=i(39516),c=i(91075),d=i(68654),h=i(33143),p=i(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 i of this.fields)if("oid"===i.type||this._layer.objectIdField===i.name)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.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=0,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 0}_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 i of this.fields)t[i.name]=e.attributes[i.name];return new r.A({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){let n="",l=!1;if(null!==r&&(n=r.constructClause(),l=!0),this.isTable()&&t&&null!==e&&""!==e)return new a.A([],[],!0,null);const c=this._createQuery();c.where=(0,u.mA)(c.where,null===i?null===t?"1=1":"":(0,o.YY)(i,0)),c.spatialRelationship=this._makeRelationshipEnum(e),c.outSpatialReference=this.spatialReference,c.orderByFields=""!==n?n.split(","):null,c.geometry=null===t?null:t,c.relationParameter=this._makeRelationshipParam(e);const d=await this._layer.queryFeatures(c);if(null===d)return new a.A([],[],l,null);this._checkCancelled(s);const h=[];return d.features.forEach(e=>{const t=e.attributes[this._layer.objectIdField];h.push(t),this._featureCache[t]=this._changeFeature(e)}),new a.A([],h,l,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 i=t.attributes[this._layer.objectIdField];e.push(i),this._featureCache[i]=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),i=[];return t.features.forEach(e=>{const t=e.attributes[this._layer.objectIdField];i.push(t),this._featureCache[t]=this._changeFeature(e)}),this._wset=new a.A([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];-1!==t&&void 0===this._featureCache[t]&&r.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&&r.push(e._known[s]),r.length>i)));s++);if(0===r.length)return"success";throw new 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 i in e)t[i]=e[i];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 i=e.layerDefinition.objectIdField;const r=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(!i){let t=!1;for(const r of e.layerDefinition.fields)if("oid"===r.type||"esriFieldTypeOID"===r.type){i=r.name,t=!0;break}if(!1===t){let t="FID",r=!0,s=0;for(;r;){let i=!0;for(const r of e.layerDefinition.fields)if(r.name===t){i=!1;break}!0===i?r=!1:(s++,t="FID"+s.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const n=[];for(let i=0;i<a.length;i++)n.push({geometry:e.featureSet.features[i].geometry,attributes:e.featureSet.features[i].attributes?this._cloneAttr(e.featureSet.features[i].attributes):{}}),n[i].attributes[t]=i;a=n,i=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:r,objectIdField:i,spatialReference:t},g="esriGeometryNull"===u||null===u;g||(y.geometryType=u);const _=new d.default(y);return e?.layerDefinition?.subtypeField&&e?.layerDefinition?.subtypes&&_.read({subtypes:e.layerDefinition.subtypes,subtypeField:e.layerDefinition.subtypeField}),new f({layer:_,spatialReference:t,isTable:g})}async queryAttachments(){return[]}async getFeatureByObjectId(e){const t=this._createQuery();t.where=this.objectIdField+"="+e.toString();const i=await this._layer.queryFeatures(t);return 1===i.features.length?i.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,i)=>{i.d(t,{BI:()=>g,D3:()=>f,XJ:()=>y,lc:()=>p,mX:()=>m,rU:()=>_,tH:()=>S});var r=i(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 g(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 _(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 S(t.expression)}return null}function m(e){let t;return e?(t=(0,r.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,I=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function S(e){if(!e)return null;let t=F.exec(e)||b.exec(e);return t?t[1]||t[3]:(t=I.exec(e),t?t[2]:null)}},32756:(e,t,i)=>{i.d(t,{Rr:()=>o,fY:()=>c,ne:()=>u});var r=i(31635),s=i(93637),n=i(10107),a=(i(44208),i(53966),i(87811),i(64108)),l=i(91880);function o(e,t,i){if(!e)return null;const r=e.find(e=>!!e.field);if(!r)return null;const s=new l.A;return s.read(r,i),[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,i,r){const n=e.find(e=>!!e.field);n&&(0,s.sM)(i,[n.toJSON()],t)}}}},c=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,r.Cg)([(0,n.MZ)(u)],i.prototype,"orderBy",void 0),i=(0,r.Cg)([(0,a.$)("esri.layers.mixins.OrderedLayer")],i),i}},33143:(e,t,i)=>{i.d(t,{A:()=>h});var r=i(31635),s=i(69540),n=i(25482),a=i(10107),l=(i(44208),i(53966),i(87811),i(36005)),o=i(64108),u=i(43937),c=i(80451),d=i(29005);let h=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const i of Object.keys(e))t[i]=(0,c.rS)(e[i]);return t}writeDomains(e,t){const i={};for(const t of Object.keys(e))e[t]&&(i[t]=e[t]?.toJSON());t.domains=i}};(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],h.prototype,"id",void 0),(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],h.prototype,"name",void 0),(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],h.prototype,"domains",void 0),(0,r.Cg)([(0,l.w)("domains")],h.prototype,"readDomains",null),(0,r.Cg)([(0,u.K)("domains")],h.prototype,"writeDomains",null),(0,r.Cg)([(0,a.MZ)({type:[d.A],json:{write:!0}})],h.prototype,"templates",void 0),h=(0,r.Cg)([(0,o.$)("esri.layers.support.FeatureType")],h)},35704:(e,t,i)=>{i.d(t,{A:()=>d});var r=i(87449),s=i(11221),n=i(89169),a=i(33325),l=i(80609),o=i(74887),u=i(88368),c=i(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 1===t?t:(t=this._idstates[e],void 0===t?2:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_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,i){const r=new n.A([],e,!1,null),s=Math.min(t,e.length);if(await(this._parent?._getFeatures(r,-1,s,i)),this._checkCancelled(i),null==this._whereClauseFunction){for(let t=0;t<s;t++){const i=this._parent?._featureFromCache(e[t]);!0===this.executeWhereClause(i)?this._idstates[e[t]]=0:this._idstates[e[t]]=1}return"success"}const a=[];for(let t=0;t<s;t++){const i=this._parent?._featureFromCache(e[t]);a.push(await this.executeWhereClauseDeferred(i))}for(let i=0;i<t;i++)!0===a[i]?this._idstates[e[i]]=0:this._idstates[e[i]]=1;return"success"}async _getFilteredSet(e,t,i,r,s){null!==this._whereClauseFunction||(null!==i?null!==this._whereclause&&(i=(0,l.kg)(this._whereclause,i)):i=this._whereclause),await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,r,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,i,r,s,n,a){if(null!==this._whereClauseFunction)return null===s&&""===i&&null===r?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,i,r,o,n,a);return!1===u.calculated?null===s&&""===i&&null===r?this._manualStat(e,t,n,a):{calculated:!1}:u}async _canDoAggregates(e,t,i,r,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,i,r,s))}async _getAggregatePagesDataSourceDefinition(e,t,i,s,n,a,o){if(null===this._parent)throw new r.d("NeverReach");return null!==n?null!==this._whereclause&&(n=(0,l.kg)(this._whereclause,n)):n=this._whereclause,this._parent._getAggregatePagesDataSourceDefinition(e,t,i,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()}}},37352:(e,t,i)=>{i.d(t,{A:()=>u});var r,s=i(31635),n=i(7762),a=i(25482),l=i(10107),o=(i(44208),i(53966),i(87811),i(64108));let u=r=class extends a.o{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new n.A}clone(){return new r({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,s.Cg)([(0,l.MZ)({type:String,json:{write:{isRequired:!0}}})],u.prototype,"floorField",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,s.Cg)([(0,l.MZ)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=r=(0,s.Cg)([(0,o.$)("esri.layers.support.LayerFloorInfo")],u)},37539:(e,t,i)=>{i.d(t,{pO:()=>y,jd:()=>h,Tp:()=>p,w5:()=>d});var r=i(34727),s=i(83047),n=i(73941),a=i(79258);Math.PI;const l=a.$O.radius,o=a.$O.eccentricitySquared,u={a1:l*o,a2:l*o*l*o,a3:l*o*o/2,a4:l*o*l*o*2.5,a5:l*o+l*o*o/2,a6:1-o};a.$O.radius,a.$O.flattening,a.Sw.radius,a.Sw.flattening,a.sH.radius,a.sH.flattening,a.sH.radius;var c=i(21325);const d={2:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:_,11:m,2:y,4:x},5:{5:y,7:null,9:null,10:y,1:S,6:null,8:null,0:null,3:_,11:m,2:y,4:x},7:{5:null,7:y,9:null,10:y,1:null,6:I,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:y,10:y,1:null,6:null,8:b,0:null,3:null,11:null,2:null,4:null},3:{5:g,7:null,9:null,10:g,1:function(e,t,i,r){const s=e[t]/M,n=N-2*Math.atan(Math.exp(-e[t+1]/M)),a=M+e[t+2],l=Math.cos(n)*a;i[r]=Math.cos(s)*l,i[r+1]=Math.sin(s)*l,i[r+2]=Math.sin(n)*a},6:null,8:null,0:null,3:y,11:function(e,t,i,r){g(e,t,i,r),m(i,r,i,r)},2:g,4:function(e,t,i,r){g(e,t,i,r),x(i,r,i,r)}},4:{5:R,7:null,9:null,10:R,1:function(e,t,i,r){R(e,t,i,r),S(i,r,i,r)},6:null,8:null,0:null,3:function(e,t,i,r){R(e,t,i,r),_(i,r,i,r)},11:function(e,t,i,r){R(e,t,i,r),m(i,r,i,r)},2:R,4:y},1:{5:C,7:null,9:null,10:C,1:y,6:null,8:null,0:null,3:function(e,t,i,r){C(e,t,i,r),_(i,r,i,r)},11:function(e,t,i,r){C(e,t,i,r),m(i,r,i,r)},2:C,4:function(e,t,i,r){C(e,t,i,r),x(i,r,i,r)}},6:{5:null,7:T,9:null,10:T,1:null,6:y,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:A,10:A,1:null,6:null,8:y,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:y,3:null,11:null,2:null,4:null},10:{5:y,7:y,9:y,10:y,1:S,6:I,8:b,0:null,3:_,11:m,2:y,4:x},11:{5:w,7:null,9:null,10:w,1:function(e,t,i,r){w(e,t,i,r),S(i,r,i,r)},6:null,8:null,0:null,3:function(e,t,i,r){w(e,t,i,r),_(i,r,i,r)},11:y,2:w,4:function(e,t,i,r){w(e,t,i,r),x(i,r,i,r)}}};function h(e,t){return p(e,t)?.projector}function p(e,t){if(null==e||null==t)return null;if(k.source.spatialReference===e&&k.dest.spatialReference===t)return k;const i=f(e,k.source),r=f(t,k.dest);return 0===i&&0===r?(0,c.aI)(e,t)?k.projector=y:k.projector=null:k.projector=d[i][r],k}function f(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,s.GA)(e,1)),(0,n.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===n.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===n.FY.wkt?t.spatialReferenceId=6:e.wkt===n.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function y(e,t,i,r){e!==i&&(i[r++]=e[t++],i[r++]=e[t++],i[r]=e[t])}function g(e,t,i,r){i[r]=L*(e[t]/M),i[r+1]=L*(N-2*Math.atan(Math.exp(-e[t+1]/M))),i[r+2]=e[t+2]}function _(e,t,i,s){!function(e,t,i,s,n){const a=.4999999*Math.PI,l=(0,r.qE)(D*e[t+1],-a,a),o=Math.sin(l);i[s++]=D*e[t]*n.radius,i[s++]=n.halfSemiMajorAxis*Math.log((1+o)/(1-o)),i[s]=e[t+2]}(e,t,i,s,a.$O)}function m(e,t,i,r){i[r]=e[t]*P,i[r+1]=e[t+1]*P,i[r+2]=e[t+2]}function w(e,t,i,r){i[r]=e[t]*O,i[r+1]=e[t+1]*O,i[r+2]=e[t+2]}function F(e,t,i,r,s){const n=s+e[t+2],a=D*e[t+1],l=D*e[t],o=Math.cos(a)*n;i[r]=Math.cos(l)*o,i[r+1]=Math.sin(l)*o,i[r+2]=Math.sin(a)*n}function b(e,t,i,r){F(e,t,i,r,a.Sw.radius)}function I(e,t,i,r){F(e,t,i,r,a.sH.radius)}function S(e,t,i,r){F(e,t,i,r,a.$O.radius)}function v(e,t,i,s,n){const a=e[t],l=e[t+1],o=e[t+2],u=Math.sqrt(a*a+l*l+o*o),c=(0,r.YN)(o/(0===u?1:u)),d=Math.atan2(l,a);i[s++]=L*d,i[s++]=L*c,i[s]=u-n}function A(e,t,i,r){v(e,t,i,r,a.Sw.radius)}function T(e,t,i,r){v(e,t,i,r,a.sH.radius)}function C(e,t,i,r){v(e,t,i,r,a.$O.radius)}function x(e,t,i,r){!function(e,t,i,r,s){const n=D*e[t],a=D*e[t+1],l=e[t+2],o=Math.sin(a),u=Math.cos(a),c=s.radius/Math.sqrt(1-s.eccentricitySquared*o*o);i[r++]=(c+l)*u*Math.cos(n),i[r++]=(c+l)*u*Math.sin(n),i[r++]=(c*(1-s.eccentricitySquared)+l)*o}(e,t,i,r,a.$O)}function R(e,t,i,r){const s=u,n=e[t],l=e[t+1],o=e[t+2];let c,d,h,p,f,y,g,_,m,w,F,b,I,S,v,A,T,C,x,R,k;c=Math.abs(o),d=n*n+l*l,h=Math.sqrt(d),p=d+o*o,f=Math.sqrt(p),R=Math.atan2(l,n),y=o*o/p,g=d/p,S=s.a2/f,v=s.a3-s.a4/f,g>.3?(_=c/f*(1+g*(s.a1+S+y*v)/f),x=Math.asin(_),w=_*_,m=Math.sqrt(1-w)):(m=h/f*(1-y*(s.a5-S-g*v)/f),x=Math.acos(m),w=1-m*m,_=Math.sqrt(w)),F=1-a.$O.eccentricitySquared*w,b=a.$O.radius/Math.sqrt(F),I=s.a6*b,S=h-b*m,v=c-I*_,T=m*S+_*v,A=m*v-_*S,C=A/(I/F+T),x+=C,k=T+A*C/2,o<0&&(x=-x),i[r++]=L*R,i[r++]=L*x,i[r]=k}const k={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:y},D=(0,r.kU)(1),L=(0,r.KJ)(1),N=.5*Math.PI,M=a.$O.radius,P=M*Math.PI/180,O=180/(M*Math.PI)},40334:(e,t,i)=>{i.r(t),i.d(t,{constructAssociationMetaDataFeatureSetFromUrl:()=>re,constructFeatureSet:()=>te,constructFeatureSetFromPortalItem:()=>ce,constructFeatureSetFromRelationship:()=>se,constructFeatureSetFromUrl:()=>ee,convertToFeatureSet:()=>ue,createFeatureSetCollectionFromMap:()=>le,createFeatureSetCollectionFromService:()=>oe,initialiseMetaDataCache:()=>H});var r=i(78888);class s{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,i){this._layerById[t]=i,this._layerByName[e]=i}async featureSetByName(e,t=!0,i=["*"]){return void 0===this._layerByName[e]?null:this._layerByName[e]}async featureSetById(e,t=!0,i=["*"]){return void 0===this._layerById[e]?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}}var n=i(78878),a=i(35704),l=i(52106),o=i(59534),u=i(68423),c=i(86691),d=i(87449),h=i(11221),p=i(89169),f=i(87594),y=i(33325),g=i(80609),_=i(1262),m=i(88368);class w{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new w;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,r){const s=new w;s.field=e;const n=m.A.create(t,{fieldsIndex:i,timeZone:r}),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 _.L("MissingStatisticParameters");const t=m.A.create((0,g.Mi)(e.parseTree.args.value[0],0,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 _.L("UnsupportedSqlFunction",{function:""});const l=a.name.toUpperCase().trim();if("MIN"===l){if(s.typeofstat="MIN",s.workingexpr=a.expr,null===n)throw new _.L("InvalidFunctionParameters",{function:"min"})}else if("MAX"===l){if(s.typeofstat="MAX",s.workingexpr=a.expr,null===n)throw new _.L("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 _.L("InvalidFunctionParameters",{function:"stdev"})}else if("SUM"===l){if(s.typeofstat="SUM",s.workingexpr=a.expr,null===n)throw new _.L("InvalidFunctionParameters",{function:"sum"})}else if("MEAN"===l){if(s.typeofstat="AVG",s.workingexpr=a.expr,null===n)throw new _.L("InvalidFunctionParameters",{function:l})}else if("AVG"===l){if(s.typeofstat="AVG",s.workingexpr=a.expr,null===n)throw new _.L("InvalidFunctionParameters",{function:"avg"})}else{if("VAR"!==l)throw new _.L("UnsupportedSqlFunction",{function:l});if(s.typeofstat="VAR",s.workingexpr=a.expr,null===n)throw new _.L("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 F=i(80200),b=i(74639),I=i(44729),S=i(55612),v=i(15032),A=i(16930),T=i(20437),C=i(95466);const x=new o.b(["MIN","MAX","VAR","STDDEV","COUNT","SUM","AVG"],[["VARIANCE","VAR"],["AVERAGE","AVG"],["MEAN","AVG"],["STDEV","STDDEV"]]);class R extends h.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 0}_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,i=1;const r=this._parent?this._parent.getFieldsIndex():new C.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"+i.toString(),i++)}for(const e of this._config.statsfields){const t=new w;t.field=e.name,t.tofieldname=e.name,t.workingexpr=e.expression instanceof m.A?e.expression:m.A.create(e.expression,{fieldsIndex:r,timeZone:this.dateFieldsTimeZoneDefaultUTC}),t.typeofstat=x.lookup(e.statistic)??"COUNT",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 m.A?e.expression:m.A.create(e.expression,{fieldsIndex:r,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=y.ik.point,this.typeIdField="",this.types=null,this.subtypes=null,this.subtypeField="",this.spatialReference=new A.A({wkid:4326});this.fields=[];const s=new w;s.field=this._nextUniqueName(e),s.tofieldname=this.objectIdField,s.workingexpr=m.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 i=new T.A;if(t.name=this._nextUniqueName(e),i.name=t.tofieldname,i.alias=i.name,(0,g.DA)(t.expression)){const e=this._parent.getField((0,g.YY)(t.expression,0));if(!e)throw new d.d("AggregationFieldNotFound");t.name=e.name,t.singlefield=e.name,this.phsyicalgroupbyfields.push(e.name),i.type=e.type,t.sqlType=e.type}else{i.type=this._convertToEsriFieldType((0,g.IY)(t.expression,this._parent.fields));const e=new T.A;e.name=t.name,e.alias=e.name,this.phsyicalgroupbyfields.push(t.name),this._adaptedFields.push(new u.Gr(e,t.expression)),this._candosimplegroupby=!1,t.sqlType=i.type}this.fields.push(i)}if(this._adaptedFields.length>0)for(const e of this._parent.fields)this._adaptedFields.push(new u.IO(e));for(let t=0;t<this._decodedStatsfield.length;t++){const i=new T.A;let r=null;const s=this._decodedStatsfield[t];s.field=this._nextUniqueName(e),s.tofieldname===this.objectIdField&&(this._internalObjectIdField=s.field),i.name=s.tofieldname,i.alias=i.name;const n=null!==s.workingexpr&&(0,g.DA)(s.workingexpr)?(0,g.YY)(s.workingexpr,0):"";switch(this._decodedStatsfield[t].typeofstat){case"SUM":if(""!==n){if(r=this._parent.getField(n),!r)throw new d.d("AggregationFieldNotFound");i.type=r.type}else i.type="double";break;case"MIN":case"MAX":if(""!==n){if(r=this._parent.getField(n),!r)throw new d.d("AggregationFieldNotFound");i.type=r.type}else i.type="double";break;case"COUNT":i.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==n&&(r=this._parent.getField(n),!r))throw new d.d("AggregationFieldNotFound");i.type="double"}this.fields.push(i)}}async _canDoAggregates(){return!1}async _getFeatures(e,t,i,r){-1!==t&&this._featureCache[t];const s=this._maxQuery;return!0===this._checkIfNeedToExpandKnownPage(e,s)?(await this._expandPagedSet(e,s,0,0,r),this._getFeatures(e,t,i,r)):"success"}async _getFilteredSet(e,t,i,r,s){if(""!==e)return new p.A([],[],!0,null);let n=null;const l={ordered:!1,nowhereclause:!1};if(await this._ensureLoaded(),null!==i)for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===(0,g.Ju)(i,this._decodedStatsfield[e].tofieldname)){l.nowhereclause=!0,i=null;break}if(null!==r){l.ordered=!0;for(let e=0;e<this._decodedStatsfield.length;e++)if(!0===r.scanForField(this._decodedStatsfield[e].tofieldname)){r=null,l.ordered=!1;break}if(null!==r)for(const e of this._decodedGroupbyfield)if(null===e.singlefield&&!0===r.scanForField(e.tofieldname)){r=null,l.ordered=!1;break}}if(!1!==this._candosimplegroupby&&await this._parent._canDoAggregates(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,null)){let e=null;i&&(e=this._reformulateWhereClauseWithoutGroupByFields(i));let t=null;r&&(t=this._reformulateOrderClauseWithoutGroupByFields(r));const a=await this._parent._getAggregatePagesDataSourceDefinition(this.phsyicalgroupbyfields,this._decodedStatsfield,"",null,e,t,this._internalObjectIdField);return this._checkCancelled(s),n=!0===l.nowhereclause?new p.A(a._candidates.slice().concat(a._known.slice()),[],!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)):new p.A(a._candidates.slice(),a._known.slice(),!0===l.ordered&&a._ordered,this._clonePageDefinition(a.pagesDefinition)),n}let o=this._parent;if(this._adaptedFields.length>0&&(o=new u.a({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),!0===l.nowhereclause)n=new p.A(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new c.A({parentfeatureset:o,orderbyclause:new f.A(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let e=o;if(null!==i){let t=null;i&&(t=this._reformulateWhereClauseWithoutGroupByFields(i)),e=new a.A({parentfeatureset:e,whereclause:t})}n=new p.A(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new c.A({parentfeatureset:e,orderbyclause:new f.A(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return n}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=(0,g.bD)(e,t.tofieldname,(0,g.YY)(t.workingexpr,0),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=(0,g.bD)(e,t.tofieldname,(0,g.YY)(t.expression,0),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,i){return!0===this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getPhysicalPage(e,t,i){if(!0===e.pagesDefinition.aggregatefeaturesetpagedefinition)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const e of r){const t={geometry:e.geometry,attributes:{}},i={};for(const t in e.attributes)i[t.toLowerCase()]=e.attributes[t];for(const e of this._decodedGroupbyfield)t.attributes[e.tofieldname]=i[e.name.toLowerCase()];for(const e of this._decodedStatsfield)t.attributes[e.tofieldname]=i[e.field.toLowerCase()];this._featureCache[t.attributes[this.objectIdField]]=new l.A(t)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise((s,n)=>{null===e.pagesDefinition.internal.iterator&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),!0===e.pagesDefinition.internal.fullyResolved||0===t?s(r.length):this._nextAggregateItem(e,t,i,r,n=>{null===n?s(r.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,i,r)))},n)})}_nextAggregateItem(e,t,i,r,s,a){try{(0,n.a2)(e.pagesDefinition.internal.iterator.next()).then(n=>{if(null===n)if(null!==e.pagesDefinition.internal.workingItem){const t=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.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 i=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(i),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(i.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void s(i)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,r,s,a)}},a)}catch(e){a(e)}}_calculateFieldStat(e,t,i){const r=[];for(const i of e.features)if(null!==t.workingexpr){const e=t.workingexpr.calculateValue(i);null!==e&&(e instanceof I.n||e instanceof v.k?r.push(e.toNumber()):e instanceof S.g?r.push(e.toMilliseconds()):r.push(e))}else r.push(null);i.attributes[t.tofieldname]=(0,b.s)(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.features[0].attributes[i.singlefield]:m.A.convertValueToStorageFormat(i.expression.calculateValue(e.features[0]),i.sqlType);t.attributes[i.tofieldname]=r}for(const i of this._decodedStatsfield)this._calculateFieldStat(e,i,t);const i=[];for(let r=0;r<this._decodedStatsfield.length;r++)i.push(this._calculateFieldStat(e,this._decodedStatsfield[r],t));return this._featureCache[t.attributes[this.objectIdField]]=new l.A({attributes:t.attributes,geometry:t.geometry}),t}_generateAggregateHash(e){let t="";for(const i of this._decodedGroupbyfield){const r=i.singlefield?e.attributes[i.singlefield]:i.expression.calculateValue(e);t+=null==r?":":":"+r.toString()}return(0,F.d)(t,F.T.String)}async _stat(){return{calculated:!1}}async getFeatureByObjectId(){return null}static registerAction(){h.A._featuresetFunctions.groupby=function(e,t){return new R({parentfeatureset:this,groupbyfields:e,statsfields:t})}}}var k=i(54784),D=i(54461),L=i(70333),N=i(61454),M=i(66395),P=i(50145),O=i(4576),j=i(39516),E=i(65864),G=i(21325),q=i(68654),Z=i(54546),U=i(61956),B=i(7562);class W extends h.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 y.gO}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+(0,y.JB)(e.toJSON());return(0,F.d)(t,F.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 i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.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=1,null!=e&&e>=10.61&&(this._databaseType=0)):null!=e&&(e>=10.5&&(this._databaseType=1,this._requestStandardised=!0),e>=10.61&&(this._databaseType=0))}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 0}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 i="execute"===t?this._layer.queryFeatures.bind(this._layer):"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let r=null;if(this.recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(t),null===r&&(r=i(e),this.recentlyUsedQueries.addToCache(t,r),r=r.catch(e=>{throw this.recentlyUsedQueries?.removeFromCache(t),e}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===r&&(r=i(e)),r}async _getFilteredSet(e,t,i,r,s){const n=await this.databaseType();if(this.isTable()&&t&&null!==e&&""!==e)return new p.A([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,r,s);let a="",l=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(a=r.constructClause(),l=!0);const o=this._createQuery();o.where=(0,j.mA)(o.where,null===i?null===t?"1=1":"":(0,g.YY)(i,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 p.A([],u,l,null)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getFilteredSetUsingPaging(e,t,i,r,s){let n="",a=!1;null!==r&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(n=r.constructClause(),a=!0);const l=await this.databaseType(),o=null===i?null===t?"1=1":"":(0,g.YY)(i,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 p.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 i=!0;!0===this._removeGeometry&&(i=!1);const r=this._overrideFields??this._fieldsIncludingObjectId(["*"]);d=new p.A([],["GETPAGES"],a,{spatialRel:this._makeRelationshipEnum(e),relationParam:this._makeRelationshipParam(e),outFields:r.join(","),resultRecordCount:u,resultOffset:0,geometry:null===t?null:t,where:o,orderByFields:n,returnGeometry:i,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,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,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,j.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(i),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=r+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 i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}async _getFeatures(e,t,i,r){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,r),this._getFeatures(e,t,i,r);let n=0;for(let r=e._lastFetchedIndex;r<e._known.length;r++){if(e._lastFetchedIndex+=1,n++,void 0===this._featureCache[e._known[r]]){let i=!1;if(null!==this._layer._mode&&void 0!==this._layer._mode){const t=this._layer._mode;if(void 0!==t._featureMap[e._known[r]]){const s=t._featureMap[e._known[r]];null!==s&&(i=!0,this._featureCache[e._known[r]]=s)}}if(!1===i&&(e._known[r]!==t&&s.push(e._known[r]),s.length>=this._maxProcessingRate()-1))break}if(n>=i&&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(r),void 0!==l.error)throw new d.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,i,r,s,n,a,l,o){await this._ensureLoaded();const u=await this.databaseType();let c=i.parseTree.column;const h=this._layer.fields??[];for(let e=0;e<h.length;e++)if(h[e].name.toLowerCase()===c.toLowerCase()){c=h[e].name;break}const p=this._createQuery();p.where=(0,j.mA)(p.where,null===n?null===s?"1=1":"":(0,g.YY)(n,u)),p.spatialRelationship=this._makeRelationshipEnum(r),p.relationParameter=this._makeRelationshipParam(r),p.geometry=null===s?null:s,p.returnDistinctValues=!0,p.returnGeometry=!1,p.outFields=[c];const f=await this.executeQuery(p,"execute");if(this._checkCancelled(o),!f.hasOwnProperty("features"))throw new d.d("InvalidStatResponse");let y=!1;for(let e=0;e<h.length;e++)if(h[e].name===c){"date"===h[e].type&&(y=!0);break}for(let e=0;e<f.features.length;e++){if(y){const t=f.features[e].attributes[c];null!==t?l.push(new Date(t)):l.push(t)}else l.push(f.features[e].attributes[c]);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,i,r,s,n,a,l,o)}:l}async _distinctStat(e,t,i,r,s,n,a){return{calculated:!0,result:await this._getDistinctPages(0,e,t,i,r,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,i,r){const s=await this.databaseType();if(this.isTable()&&i&&null!==t&&""!==t)return{calculated:!0,result:0};const n=this._createQuery();return n.where=(0,j.mA)(n.where,null===r?null===i?"1=1":"":(0,g.YY)(r,s)),n.spatialRelationship=this._makeRelationshipEnum(t),n.relationParameter=this._makeRelationshipParam(t),n.geometry=null===i?null:i,n.returnGeometry=!1,{calculated:!0,result:await this.executeQuery(n,"executeForCount")}}async _stats(e,t,i,r,s,n,a){await this._ensureLoaded();const l=this._layer.capabilities?.query,o=!!l?.supportsSqlExpression,u=!!l?.supportsStatistics,c=!!l?.supportsDistinct;if("count"===e)return c?this._countstat(e,i,r,s):{calculated:!1};if(!1===u||!1===(0,g.DA)(t)&&!1===o||!1===t.isStandardized)return""!==i||null!==s?{calculated:!1}:this._manualStat(e,t,n,a);if("distinct"===e)return!1===c?""!==i||null!==s?{calculated:!1}:this._manualStat(e,t,n,a):this._distinctStat(e,t,i,r,s,n,a);const h=await this.databaseType();if(this.isTable()&&r&&null!==i&&""!==i)return{calculated:!0,result:null};const p=this._createQuery();p.where=(0,j.mA)(p.where,null===s?null===r?"1=1":"":(0,g.YY)(s,h)),p.spatialRelationship=this._makeRelationshipEnum(i),p.relationParameter=this._makeRelationshipParam(i),p.geometry=null===r?null:r;const f=new B.A;f.statisticType=(0,P.Dp)(e),f.onStatisticField=(0,g.YY)(t,h),f.outStatisticFieldName="ARCADE_STAT_RESULT",p.returnGeometry=!1;let y="ARCADE_STAT_RESULT";p.outStatistics=[f];const _=await this.executeQuery(p,"execute");if(!_.hasOwnProperty("features")||0===_.features.length)throw new d.d("InvalidStatResponse");let m=!1;const w=_.fields??[];for(let e=0;e<w.length;e++)if("ARCADE_STAT_RESULT"===w[e].name.toUpperCase()){y=w[e].name,"date"===w[e].type&&(m=!0);break}if(m){let e=_.features[0].attributes[y];return null!==e&&(e=new Date(_.features[0].attributes[y])),{calculated:!0,result:e}}return{calculated:!0,result:_.features[0].attributes[y]}}_stat(e,t,i,r,s,n,a){return this._stats(e,t,i,r,s,n,a)}async _canDoAggregates(e,t){await this._ensureLoaded();let i=!1;const r=this._layer.capabilities?.query,s=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(i=!0),i)for(let e=0;e<t.length-1;e++)(!1===t[e].workingexpr?.isStandardized||!1===(0,g.DA)(t[e].workingexpr)&&!1===s)&&(i=!1);return!1!==i}_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,i,r,s,n,a){await this._ensureLoaded();const l=await this.databaseType();let o=null;if(!this._layer.capabilities.query.supportsPaginationOnAggregatedQueries){const t=this.getFieldsIndex();o={keyFields:e.map((e,i)=>({name:t.normalizeFieldName(e)??e,asc:null==n||1===n._directions[i]}))}}let u="",c=!1;null!=n&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(null==o||(0,O.MJ)(e,0,e.length,n._fields,0,Math.min(n._fields.length,e.length),(e,t)=>e.toLowerCase()===t.toLowerCase()))&&(u=n.constructClause(),c=!0),""===u&&(u=e.join(","));const d=[];for(let e=0;e<t.length;e++){const i=new B.A;i.onStatisticField=null!==t[e].workingexpr?(0,g.YY)(t[e].workingexpr,l):"",i.outStatisticFieldName=t[e].field,i.statisticType=t[e].toStatisticsName(),d.push(i)}let h=this._maxQueryRate();const f=this._layer.capabilities?.query.maxRecordCount;null!=f&&f<h&&(h=f);const y=null===s?null===r?"1=1":"":(0,g.YY)(s,l);return new p.A([],["GETPAGES"],c,{groupbypage:!0,spatialRel:this._makeRelationshipEnum(i),relationParam:this._makeRelationshipParam(i),outFields:["*"],useOIDpagination:!1,generatedOid:a,resultRecordCount:h,resultOffset:0,groupByFieldsForStatistics:e,outStatistics:d,geometry:null===r?null:r,where:y,orderByFields:u,returnGeometry:!1,returnIdsOnly:!1,internal:{lastMaxId:-1,set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1,keysetPagination:o}})}async _getAgregagtePhysicalPage(e,t,i){let r=e.pagesDefinition.where;if(!0===e.pagesDefinition.useOIDpagination&&(r=(0,j.mA)(r,e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString())),null!=e.pagesDefinition.internal.keysetPagination?.clause){if(!this._layer.capabilities.query.supportsOrderBy)throw new d.d("NotImplemented");r=(0,j.mA)(r,(0,g.YY)(e.pagesDefinition.internal.keysetPagination.clause,await this.databaseType()))}const s=e.pagesDefinition.internal.lastRetrieved,n=s,a=e.pagesDefinition.internal.lastPage,o=this._createQuery();if(o.where=(0,j.mA)(o.where,r),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(i),!u.hasOwnProperty("features"))throw new d.d("InvalidStatResponse");const c=[];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++)c.push(new l.A({attributes:u.features[e].attributes,geometry:null}));return e.pagesDefinition.internal.keysetPagination?0!==u.features.length&&u.exceededTransferLimit?function(e,t){null==e.clause&&(e.clause=function(e){if(0===e.length)throw new d.d("NeverReach");const t=[];for(let i=0;i<e.length;i++){const r=e[i],s=[`"${r.name.replaceAll('"','""')}" ${r.asc?">":"<"} @last_${i}`];for(let t=0;t<i;t++){const i=e[t];s.push(`"${i.name.replaceAll('"','""')}" = @last_${t}`)}t.push(s.join(" AND "))}const i=t.join(" OR ");return m.A.create(i)}(e.keyFields));for(let i=0;i<e.keyFields.length;i++){const r=e.keyFields[i].name;e.clause.parameters[`last_${i}`]=t.attributes[r]}}(e.pagesDefinition.internal.keysetPagination,c.at(-1)):e.pagesDefinition.internal.fullyResolved=!0:!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,c}static create(e,t,i,r,s){const n=new q.default({url:e,outFields:null===t?["*"]:t});return new W({layer:n,spatialReference:i,lrucache:r,interceptor:s})}relationshipMetaData(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return(0,y.Qi)(this._layer.parsedUrl.path)}async queryAttachments(e,t,i,r,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||i&&i>0)&&(a.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(a.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:n,query:a,method:"attachments"});const l=await n.queryAttachments(new Z.A(a)),o=[];return l&&l[e]&&l[e].forEach(t=>{const i=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+t.id.toString();let r=null;s&&t.exifInfo&&(r=M.A.convertJsonToArcade(t.exifInfo,"system",!0)),o.push(new N.A(t.id,t.name,t.contentType,t.size,i,r,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,G.YX)(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await(0,r.A)(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const e={},t=i.data;if(t?.relatedRecordGroups){const i=t.spatialReference;for(const r of t.relatedRecordGroups){const s=r.objectId,n=[];for(const e of r.relatedRecords){e.geometry&&(e.geometry.spatialReference=i);const t=new l.A({geometry:e.geometry?(0,E.rS)(e.geometry):null,attributes:e.attributes});n.push(t)}e[s]={features:n,exceededTransferLimit:!0===t.exceededTransferLimit}}}return e}throw new d.d("InvalidRequest")}async getFeatureByObjectId(e,t){const i=this._createQuery();i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=(0,j.mA)(i.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await this._layer.queryFeatures(i);return 1===r.features.length?r.features[0]:null}async getIdentityUser(){await this.load();const e=L.id?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=L.id?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.slice(0,i):t,t){t+="/rest/info";try{const e=await(0,r.A)(t,{query:{f:"json"}});let i="";return e.data?.owningSystemUrl&&(i=e.data.owningSystemUrl),i}catch(e){return""}}return""}getDataSourceFeatureSet(){const e=new W({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 i=this._layer.parsedUrl?.path??null;if(i){const s=await(0,r.A)(i,{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:""===i?null:i,webMapLayerId:s?this._layer.id??null:null,webMapLayerTitle:s?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}var V=i(30235),$=i(26591);class Q extends h.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 y.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 i of this.fields)if("oid"===i.type)e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.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 0}_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 i of this.fields)t[i.name]=e.attributes[i.name];return new l.A({geometry:!0===this._removeGeometry?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){if(await this.databaseType(),this.isTable()&&t&&null!==e&&""!==e)return new p.A([],[],!0,null);const n=this._layer.nativeCapabilities();if(!1===n.canQueryRelated)return new p.A([],[],!0,null);if(n.capabilities?.queryRelated.supportsPagination)return this._getFilteredSetUsingPaging(e,t,i,r,s);let a="",l=!1;null!==r&&!0===n.capabilities?.queryRelated.supportsOrderBy&&(a=r.constructClause(),l=!0);const o=new $.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 h=d[this._findObjectId]?d[this._findObjectId].features:[],f=[];for(let e=0;e<h.length;e++)this._featureCache[h[e].attributes[this._relatedLayer.objectIdField]]=h[e],f.push(h[e].attributes[this._relatedLayer.objectIdField]);const y=t&&null!==e&&""!==e,g=null!=i;return new p.A(y||g?f:[],y||g?[]:f,l,null)}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let i=!1;for(const e of t)if(e.toUpperCase()===this.objectIdField.toUpperCase()){i=!0;break}return!1===i&&t.push(this.objectIdField),t}async _getFilteredSetUsingPaging(e,t,i,r,s){let n="",a=!1;const l=this._layer.nativeCapabilities();null!==r&&!0===l.capabilities?.queryRelated.supportsOrderBy&&(n=r.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!=i;let h=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 h=new p.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(h,o,0,0,s),h}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,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,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,n=e.pagesDefinition.internal.lastPage,a=this._layer.nativeCapabilities(),l=new $.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(i),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=r+u.length,e.pagesDefinition.internal.lastPage+=e.pagesDefinition.resultRecordCount,u.length}async _getFeatures(e,t,i,r){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,r),this._getFeatures(e,t,i,r);let a=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(a++,a<=i&&(e._lastFetchedIndex+=1),!("GETPAGES"!==e._known[r]&&void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&s.push(e._known[r]),s.length>i)))&&!(a>=i&&0===s.length);r++);if(0===s.length)return"success";throw new d.d("MissingFeatures")}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,s,n,a){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this._relatedLayer.queryAttachments(e,t,i,r,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 z=i(23732),J=i(92474),Y=i(4146),K=i(80812);function H(){null===z.A.applicationCache&&(z.A.applicationCache=new z.A)}async function X(e,t,i){if(z.A.applicationCache){const i=z.A.applicationCache.getLayerInfo(e);if(i){const r=await i;return new q.default({url:e,outFields:t,sourceJSON:r})}const r=new q.default({url:e,outFields:t}),s=(async()=>(await r.load(),r.sourceJSON))();if(z.A.applicationCache){z.A.applicationCache.setLayerInfo(e,s);try{return await s,r}catch(t){throw z.A.applicationCache.clearLayerInfo(e),t}}return await s,r}if(null!=i){const r=i.getCachedLayerMetadata(e);if(r){const i=await r;return new q.default({url:e,outFields:t,sourceJSON:i})}const s=new q.default({url:e,outFields:t}),n=(async()=>(await s.load(),s.sourceJSON))();i.setCachedLayerMetadata(e,n);try{return await n,s}catch(t){throw i.removeCachedLayerMetadata(e,n),t}}return new q.default({url:e,outFields:t})}async function ee(e,t,i,r,s,n=null){return te(await X(e,["*"],s),t,i,r,s,n)}function te(e,t=null,i=null,r=!0,s=null,n=null){switch(e.type){case"catalog-footprint":return te(e.parent,t,i,r,s,n);case"subtype-sublayer":{const a=te(e.parent,t,i,r,s,n);return a.filter(m.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 V.A({layer:e,spatialReference:t,outFields:i,includeGeometry:r,lrucache:s,interceptor:n});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:e,spatialReference:t,outFields:i,includeGeometry:r,lrucache:s,interceptor:n};return!e.url&&e.source?new V.A(a):new W(a)}default:throw new Error(`Unsupported layer type: ${e.type}`)}}async function ie(e,t){if(null!==z.A.applicationCache){const t=z.A.applicationCache.getLayerInfo(e);if(null!==t)return t}if(null!=t){const i=t.getCachedServiceMetadata(e);if(null!=i)return i}const i=(async()=>{const t=await(0,r.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!==z.A.applicationCache){z.A.applicationCache.setLayerInfo(e,i);try{return await i}catch(t){throw z.A.applicationCache.clearLayerInfo(e),t}}if(null!=t){t.setCachedServiceMetadata(e,i);try{return await i}catch(r){throw t.removeCachedServiceMetadata(e,i),r}}return i}async function re(e,t,i){const s={metadata:null,networkId:-1,unVersion:3,terminals:[],layerIdLookup:new Map,sourceIdLookup:new Map,queryelem:null,layerNameLkp:{},lkp:null},n=await ie(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 i="QUERYDATAELEMTS:"+t.toString()+":"+e;if(null!==z.A.applicationCache){const e=z.A.applicationCache.getLayerInfo(i);if(null!==e)return e}const s=(async()=>{const i=await(0,r.A)(e+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([t.toString()]),f:"json"}});if(i.data){const e=i.data;if(e.layerDataElements?.[0])return e.layerDataElements[0]}throw new d.d("DataElementsNotFound")})();if(null!==z.A.applicationCache){z.A.applicationCache.setLayerInfo(i,s);try{return await s}catch(e){throw z.A.applicationCache.clearLayerInfo(i),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!==z.A.applicationCache){const t=z.A.applicationCache.getLayerInfo(e);if(null!==t)return t}const t=(async()=>{const t=await(0,r.A)(e,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(null!==z.A.applicationCache){z.A.applicationCache.setLayerInfo(e,t);try{return await t}catch(t){throw z.A.applicationCache.clearLayerInfo(e),t}}return t}(e+"/"+a);if(void 0!==n.systemLayers?.associationsTableId&&null!==n.systemLayers.associationsTableId){let r=null;if(i&&s.unVersion<8){const i=[];s.unVersion>=4&&(i.push("STATUS"),i.push("PERCENTALONG")),r=await ee(e+"/"+n.systemLayers.associationsTableId,t,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...i],!1,null,null),await r.load(),s.unVersion>=4&&(r=r.filter(m.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:r.getFieldsIndex(),timeZone:r.dateFieldsTimeZoneDefaultUTC})),await r.load())}return{lkp:s.lkp,associations:r,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 se(e,t,i,r=null,s=null,n=!0,a=null,l=null){let o=e.serviceUrl();if(!o)return null;o=o.endsWith("/")?o+t.relatedTableId.toString():o+"/"+t.relatedTableId.toString();const u=await ee(o,r,s,n,a,l);return new Q({layer:e,relatedLayer:u,relationship:t,objectId:i,spatialReference:r,outFields:s,includeGeometry:n,lrucache:a,interceptor:l})}a.A.registerAction(),R.registerAction(),c.A.registerAction(),k.A.registerAction(),D.A.registerAction();class ne extends s{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=te(e,this._overrideSpatialReference,null===i?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if((0,J.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.title===e&&s.includeGeometry===t&&s.outFields===r)return this._instantLayers[i].featureset}const s=this._map.allLayers.find(t=>(0,y.eB)(t)&&t.title===e);if(null!=s)return this._makeAndAddFeatureSet(s,t,i);if(this._map.allTables){const r=this._map.allTables.find(t=>(0,y.eB)(t)&&t.title===e);if(null!=r)return this._makeAndAddFeatureSet(r,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){if((0,J.Zm)(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.id===e&&s.includeGeometry===t&&s.outFields===r)return this._instantLayers[i].featureset}const s=this._map.allLayers.find(t=>(0,y.eB)(t)&&t.id===e);if(s)return this._makeAndAddFeatureSet(s,t,i);if(this._map.allTables){const r=this._map.allTables.find(t=>(0,y.eB)(t)&&t.id===e);if(null!=r)return this._makeAndAddFeatureSet(r,t,i)}return null}}class ae extends s{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=te(e,this._overrideSpatialReference,null===i?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await ie(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ae(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.title===e&&s.includeGeometry===t&&s.outFields===r)return this._instantLayers[i].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 X(this._url+"/"+n.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){null===i&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);e=null!=e?e.toString():"";for(let i=0;i<this._instantLayers.length;i++){const s=this._instantLayers[i];if(s.opitem.id===e&&s.includeGeometry===t&&s.outFields===r)return this._instantLayers[i].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 X(this._url+"/"+n.id,["*"],this._lrucache);return this._makeAndAddFeatureSet(e,t,i)}return null}}function le(e,t,i=null,r=null){return new ne(e,t,i,r)}function oe(e,t,i=null,r=null){return new ae(e,t,i,r)}function ue(e,t,i,r,s){if(null===e)return null;if((0,n.m)(e)){switch(t){case"datasource":return e.getDataSourceFeatureSet();case"parent":return e;case"root":return e.getRootFeatureSet()}return null}if(e instanceof Y.A&&(0,y.NI)(e)){const n=e;switch(t){case"datasource":return te(n,s,"outFields"in n?n.outFields:null,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return te(n,s,"outFields"in n?n.outFields:null,!0,i,r)}return null}if((0,n.a1)(e)){switch(t){case"datasource":return te(e.parent,s,e.parent.outFields,!0,i,r).getDataSourceFeatureSet();case"parent":case"root":return te(e,s,e.parent.outFields,!0,i,r)}return null}return null}async function ce(e,t,i,r,s,n,a,l=null){if(z.A.applicationCache){const o=z.A.applicationCache.getLayerInfo(e+":"+n.url);if(o)return de(await o,t,i,r,s,a,l)}if(null!=a){const o=a.getCachedPortalItem(n.url,e);if(null!=o)return await de(await o,t,i,r,s,a,l)}const o=new K.default({id:e,portal:n}).load();z.A.applicationCache?z.A.applicationCache.setLayerInfo(e+":"+n.url,o):null!=a&&a.setCachedPortalItem(n.url,e,o);try{return await de(await o,t,i,r,s,a,l)}catch(t){throw z.A.applicationCache&&z.A.applicationCache.clearLayerInfo(e+":"+n.url),null!=a&&a.removeCachedPortalItem(n.url,e,o),t}}async function de(e,t,i,r,s,n,a){let l;if("Feature Service"===e.type||"Map Service"===e.type)l=await X((0,y.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=Y.A.fromPortalItem(e);n.setCachedPortalItemLayer(e.portal.url,e.id,t);try{l=await t}catch(i){throw n.removeCachedPortalItemLayer(e.portal.url,e.id,t),i}}}else l=await Y.A.fromPortalItem(e)}return te(l,i,r,s,n,a)}},41366:(e,t,i)=>{i.d(t,{K:()=>h,Q:()=>u});var r=i(31635),s=i(66552),n=i(53966),a=i(10107),l=(i(44208),i(87811),i(93223)),o=i(64108);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=>{const t=e;let i=class extends t{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,i=null!=this.normalizationTotal;return t||i?(e=t&&d||i&&c||null,t&&i&&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,r.Cg)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),(0,r.Cg)([(0,l.e)(u,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=(0,r.Cg)([(0,o.$)("esri.rest.support.NormalizationBinParametersMixin")],i),i}},41560:(e,t,i)=>{i.d(t,{Ch:()=>a,mW:()=>n});var r=i(34727),s=i(39516);function n(e,t){return{...t,filterMode:e.mode}}function a(e,t,i){const n=function(e){if("manual"===u(e))return null;const t=[Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY];for(const{minScale:i,maxScale:r}of e.filters)t[0]=Math.max(t[0],c(i)),t[1]=Math.min(t[1],d(r));return t}(e);if(n&&((0,r.gg)(t,n[0])||(0,r.ZH)(i,n[1])))return"";const a=Array.from(l(e,t,i)),o=function(e,t,i){if(0===e.length)return!0;const s=c(e.at(0)?.minScale),n=d(e.at(-1)?.maxScale);if((0,r.ZH)(s,t)||(0,r.gg)(n,i))return!0;for(let t=0;t<e.length-1;t++){const i=e[t],s=e[t+1];if((0,r.ZH)(c(s.minScale),d(i.maxScale)))return!0}return!1}(a,t,i)?"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,i){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 r of e.filters)o(r.minScale,r.maxScale,t,i)&&(yield r)}}function o(e,t,i,s){return e=c(e),i=c(i),t=d(t),!(!(0,r.Sp)(i,e)&&(s??i)>e||(0,r.Hx)(t,i)||void 0!==s&&(0,r.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}},45067:(e,t,i)=>{i.d(t,{A:()=>d});var r=i(31635),s=i(69540),n=i(66552),a=i(25482),l=i(10107),o=(i(44208),i(53966),i(87811),i(64108));const u=new n.J({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),c=new n.J({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let d=class extends((0,s.OU)(a.o)){constructor(e){super(e),this.cardinality=null,this.catalogId=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};(0,r.Cg)([(0,l.MZ)({json:{read:u.read,write:u.write}})],d.prototype,"cardinality",void 0),(0,r.Cg)([(0,l.MZ)({json:{name:"catalogID"}})],d.prototype,"catalogId",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"composite",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"id",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyField",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyFieldInRelationshipTable",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"name",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"relatedTableId",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:!0,write:!0}})],d.prototype,"relationshipTableId",void 0),(0,r.Cg)([(0,l.MZ)({json:{read:c.read,write:c.write}})],d.prototype,"role",void 0),d=(0,r.Cg)([(0,o.$)("esri.layers.support.Relationship")],d)},46140:(e,t,i)=>{i.d(t,{R:()=>s});var r=i(49186);let s=class e{constructor(e,t,i=""){this.major=e,this.minor=t,this._context=i}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+":",i=this._context&&this._context+" ";throw new r.A(t+"unsupported-version",`Required major ${i}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,i=""){const[s,n]=t.split("."),a=/^\s*\d+\s*$/;if(!s?.match||!a.test(s))throw new r.A((i&&i+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!n?.match||!a.test(n))throw new r.A((i&&i+":")+"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,i)}}},50498:(e,t,i)=>{i.d(t,{Ye:()=>d,gy:()=>c,yR:()=>h});var r=i(66552),s=i(5443),n=i(91075),a=i(48526),l=i(86738),o=i(39829),u=i(82799);const c=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),d=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),h={base:n.A,key:"type",typeMap:{extent:s.A,multipoint:a.A,point:l.A,polyline:u.A,polygon:o.A}}},52106:(e,t,i)=>{i.d(t,{A:()=>I});var r,s=i(31635),n=i(37838),a=i(69540),l=i(51447),o=i(25482),u=i(53966),c=i(36708),d=i(24326),h=i(10107),p=(i(44208),i(87811),i(64108)),f=i(12195),y=i(65864),g=i(50498),_=i(55156),m=i(60950),w=i(54339),F=i(33910);function b(e){if(null==e)return null;const t={};for(const i in e){const r=e[i];r&&(t[i]=r.toJSON())}return 0!==Object.keys(t).length?t:null}let I=class extends((0,a.OU)(o.o)){static{r=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,d.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,l.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new r({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=(0,m.E_)(this.origin);if(t)return t.popupTemplate??(e?t.defaultPopupTemplate:null)??null;const i=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const t of[i,this.sourceLayer,this.layer])if(t&&"object"==typeof t){if("popupTemplate"in t&&t.popupTemplate)return t.popupTemplate;if(e&&"defaultPopupTemplate"in t&&null!=t.defaultPopupTemplate)return t.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const i=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",i,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=(0,_.I)(this.origin);if(e)return(0,w.r)(this,e);const t=this.sourceLayer??this.layer;return t?(0,w.r)(this,t):null}getGlobalId(){const e=(0,_.I)(this.origin);if(e?.globalIdField)return this.getAttribute(e.globalIdField);const t=this.sourceLayer??this.layer;return t&&"globalIdField"in t&&t.globalIdField?this.getAttribute(t.globalIdField):null}toJSON(){return{aggregateGeometries:b(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,f.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const i={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",i,i,e.action)}}_notifyLayer(e,t,i,r){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const s={graphic:this,property:e,oldValue:t,newValue:i};"origin-transform"===e&&(s.action=r),"attributes"===e&&(s.attributeName=r),this.layer.graphicChanged(s)}_watchMeshGeometryChanges(){this.addHandles([(0,c.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,c.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,s.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const i in e){const r=(0,y.rS)(e[i]);r&&(t[i]=r)}return 0!==Object.keys(t).length?t:null}}})],I.prototype,"aggregateGeometries",null),(0,s.Cg)([(0,h.MZ)({value:null})],I.prototype,"attributes",null),(0,s.Cg)([(0,h.MZ)({value:null,types:g.yR,json:{read:y.rS}})],I.prototype,"geometry",null),(0,s.Cg)([(0,h.MZ)({type:Boolean})],I.prototype,"isAggregate",void 0),(0,s.Cg)([(0,h.MZ)({clonable:!1})],I.prototype,"layer",void 0),(0,s.Cg)([(0,h.MZ)({clonable:"reference"})],I.prototype,"origin",void 0),(0,s.Cg)([(0,h.MZ)({type:n.A,value:null})],I.prototype,"popupTemplate",null),(0,s.Cg)([(0,h.MZ)({clonable:"reference"})],I.prototype,"sourceLayer",void 0),(0,s.Cg)([(0,h.MZ)({value:null,types:F.Es})],I.prototype,"symbol",null),(0,s.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],I.prototype,"_version",void 0),(0,s.Cg)([(0,h.MZ)({type:Boolean,value:!0})],I.prototype,"visible",null),I=r=(0,s.Cg)([(0,p.$)("esri.Graphic")],I)},52136:(e,t,i)=>{i.d(t,{p:()=>a});var r=i(31635),s=i(10107),n=(i(44208),i(53966),i(87811),i(64108));const a=e=>{const t=e;let i=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,r.Cg)([(0,s.MZ)({type:String})],i.prototype,"apiKey",null),i=(0,r.Cg)([(0,n.$)("esri.layers.mixins.APIKeyMixin")],i),i}},54461:(e,t,i)=>{i.d(t,{A:()=>a});var r=i(87449),s=i(11221),n=i(89169);class a 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(1===t)return t;const i=this._idstates[e];return 0===i||1===i?i:0===t&&void 0===i?this._countedin<this._topnum?(this._idstates[e]=0,this._countedin++,0):(this._idstates[e]=1,1):2}async _expandPagedSet(e,t,i,s,n){if(null===this._parent)throw new r.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,i,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,i,r){const s=[],a=this._maxQueryRate();if(!0===this._checkIfNeedToExpandKnownPage(e,a))return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);-1!==t&&void 0===this._featureCache[t]&&s.push(t);let l=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(l++,l<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&s.push(e._known[r]),s.length>a)));r++);if(0===s.length)return"success";const o=new n.A([],s,!1,null),u=Math.min(s.length,i);await this._parent._getFeatures(o,-1,u,r);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,i,r,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 i=0,r=null;const s=[];for(let n=0;n<e._candidates.length;n++){const a=this._isInFeatureSet(e._candidates[n]);if(0===a){if(e._known.push(e._candidates[n]),i+=1,null===r?r={start:n,end:n}:r.end===n-1?r.end=n:(s.push(r),r={start:n,end:n}),e._known.length>=this._topnum)break}else if(1===a)null===r?r={start:n,end:n}:r.end===n-1?r.end=n:(s.push(r),r={start:n,end:n}),i+=1;else if(2===a)break;if(i>=t)break}null!==r&&s.push(r);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 a({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}},55156:(e,t,i)=>{i.d(t,{I:()=>s,e:()=>r});const r=Symbol("idFieldsProviderSymbol");function s(e){return(t=e)&&r in t?e[r]:void 0;var t}},55674:(e,t,i)=>{i.d(t,{Ad:()=>p,Gj:()=>g,QY:()=>h,lL:()=>_,xR:()=>f});var r=i(66131),s=i(49186),n=(i(44208),i(44729)),a=i(15032),l=i(65864),o=i(95466),u=i(43668),c=i(98623);const d=["geometry","scale","timeProperties"];function h(e,t){if(null!=t)for(const i of d)t.hasArcadeDependency(i)&&e.add(i);return e}function p(e,t){return y.create(e,t,null,["$feature","$view"])}function f(e,t,i){return y.create(e,t,i,["$feature","$view","$config"])}class y{static async create(e,t,i,r){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:r.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},d=n.compileScript(l,c);let h=null;null!=i&&(h=new a(i),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,i,r,s,n,a,l){this.script=e,this._arcade=t,this._syntaxTree=i,this._compiled=r,this._spatialReference=s,this._viewDict=n,this._configDict=a,this._dictionaryCtor=l,this._dependencies=new Map,this._featureReader=new g,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 i=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!=i?r.lY.epochToArcadeDate(s,i):r.lY.unknownEpochToArcadeDate(s):void 0,currentEnd:null!=n?null!=i?r.lY.epochToArcadeDate(n,i):r.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:i})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class g{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,i){const r=t??new o.A(_(e.attributes));this._boundTarget=e,this._boundSchema.fields=r.fields,this._boundSchema.fieldsIndex=r,this._boundSchema.spatialReference=i}_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}_hasGeometry(){return null!=this._boundTarget.geometry}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===c.L5}field(e,t=!0){const i=this._getField(e);if(i){const t=this._boundTarget.attributes[i.name];if(null==t)return null;switch(i.type){case"date-only":case"esriFieldTypeDateOnly":return n.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return a.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return r.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?r.lY.unknownEpochToArcadeDate(t):r.lY.epochToArcadeDate(t,this.contextTimeZone??c.qU);default:return t}}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)}isEmpty(){return this._boundSchema.fields.length<=0&&!this._hasGeometry()}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 _(e){const t=[];for(const i in e)t.push({name:i,alias:i,type:"string"==typeof e[i]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},58501:(e,t,i)=>{i.d(t,{q:()=>s});var r=i(62815);function s(e,t,i){if(!i?.features||!i.hasZ)return;const s=(0,r.N)(i.geometryType,t,e.outSpatialReference);if(null!=s)for(const e of i.features)s(e.geometry)}},62815:(e,t,i)=>{i.d(t,{N:()=>a});var r=i(83047),s=i(73941),n=i(21325);function a(e,t,i){if(null==t||null==i||i.vcsWkid||(0,n.aI)(t,i)||(0,s.xP)(t)||(0,s.xP)(i))return null;const a=(0,r.G9)(t)/(0,r.G9)(i);if(1===a)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,a);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,a);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,a);default:return null}}},68423:(e,t,i)=>{i.d(t,{Gr:()=>m,IO:()=>y,a:()=>w,bV:()=>_,p8:()=>g});var r=i(52106),s=i(78502),n=i(87449),a=i(11221),l=i(89169),o=i(33325),u=i(80609),c=i(97768),d=i(1262),h=i(88368),p=i(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 g extends f{constructor(e,t,i){super((0,o.ke)(e)),this.originalField=e,this.sqlRewritable=!0,this.field.name=t,this.field.alias=i}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 _ extends f{constructor(e,t,i){super(e),this.codefield=t,this.lkp=i,this.reverseLkp={};for(const e in i)this.reverseLkp[i[e]]=e;this.sqlRewritable=!0}static{this.BADNESS="_!!!_BAD_LKP_!!!!"}rewriteSql(e,t){const i=this.evaluateNodeToWhereClause(e.parseTree,0,this.field.name,this.codefield instanceof h.A?(0,u.YY)(this.codefield,0):this.codefield,e.parameters);return i.includes(_.BADNESS)?{rewritten:!1,where:e}:{rewritten:this.sqlRewritable,where:h.A.create(i,{fieldsIndex:t._parent.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})}}evaluateNodeToWhereClause(e,t,i=null,r=null,s){let n,a,l,c;switch(e.type){case"interval":return(0,u.oj)(this.evaluateNodeToWhereClause(e.value,t,i,r,s),e.qualifier,e.op);case"case-expression":{let r=" CASE ";"simple"===e.format&&(r+=this.evaluateNodeToWhereClause(e.operand,t,i,_.BADNESS,s));for(let n=0;n<e.clauses.length;n++)r+=" WHEN "+this.evaluateNodeToWhereClause(e.clauses[n].operand,t,i,_.BADNESS,s)+" THEN "+this.evaluateNodeToWhereClause(e.clauses[n].value,t,i,_.BADNESS,s);return null!==e.else&&(r+=" ELSE "+this.evaluateNodeToWhereClause(e.else,t,i,_.BADNESS,s)),r+=" END ",r}case"parameter":{const i=s[e.value.toLowerCase()];if("string"==typeof i)return"'"+i.toString().replaceAll("'","''")+"'";if((0,o.$P)(i))return(0,u.bm)(i,t);if((0,o.Lk)(i))return(0,u.bm)(i,t);if((0,o.eg)(i))return(0,u.F1)(i,t);if((0,o.rX)(i))return(0,u.R8)(i,t);if((0,o.f0)(i))return(0,u.Nf)(i,t);if(Array.isArray(i)){const e=[];for(let r=0;r<i.length;r++)"string"==typeof i[r]?e.push("'"+i[r].toString().replaceAll("'","''")+"'"):(0,o.$P)(i[r])||(0,o.Lk)(i[r])?e.push((0,u.bm)(i[r],t)):(0,o.eg)(i[r])?e.push((0,u.F1)(i[r],t)):(0,o.rX)(i[r])?e.push((0,u.R8)(i[r],t)):(0,o.f0)(i[r])?e.push((0,u.Nf)(i[r],t)):e.push(i[r].toString());return e}return i.toString()}case"expression-list":a=[];for(const n of e.value)a.push(this.evaluateNodeToWhereClause(n,t,i,r,s));return a;case"unary-expression":return" ( NOT "+this.evaluateNodeToWhereClause(e.expr,t,i,_.BADNESS,s)+" ) ";case"binary-expression":switch(e.operator){case"AND":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" AND "+this.evaluateNodeToWhereClause(e.right,t,i,r,s)+") ";case"OR":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" OR "+this.evaluateNodeToWhereClause(e.right,t,i,r,s)+") ";case"IS":if("null"!==e.right.type)throw new d.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" IS NULL )";case"ISNOT":if("null"!==e.right.type)throw new d.L("UnsupportedIsRhs");return" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,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,i,r,s)+" IN ("+n.join(",")+")) "}return n=this.evaluateNodeToWhereClause(e.right,t,i,r,s)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" IN ("+n.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,i,r,s),Array.isArray(c)?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,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,i,r,s)+" NOT IN ("+n.join(",")+")) "}return n=this.evaluateNodeToWhereClause(e.right,t,i,r,s)," ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" NOT IN ("+n.join(",")+")) "}return c=this.evaluateNodeToWhereClause(e.right,t,i,r,s),Array.isArray(c)?" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" NOT IN ("+c.join(",")+")) ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,r,s)+" NOT IN ("+c+")) ";case"BETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)," ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"NOTBETWEEN":return l=this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)," ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" NOT BETWEEN "+l[0]+" AND "+l[1]+" ) ";case"LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+") ";case"NOT LIKE":return""!==e.escape?" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+" ESCAPE '"+e.escape+"') ":" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" NOT LIKE "+this.evaluateNodeToWhereClause(e.right,t,i,_.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" ("+r+" "+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+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,_.BADNESS,s)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,_.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,_.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 i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":(0,u.Kb)(e.column);case"data-type":return e.value;case"function":{const r=this.evaluateNodeToWhereClause(e.args,t,i,_.BADNESS,s);return(0,u.F6)(e.name,r,t)}}throw new d.L("UnsupportedSyntax",{node:e.type})}extractValue(e){if(this.codefield instanceof h.A){const t=this.codefield.calculateValueCompiled(e);return this.reverseLkp[h.A.convertValueToStorageFormat(t)]}return 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,0),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 i of e)if(i.name.toLowerCase()===t.toString().toLowerCase())return i;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,i,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,i,n);let u=0;for(let r=e._lastFetchedIndex;r<e._known.length&&(u++,u<=i&&(e._lastFetchedIndex+=1),!(void 0===this._featureCache[e._known[r]]&&(e._known[r]!==t&&a.push(e._known[r]),a.length>=o)));r++);if(0===a.length)return"success";e=new l.A([],a,e._ordered,null);const c=Math.min(a.length,i);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 i of this.adaptedFields)t[i.field.name]=i.extractValue(e);this._featureCache[e.id]=new r.A({attributes:t,geometry:(0,s.Yq)(e.geometry)})}return"success"}async _fetchAndRefineFeatures(){throw new n.d("NeverReach")}async _getFilteredSet(e,t,i,r,s){let n=!1;const a=this._reformulateWithoutAdaptions(i);n=a.cannot,i=a.where;let o=!1;if(null!==r){o=!0;const e=[];for(const t of this.adaptedFields)if(!(t instanceof y)&&!0===r.scanForField(t.field.name)){if(!(t instanceof g)){r=null,o=!1;break}e.push({field:t.field.name,newfield:t.originalField.name})}r&&e.length>0&&(r=r.replaceFields(e))}null!==i?null!==this._extraFilter&&(i=(0,u.kg)(this._extraFilter,i)):i=this._extraFilter,await this._ensureLoaded();const c=await this._parent._getFilteredSet(e,t,i,r,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 i of this.adaptedFields)if(!0===(0,u.Ju)(e,i.field.name)){const r=i.rewriteSql(e,this);if(!0!==r.rewritten){t.cannot=!0,t.where=null;break}t.where=r.where}return t}async _stat(e,t,i,r,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&&""===i&&null===r?this._manualStat(e,t,n,a):{calculated:!1};const c=await this._parent._stat(e,t,i,r,s,n,a);return!1===c.calculated?null===s&&""===i&&null===r?this._manualStat(e,t,n,a):{calculated:!1}:c}async _canDoAggregates(e,t,i,r,s){if(null===this._parent)return!1;for(let t=0;t<e.length;t++)for(const i of this.adaptedFields)if(e[t].toLowerCase()===i.field.name.toLowerCase()&&!(i instanceof y))return!1;const n=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)return!1;const t=i.clone();t.workingexpr=e.where,n.push(t)}else n.push(i)}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,i,r,s))}async _getAggregatePagesDataSourceDefinition(e,t,i,r,s,a,l){if(null===this._parent)throw new n.d("NeverReach");const o=[];for(let e=0;e<t.length;e++){const i=t[e];if(null!==i.workingexpr){const e=this._reformulateWithoutAdaptions(i.workingexpr);if(e.cannot)throw new n.d("NeverReach");const t=i.clone();t.workingexpr=e.where,o.push(t)}else o.push(i)}const c=this._reformulateWithoutAdaptions(s);if(c.cannot)throw new 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,i,r,s,a,l)}}},73681:(e,t,i)=>{i.d(t,{n:()=>o});var r=i(49186),s=i(53966),n=i(46140),a=i(95466),l=i(55674);class o{static async from(e,t,i){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(i))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 r.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(i,f);return new o(f,c,p,y)}constructor(e,t,i,r){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=i,this._reader=r}get itemNames(){return this._itemNames}evaluate(e,t,i,r){try{return this._reader.bind(e,i,r),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||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},86691:(e,t,i)=>{i.d(t,{A:()=>o});var r=i(78878),s=i(87449),n=i(11221),a=i(89169),l=i(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 i=await this.getIdColumnDictionary(e,[],-1,t);this._orderbyclause?.order(i);const r=new a.A([],[],!0,null);for(let e=0;e<i.length;e++)r._known.push(i[e].id);return r}async getIdColumnDictionary(e,t,i,s){if(i<e._known.length-1){const n=this._maxQueryRate();if("GETPAGES"===e._known[i+1])return await(0,r.a2)(this._parent._expandPagedSet(e,n,0,0,s)),this.getIdColumnDictionary(e,t,i,s);let a=i+1;const l=[];for(;a<e._known.length&&"GETPAGES"!==e._known[a];)l.push(e._known[a]),a++;i+=l.length;const o=await(0,r.a2)(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,i,s)}return e._candidates.length>0?(await(0,r.a2)(this._refineSetBlock(e,this._maxProcessingRate(),s)),this._checkCancelled(s),this.getIdColumnDictionary(e,t,i,s)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_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.d("NeverReach")}async _getFilteredSet(e,t,i,r,s){await this._ensureLoaded();const n=await this._parent._getFilteredSet(e,t,i,null===r?this._orderbyclause:r,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===i||(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,i)=>{function r(e,t){return e===t?0:null===e?-1:null===t?1:e<t?-1:1}i.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 i=t[e].match(/\S+/g);this._fields.push(i[0]),2===i.length?"asc"===i[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 i=0;i<this._fields.length;i++){const s=this.featureValue(e.feature,this._fields[i],i),n=this.featureValue(t.feature,this._fields[i],i);let a=0;if(a=1===this._directions[i]?r(s,n):-1*r(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 i=0;i<this._fields.length;i++){0!==i&&(t+=",");let r=this._fields[i];for(const t of e)if(r.toLowerCase()===t.field.toLowerCase()){r=t.newfield;break}t+=r,1===this._directions[i]?t+=" ASC":t+=" DESC"}return new s(t)}featureValue(e,t,i){const r=e.attributes[t];if(void 0!==r)return r;for(const r in e.attributes)if(t.toLowerCase()===r.toLowerCase())return this._fields[i]=r,e.attributes[r];return null}}},91218:(e,t,i)=>{i.r(t),i.d(t,{canProjectWithoutEngine:()=>W,initializeProjection:()=>$,isEqualBaseGCS:()=>V,isLoaded:()=>k,isLoadedOrLoad:()=>D,isLoadedOrLoadFor:()=>L,load:()=>M,project:()=>P,projectExtent:()=>ie,projectMany:()=>O,projectMultipoint:()=>Y,projectOrLoad:()=>j,projectOrLoadMany:()=>E,projectPoint:()=>z,projectPolygon:()=>ee,projectPolyline:()=>H,projectWithZConversion:()=>B,projectWithoutEngine:()=>Q,requiresLoad:()=>N,test:()=>Z,tryProjectWithZConversion:()=>U,unload:()=>q});var r=i(49186),s=i(74887),n=i(62788),a=i(95488),l=i(51850),o=i(21276),u=i(73941),c=i(5443),d=i(91075),h=i(48526),p=i(86738),f=i(39829),y=i(82799),g=i(16930),_=i(159),m=i(9762),w=i(37539);function F(e,t,i,r,s,n){return b[0]=e,b[1]=t,b[2]=i,(0,m.projectBuffer)(b,r,0,s,n,0)}const b=(0,l.vt)();var I=i(21325),S=i(62815);let v=null,A=null,T=null,C=null,x={};const R=new a.I;function k(){return!!(A?.isLoaded()&&T?.isLoaded()&&C?.isLoaded())}function D(){return!!k()||((0,n.gc)(R),M(),!1)}function L(e,t){return!e||!t||W(e,t)||D()}function N(e,t){return!W(e,t)&&!k()}async function M(e){null==v&&(v=Promise.all([i.e(3276).then(i.bind(i,83276)).then(e=>(A=e,A.load())),i.e(8377).then(i.bind(i,8377)).then(e=>(T=e,T.load())),i.e(2158).then(i.bind(i,12158)).then(e=>(C=e,C.load()))])),await v,(0,s.Te)(e),R.notify()}function P(e,t,i){return Array.isArray(e)?0===e.length?[]:((0,o.H)(e),O(e,e[0].spatialReference,t,i)):((0,o.f)(e),O([e],e.spatialReference,t,i)[0])}function O(e,t,i,r){if(null==t||null==i)return e;if(W(t,i,r))return e.map(e=>Q(e,t,i));if(null==r?.geographicTransformation&&(0,u.jA)(t))return e.map(e=>Q(e,t,g.A.WGS84)).map(e=>U(e,i));if(null==r?.geographicTransformation&&(0,u.jA)(i))return e.map(e=>U(e,g.A.WGS84)).map(e=>Q(e,g.A.WGS84,i));if(!k())throw new G;if(!r?.geographicTransformation)if(r?.extendedParams)r={...r,geographicTransformation:C.getTransformation(t,i,r.areaOfInterestExtent)||new _.A};else if(!r?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,i);let s=x[e];s||(s=C.getTransformation(t,i)||new _.A,x[e]=s),r={geographicTransformation:s}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof d.A?A.executeMany(e,i,r):T.executeMany(e,i,r)}function j(e,t){const i=E([e],t);return null!=i.pending?{pending:i.pending,geometry:null}:null!=i.geometries?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function E(e,t){if(!k())for(const i of e)if(null!=i&&!(0,I.aI)(i.spatialReference,t)&&(0,I.fn)(i.spatialReference)&&(0,I.fn)(t)&&!W(i.spatialReference,t))return(0,n.gc)(R),{pending:M(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,I.aI)(e.spatialReference,t)?e:(0,I.fn)(e.spatialReference)&&(0,I.fn)(t)?U(e,t):null)}}class G extends r.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function q(){v=null,A=null,T=null,C=null,x={}}const Z={get loadPromise(){return v}};function U(e,t){try{const i=P(e,t);if(null==i)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const r=(0,S.N)(i.type,e.spatialReference,t);return null!=r&&r(i),i}catch(e){if(!(e instanceof G))throw e;return null}}async function B(e,t,i){const r=e.spatialReference;return null!=r&&null!=t&&await $(r,t,null,i),U(e,t)}function W(e,t,i){return!(i?.areaOfInterestExtent||i?.extendedParams||i?.geographicTransformation)&&(!!(0,I.aI)(e,t)||(0,I.fn)(e)&&(0,I.fn)(t)&&!!(0,w.jd)(e,t))}function V(e,t){if((0,I.aI)(e,t))return!0;if(!(0,I.fn)(e)||!(0,I.fn)(t))return!1;const i=(0,I.oT)(e)||(0,I.K8)(e)||(0,I.x1)(e),r=(0,I.oT)(t)||(0,I.K8)(t)||(0,I.x1)(t);return i&&r}async function $(e,t,i,r){if(k())return(0,s.NO)(r);if(Array.isArray(e)){for(const{source:t,dest:i,options:s}of e)if(t&&i&&!W(t,i,s))return M(r)}else if(e&&t&&!W(e,t,i))return M(r);return(0,s.NO)(r)}function Q(e,t,i){return e?"x"in e?J(e,t,new p.A,i,0):"xmin"in e?re(e,t,new c.A,i,0):"rings"in e?te(e,t,new f.A,i,0):"paths"in e?X(e,t,new y.A,i,0):"points"in e?K(e,t,new h.A,i,0):null:null}function z(e,t,i=t.spatialReference,r=0){return null!=i&&null!=e.spatialReference&&null!=J(e,e.spatialReference,t,i,r)}function J(e,t,i,r,s){ne[0]=e.x,ne[1]=e.y;const n=e.z;return ne[2]=void 0!==n?n:s,(0,m.projectBuffer)(ne,t,0,ne,r,0)?(i.x=ne[0],i.y=ne[1],i.spatialReference=r,void 0!==n||(0,u.xP)(r)?(i.z=ne[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),void 0===e.m?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function Y(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=K(e,e.spatialReference,t,i,r)}function K(e,t,i,r,s){const{points:n,hasZ:a,hasM:l}=e,o=[],c=n.length,d=[];for(const e of n)d.push(e[0],e[1],a?e[2]:s);if(!(0,m.projectBuffer)(d,t,0,d,r,0,c))return null;const h=a||(0,u.xP)(r);for(let e=0;e<c;++e){const t=3*e,i=d[t],r=d[t+1];h&&l?o.push([i,r,d[t+2],n[e][3]]):h?o.push([i,r,d[t+2]]):l?o.push([i,r,n[e][2]]):o.push([i,r])}return i.points=o,i.spatialReference=r,i.hasZ=a,i.hasM=l,i}function H(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=X(e,e.spatialReference,t,i,r)}function X(e,t,i,r,s){const{paths:n,hasZ:a,hasM:l}=e,o=[];if(!se(n,a??!1,l??!1,t,o,r,s))return null;const c=a||(0,u.xP)(r);return i.paths=o,i.spatialReference=r,i.hasZ=c,i.hasM=l,i}function ee(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=te(e,e.spatialReference,t,i,r)}function te(e,t,i,r,s){const{rings:n,hasZ:a,hasM:l}=e,o=[];if(!se(n,a??!1,l??!1,t,o,r,s))return null;const c=a||(0,u.xP)(r);return i.rings=o,i.spatialReference=r,i.hasZ=c,i.hasM=l,i}function ie(e,t,i=t.spatialReference,r=0){return null!=e.spatialReference&&null!=i&&null!=re(e,e.spatialReference,t,i,r)}function re(e,t,i,r,s){const{xmin:n,ymin:a,xmax:l,ymax:o,hasZ:c,hasM:d}=e;if(!F(n,a,c?e.zmin:s,t,ne,r))return null;const h=c||(0,u.xP)(r);return i.xmin=ne[0],i.ymin=ne[1],h&&(i.zmin=ne[2]),F(l,o,c?e.zmax:s,t,ne,r)?(i.xmax=ne[0],i.ymax=ne[1],h&&(i.zmax=ne[2]),d&&(i.mmin=e.mmin,i.mmax=e.mmax),i.spatialReference=r,i):null}function se(e,t,i,r,s,n,a=0){const l=new Array;for(const i of e)for(const e of i)l.push(e[0],e[1],t?e[2]:a);if(!(0,m.projectBuffer)(l,r,0,l,n,0))return!1;let o=0;s.length=0;const c=t||(0,u.xP)(n);for(const t of e){const e=new Array;for(const r of t)c&&i?e.push([l[o++],l[o++],l[o++],r[3]]):c?e.push([l[o++],l[o++],l[o++]]):i?(e.push([l[o++],l[o++],r[2]]),o++):(e.push([l[o++],l[o++]]),o++);s.push(e)}return!0}const ne=(0,l.vt)()},91880:(e,t,i)=>{i.d(t,{A:()=>c});var r,s=i(31635),n=i(66552),a=i(25482),l=i(10107),o=(i(44208),i(53966),i(87811),i(64108));const u=new n.J({asc:"ascending",desc:"descending"});let c=class extends a.o{static{r=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new r({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,s.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],c.prototype,"field",void 0),(0,s.Cg)([(0,l.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],c.prototype,"valueExpression",void 0),(0,s.Cg)([(0,l.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],c.prototype,"order",void 0),c=r=(0,s.Cg)([(0,o.$)("esri.layers.support.OrderByInfo")],c)},99157:(e,t,i)=>{i.d(t,{A:()=>o});var r,s=i(31635),n=i(65008),a=i(10107),l=(i(44208),i(53966),i(87811),i(64108));let o=r=class extends n.A{constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new r({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,s.Cg)([(0,a.MZ)()],o.prototype,"isInverse",void 0),(0,s.Cg)([(0,a.MZ)()],o.prototype,"wkt",void 0),(0,s.Cg)([(0,a.MZ)()],o.prototype,"wkid",void 0),o=r=(0,s.Cg)([(0,l.$)("esri.geometry.operators.support.GeographicTransformationStep")],o)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[655],{16405:(t,e,r)=>{r.d(e,{A:()=>c});var o,s=r(31635),i=r(65008),l=r(66552),a=r(4718),n=r(10107),u=(r(44208),r(53966),r(64108)),p=r(5443),d=r(16930),h=r(28735);const y=new l.J({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let c=o=class extends i.A{constructor(t){super(t),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(t){"asc"!==t&&"desc"!==t||this._set("sortOrder",t)}clone(){return new o({categories:this.categories?(0,a.o8)(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(t,e){let r=[];this.categories&&(r=this.categories.map(t=>Array.isArray(t)?JSON.stringify(t):t));let o="";if(this.extent){const t=(0,h.Cv)(this.extent,d.A.WGS84);null!=t&&(o=`${t.xmin},${t.ymin},${t.xmax},${t.ymax}`)}let s=this.query;!this.disableExtraQuery&&t.extraQuery&&(s="("+s+")"+t.extraQuery);const i={categories:r,bbox:o,q:s,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(i.sortField=this.sortField.split(",").map(t=>y.toJSON(t.trim())).join(","),i.sortOrder=this.sortOrder),{query:{...e,...i}}}};(0,s.Cg)([(0,n.MZ)()],c.prototype,"categories",void 0),(0,s.Cg)([(0,n.MZ)()],c.prototype,"disableExtraQuery",void 0),(0,s.Cg)([(0,n.MZ)({type:p.A})],c.prototype,"extent",void 0),(0,s.Cg)([(0,n.MZ)()],c.prototype,"filter",void 0),(0,s.Cg)([(0,n.MZ)()],c.prototype,"num",void 0),(0,s.Cg)([(0,n.MZ)()],c.prototype,"query",void 0),(0,s.Cg)([(0,n.MZ)()],c.prototype,"sortField",void 0),(0,s.Cg)([(0,n.MZ)()],c.prototype,"sortOrder",null),(0,s.Cg)([(0,n.MZ)()],c.prototype,"start",void 0),c=o=(0,s.Cg)([(0,u.$)("esri.portal.PortalQueryParams")],c)},20655:(t,e,r)=>{r.d(e,{A:()=>q});var o=r(31635),s=r(92602),i=r(70333),l=r(78888),a=r(49186),n=r(44208),u=r(25482),p=r(92474),d=r(97768),h=r(74887),y=r(10107),c=r(56507),m=(r(87811),r(36005)),g=r(64108),C=r(5443),f=r(73444);let v;var M=r(96360),Z=r(16405),S=r(65008);r(53966);let O=class extends S.A{constructor(t){super(t),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};(0,o.Cg)([(0,y.MZ)()],O.prototype,"nextQueryParams",void 0),(0,o.Cg)([(0,y.MZ)()],O.prototype,"queryParams",void 0),(0,o.Cg)([(0,y.MZ)()],O.prototype,"results",void 0),(0,o.Cg)([(0,y.MZ)()],O.prototype,"total",void 0),O=(0,o.Cg)([(0,g.$)("esri.portal.PortalQueryResult")],O);var w,P=r(41318),G=r(926);let A;const b={PortalGroup:()=>Promise.resolve({default:M.A}),PortalItem:()=>r.e(812).then(r.bind(r,80812)),PortalUser:()=>Promise.resolve({default:P.A})};let q=class extends((0,u.T)(p.x_)){static{w=this}static{this.AUTH_MODE_ANONYMOUS="anonymous"}static{this.AUTH_MODE_AUTO="auto"}static{this.AUTH_MODE_IMMEDIATE="immediate"}static{this.AUTH_MODE_NO_PROMPT="no-prompt"}constructor(t){super(t),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.g3DTilesGalleryGroupQuery=null,this.g3dTilesEnabled=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.default3DBasemapQuery=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.hasClassificationSchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.recycleBinEnabled=!1,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=s.A.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useDefault3dBasemap=!1,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(t){return"string"==typeof t?{url:t}:t}destroy(){D.unregister(this),this.defaultBasemap=(0,d.pR)(this.defaultBasemap),this.defaultDevBasemap=(0,d.pR)(this.defaultDevBasemap),this.defaultVectorBasemap=(0,d.pR)(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=(0,d.xt)(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(t){if(t)for(const e of t)s.A.request.trustedServers.includes(e)||s.A.request.trustedServers.push(e);return t}readDefaultBasemap(t){return this._readBasemap(t)}readDefaultDevBasemap(t){return this._readBasemap(t)}readDefaultVectorBasemap(t){return this._readBasemap(t)}get extraQuery(){const t=this.user?.orgId,e=!t||this.canSearchPublic;return this.id&&!e?` AND orgid:${this.id}`:null}get hasAPIKey(){return(0,G.Jn)(this.restUrl)}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get loaded(){return super.loaded}get restUrl(){let t=this.url;if(t){const e=t.indexOf("/sharing");t=e>0?t.slice(0,e):this.url.replace(/\/+$/,""),t+="/sharing/rest"}return t}get thumbnailUrl(){const t=this.restUrl,e=this.thumbnail;return t&&e?this._normalizeSSL(t+"/portals/self/resources/"+e):null}readUrlKey(t){return t?t.toLowerCase():t}readUser(t){let e=null;return t&&(e=P.A.fromJSON(t),e.portal=this),e}load(t){const e=Promise.all([r.e(812),r.e(3116)]).then(r.bind(r,83116)).then(({default:e})=>{(0,h.Te)(t),A=e}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,t)).then(t=>{if(!this.hasAPIKey&&i.id){const t=i.id;this.credential=t.findCredential(this.restUrl),this.credential||this.authMode!==w.AUTH_MODE_AUTO&&this.authMode!==w.AUTH_MODE_NO_PROMPT||(this._esriIdCredentialCreateHandle?.remove(),this._esriIdCredentialCreateHandle=t.on("credential-create",function(t){const e=i.id;return()=>{const r=t.deref();r&&e.findCredential(r.restUrl)&&r.signIn().catch(()=>{})}}(new WeakRef(this))),D.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=t,this.read(t)});return this.addResolvingPromise(e),Promise.resolve(this)}async createElevationLayers(){await this.load();const t=this._getHelperService("defaultElevationLayers"),e=(await Promise.all([r.e(4045),r.e(9953),r.e(812),r.e(4802),r.e(588)]).then(r.bind(r,68611))).default;return t?t.map(t=>new e({id:t.id,url:t.url})):[]}async fetchBasemaps(t,e){const r=await this._fetchBasemaps(t,e);if(!0===e?.include3d&&!1!==this.use3dBasemaps){if(this.g3dTilesEnabled&&this.g3DTilesGalleryGroupQuery&&(0,n.A)("enable-feature:basemap-groundlayers")){const t=await this._fetchBasemaps3D(this.g3DTilesGalleryGroupQuery,e);r.unshift(...t)}const o=await this._fetchBasemaps3D(t,e);r.unshift(...o)}return r}async fetchDefault3DBasemap(t){if(!this.useDefault3dBasemap||!this.default3DBasemapQuery||"none"===this.default3DBasemapQuery)return null;const e=new Z.A;e.query=this.default3DBasemapQuery,e.disableExtraQuery=!0;const r=(await this.queryItems(e,t)).results.find(t=>"Web Scene"===t.type);return r?new A({portalItem:r}):null}fetchCategorySchema(t){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",t).then(t=>t.categorySchema):(0,h.G4)(t)?Promise.reject((0,h.NK)()):Promise.resolve([])}async fetchClassificationSchema(t){return this.hasClassificationSchema?this.request(this.restUrl+"/portals/self/classification/classificationSchema",t).then(t=>t.classificationSchema):null}fetchFeaturedGroups(t){const e=this.featuredGroups,r=new Z.A({num:100,sortField:"title"});if(e?.length){const o=[];for(const t of e)o.push(`(title:"${t.title}" AND owner:${t.owner})`);return r.query=o.join(" OR "),this.queryGroups(r,t).then(t=>t.results)}return(0,h.G4)(t)?Promise.reject((0,h.NK)()):Promise.resolve([])}fetchRegions(t){const e=this.user?.culture||this.culture||(0,f.JK)();return this.request(this.restUrl+"/portals/regions",{...t,query:{culture:e}})}fetchSettings(t){const e=this.user?.culture||this.culture||(0,f.JK)();return this.request(this.restUrl+"/portals/self/settings",{...t,query:{culture:e}})}static getDefault(){return v&&!v.destroyed||(v=new w),v}queryGroups(t,e){return this.queryPortal("/community/groups",t,"PortalGroup",e)}queryItems(t,e){return this.queryPortal("/search",t,"PortalItem",e)}queryUsers(t,e){return t.sortField||(t.sortField="username"),this.queryPortal("/community/users",t,"PortalUser",e)}fetchSelf(t=this.authMode,e=!1,r){const o=this.restUrl+"/portals/self",s={authMode:t,query:{culture:(0,f.JK)().toLowerCase()},withCredentials:!0,...r};return"auto"===s.authMode&&(s.authMode="no-prompt"),e&&(s.query.default=!0),this.request(o,s)}queryPortal(t,e,r,o){const s=(0,c.dp)(Z.A,e),i=e=>this.request(this.restUrl+t,{...s.toRequestOptions(this),...o}).then(t=>{const r=s.clone();return r.start=t.nextStart,new O({nextQueryParams:r,queryParams:s,total:t.total,results:w._resultsToTypedArray(e,{portal:this},t,o)})}).then(t=>Promise.all(t.results.map(e=>"function"==typeof e.when?e.when():t)).then(()=>t,e=>((0,h.QP)(e),t)));return r&&b[r]?b[r]().then(({default:t})=>((0,h.Te)(o),i(t))):i()}signIn(){if(this.hasAPIKey)return this.load().then(()=>{if(!this.user)throw new a.A("portal:not-authenticated","Unable to authenticate user. Portal.user is missing")});if(this.authMode===w.AUTH_MODE_ANONYMOUS||this.authMode===w.AUTH_MODE_NO_PROMPT&&!i.id)return Promise.reject(new a.A("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if("failed"===this.loadStatus)return Promise.reject(this.loadError);const t=t=>Promise.resolve().then(()=>"not-loaded"===this.loadStatus?(t||(this.authMode="immediate"),this.load().then(()=>null)):"loading"===this.loadStatus?this.load().then(()=>this.credential?null:(this.credential=t,this.fetchSelf("immediate"))):this.user&&this.credential===t?null:(this.credential=t,this.fetchSelf("immediate"))).then(t=>{t&&(this.sourceJSON=t,this.read(t))});return i.id?i.id.getCredential(this.restUrl,{prompt:this.authMode!==w.AUTH_MODE_NO_PROMPT}).then(e=>t(e)):t(this.credential)}normalizeUrl(t){const e=this.credential?.token;return this._normalizeSSL(e?t+(t.includes("?")?"&":"?")+"token="+e:t)}requestToTypedArray(t,e,r){return this.request(t,e).then(t=>{const e=w._resultsToTypedArray(r,{portal:this},t);return Promise.all(e.map(e=>"function"==typeof e.when?e.when():t)).then(()=>e,()=>e)})}request(t,e={}){const r={f:"json",...e.query},{authMode:o=(this.authMode===w.AUTH_MODE_ANONYMOUS||this.authMode===w.AUTH_MODE_NO_PROMPT?this.authMode:"auto"),body:s=null,cacheBust:i=!1,method:a="auto",responseType:n="json",signal:u}=e,p={authMode:o,body:s,cacheBust:i,method:a,query:r,responseType:n,timeout:0,signal:u};return e.withCredentials&&(p.withCredentials=!0),(0,l.A)(this._normalizeSSL(t),p).then(t=>t.data)}toJSON(){throw new a.A("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new w({sourceJSON:t})}_getHelperService(t){const e=this.helperServices?.[t];if(!e)throw new a.A("portal:service-not-found",`The \`helperServices\` do not include an entry named "${t}"`);return e}async _fetchBasemaps(t,e){const r=new Z.A;r.query=t||((0,G.Dd)()?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),r.disableExtraQuery=!0;const o=await this.queryGroups(r,e);if(!o.total)return[];const s=o.results[0];r.num=100,r.query='type:"Web Map" -type:"Web Application"',r.sortField=s.sortField||"name",r.sortOrder=s.sortOrder||"desc";const i=await s.queryItems(r,e);return i.total?i.results.filter(t=>"Web Map"===t.type).map(t=>new A({portalItem:t})):[]}async _fetchBasemaps3D(t,e){const r=t||this.basemapGalleryGroupQuery3D;if(!r)return[];if((0,G.Dd)())return[];const o=new Z.A({query:r,disableExtraQuery:!0}),s=await this.queryGroups(o,e);if(!s.total)return[];const i=s.results[0];o.num=100,o.query='type:"Web Scene"',o.sortField=i.sortField||"name",o.sortOrder=i.sortOrder||"desc";const l=await i.queryItems(o,e);return l.total?l.results.filter(t=>"Web Scene"===t.type).map(t=>new A({portalItem:t})):[]}_normalizeSSL(t){return t.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(t){if(t){const e=A.fromJSON(t);return e.portalItem={portal:this},e}return null}static _resultsToTypedArray(t,e,r,o){let s;if(r){const i=null!=o?o.signal:null;s=r.listings||r.notifications||r.userInvitations||r.tags||r.items||r.groups||r.comments||r.provisions||r.results||r.relatedItems||r,(t||e)&&(s=s.map(r=>{const o=Object.assign(t?t.fromJSON(r):r,e);return"function"==typeof o.load&&o.load(i),o}))}else s=[];return s}};(0,o.Cg)([(0,y.MZ)()],q.prototype,"access",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"allSSL",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"authMode",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"authorizedCrossOriginDomains",void 0),(0,o.Cg)([(0,m.w)("authorizedCrossOriginDomains")],q.prototype,"readAuthorizedCrossOriginDomains",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"basemapGalleryGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)({json:{name:"3DBasemapGalleryGroupQuery"}})],q.prototype,"basemapGalleryGroupQuery3D",void 0),(0,o.Cg)([(0,y.MZ)({json:{name:"g3DTilesGalleryGroupQuery"}})],q.prototype,"g3DTilesGalleryGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)({json:{name:"g3dTilesEnabled"}})],q.prototype,"g3dTilesEnabled",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"bingKey",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"canListApps",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"canListData",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"canListPreProvisionedItems",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"canProvisionDirectPurchase",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"canSearchPublic",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"canShareBingPublic",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"canSharePublic",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"canSignInArcGIS",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"canSignInIDP",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"colorSetsGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"commentsEnabled",void 0),(0,o.Cg)([(0,y.MZ)({type:Date})],q.prototype,"created",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"credential",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"culture",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"currentVersion",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"customBaseUrl",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"default3DBasemapQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"defaultBasemap",void 0),(0,o.Cg)([(0,m.w)("defaultBasemap")],q.prototype,"readDefaultBasemap",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"defaultDevBasemap",void 0),(0,o.Cg)([(0,m.w)("defaultDevBasemap")],q.prototype,"readDefaultDevBasemap",null),(0,o.Cg)([(0,y.MZ)({type:C.A})],q.prototype,"defaultExtent",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"defaultVectorBasemap",void 0),(0,o.Cg)([(0,m.w)("defaultVectorBasemap")],q.prototype,"readDefaultVectorBasemap",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"description",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"devBasemapGalleryGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"eueiEnabled",void 0),(0,o.Cg)([(0,y.MZ)({readOnly:!0})],q.prototype,"extraQuery",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"featuredGroups",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"featuredItemsGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"galleryTemplatesGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"layoutGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"livingAtlasGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)({readOnly:!0})],q.prototype,"hasAPIKey",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"hasCategorySchema",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"hasClassificationSchema",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"helpBase",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"helperServices",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"helpMap",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"homePageFeaturedContent",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"homePageFeaturedContentCount",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"httpPort",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"httpsPort",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"id",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"ipCntryCode",void 0),(0,o.Cg)([(0,y.MZ)({readOnly:!0})],q.prototype,"isOrganization",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"isPortal",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"isReadOnly",void 0),(0,o.Cg)([(0,y.MZ)({readOnly:!0})],q.prototype,"itemPageUrl",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"layerTemplatesGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"maxTokenExpirationMinutes",void 0),(0,o.Cg)([(0,y.MZ)({type:Date})],q.prototype,"modified",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"name",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"portalHostname",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"portalMode",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"portalProperties",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"region",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"recycleBinEnabled",void 0),(0,o.Cg)([(0,y.MZ)({readOnly:!0})],q.prototype,"restUrl",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"rotatorPanels",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"showHomePageDescription",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"sourceJSON",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"staticImagesUrl",void 0),(0,o.Cg)([(0,y.MZ)({json:{name:"2DStylesGroupQuery"}})],q.prototype,"stylesGroupQuery2d",void 0),(0,o.Cg)([(0,y.MZ)({json:{name:"stylesGroupQuery"}})],q.prototype,"stylesGroupQuery3d",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"supportsHostedServices",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"symbolSetsGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"templatesGroupQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"thumbnail",void 0),(0,o.Cg)([(0,y.MZ)({readOnly:!0})],q.prototype,"thumbnailUrl",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"units",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"url",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"urlKey",void 0),(0,o.Cg)([(0,m.w)("urlKey")],q.prototype,"readUrlKey",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"user",void 0),(0,o.Cg)([(0,m.w)("user")],q.prototype,"readUser",null),(0,o.Cg)([(0,y.MZ)()],q.prototype,"use3dBasemaps",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"useDefault3dBasemap",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"useStandardizedQuery",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"useVectorBasemaps",void 0),(0,o.Cg)([(0,y.MZ)()],q.prototype,"vectorBasemapGalleryGroupQuery",void 0),q=w=(0,o.Cg)([(0,g.$)("esri.portal.Portal")],q);const D=new FinalizationRegistry(t=>{t.remove()})},41318:(t,e,r)=>{r.d(e,{A:()=>d});var o=r(31635),s=r(49186),i=r(25482),l=r(10107),a=(r(44208),r(53966),r(87811),r(64108));let n=class extends i.o{constructor(t){super(t),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const t=this.portal?.restUrl;return t?`${t}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new s.A("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};(0,o.Cg)([(0,l.MZ)({type:Date})],n.prototype,"created",void 0),(0,o.Cg)([(0,l.MZ)()],n.prototype,"id",void 0),(0,o.Cg)([(0,l.MZ)()],n.prototype,"portal",void 0),(0,o.Cg)([(0,l.MZ)()],n.prototype,"title",void 0),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],n.prototype,"url",null),(0,o.Cg)([(0,l.MZ)()],n.prototype,"username",void 0),n=(0,o.Cg)([(0,a.$)("esri.portal.PortalFolder")],n);var u,p=r(96360);let d=u=class extends i.o{constructor(t){super(t),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.id=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userLicenseTypeId=null,this.userType=null}get thumbnailUrl(){const t=this.url,e=this.thumbnail;return t&&e?this.portal.normalizeUrl(`${t}/info/${e}?f=json`):null}get userContentUrl(){const t=this.portal?.restUrl;return t?`${t}/content/users/${this.id}`:null}get url(){const t=this.portal?.restUrl;return t?`${t}/community/users/${this.id}`:null}addItem(t){const e=t&&t.item,r=t?.data,o=t?.folder,s={method:"post"};e&&(s.query=e.createPostQuery(),null!=r&&("string"==typeof r?s.query.text=r:"object"==typeof r&&(s.query.text=JSON.stringify(r))));let i=this.userContentUrl;return o&&(i+="/"+("string"==typeof o?o:o.id)),this.portal.request(i+"/addItem",s).then(t=>(e.id=t.id,e.portal=this.portal,e.loaded?e.reload():e.load()))}async deleteItem(t,e=!1){let r=this.userContentUrl;t.ownerFolder&&(r+="/"+t.ownerFolder);const o=e?{permanentDelete:!0}:{};await this.portal.request(r+`/items/${t.id}/delete`,{method:"post",query:o}),t.id=null,t.portal=null}async deleteItems(t,e=!1){t=t.slice();const r=this.userContentUrl+"/deleteItems",o=[],i=t.map(t=>t.id);if(i.length){const l={method:"post",query:{items:i.join(","),permanentDelete:e}},a=await this.portal.request(r,l);for(const e of a.results){const r=t.find(t=>e.itemId===t.id),i=e.success;let l=null;i?(r.id=null,r.portal=null):e.error&&(l=new s.A("portal:delete-item-failed",e.error.message,e.error)),o.push({item:r,success:i,error:l})}}return o}fetchFolders(){return this.portal.request(this.userContentUrl??"",{query:{num:1}}).then(t=>{let e;return e=t&&t.folders?t.folders.map(t=>{const e=n.fromJSON(t);return e.portal=this.portal,e}):[],e})}fetchGroups(){return this.portal.request(this.url??"").then(t=>{let e;return e=t&&t.groups?t.groups.map(t=>{const e=p.A.fromJSON(t);return e.portal=this.portal,e}):[],e})}async fetchItems(t){t??={};let e=this.userContentUrl??"";t.folder&&(e+="/"+t.folder.id);const{default:o}=await r.e(812).then(r.bind(r,80812)),s={folders:!1,inRecycleBin:!!t.inRecycleBin||null,foldersContent:!(t.folder||!t.includeSubfolderItems)||null,num:t.num||10,start:t.start||1,sortField:t.sortField||"created",sortOrder:t.sortOrder||"asc"},i=await this.portal.request(e,{query:s});let l;return i?.items?(l=i.items.map(t=>{const e=o.fromJSON(t);return e.portal=this.portal,e}),await Promise.all(l.map(t=>t.load())),{items:l,nextStart:i.nextStart,total:i.total}):{items:[],nextStart:-1,total:0}}fetchTags(){return this.portal.request(this.url+"/tags").then(t=>t.tags)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}queryFavorites(t){return this.favGroupId?(this._favGroup||(this._favGroup=new p.A({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(t)):Promise.reject(new s.A("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}async restoreItem(t,e){const r=this.userContentUrl,o=e?{folderID:"string"==typeof e?e:e.id}:null;await this.portal.request(r+`/items/${t.id}/restore`,{method:"post",query:o})}toJSON(){throw new s.A("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const e=new u({sourceJSON:t});return e.read(t),e}};(0,o.Cg)([(0,l.MZ)()],d.prototype,"access",void 0),(0,o.Cg)([(0,l.MZ)({type:Date})],d.prototype,"created",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"culture",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"description",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"email",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"favGroupId",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"fullName",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"id",void 0),(0,o.Cg)([(0,l.MZ)({type:Date})],d.prototype,"modified",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"orgId",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"portal",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"preferredView",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"privileges",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"region",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"role",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"roleId",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"sourceJSON",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"thumbnail",void 0),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],d.prototype,"thumbnailUrl",null),(0,o.Cg)([(0,l.MZ)()],d.prototype,"units",void 0),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],d.prototype,"userContentUrl",null),(0,o.Cg)([(0,l.MZ)({readOnly:!0})],d.prototype,"url",null),(0,o.Cg)([(0,l.MZ)()],d.prototype,"username",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"userLicenseTypeId",void 0),(0,o.Cg)([(0,l.MZ)()],d.prototype,"userType",void 0),d=u=(0,o.Cg)([(0,a.$)("esri.portal.PortalUser")],d)},96360:(t,e,r)=>{r.d(e,{A:()=>d});var o,s=r(31635),i=r(49186),l=r(25482),a=r(10107),n=r(56507),u=(r(44208),r(87811),r(64108)),p=r(16405);let d=o=class extends l.o{constructor(t){super(t),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){const t=this.url,e=this.thumbnail;return t&&e&&this.portal?this.portal?.normalizeUrl(`${t}/info/${e}?f=json`):null}get url(){const t=this.portal?.restUrl;return t?t+"/community/groups/"+this.id:null}fetchCategorySchema(t){return this.portal.request(this.url+"/categorySchema",t).then(e=>{const r=e.categorySchema||[];return r.some(t=>"contentCategorySetsGroupQuery.LivingAtlas"===t.source)?this._fetchCategorySchemaSet("LivingAtlas",t):r})}fetchMembers(t){return this.portal.request(this.url+"/users",t)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}toJSON(){throw new i.A("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const e=new o({sourceJSON:t});return e.read(t),e}queryItems(t,e){let r=(0,n.dp)(p.A,t);const o=this.portal;return parseFloat(o.currentVersion)>5?(r=r||new p.A,o.queryPortal(`/content/groups/${this.id}/search`,r,"PortalItem",e)):(r=r?r.clone():new p.A,r.query="group:"+this.id+(r.query?" "+r.query:""),o.queryItems(r,e))}_fetchCategorySchemaSet(t,e){const r=this.portal;return r.fetchSelf(r.authMode,!0,e).then(t=>{const o=t.contentCategorySetsGroupQuery;if(o){const t=new p.A({disableExtraQuery:!0,num:1,query:o});return r.queryGroups(t,e)}throw new i.A("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(r=>{if(r.total){const o=r.results[0],s=new p.A({num:1,query:`typekeywords:"${t}"`});return o.queryItems(s,e)}throw new i.A("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(t=>t.total?t.results[0].fetchData("json",e).then(t=>{const e=t?.categorySchema;return e?.length?e:[]}):[])}};(0,s.Cg)([(0,a.MZ)()],d.prototype,"access",void 0),(0,s.Cg)([(0,a.MZ)({type:Date})],d.prototype,"created",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"description",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"id",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"isInvitationOnly",void 0),(0,s.Cg)([(0,a.MZ)({type:Date})],d.prototype,"modified",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"owner",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"portal",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"snippet",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"sortField",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"sortOrder",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"sourceJSON",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"tags",void 0),(0,s.Cg)([(0,a.MZ)()],d.prototype,"thumbnail",void 0),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],d.prototype,"thumbnailUrl",null),(0,s.Cg)([(0,a.MZ)()],d.prototype,"title",void 0),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],d.prototype,"url",null),d=o=(0,s.Cg)([(0,u.$)("esri.portal.PortalGroup")],d)}}]);
@@ -1,5 +0,0 @@
1
- /*
2
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
- See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
- */
5
- import{__decorate as t,__addDisposableResource as e,__disposeResources as s}from"tslib";import r from"../../../core/Accessor.js";import{disposable as o}from"../../../core/handleUtils.js";import{addMany as i,deleteMany as n}from"../../../core/SetUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{trackAccess as p}from"../../../core/accessorSupport/tracking.js";import{SimpleObservable as h}from"../../../core/accessorSupport/tracking/SimpleObservable.js";import{Part as l,EditGeometry as d}from"./EditGeometry.js";import{EditGeometryOperations as u}from"./EditGeometryOperations.js";import{ReplayableAppendVertex as y}from"./operations/ReplayableAppendVertex.js";import{UndoGroup as f}from"./operations/UndoGroup.js";class m extends u{constructor(t,e,s){super(t,e,s),this._checkpoints=[],this._observable=new h,this._suppressChangeEvents=!1}createCheckpoint(t,e){const s=new _({data:this.data,status:t,geometryType:e});return this._checkpoints.push(s),s}completeCheckpoint(t){const e=t?this._checkpoints.indexOf(t):-1;if(e<0||!t)return null;this._checkpoints.splice(e,1);const s=e-1,r=s>-1?this._checkpoints.at(s):void 0;return r?.merge(t)??t.destroy(),this._checkpoints.forEach(t=>"committed"===t.status&&t.redoStack?.splice(0)),this._observable.notify(),null}cancelCheckpoint(t){const e=t?this._checkpoints.indexOf(t):-1;if(e<0||!t)return null;this._checkpoints.splice(e,1);return t.close().undo(),this._observable.notify(),null}undo(){const t=this._checkpoints.findLast(t=>"committed"===t.status&&t.undoStack?.length);if(!t)return null;const e=this._checkpoints.filter(t=>"committed"!==t.status).reverse(),s=this._suppressEvents(()=>e.map(t=>({cp:t,ops:t.rewind()})));try{return t?.undo()}finally{s&&this._suppressEvents(()=>{for(const{cp:t,ops:e}of s)t.replay(e)}),this._observable.notify(),this._checkpoints.forEach(t=>t.notify())}}redo(){const t=this._checkpoints.find(t=>"committed"===t.status&&t.redoStack?.length);if(!t)return null;const e=this._checkpoints.filter(t=>"committed"!==t.status).reverse(),s=this._suppressEvents(()=>e.map(t=>({cp:t,ops:t.rewind()})));try{return t?.redo()}finally{s&&this._suppressEvents(()=>{for(const{cp:t,ops:e}of s)t.replay(e)}),this._observable.notify(),this._checkpoints.forEach(t=>t.notify())}}emit(t,e){return!this._suppressChangeEvents&&super.emit(t,e)}appendVertex(t,e){return e??=new l(this.data.spatialReference,this.viewingMode),this._apply(new y(this.data,e,t))}appendVertexToFirstPart(t){const e=this.data.parts.at(0);return e?this._apply(new y(this.data,e,t)):null}get canUndo(){return p(this._observable),this._checkpoints.some(t=>"committed"===t.status&&t.undoStack?.length)}get canRedo(){return p(this._observable),this._checkpoints.some(t=>"committed"===t.status&&t.redoStack?.length)}get lastOperation(){return p(this._observable),this._checkpoints?.findLast(t=>(t.undoStack?.length??0)>0)?.undoStack?.at(-1)}_apply(t,e=1){const s=this._checkpoints.at(-1);if(!s)return t;const r=s.undoStack?.at(-1);try{if(0!==e&&null!=r&&r.accumulate(t))s.notify();else{const e=k(t,this.data,"apply");s.undoStack?.push(t),s.syncOwnVertices(e),s.redoStack?.splice(0)}}finally{this._observable.notify()}return t}get test(){const{_checkpoints:t,_undoStack:e,_redoStack:s}=this;return{checkpoints:t,undoStack:e,redoStack:s}}_suppressEvents(t){this._suppressChangeEvents=!0;try{return t()}finally{this._suppressChangeEvents=!1}}static fromGeometry(t,e,s){return new m(d.fromGeometry(t,e,s),e,!!s?.allowCurves)}}let _=class extends r{constructor(t){super(t),this.undoStack=[],this.redoStack=[],this._ownVertices=new Set,this.data=null,this.status=t.status,this.geometryType=t.geometryType}destroy(){this.undoStack=null,this.redoStack=null,this._ownVertices.clear(),this.data=null}get finalVertex(){return this._finalVertex}get geometry(){const t=this._startingVertex?.leftSegment?.leftVertex??this._startingVertex;return t||this._finalVertex?this.data?.getPartialGeometry(t,this._finalVertex,this.geometryType):null}undo(){const t=this.undoStack?.pop();return t&&this.data&&(this.syncOwnVertices(k(t,this.data,"undo")),this.redoStack?.push(t)),this.notify(),t}redo(){const t=this.redoStack?.pop();return t&&this.data&&(this.syncOwnVertices(k(t,this.data,"redo")),this.undoStack?.push(t)),this.notify(),t}rewind(){const t=[];let e=this.undoStack?.pop();for(;e;)e.undo(),t.push(e),e=this.undoStack?.pop();return t}replay(t){let e=t.pop();for(;e;)e.apply(),this.undoStack?.push(e),e=t.pop();this.notify()}syncOwnVertices(t){const e=this._ownVertices;for(const o of t){const{addedVertices:t,removedVertices:s}=o;i(e,t),n(e,s)}let s=null,r=null;for(const o of e)(!s||o.part.index<s.part.index||o.part.index===s.part.index&&o.index<=s.index)&&(s=o),(!r||o.part.index>r.part.index||o.part.index===r.part.index&&o.index>r.index)&&(r=o);this._startingVertex=s,this._finalVertex=r}close(){const t=new f(this.undoStack??[]);return this.destroy(),t}merge(t){i(this._ownVertices,t._ownVertices),this.undoStack?.push(t.close()),this.redoStack?.splice(0),this.syncOwnVertices([]),this.notify()}notify(){this.notifyChange("geometry")}get test(){const{_finalVertex:t,_startingVertex:e,_ownVertices:s}=this;return{finalVertex:t,startingVertex:e,ownedVertices:s}}};function k(t,r,i){const n={stack:[],error:void 0,hasError:!1};try{const s=[];e(n,o(r.on("change",t=>s.push(t))),!1);switch(i){case"apply":case"redo":t.apply();break;case"undo":t.undo()}return s}catch(c){n.error=c,n.hasError=!0}finally{s(n)}}t([c({constructOnly:!0})],_.prototype,"status",void 0),t([c({constructOnly:!0})],_.prototype,"geometryType",void 0),t([c()],_.prototype,"data",void 0),t([c()],_.prototype,"finalVertex",null),t([c()],_.prototype,"geometry",null),t([c()],_.prototype,"_startingVertex",void 0),t([c()],_.prototype,"_finalVertex",void 0),_=t([a("esri.views.interactive.editGeometry.CheckpointingEditGeometryOperations")],_);export{_ as Checkpoint,m as CheckpointingEditGeometryOperations};