@arcgis/core 4.34.0-next.58 → 4.34.0-next.59

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 (229) hide show
  1. package/Basemap.js +1 -1
  2. package/LICENSE.md +19 -0
  3. package/README.md +2 -18
  4. package/applications/KnowledgeStudio/reshape.d.ts +5 -0
  5. package/applications/KnowledgeStudio/reshape.js +5 -0
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/{26975e5b3fb7f2ed45a4.js → 03fe4164abd12abc7921.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{893e5eb5c028c4704317.js → 0427f66b56ec6601deb0.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0cb2f7172190babb4139.js +1 -0
  10. package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +1 -0
  11. package/assets/esri/core/workers/chunks/{1776ef96c9f4636f8838.js → 138c11b5eca621e51396.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{57c438bb0da6410df525.js → 1bf17c6548ac4cd5a166.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{043bb97e38e3a54aa2ab.js → 1ed7a8f4a0058d3b69ef.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{827bebb4bcdde23adc91.js → 251b7f2e295ce191eb62.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{02a31483e09652a1a1a2.js → 2b7f9a57a2cfbc108673.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{7c86af4f60cea383ed96.js → 39a1f361bb69073af765.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{327b0da744426ce40e60.js → 3a7ac10a6614fe5745f7.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{8c79945909069733558f.js → 4094cebc4b92c52f4e27.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{82de1b50ae286f1e6c44.js → 451761c7bd2da530e1d0.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{cc748d4f4adb9c584aa4.js → 45aeff2f751f124f8e53.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{d20af70b23f175fb5442.js → 48b9ba825856a0c843ff.js} +1 -1
  22. package/assets/esri/core/workers/chunks/4dee2f05508e90410f13.js +1 -0
  23. package/assets/esri/core/workers/chunks/{d630fc3acd2552c98dc0.js → 547af4ffbeeccba9d187.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{ff14b632f147cb68ed59.js → 58422c616a824ab49218.js} +1 -1
  25. package/assets/esri/core/workers/chunks/589a0e244ef5f1b84ab6.js +1 -0
  26. package/assets/esri/core/workers/chunks/{2c7e7895c4dda176220e.js → 5d4b24c864ebb68ae61e.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{a1ff4c252012d5026133.js → 65eb183b5d001dfc42c8.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{f1b6d6ee03635d985c3e.js → 6688efc71d9d8f4d2559.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{d5faf3ddf9a39de826be.js → 672c04d48aa51f16e9b7.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{17e203e4680c07bd02f1.js → 7aa7aff6d42be7c2d1d2.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{549e073fe276363a9896.js → 7db105f6b688b6da8106.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{945c5a477940ebd23a4c.js → 7f0c78bcba0aed3c4eff.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{3eb792863a789b97ec58.js → 831a69e5a87e92830fbe.js} +1 -1
  34. package/assets/esri/core/workers/chunks/83dfaa6e3bd58d544f35.js +1 -0
  35. package/assets/esri/core/workers/chunks/8bbae8ac586e5c0819d2.js +1 -0
  36. package/assets/esri/core/workers/chunks/{9275313e0f1f521b2658.js → 9325000c87295c473291.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{944d1608f935516951c4.js → 94b9948ec628187c19fc.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{757717416d909059df2f.js → 981275b6f008431c983a.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{c71dac67f95d694bf67e.js → 9f4e23bae621ff3ecea3.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{989251f5e0d6a08b1afa.js → a17ed7ce97e69466d730.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{319fe6a02ec630a827ea.js → a7ea2e3895046e566bc6.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{5cfec58c7c31e6d8c6ea.js → abe60d92e0219ee97036.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{4193691ca076948f4f90.js → b53008c1461dd6bacc63.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{1d234c057a6671acc59f.js → b605dfdfed8ff8eda4f3.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{0fb2dcbd54175e75d94d.js → b68b54be3d67595a9446.js} +4 -6
  46. package/assets/esri/core/workers/chunks/{7eda1c400658b6a99be8.js → ba0c7339fa19cc7cbde7.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{724de82d101eb59c2834.js → bd451668c4ce9f7d7128.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{91ede8c62a7b1e8b8023.js → be06c8a58c217a17451b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{08c0c016787caa169492.js → c24214666d10cb648428.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{a3a23a56df4e5ee86bb2.js → c5fe356fc5b8b7be0d31.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{64fab4e1e28c06c83403.js → c779c8b98e07fa881c1d.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{4a0257c449f31bdadf26.js → cef9ff811221a7c3812c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{b1982490762972ae023d.js → d0296368ae143de4d5ce.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{3d5954478864a975e65e.js → d07d3b0e06f12aee4a8b.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{e1472dbf0795d737d6f8.js → d2371f5034b2a32e2523.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{2f65081bfedeab44d6cb.js → d35cadfb78ac9803069b.js} +1 -1
  57. package/assets/esri/core/workers/chunks/d7ce68667bb355ef8e5d.js +1 -0
  58. package/assets/esri/core/workers/chunks/{8c2fcfcfbb6b70f7bada.js → d823277612f971a9c2f0.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{c4ff5c78fc8668af9c05.js → d91b80aa4f847c2e2a33.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{c4ceb267d4004d8da8cc.js → e0bbfbe1ed39c82f1bd4.js} +1 -1
  61. package/assets/esri/core/workers/chunks/e58c5c8639aa837c84d1.js +1 -0
  62. package/assets/esri/core/workers/chunks/{a24762e976c1459b12de.js → e689a4849f5af3f2f641.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{5787101b2b814c5d2439.js → eacc7fccdc3fb670ac8f.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{0df1f56df6d47dfbb6ea.js → eada3483116a5ea8baed.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{47682247910271077333.js → ee78a38a0cacb19b2fd4.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{f4061587ff5789fa4e1f.js → f594df2f5ce6ca41a254.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{d7b3e81cc313fd0a33b0.js → f5c821ca2911a5103c9a.js} +1 -1
  68. package/assets/esri/core/workers/chunks/f711aeba1a2c184ddb43.js +1 -0
  69. package/assets/esri/core/workers/chunks/fdae43a97537093e4b97.js +1 -0
  70. package/chunks/BloomComposition.glsl.js +36 -18
  71. package/chunks/ComponentShader.glsl.js +1 -1
  72. package/chunks/CompositeGeographicTransformation.js +1 -1
  73. package/chunks/DefaultMaterial.glsl.js +1 -1
  74. package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
  75. package/chunks/GeographicTransformation.js +1 -1
  76. package/chunks/MultiPathImpl.js +1 -1
  77. package/chunks/OperatorGeodesicBuffer.js +1 -1
  78. package/chunks/OperatorGeodeticArea.js +1 -1
  79. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  80. package/chunks/OperatorGeodeticLength.js +1 -1
  81. package/chunks/OperatorProximityGeodesic.js +1 -1
  82. package/chunks/OperatorShapePreservingLength.js +1 -1
  83. package/chunks/OperatorShapePreservingProject.js +1 -1
  84. package/chunks/Path.glsl.js +1 -1
  85. package/chunks/Point2D.js +1 -1
  86. package/chunks/ProjectionTransformation.js +1 -1
  87. package/chunks/RealisticTree.glsl.js +1 -1
  88. package/chunks/SpatialReference.js +1 -1
  89. package/chunks/UnitFactory.js +1 -1
  90. package/chunks/sphere.js +1 -1
  91. package/chunks/vec42.js +1 -1
  92. package/config.js +1 -1
  93. package/copyright.txt +2 -20
  94. package/core/accessorSupport/layerContainerType.js +1 -1
  95. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  96. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  97. package/core/quantityFormatUtils.js +1 -1
  98. package/core/unitFormatUtils.js +1 -1
  99. package/editing/geometry/coordUtils.js +5 -0
  100. package/editing/geometry/lineUtils.js +5 -0
  101. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  102. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  103. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  104. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  105. package/editing/sharedTemplates/executor/builders/support/shapeUtils.js +1 -1
  106. package/geometry/coordinateFormatter.js +1 -1
  107. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  108. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  109. package/geometry/operators/gx/operatorOffset.js +1 -1
  110. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  111. package/geometry/operators/support/apiConverter.js +1 -1
  112. package/geometry/operators/support/initNoPeFactory.js +1 -1
  113. package/geometry/operators/support/jsonConverter.js +1 -1
  114. package/geometry/support/sphere.js +1 -1
  115. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  116. package/graphic/LinkChartGraphicOrigin.js +5 -0
  117. package/graphic/isLinkChartGraphicOrigin.js +5 -0
  118. package/interfaces.d.ts +129 -10
  119. package/kernel.js +1 -1
  120. package/layers/FeatureLayer.js +1 -1
  121. package/layers/GroundLayer.js +1 -1
  122. package/layers/ParquetLayer.js +1 -1
  123. package/layers/catalog/catalogUtils.js +1 -1
  124. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  125. package/layers/knowledgeGraph/nodeMovementUtils.js +5 -0
  126. package/layers/mixins/ImageryTileMixin.js +1 -1
  127. package/layers/mixins/operationalLayers.js +1 -1
  128. package/layers/support/RasterStorageInfo.js +1 -1
  129. package/layers/support/Sublayer.js +1 -1
  130. package/layers/support/layersCreator.js +1 -1
  131. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  132. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  133. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  134. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  135. package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
  136. package/package.json +1 -1
  137. package/portal/schemas/definitions.js +1 -1
  138. package/renderers/support/RasterSymbolizer.js +1 -1
  139. package/support/basemapUtils.js +1 -1
  140. package/support/revision.js +1 -1
  141. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  142. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  143. package/views/3d/camera/constraintUtils/distance.js +1 -1
  144. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  145. package/views/3d/layers/I3SMeshView3D.js +1 -1
  146. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  147. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  148. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  149. package/views/3d/layers/graphics/ElevationContext.js +1 -1
  150. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  151. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  152. package/views/3d/layers/graphics/pointUtils.js +1 -1
  153. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  154. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  155. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  156. package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
  157. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  158. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  159. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  160. package/views/3d/state/utils/navigationUtils.js +1 -1
  161. package/views/3d/support/CombinedElevationProvider.js +1 -1
  162. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  163. package/views/3d/terrain/OverlayManager.js +1 -1
  164. package/views/3d/terrain/SphericalPatch.js +1 -1
  165. package/views/3d/terrain/TerrainSurface.js +1 -1
  166. package/views/3d/terrain/Tile.js +1 -1
  167. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  168. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -4
  169. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  170. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  171. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  172. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechniqueConfiguration.js +5 -0
  173. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  174. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  175. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  176. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  177. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  178. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  179. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  180. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  181. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  182. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  183. package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
  184. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  185. package/views/LinkChartView.js +1 -1
  186. package/views/draw/DrawOperation.js +1 -1
  187. package/views/draw/support/GraphicMover.js +1 -1
  188. package/views/draw/support/HighlightHelper.js +1 -1
  189. package/views/draw/support/Reshape.js +1 -1
  190. package/views/draw/support/drawUtils.js +1 -1
  191. package/views/interactive/Tooltip.js +1 -1
  192. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  193. package/views/interactive/sketch/SketchLabelOptions.js +1 -1
  194. package/views/interactive/sketch/SketchOptions.js +1 -1
  195. package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
  196. package/views/interactive/sketch/SketchTooltipVisibleElements.js +1 -1
  197. package/views/interactive/sketch/SketchValueOptions.js +1 -1
  198. package/views/interactive/sketch/Units.js +1 -1
  199. package/views/interactive/sketch/constraints.js +1 -1
  200. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  201. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  202. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  203. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  204. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  205. package/views/interactive/tooltip/fields/fields.js +1 -1
  206. package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
  207. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  208. package/views/support/angularMeasurementUtils.js +1 -1
  209. package/webdoc/support/writeUtils.js +1 -1
  210. package/webscene/spec-certification/api.js +1 -1
  211. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  212. package/widgets/Editor/support/splitFeatureUtils.js +5 -0
  213. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  214. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  215. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  216. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  217. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  218. package/widgets/OrientedImageryViewer.js +1 -1
  219. package/EULA.pdf +0 -0
  220. package/assets/esri/core/workers/chunks/00ee6f84119bc55a222f.js +0 -1
  221. package/assets/esri/core/workers/chunks/0569698a3e4eaf2bac8e.js +0 -1
  222. package/assets/esri/core/workers/chunks/0e4976f92b66793137c4.js +0 -1
  223. package/assets/esri/core/workers/chunks/171ce8c64f322cd5d6d1.js +0 -1
  224. package/assets/esri/core/workers/chunks/1ae15163af8875148fb8.js +0 -1
  225. package/assets/esri/core/workers/chunks/373c9e17e2834dfc1839.js +0 -1
  226. package/assets/esri/core/workers/chunks/55bb794bcdd9cc788322.js +0 -1
  227. package/assets/esri/core/workers/chunks/6acffacbb4a03af52e3b.js +0 -1
  228. package/assets/esri/core/workers/chunks/b457b7dd907f06278bee.js +0 -1
  229. package/assets/esri/core/workers/chunks/e7ccf067bea8f4766424.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9784],{8947:(e,t,i)=>{i.d(t,{L:()=>n});var r=i(60999),s=i(74887),o=i(67076);async function n(e,t,i){const n=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(n&&"unique-value"===n.type&&n.styleOrigin){const a=await(0,r.Ke)(n.populateFromStyle());if((0,s.Te)(i),!1===a.ok){const i=a.error;t?.messages&&t.messages.push(new o.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${i.message}`,{error:i,context:t})),e.clear("renderer",t?.origin)}}}},29784:(e,t,i)=>{i.r(t),i.d(t,{default:()=>xe});var r=i(31635),s=i(13874),o=i(78888),n=i(69540),a=i(7762),l=i(49186),u=i(4718),p=i(53966),d=i(97768),y=i(92071),c=i(93637),h=i(74887),g=i(39516),f=i(10107),m=i(79901),b=i(36005),w=i(40608),v=i(43937),C=i(89317),T=i(38141),F=i(16930),M=i(99959);const S=Symbol("isFeatureGraphicOrigin");var _;class I extends M.A{static{_=S}constructor(e){super(),this[_]=!0,this.type="feature",this.layer=e}}var E=i(4146),A=i(52106),O=i(44208),Z=i(92474),j=i(61893),D=i(29953),q=i(56507),L=(i(87811),i(7695)),P=i(5443),x=i(39829),R=i(50498),G=i(96520),k=i(58501),J=i(22671);let N=0,$=class extends((0,Z.WV)((0,j.g)(a.A))){constructor(e){super(e),this._idToClientGeometry=null,this.type="memory"}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);(0,k.q)(e,this.layer.spatialReference,i);const r=J.A.fromJSON(i);if(!this._requiresClientGraphicMapping()||!this._idToClientGeometry)return r;const s=this.layer.objectIdField;for(const e of r.features){const t=e.attributes[s],i=this._idToClientGeometry.get(t);void 0!==i&&(e.geometry=i)}return r.geometryType=this.layer.geometryType,r}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new l.A("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return(0,k.q)(e,this.layer.spatialReference,i),i}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(e=>({count:e.count,extent:P.A.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async queryAttributeBins(e,t={}){return await this.load(),this._connection.invoke("queryAttributeBins",e?.toJSON(),t)}async _applyEdits(e){if(!this._connection)throw new l.A("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let i=null;const r=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const o=e=>"objectId"in e&&null!=e.objectId?e.objectId:"attributes"in e&&null!=e.attributes[t]?e.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const t of e.deleteFeatures){const e=o(t);null!=e&&r.push(e)}const n=e.updateFeatures&&this._idToClientGeometry?new Map:null;if(e.updateFeatures)for(const t of e.updateFeatures)if(s.push(this._serializeFeature(t)),n&&null!=t.geometry){const e=o(t);null!=e&&n.set(e,t)}(0,G.u)(i?i.features:null,s,this.layer.spatialReference);const{fullExtent:a,featureEditResults:u}=await this._connection.invoke("applyEdits",{adds:i?i.features:[],updates:s,deletes:r});return this.fullExtent=a,i&&i.finish(u.uidToObjectId),this._updateIdToClientGeometries(n,u),this._createEditsResult(u)}async _prepareClientMapping(e,t){if("mesh"!==this._layerOrSourceGeometryType||null==e)return;const i=[];for(const{geometry:r}of e)null==r||"mesh"!==r.type||r.hasExtent||r.loaded||i.push(r.load({signal:t}));i.length&&await Promise.all(i)}_updateIdToClientGeometries(e,t){if(this._idToClientGeometry){if(e)for(const i of t.updateResults){if(!i.success)continue;const t=e.get(i.objectId);null!=t&&this._addIdToClientGeometry(t)}for(const e of t.deleteResults)e.success&&this._idToClientGeometry.delete(e.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:""};return{objectId:e.objectId,globalId:e.globalId,error:t?new l.A("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,i=new Array(e.length);let r=null;for(let s=0;s<e.length;s++){const o=e[s],n=this._serializeFeature(o);r||null==o.geometry||(r=o.geometry.type),i[s]=n,t.set(`${n.uid}`,o)}const s=this;return{features:i,inferredGeometryType:r,finish(e){const i=s.sourceJSON.objectIdField;for(const r in e){const o=e[r],n=t.get(r);n&&(n.attributes||(n.attributes={}),-1===o?delete n.attributes[i]:n.attributes[i]=o,s._addIdToClientGeometry(n))}}}}_addIdToClientGeometry(e){if(!this._idToClientGeometry)return;const t=this.sourceJSON.objectIdField,i=e.attributes?.[t];null!=i&&this._idToClientGeometry.set(i,e.geometry??null)}get _layerOrSourceGeometryType(){return this.layer?.geometryType??this.sourceJSON?.geometryType}_requiresClientGraphicMapping(){return this._geometryTypeRequiresClientGraphicMapping(this._layerOrSourceGeometryType)}_geometryRequiresClientGraphicMapping(e){return this._geometryTypeRequiresClientGraphicMapping(e.type)}_geometryTypeRequiresClientGraphicMapping(e){return"mesh"===e||"multipatch"===e||"extent"===e}_serializeFeature(e){const{attributes:t}=e,i=this._geometryForSerialization(e),r=(N++).toString();return i?{uid:r,geometry:i.toJSON(),attributes:t}:{uid:r,attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return null==t?null:this._geometryRequiresClientGraphicMapping(t)?t.extent?x.A.fromExtent(t.extent):null:t}async _startWorker(e){this._connection=await(0,D.ho)("MemorySourceWorker",{strategy:(0,O.A)("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:i,objectIdField:r,hasM:s,hasZ:o,timeInfo:n,dateFieldsTimeZone:a}=this.layer,l="defaults"===this.layer.originOf("spatialReference");await this._prepareClientMapping(this.items,e);const u=this._prepareAddFeatures(this.items);this.addHandles(this.on("before-changes",e=>{p.A.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),e.preventDefault()}));const d={features:u.features,fields:t?.map(e=>e.toJSON()),geometryType:R.Ye.toJSON(this._workerGeometryType),hasM:"mesh"!==this._layerOrSourceGeometryType&&s,hasZ:"mesh"===this._layerOrSourceGeometryType||o,objectIdField:r,spatialReference:l?null:i&&i.toJSON(),timeInfo:n?.toJSON()??null,dateFieldsTimeZone:a},y=await this._connection.invoke("load",d,{signal:e});for(const e of y.warnings)p.A.getLogger(this.layer).warn("#load()",`${e.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:e});y.featureErrors.length&&p.A.getLogger(this.layer).warn("#load()",`Encountered ${y.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:y.featureErrors});const c=y.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(u.inferredGeometryType)&&(c.geometryType=R.Ye.toJSON(u.inferredGeometryType)),this.sourceJSON=c,this._requiresClientGraphicMapping()&&(this._idToClientGeometry=new Map),u.finish(y.assignedObjectIds)}};(0,r.Cg)([(0,L.u)({Type:A.A,ensureType:(0,q.dp)(A.A)})],$.prototype,"itemType",void 0),(0,r.Cg)([(0,f.MZ)()],$.prototype,"type",void 0),(0,r.Cg)([(0,f.MZ)({constructOnly:!0})],$.prototype,"layer",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],$.prototype,"_workerGeometryType",null),(0,r.Cg)([(0,f.MZ)()],$.prototype,"sourceJSON",void 0),$=(0,r.Cg)([(0,w.$)("esri.layers.graphics.sources.MemorySource")],$);var V=i(52136),K=i(18768),Q=i(63074),W=i(69208),z=i(6455),B=i(47685),H=i(87718),U=i(87796),Y=i(76294),X=i(16131),ee=i(32756),te=i(8303),ie=i(65008);let re=class extends ie.A{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};(0,r.Cg)([(0,f.MZ)()],re.prototype,"updating",void 0),(0,r.Cg)([(0,f.MZ)()],re.prototype,"status",void 0),re=(0,r.Cg)([(0,w.$)("esri.layers.support.PublishingInfo")],re);const se=Symbol(),oe=e=>{var t;const i=e;let s=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=se}get publishingInfo(){if(this.destroyed)return null;const e=this._get("publishingInfo");if(e)return e;const t=new re;return this._checkPublishingStatus(t),t}_checkPublishingStatus(e){let t=0;const i=async s=>{let o;e.updating=!0;try{o=await this.fetchPublishingStatus()}catch(e){o="unavailable"}"published"!==o&&"unavailable"!==o||("publishing"===e.status&&this.refresh(),r.remove()),e.status=o,e.updating=!1,r.removed||(t=setTimeout(i,s,s+125))},r={removed:!1,remove(){this.removed=!0,clearTimeout(t)}};this.when().catch(()=>r.remove()),i(250),this.addHandles(r)}};return(0,r.Cg)([(0,f.MZ)({readOnly:!0,clonable:!1})],s.prototype,"publishingInfo",null),s=(0,r.Cg)([(0,w.$)("esri.layers.mixins.PublishableLayer")],s),s};var ne=i(54310),ae=i(25036),le=i(82935),ue=i(68109),pe=i(60694),de=i(10873),ye=i(15426),ce=i(29005),he=i(33143),ge=i(17036),fe=i(30524),me=i(46499),be=i(39383),we=i(22453),ve=i(96184),Ce=i(17311),Te=i(91908),Fe=i(27733),Me=i(65494),Se=i(8947),_e=i(41214),Ie=i(61956),Ee=i(54218),Ae=i(30291),Oe=i(33910),Ze=i(78553);const je="FeatureLayer";function De(e,t){return new l.A("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function qe(e){return e&&e instanceof a.A}const Le=(0,ge.p)();function Pe(e,t,i){const r=!!i?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let xe=class extends((0,U.j)((0,Y.J)((0,H.F)(oe((0,B.w6)((0,z.FJ)((0,Q.dM)((0,ee.fY)((0,le.e)((0,ue.d)((0,ae.j)((0,ne.J)((0,K.b)((0,X.q)((0,te.A)((0,y.P)((0,W.d)((0,V.p)((0,n.OU)(E.A)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new I(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=F.A.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=(0,h.sg)(async(e,t,r)=>{const{save:s,saveAs:o}=await i.e(3359).then(i.bind(i,33359));switch(e){case 0:return s(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(h.QP).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new l.A("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>(0,ye.VA)(this,"load",e));return this.addResolvingPromise(i),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return(0,d.pR)(e),new Ce.A({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,(0,we.S)(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,i){return this._readEditingEnabled(t,!0,i)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,i,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return(0,ye.C$)(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,i,r){r?.writeLayerSchema&&(0,c.sM)(i,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return(0,ye.jD)(t.layerDefinition||t)}readObjectIdField(e,t){return(0,ye.Zm)(t.layerDefinition||t)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){(0,fe.yp)(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){t=t.layerDefinition||t;const r=t.drawingInfo?.renderer;if(r){const e=(0,Me.L)(r,t,i)??void 0;return e||p.A.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),e}return(0,ye.PD)(t,i)}set source(e){const t=this._get("source");t!==e&&(qe(t)&&this._resetMemorySource(t),qe(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof a.A?new $({layer:this,items:e}):e:null}readSource(e,t){const i=J.A.fromJSON(t.featureSet);return new $({layer:this,items:i?.features??[]})}readTemplates(e,t){const i=t.editFieldsInfo,r=i?.creatorField,s=i?.editorField;return e=e?.map(e=>ce.A.fromJSON(e)),this._fixTemplates(e,r),this._fixTemplates(e,s),e}readTitle(e,t){const i=t.layerDefinition?.name??t.name,r=t.title||t.layerDefinition?.title;if(i){const e=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?(0,pe.yG)(this.url,i):i;let t=i;if(!t&&this.url){const e=(0,pe.qg)(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),(0,pe.cr)(t)}if("item-title"===this.sublayerTitleMode&&r)return r}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let i=(t=t.layerDefinition||t).typeIdField;if(i&&t.fields){i=i.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===i);e&&(i=e.name)}return i}readTypes(e,t){e=(t=t.layerDefinition||t).types;const i=t.editFieldsInfo,r=i?.creatorField,s=i?.editorField;return e?.map(e=>(e=he.A.fromJSON(e),this._fixTemplates(e.templates,r),this._fixTemplates(e.templates,s),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const i=await(0,ye.Xl)(this,e,t,je);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,i){const r=await(0,ye.bt)(this,e,t,i,je);return this.lastEditsEventDate=new Date,r}async applyEdits(e,t){return(0,ye.ct)(this,e,t)}async uploadAssets(e,t){return(0,ye.rn)(this,e,t)}createPopupTemplate(e){return(0,Ae.tn)(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await(0,h.qr)(Promise.all([i.e(708),i.e(364),i.e(8628),i.e(2593)]).then(i.bind(i,72593)),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=(0,ye.VZ)(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,i=(0,g.mA)(this.definitionExpression,t);return e.where=i||"1=1",e}async deleteAttachments(e,t){const i=await(0,ye.mm)(this,e,t,je);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return(0,ye.WP)(this,e,je)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return(0,ye.xd)(this.types,this.typeIdField,e)}getFieldDomain(e,t){return(0,ye.Vq)(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return(0,ye.lV)(this,e,t,je)}async queryFeatures(e,t){const i=await this.load(),r=await i.source.queryFeatures(Ie.A.from(e)??i.createQuery(),t);if(r?.features)for(const e of r.features)e.layer=e.sourceLayer=i,e.origin=this.graphicOrigin;return r}async queryObjectIds(e,t){return await(0,ye.sg)(this,e,t,je)}async queryFeatureCount(e,t){return(0,ye.Ye)(this,e,t,je)}async queryExtent(e,t){return(0,ye.B5)(this,e,t,je)}async queryRelatedFeatures(e,t){return(0,ye.hM)(this,e,t,je)}async queryRelatedFeaturesCount(e,t){return(0,ye.S2)(this,e,t,je)}async queryTopFeatures(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopFeatures||!s?.query?.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryTopFeatures capability");const o=await i.e(7561).then(i.bind(i,57561)),n=await r.queryTopFeatures(o.default.from(e),t);if(n?.features)for(const e of n.features)e.layer=e.sourceLayer=this;return n}async queryAttributeBins(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryAttributeBins)throw new l.A(je,"Layer source does not support queryAttributeBins capability");(0,ye.ZJ)(e,s,je);const o=await Promise.all([i.e(4575),i.e(7136)]).then(i.bind(i,14575)),n=await r.queryAttributeBins(o.default.from(e),t);if(n.features)for(const e of n.features)e.layer=e.sourceLayer=this;return n}async queryTopObjectIds(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopObjectIds||!s?.query.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryTopObjectIds capability");const o=await i.e(7561).then(i.bind(i,57561));return(await r.queryTopObjectIds(o.default.from(e),t)).filter(Ee.Et)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopExtents||!s?.query?.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryTopExtents capability");const o=await i.e(7561).then(i.bind(i,57561));return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopCount||!s?.query?.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryFeatureCount capability");const o=await i.e(7561).then(i.bind(i,57561));return r.queryTopCount(o.default.from(e),t)}read(e,t){const i=e.featureCollection;if((i||"Feature Collection"===e.type)&&(this.resourceInfo=e),i){const{layers:e,showLegend:r}=i;1===e?.length&&(super.read(e[0],t),null!=r&&super.read({showLegend:r},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:i,layerContainerType:r,messages:s}=t;if(this.dynamicDataSource)return s?.push(De(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(("web-map"===i||"web-scene"===i)&&"tables"!==r)return s?.push(De(this,`a table source can only be written to tables, not ${r}`)),null;if(this._hasMemorySource())return s?.push(De(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&("web-map"===i||"web-scene"===i)&&"tables"===r)return s?.push(De(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new l.A(je,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||(0,Te.D)(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,i){let r=e.layerDefinition?.capabilities;return r?this._hasEditingCapability(r):(r=e.capabilities,t&&"web-map"===i?.origin&&!this._hasMemorySource()&&r?this._hasEditingCapability(r):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,i,r){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";(0,c.sM)("layerDefinition.capabilities",e,t),i&&!r?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return(0,o.A)(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),(0,fe.yp)(this.renderer,this.fieldsIndex),(0,fe.sv)(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),(0,Se.L)(this,{origin:"service"})}async hasDataChanged(){return(0,ye.jp)(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const i=e.prototype?.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new l.A("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new l.A("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};(0,r.Cg)([(0,f.MZ)({clonable:!1,readOnly:!0})],xe.prototype,"_titleCreator",null),(0,r.Cg)([(0,f.MZ)(de.zQ)],xe.prototype,"attributeTableTemplate",void 0),(0,r.Cg)([(0,b.w)("service","capabilities")],xe.prototype,"readCapabilities",null),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],xe.prototype,"charts",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],xe.prototype,"createQueryVersion",null),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.copyrightText"}}})],xe.prototype,"copyright",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.displayField"}}})],xe.prototype,"displayField",void 0),(0,r.Cg)([(0,f.MZ)({types:Oe.Es,readOnly:!0})],xe.prototype,"defaultSymbol",void 0),(0,r.Cg)([(0,f.MZ)({type:Fe.L})],xe.prototype,"dynamicDataSource",void 0),(0,r.Cg)([(0,f.MZ)({type:Boolean})],xe.prototype,"editingEnabled",null),(0,r.Cg)([(0,b.w)(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],xe.prototype,"readEditingEnabled",null),(0,r.Cg)([(0,b.w)("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],xe.prototype,"readEditingEnabledFromWebMap",null),(0,r.Cg)([(0,v.K)(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],xe.prototype,"writeEditingEnabled",null),(0,r.Cg)([(0,v.K)("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],xe.prototype,"writeEditingEnabledToWebMap",null),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],xe.prototype,"effectiveEditingEnabled",null),(0,r.Cg)([(0,f.MZ)({clonable:!1,readOnly:!0})],xe.prototype,"featureTitleFields",null),(0,r.Cg)([(0,f.MZ)({...Le.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Pe}}}}})],xe.prototype,"fields",void 0),(0,r.Cg)([(0,f.MZ)(Le.fieldsIndex)],xe.prototype,"fieldsIndex",void 0),(0,r.Cg)([(0,f.MZ)({type:T.A,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],xe.prototype,"formTemplate",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.extent"}}})],xe.prototype,"fullExtent",void 0),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Pe,writer(e,t,i){const r=e?ye.iX.toJSON(e):null;r&&(0,c.sM)(i,r,t)}}}},read:{source:"layerDefinition.geometryType",reader:ye.iX.read}}})],xe.prototype,"geometryType",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0,clonable:!1})],xe.prototype,"graphicOrigin",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.hasM"}}})],xe.prototype,"hasM",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.hasZ"}}})],xe.prototype,"hasZ",void 0),(0,r.Cg)([(0,f.MZ)(de.id)],xe.prototype,"id",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],xe.prototype,"infoFor3D",void 0),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],xe.prototype,"isTable",void 0),(0,r.Cg)([(0,b.w)("service","isTable",["type","geometryType"]),(0,b.w)("isTable",["layerDefinition.type","layerDefinition.geometryType"])],xe.prototype,"readIsTable",null),(0,r.Cg)([(0,v.K)("web-map","isTable")],xe.prototype,"writeIsTable",null),(0,r.Cg)([(0,f.MZ)(de.kF)],xe.prototype,"labelsVisible",void 0),(0,r.Cg)([(0,f.MZ)({type:[me.A],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:be.w,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:be.w,write:{layerContainerTypes:C.K}}})],xe.prototype,"labelingInfo",void 0),(0,r.Cg)([(0,f.MZ)((()=>{const e=(0,u.o8)(de.Ih);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,i){(0,c.sM)(i,(0,Ze.p)(e),t)}}},e})())],xe.prototype,"opacity",void 0),(0,r.Cg)([(0,f.MZ)(de.fV)],xe.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,f.MZ)({type:["show","hide"],json:(()=>{const e=(0,u.o8)(de.C1.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],xe.prototype,"listMode",void 0),(0,r.Cg)([(0,b.w)("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],xe.prototype,"readGlobalIdField",null),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Pe}}}}})],xe.prototype,"objectIdField",void 0),(0,r.Cg)([(0,b.w)("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],xe.prototype,"readObjectIdField",null),(0,r.Cg)([(0,f.MZ)({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:C.K}}})],xe.prototype,"operationalLayerType",void 0),(0,r.Cg)([(0,f.MZ)(Le.outFields)],xe.prototype,"outFields",void 0),(0,r.Cg)([(0,f.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],xe.prototype,"path",void 0),(0,r.Cg)([(0,f.MZ)(de.M6)],xe.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,f.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],xe.prototype,"popupTemplate",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],xe.prototype,"defaultPopupTemplate",null),(0,r.Cg)([(0,f.MZ)({types:_e.Hg,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:_e.XJ,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:C.K,overridePolicy:(e,t,i)=>({ignoreOrigin:i?.writeLayerSchema,layerContainerTypes:C.K})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,i)=>({ignoreOrigin:i?.writeLayerSchema,layerContainerTypes:C.K})}}})],xe.prototype,"renderer",null),(0,r.Cg)([(0,b.w)("service","renderer",["drawingInfo.renderer","defaultSymbol"]),(0,b.w)("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],xe.prototype,"readRenderer",null),(0,r.Cg)([(0,f.MZ)()],xe.prototype,"resourceInfo",void 0),(0,r.Cg)([(0,f.MZ)((()=>{const e=(0,u.o8)(de.PY);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],xe.prototype,"screenSizePerspectiveEnabled",void 0),(0,r.Cg)([(0,f.MZ)({clonable:!1})],xe.prototype,"source",null),(0,r.Cg)([(0,m.w)("source")],xe.prototype,"castSource",null),(0,r.Cg)([(0,b.w)("portal-item","source",["featureSet"]),(0,b.w)("web-map","source",["featureSet"])],xe.prototype,"readSource",null),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],xe.prototype,"spatialReference",void 0),(0,r.Cg)([(0,f.MZ)({type:Number})],xe.prototype,"subtypeCode",void 0),(0,r.Cg)([(0,f.MZ)({type:[ce.A]})],xe.prototype,"templates",void 0),(0,r.Cg)([(0,b.w)("templates",["editFieldsInfo","creatorField","editorField","templates"])],xe.prototype,"readTemplates",null),(0,r.Cg)([(0,f.MZ)({type:ve.A})],xe.prototype,"timeInfo",void 0),(0,r.Cg)([(0,f.MZ)()],xe.prototype,"title",void 0),(0,r.Cg)([(0,b.w)("service","title",["name"]),(0,b.w)("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],xe.prototype,"readTitle",null),(0,r.Cg)([(0,b.w)("web-map","title",["layerDefinition.name","title"])],xe.prototype,"readTitleFromWebMap",null),(0,r.Cg)([(0,f.MZ)({type:String})],xe.prototype,"sublayerTitleMode",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:!1}})],xe.prototype,"type",void 0),(0,r.Cg)([(0,f.MZ)({type:String})],xe.prototype,"typeIdField",void 0),(0,r.Cg)([(0,b.w)("service","typeIdField"),(0,b.w)("typeIdField",["layerDefinition.typeIdField"])],xe.prototype,"readTypeIdField",null),(0,r.Cg)([(0,f.MZ)({type:[he.A]})],xe.prototype,"types",void 0),(0,r.Cg)([(0,b.w)("service","types",["types"]),(0,b.w)("types",["layerDefinition.types"])],xe.prototype,"readTypes",null),(0,r.Cg)([(0,f.MZ)({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:C.K}}}}})],xe.prototype,"visible",void 0),(0,r.Cg)([(0,b.w)("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],xe.prototype,"readVisible",null),xe=(0,r.Cg)([(0,w.$)("esri.layers.FeatureLayer")],xe)},68109:(e,t,i)=>{i.d(t,{d:()=>v});var r=i(31635),s=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),n=i(13874),a=i(69540),l=i(25482),u=i(93637),p=i(43937),d=i(50820),y=i(10873),c=i(46499),h=i(41214);let g=class extends((0,a.OU)(l.o)){constructor(e){super(e),this.labelingInfo=null,this.labelsVisible=!0,this.renderer=null,this.visible=!0}};(0,r.Cg)([(0,s.MZ)({type:[c.A],json:{write:!0}})],g.prototype,"labelingInfo",void 0),(0,r.Cg)([(0,s.MZ)(y.kF)],g.prototype,"labelsVisible",void 0),(0,r.Cg)([(0,s.MZ)({types:h.Hg,json:{write:!0}})],g.prototype,"renderer",void 0),(0,r.Cg)([(0,s.MZ)({type:Boolean,json:{write:!0}})],g.prototype,"visible",void 0),g=(0,r.Cg)([(0,o.$)("esri.layers.support.TrackPartInfo")],g);var f=i(96576),m=i(59868),b=i(26253);let w=class extends((0,a.OU)(l.o)){constructor(e){super(e),this.enabled=!0,this.fields=[],this.latestObservations=new g({renderer:new f.A({symbol:m.UK.clone()})}),this.maxDisplayDuration=null,this.maxDisplayObservationsPerTrack=0,this.popupEnabled=!0,this.popupTemplate=null,this.previousObservations=new g({renderer:new f.A({symbol:m.UK.clone()})}),this.trackLines=new g({renderer:new f.A({symbol:m.A7.clone()})}),this.timeField="startTimeField"}writeFields(e,t,i){const r=e.filter(e=>"avg_angle"!==e.statisticType).map(e=>e.toJSON());(0,u.sM)(i,r,t)}};(0,r.Cg)([(0,s.MZ)({type:Boolean,json:{write:!0}})],w.prototype,"enabled",void 0),(0,r.Cg)([(0,s.MZ)({type:[d.A],json:{write:!0}})],w.prototype,"fields",void 0),(0,r.Cg)([(0,p.K)("fields")],w.prototype,"writeFields",null),(0,r.Cg)([(0,s.MZ)({type:g,json:{write:!0}})],w.prototype,"latestObservations",void 0),(0,r.Cg)([(0,s.MZ)({type:b.T,json:{write:!0}})],w.prototype,"maxDisplayDuration",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],w.prototype,"maxDisplayObservationsPerTrack",void 0),(0,r.Cg)([(0,s.MZ)(y.M6)],w.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,s.MZ)({type:n.A,json:{name:"popupInfo",write:!0}})],w.prototype,"popupTemplate",void 0),(0,r.Cg)([(0,s.MZ)({type:g,json:{write:!0}})],w.prototype,"previousObservations",void 0),(0,r.Cg)([(0,s.MZ)({type:g,json:{write:!0}})],w.prototype,"trackLines",void 0),(0,r.Cg)([(0,s.MZ)({type:["timeReceived","startTimeField","endTimeField"],json:{read:!0,write:!0}})],w.prototype,"timeField",void 0),w=(0,r.Cg)([(0,o.$)("esri.layers.support.TrackInfo")],w);const v=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.trackInfo=null}};return(0,r.Cg)([(0,s.MZ)({type:w})],i.prototype,"trackInfo",void 0),i=(0,r.Cg)([(0,o.$)("esri.layers.mixins.TrackableLayer")],i),i}},96520:(e,t,i)=>{i.d(t,{u:()=>n});var r=i(83047),s=i(21325);function o(e,t,i){if(null==e.hasM||e.hasZ)for(const e of t)for(const t of e)t.length>2&&(t[2]*=i)}function n(e,t,i){if(!e&&!t||!i)return;const s=(0,r.G9)(i);a(e,i,s),a(t,i,s)}function a(e,t,i){if(e)for(const r of e)l(r.geometry,t,i)}function l(e,t,i){if(!e?.spatialReference||(0,s.aI)(e.spatialReference,t))return;const n=(0,r.G9)(e.spatialReference)/i;if(1!==n)if("x"in e)null!=e.z&&(e.z*=n);else if("rings"in e)o(e,e.rings,n);else if("paths"in e)o(e,e.paths,n);else if("points"in e&&(null==e.hasM||e.hasZ))for(const t of e.points)t.length>2&&(t[2]*=n)}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9784],{8947:(e,t,i)=>{i.d(t,{L:()=>n});var r=i(60999),s=i(74887),o=i(67076);async function n(e,t,i){const n=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(n&&"unique-value"===n.type&&n.styleOrigin){const a=await(0,r.Ke)(n.populateFromStyle());if((0,s.Te)(i),!1===a.ok){const i=a.error;t?.messages&&t.messages.push(new o.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${i.message}`,{error:i,context:t})),e.clear("renderer",t?.origin)}}}},29784:(e,t,i)=>{i.r(t),i.d(t,{default:()=>xe});var r=i(31635),s=i(13874),o=i(78888),n=i(69540),a=i(7762),l=i(49186),u=i(4718),p=i(53966),d=i(97768),y=i(92071),c=i(93637),h=i(74887),g=i(39516),f=i(10107),m=i(79901),b=i(36005),w=i(40608),v=i(43937),C=i(89317),T=i(38141),F=i(16930),M=i(99959);const S=Symbol("isFeatureGraphicOrigin");var _;class I extends M.A{static{_=S}constructor(e){super(),this[_]=!0,this.type="feature",this.layer=e}}var E=i(4146),A=i(52106),O=i(44208),Z=i(92474),j=i(61893),D=i(29953),q=i(56507),L=(i(87811),i(7695)),P=i(5443),x=i(39829),R=i(50498),G=i(96520),k=i(58501),J=i(22671);let N=0,$=class extends((0,Z.WV)((0,j.g)(a.A))){constructor(e){super(e),this._idToClientGeometry=null,this.type="memory"}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);(0,k.q)(e,this.layer.spatialReference,i);const r=J.A.fromJSON(i);if(!this._requiresClientGraphicMapping()||!this._idToClientGeometry)return r;const s=this.layer.objectIdField;for(const e of r.features){const t=e.attributes[s],i=this._idToClientGeometry.get(t);void 0!==i&&(e.geometry=i)}return r.geometryType=this.layer.geometryType,r}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new l.A("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return(0,k.q)(e,this.layer.spatialReference,i),i}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(e=>({count:e.count,extent:P.A.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async queryAttributeBins(e,t={}){return await this.load(),this._connection.invoke("queryAttributeBins",e?.toJSON(),t)}async _applyEdits(e){if(!this._connection)throw new l.A("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let i=null;const r=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const o=e=>"objectId"in e&&null!=e.objectId?e.objectId:"attributes"in e&&null!=e.attributes[t]?e.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const t of e.deleteFeatures){const e=o(t);null!=e&&r.push(e)}const n=e.updateFeatures&&this._idToClientGeometry?new Map:null;if(e.updateFeatures)for(const t of e.updateFeatures)if(s.push(this._serializeFeature(t)),n&&null!=t.geometry){const e=o(t);null!=e&&n.set(e,t)}(0,G.u)(i?i.features:null,s,this.layer.spatialReference);const{fullExtent:a,featureEditResults:u}=await this._connection.invoke("applyEdits",{adds:i?i.features:[],updates:s,deletes:r});return this.fullExtent=a,i&&i.finish(u.uidToObjectId),this._updateIdToClientGeometries(n,u),this._createEditsResult(u)}async _prepareClientMapping(e,t){if("mesh"!==this._layerOrSourceGeometryType||null==e)return;const i=[];for(const{geometry:r}of e)null==r||"mesh"!==r.type||r.hasExtent||r.loaded||i.push(r.load({signal:t}));i.length&&await Promise.all(i)}_updateIdToClientGeometries(e,t){if(this._idToClientGeometry){if(e)for(const i of t.updateResults){if(!i.success)continue;const t=e.get(i.objectId);null!=t&&this._addIdToClientGeometry(t)}for(const e of t.deleteResults)e.success&&this._idToClientGeometry.delete(e.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:""};return{objectId:e.objectId,globalId:e.globalId,error:t?new l.A("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,i=new Array(e.length);let r=null;for(let s=0;s<e.length;s++){const o=e[s],n=this._serializeFeature(o);r||null==o.geometry||(r=o.geometry.type),i[s]=n,t.set(`${n.uid}`,o)}const s=this;return{features:i,inferredGeometryType:r,finish(e){const i=s.sourceJSON.objectIdField;for(const r in e){const o=e[r],n=t.get(r);n&&(n.attributes||(n.attributes={}),-1===o?delete n.attributes[i]:n.attributes[i]=o,s._addIdToClientGeometry(n))}}}}_addIdToClientGeometry(e){if(!this._idToClientGeometry)return;const t=this.sourceJSON.objectIdField,i=e.attributes?.[t];null!=i&&this._idToClientGeometry.set(i,e.geometry??null)}get _layerOrSourceGeometryType(){return this.layer?.geometryType??this.sourceJSON?.geometryType}_requiresClientGraphicMapping(){return this._geometryTypeRequiresClientGraphicMapping(this._layerOrSourceGeometryType)}_geometryRequiresClientGraphicMapping(e){return this._geometryTypeRequiresClientGraphicMapping(e.type)}_geometryTypeRequiresClientGraphicMapping(e){return"mesh"===e||"multipatch"===e||"extent"===e}_serializeFeature(e){const{attributes:t}=e,i=this._geometryForSerialization(e),r=(N++).toString();return i?{uid:r,geometry:i.toJSON(),attributes:t}:{uid:r,attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return null==t?null:this._geometryRequiresClientGraphicMapping(t)?t.extent?x.A.fromExtent(t.extent):null:t}async _startWorker(e){this._connection=await(0,D.ho)("MemorySourceWorker",{strategy:(0,O.A)("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:i,objectIdField:r,hasM:s,hasZ:o,timeInfo:n,dateFieldsTimeZone:a}=this.layer,l="defaults"===this.layer.originOf("spatialReference");await this._prepareClientMapping(this.items,e);const u=this._prepareAddFeatures(this.items);this.addHandles(this.on("before-changes",e=>{p.A.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),e.preventDefault()}));const d={features:u.features,fields:t?.map(e=>e.toJSON()),geometryType:R.Ye.toJSON(this._workerGeometryType),hasM:"mesh"!==this._layerOrSourceGeometryType&&s,hasZ:"mesh"===this._layerOrSourceGeometryType||o,objectIdField:r,spatialReference:l?null:i&&i.toJSON(),timeInfo:n?.toJSON()??null,dateFieldsTimeZone:a},y=await this._connection.invoke("load",d,{signal:e});for(const e of y.warnings)p.A.getLogger(this.layer).warn("#load()",`${e.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:e});y.featureErrors.length&&p.A.getLogger(this.layer).warn("#load()",`Encountered ${y.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:y.featureErrors});const c=y.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(u.inferredGeometryType)&&(c.geometryType=R.Ye.toJSON(u.inferredGeometryType)),this.sourceJSON=c,this._requiresClientGraphicMapping()&&(this._idToClientGeometry=new Map),u.finish(y.assignedObjectIds)}};(0,r.Cg)([(0,L.u)({Type:A.A,ensureType:(0,q.dp)(A.A)})],$.prototype,"itemType",void 0),(0,r.Cg)([(0,f.MZ)()],$.prototype,"type",void 0),(0,r.Cg)([(0,f.MZ)({constructOnly:!0})],$.prototype,"layer",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],$.prototype,"_workerGeometryType",null),(0,r.Cg)([(0,f.MZ)()],$.prototype,"sourceJSON",void 0),$=(0,r.Cg)([(0,w.$)("esri.layers.graphics.sources.MemorySource")],$);var V=i(52136),K=i(18768),Q=i(63074),W=i(69208),z=i(6455),B=i(47685),H=i(87718),U=i(87796),Y=i(76294),X=i(16131),ee=i(32756),te=i(8303),ie=i(65008);let re=class extends ie.A{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};(0,r.Cg)([(0,f.MZ)()],re.prototype,"updating",void 0),(0,r.Cg)([(0,f.MZ)()],re.prototype,"status",void 0),re=(0,r.Cg)([(0,w.$)("esri.layers.support.PublishingInfo")],re);const se=Symbol(),oe=e=>{var t;const i=e;let s=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=se}get publishingInfo(){if(this.destroyed)return null;const e=this._get("publishingInfo");if(e)return e;const t=new re;return this._checkPublishingStatus(t),t}_checkPublishingStatus(e){let t=0;const i=async s=>{let o;e.updating=!0;try{o=await this.fetchPublishingStatus()}catch(e){o="unavailable"}"published"!==o&&"unavailable"!==o||("publishing"===e.status&&this.refresh(),r.remove()),e.status=o,e.updating=!1,r.removed||(t=setTimeout(i,s,s+125))},r={removed:!1,remove(){this.removed=!0,clearTimeout(t)}};this.when().catch(()=>r.remove()),i(250),this.addHandles(r)}};return(0,r.Cg)([(0,f.MZ)({readOnly:!0,clonable:!1})],s.prototype,"publishingInfo",null),s=(0,r.Cg)([(0,w.$)("esri.layers.mixins.PublishableLayer")],s),s};var ne=i(54310),ae=i(25036),le=i(82935),ue=i(68109),pe=i(60694),de=i(10873),ye=i(15426),ce=i(29005),he=i(33143),ge=i(17036),fe=i(30524),me=i(46499),be=i(39383),we=i(22453),ve=i(96184),Ce=i(17311),Te=i(91908),Fe=i(27733),Me=i(65494),Se=i(8947),_e=i(41214),Ie=i(61956),Ee=i(54218),Ae=i(30291),Oe=i(33910),Ze=i(78553);const je="FeatureLayer";function De(e,t){return new l.A("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function qe(e){return e&&e instanceof a.A}const Le=(0,ge.p)();function Pe(e,t,i){const r=!!i?.writeLayerSchema;return{enabled:r,ignoreOrigin:r}}let xe=class extends((0,U.j)((0,Y.J)((0,H.F)(oe((0,B.w6)((0,z.FJ)((0,Q.dM)((0,ee.fY)((0,le.e)((0,ue.d)((0,ae.j)((0,ne.J)((0,K.b)((0,X.q)((0,te.A)((0,y.P)((0,W.d)((0,V.p)((0,n.OU)(E.A)))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new I(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=F.A.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=(0,h.sg)(async(e,t,r)=>{const{save:s,saveAs:o}=await i.e(3359).then(i.bind(i,33359));switch(e){case 0:return s(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(h.QP).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new l.A("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>(0,ye.VA)(this,"load",e));return this.addResolvingPromise(i),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return(0,d.pR)(e),new Ce.A({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,(0,we.S)(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,i){return this._readEditingEnabled(t,!0,i)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,i,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return(0,ye.C$)(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,i,r){r?.writeLayerSchema&&(0,c.sM)(i,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return(0,ye.jD)(t.layerDefinition||t)}readObjectIdField(e,t){return(0,ye.Zm)(t.layerDefinition||t)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){(0,fe.yp)(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){t=t.layerDefinition||t;const r=t.drawingInfo?.renderer;if(r){const e=(0,Me.L)(r,t,i)??void 0;return e||p.A.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),e}return(0,ye.PD)(t,i)}set source(e){const t=this._get("source");t!==e&&(qe(t)&&this._resetMemorySource(t),qe(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof a.A?new $({layer:this,items:e}):e:null}readSource(e,t){const i=J.A.fromJSON(t.featureSet);return new $({layer:this,items:i?.features??[]})}readTemplates(e,t){const i=t.editFieldsInfo,r=i?.creatorField,s=i?.editorField;return e=e?.map(e=>ce.A.fromJSON(e)),this._fixTemplates(e,r),this._fixTemplates(e,s),e}readTitle(e,t){const i=t.layerDefinition?.name??t.name,r=t.title||t.layerDefinition?.title;if(i){const e=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?(0,pe.yG)(this.url,i):i;let t=i;if(!t&&this.url){const e=(0,pe.qg)(this.url);null!=e&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),(0,pe.cr)(t)}if("item-title"===this.sublayerTitleMode&&r)return r}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let i=(t=t.layerDefinition||t).typeIdField;if(i&&t.fields){i=i.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===i);e&&(i=e.name)}return i}readTypes(e,t){e=(t=t.layerDefinition||t).types;const i=t.editFieldsInfo,r=i?.creatorField,s=i?.editorField;return e?.map(e=>(e=he.A.fromJSON(e),this._fixTemplates(e.templates,r),this._fixTemplates(e.templates,s),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const i=await(0,ye.Xl)(this,e,t,je);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,i){const r=await(0,ye.bt)(this,e,t,i,je);return this.lastEditsEventDate=new Date,r}async applyEdits(e,t){return(0,ye.ct)(this,e,t)}async uploadAssets(e,t){return(0,ye.rn)(this,e,t)}createPopupTemplate(e){return(0,Ae.tn)(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await(0,h.qr)(Promise.all([i.e(708),i.e(364),i.e(8628),i.e(2593)]).then(i.bind(i,72593)),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=(0,ye.VZ)(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,i=(0,g.mA)(this.definitionExpression,t);return e.where=i||"1=1",e}async deleteAttachments(e,t){const i=await(0,ye.mm)(this,e,t,je);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return(0,ye.WP)(this,e,je)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return(0,ye.xd)(this.types,this.typeIdField,e)}getFieldDomain(e,t){return(0,ye.Vq)(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return(0,ye.lV)(this,e,t,je)}async queryFeatures(e,t){const i=await this.load(),r=await i.source.queryFeatures(Ie.A.from(e)??i.createQuery(),t),s=this.graphicOrigin;if(r?.features)for(const e of r.features)e.layer=e.sourceLayer=i,e.origin=s;return r}async queryObjectIds(e,t){return await(0,ye.sg)(this,e,t,je)}async queryFeatureCount(e,t){return(0,ye.Ye)(this,e,t,je)}async queryExtent(e,t){return(0,ye.B5)(this,e,t,je)}async queryRelatedFeatures(e,t){return(0,ye.hM)(this,e,t,je)}async queryRelatedFeaturesCount(e,t){return(0,ye.S2)(this,e,t,je)}async queryTopFeatures(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopFeatures||!s?.query?.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryTopFeatures capability");const o=await i.e(7561).then(i.bind(i,57561)),n=await r.queryTopFeatures(o.default.from(e),t);if(n?.features)for(const e of n.features)e.layer=e.sourceLayer=this;return n}async queryAttributeBins(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryAttributeBins)throw new l.A(je,"Layer source does not support queryAttributeBins capability");(0,ye.ZJ)(e,s,je);const o=await Promise.all([i.e(4575),i.e(7136)]).then(i.bind(i,14575)),n=await r.queryAttributeBins(o.default.from(e),t);if(n.features)for(const e of n.features)e.layer=e.sourceLayer=this;return n}async queryTopObjectIds(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopObjectIds||!s?.query.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryTopObjectIds capability");const o=await i.e(7561).then(i.bind(i,57561));return(await r.queryTopObjectIds(o.default.from(e),t)).filter(Ee.Et)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopExtents||!s?.query?.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryTopExtents capability");const o=await i.e(7561).then(i.bind(i,57561));return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:s}=await this.load();if(!r.queryTopCount||!s?.query?.supportsTopFeaturesQuery)throw new l.A(je,"Layer source does not support queryFeatureCount capability");const o=await i.e(7561).then(i.bind(i,57561));return r.queryTopCount(o.default.from(e),t)}read(e,t){const i=e.featureCollection;if((i||"Feature Collection"===e.type)&&(this.resourceInfo=e),i){const{layers:e,showLegend:r}=i;1===e?.length&&(super.read(e[0],t),null!=r&&super.read({showLegend:r},t))}super.read(e,t),t&&"service"===t.origin&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:i,layerContainerType:r,messages:s}=t;if(this.dynamicDataSource)return s?.push(De(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(("web-map"===i||"web-scene"===i)&&"tables"!==r)return s?.push(De(this,`a table source can only be written to tables, not ${r}`)),null;if(this._hasMemorySource())return s?.push(De(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&("web-map"===i||"web-scene"===i)&&"tables"===r)return s?.push(De(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new l.A(je,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||(0,Te.D)(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,i){let r=e.layerDefinition?.capabilities;return r?this._hasEditingCapability(r):(r=e.capabilities,t&&"web-map"===i?.origin&&!this._hasMemorySource()&&r?this._hasEditingCapability(r):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,i,r){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";(0,c.sM)("layerDefinition.capabilities",e,t),i&&!r?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return(0,o.A)(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),(0,fe.yp)(this.renderer,this.fieldsIndex),(0,fe.sv)(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),(0,Se.L)(this,{origin:"service"})}async hasDataChanged(){return(0,ye.jp)(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const i=e.prototype?.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new l.A("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new l.A("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};(0,r.Cg)([(0,f.MZ)({clonable:!1,readOnly:!0})],xe.prototype,"_titleCreator",null),(0,r.Cg)([(0,f.MZ)(de.zQ)],xe.prototype,"attributeTableTemplate",void 0),(0,r.Cg)([(0,b.w)("service","capabilities")],xe.prototype,"readCapabilities",null),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-scene":{write:!1}},write:!0}})],xe.prototype,"charts",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],xe.prototype,"createQueryVersion",null),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.copyrightText"}}})],xe.prototype,"copyright",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.displayField"}}})],xe.prototype,"displayField",void 0),(0,r.Cg)([(0,f.MZ)({types:Oe.Es,readOnly:!0})],xe.prototype,"defaultSymbol",void 0),(0,r.Cg)([(0,f.MZ)({type:Fe.L})],xe.prototype,"dynamicDataSource",void 0),(0,r.Cg)([(0,f.MZ)({type:Boolean})],xe.prototype,"editingEnabled",null),(0,r.Cg)([(0,b.w)(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],xe.prototype,"readEditingEnabled",null),(0,r.Cg)([(0,b.w)("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],xe.prototype,"readEditingEnabledFromWebMap",null),(0,r.Cg)([(0,v.K)(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],xe.prototype,"writeEditingEnabled",null),(0,r.Cg)([(0,v.K)("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],xe.prototype,"writeEditingEnabledToWebMap",null),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],xe.prototype,"effectiveEditingEnabled",null),(0,r.Cg)([(0,f.MZ)({clonable:!1,readOnly:!0})],xe.prototype,"featureTitleFields",null),(0,r.Cg)([(0,f.MZ)({...Le.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Pe}}}}})],xe.prototype,"fields",void 0),(0,r.Cg)([(0,f.MZ)(Le.fieldsIndex)],xe.prototype,"fieldsIndex",void 0),(0,r.Cg)([(0,f.MZ)({type:T.A,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],xe.prototype,"formTemplate",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.extent"}}})],xe.prototype,"fullExtent",void 0),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Pe,writer(e,t,i){const r=e?ye.iX.toJSON(e):null;r&&(0,c.sM)(i,r,t)}}}},read:{source:"layerDefinition.geometryType",reader:ye.iX.read}}})],xe.prototype,"geometryType",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0,clonable:!1})],xe.prototype,"graphicOrigin",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.hasM"}}})],xe.prototype,"hasM",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.hasZ"}}})],xe.prototype,"hasZ",void 0),(0,r.Cg)([(0,f.MZ)(de.id)],xe.prototype,"id",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],xe.prototype,"infoFor3D",void 0),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],xe.prototype,"isTable",void 0),(0,r.Cg)([(0,b.w)("service","isTable",["type","geometryType"]),(0,b.w)("isTable",["layerDefinition.type","layerDefinition.geometryType"])],xe.prototype,"readIsTable",null),(0,r.Cg)([(0,v.K)("web-map","isTable")],xe.prototype,"writeIsTable",null),(0,r.Cg)([(0,f.MZ)(de.kF)],xe.prototype,"labelsVisible",void 0),(0,r.Cg)([(0,f.MZ)({type:[me.A],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:be.w,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:be.w,write:{layerContainerTypes:C.K}}})],xe.prototype,"labelingInfo",void 0),(0,r.Cg)([(0,f.MZ)((()=>{const e=(0,u.o8)(de.Ih);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,i){(0,c.sM)(i,(0,Ze.p)(e),t)}}},e})())],xe.prototype,"opacity",void 0),(0,r.Cg)([(0,f.MZ)(de.fV)],xe.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,f.MZ)({type:["show","hide"],json:(()=>{const e=(0,u.o8)(de.C1.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],xe.prototype,"listMode",void 0),(0,r.Cg)([(0,b.w)("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],xe.prototype,"readGlobalIdField",null),(0,r.Cg)([(0,f.MZ)({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Pe}}}}})],xe.prototype,"objectIdField",void 0),(0,r.Cg)([(0,b.w)("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],xe.prototype,"readObjectIdField",null),(0,r.Cg)([(0,f.MZ)({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:C.K}}})],xe.prototype,"operationalLayerType",void 0),(0,r.Cg)([(0,f.MZ)(Le.outFields)],xe.prototype,"outFields",void 0),(0,r.Cg)([(0,f.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],xe.prototype,"path",void 0),(0,r.Cg)([(0,f.MZ)(de.M6)],xe.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,f.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],xe.prototype,"popupTemplate",void 0),(0,r.Cg)([(0,f.MZ)({readOnly:!0})],xe.prototype,"defaultPopupTemplate",null),(0,r.Cg)([(0,f.MZ)({types:_e.Hg,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:_e.XJ,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:C.K,overridePolicy:(e,t,i)=>({ignoreOrigin:i?.writeLayerSchema,layerContainerTypes:C.K})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,i)=>({ignoreOrigin:i?.writeLayerSchema,layerContainerTypes:C.K})}}})],xe.prototype,"renderer",null),(0,r.Cg)([(0,b.w)("service","renderer",["drawingInfo.renderer","defaultSymbol"]),(0,b.w)("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],xe.prototype,"readRenderer",null),(0,r.Cg)([(0,f.MZ)()],xe.prototype,"resourceInfo",void 0),(0,r.Cg)([(0,f.MZ)((()=>{const e=(0,u.o8)(de.PY);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],xe.prototype,"screenSizePerspectiveEnabled",void 0),(0,r.Cg)([(0,f.MZ)({clonable:!1})],xe.prototype,"source",null),(0,r.Cg)([(0,m.w)("source")],xe.prototype,"castSource",null),(0,r.Cg)([(0,b.w)("portal-item","source",["featureSet"]),(0,b.w)("web-map","source",["featureSet"])],xe.prototype,"readSource",null),(0,r.Cg)([(0,f.MZ)({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],xe.prototype,"spatialReference",void 0),(0,r.Cg)([(0,f.MZ)({type:Number})],xe.prototype,"subtypeCode",void 0),(0,r.Cg)([(0,f.MZ)({type:[ce.A]})],xe.prototype,"templates",void 0),(0,r.Cg)([(0,b.w)("templates",["editFieldsInfo","creatorField","editorField","templates"])],xe.prototype,"readTemplates",null),(0,r.Cg)([(0,f.MZ)({type:ve.A})],xe.prototype,"timeInfo",void 0),(0,r.Cg)([(0,f.MZ)()],xe.prototype,"title",void 0),(0,r.Cg)([(0,b.w)("service","title",["name"]),(0,b.w)("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],xe.prototype,"readTitle",null),(0,r.Cg)([(0,b.w)("web-map","title",["layerDefinition.name","title"])],xe.prototype,"readTitleFromWebMap",null),(0,r.Cg)([(0,f.MZ)({type:String})],xe.prototype,"sublayerTitleMode",void 0),(0,r.Cg)([(0,f.MZ)({json:{read:!1}})],xe.prototype,"type",void 0),(0,r.Cg)([(0,f.MZ)({type:String})],xe.prototype,"typeIdField",void 0),(0,r.Cg)([(0,b.w)("service","typeIdField"),(0,b.w)("typeIdField",["layerDefinition.typeIdField"])],xe.prototype,"readTypeIdField",null),(0,r.Cg)([(0,f.MZ)({type:[he.A]})],xe.prototype,"types",void 0),(0,r.Cg)([(0,b.w)("service","types",["types"]),(0,b.w)("types",["layerDefinition.types"])],xe.prototype,"readTypes",null),(0,r.Cg)([(0,f.MZ)({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:C.K}}}}})],xe.prototype,"visible",void 0),(0,r.Cg)([(0,b.w)("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],xe.prototype,"readVisible",null),xe=(0,r.Cg)([(0,w.$)("esri.layers.FeatureLayer")],xe)},68109:(e,t,i)=>{i.d(t,{d:()=>v});var r=i(31635),s=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),n=i(13874),a=i(69540),l=i(25482),u=i(93637),p=i(43937),d=i(50820),y=i(10873),c=i(46499),h=i(41214);let g=class extends((0,a.OU)(l.o)){constructor(e){super(e),this.labelingInfo=null,this.labelsVisible=!0,this.renderer=null,this.visible=!0}};(0,r.Cg)([(0,s.MZ)({type:[c.A],json:{write:!0}})],g.prototype,"labelingInfo",void 0),(0,r.Cg)([(0,s.MZ)(y.kF)],g.prototype,"labelsVisible",void 0),(0,r.Cg)([(0,s.MZ)({types:h.Hg,json:{write:!0}})],g.prototype,"renderer",void 0),(0,r.Cg)([(0,s.MZ)({type:Boolean,json:{write:!0}})],g.prototype,"visible",void 0),g=(0,r.Cg)([(0,o.$)("esri.layers.support.TrackPartInfo")],g);var f=i(96576),m=i(59868),b=i(26253);let w=class extends((0,a.OU)(l.o)){constructor(e){super(e),this.enabled=!0,this.fields=[],this.latestObservations=new g({renderer:new f.A({symbol:m.UK.clone()})}),this.maxDisplayDuration=null,this.maxDisplayObservationsPerTrack=0,this.popupEnabled=!0,this.popupTemplate=null,this.previousObservations=new g({renderer:new f.A({symbol:m.UK.clone()})}),this.trackLines=new g({renderer:new f.A({symbol:m.A7.clone()})}),this.timeField="startTimeField"}writeFields(e,t,i){const r=e.filter(e=>"avg_angle"!==e.statisticType).map(e=>e.toJSON());(0,u.sM)(i,r,t)}};(0,r.Cg)([(0,s.MZ)({type:Boolean,json:{write:!0}})],w.prototype,"enabled",void 0),(0,r.Cg)([(0,s.MZ)({type:[d.A],json:{write:!0}})],w.prototype,"fields",void 0),(0,r.Cg)([(0,p.K)("fields")],w.prototype,"writeFields",null),(0,r.Cg)([(0,s.MZ)({type:g,json:{write:!0}})],w.prototype,"latestObservations",void 0),(0,r.Cg)([(0,s.MZ)({type:b.T,json:{write:!0}})],w.prototype,"maxDisplayDuration",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{write:!0}})],w.prototype,"maxDisplayObservationsPerTrack",void 0),(0,r.Cg)([(0,s.MZ)(y.M6)],w.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,s.MZ)({type:n.A,json:{name:"popupInfo",write:!0}})],w.prototype,"popupTemplate",void 0),(0,r.Cg)([(0,s.MZ)({type:g,json:{write:!0}})],w.prototype,"previousObservations",void 0),(0,r.Cg)([(0,s.MZ)({type:g,json:{write:!0}})],w.prototype,"trackLines",void 0),(0,r.Cg)([(0,s.MZ)({type:["timeReceived","startTimeField","endTimeField"],json:{read:!0,write:!0}})],w.prototype,"timeField",void 0),w=(0,r.Cg)([(0,o.$)("esri.layers.support.TrackInfo")],w);const v=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.trackInfo=null}};return(0,r.Cg)([(0,s.MZ)({type:w})],i.prototype,"trackInfo",void 0),i=(0,r.Cg)([(0,o.$)("esri.layers.mixins.TrackableLayer")],i),i}},96520:(e,t,i)=>{i.d(t,{u:()=>n});var r=i(83047),s=i(21325);function o(e,t,i){if(null==e.hasM||e.hasZ)for(const e of t)for(const t of e)t.length>2&&(t[2]*=i)}function n(e,t,i){if(!e&&!t||!i)return;const s=(0,r.G9)(i);a(e,i,s),a(t,i,s)}function a(e,t,i){if(e)for(const r of e)l(r.geometry,t,i)}function l(e,t,i){if(!e?.spatialReference||(0,s.aI)(e.spatialReference,t))return;const n=(0,r.G9)(e.spatialReference)/i;if(1!==n)if("x"in e)null!=e.z&&(e.z*=n);else if("rings"in e)o(e,e.rings,n);else if("paths"in e)o(e,e.paths,n);else if("points"in e&&(null==e.hasM||e.hasZ))for(const t of e.points)t.length>2&&(t[2]*=n)}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1088,6859],{16859:(t,e,i)=>{i.d(e,{G:()=>M,a:()=>f,m:()=>D});var n=i(31635),s=i(55537),o=i(88885),r=i(39117),m=i(95213),a=i(79187),u=i(83661),c=i(11878),h=i(26640),l=i(76061),_=i(31088);class g{getOperatorType(){return 10317}supportsCurves(){return!0}accelerateGeometry(t,e,i){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,i,n,s,o){return new _.OperatorGeodeticDensifyCursor(t,e,4,i,n,s,o)}execute(t,e,i,n,o,r){const m=new l.S([t]),a=this.executeMany(m,e,i,n,o,r).next();return a||(0,s.d)("null output"),a}}var p=i(31139);class y{[Symbol.dispose](){this.m_peR1.destroy(),this.m_peR2.destroy(),this.m_peR3.destroy(),this.m_peR1=null,this.m_peR2=null,this.m_peR3=null}constructor(t,e,i){this.m_peR1=new r.a7,this.m_peR2=new r.a7,this.m_peR3=new r.a7,void 0!==t?this.reset(t,e,i):this.reset(1,0,1)}reset(t,e,i){this.m_a=t,this.m_e2=e,this.m_b=this.m_a*Math.sqrt(1-this.m_e2),this.m_unitToDegree=i,this.m_unitToRad=.017453292519943295*i,this.m_u180=180/this.m_unitToDegree,this.m_u360=360/this.m_unitToDegree}calculateBbox(t,e,i,n){const s=this.m_peR1,o=this.m_peR2,m=this.m_peR3;r.a8.geodeticDistance(this.m_a,this.m_e2,t*this.m_unitToRad,e*this.m_unitToRad,i*this.m_unitToRad,n*this.m_unitToRad,m,s,o,0);const c=Math.cos(s.val),h=Math.cos(o.val+3.141592653589793),l=e*this.m_unitToRad,_=r.ai.phiToEta(this.m_e2,l),g=Math.sin(s.val)*Math.cos(_);let p=e;if(c*h<0){const t=c<0?-1:1,e=Math.acos(Math.abs(g))*t;p=r.ai.etaToPhi(this.m_e2,e)/this.m_unitToRad}let y=(0,u.l)((i-t)*this.m_unitToRad,2*Math.PI);Math.abs(y)>Math.PI&&(y=y>0?y-2*Math.PI:y+2*Math.PI),y/=this.m_unitToRad,i=t+y;const d=new a.Envelope2D;return d.xmin=Math.min(t,i),d.xmax=Math.max(t,i),d.ymin=Math.min(e,n),d.ymin=Math.min(d.ymin,p),d.ymax=Math.max(e,n),d.ymax=Math.max(d.ymax,p),d}minDistanceGeodesic(t,e){const i=d(t),n=d(e);if(i&&n)return this.lowerDistanceGeodetic_(t.xmin,t.ymin,e.xmin,e.ymin);const s=this.normalizeGeodesic_(e,t);return function(t,e){return e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax}(t,s)?t.ymin>=s.ymax?this.minDistanceGeodesicUpDown_(t,s):s.ymin>=t.ymax?this.minDistanceGeodesicUpDown_(s,t):t.xmin>s.xmax?this.minDistanceGeodesicLeftRight_(s,t):this.minDistanceGeodesicLeftRight_(t,s):0}normalizeGeodesic_(t,e){const i=t.clone(),n=t.clone();let s=x(i,e);if(0===s)return i;for(;n.xmax>e.xmin;){n.xmin-=this.m_u360,n.xmax-=this.m_u360;const t=x(n,e);if(t<s&&(i.assign(n),s=t,0===s))return i}for(n.assign(t);n.xmin<e.xmax;){n.xmin+=this.m_u360,n.xmax+=this.m_u360;const t=x(n,e);if(t<s&&(i.assign(n),s=t,0===s))return i}return i}lowerDistanceGeodetic_(t,e,i,n){const s=this.m_peR1;{const o=this.m_b*this.m_b/this.m_a,m=r.ai.phiToPhig(this.m_e2,this.m_unitToRad*e),a=r.ai.phiToPhig(this.m_e2,this.m_unitToRad*n);r.a8.geodeticDistance(o,0,this.m_unitToRad*t,m,this.m_unitToRad*i,a,s,null,null,0)}return s.val}minDistanceGeodesicUpDown_(t,e){if(e.xmin<=t.xmin?e.xmax>=t.xmin:t.xmax>=e.xmin)return this.lowerDistanceGeodetic_(0,t.ymin,0,e.ymax);if(e.xmin>t.xmax){const i=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);if(e.xmax-t.xmin<this.m_u180)return i;const n=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);return Math.min(i,n)}{const i=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);if(t.xmax-e.xmin<this.m_u180)return i;const n=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);return Math.min(i,n)}}minDistanceGeodesicLeftRight_(t,e){let i=Math.abs(t.xmax-e.xmin);for(;i>this.m_u180;)i-=this.m_u360;let n=Math.abs(t.xmin-e.xmax);for(;n>this.m_u180;)n-=this.m_u360;return Math.abs(i)<=Math.abs(n)?this.minDistanceGeodesicLeftRightNormalized_(t,e):this.minDistanceGeodesicLeftRightNormalized_(e,t)}minDistanceGeodesicLeftRightNormalized_(t,e){let i,n;return i=this.lowerDistanceGeodetic_(t.xmax,t.ymin,e.xmin,e.ymin),t.ymin>=e.ymin&&t.ymin<=e.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymin,e.xmin,e.ymin,e.ymax),i=Math.min(i,n)),e.ymin>=t.ymin&&e.ymin<=t.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymin,t.xmax,t.ymin,t.ymax),i=Math.min(i,n)),n=this.lowerDistanceGeodetic_(t.xmax,t.ymax,e.xmin,e.ymax),i=Math.min(i,n),t.ymax>=e.ymin&&t.ymax<=e.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymax,e.xmin,e.ymin,e.ymax),i=Math.min(i,n)),e.ymax>=t.ymin&&e.ymax<=t.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymax,t.xmax,t.ymin,t.ymax),i=Math.min(i,n)),i}lowerDistanceGeodeticSegMeridional_(t,e,i,n,s,o){let r=this.lowerDistanceGeodeticPtMeridional_(t,e,n,s,o);const m=this.lowerDistanceGeodeticPtMeridional_(t,i,n,s,o);let a=this.lowerDistanceGeodeticPtMeridional_(n,s,t,e,i);const u=this.lowerDistanceGeodeticPtMeridional_(n,o,t,e,i);return r=Math.min(r,m),a=Math.min(a,u),Math.min(r,a)}lowerDistanceGeodeticPtMeridional_(t,e,i,n,s){const o=this.m_b*this.m_b/this.m_a,a=r.ai.phiToPhig(this.m_e2,this.m_unitToRad*e),c=r.ai.phiToPhig(this.m_e2,this.m_unitToRad*n),h=r.ai.phiToPhig(this.m_e2,this.m_unitToRad*s),l=this.m_peR1,_=this.m_peR2;r.a8.geodeticDistance(o,0,this.m_unitToRad*i,c,this.m_unitToRad*t,a,l,null,null,0),r.a8.geodeticDistance(o,0,this.m_unitToRad*i,h,this.m_unitToRad*t,a,_,null,null,0);const g=(0,r.a9)(1,0,new u.P(this.m_unitToRad*t,a)),p=(0,r.a9)(1,0,new u.P(this.m_unitToRad*i,c)),y=(0,r.a9)(1,0,new u.P(this.m_unitToRad*i,h));let d=new m.d;d.setCrossProductVector(p,y);const x=p.dotProduct(y);if(d.length()<1.568e-10)return x>=0?Math.min(l.val,_.val):0;d=d.getUnitVector();let P=new m.d;if(P.setCrossProductVector(d,g),P.length()<1.568e-10)return Math.min(l.val,_.val)-1e-5*o;P=P.getUnitVector();let D=g.sub(d.mul(g.dotProduct(d)));{const e=new m.d;e.setCrossProductVector(p,D);const i=new m.d;i.setCrossProductVector(D,y);let n=d.dotProduct(e)>0&&d.dotProduct(i)>0;if(n||(D.negateThis(),e.setCrossProductVector(p,D),i.setCrossProductVector(D,y),n=d.dotProduct(e)>0&&d.dotProduct(i)>0),n){D=D.getUnitVector();const e=(0,r.ah)(1,0,D),i=this.m_peR3;r.a8.geodeticDistance(o,0,this.m_unitToRad*t,a,e.x,e.y,i,null,null,0);const n=Math.min(l.val,_.val);return Math.min(n,i.val)}}return Math.min(l.val,_.val)}}function d(t){return t.xmin===t.xmax&&t.ymin===t.ymax}function x(t,e){let i,n=0;return i=t.xmin-e.xmax,i>n&&(n=i),i=e.xmin-t.xmax,i>n&&(n=i),n}class P{}function D(t){return{outPoint:void 0===t?new u.P:t.clone()}}function v(t,e){t.outPoint.assign(e.outPoint)}function G(){return new a.Envelope2D}class f{constructor(t,e,i,n,s=0,o=4){this.m_ptDistFrom=new u.P,this.m_segStartPt=new u.P,this.m_segEndPt=new u.P,this.m_geodeticLength=new r.a7,this.m_az12=new r.a7,this.m_minGeodeticDist=new r.a7,this.m_segStartPt3d=new m.d,this.m_segEndPt3d=new m.d,this.m_sr=n,this.m_distCurveType=s,this.m_segCurveType=o,this.m_inputGCS=this.m_sr.getGCS(),this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_bIsPannablePcs=2===this.m_sr.getCoordinateSystemType()&&this.m_sr.isPannable();const a=(0,r.F)();this.m_inputGCS.querySpheroidData(a),this.m_a=a.majorSemiAxis,this.m_eSquared=a.e2,this.setPointDistFrom(t),this.setSegmentEndPoints(e,i)}setSegmentEndPoints(t,e){this.m_segStartPt.assign(t),this.m_segEndPt.assign(e),this.m_bIsPannablePcs||(this.m_segStartPt.mulThis(this.m_rpu),this.m_segEndPt.mulThis(this.m_rpu)),2===this.m_segCurveType&&(this.m_segStartPt3d.assign((0,r.a9)(this.m_a,this.m_eSquared,this.m_segStartPt)),this.m_segEndPt3d.assign((0,r.a9)(this.m_a,this.m_eSquared,this.m_segEndPt))),this.calculateAndUpdateSegmentLength()}setPointDistFrom(t){this.m_ptDistFrom.assign(t),this.m_ptDistFrom.scale(this.m_rpu)}setSegmentCurveType(t){this.m_segCurveType=t}setDistanceCurveType(t){this.m_distCurveType=t}makeFunctor(){return t=>{let e;switch(this.m_segCurveType){case 0:case 1:case 3:{const i={stack:[],error:void 0,hasError:!1};try{const s=(0,n.mS)(i,new r.a7,!1),o=(0,n.mS)(i,new r.a7,!1);r.a8.geodeticCoordinate(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_geodeticLength.val*t,this.m_az12.val,s,o,this.m_segCurveType),e=new u.P(s.val,o.val);break}catch(t){i.error=t,i.hasError=!0}finally{(0,n.hk)(i)}}case 2:{const i=m.d.lerp(this.m_segStartPt3d,this.m_segEndPt3d,t);e=(0,r.ah)(this.m_a,this.m_eSquared,i);break}case 4:e=u.P.lerp(this.m_segStartPt,this.m_segEndPt,t),this.m_bIsPannablePcs&&((0,r.ab)(this.m_sr,0,[e],1),e.mulThis(this.m_rpu));break;default:(0,s.d)("Invalid curve type")}return r.a8.geodeticDistance(this.m_a,this.m_eSquared,this.m_ptDistFrom.x,this.m_ptDistFrom.y,e.x,e.y,this.m_minGeodeticDist,null,null,this.m_distCurveType),this.m_minGeodeticDist.val}}calculateAndUpdateSegmentLength(){switch(this.m_segCurveType){case 0:case 2:case 1:case 3:r.a8.geodeticDistance(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_segEndPt.x,this.m_segEndPt.y,this.m_geodeticLength,this.m_az12,null,this.m_segCurveType);break;case 4:this.m_geodeticLength.val=u.P.distance(this.m_segStartPt,this.m_segEndPt);break;default:(0,s.d)("Invalid curve type")}}[Symbol.dispose](){this.m_geodeticLength[Symbol.dispose](),this.m_az12[Symbol.dispose](),this.m_minGeodeticDist[Symbol.dispose]()}}function S(){return new P}class M{[Symbol.dispose](){this.m_envHelper[Symbol.dispose]()}constructor(t,e,i,n,s){this.m_boxGeomA=G(),this.m_boxGeomB=G(),this.m_envGeomA=new a.Envelope2D,this.m_envGeomB=new a.Envelope2D,this.m_progressCounter=0,this.m_transformPCS2GCS=null,this.m_segmentBoxesA=new Map,this.m_segmentBoxesB=new Map,this.m_boundaryPtsA=[],this.m_boundaryPtsB=[],this.m_scaleToRadians=new c.T,this.m_scaleToDegrees=new c.T,this.m_inputSR=t,this.m_distCurveType=e,this.m_progressTracker=i,this.m_maxDistance=n,this.m_maxDeviation=s,this.m_inputGCS=t.getGCS(),this.m_peGeogcs=this.m_inputGCS.getPECoordSys(),this.m_tolerance=0;const o=(0,r.F)();this.m_inputGCS.querySpheroidData(o),this.m_a=o.majorSemiAxis,this.m_eSquared=o.e2,this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_envHelper=new y(this.m_a,this.m_eSquared,1),4===this.m_distCurveType&&(this.m_distCurveType=0),this.m_boxGeomA.setEmpty(),this.m_boxGeomB.setEmpty(),this.m_envGeomA.setEmpty(),this.m_envGeomB.setEmpty(),this.m_bIsPannablePcs=2===this.m_inputSR.getCoordinateSystemType()&&this.m_inputSR.isPannable()}progress(t=!1){}calculate(t,e,i,n){const s=D(),o=D();if(t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.checkGeometriesIntersect(t,e,s,o))return i&&v(i,s),n&&v(n,o),0;const r=this.prepareGeometry(t);if(r.isEmpty())return Number.NaN;const m=this.prepareGeometry(e);if(m.isEmpty())return Number.NaN;this.m_tolerance=this.computeTolerance(r,m);const a=this._ExecuteBruteForce(r,m,s,o);return a>=this.m_maxDistance?Number.NaN:(i&&(this.prepareOutput(s),v(i,s)),n&&(this.prepareOutput(o),v(n,o)),a)}createDistanceFunctor(t,e,i){const n=new f(t,e,i,this.m_inputSR,this.m_distCurveType);return this.m_bIsPannablePcs||1===this.m_inputSR.getCoordinateSystemType()||n.setSegmentCurveType(2),n}_NormalizeAndProject(t){if(this.m_inputSR.isPannable()&&(t=(new r.O).foldInto360Range(t,this.m_inputSR)),2===this.m_inputSR.getCoordinateSystemType()){const e=(0,r.g)(this.m_inputSR,this.m_inputGCS,null);t=(new r.O).execute(t,e,this.m_progressTracker)}return t}_ExecuteBruteForce(t,e,i,n){switch(t.getGeometryType()){case s.G.enumPoint:return this.calculateDistanceGeodeticPointGeometry(t,e,i,n);case s.G.enumMultiPoint:return this.calculateDistanceGeodeticMultipointGeometry(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:case s.G.enumEnvelope:return this.calculateDistanceGeodeticMultipathGeometry(t,e,i,n);default:(0,s.a)("")}}calculateDistanceGeodeticPointGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.calculateDistanceGeodeticPointPoint(t,e,i,n);case s.G.enumMultiPoint:return this.calculateDistanceGeodeticPointMultipoint(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:return this.calculateDistanceGeodeticPointMultipath(t,e,i,n);default:(0,s.a)("")}}calculateDistanceGeodeticPointPoint(t,e,i,s){const o={stack:[],error:void 0,hasError:!1};try{const m=t.getXY();m.scale(this.m_rpu);const a=e.getXY();a.scale(this.m_rpu),i.outPoint.assign(m),s.outPoint.assign(a);const u=(0,n.mS)(o,new r.a7,!1);return r.a8.geodeticDistance(this.m_a,this.m_eSquared,m.x,m.y,a.x,a.y,u,null,null,this.m_distCurveType),u.val}catch(t){o.error=t,o.hasError=!0}finally{(0,n.hk)(o)}}calculateDistanceGeodeticPointMultipoint(t,e,i,s){const o={stack:[],error:void 0,hasError:!1};try{this.computeEnvelopesAndBoxes(t,e);const a=this.estimateMinimumDistance(i,s);let c=a<this.m_maxDistance?a:this.m_maxDistance;const h=t.getXY();h.scale(this.m_rpu),i.outPoint.assign(h);const l=(0,r.a9)(this.m_a,this.m_eSquared,h),_=new u.P,g=e.getImpl(),p=(0,n.mS)(o,new r.a7,!1),y=g.getPointCount();for(let t=0;t<y;++t){g.queryXY(t,_),_.scale(this.m_rpu);const e=(0,r.a9)(this.m_a,this.m_eSquared,_);if(!(m.d.distance(l,e)>c)&&!(this.m_envHelper.minDistanceGeodesic(this.m_boxGeomA,this.m_boxGeomB)>c)&&(r.a8.geodeticDistance(this.m_a,this.m_eSquared,h.x,h.y,_.x,_.y,p,null,null,this.m_distCurveType),p.val<c&&(c=p.val,s.outPoint=_,0===c)))return c}return c===this.m_maxDistance?Number.POSITIVE_INFINITY:c}catch(t){o.error=t,o.hasError=!0}finally{(0,n.hk)(o)}}calculateDistanceGeodeticPointMultipath(t,e,i,o){const m={stack:[],error:void 0,hasError:!1};try{const a=new u.P,c=new u.P;a.assign(t.getXY()),c.assign(t.getXY()),i.outPoint.assign(c.mul(this.m_rpu)),this.m_bIsPannablePcs&&(0,r.aa)(this.m_inputSR,[a],1,!1),this.computeEnvelopesAndBoxes(t,e);const h=this.estimateMinimumDistance(i,o);let l=h<this.m_maxDistance?h:this.m_maxDistance;const _=e.getImpl(),g=new u.P(0,0),p=new u.P(0,0),y=[1],d=this.canUseSpatialTree(t,e),x=S();d&&this.buildSpatialTree(x,e);const P=G();P.setCoords({xmin:c.x,ymin:c.y,xmax:c.x,ymax:c.y});const D=(0,n.mS)(m,this.createDistanceFunctor(c,g,p),!1),v=_.querySegmentIterator();if(v.stripAttributes(),d)(0,s.g)(0);else for(;v.nextPath();)for(;v.hasNextSegment();){const t=v.nextSegment(),e=this.findOrComputeBoxSegment(v.getStartPointIndex(),t,this.m_segmentBoxesB);if(this.m_envHelper.minDistanceGeodesic(P,e)>l)continue;const i=this.calculateDistanceGeodeticPointSegment(a,c,t,y,D);if(i.second<l&&(this.updateOutputSegment(o,t,i.first),l=i.second,0===l))return 0}return l===this.m_maxDistance?Number.POSITIVE_INFINITY:l}catch(t){m.error=t,m.hasError=!0}finally{(0,n.hk)(m)}}calculateDistanceGeodeticMultipointGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.calculateDistanceGeodeticPointMultipoint(e,t,n,i);case s.G.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipoint(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:case s.G.enumEnvelope:return this.calculateDistanceGeodeticMultipointMultipath(t,e,i,n);default:(0,s.a)("")}}calculateDistanceGeodeticMultipointMultipoint(t,e,i,s){const o={stack:[],error:void 0,hasError:!1};try{const a=(0,n.mS)(o,new r.a7,!1);this.computeEnvelopesAndBoxes(t,e);const c=this.estimateMinimumDistance(i,s);let h=c<this.m_maxDistance?c:this.m_maxDistance;const l=new u.P,_=new u.P,g=t.getImpl(),p=e.getImpl(),y=G(),d=g.getPointCount(),x=p.getPointCount();for(let t=0;t<d;++t){if(l.assign(g.getXY(t)),y.setCoords({xmin:l.x,ymin:l.y,xmax:l.x,ymax:l.y}),this.m_envHelper.minDistanceGeodesic(y,this.m_boxGeomB)>h)continue;l.scale(this.m_rpu);const e=(0,r.a9)(this.m_a,this.m_eSquared,l);for(let t=0;t<x;++t){_.assign(p.getXY(t)),_.scale(this.m_rpu);const n=(0,r.a9)(this.m_a,this.m_eSquared,_);if(!(m.d.distance(e,n)>=h)&&(r.a8.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,a,null,null,this.m_distCurveType),a.val<h&&(i.outPoint.assign(l),s.outPoint.assign(_),h=a.val,0===h)))return h}}return h===this.m_maxDistance?Number.POSITIVE_INFINITY:h}catch(t){o.error=t,o.hasError=!0}finally{(0,n.hk)(o)}}calculateDistanceGeodeticMultipointMultipath(t,e,i,o){const m={stack:[],error:void 0,hasError:!1};try{const a=e.getImpl().querySegmentIterator();a.stripAttributes(),this.computeEnvelopesAndBoxes(t,e);const c=this.estimateMinimumDistance(i,o);let h=c<this.m_maxDistance?c:this.m_maxDistance;const l=new u.P,_=new u.P(0,0),g=new u.P(0,0),p=new u.P(0,0),y=[0],d=G(),x=(0,n.mS)(m,this.createDistanceFunctor(_,g,p),!1),P=S(),D=this.canUseSpatialTree(t,e);D&&this.buildSpatialTree(P,e);const v=t.getPointCount();for(let e=0;e<v;++e)if(l.assign(t.getXY(e)),_.assign(t.getXY(e)),this.m_bIsPannablePcs&&(0,r.aa)(this.m_inputSR,[l],1,!1),d.setCoords({xmin:_.x,ymin:_.y,xmax:_.x,ymax:_.y}),!(this.m_envHelper.minDistanceGeodesic(d,this.m_boxGeomB)>h))if(x.setPointDistFrom(_),D)(0,s.g)(0);else{for(;a.nextPath();)for(;a.hasNextSegment();){const t=a.nextSegment();if(this.m_envHelper.minDistanceGeodesic(d,this.findOrComputeBoxSegment(a.getStartPointIndex(),t,this.m_segmentBoxesB))>h)continue;const e=this.calculateDistanceGeodeticPointSegment(l,_,t,y,x);if(e.second<h&&(i.outPoint.assign(_.mul(this.m_rpu)),this.updateOutputSegment(o,t,e.first),h=e.second,0===h))return 0}a.resetToFirstPath()}return h===this.m_maxDistance?Number.POSITIVE_INFINITY:h}catch(t){m.error=t,m.hasError=!0}finally{(0,n.hk)(m)}}calculateDistanceGeodeticMultipathGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.calculateDistanceGeodeticPointMultipath(e,t,n,i);case s.G.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipath(e,t,n,i);case s.G.enumPolyline:case s.G.enumPolygon:case s.G.enumEnvelope:return this.calculateDistanceGeodeticMultipathMultipath(t,e,i,n);default:(0,s.a)("")}}calculateDistanceGeodeticMultipathMultipath(t,e,i,n){const s=[t],o=[e],r=this.swapGeometries(s,o),m=s[0],a=o[0];this.computeEnvelopesAndBoxes(s[0],o[0]);const c=this.estimateMinimumDistance(i,n),h=this.calculateDistanceGeodeticMultipathMultipath_(m,a,i,n,c);return r&&(n.outPoint=(0,u.c)(i.outPoint,i.outPoint=n.outPoint)),h}calculateDistanceGeodeticMultipathMultipath_(t,e,i,m,a=Number.MAX_VALUE){const c={stack:[],error:void 0,hasError:!1};try{let l=a;const _=new u.P(0,0),g=new u.P,p=new u.P(0,0),y=new u.P,d=new u.P(0,0),x=new u.P,P=new u.P,D=new u.P,v=[new u.P],f=[0],M=[0],b=G(),E=G(),T=(0,n.mS)(c,this.createDistanceFunctor(d,_,p),!1),I=S(),N=this.canUseSpatialTree(t,e);N&&this.buildSpatialTree(I,e);const w=e.querySegmentIterator();w.stripAttributes();const B=new o.S,C=(0,h.s)(t);for(let e=0;e<C.length;++e){const n=C[e];t.getSegmentBuffer(n,B,!0);const o=B.get();if(b.assign(this.findOrComputeBoxSegment(n,o,this.m_segmentBoxesA)),N)(0,s.g)(0);else{if(d.assign(o.getStartXY()),x.assign(o.getStartXY()),P.assign(o.getEndXY()),D.assign(o.getEndXY()),this.m_bIsPannablePcs&&((0,r.ab)(this.m_inputSR,0,[x],1),(0,r.ab)(this.m_inputSR,0,[D],1)),this.m_envHelper.minDistanceGeodesic(b,this.m_boxGeomB)>l)continue;for(;w.nextPath();){for(;w.hasNextSegment();){const t=w.nextSegment();if(_.assign(t.getStartXY()),g.assign(t.getStartXY()),p.assign(t.getEndXY()),y.assign(t.getEndXY()),o.intersect(t,v,f,M,this.m_tolerance))return this.updateOutputSegment(i,o,f[0]),this.updateOutputSegment(m,t,M[0]),0;if(this.m_bIsPannablePcs&&((0,r.ab)(this.m_inputSR,0,[g],1),(0,r.ab)(this.m_inputSR,0,[y],1)),E.assign(this.findOrComputeBoxPoint(w.getStartPointIndex(),g,y,this.m_segmentBoxesB)),this.m_envHelper.minDistanceGeodesic(b,E)>l)continue;T.setSegmentEndPoints(_,p),T.setPointDistFrom(x);let e=(0,r.ac)(T.makeFunctor(),0,1,1e-10);if(e.second<l&&(i.outPoint.assign(x.mul(this.m_rpu)),this.updateOutputSegment(m,t,e.first),l=e.second,0===l))break;if(T.setPointDistFrom(D),e=(0,r.ac)(T.makeFunctor(),0,1,1e-10),e.second<l&&(i.outPoint.assign(D.mul(this.m_rpu)),this.updateOutputSegment(m,t,e.first),l=e.second,0===l))break;if(T.setSegmentEndPoints(d,P),T.setPointDistFrom(g),e=(0,r.ac)(T.makeFunctor(),0,1,1e-10),e.second<l&&(this.updateOutputSegment(i,o,e.first),m.outPoint.assign(g.mul(this.m_rpu)),l=e.second,0===l))break;if(T.setPointDistFrom(y),e=(0,r.ac)(T.makeFunctor(),0,1,1e-10),e.second<l&&(this.updateOutputSegment(i,o,e.first),m.outPoint.assign(y.mul(this.m_rpu)),l=e.second,0===l))break}if(0===l)return 0}w.resetToFirstPath()}}return l===this.m_maxDistance?Number.POSITIVE_INFINITY:l}catch(t){c.error=t,c.hasError=!0}finally{(0,n.hk)(c)}}calculateDistanceGeodeticPointSegment(t,e,i,n,s){const o=i.getStartXY(),m=i.getEndXY();return i.intersectPoint(t,n,this.m_tolerance)?(0,u.k)(n[0],0):(s.setPointDistFrom(e),s.setSegmentEndPoints(o,m),(0,r.ac)(s.makeFunctor(),0,1,1e-10))}prepareGeometry(t){let e=t.clone();const i=t.getGeometryType();if(i===s.G.enumPoint||i===s.G.enumMultiPoint)return this._NormalizeAndProject(e);if(i===s.G.enumEnvelope&&(e=this.envelopeToPolygon(e)),this.m_inputSR.isPannable())return this.prepareGeometryPannable(e,4);if(2===this.m_inputSR.getCoordinateSystemType()){if(e=(0,r.ad)(e,this.m_inputSR,0,null),e.isEmpty())return e;e=(new g).execute(e,this.m_inputSR,5e4,this.m_maxDeviation/2,0,null);const t=this.m_inputSR.getSRToGCSTransform();return(new r.O).execute(e,t,this.m_progressTracker)}const n=new a.Envelope2D;e.queryLooseEnvelope(n);const o=this.m_inputSR.getPannableExtent();if(n.ymin<o.ymin||n.ymax>o.ymax){const t=new a.Envelope2D(n.xmin-1,o.ymin,n.xmax+1,o.ymax);if(e=(new p.O).execute(e,t,this.m_inputSR,this.m_progressTracker),e.isEmpty())return e}return n.width()>2*o.width()?(e=(0,r.ae)(e,-2*o.width(),2*o.width(),this.m_inputSR,!0,0,!0,this.m_progressTracker),e):e}prepareGeometryPannable(t,e){const i=new a.Envelope2D;t.queryEnvelope(i);const n=this.m_inputSR.getPannableExtent();if(n.containsEnvelope(i))return t;const s=new u.E;n.queryIntervalX(s);const o=new u.E;return i.queryIntervalX(o),s.contains(o)?(0,r.af)(t,this.m_inputSR):(new r.O).foldInto360RangeGeodetic(t,this.m_inputSR,e)}prepareOutput(t){t.outPoint.scale(1/this.m_rpu),2===this.m_inputSR.getCoordinateSystemType()&&(0,r.aa)(this.m_inputSR,[t.outPoint],1,!1)}updateOutputSegment(t,e,i){e.queryCoord2D(i,t.outPoint),this.m_bIsPannablePcs&&(0,r.ab)(this.m_inputSR,0,[t.outPoint],1),t.outPoint.mulThis(this.m_rpu)}computeTolerance(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB);const i=new a.Envelope2D(this.m_envGeomA);return i.mergeEnvelope2D(this.m_envGeomB),(0,m.a)(null,i)}envelopeToPolygon(t){const e=new o.a;return e.addEnvelope(t,!1),e}computeEnvelopesAndBoxes(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.m_boxGeomA=this.computeBoxGeometry(t,this.m_boundaryPtsA,this.m_segmentBoxesA),this.m_boxGeomB=this.computeBoxGeometry(e,this.m_boundaryPtsB,this.m_segmentBoxesB)}computeBoxGeometry(t,e,i){switch(t.getGeometryType()){case s.G.enumPoint:return this.computeBoxPoint(t,e);case s.G.enumMultiPoint:return this.computeBoxMultiPoint(t,e);case s.G.enumPolyline:case s.G.enumPolygon:return this.computeBoxMultiPath(t,e,i);default:(0,s.d)("Invalid geometry type")}}computeBoxPoint(t,e){const i=t.getXY();e.length=0,e.push(i.mul(this.m_rpu));const n=G();return n.setCoords({xmin:i.x,ymin:i.y,xmax:i.x,ymax:i.y}),n}computeBoxMultiPoint(t,e){let i=!0;for(let n=0;n<t.getPointCount();++n){const s=t.getXY(n);if(i){e.length=0;for(let t=0;t<4;++t)e.push(s.clone());i=!1}s.x<e[0].x&&e[0].assign(s),s.y>e[1].y&&e[1].assign(s),s.x>e[2].x&&e[2].assign(s),s.y<e[3].y&&e[3].assign(s)}for(let t=0;t<e.length;++t)e[t].mulThis(this.m_rpu);const n=G();return t.queryEnvelope(n),n}computeBoxMultiPath(t,e,i){let n=!0;const s=G();s.setEmpty();const o=t.querySegmentIterator();for(o.stripAttributes();o.nextPath();)for(;o.hasNextSegment();){const t=o.nextSegment(),m=t.getStartXY(),a=t.getEndXY();if(this.m_bIsPannablePcs&&((0,r.ab)(this.m_inputSR,0,[m],1),(0,r.ab)(this.m_inputSR,0,[a],1)),n){for(let t=0;t<4;++t)e.push(m.clone());n=!1}m.x<e[0].x&&e[0].assign(m),m.y>e[1].y&&e[1].assign(m),m.x>e[2].x&&e[2].assign(m),m.y<e[3].y&&e[3].assign(m),a.x<e[0].x&&e[0].assign(a),a.y>e[1].y&&e[1].assign(a),a.x>e[2].x&&e[2].assign(a),a.y<e[3].y&&e[3].assign(a);const u=this.findOrComputeBoxPoint(o.getStartPointIndex(),m,a,i);s.mergeEnvelope2D(u)}for(let t=0;t<e.length;++t)e[t].mulThis(this.m_rpu);return s}findOrComputeBoxSegment(t,e,i){if(!i.has(t)){let n=G();if(e.queryEnvelope(n),this.m_bIsPannablePcs){const t=u.P.construct(n.xmin,n.ymin),e=u.P.construct(n.xmax,n.ymax);(0,r.ab)(this.m_inputSR,0,[t],1),(0,r.ab)(this.m_inputSR,0,[e],1),n=this.m_envHelper.calculateBbox(t.x,t.y,e.x,e.y)}return i.set(t,n),n}return i.get(t)}findOrComputeBoxPoint(t,e,i,n){if(!n.has(t)){let s=G();return s.setCoords({xmin:e.x,ymin:e.y,xmax:i.x,ymax:i.y}),this.m_bIsPannablePcs&&(s=this.m_envHelper.calculateBbox(s.xmin,s.ymin,s.xmax,s.ymax)),n.set(t,s),s}return n.get(t)}estimateMinimumDistance(t,e){const i={stack:[],error:void 0,hasError:!1};try{const s=t=>(0,r.a9)(this.m_a,this.m_eSquared,t),o=this.m_boundaryPtsA.map(s),a=this.m_boundaryPtsB.map(s);let u=Number.MAX_VALUE,c=0,h=0;for(let t=0;t<o.length;++t)for(let e=0;e<a.length;++e){const i=m.d.distance(o[t],a[e]);i<u&&(u=i,c=t,h=e)}t.outPoint.assign(this.m_boundaryPtsA[c]),e.outPoint.assign(this.m_boundaryPtsB[h]);const l=(0,n.mS)(i,new r.a7,!1);return r.a8.geodeticDistance(this.m_a,this.m_eSquared,this.m_boundaryPtsA[c].x,this.m_boundaryPtsA[c].y,this.m_boundaryPtsB[h].x,this.m_boundaryPtsB[h].y,l,null,null,this.m_distCurveType),l.val}catch(t){i.error=t,i.hasError=!0}finally{(0,n.hk)(i)}}swapGeometries(t,e){return(0,s.v)(t[0])>(0,s.v)(e[0])&&(e[0]=(0,u.c)(t[0],t[0]=e[0]),this.m_envGeomB=(0,u.c)(this.m_envGeomA,this.m_envGeomA=this.m_envGeomB),!0)}canUseSpatialTree(t,e){return!1}checkGeometriesIntersect(t,e,i,n){let o=t.getGeometryType(),m=e.getGeometryType();if(this.m_envGeomA.isIntersecting(this.m_envGeomB)){if(o===s.G.enumPoint&&2===e.getDimension()){const s=[0],o=[t.getXY()];if((0,r.ag)(e,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}else if(m===s.G.enumPoint&&2===t.getDimension()){const s=[2],o=[e.getXY()];if((0,r.ag)(t,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}if(o===s.G.enumMultiPoint&&2===e.getDimension())return this.multipointIntersectsArea(t,e,i,n);if(m===s.G.enumMultiPoint&&2===t.getDimension())return this.multipointIntersectsArea(e,t,n,i);let a,u,c=t,l=e;if(o===s.G.enumEnvelope&&(a=this.envelopeToPolygon(t),c=a,o=s.G.enumPolygon),m===s.G.enumEnvelope&&(u=this.envelopeToPolygon(e),l=u,m=s.G.enumPolygon),(0,s.h)(o)&&(0,s.h)(m)){const t=c.querySegmentIterator(),e=l.querySegmentIterator(),s=(0,h.m)(),o=(0,h.m)();if((0,h.w)(c,l,t,e,s,o))return i.outPoint.assign(s.outPoint),n.outPoint.assign(s.outPoint),!0}}return!1}multipointIntersectsArea(t,e,i,n){const s=t.getPointCount();for(let o=0;o<s;++o){const s=[2],m=t.getXY(o);if((0,r.ag)(e,[m],1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(m),n.outPoint.assign(m),!0}return!1}getNearestNeighbourVisitor(t,e,i,n,o,r,m){return(0,s.g)(0),{}}buildSpatialTree(t,e){(0,s.g)(0)}}},26640:(t,e,i)=>{i.d(e,{D:()=>D,m:()=>c,s:()=>d,w:()=>y});var n=i(31635),s=i(55537),o=i(88885),r=i(39117),m=i(83661),a=i(79187),u=i(95213);function c(){return{outPoint:new m.P,index:-1,t:Number.NaN}}function h(t,e,i){return{outPoint:t.clone(),index:e,t:i}}function l(t,e,i,n){t.outPoint.assign(e),t.index=i,t.t=n}function _(t,e){t.outPoint.assign(e.outPoint),t.index=e.index,t.t=e.t}function g(t,e,i,n){t.index=i,t.t=n,e.queryCoord2D(t.t,t.outPoint)}function p(t,e){const i=c();_(i,t),_(t,e),_(e,i)}function y(t,e,i,n,o,m){if(t.getGeometryType()===s.G.enumPolygon){for(;n.nextPath();)if(n.hasNextSegment()){const e=n.nextSegment();if(0!==(0,r.R)(t,e.getEndXY(),0))return l(o,e.getEndXY(),-1,Number.NaN),l(m,e.getEndXY(),-1,Number.NaN),!0}n.resetToFirstPath()}if(e.getGeometryType()===s.G.enumPolygon){for(;i.nextPath();)if(i.hasNextSegment()){const t=i.nextSegment();if(0!==(0,r.R)(e,t.getEndXY(),0))return l(o,t.getEndXY(),-1,Number.NaN),l(m,t.getEndXY(),-1,Number.NaN),!0}i.resetToFirstPath()}return!1}function d(t){const e=t.getPathCount(),i=(0,m.d)(t.getSegmentCount(),0);let n=0;for(let s=0;s<e;++s){const e=n+t.getSegmentCountPath(s);for(let o=n,r=t.getPathStart(s);o<e;++o,++r)i[o]=r;n=e}return(0,o.s)(t.getPointCount(),i),i}function x(t,e){return!!Number.isNaN(e)||t<=e}function P(t){const e=new o.a;return e.addEnvelope(t,!1),e}class D{constructor(t,e){if(this.m_env2DgeometryA=null,this.m_env2DgeometryB=null,this.m_progressCounter=0,this.m_progressTracker=e,this.m_maxSqrDistance=t*t,this.m_maxDistance=t,this.m_bIsNearCalc=!1,Number.isNaN(this.m_maxDistance)?this.m_maxDistance=Number.POSITIVE_INFINITY:this.m_maxDistance=t,this.m_maxSqrDistance=this.m_maxDistance*this.m_maxDistance,Number.isFinite(this.m_maxSqrDistance)){let t=Math.sqrt(this.m_maxSqrDistance);for(;t<this.m_maxDistance;)this.m_maxSqrDistance*=1+Number.EPSILON,t=Math.sqrt(this.m_maxSqrDistance)}}calculate(t,e,i,n){if((t.getGeometryType()!==u.P.type||e.getGeometryType()!==u.P.type)&&(this.m_env2DgeometryA=new a.Envelope2D,this.m_env2DgeometryB=new a.Envelope2D,t.queryEnvelope(this.m_env2DgeometryA),e.queryEnvelope(this.m_env2DgeometryB),!x(this.m_env2DgeometryA.distanceFromEnvelope(this.m_env2DgeometryB),this.m_maxDistance)))return Number.POSITIVE_INFINITY;const s=h(new m.P,(0,m.j)(),Number.NaN),o=h(new m.P,(0,m.j)(),Number.NaN),r=this._ExecuteBruteForce(t,e,s,o);return x(r,this.m_maxDistance)?(null!==i&&_(i,s),null!==n&&_(n,o),r):Number.POSITIVE_INFINITY}isNear(t,e){if(this.m_bIsNearCalc=!0,t.isEmpty()||e.isEmpty())return!1;if(t===e)return!0;let i=!0;if(t.getGeometryType()!==u.P.type&&t.getGeometryType()!==u.E.type||e.getGeometryType()!==u.P.type&&e.getGeometryType()!==u.E.type||(i=!1),i){if(this.m_env2DgeometryA=new a.Envelope2D,this.m_env2DgeometryB=new a.Envelope2D,t.queryEnvelope(this.m_env2DgeometryA),e.queryEnvelope(this.m_env2DgeometryB),!(this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)>this.m_maxSqrDistance))return!0;if(this.m_env2DgeometryA.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>this.m_maxSqrDistance)return!1}const n=h(new m.P,(0,m.j)(),Number.NaN),s=h(new m.P,(0,m.j)(),Number.NaN);return this._ExecuteBruteForce(t,e,n,s)<=this.m_maxDistance}progress_(t=!1){}_ExecuteBruteForce(t,e,i,n){switch(t.getGeometryType()){case s.G.enumPoint:return this.distancePointGeometry(t,e,i,n);case s.G.enumMultiPoint:return this.distanceMultipointGeometry(t,e,i,n);case s.G.enumEnvelope:return this.distanceEnvelopeGeometry(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:return this.distanceMultipathGeometry(t,e,i,n);default:return Number.NaN}}distancePointGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.distancePointPoint(t,e,i,n);case s.G.enumMultiPoint:return this.distancePointMultipoint(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:return this.distancePointMultipath(t,e,i,n);case s.G.enumEnvelope:return this.distancePointEnvelope(t,e,i,n);default:return Number.NaN}}distancePointPoint(t,e,i,n){const s=t.getXY(),o=e.getXY();return l(i,s,0,0),l(n,o,0,0),Math.sqrt(m.P.sqrDistance(s,o))}distancePointMultipoint(t,e,i,n){const s=t.getXY();let o=this.m_maxSqrDistance,r=o,a=!1;const u=e.getPointCount(),c=new m.P;for(let t=0;t<u;++t)if(e.queryXY(t,c),r=m.P.sqrDistance(s,c),this.m_bIsNearCalc){if(r<=o)return 0}else if(!(r>o)&&(!a&&r===o||r<o)&&(o=r,l(i,s,0,0),l(n,c,t,0),a=!0,0===o))return 0;return a?Math.sqrt(o):Number.POSITIVE_INFINITY}distancePointMultipath(t,e,i,n){const o=!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB),u=t.getXY();if(!o&&e.getGeometryType()===s.G.enumPolygon&&0!==(0,r.R)(e,u,0))return l(i,u,0,0),l(n,u,-1,Number.NaN),0;e.getImpl().getAccelerators();let c=this.m_maxSqrDistance,h=c,_=-1;const g=new a.Envelope2D,p=e.querySegmentIterator();let y=!1;for(;p.nextPath();)for(;p.hasNextSegment();){const t=p.nextSegment();t.queryEnvelope(g);const e=g.sqrDistance(u);if(e>c)continue;if(!this.m_bIsNearCalc&&y&&e===c)continue;_=t.getClosestCoordinate(u,!1);const s=t.getCoord2D(_);if(h=m.P.sqrDistance(u,s),this.m_bIsNearCalc){if(h<=c)return 0}else if(!(h>c)&&(!y||h<c)&&(c=h,l(i,u,0,0),l(n,s,p.getStartPointIndex(),_),y=!0,0===c))return 0}return y?Math.sqrt(c):Number.POSITIVE_INFINITY}distancePointEnvelope(t,e,i,n){const s=t.getXY();l(i,s,0,0),l(n,s,-1,Number.NaN);const o=e.asEnvelope2D();return o.contains(s)?0:Math.sqrt(o.sqrDistance(s,n.outPoint))}distanceMultipointGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:{this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const s=this.distancePointMultipoint(e,t,n,i);return this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),s}case s.G.enumMultiPoint:return this.distanceMultipointMultipoint(t,e,i,n,1,1);case s.G.enumPolyline:case s.G.enumPolygon:return this.distanceMultipointMultipath(t,e,i,n);case s.G.enumEnvelope:return this.distanceMultipointMultipath(t,P(e),i,n);default:return Number.NaN}}distanceMultipointMultipoint(t,e,i,s,o,r){const a={stack:[],error:void 0,hasError:!1};try{if(this.m_bIsNearCalc&&1===o&&1===r){const n=Math.trunc((0,m.s)(Math.sqrt(t.getPointCount())+1,1,(0,m.i)())),o=Math.trunc((0,m.s)(Math.sqrt(e.getPointCount())+1,1,(0,m.i)()));if((n>=4||o>=4)&&this.distanceMultipointMultipoint(t,e,i,s,n,o)<=this.m_maxSqrDistance)return 0}let u=this.m_maxSqrDistance;const c=[t],h=[e],_=this.swapGeometriesIfBGtA(c,h);_&&(this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),r=(0,m.c)(o,o=r),p(i,s)),(0,n.mS)(a,(0,m.h)(()=>{p(i,s),this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)},!_),!1);const g=c[0].getImpl(),y=h[0].getImpl(),d=g.getPointCount(),x=y.getPointCount(),P=x>1;let D=!1;const v=new m.P,G=new m.P;for(let t=0;t<d;t+=o){if(g.queryXY(t,v),P){const t=this.m_env2DgeometryB.sqrDistance(v);if(this.m_bIsNearCalc){if(t>u)continue;if(this.m_env2DgeometryB.sqrMaxMinDistance(v)<=u)return 0}else if(t>=u)continue}for(let e=0;e<x;e+=r){y.queryXY(e,G);const n=m.P.sqrDistance(v,G);if(this.m_bIsNearCalc){if(n<=u)return 0}else if(!(n>u||D&&n===u)&&(!D||n<u)&&(l(i,v,t,0),l(s,G,e,0),D=!0,u=n,0===u))return D?Math.sqrt(u):Number.POSITIVE_INFINITY}}return D?Math.sqrt(u):Number.POSITIVE_INFINITY}catch(t){a.error=t,a.hasError=!0}finally{(0,n.hk)(a)}}distanceMultipointMultipath(t,e,i,n){let o=!!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)&&e.getGeometryType()===s.G.enumPolygon;const u=e.querySegmentIterator();u.stripAttributes();const c=new a.Envelope2D,h=new m.P;let _=this.m_maxSqrDistance;const g=t.getImpl(),p=g.getPointCount(),y=p>1;let d=!1;for(;u.nextPath();)for(;u.hasNextSegment();){const t=u.nextSegment();if(t.queryLooseEnvelope(c),y){const t=c.sqrDistanceEnvelope(this.m_env2DgeometryA,null,null);if(this.m_bIsNearCalc){if(t>_)continue}else if(t>_||d&&t===_)continue}for(let s=0;s<p;s++){if(g.queryXY(s,h),o&&0!==(0,r.R)(e,h,0))return l(i,h,-1,Number.NaN),l(n,h,s,0),0;{const t=c.sqrDistance(h);if(this.m_bIsNearCalc){if(t>_)continue}else if(t>_)continue}const m=t.getClosestCoordinate(h,!1),a=t.getCoord2D(m);h.subThis(a);const p=h.sqrLength();if(this.m_bIsNearCalc){if(p<=_)return 0}else if(!(p>_)&&(!d||p<_)&&(_=p,l(i,g.getXY(s),s,0),l(n,a,u.getStartPointIndex(),m),d=!0,0===_))return 0}o=!1}return d?Math.sqrt(_):Number.POSITIVE_INFINITY}distanceEnvelopeGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.distancePointEnvelope(e,t,n,i);case s.G.enumMultiPoint:{this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const s=this.distanceMultipointMultipath(e,P(t),n,i);return this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),s}case s.G.enumPolyline:case s.G.enumPolygon:return this.distanceMultipathMultipath(P(t),e,i,n);case s.G.enumEnvelope:return this.distanceEnvelopeEnvelope(t,e,i,n);default:return Number.NaN}}distanceEnvelopeEnvelope(t,e,i,n){i.t=Number.NaN,i.index=-1,n.t=Number.NaN,n.index=-1;const s=t.asEnvelope2D(),o=e.asEnvelope2D();return Math.sqrt(s.sqrDistanceEnvelope(o,i.outPoint,n.outPoint))}distanceMultipathGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:{this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const s=this.distancePointMultipath(e,t,n,i);return this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),s}case s.G.enumMultiPoint:{this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const s=this.distanceMultipointMultipath(e,t,n,i);return this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),s}case s.G.enumPolyline:case s.G.enumPolygon:return this.distanceMultipathMultipath(t,e,i,n);case s.G.enumEnvelope:return this.distanceMultipathMultipath(t,P(e),i,n);default:return Number.NaN}}distanceMultipathMultipath(t,e,i,s){const r={stack:[],error:void 0,hasError:!1};try{const u=[t],h=[e],l=this.swapGeometriesIfAGtB(u,h);l&&(this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),p(i,s)),(0,n.mS)(r,(0,m.h)(()=>{p(i,s),this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)},!l),!1);const x=u[0],P=h[0],D=x.querySegmentIterator();D.stripAttributes();const v=P.querySegmentIterator();if(v.stripAttributes(),this.m_bIsNearCalc&&this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)<=this.m_maxSqrDistance)return 0;if(this.m_bIsNearCalc){const t=Math.trunc((0,m.s)(Math.sqrt(x.getPointCount())+1,1,(0,m.i)())),e=Math.trunc((0,m.s)(Math.sqrt(x.getPointCount())+1,1,(0,m.i)()));if(this.distanceMultipointMultipoint(x,P,i,s,t,e)<=this.m_maxSqrDistance)return 0}if(this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)){const t=c(),e=c();if(y(x,P,D,v,t,e))return _(i,t),_(s,e),0}const G=d(x),f=[],S=new o.S,M=new a.Envelope2D,b=new a.Envelope2D,E=new a.Envelope2D;let T=this.m_maxSqrDistance,I=!0,N=!1;for(let t=0,e=G.length;t<e;++t){x.querySegment(G[t],S,!0);const e=S.get();if(e.queryEnvelope(M),!(M.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>T)){if(this.m_bIsNearCalc&&M.sqrMaxDistanceEnvelope(this.m_env2DgeometryB)<=T)return 0;for(;v.nextPath();){if(this.progress_(),I)P.queryPathEnvelope(v.getPathIndex(),E),f[v.getPathIndex()]=E.clone();else if(M.sqrDistanceEnvelope(f[v.getPathIndex()],null,null)>T)continue;for(;v.hasNextSegment();){const n=v.nextSegment();if(n.queryEnvelope(b),M.sqrDistanceEnvelope(b,null,null)<=T){const o=!M.isIntersecting(b),r=[0],m=[0];let a=e.distance(n,o,r,m);if(a*=a,this.m_bIsNearCalc&&a<=this.m_maxSqrDistance)return 0;if(a<T||a===T&&G[t]<i.index){if(N=!0,g(i,e,G[t],r[0]),g(s,n,v.getStartPointIndex(),m[0]),0===a)return 0;T=a}}}}v.resetToFirstPath(),I=!1}}return N?Math.sqrt(T):Number.POSITIVE_INFINITY}catch(t){r.error=t,r.hasError=!0}finally{(0,n.hk)(r)}}swapGeometriesIfAGtB(t,e){return(0,s.v)(t[0])>(0,s.v)(e[0])&&(e[0]=(0,m.c)(t[0],t[0]=e[0]),!0)}swapGeometriesIfBGtA(t,e){return this.swapGeometriesIfAGtB(e,t)}}},31088:(t,e,i)=>{i.r(e),i.d(e,{OperatorGeodeticDensifyByLength:()=>r,OperatorGeodeticDensifyCursor:()=>m});var n=i(76061),s=i(55537),o=i(39117);class r{getOperatorType(){return 10310}supportsCurves(){return!0}accelerateGeometry(t,e,i){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,i,n,s){return new m(t,i,n,e,-1,-1,s)}execute(t,e,i,o,r){const m=new n.S([t]),a=this.executeMany(m,e,i,o,r).next();return a||(0,s.d)("null output"),a}}class m extends n.G{constructor(t,e,i,n,o,r,m){super(),this.m_progressTracker=m,r>0&&(0,s.t)(""),4!==i&&o>0&&(0,s.t)(""),e||(0,s.a)(""),0===e.getCoordinateSystemType()&&(0,s.a)(""),n>0||o>0||(0,s.a)(""),this.m_index=-1,this.m_inputGeoms=t,this.m_spatialReference=e,this.m_curveType=i,this.m_maxLengthMeters=n,this.m_maxDeviationMeters=o,this.m_maxAngle=r}next(){{let t;for(;t=this.m_inputGeoms.next();)return(0,s.c)(t),this.m_index=this.m_inputGeoms.getGeometryID(),this.geodeticDensify(t);return null}}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodeticDensify(t){return(0,o.ak)(t,this.m_spatialReference,this.m_curveType,this.m_maxLengthMeters,this.m_maxDeviationMeters,this.m_progressTracker)}}},76061:(t,e,i)=>{i.d(e,{G:()=>n,S:()=>s});class n{*[Symbol.iterator](){let t=this.next();for(;t;)yield t,t=this.next()}}class s extends n{constructor(t){super(),this.m_iGeom=-1,this.m_aGeoms=t?t.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const t=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,t}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1088,6859],{16859:(t,e,i)=>{i.d(e,{G:()=>M,a:()=>f,m:()=>D});var n=i(31635),s=i(55537),o=i(88885),r=i(39117),m=i(95213),a=i(79187),u=i(83661),c=i(11878),h=i(26640),l=i(76061),_=i(31088);class g{getOperatorType(){return 10317}supportsCurves(){return!0}accelerateGeometry(t,e,i){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,i,n,s,o){return new _.OperatorGeodeticDensifyCursor(t,e,4,i,n,s,o)}execute(t,e,i,n,o,r){const m=new l.S([t]),a=this.executeMany(m,e,i,n,o,r).next();return a||(0,s.d)("null output"),a}}var p=i(31139);class y{[Symbol.dispose](){this.m_peR1.destroy(),this.m_peR2.destroy(),this.m_peR3.destroy(),this.m_peR1=null,this.m_peR2=null,this.m_peR3=null}constructor(t,e,i){this.m_peR1=new r.aa,this.m_peR2=new r.aa,this.m_peR3=new r.aa,void 0!==t?this.reset(t,e,i):this.reset(1,0,1)}reset(t,e,i){this.m_a=t,this.m_e2=e,this.m_b=this.m_a*Math.sqrt(1-this.m_e2),this.m_unitToDegree=i,this.m_unitToRad=.017453292519943295*i,this.m_u180=180/this.m_unitToDegree,this.m_u360=360/this.m_unitToDegree}calculateBbox(t,e,i,n){const s=this.m_peR1,o=this.m_peR2,m=this.m_peR3;r.ab.geodeticDistance(this.m_a,this.m_e2,t*this.m_unitToRad,e*this.m_unitToRad,i*this.m_unitToRad,n*this.m_unitToRad,m,s,o,0);const c=Math.cos(s.val),h=Math.cos(o.val+3.141592653589793),l=e*this.m_unitToRad,_=r.al.phiToEta(this.m_e2,l),g=Math.sin(s.val)*Math.cos(_);let p=e;if(c*h<0){const t=c<0?-1:1,e=Math.acos(Math.abs(g))*t;p=r.al.etaToPhi(this.m_e2,e)/this.m_unitToRad}let y=(0,u.n)((i-t)*this.m_unitToRad,2*Math.PI);Math.abs(y)>Math.PI&&(y=y>0?y-2*Math.PI:y+2*Math.PI),y/=this.m_unitToRad,i=t+y;const d=new a.Envelope2D;return d.xmin=Math.min(t,i),d.xmax=Math.max(t,i),d.ymin=Math.min(e,n),d.ymin=Math.min(d.ymin,p),d.ymax=Math.max(e,n),d.ymax=Math.max(d.ymax,p),d}minDistanceGeodesic(t,e){const i=d(t),n=d(e);if(i&&n)return this.lowerDistanceGeodetic_(t.xmin,t.ymin,e.xmin,e.ymin);const s=this.normalizeGeodesic_(e,t);return function(t,e){return e.xmax<t.xmin||e.xmin>t.xmax||e.ymax<t.ymin||e.ymin>t.ymax}(t,s)?t.ymin>=s.ymax?this.minDistanceGeodesicUpDown_(t,s):s.ymin>=t.ymax?this.minDistanceGeodesicUpDown_(s,t):t.xmin>s.xmax?this.minDistanceGeodesicLeftRight_(s,t):this.minDistanceGeodesicLeftRight_(t,s):0}normalizeGeodesic_(t,e){const i=t.clone(),n=t.clone();let s=x(i,e);if(0===s)return i;for(;n.xmax>e.xmin;){n.xmin-=this.m_u360,n.xmax-=this.m_u360;const t=x(n,e);if(t<s&&(i.assign(n),s=t,0===s))return i}for(n.assign(t);n.xmin<e.xmax;){n.xmin+=this.m_u360,n.xmax+=this.m_u360;const t=x(n,e);if(t<s&&(i.assign(n),s=t,0===s))return i}return i}lowerDistanceGeodetic_(t,e,i,n){const s=this.m_peR1;{const o=this.m_b*this.m_b/this.m_a,m=r.al.phiToPhig(this.m_e2,this.m_unitToRad*e),a=r.al.phiToPhig(this.m_e2,this.m_unitToRad*n);r.ab.geodeticDistance(o,0,this.m_unitToRad*t,m,this.m_unitToRad*i,a,s,null,null,0)}return s.val}minDistanceGeodesicUpDown_(t,e){if(e.xmin<=t.xmin?e.xmax>=t.xmin:t.xmax>=e.xmin)return this.lowerDistanceGeodetic_(0,t.ymin,0,e.ymax);if(e.xmin>t.xmax){const i=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);if(e.xmax-t.xmin<this.m_u180)return i;const n=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);return Math.min(i,n)}{const i=this.lowerDistanceGeodeticSegMeridional_(t.xmin,t.ymin,t.ymax,e.xmax,e.ymin,e.ymax);if(t.xmax-e.xmin<this.m_u180)return i;const n=this.lowerDistanceGeodeticSegMeridional_(t.xmax,t.ymin,t.ymax,e.xmin,e.ymin,e.ymax);return Math.min(i,n)}}minDistanceGeodesicLeftRight_(t,e){let i=Math.abs(t.xmax-e.xmin);for(;i>this.m_u180;)i-=this.m_u360;let n=Math.abs(t.xmin-e.xmax);for(;n>this.m_u180;)n-=this.m_u360;return Math.abs(i)<=Math.abs(n)?this.minDistanceGeodesicLeftRightNormalized_(t,e):this.minDistanceGeodesicLeftRightNormalized_(e,t)}minDistanceGeodesicLeftRightNormalized_(t,e){let i,n;return i=this.lowerDistanceGeodetic_(t.xmax,t.ymin,e.xmin,e.ymin),t.ymin>=e.ymin&&t.ymin<=e.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymin,e.xmin,e.ymin,e.ymax),i=Math.min(i,n)),e.ymin>=t.ymin&&e.ymin<=t.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymin,t.xmax,t.ymin,t.ymax),i=Math.min(i,n)),n=this.lowerDistanceGeodetic_(t.xmax,t.ymax,e.xmin,e.ymax),i=Math.min(i,n),t.ymax>=e.ymin&&t.ymax<=e.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(t.xmax,t.ymax,e.xmin,e.ymin,e.ymax),i=Math.min(i,n)),e.ymax>=t.ymin&&e.ymax<=t.ymax&&(n=this.lowerDistanceGeodeticPtMeridional_(e.xmin,e.ymax,t.xmax,t.ymin,t.ymax),i=Math.min(i,n)),i}lowerDistanceGeodeticSegMeridional_(t,e,i,n,s,o){let r=this.lowerDistanceGeodeticPtMeridional_(t,e,n,s,o);const m=this.lowerDistanceGeodeticPtMeridional_(t,i,n,s,o);let a=this.lowerDistanceGeodeticPtMeridional_(n,s,t,e,i);const u=this.lowerDistanceGeodeticPtMeridional_(n,o,t,e,i);return r=Math.min(r,m),a=Math.min(a,u),Math.min(r,a)}lowerDistanceGeodeticPtMeridional_(t,e,i,n,s){const o=this.m_b*this.m_b/this.m_a,a=r.al.phiToPhig(this.m_e2,this.m_unitToRad*e),c=r.al.phiToPhig(this.m_e2,this.m_unitToRad*n),h=r.al.phiToPhig(this.m_e2,this.m_unitToRad*s),l=this.m_peR1,_=this.m_peR2;r.ab.geodeticDistance(o,0,this.m_unitToRad*i,c,this.m_unitToRad*t,a,l,null,null,0),r.ab.geodeticDistance(o,0,this.m_unitToRad*i,h,this.m_unitToRad*t,a,_,null,null,0);const g=(0,r.ad)(1,0,new u.P(this.m_unitToRad*t,a)),p=(0,r.ad)(1,0,new u.P(this.m_unitToRad*i,c)),y=(0,r.ad)(1,0,new u.P(this.m_unitToRad*i,h));let d=new m.d;d.setCrossProductVector(p,y);const x=p.dotProduct(y);if(d.length()<1.568e-10)return x>=0?Math.min(l.val,_.val):0;d=d.getUnitVector();let P=new m.d;if(P.setCrossProductVector(d,g),P.length()<1.568e-10)return Math.min(l.val,_.val)-1e-5*o;P=P.getUnitVector();let D=g.sub(d.mul(g.dotProduct(d)));{const e=new m.d;e.setCrossProductVector(p,D);const i=new m.d;i.setCrossProductVector(D,y);let n=d.dotProduct(e)>0&&d.dotProduct(i)>0;if(n||(D.negateThis(),e.setCrossProductVector(p,D),i.setCrossProductVector(D,y),n=d.dotProduct(e)>0&&d.dotProduct(i)>0),n){D=D.getUnitVector();const e=(0,r.ak)(1,0,D),i=this.m_peR3;r.ab.geodeticDistance(o,0,this.m_unitToRad*t,a,e.x,e.y,i,null,null,0);const n=Math.min(l.val,_.val);return Math.min(n,i.val)}}return Math.min(l.val,_.val)}}function d(t){return t.xmin===t.xmax&&t.ymin===t.ymax}function x(t,e){let i,n=0;return i=t.xmin-e.xmax,i>n&&(n=i),i=e.xmin-t.xmax,i>n&&(n=i),n}class P{}function D(t){return{outPoint:void 0===t?new u.P:t.clone()}}function v(t,e){t.outPoint.assign(e.outPoint)}function G(){return new a.Envelope2D}class f{constructor(t,e,i,n,s=0,o=4){this.m_ptDistFrom=new u.P,this.m_segStartPt=new u.P,this.m_segEndPt=new u.P,this.m_geodeticLength=new r.aa,this.m_az12=new r.aa,this.m_minGeodeticDist=new r.aa,this.m_segStartPt3d=new m.d,this.m_segEndPt3d=new m.d,this.m_sr=n,this.m_distCurveType=s,this.m_segCurveType=o,this.m_inputGCS=this.m_sr.getGCS(),this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_bIsPannablePcs=2===this.m_sr.getCoordinateSystemType()&&this.m_sr.isPannable();const a=(0,r.r)();this.m_inputGCS.querySpheroidData(a),this.m_a=a.majorSemiAxis,this.m_eSquared=a.e2,this.setPointDistFrom(t),this.setSegmentEndPoints(e,i)}setSegmentEndPoints(t,e){this.m_segStartPt.assign(t),this.m_segEndPt.assign(e),this.m_bIsPannablePcs||(this.m_segStartPt.mulThis(this.m_rpu),this.m_segEndPt.mulThis(this.m_rpu)),2===this.m_segCurveType&&(this.m_segStartPt3d.assign((0,r.ad)(this.m_a,this.m_eSquared,this.m_segStartPt)),this.m_segEndPt3d.assign((0,r.ad)(this.m_a,this.m_eSquared,this.m_segEndPt))),this.calculateAndUpdateSegmentLength()}setPointDistFrom(t){this.m_ptDistFrom.assign(t),this.m_ptDistFrom.scale(this.m_rpu)}setSegmentCurveType(t){this.m_segCurveType=t}setDistanceCurveType(t){this.m_distCurveType=t}makeFunctor(){return t=>{let e;switch(this.m_segCurveType){case 0:case 1:case 3:{const i={stack:[],error:void 0,hasError:!1};try{const s=(0,n.mS)(i,new r.aa,!1),o=(0,n.mS)(i,new r.aa,!1);r.ab.geodeticCoordinate(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_geodeticLength.val*t,this.m_az12.val,s,o,this.m_segCurveType),e=new u.P(s.val,o.val);break}catch(t){i.error=t,i.hasError=!0}finally{(0,n.hk)(i)}}case 2:{const i=m.d.lerp(this.m_segStartPt3d,this.m_segEndPt3d,t);e=(0,r.ak)(this.m_a,this.m_eSquared,i);break}case 4:e=u.P.lerp(this.m_segStartPt,this.m_segEndPt,t),this.m_bIsPannablePcs&&((0,r.af)(this.m_sr,0,[e],1),e.mulThis(this.m_rpu));break;default:(0,s.d)("Invalid curve type")}return r.ab.geodeticDistance(this.m_a,this.m_eSquared,this.m_ptDistFrom.x,this.m_ptDistFrom.y,e.x,e.y,this.m_minGeodeticDist,null,null,this.m_distCurveType),this.m_minGeodeticDist.val}}calculateAndUpdateSegmentLength(){switch(this.m_segCurveType){case 0:case 2:case 1:case 3:r.ab.geodeticDistance(this.m_a,this.m_eSquared,this.m_segStartPt.x,this.m_segStartPt.y,this.m_segEndPt.x,this.m_segEndPt.y,this.m_geodeticLength,this.m_az12,null,this.m_segCurveType);break;case 4:this.m_geodeticLength.val=u.P.distance(this.m_segStartPt,this.m_segEndPt);break;default:(0,s.d)("Invalid curve type")}}[Symbol.dispose](){this.m_geodeticLength[Symbol.dispose](),this.m_az12[Symbol.dispose](),this.m_minGeodeticDist[Symbol.dispose]()}}function S(){return new P}class M{[Symbol.dispose](){this.m_envHelper[Symbol.dispose]()}constructor(t,e,i,n,s){this.m_boxGeomA=G(),this.m_boxGeomB=G(),this.m_envGeomA=new a.Envelope2D,this.m_envGeomB=new a.Envelope2D,this.m_progressCounter=0,this.m_transformPCS2GCS=null,this.m_segmentBoxesA=new Map,this.m_segmentBoxesB=new Map,this.m_boundaryPtsA=[],this.m_boundaryPtsB=[],this.m_scaleToRadians=new c.T,this.m_scaleToDegrees=new c.T,this.m_inputSR=t,this.m_distCurveType=e,this.m_progressTracker=i,this.m_maxDistance=n,this.m_maxDeviation=s,this.m_inputGCS=t.getGCS(),this.m_peGeogcs=this.m_inputGCS.getPECoordSys(),this.m_tolerance=0;const o=(0,r.r)();this.m_inputGCS.querySpheroidData(o),this.m_a=o.majorSemiAxis,this.m_eSquared=o.e2,this.m_rpu=this.m_inputGCS.getUnit().getUnitToBaseFactor(),this.m_envHelper=new y(this.m_a,this.m_eSquared,1),4===this.m_distCurveType&&(this.m_distCurveType=0),this.m_boxGeomA.setEmpty(),this.m_boxGeomB.setEmpty(),this.m_envGeomA.setEmpty(),this.m_envGeomB.setEmpty(),this.m_bIsPannablePcs=2===this.m_inputSR.getCoordinateSystemType()&&this.m_inputSR.isPannable()}progress(t=!1){}calculate(t,e,i,n){const s=D(),o=D();if(t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.checkGeometriesIntersect(t,e,s,o))return i&&v(i,s),n&&v(n,o),0;const r=this.prepareGeometry(t);if(r.isEmpty())return Number.NaN;const m=this.prepareGeometry(e);if(m.isEmpty())return Number.NaN;this.m_tolerance=this.computeTolerance(r,m);const a=this._ExecuteBruteForce(r,m,s,o);return a>=this.m_maxDistance?Number.NaN:(i&&(this.prepareOutput(s),v(i,s)),n&&(this.prepareOutput(o),v(n,o)),a)}createDistanceFunctor(t,e,i){const n=new f(t,e,i,this.m_inputSR,this.m_distCurveType);return this.m_bIsPannablePcs||1===this.m_inputSR.getCoordinateSystemType()||n.setSegmentCurveType(2),n}_NormalizeAndProject(t){if(this.m_inputSR.isPannable()&&(t=(new r.O).foldInto360Range(t,this.m_inputSR)),2===this.m_inputSR.getCoordinateSystemType()){const e=(0,r.E)(this.m_inputSR,this.m_inputGCS,null);t=(new r.O).execute(t,e,this.m_progressTracker)}return t}_ExecuteBruteForce(t,e,i,n){switch(t.getGeometryType()){case s.G.enumPoint:return this.calculateDistanceGeodeticPointGeometry(t,e,i,n);case s.G.enumMultiPoint:return this.calculateDistanceGeodeticMultipointGeometry(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:case s.G.enumEnvelope:return this.calculateDistanceGeodeticMultipathGeometry(t,e,i,n);default:(0,s.a)("")}}calculateDistanceGeodeticPointGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.calculateDistanceGeodeticPointPoint(t,e,i,n);case s.G.enumMultiPoint:return this.calculateDistanceGeodeticPointMultipoint(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:return this.calculateDistanceGeodeticPointMultipath(t,e,i,n);default:(0,s.a)("")}}calculateDistanceGeodeticPointPoint(t,e,i,s){const o={stack:[],error:void 0,hasError:!1};try{const m=t.getXY();m.scale(this.m_rpu);const a=e.getXY();a.scale(this.m_rpu),i.outPoint.assign(m),s.outPoint.assign(a);const u=(0,n.mS)(o,new r.aa,!1);return r.ab.geodeticDistance(this.m_a,this.m_eSquared,m.x,m.y,a.x,a.y,u,null,null,this.m_distCurveType),u.val}catch(t){o.error=t,o.hasError=!0}finally{(0,n.hk)(o)}}calculateDistanceGeodeticPointMultipoint(t,e,i,s){const o={stack:[],error:void 0,hasError:!1};try{this.computeEnvelopesAndBoxes(t,e);const a=this.estimateMinimumDistance(i,s);let c=a<this.m_maxDistance?a:this.m_maxDistance;const h=t.getXY();h.scale(this.m_rpu),i.outPoint.assign(h);const l=(0,r.ad)(this.m_a,this.m_eSquared,h),_=new u.P,g=e.getImpl(),p=(0,n.mS)(o,new r.aa,!1),y=g.getPointCount();for(let t=0;t<y;++t){g.queryXY(t,_),_.scale(this.m_rpu);const e=(0,r.ad)(this.m_a,this.m_eSquared,_);if(!(m.d.distance(l,e)>c)&&!(this.m_envHelper.minDistanceGeodesic(this.m_boxGeomA,this.m_boxGeomB)>c)&&(r.ab.geodeticDistance(this.m_a,this.m_eSquared,h.x,h.y,_.x,_.y,p,null,null,this.m_distCurveType),p.val<c&&(c=p.val,s.outPoint=_,0===c)))return c}return c===this.m_maxDistance?Number.POSITIVE_INFINITY:c}catch(t){o.error=t,o.hasError=!0}finally{(0,n.hk)(o)}}calculateDistanceGeodeticPointMultipath(t,e,i,o){const m={stack:[],error:void 0,hasError:!1};try{const a=new u.P,c=new u.P;a.assign(t.getXY()),c.assign(t.getXY()),i.outPoint.assign(c.mul(this.m_rpu)),this.m_bIsPannablePcs&&(0,r.ae)(this.m_inputSR,[a],1,!1),this.computeEnvelopesAndBoxes(t,e);const h=this.estimateMinimumDistance(i,o);let l=h<this.m_maxDistance?h:this.m_maxDistance;const _=e.getImpl(),g=new u.P(0,0),p=new u.P(0,0),y=[1],d=this.canUseSpatialTree(t,e),x=S();d&&this.buildSpatialTree(x,e);const P=G();P.setCoords({xmin:c.x,ymin:c.y,xmax:c.x,ymax:c.y});const D=(0,n.mS)(m,this.createDistanceFunctor(c,g,p),!1),v=_.querySegmentIterator();if(v.stripAttributes(),d)(0,s.g)(0);else for(;v.nextPath();)for(;v.hasNextSegment();){const t=v.nextSegment(),e=this.findOrComputeBoxSegment(v.getStartPointIndex(),t,this.m_segmentBoxesB);if(this.m_envHelper.minDistanceGeodesic(P,e)>l)continue;const i=this.calculateDistanceGeodeticPointSegment(a,c,t,y,D);if(i.second<l&&(this.updateOutputSegment(o,t,i.first),l=i.second,0===l))return 0}return l===this.m_maxDistance?Number.POSITIVE_INFINITY:l}catch(t){m.error=t,m.hasError=!0}finally{(0,n.hk)(m)}}calculateDistanceGeodeticMultipointGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.calculateDistanceGeodeticPointMultipoint(e,t,n,i);case s.G.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipoint(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:case s.G.enumEnvelope:return this.calculateDistanceGeodeticMultipointMultipath(t,e,i,n);default:(0,s.a)("")}}calculateDistanceGeodeticMultipointMultipoint(t,e,i,s){const o={stack:[],error:void 0,hasError:!1};try{const a=(0,n.mS)(o,new r.aa,!1);this.computeEnvelopesAndBoxes(t,e);const c=this.estimateMinimumDistance(i,s);let h=c<this.m_maxDistance?c:this.m_maxDistance;const l=new u.P,_=new u.P,g=t.getImpl(),p=e.getImpl(),y=G(),d=g.getPointCount(),x=p.getPointCount();for(let t=0;t<d;++t){if(l.assign(g.getXY(t)),y.setCoords({xmin:l.x,ymin:l.y,xmax:l.x,ymax:l.y}),this.m_envHelper.minDistanceGeodesic(y,this.m_boxGeomB)>h)continue;l.scale(this.m_rpu);const e=(0,r.ad)(this.m_a,this.m_eSquared,l);for(let t=0;t<x;++t){_.assign(p.getXY(t)),_.scale(this.m_rpu);const n=(0,r.ad)(this.m_a,this.m_eSquared,_);if(!(m.d.distance(e,n)>=h)&&(r.ab.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,a,null,null,this.m_distCurveType),a.val<h&&(i.outPoint.assign(l),s.outPoint.assign(_),h=a.val,0===h)))return h}}return h===this.m_maxDistance?Number.POSITIVE_INFINITY:h}catch(t){o.error=t,o.hasError=!0}finally{(0,n.hk)(o)}}calculateDistanceGeodeticMultipointMultipath(t,e,i,o){const m={stack:[],error:void 0,hasError:!1};try{const a=e.getImpl().querySegmentIterator();a.stripAttributes(),this.computeEnvelopesAndBoxes(t,e);const c=this.estimateMinimumDistance(i,o);let h=c<this.m_maxDistance?c:this.m_maxDistance;const l=new u.P,_=new u.P(0,0),g=new u.P(0,0),p=new u.P(0,0),y=[0],d=G(),x=(0,n.mS)(m,this.createDistanceFunctor(_,g,p),!1),P=S(),D=this.canUseSpatialTree(t,e);D&&this.buildSpatialTree(P,e);const v=t.getPointCount();for(let e=0;e<v;++e)if(l.assign(t.getXY(e)),_.assign(t.getXY(e)),this.m_bIsPannablePcs&&(0,r.ae)(this.m_inputSR,[l],1,!1),d.setCoords({xmin:_.x,ymin:_.y,xmax:_.x,ymax:_.y}),!(this.m_envHelper.minDistanceGeodesic(d,this.m_boxGeomB)>h))if(x.setPointDistFrom(_),D)(0,s.g)(0);else{for(;a.nextPath();)for(;a.hasNextSegment();){const t=a.nextSegment();if(this.m_envHelper.minDistanceGeodesic(d,this.findOrComputeBoxSegment(a.getStartPointIndex(),t,this.m_segmentBoxesB))>h)continue;const e=this.calculateDistanceGeodeticPointSegment(l,_,t,y,x);if(e.second<h&&(i.outPoint.assign(_.mul(this.m_rpu)),this.updateOutputSegment(o,t,e.first),h=e.second,0===h))return 0}a.resetToFirstPath()}return h===this.m_maxDistance?Number.POSITIVE_INFINITY:h}catch(t){m.error=t,m.hasError=!0}finally{(0,n.hk)(m)}}calculateDistanceGeodeticMultipathGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.calculateDistanceGeodeticPointMultipath(e,t,n,i);case s.G.enumMultiPoint:return this.calculateDistanceGeodeticMultipointMultipath(e,t,n,i);case s.G.enumPolyline:case s.G.enumPolygon:case s.G.enumEnvelope:return this.calculateDistanceGeodeticMultipathMultipath(t,e,i,n);default:(0,s.a)("")}}calculateDistanceGeodeticMultipathMultipath(t,e,i,n){const s=[t],o=[e],r=this.swapGeometries(s,o),m=s[0],a=o[0];this.computeEnvelopesAndBoxes(s[0],o[0]);const c=this.estimateMinimumDistance(i,n),h=this.calculateDistanceGeodeticMultipathMultipath_(m,a,i,n,c);return r&&(n.outPoint=(0,u.c)(i.outPoint,i.outPoint=n.outPoint)),h}calculateDistanceGeodeticMultipathMultipath_(t,e,i,m,a=Number.MAX_VALUE){const c={stack:[],error:void 0,hasError:!1};try{let l=a;const _=new u.P(0,0),g=new u.P,p=new u.P(0,0),y=new u.P,d=new u.P(0,0),x=new u.P,P=new u.P,D=new u.P,v=[new u.P],f=[0],M=[0],b=G(),E=G(),T=(0,n.mS)(c,this.createDistanceFunctor(d,_,p),!1),I=S(),N=this.canUseSpatialTree(t,e);N&&this.buildSpatialTree(I,e);const w=e.querySegmentIterator();w.stripAttributes();const B=new o.S,C=(0,h.s)(t);for(let e=0;e<C.length;++e){const n=C[e];t.getSegmentBuffer(n,B,!0);const o=B.get();if(b.assign(this.findOrComputeBoxSegment(n,o,this.m_segmentBoxesA)),N)(0,s.g)(0);else{if(d.assign(o.getStartXY()),x.assign(o.getStartXY()),P.assign(o.getEndXY()),D.assign(o.getEndXY()),this.m_bIsPannablePcs&&((0,r.af)(this.m_inputSR,0,[x],1),(0,r.af)(this.m_inputSR,0,[D],1)),this.m_envHelper.minDistanceGeodesic(b,this.m_boxGeomB)>l)continue;for(;w.nextPath();){for(;w.hasNextSegment();){const t=w.nextSegment();if(_.assign(t.getStartXY()),g.assign(t.getStartXY()),p.assign(t.getEndXY()),y.assign(t.getEndXY()),o.intersect(t,v,f,M,this.m_tolerance))return this.updateOutputSegment(i,o,f[0]),this.updateOutputSegment(m,t,M[0]),0;if(this.m_bIsPannablePcs&&((0,r.af)(this.m_inputSR,0,[g],1),(0,r.af)(this.m_inputSR,0,[y],1)),E.assign(this.findOrComputeBoxPoint(w.getStartPointIndex(),g,y,this.m_segmentBoxesB)),this.m_envHelper.minDistanceGeodesic(b,E)>l)continue;T.setSegmentEndPoints(_,p),T.setPointDistFrom(x);let e=(0,r.ag)(T.makeFunctor(),0,1,1e-10);if(e.second<l&&(i.outPoint.assign(x.mul(this.m_rpu)),this.updateOutputSegment(m,t,e.first),l=e.second,0===l))break;if(T.setPointDistFrom(D),e=(0,r.ag)(T.makeFunctor(),0,1,1e-10),e.second<l&&(i.outPoint.assign(D.mul(this.m_rpu)),this.updateOutputSegment(m,t,e.first),l=e.second,0===l))break;if(T.setSegmentEndPoints(d,P),T.setPointDistFrom(g),e=(0,r.ag)(T.makeFunctor(),0,1,1e-10),e.second<l&&(this.updateOutputSegment(i,o,e.first),m.outPoint.assign(g.mul(this.m_rpu)),l=e.second,0===l))break;if(T.setPointDistFrom(y),e=(0,r.ag)(T.makeFunctor(),0,1,1e-10),e.second<l&&(this.updateOutputSegment(i,o,e.first),m.outPoint.assign(y.mul(this.m_rpu)),l=e.second,0===l))break}if(0===l)return 0}w.resetToFirstPath()}}return l===this.m_maxDistance?Number.POSITIVE_INFINITY:l}catch(t){c.error=t,c.hasError=!0}finally{(0,n.hk)(c)}}calculateDistanceGeodeticPointSegment(t,e,i,n,s){const o=i.getStartXY(),m=i.getEndXY();return i.intersectPoint(t,n,this.m_tolerance)?(0,u.l)(n[0],0):(s.setPointDistFrom(e),s.setSegmentEndPoints(o,m),(0,r.ag)(s.makeFunctor(),0,1,1e-10))}prepareGeometry(t){let e=t.clone();const i=t.getGeometryType();if(i===s.G.enumPoint||i===s.G.enumMultiPoint)return this._NormalizeAndProject(e);if(i===s.G.enumEnvelope&&(e=this.envelopeToPolygon(e)),this.m_inputSR.isPannable())return this.prepareGeometryPannable(e,4);if(2===this.m_inputSR.getCoordinateSystemType()){if(e=(0,r.ah)(e,this.m_inputSR,0,null),e.isEmpty())return e;e=(new g).execute(e,this.m_inputSR,5e4,this.m_maxDeviation/2,0,null);const t=this.m_inputSR.getSRToGCSTransform();return(new r.O).execute(e,t,this.m_progressTracker)}const n=new a.Envelope2D;e.queryLooseEnvelope(n);const o=this.m_inputSR.getPannableExtent();if(n.ymin<o.ymin||n.ymax>o.ymax){const t=new a.Envelope2D(n.xmin-1,o.ymin,n.xmax+1,o.ymax);if(e=(new p.O).execute(e,t,this.m_inputSR,this.m_progressTracker),e.isEmpty())return e}return n.width()>2*o.width()?(e=(0,r.ai)(e,-2*o.width(),2*o.width(),this.m_inputSR,!0,0,!0,this.m_progressTracker),e):e}prepareGeometryPannable(t,e){const i=new a.Envelope2D;t.queryEnvelope(i);const n=this.m_inputSR.getPannableExtent();if(n.containsEnvelope(i))return t;const s=new u.E;n.queryIntervalX(s);const o=new u.E;return i.queryIntervalX(o),s.contains(o)?(0,r.a7)(t,this.m_inputSR):(new r.O).foldInto360RangeGeodetic(t,this.m_inputSR,e)}prepareOutput(t){t.outPoint.scale(1/this.m_rpu),2===this.m_inputSR.getCoordinateSystemType()&&(0,r.ae)(this.m_inputSR,[t.outPoint],1,!1)}updateOutputSegment(t,e,i){e.queryCoord2D(i,t.outPoint),this.m_bIsPannablePcs&&(0,r.af)(this.m_inputSR,0,[t.outPoint],1),t.outPoint.mulThis(this.m_rpu)}computeTolerance(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB);const i=new a.Envelope2D(this.m_envGeomA);return i.mergeEnvelope2D(this.m_envGeomB),(0,m.a)(null,i)}envelopeToPolygon(t){const e=new o.a;return e.addEnvelope(t,!1),e}computeEnvelopesAndBoxes(t,e){t.queryEnvelope(this.m_envGeomA),e.queryEnvelope(this.m_envGeomB),this.m_boxGeomA=this.computeBoxGeometry(t,this.m_boundaryPtsA,this.m_segmentBoxesA),this.m_boxGeomB=this.computeBoxGeometry(e,this.m_boundaryPtsB,this.m_segmentBoxesB)}computeBoxGeometry(t,e,i){switch(t.getGeometryType()){case s.G.enumPoint:return this.computeBoxPoint(t,e);case s.G.enumMultiPoint:return this.computeBoxMultiPoint(t,e);case s.G.enumPolyline:case s.G.enumPolygon:return this.computeBoxMultiPath(t,e,i);default:(0,s.d)("Invalid geometry type")}}computeBoxPoint(t,e){const i=t.getXY();e.length=0,e.push(i.mul(this.m_rpu));const n=G();return n.setCoords({xmin:i.x,ymin:i.y,xmax:i.x,ymax:i.y}),n}computeBoxMultiPoint(t,e){let i=!0;for(let n=0;n<t.getPointCount();++n){const s=t.getXY(n);if(i){e.length=0;for(let t=0;t<4;++t)e.push(s.clone());i=!1}s.x<e[0].x&&e[0].assign(s),s.y>e[1].y&&e[1].assign(s),s.x>e[2].x&&e[2].assign(s),s.y<e[3].y&&e[3].assign(s)}for(let t=0;t<e.length;++t)e[t].mulThis(this.m_rpu);const n=G();return t.queryEnvelope(n),n}computeBoxMultiPath(t,e,i){let n=!0;const s=G();s.setEmpty();const o=t.querySegmentIterator();for(o.stripAttributes();o.nextPath();)for(;o.hasNextSegment();){const t=o.nextSegment(),m=t.getStartXY(),a=t.getEndXY();if(this.m_bIsPannablePcs&&((0,r.af)(this.m_inputSR,0,[m],1),(0,r.af)(this.m_inputSR,0,[a],1)),n){for(let t=0;t<4;++t)e.push(m.clone());n=!1}m.x<e[0].x&&e[0].assign(m),m.y>e[1].y&&e[1].assign(m),m.x>e[2].x&&e[2].assign(m),m.y<e[3].y&&e[3].assign(m),a.x<e[0].x&&e[0].assign(a),a.y>e[1].y&&e[1].assign(a),a.x>e[2].x&&e[2].assign(a),a.y<e[3].y&&e[3].assign(a);const u=this.findOrComputeBoxPoint(o.getStartPointIndex(),m,a,i);s.mergeEnvelope2D(u)}for(let t=0;t<e.length;++t)e[t].mulThis(this.m_rpu);return s}findOrComputeBoxSegment(t,e,i){if(!i.has(t)){let n=G();if(e.queryEnvelope(n),this.m_bIsPannablePcs){const t=u.P.construct(n.xmin,n.ymin),e=u.P.construct(n.xmax,n.ymax);(0,r.af)(this.m_inputSR,0,[t],1),(0,r.af)(this.m_inputSR,0,[e],1),n=this.m_envHelper.calculateBbox(t.x,t.y,e.x,e.y)}return i.set(t,n),n}return i.get(t)}findOrComputeBoxPoint(t,e,i,n){if(!n.has(t)){let s=G();return s.setCoords({xmin:e.x,ymin:e.y,xmax:i.x,ymax:i.y}),this.m_bIsPannablePcs&&(s=this.m_envHelper.calculateBbox(s.xmin,s.ymin,s.xmax,s.ymax)),n.set(t,s),s}return n.get(t)}estimateMinimumDistance(t,e){const i={stack:[],error:void 0,hasError:!1};try{const s=t=>(0,r.ad)(this.m_a,this.m_eSquared,t),o=this.m_boundaryPtsA.map(s),a=this.m_boundaryPtsB.map(s);let u=Number.MAX_VALUE,c=0,h=0;for(let t=0;t<o.length;++t)for(let e=0;e<a.length;++e){const i=m.d.distance(o[t],a[e]);i<u&&(u=i,c=t,h=e)}t.outPoint.assign(this.m_boundaryPtsA[c]),e.outPoint.assign(this.m_boundaryPtsB[h]);const l=(0,n.mS)(i,new r.aa,!1);return r.ab.geodeticDistance(this.m_a,this.m_eSquared,this.m_boundaryPtsA[c].x,this.m_boundaryPtsA[c].y,this.m_boundaryPtsB[h].x,this.m_boundaryPtsB[h].y,l,null,null,this.m_distCurveType),l.val}catch(t){i.error=t,i.hasError=!0}finally{(0,n.hk)(i)}}swapGeometries(t,e){return(0,s.v)(t[0])>(0,s.v)(e[0])&&(e[0]=(0,u.c)(t[0],t[0]=e[0]),this.m_envGeomB=(0,u.c)(this.m_envGeomA,this.m_envGeomA=this.m_envGeomB),!0)}canUseSpatialTree(t,e){return!1}checkGeometriesIntersect(t,e,i,n){let o=t.getGeometryType(),m=e.getGeometryType();if(this.m_envGeomA.isIntersecting(this.m_envGeomB)){if(o===s.G.enumPoint&&2===e.getDimension()){const s=[0],o=[t.getXY()];if((0,r.aj)(e,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}else if(m===s.G.enumPoint&&2===t.getDimension()){const s=[2],o=[e.getXY()];if((0,r.aj)(t,o,1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(o[0]),n.outPoint.assign(o[0]),!0}if(o===s.G.enumMultiPoint&&2===e.getDimension())return this.multipointIntersectsArea(t,e,i,n);if(m===s.G.enumMultiPoint&&2===t.getDimension())return this.multipointIntersectsArea(e,t,n,i);let a,u,c=t,l=e;if(o===s.G.enumEnvelope&&(a=this.envelopeToPolygon(t),c=a,o=s.G.enumPolygon),m===s.G.enumEnvelope&&(u=this.envelopeToPolygon(e),l=u,m=s.G.enumPolygon),(0,s.h)(o)&&(0,s.h)(m)){const t=c.querySegmentIterator(),e=l.querySegmentIterator(),s=(0,h.m)(),o=(0,h.m)();if((0,h.w)(c,l,t,e,s,o))return i.outPoint.assign(s.outPoint),n.outPoint.assign(s.outPoint),!0}}return!1}multipointIntersectsArea(t,e,i,n){const s=t.getPointCount();for(let o=0;o<s;++o){const s=[2],m=t.getXY(o);if((0,r.aj)(e,[m],1,this.m_tolerance,s),0!==s[0])return i.outPoint.assign(m),n.outPoint.assign(m),!0}return!1}getNearestNeighbourVisitor(t,e,i,n,o,r,m){return(0,s.g)(0),{}}buildSpatialTree(t,e){(0,s.g)(0)}}},26640:(t,e,i)=>{i.d(e,{D:()=>D,m:()=>c,s:()=>d,w:()=>y});var n=i(31635),s=i(55537),o=i(88885),r=i(39117),m=i(83661),a=i(79187),u=i(95213);function c(){return{outPoint:new m.P,index:-1,t:Number.NaN}}function h(t,e,i){return{outPoint:t.clone(),index:e,t:i}}function l(t,e,i,n){t.outPoint.assign(e),t.index=i,t.t=n}function _(t,e){t.outPoint.assign(e.outPoint),t.index=e.index,t.t=e.t}function g(t,e,i,n){t.index=i,t.t=n,e.queryCoord2D(t.t,t.outPoint)}function p(t,e){const i=c();_(i,t),_(t,e),_(e,i)}function y(t,e,i,n,o,m){if(t.getGeometryType()===s.G.enumPolygon){for(;n.nextPath();)if(n.hasNextSegment()){const e=n.nextSegment();if(0!==(0,r.R)(t,e.getEndXY(),0))return l(o,e.getEndXY(),-1,Number.NaN),l(m,e.getEndXY(),-1,Number.NaN),!0}n.resetToFirstPath()}if(e.getGeometryType()===s.G.enumPolygon){for(;i.nextPath();)if(i.hasNextSegment()){const t=i.nextSegment();if(0!==(0,r.R)(e,t.getEndXY(),0))return l(o,t.getEndXY(),-1,Number.NaN),l(m,t.getEndXY(),-1,Number.NaN),!0}i.resetToFirstPath()}return!1}function d(t){const e=t.getPathCount(),i=(0,m.d)(t.getSegmentCount(),0);let n=0;for(let s=0;s<e;++s){const e=n+t.getSegmentCountPath(s);for(let o=n,r=t.getPathStart(s);o<e;++o,++r)i[o]=r;n=e}return(0,o.s)(t.getPointCount(),i),i}function x(t,e){return!!Number.isNaN(e)||t<=e}function P(t){const e=new o.a;return e.addEnvelope(t,!1),e}class D{constructor(t,e){if(this.m_env2DgeometryA=null,this.m_env2DgeometryB=null,this.m_progressCounter=0,this.m_progressTracker=e,this.m_maxSqrDistance=t*t,this.m_maxDistance=t,this.m_bIsNearCalc=!1,Number.isNaN(this.m_maxDistance)?this.m_maxDistance=Number.POSITIVE_INFINITY:this.m_maxDistance=t,this.m_maxSqrDistance=this.m_maxDistance*this.m_maxDistance,Number.isFinite(this.m_maxSqrDistance)){let t=Math.sqrt(this.m_maxSqrDistance);for(;t<this.m_maxDistance;)this.m_maxSqrDistance*=1+Number.EPSILON,t=Math.sqrt(this.m_maxSqrDistance)}}calculate(t,e,i,n){if((t.getGeometryType()!==u.P.type||e.getGeometryType()!==u.P.type)&&(this.m_env2DgeometryA=new a.Envelope2D,this.m_env2DgeometryB=new a.Envelope2D,t.queryEnvelope(this.m_env2DgeometryA),e.queryEnvelope(this.m_env2DgeometryB),!x(this.m_env2DgeometryA.distanceFromEnvelope(this.m_env2DgeometryB),this.m_maxDistance)))return Number.POSITIVE_INFINITY;const s=h(new m.P,(0,m.j)(),Number.NaN),o=h(new m.P,(0,m.j)(),Number.NaN),r=this._ExecuteBruteForce(t,e,s,o);return x(r,this.m_maxDistance)?(null!==i&&_(i,s),null!==n&&_(n,o),r):Number.POSITIVE_INFINITY}isNear(t,e){if(this.m_bIsNearCalc=!0,t.isEmpty()||e.isEmpty())return!1;if(t===e)return!0;let i=!0;if(t.getGeometryType()!==u.P.type&&t.getGeometryType()!==u.E.type||e.getGeometryType()!==u.P.type&&e.getGeometryType()!==u.E.type||(i=!1),i){if(this.m_env2DgeometryA=new a.Envelope2D,this.m_env2DgeometryB=new a.Envelope2D,t.queryEnvelope(this.m_env2DgeometryA),e.queryEnvelope(this.m_env2DgeometryB),!(this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)>this.m_maxSqrDistance))return!0;if(this.m_env2DgeometryA.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>this.m_maxSqrDistance)return!1}const n=h(new m.P,(0,m.j)(),Number.NaN),s=h(new m.P,(0,m.j)(),Number.NaN);return this._ExecuteBruteForce(t,e,n,s)<=this.m_maxDistance}progress_(t=!1){}_ExecuteBruteForce(t,e,i,n){switch(t.getGeometryType()){case s.G.enumPoint:return this.distancePointGeometry(t,e,i,n);case s.G.enumMultiPoint:return this.distanceMultipointGeometry(t,e,i,n);case s.G.enumEnvelope:return this.distanceEnvelopeGeometry(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:return this.distanceMultipathGeometry(t,e,i,n);default:return Number.NaN}}distancePointGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.distancePointPoint(t,e,i,n);case s.G.enumMultiPoint:return this.distancePointMultipoint(t,e,i,n);case s.G.enumPolyline:case s.G.enumPolygon:return this.distancePointMultipath(t,e,i,n);case s.G.enumEnvelope:return this.distancePointEnvelope(t,e,i,n);default:return Number.NaN}}distancePointPoint(t,e,i,n){const s=t.getXY(),o=e.getXY();return l(i,s,0,0),l(n,o,0,0),Math.sqrt(m.P.sqrDistance(s,o))}distancePointMultipoint(t,e,i,n){const s=t.getXY();let o=this.m_maxSqrDistance,r=o,a=!1;const u=e.getPointCount(),c=new m.P;for(let t=0;t<u;++t)if(e.queryXY(t,c),r=m.P.sqrDistance(s,c),this.m_bIsNearCalc){if(r<=o)return 0}else if(!(r>o)&&(!a&&r===o||r<o)&&(o=r,l(i,s,0,0),l(n,c,t,0),a=!0,0===o))return 0;return a?Math.sqrt(o):Number.POSITIVE_INFINITY}distancePointMultipath(t,e,i,n){const o=!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB),u=t.getXY();if(!o&&e.getGeometryType()===s.G.enumPolygon&&0!==(0,r.R)(e,u,0))return l(i,u,0,0),l(n,u,-1,Number.NaN),0;e.getImpl().getAccelerators();let c=this.m_maxSqrDistance,h=c,_=-1;const g=new a.Envelope2D,p=e.querySegmentIterator();let y=!1;for(;p.nextPath();)for(;p.hasNextSegment();){const t=p.nextSegment();t.queryEnvelope(g);const e=g.sqrDistance(u);if(e>c)continue;if(!this.m_bIsNearCalc&&y&&e===c)continue;_=t.getClosestCoordinate(u,!1);const s=t.getCoord2D(_);if(h=m.P.sqrDistance(u,s),this.m_bIsNearCalc){if(h<=c)return 0}else if(!(h>c)&&(!y||h<c)&&(c=h,l(i,u,0,0),l(n,s,p.getStartPointIndex(),_),y=!0,0===c))return 0}return y?Math.sqrt(c):Number.POSITIVE_INFINITY}distancePointEnvelope(t,e,i,n){const s=t.getXY();l(i,s,0,0),l(n,s,-1,Number.NaN);const o=e.asEnvelope2D();return o.contains(s)?0:Math.sqrt(o.sqrDistance(s,n.outPoint))}distanceMultipointGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:{this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const s=this.distancePointMultipoint(e,t,n,i);return this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),s}case s.G.enumMultiPoint:return this.distanceMultipointMultipoint(t,e,i,n,1,1);case s.G.enumPolyline:case s.G.enumPolygon:return this.distanceMultipointMultipath(t,e,i,n);case s.G.enumEnvelope:return this.distanceMultipointMultipath(t,P(e),i,n);default:return Number.NaN}}distanceMultipointMultipoint(t,e,i,s,o,r){const a={stack:[],error:void 0,hasError:!1};try{if(this.m_bIsNearCalc&&1===o&&1===r){const n=Math.trunc((0,m.s)(Math.sqrt(t.getPointCount())+1,1,(0,m.i)())),o=Math.trunc((0,m.s)(Math.sqrt(e.getPointCount())+1,1,(0,m.i)()));if((n>=4||o>=4)&&this.distanceMultipointMultipoint(t,e,i,s,n,o)<=this.m_maxSqrDistance)return 0}let u=this.m_maxSqrDistance;const c=[t],h=[e],_=this.swapGeometriesIfBGtA(c,h);_&&(this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),r=(0,m.c)(o,o=r),p(i,s)),(0,n.mS)(a,(0,m.h)(()=>{p(i,s),this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)},!_),!1);const g=c[0].getImpl(),y=h[0].getImpl(),d=g.getPointCount(),x=y.getPointCount(),P=x>1;let D=!1;const v=new m.P,G=new m.P;for(let t=0;t<d;t+=o){if(g.queryXY(t,v),P){const t=this.m_env2DgeometryB.sqrDistance(v);if(this.m_bIsNearCalc){if(t>u)continue;if(this.m_env2DgeometryB.sqrMaxMinDistance(v)<=u)return 0}else if(t>=u)continue}for(let e=0;e<x;e+=r){y.queryXY(e,G);const n=m.P.sqrDistance(v,G);if(this.m_bIsNearCalc){if(n<=u)return 0}else if(!(n>u||D&&n===u)&&(!D||n<u)&&(l(i,v,t,0),l(s,G,e,0),D=!0,u=n,0===u))return D?Math.sqrt(u):Number.POSITIVE_INFINITY}}return D?Math.sqrt(u):Number.POSITIVE_INFINITY}catch(t){a.error=t,a.hasError=!0}finally{(0,n.hk)(a)}}distanceMultipointMultipath(t,e,i,n){let o=!!this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)&&e.getGeometryType()===s.G.enumPolygon;const u=e.querySegmentIterator();u.stripAttributes();const c=new a.Envelope2D,h=new m.P;let _=this.m_maxSqrDistance;const g=t.getImpl(),p=g.getPointCount(),y=p>1;let d=!1;for(;u.nextPath();)for(;u.hasNextSegment();){const t=u.nextSegment();if(t.queryLooseEnvelope(c),y){const t=c.sqrDistanceEnvelope(this.m_env2DgeometryA,null,null);if(this.m_bIsNearCalc){if(t>_)continue}else if(t>_||d&&t===_)continue}for(let s=0;s<p;s++){if(g.queryXY(s,h),o&&0!==(0,r.R)(e,h,0))return l(i,h,-1,Number.NaN),l(n,h,s,0),0;{const t=c.sqrDistance(h);if(this.m_bIsNearCalc){if(t>_)continue}else if(t>_)continue}const m=t.getClosestCoordinate(h,!1),a=t.getCoord2D(m);h.subThis(a);const p=h.sqrLength();if(this.m_bIsNearCalc){if(p<=_)return 0}else if(!(p>_)&&(!d||p<_)&&(_=p,l(i,g.getXY(s),s,0),l(n,a,u.getStartPointIndex(),m),d=!0,0===_))return 0}o=!1}return d?Math.sqrt(_):Number.POSITIVE_INFINITY}distanceEnvelopeGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:return this.distancePointEnvelope(e,t,n,i);case s.G.enumMultiPoint:{this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const s=this.distanceMultipointMultipath(e,P(t),n,i);return this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),s}case s.G.enumPolyline:case s.G.enumPolygon:return this.distanceMultipathMultipath(P(t),e,i,n);case s.G.enumEnvelope:return this.distanceEnvelopeEnvelope(t,e,i,n);default:return Number.NaN}}distanceEnvelopeEnvelope(t,e,i,n){i.t=Number.NaN,i.index=-1,n.t=Number.NaN,n.index=-1;const s=t.asEnvelope2D(),o=e.asEnvelope2D();return Math.sqrt(s.sqrDistanceEnvelope(o,i.outPoint,n.outPoint))}distanceMultipathGeometry(t,e,i,n){switch(e.getGeometryType()){case s.G.enumPoint:{this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const s=this.distancePointMultipath(e,t,n,i);return this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),s}case s.G.enumMultiPoint:{this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB);const s=this.distanceMultipointMultipath(e,t,n,i);return this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),s}case s.G.enumPolyline:case s.G.enumPolygon:return this.distanceMultipathMultipath(t,e,i,n);case s.G.enumEnvelope:return this.distanceMultipathMultipath(t,P(e),i,n);default:return Number.NaN}}distanceMultipathMultipath(t,e,i,s){const r={stack:[],error:void 0,hasError:!1};try{const u=[t],h=[e],l=this.swapGeometriesIfAGtB(u,h);l&&(this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB),p(i,s)),(0,n.mS)(r,(0,m.h)(()=>{p(i,s),this.m_env2DgeometryB=(0,m.c)(this.m_env2DgeometryA,this.m_env2DgeometryA=this.m_env2DgeometryB)},!l),!1);const x=u[0],P=h[0],D=x.querySegmentIterator();D.stripAttributes();const v=P.querySegmentIterator();if(v.stripAttributes(),this.m_bIsNearCalc&&this.m_env2DgeometryA.sqrMaxMinDistanceEnvelope(this.m_env2DgeometryB)<=this.m_maxSqrDistance)return 0;if(this.m_bIsNearCalc){const t=Math.trunc((0,m.s)(Math.sqrt(x.getPointCount())+1,1,(0,m.i)())),e=Math.trunc((0,m.s)(Math.sqrt(x.getPointCount())+1,1,(0,m.i)()));if(this.distanceMultipointMultipoint(x,P,i,s,t,e)<=this.m_maxSqrDistance)return 0}if(this.m_env2DgeometryA.isIntersecting(this.m_env2DgeometryB)){const t=c(),e=c();if(y(x,P,D,v,t,e))return _(i,t),_(s,e),0}const G=d(x),f=[],S=new o.S,M=new a.Envelope2D,b=new a.Envelope2D,E=new a.Envelope2D;let T=this.m_maxSqrDistance,I=!0,N=!1;for(let t=0,e=G.length;t<e;++t){x.querySegment(G[t],S,!0);const e=S.get();if(e.queryEnvelope(M),!(M.sqrDistanceEnvelope(this.m_env2DgeometryB,null,null)>T)){if(this.m_bIsNearCalc&&M.sqrMaxDistanceEnvelope(this.m_env2DgeometryB)<=T)return 0;for(;v.nextPath();){if(this.progress_(),I)P.queryPathEnvelope(v.getPathIndex(),E),f[v.getPathIndex()]=E.clone();else if(M.sqrDistanceEnvelope(f[v.getPathIndex()],null,null)>T)continue;for(;v.hasNextSegment();){const n=v.nextSegment();if(n.queryEnvelope(b),M.sqrDistanceEnvelope(b,null,null)<=T){const o=!M.isIntersecting(b),r=[0],m=[0];let a=e.distance(n,o,r,m);if(a*=a,this.m_bIsNearCalc&&a<=this.m_maxSqrDistance)return 0;if(a<T||a===T&&G[t]<i.index){if(N=!0,g(i,e,G[t],r[0]),g(s,n,v.getStartPointIndex(),m[0]),0===a)return 0;T=a}}}}v.resetToFirstPath(),I=!1}}return N?Math.sqrt(T):Number.POSITIVE_INFINITY}catch(t){r.error=t,r.hasError=!0}finally{(0,n.hk)(r)}}swapGeometriesIfAGtB(t,e){return(0,s.v)(t[0])>(0,s.v)(e[0])&&(e[0]=(0,m.c)(t[0],t[0]=e[0]),!0)}swapGeometriesIfBGtA(t,e){return this.swapGeometriesIfAGtB(e,t)}}},31088:(t,e,i)=>{i.r(e),i.d(e,{OperatorGeodeticDensifyByLength:()=>r,OperatorGeodeticDensifyCursor:()=>m});var n=i(76061),s=i(55537),o=i(39117);class r{getOperatorType(){return 10310}supportsCurves(){return!0}accelerateGeometry(t,e,i){return!1}canAccelerateGeometry(t){return!1}executeMany(t,e,i,n,s){return new m(t,i,n,e,-1,-1,s)}execute(t,e,i,o,r){const m=new n.S([t]),a=this.executeMany(m,e,i,o,r).next();return a||(0,s.d)("null output"),a}}class m extends n.G{constructor(t,e,i,n,o,r,m){super(),this.m_progressTracker=m,r>0&&(0,s.t)(""),4!==i&&o>0&&(0,s.t)(""),e||(0,s.a)(""),0===e.getCoordinateSystemType()&&(0,s.a)(""),n>0||o>0||(0,s.a)(""),this.m_index=-1,this.m_inputGeoms=t,this.m_spatialReference=e,this.m_curveType=i,this.m_maxLengthMeters=n,this.m_maxDeviationMeters=o,this.m_maxAngle=r}next(){{let t;for(;t=this.m_inputGeoms.next();)return(0,s.c)(t),this.m_index=this.m_inputGeoms.getGeometryID(),this.geodeticDensify(t);return null}}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodeticDensify(t){return(0,o.am)(t,this.m_spatialReference,this.m_curveType,this.m_maxLengthMeters,this.m_maxDeviationMeters,this.m_progressTracker)}}},76061:(t,e,i)=>{i.d(e,{G:()=>n,S:()=>s});class n{*[Symbol.iterator](){let t=this.next();for(;t;)yield t,t=this.next()}}class s extends n{constructor(t){super(),this.m_iGeom=-1,this.m_aGeoms=t?t.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const t=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,t}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1728],{71728:(e,t,a)=>{a.r(t),a.d(t,{default:()=>R});var i=a(31635),n=a(67996),o=a(7762),s=a(49186),r=a(53966),l=a(91869),h=a(92071),d=a(74887),c=a(36708),p=a(10107),u=(a(44208),a(87811),a(40608)),y=a(35666),g=a(5443),m=a(86738),f=a(82799),M=a(4146),w=a(90708),L=a(15375);const b={MULTIPLIER:"multiplier",ABSOLUTE:"absolute-value"};var C=a(80340),k=a(90323),T=a(85342),N=a(69860),D=a(30504),x=a(63074),v=a(16131),A=a(25036),E=a(10873),I=a(8460),_=a(62568);let S=class extends((0,v.q)((0,x.dM)((0,A.j)((0,h.P)(M.A))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(o.A.ofType(k.A)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new g.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(o.A.ofType(k.A)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new s.A("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles((0,c.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),c.OH))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let a=[],i=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new s.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(a=e.knowledgeGraph.dataModel.entityTypes??[],i=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,o)=>{const s=this._graphTypeLookup.get(o);if(!s)return r.A.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(o);"relationship"===s.type?t.has(o)||(t.add(o),i.push(s)):"entity"===s.type?t.has(o)||(t.add(o),a.push(s)):(r.A.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(o))}):(a=e.knowledgeGraph.dataModel.entityTypes??[],i=e.knowledgeGraph.dataModel.relationshipTypes??[]);const n=new C.P({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=a,this.memberRelationshipTypes=i,this.dataManager=n}load(e){const t=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,T.qN)(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(a=>{t.push(a.refreshCachedQueryEngine()),e.push(new Promise(e=>{a.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(a=>{(0,_.fetchKnowledgeGraph)(this.url).then(async i=>{i.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),i.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const o=this.linkChart?.linkChartProperties;if(6===o?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,this._originalInclusionList=await n.XW.fetchAndConvertSerializedLinkChart({entitiesUrl:o?.entitiesUrl,relationshipsUrl:o?.relationshipsUrl}),this._alignLayersDataModelAndInclusionDefinition(i.dataModel),this.initializationLinkChartConfig={layoutSettings:o?.layoutSettings??void 0,layoutMode:(0,D.k5)(o.layoutType)}),this._initializeLayerProperties({knowledgeGraph:i,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const e=N.A.getInstance();for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const i of a.members?.values()??[]){const a=e.readFromStoreById(`${t}__${i.id}`);a&&(0,l.tE)(this.dataManager.sublayerCaches,t,()=>new Map).set(i.id,a)}await t()}else{const a="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,a,!0).then(async()=>{(0,d.Te)(e),await t()}))}a(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):r.A.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await(0,D.aq)(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));i.length>0&&(this.membershipModified=!0),await this._handleNewRecords(i,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new s.A("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new s.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,l.tE)(this.sublayerIdsCache,e,()=>new Set);const a=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),a.geometryType?this.layers.push(a):this.tables.push(a),await(0,T.qN)(this,[e]),this._refreshNamedTypes(),a}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1,overrideMembershipCheck:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const t of e)(i||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id))&&n.push(t);if(t){const e=new Set,t=[];for(const t of n)if(this.dataManager.nodeConnectionsLookup.has(t.id))for(const a of this.dataManager.nodeConnectionsLookup.get(t.id))e.add(a);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const e of n)this.sublayerIdsCache.get(e.typeName)?.delete(e.id),this.dataManager.relationshipTypeNames.has(e.typeName)?this.relationshipLinkChartDiagramLookup.delete(e.id):this.entityLinkChartDiagramLookup.delete(e.id);const o=a?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:o}),n.length>0&&(this.membershipModified=!0);const s=[];return this.layers.forEach(e=>{s.push(e.refreshCachedQueryEngine())}),await Promise.all(s),this._refreshNamedTypes(),n}async expand(e,t){let a=[];try{const i=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);a=i.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(a,t),i.length>0&&(this.membershipModified=!0),(0,d.Te)(t?.signal)}catch(e){throw(0,d.zf)(e)&&a.length>0&&await this.removeRecords(a,{overrideMembershipCheck:!0}),e}return{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new o.A,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new o.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const a=(0,l.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a="coords"in i&&"lengths"in i?i:(0,w.Ux)(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}})})}async calculateLinkChartLayout(e="organic-standard",t){const a=[],i=[],n=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{a.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{i.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const o=new Map,h=new Map,c=new Map,p=new Map,u=new Uint8Array(a.length),y=new Float64Array(a.length),M=new Float64Array(a.length),b=new Float64Array(a.length),C=new Float64Array(a.length),k=new Uint32Array(i.length),T=new Uint32Array(i.length),N=new Float64Array(i.length),D=new Float64Array(i.length),x=[];let v=!1;const A=new g.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let E,_="organic-standard",S=0,R=0;const z=I.i6.apply;switch(_="geographic-organic-standard"===e?"organic-standard":e,_){case"organic-standard":E=I.pM.apply;break;case"organic-community":E=I.Tu.apply;break;case"hierarchical-bottom-to-top":E=I.$C.apply;break;case"radial-root-centric":E=I.vJ.apply;break;case"tree-left-to-right":E=I.Xq.apply;break;default:E=I.Wg.apply}let P=!1;a.forEach(({typeName:a,feature:i})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedNodeLocations?.has(i.attributes[L.dr])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)?u[S]=2:u[S]=0;const n=t.lockedNodeLocations.get(i.attributes[L.dr]);y[S]=n.x,M[S]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)){u[S]=2;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":y[S]=t?.x,M[S]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(y[S]=e.x,M[S]=e.y):u[S]=1;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(y[S]=e.x,M[S]=e.y):u[S]=1;break;default:u[S]=1}(null==y[S]||null==M[S]||Number.isNaN(y[S])||Number.isNaN(M[S]))&&(u[S]=1,y[S]=0,M[S]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!P&&t?.lockedNodeLocations?.has(i.attributes[L.dr])&&(P=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;b[S]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?i.attributes[s]:null;C[S]=r?new Date(r).getTime():NaN,y[S]=0,M[S]=0,u[S]=1}else u[S]=1,y[S]=0,M[S]=0;p.set(i.attributes[L.dr],S),x[S]={feature:i,typeName:a},S++}),P&&r.A.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let G=!1;const O=new Map;i.forEach(a=>{const i=a.feature.attributes[L.Cz],o=a.feature.attributes[L.KQ],s=p.get(i),r=p.get(o),l=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?a.feature.attributes[h]:null,c=l?.endField,u=c?a.feature.attributes[c]:null;if(void 0!==s&&void 0!==r){let t=i+"-"+o;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+u);const l=O.get(t),h=l?.has(a.typeName);h||(k[R]=s,T[R]=r,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(N[R]=d?new Date(d).getTime():NaN,D[R]=u?new Date(u).getTime():NaN),void 0===l?O.set(t,new Map([[a.typeName,R]])):l.set(a.typeName,R),R++),n.push(a)}else G=!0,this.relationshipLinkChartDiagramLookup.set(i,null)}),G&&r.A.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const F=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),Z=this._convertValidatedOrganicSettingsToCalculationSettings(F);await(0,I.Hh)();let B=1,U=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let a;({status:B,links:U,graphics:a}=z(()=>t?.signal?.aborted??!1,u,y,M,b,C,k.subarray(0,R),T.subarray(0,R),N.subarray(0,R),D.subarray(0,R),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===B&&(this.chronologicalAuxiliaryGraphics=a)}else({status:B,links:U}=E(()=>t?.signal?.aborted??!1,u,y,M,k.subarray(0,R),T.subarray(0,R),Z.computationBudgetTime,Z.idealEdgeLengthMultiplier,Z.repulsionRadiusMultiplier));if((0,d.Te)(t?.signal),1===B)throw new s.A("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===B)throw(0,d.NK)();for(let e=0;e<x.length;e++){if(M[e]>84.9999?M[e]=84.9999:M[e]<-84.9999&&(M[e]=-84.9999),y[e]>179.9999?y[e]=179.9999:y[e]<-179.9999&&(y[e]=-179.9999),x[e].feature.attributes[L.T1]=new m.A(y[e],M[e]),o.has(x[e].typeName)){const t=o.get(x[e].typeName);t?.set(x[e].feature.attributes[L.dr],x[e].feature)}else{const t=new Map;t.set(x[e].feature.attributes[L.dr],x[e].feature),o.set(x[e].typeName,t)}c.set(x[e].feature.attributes[L.dr],x[e].feature);const t=(0,w.Ux)(x[e].feature.attributes[L.T1]);this.entityLinkChartDiagramLookup.set(x[e].feature.attributes[L.dr],x[e].feature.attributes[L.T1]?t:null);const a=(0,l.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,x[e].typeName,()=>({useAllData:!1,members:new Map}));(0,l.tE)(a.members,x[e].feature.attributes[L.dr],()=>({id:x[e].feature.attributes[L.dr],linkChartLocation:void 0})).linkChartLocation=x[e].feature.attributes[L.T1];const{x:i,y:n}=x[e].feature.attributes[L.T1];if(v)A.xmin=Math.min(A.xmin,i),A.xmax=Math.max(A.xmax,i),A.ymin=Math.min(A.ymin,n),A.ymax=Math.max(A.ymax,n);else{const e=1e-7;A.xmin=i-e,A.xmax=i+e,A.ymin=n-e,A.ymax=n+e,v=!0}}if(this.linkChartExtent.xmin=A.xmin,this.linkChartExtent.xmax=A.xmax,this.linkChartExtent.ymin=A.ymin,this.linkChartExtent.ymax=A.ymax,!U)throw new s.A("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const j=new Map,Q=new Map,q=new Map,W=new Set;for(let a=0;a<n.length;a++){const i=[],o=n[a],s=o.feature.attributes[L.Cz],d=o.feature.attributes[L.KQ];let u=s+"-"+d;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(o.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?o.feature.attributes[a]:null,n=e?.endField;u+="-"+i+"-"+(n?o.feature.attributes[n]:null)}const y=O.get(u).get(o.typeName),g=0===y?0:U?.vertexEndIndex[y-1];if(!W.has(y)){if(W.add(y),2===U.types[y]){const e=[U.vertices[2*g],U.vertices[2*g+1]],t=[U.vertices[2*(g+1)],U.vertices[2*(g+1)+1]],a=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[a[0]-e[0],a[1]-e[1]],o=[a[0]+n[1],a[1]-n[0]],s=[a[0]-n[1],a[1]+n[0]];i.push(e),i.push(o),i.push(t),i.push(s),i.push(e)}else{if(0!==U.types[y]){r.A.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<U.vertexEndIndex[y];e++)i.push([U.vertices[2*e],U.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=x[p.get(s)]?.feature.attributes[L.T1],t=x[p.get(d)]?.feature.attributes[L.T1];i[0][0]===e.x&&i[0][1]===e.y||(i[0]=[e.x,e.y]),i[i.length-1][0]===t.x&&i[i.length-1][1]===t.y||(i[i.length-1]=[t.x,t.y])}for(let e=1;e<i.length-1;e++)i[e][1]>85.5?i[e][1]=85.5:i[e][1]<-85.5&&(i[e][1]=-85.5),i[e][0]>179.9999?i[e][0]=179.9999:i[e][0]<-179.9999&&(i[e][0]=-179.9999);j.has(u)?j.get(u).push(i):j.set(u,[i])}const m=j.get(u);Q.has(u)||(Q.set(u,new Map),q.set(u,new Map));const M=Q.get(u),b=q.get(u);M.has(o.typeName)||(M.set(o.typeName,m.shift()),b.set(o.typeName,0));const C=M.get(o.typeName);b.set(o.typeName,b.get(o.typeName)+1);const k=new f.A({paths:[C]});if(o.feature.attributes[L.T1]=k,h.has(o.typeName)){const e=h.get(o.typeName);e?.set(o.feature.attributes[L.dr],o.feature)}else{const e=new Map;e.set(o.feature.attributes[L.dr],o.feature),h.set(o.typeName,e)}c.set(o.feature.attributes[L.dr],o.feature);const T=(0,w.Ux)(o.feature.attributes[L.T1]);this.relationshipLinkChartDiagramLookup.set(o.feature.attributes[L.dr],o.feature.attributes[L.T1]?T:null);const N=(0,l.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,o.typeName,()=>({useAllData:!1,members:new Map}));(0,l.tE)(N.members,o.feature.attributes[L.dr],()=>({id:o.feature.attributes[L.dr],linkChartLocation:void 0})).linkChartLocation=T}for(const e of n)e.feature.attributes[L.M1]=q.get(e.feature.attributes[L.Cz]+"-"+e.feature.attributes[L.KQ])?.get(e.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:o,links:h,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(e=>{a.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||a?.members?.forEach(t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new m.A({x:i.x,y:i.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}a=await this.dataManager.getRelationshipsBetweenNodes(e,i,t),await this._handleNewRecords(a,t),(0,d.Te)(t)}catch(e){throw(0,d.zf)(e)&&this.removeRecords(a),e}return{records:a}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}a=await this.dataManager.getRelationshipsFromNodes(e,n,i,t),await this._handleNewRecords(a,t),a.length>0&&(this.membershipModified=!0),(0,d.Te)(t)}catch(e){throw(0,d.zf)(e)&&this.removeRecords(a),e}return{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const a=new Map;this.layers.forEach(e=>{a.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const a=new Set,i=[],n=this.layers.concat(this.tables);for(const t of e)this._graphTypeLookup.has(t.typeName)&&(!1===n.some(e=>e.objectType.name===t.typeName)&&(this.dataManager.sublayerCaches.set(t.typeName,new Map),a.add(t.typeName)),(0,l.tE)(this.sublayerIdsCache,t.typeName,()=>new Set).add(t.id),i.push(t));this.dataManager.addToLayer(i);for(const e of a){const t=this._graphTypeLookup.get(e);if(t){const a=this._createSublayer(t);"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),a.geometryType?this.layers.push(a):this.tables.push(a)}}await(0,T.qN)(this,Array.from(a),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const o={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:new Map};for(const[e,t]of this.entityLinkChartDiagramLookup.entries())t&&o.lockedNodeLocations.set(e,new m.A(t.coords[0],t.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,o)}_createSublayers(e,t,a){e.forEach(e=>{const i=this._createSublayer(e);a(i)&&t.push(i),this._updateSublayerCaches(e)})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const a=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);a&&(t.objectType=a,t.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const o=(0,w.Ux)(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[L.Cz]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[L.KQ]);if(t&&a){const i=(0,w.Ux)(new f.A({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[L.dr],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[L.dr],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),i=e=>a(e)&&e>=0,n={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return n;const{computationBudgetTime:o,autoRepulsionRadius:s,repulsionRadiusMultiplier:l,absoluteIdealEdgeLength:h,multiplicativeIdealEdgeLength:d,idealEdgeLengthType:c}=t;return(e=>a(e)&&e>=1)(o)?n.computationBudgetTime=o:o&&r.A.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n.autoRepulsionRadius=s,!s&&(e=>a(e)&&e>=1)(l)?n.repulsionRadiusMultiplier=l:s||(n.autoRepulsionRadius=!0,r.A.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&((e=>Object.values(b).includes(e))(c)?n.idealEdgeLengthType=c:void 0!==c&&r.A.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===c&&i(h)?n.absoluteIdealEdgeLength=h:"absolute-value"===c&&void 0!==h?r.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===c&&i(d)?n.multiplicativeIdealEdgeLength=d:"multiplier"===c&&void 0!==d&&r.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),n}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===b.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===b.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new k.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),a=new Set((e.entityTypes??[]).map(e=>e.name)),i=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const e of this.layers)!e.graphType&&t.has(e.graphTypeName)&&(e.graphType=a.has(e.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?a.has(e.graphTypeName):i.has(e.graphTypeName)));this.setAtOrigin("layers",e,(0,y.OL)(this.originIdOf("layers")))}else this.layers=new o.A;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],a=this.layers.map(e=>e.graphTypeName).concat(t);for(const t of a)e.has(t)||this._originalInclusionList.namedTypeDefinitions.set(t,{useAllData:!1,members:new Map});const i=[];for(const e of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(e)||(r.A.getLogger(this).warn(`A named type, ${e}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),i.push(e));for(const e of i)this._originalInclusionList.namedTypeDefinitions.delete(e)}}};(0,i.Cg)([(0,p.MZ)(E.OZ)],S.prototype,"url",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"dataPreloadedInLocalCache",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"initializationLinkChartConfig",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"membershipModified",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"dataManager",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"initializationInclusionModeDefinition",null),(0,i.Cg)([(0,p.MZ)()],S.prototype,"knowledgeGraph",void 0),(0,i.Cg)([(0,p.MZ)({type:o.A.ofType(k.A),json:{write:{ignoreOrigin:!0}}})],S.prototype,"layers",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],S.prototype,"linkChart",null),(0,i.Cg)([(0,p.MZ)()],S.prototype,"entityLinkChartDiagramLookup",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"relationshipLinkChartDiagramLookup",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"linkChartExtent",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"memberEntityTypes",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"memberRelationshipTypes",void 0),(0,i.Cg)([(0,p.MZ)({type:["LinkChartLayer"]})],S.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"sublayerIdsCache",void 0),(0,i.Cg)([(0,p.MZ)({type:o.A.ofType(k.A),json:{write:{ignoreOrigin:!0}}})],S.prototype,"tables",void 0),(0,i.Cg)([(0,p.MZ)({json:{read:!1}})],S.prototype,"type",void 0),(0,i.Cg)([(0,p.MZ)({json:{read:!1}})],S.prototype,"chronologicalAuxiliaryGraphics",void 0),S=(0,i.Cg)([(0,u.$)("esri.layers.LinkChartLayer")],S);const R=S}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1728],{71728:(e,t,a)=>{a.r(t),a.d(t,{default:()=>R});var i=a(31635),n=a(67996),o=a(7762),s=a(49186),r=a(53966),l=a(91869),h=a(92071),d=a(74887),c=a(36708),p=a(10107),u=(a(44208),a(87811),a(40608)),y=a(35666),g=a(5443),m=a(86738),f=a(82799),M=a(4146),w=a(90708),L=a(15375);const b={MULTIPLIER:"multiplier",ABSOLUTE:"absolute-value"};var C=a(80340),k=a(62796),T=a(85342),N=a(69860),D=a(30504),x=a(63074),v=a(16131),A=a(25036),E=a(10873),I=a(8460),_=a(62568);let S=class extends((0,v.q)((0,x.dM)((0,A.j)((0,h.P)(M.A))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(o.A.ofType(k.A)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new g.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(o.A.ofType(k.A)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new s.A("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles((0,c.wB)(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),c.OH))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let a=[],i=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new s.A("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(a=e.knowledgeGraph.dataModel.entityTypes??[],i=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,o)=>{const s=this._graphTypeLookup.get(o);if(!s)return r.A.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(o);"relationship"===s.type?t.has(o)||(t.add(o),i.push(s)):"entity"===s.type?t.has(o)||(t.add(o),a.push(s)):(r.A.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(o))}):(a=e.knowledgeGraph.dataModel.entityTypes??[],i=e.knowledgeGraph.dataModel.relationshipTypes??[]);const n=new C.P({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=a,this.memberRelationshipTypes=i,this.dataManager=n}load(e){const t=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await(0,T.qN)(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(a=>{t.push(a.refreshCachedQueryEngine()),e.push(new Promise(e=>{a.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(a=>{(0,_.fetchKnowledgeGraph)(this.url).then(async i=>{i.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),i.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const o=this.linkChart?.linkChartProperties;if(6===o?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,this._originalInclusionList=await n.XW.fetchAndConvertSerializedLinkChart({entitiesUrl:o?.entitiesUrl,relationshipsUrl:o?.relationshipsUrl}),this._alignLayersDataModelAndInclusionDefinition(i.dataModel),this.initializationLinkChartConfig={layoutSettings:o?.layoutSettings??void 0,layoutMode:(0,D.k5)(o.layoutType)}),this._initializeLayerProperties({knowledgeGraph:i,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const e=N.A.getInstance();for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const i of a.members?.values()??[]){const a=e.readFromStoreById(`${t}__${i.id}`);a&&(0,l.tE)(this.dataManager.sublayerCaches,t,()=>new Map).set(i.id,a)}await t()}else{const a="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,a,!0).then(async()=>{(0,d.Te)(e),await t()}))}a(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):r.A.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await(0,D.aq)(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));i.length>0&&(this.membershipModified=!0),await this._handleNewRecords(i,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new s.A("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new s.A("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),(0,l.tE)(this.sublayerIdsCache,e,()=>new Set);const a=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),a.geometryType?this.layers.push(a):this.tables.push(a),await(0,T.qN)(this,[e]),this._refreshNamedTypes(),a}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1,overrideMembershipCheck:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const t of e)(i||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id))&&n.push(t);if(t){const e=new Set,t=[];for(const t of n)if(this.dataManager.nodeConnectionsLookup.has(t.id))for(const a of this.dataManager.nodeConnectionsLookup.get(t.id))e.add(a);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const e of n)this.sublayerIdsCache.get(e.typeName)?.delete(e.id),this.dataManager.relationshipTypeNames.has(e.typeName)?this.relationshipLinkChartDiagramLookup.delete(e.id):this.entityLinkChartDiagramLookup.delete(e.id);const o=a?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:o}),n.length>0&&(this.membershipModified=!0);const s=[];return this.layers.forEach(e=>{s.push(e.refreshCachedQueryEngine())}),await Promise.all(s),this._refreshNamedTypes(),n}async expand(e,t){let a=[];try{const i=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);a=i.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(a,t),i.length>0&&(this.membershipModified=!0),(0,d.Te)(t?.signal)}catch(e){throw(0,d.zf)(e)&&a.length>0&&await this.removeRecords(a,{overrideMembershipCheck:!0}),e}return{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new o.A,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new o.A,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const a=(0,l.tE)(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a="coords"in i&&"lengths"in i?i:(0,w.Ux)(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}})})}async calculateLinkChartLayout(e="organic-standard",t){const a=[],i=[],n=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{a.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{i.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const o=new Map,h=new Map,c=new Map,p=new Map,u=new Uint8Array(a.length),y=new Float64Array(a.length),M=new Float64Array(a.length),b=new Float64Array(a.length),C=new Float64Array(a.length),k=new Uint32Array(i.length),T=new Uint32Array(i.length),N=new Float64Array(i.length),D=new Float64Array(i.length),x=[];let v=!1;const A=new g.A({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let E,_="organic-standard",S=0,R=0;const z=I.i6.apply;switch(_="geographic-organic-standard"===e?"organic-standard":e,_){case"organic-standard":E=I.pM.apply;break;case"organic-community":E=I.Tu.apply;break;case"hierarchical-bottom-to-top":E=I.$C.apply;break;case"radial-root-centric":E=I.vJ.apply;break;case"tree-left-to-right":E=I.Xq.apply;break;default:E=I.Wg.apply}let P=!1;a.forEach(({typeName:a,feature:i})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedNodeLocations?.has(i.attributes[L.dr])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)?u[S]=2:u[S]=0;const n=t.lockedNodeLocations.get(i.attributes[L.dr]);y[S]=n.x,M[S]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)){u[S]=2;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":y[S]=t?.x,M[S]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(y[S]=e.x,M[S]=e.y):u[S]=1;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(y[S]=e.x,M[S]=e.y):u[S]=1;break;default:u[S]=1}(null==y[S]||null==M[S]||Number.isNaN(y[S])||Number.isNaN(M[S]))&&(u[S]=1,y[S]=0,M[S]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!P&&t?.lockedNodeLocations?.has(i.attributes[L.dr])&&(P=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;b[S]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?i.attributes[s]:null;C[S]=r?new Date(r).getTime():NaN,y[S]=0,M[S]=0,u[S]=1}else u[S]=1,y[S]=0,M[S]=0;p.set(i.attributes[L.dr],S),x[S]={feature:i,typeName:a},S++}),P&&r.A.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let G=!1;const O=new Map;i.forEach(a=>{const i=a.feature.attributes[L.Cz],o=a.feature.attributes[L.KQ],s=p.get(i),r=p.get(o),l=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?a.feature.attributes[h]:null,c=l?.endField,u=c?a.feature.attributes[c]:null;if(void 0!==s&&void 0!==r){let t=i+"-"+o;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+u);const l=O.get(t),h=l?.has(a.typeName);h||(k[R]=s,T[R]=r,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(N[R]=d?new Date(d).getTime():NaN,D[R]=u?new Date(u).getTime():NaN),void 0===l?O.set(t,new Map([[a.typeName,R]])):l.set(a.typeName,R),R++),n.push(a)}else G=!0,this.relationshipLinkChartDiagramLookup.set(i,null)}),G&&r.A.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const F=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),Z=this._convertValidatedOrganicSettingsToCalculationSettings(F);await(0,I.Hh)();let B=1,U=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let a;({status:B,links:U,graphics:a}=z(()=>t?.signal?.aborted??!1,u,y,M,b,C,k.subarray(0,R),T.subarray(0,R),N.subarray(0,R),D.subarray(0,R),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===B&&(this.chronologicalAuxiliaryGraphics=a)}else({status:B,links:U}=E(()=>t?.signal?.aborted??!1,u,y,M,k.subarray(0,R),T.subarray(0,R),Z.computationBudgetTime,Z.idealEdgeLengthMultiplier,Z.repulsionRadiusMultiplier));if((0,d.Te)(t?.signal),1===B)throw new s.A("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===B)throw(0,d.NK)();for(let e=0;e<x.length;e++){if(M[e]>84.9999?M[e]=84.9999:M[e]<-84.9999&&(M[e]=-84.9999),y[e]>179.9999?y[e]=179.9999:y[e]<-179.9999&&(y[e]=-179.9999),x[e].feature.attributes[L.T1]=new m.A(y[e],M[e]),o.has(x[e].typeName)){const t=o.get(x[e].typeName);t?.set(x[e].feature.attributes[L.dr],x[e].feature)}else{const t=new Map;t.set(x[e].feature.attributes[L.dr],x[e].feature),o.set(x[e].typeName,t)}c.set(x[e].feature.attributes[L.dr],x[e].feature);const t=(0,w.Ux)(x[e].feature.attributes[L.T1]);this.entityLinkChartDiagramLookup.set(x[e].feature.attributes[L.dr],x[e].feature.attributes[L.T1]?t:null);const a=(0,l.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,x[e].typeName,()=>({useAllData:!1,members:new Map}));(0,l.tE)(a.members,x[e].feature.attributes[L.dr],()=>({id:x[e].feature.attributes[L.dr],linkChartLocation:void 0})).linkChartLocation=x[e].feature.attributes[L.T1];const{x:i,y:n}=x[e].feature.attributes[L.T1];if(v)A.xmin=Math.min(A.xmin,i),A.xmax=Math.max(A.xmax,i),A.ymin=Math.min(A.ymin,n),A.ymax=Math.max(A.ymax,n);else{const e=1e-7;A.xmin=i-e,A.xmax=i+e,A.ymin=n-e,A.ymax=n+e,v=!0}}if(this.linkChartExtent.xmin=A.xmin,this.linkChartExtent.xmax=A.xmax,this.linkChartExtent.ymin=A.ymin,this.linkChartExtent.ymax=A.ymax,!U)throw new s.A("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const j=new Map,Q=new Map,q=new Map,W=new Set;for(let a=0;a<n.length;a++){const i=[],o=n[a],s=o.feature.attributes[L.Cz],d=o.feature.attributes[L.KQ];let u=s+"-"+d;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(o.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?o.feature.attributes[a]:null,n=e?.endField;u+="-"+i+"-"+(n?o.feature.attributes[n]:null)}const y=O.get(u).get(o.typeName),g=0===y?0:U?.vertexEndIndex[y-1];if(!W.has(y)){if(W.add(y),2===U.types[y]){const e=[U.vertices[2*g],U.vertices[2*g+1]],t=[U.vertices[2*(g+1)],U.vertices[2*(g+1)+1]],a=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[a[0]-e[0],a[1]-e[1]],o=[a[0]+n[1],a[1]-n[0]],s=[a[0]-n[1],a[1]+n[0]];i.push(e),i.push(o),i.push(t),i.push(s),i.push(e)}else{if(0!==U.types[y]){r.A.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<U.vertexEndIndex[y];e++)i.push([U.vertices[2*e],U.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=x[p.get(s)]?.feature.attributes[L.T1],t=x[p.get(d)]?.feature.attributes[L.T1];i[0][0]===e.x&&i[0][1]===e.y||(i[0]=[e.x,e.y]),i[i.length-1][0]===t.x&&i[i.length-1][1]===t.y||(i[i.length-1]=[t.x,t.y])}for(let e=1;e<i.length-1;e++)i[e][1]>85.5?i[e][1]=85.5:i[e][1]<-85.5&&(i[e][1]=-85.5),i[e][0]>179.9999?i[e][0]=179.9999:i[e][0]<-179.9999&&(i[e][0]=-179.9999);j.has(u)?j.get(u).push(i):j.set(u,[i])}const m=j.get(u);Q.has(u)||(Q.set(u,new Map),q.set(u,new Map));const M=Q.get(u),b=q.get(u);M.has(o.typeName)||(M.set(o.typeName,m.shift()),b.set(o.typeName,0));const C=M.get(o.typeName);b.set(o.typeName,b.get(o.typeName)+1);const k=new f.A({paths:[C]});if(o.feature.attributes[L.T1]=k,h.has(o.typeName)){const e=h.get(o.typeName);e?.set(o.feature.attributes[L.dr],o.feature)}else{const e=new Map;e.set(o.feature.attributes[L.dr],o.feature),h.set(o.typeName,e)}c.set(o.feature.attributes[L.dr],o.feature);const T=(0,w.Ux)(o.feature.attributes[L.T1]);this.relationshipLinkChartDiagramLookup.set(o.feature.attributes[L.dr],o.feature.attributes[L.T1]?T:null);const N=(0,l.tE)(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,o.typeName,()=>({useAllData:!1,members:new Map}));(0,l.tE)(N.members,o.feature.attributes[L.dr],()=>({id:o.feature.attributes[L.dr],linkChartLocation:void 0})).linkChartLocation=T}for(const e of n)e.feature.attributes[L.M1]=q.get(e.feature.attributes[L.Cz]+"-"+e.feature.attributes[L.KQ])?.get(e.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:o,links:h,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(e=>{a.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||a?.members?.forEach(t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new m.A({x:i.x,y:i.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}a=await this.dataManager.getRelationshipsBetweenNodes(e,i,t),await this._handleNewRecords(a,t),(0,d.Te)(t)}catch(e){throw(0,d.zf)(e)&&this.removeRecords(a),e}return{records:a}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}a=await this.dataManager.getRelationshipsFromNodes(e,n,i,t),await this._handleNewRecords(a,t),a.length>0&&(this.membershipModified=!0),(0,d.Te)(t)}catch(e){throw(0,d.zf)(e)&&this.removeRecords(a),e}return{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const a=new Map;this.layers.forEach(e=>{a.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const a=new Set,i=[],n=this.layers.concat(this.tables);for(const t of e)this._graphTypeLookup.has(t.typeName)&&(!1===n.some(e=>e.objectType.name===t.typeName)&&(this.dataManager.sublayerCaches.set(t.typeName,new Map),a.add(t.typeName)),(0,l.tE)(this.sublayerIdsCache,t.typeName,()=>new Set).add(t.id),i.push(t));this.dataManager.addToLayer(i);for(const e of a){const t=this._graphTypeLookup.get(e);if(t){const a=this._createSublayer(t);"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),a.geometryType?this.layers.push(a):this.tables.push(a)}}await(0,T.qN)(this,Array.from(a),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const o={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:new Map};for(const[e,t]of this.entityLinkChartDiagramLookup.entries())t&&o.lockedNodeLocations.set(e,new m.A(t.coords[0],t.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,o)}_createSublayers(e,t,a){e.forEach(e=>{const i=this._createSublayer(e);a(i)&&t.push(i),this._updateSublayerCaches(e)})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const a=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);a&&(t.objectType=a,t.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const o=(0,w.Ux)(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[L.Cz]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[L.KQ]);if(t&&a){const i=(0,w.Ux)(new f.A({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[L.dr],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[L.dr],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),i=e=>a(e)&&e>=0,n={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return n;const{computationBudgetTime:o,autoRepulsionRadius:s,repulsionRadiusMultiplier:l,absoluteIdealEdgeLength:h,multiplicativeIdealEdgeLength:d,idealEdgeLengthType:c}=t;return(e=>a(e)&&e>=1)(o)?n.computationBudgetTime=o:o&&r.A.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),n.autoRepulsionRadius=s,!s&&(e=>a(e)&&e>=1)(l)?n.repulsionRadiusMultiplier=l:s||(n.autoRepulsionRadius=!0,r.A.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&((e=>Object.values(b).includes(e))(c)?n.idealEdgeLengthType=c:void 0!==c&&r.A.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===c&&i(h)?n.absoluteIdealEdgeLength=h:"absolute-value"===c&&void 0!==h?r.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===c&&i(d)?n.multiplicativeIdealEdgeLength=d:"multiplier"===c&&void 0!==d&&r.A.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),n}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===b.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===b.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new k.A({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),a=new Set((e.entityTypes??[]).map(e=>e.name)),i=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const e of this.layers)!e.graphType&&t.has(e.graphTypeName)&&(e.graphType=a.has(e.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?a.has(e.graphTypeName):i.has(e.graphTypeName)));this.setAtOrigin("layers",e,(0,y.OL)(this.originIdOf("layers")))}else this.layers=new o.A;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],a=this.layers.map(e=>e.graphTypeName).concat(t);for(const t of a)e.has(t)||this._originalInclusionList.namedTypeDefinitions.set(t,{useAllData:!1,members:new Map});const i=[];for(const e of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(e)||(r.A.getLogger(this).warn(`A named type, ${e}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),i.push(e));for(const e of i)this._originalInclusionList.namedTypeDefinitions.delete(e)}}};(0,i.Cg)([(0,p.MZ)(E.OZ)],S.prototype,"url",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"dataPreloadedInLocalCache",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"initializationLinkChartConfig",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"membershipModified",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"dataManager",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"initializationInclusionModeDefinition",null),(0,i.Cg)([(0,p.MZ)()],S.prototype,"knowledgeGraph",void 0),(0,i.Cg)([(0,p.MZ)({type:o.A.ofType(k.A),json:{write:{ignoreOrigin:!0}}})],S.prototype,"layers",void 0),(0,i.Cg)([(0,p.MZ)({readOnly:!0})],S.prototype,"linkChart",null),(0,i.Cg)([(0,p.MZ)()],S.prototype,"entityLinkChartDiagramLookup",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"relationshipLinkChartDiagramLookup",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"linkChartExtent",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"memberEntityTypes",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"memberRelationshipTypes",void 0),(0,i.Cg)([(0,p.MZ)({type:["LinkChartLayer"]})],S.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,p.MZ)()],S.prototype,"sublayerIdsCache",void 0),(0,i.Cg)([(0,p.MZ)({type:o.A.ofType(k.A),json:{write:{ignoreOrigin:!0}}})],S.prototype,"tables",void 0),(0,i.Cg)([(0,p.MZ)({json:{read:!1}})],S.prototype,"type",void 0),(0,i.Cg)([(0,p.MZ)({json:{read:!1}})],S.prototype,"chronologicalAuxiliaryGraphics",void 0),S=(0,i.Cg)([(0,u.$)("esri.layers.LinkChartLayer")],S);const R=S}}]);
@@ -254,7 +254,7 @@ return dpDummy * hiD + loD;
254
254
  float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
255
255
  vec4 emission = ${ne?"vec4(0.0)":"getEmissions(albedo)"};
256
256
  ${(0,D.If)(Z,"mrr = applySnowToMRR(mrr, snow);\n emission = snowCoverForEmissions(emission, snow);")}
257
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
257
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:D.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
258
258
  vec4 finalColor = vec4(shadedColor, opacity_);
259
259
  outputColorHighlightOID(finalColor, vpos, albedo ${(0,D.If)(Z,", snow")});
260
260
  `),t}const V=Object.freeze(Object.defineProperty({__proto__:null,build:U},Symbol.toStringTag,{value:"Module"}))},29920:(e,t,r)=>{r.d(t,{j:()=>s});var i=r(15142),n=r(38954),o=r(51850),a=r(620);class s{get center(){return(0,o.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,o.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,o.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,a.vA)(e.length>=1),(0,a.vA)(3===r.size||4===r.size);const{data:i,size:s,indices:c}=r;(0,a.vA)(c.length%this._numIndexPerPrimitive===0),(0,a.vA)(c.length>=e.length*this._numIndexPerPrimitive);const d=e.length;let u=s*c[this._numIndexPerPrimitive*e[0]];l.clear(),l.push(u);const h=(0,o.fA)(i[u],i[u+1],i[u+2]),p=(0,o.o8)(h);for(let t=0;t<d;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){u=s*c[r+e],l.push(u);let t=i[u];h[0]=Math.min(t,h[0]),p[0]=Math.max(t,p[0]),t=i[u+1],h[1]=Math.min(t,h[1]),p[1]=Math.max(t,p[1]),t=i[u+2],h[2]=Math.min(t,h[2]),p[2]=Math.max(t,p[2])}}for(let e=0;e<3;++e)this._data[4+e]=h[e],this._data[7+e]=p[e];const m=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5);let f=.5*Math.max(Math.max(p[0]-h[0],p[1]-h[1]),p[2]-h[2]),g=f*f;for(let e=0;e<l.length;++e){u=l.at(e);const t=i[u]-m[0],r=i[u+1]-m[1],n=i[u+2]-m[2],o=t*t+r*r+n*n;if(o<=g)continue;const a=Math.sqrt(o),s=.5*(a-f);f+=s,g=f*f;const c=s/a;m[0]+=t*c,m[1]+=r*c,m[2]+=n*c}this._data[3]=f;for(let e=0;e<3;++e)this._data[0+e]=m[e];l.clear()}getChildren(){if(this._children||(0,n.s)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,n.m)((0,o.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:a,size:l,indices:c}=this.position;for(let n=0;n<t;++n){let t=0;const o=this._numIndexPerPrimitive*this.primitiveIndices[n];let s=l*c[o],d=a[s],u=a[s+1],h=a[s+2];for(let e=1;e<this._numIndexPerPrimitive;++e){s=l*c[o+e];const t=a[s],r=a[s+1],i=a[s+2];t<d&&(d=t),r<u&&(u=r),i<h&&(h=i)}d<e[0]&&(t|=1),u<e[1]&&(t|=2),h<e[2]&&(t|=4),r[n]=t,++i[t]}let d=0;for(let e=0;e<8;++e)i[e]>0&&++d;if(d<2)return;const u=new Array(8);for(let e=0;e<8;++e)u[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];u[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==u[e]&&this._children.push(new s(u[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){l.prune()}}const l=new i.A({deallocator:null})},32482:(e,t,r)=>{r.d(t,{Bz:()=>b,G:()=>x}),r(51850);var i=r(46686),n=r(49255),o=r(31821);function a(e,t){const r=(0,n.RN)(t.output)&&t.receiveShadows;r&&(0,i.o)(e,!0),e.vertex.code.add(o.H`
@@ -592,7 +592,7 @@ return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScal
592
592
  ${k?R.H`float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2];
593
593
  ${(0,R.If)(V,R.H`mrr = applySnowToMRR(mrr, 1.0)`)}
594
594
  vec4 emission = ${V||W?"vec4(0.0)":"getEmissions(albedo)"};
595
- vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:R.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
595
+ vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, additionalAmbientIrradiance);`:R.H`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`}
596
596
  vec4 finalColor = vec4(shadedColor, opacity_);
597
597
  outputColorHighlightOID(finalColor, vpos, albedo ${(0,R.If)(V,", 1.0")});`),t}const L=Object.freeze(Object.defineProperty({__proto__:null,build:H},Symbol.toStringTag,{value:"Module"}))},57917:(e,t,r)=>{r.d(t,{S:()=>o});var i=r(34275),n=r(20498);function o(e){if(e.length<i.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,i.LW)(e)?(0,n.pX)().from(e):(0,i.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}},58614:(e,t,r)=>{r.d(t,{S:()=>a}),r(28421);var i=r(20304),n=r(31821),o=r(49788);function a(e,t){!function(e,t,r){const i=e.fragment,a=t.alphaDiscardMode,s=0===a;2!==a&&3!==a||i.uniforms.add(r),i.code.add(n.H`
598
598
  void discardOrAdjustAlpha(inout vec4 color) {
@@ -858,8 +858,7 @@ return pow(outColor, vec3(INV_GAMMA_SRGB));
858
858
  const float horizonLightDiffusion = 0.4;
859
859
  const float additionalAmbientIrradianceFactor = 0.02;
860
860
  vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight,
861
- vec3 viewDir, vec3 groundNormal, vec3 mrr, vec4 _emission,
862
- float additionalAmbientIrradiance) {
861
+ vec3 viewDir, vec3 groundNormal, vec3 mrr, float additionalAmbientIrradiance) {
863
862
  vec3 viewDirection = -viewDir;
864
863
  vec3 h = normalize(viewDirection + mainLightDirection);
865
864
  PBRShadingInfo inputs;
@@ -893,8 +892,7 @@ inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianc
893
892
  inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE);`),r.code.add(d.H`
894
893
  vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
895
894
  vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
896
- vec3 emissionComponent = _emission.rgb == vec3(0.0) ? _emission.rgb : tonemapACES(pow(_emission.rgb, vec3(GAMMA_SRGB)));
897
- vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
895
+ vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent;
898
896
  ${s?d.H`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`:d.H`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`}
899
897
  return outColor;
900
898
  }