@arcgis/core 4.34.0-next.57 → 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 (462) 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/03fe4164abd12abc7921.js +1 -0
  8. package/assets/esri/core/workers/chunks/{893e5eb5c028c4704317.js → 0427f66b56ec6601deb0.js} +1 -1
  9. package/assets/esri/core/workers/chunks/06b65105b15abf4d0fbf.js +1 -0
  10. package/assets/esri/core/workers/chunks/{02902303e5585a16ebea.js → 0b53bc76d38e85902748.js} +1 -1
  11. package/assets/esri/core/workers/chunks/0cb2f7172190babb4139.js +1 -0
  12. package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +1 -0
  13. package/assets/esri/core/workers/chunks/{1776ef96c9f4636f8838.js → 138c11b5eca621e51396.js} +1 -1
  14. package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +1 -0
  15. package/assets/esri/core/workers/chunks/1612d1c1d78c122dfef6.js +1 -0
  16. package/assets/esri/core/workers/chunks/17abab49db1813d3e192.js +1 -0
  17. package/assets/esri/core/workers/chunks/182383fd00008606bfaa.js +1 -0
  18. package/assets/esri/core/workers/chunks/18f878ec695617650a96.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d578c3880eaf2dd62324.js → 19e5e011f929b6b940fe.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{57c438bb0da6410df525.js → 1bf17c6548ac4cd5a166.js} +1 -1
  21. package/assets/esri/core/workers/chunks/1c61cf137a989bc52bb8.js +1 -0
  22. package/assets/esri/core/workers/chunks/{043bb97e38e3a54aa2ab.js → 1ed7a8f4a0058d3b69ef.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{dd2b5f115d156b5b212e.js → 22ec2b0a853911692dc8.js} +1 -1
  24. package/assets/esri/core/workers/chunks/232c76f122b1f519e099.js +1 -0
  25. package/assets/esri/core/workers/chunks/{827bebb4bcdde23adc91.js → 251b7f2e295ce191eb62.js} +1 -1
  26. package/assets/esri/core/workers/chunks/27334cda1b877abcba1b.js +1 -0
  27. package/assets/esri/core/workers/chunks/{02a31483e09652a1a1a2.js → 2b7f9a57a2cfbc108673.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{9fef330b241f958b55df.js → 2cd27b06226e30aec5da.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{7c86af4f60cea383ed96.js → 39a1f361bb69073af765.js} +1 -1
  30. package/assets/esri/core/workers/chunks/3a7ac10a6614fe5745f7.js +1 -0
  31. package/assets/esri/core/workers/chunks/{70cf81ec5a901782d2db.js → 3e7c9a43e52ed6a1b018.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{8257352421f453a669e9.js → 3f634580055b30dbfc8e.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{0e8d3d38e9b1f6abf6f2.js → 3fd09a7c05583a57a317.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{52917b753c5ceab0c1f7.js → 4050ddb580d364d9e205.js} +7 -7
  35. package/assets/esri/core/workers/chunks/{8c79945909069733558f.js → 4094cebc4b92c52f4e27.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{82de1b50ae286f1e6c44.js → 451761c7bd2da530e1d0.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{cc748d4f4adb9c584aa4.js → 45aeff2f751f124f8e53.js} +1 -1
  38. package/assets/esri/core/workers/chunks/462b30fc40a5f337ba10.js +1 -0
  39. package/assets/esri/core/workers/chunks/{d20af70b23f175fb5442.js → 48b9ba825856a0c843ff.js} +1 -1
  40. package/assets/esri/core/workers/chunks/497214e9e82b936fc94e.js +1 -0
  41. package/assets/esri/core/workers/chunks/4ac127cefa3aa5e93e78.js +1 -0
  42. package/assets/esri/core/workers/chunks/4b1daffa97fd90a554a0.js +1 -0
  43. package/assets/esri/core/workers/chunks/4d7fcec769369c576847.js +1 -0
  44. package/assets/esri/core/workers/chunks/4dee2f05508e90410f13.js +1 -0
  45. package/assets/esri/core/workers/chunks/516864fb68025acc7db6.js +1 -0
  46. package/assets/esri/core/workers/chunks/{d630fc3acd2552c98dc0.js → 547af4ffbeeccba9d187.js} +1 -1
  47. package/assets/esri/core/workers/chunks/54b43876ae6fb078eb38.js +1 -0
  48. package/assets/esri/core/workers/chunks/{cf699b9bb530b87be14c.js → 58422c616a824ab49218.js} +1 -1
  49. package/assets/esri/core/workers/chunks/589a0e244ef5f1b84ab6.js +1 -0
  50. package/assets/esri/core/workers/chunks/5b7e5ec6aea1f7f9b005.js +1 -0
  51. package/assets/esri/core/workers/chunks/{fe55833c80cf59df9c2b.js → 5cb238318a24b70d5ac3.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{2c7e7895c4dda176220e.js → 5d4b24c864ebb68ae61e.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{88a5e7415f8858c454f7.js → 5de7c2a80bd9c81cefe2.js} +1 -1
  54. package/assets/esri/core/workers/chunks/5e1afea05b624b315d9f.js +1 -0
  55. package/assets/esri/core/workers/chunks/5ed7e139c72cd2b3ddba.js +1 -0
  56. package/assets/esri/core/workers/chunks/6531f33d6710960079e9.js +1 -0
  57. package/assets/esri/core/workers/chunks/{a1ff4c252012d5026133.js → 65eb183b5d001dfc42c8.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{f1b6d6ee03635d985c3e.js → 6688efc71d9d8f4d2559.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{d5faf3ddf9a39de826be.js → 672c04d48aa51f16e9b7.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{1cbd59918c60a1a21494.js → 700b5a536f97233bc4af.js} +1 -1
  61. package/assets/esri/core/workers/chunks/7597ef10d1699e7088e5.js +1 -0
  62. package/assets/esri/core/workers/chunks/781e424a383c71ca904d.js +1 -0
  63. package/assets/esri/core/workers/chunks/79933271a76a1756584f.js +1 -0
  64. package/assets/esri/core/workers/chunks/{17e203e4680c07bd02f1.js → 7aa7aff6d42be7c2d1d2.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{c2f184e9f579152aa29a.js → 7b17f52019762aa21af8.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{549e073fe276363a9896.js → 7db105f6b688b6da8106.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{945c5a477940ebd23a4c.js → 7f0c78bcba0aed3c4eff.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{a249e56a0be8cef33ba8.js → 81eb7785d626aa975033.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{3eb792863a789b97ec58.js → 831a69e5a87e92830fbe.js} +1 -1
  70. package/assets/esri/core/workers/chunks/8374d87176486c1fc90e.js +1 -0
  71. package/assets/esri/core/workers/chunks/83dfaa6e3bd58d544f35.js +1 -0
  72. package/assets/esri/core/workers/chunks/{5691d504ffe5592bc40f.js → 897f9775f06ddbf6486f.js} +1 -1
  73. package/assets/esri/core/workers/chunks/8bbae8ac586e5c0819d2.js +1 -0
  74. package/assets/esri/core/workers/chunks/8c0e11f781607239749d.js +1 -0
  75. package/assets/esri/core/workers/chunks/90540fdfb0c5f68aa959.js +1 -0
  76. package/assets/esri/core/workers/chunks/9280edff80fd87860a5e.js +1 -0
  77. package/assets/esri/core/workers/chunks/{9275313e0f1f521b2658.js → 9325000c87295c473291.js} +1 -1
  78. package/assets/esri/core/workers/chunks/94b9948ec628187c19fc.js +1 -0
  79. package/assets/esri/core/workers/chunks/94f1005222bff1870ef1.js +1 -0
  80. package/assets/esri/core/workers/chunks/{aab349d4624b78ef429f.js → 96102a9296afd1bfe1a9.js} +1 -1
  81. package/assets/esri/core/workers/chunks/981275b6f008431c983a.js +1 -0
  82. package/assets/esri/core/workers/chunks/{4d2473e680324dc17cfa.js → 997a2a1a51039ce7e4e3.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{07d5e0633cc2f765037f.js → 9f4e23bae621ff3ecea3.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{4e2b125e6e3945985a54.js → 9f93513037a6e87433c4.js} +1 -1
  85. package/assets/esri/core/workers/chunks/a16b471c3706ee37f9b6.js +1 -0
  86. package/assets/esri/core/workers/chunks/{989251f5e0d6a08b1afa.js → a17ed7ce97e69466d730.js} +1 -1
  87. package/assets/esri/core/workers/chunks/a2150baf0661e2f28011.js +1 -0
  88. package/assets/esri/core/workers/chunks/a244afea77127e54dd3a.js +1 -0
  89. package/assets/esri/core/workers/chunks/{ab3c018c406dcd81ef9e.js → a2f4b6d8da93f106852c.js} +1 -1
  90. package/assets/esri/core/workers/chunks/a532614aa65fb52dee7b.js +1 -0
  91. package/assets/esri/core/workers/chunks/{3b51b61a7b8a1ef87c9b.js → a700f57af6856cb5313c.js} +1 -1
  92. package/assets/esri/core/workers/chunks/{319fe6a02ec630a827ea.js → a7ea2e3895046e566bc6.js} +1 -1
  93. package/assets/esri/core/workers/chunks/abe60d92e0219ee97036.js +1 -0
  94. package/assets/esri/core/workers/chunks/{a7530dcb08b43e37bbb2.js → ae1cb4c65d72217ae4d4.js} +1 -1
  95. package/assets/esri/core/workers/chunks/af5ae7c36e1178077cbc.js +1 -0
  96. package/assets/esri/core/workers/chunks/{7f80bbbd0897082c1af3.js → b29144ee58b43f769d9a.js} +1 -1
  97. package/assets/esri/core/workers/chunks/b30de4936caa654d7817.js +1 -0
  98. package/assets/esri/core/workers/chunks/{4193691ca076948f4f90.js → b53008c1461dd6bacc63.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{1d234c057a6671acc59f.js → b605dfdfed8ff8eda4f3.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{76ff7ccfe583927918f3.js → b68b54be3d67595a9446.js} +18 -18
  101. package/assets/esri/core/workers/chunks/b6c6f82df3b60c2f831f.js +1 -0
  102. package/assets/esri/core/workers/chunks/{7eda1c400658b6a99be8.js → ba0c7339fa19cc7cbde7.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{fae6030a81cb91a91b69.js → bafd9b0f6e817252cb31.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{c80c032c5b7a11db177a.js → bb2ab663e3e5597f2104.js} +1 -1
  105. package/assets/esri/core/workers/chunks/{724de82d101eb59c2834.js → bd451668c4ce9f7d7128.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{91ede8c62a7b1e8b8023.js → be06c8a58c217a17451b.js} +1 -1
  107. package/assets/esri/core/workers/chunks/bf6b76027c60b4ffa507.js +1 -0
  108. package/assets/esri/core/workers/chunks/{08c0c016787caa169492.js → c24214666d10cb648428.js} +1 -1
  109. package/assets/esri/core/workers/chunks/c34a164a8ece4cb33e81.js +1 -0
  110. package/assets/esri/core/workers/chunks/{a3a23a56df4e5ee86bb2.js → c5fe356fc5b8b7be0d31.js} +1 -1
  111. package/assets/esri/core/workers/chunks/c696615cae5daefa2d98.js +1 -0
  112. package/assets/esri/core/workers/chunks/{e982cf44906eb26164f2.js → c75b0243e5bb84738419.js} +1 -1
  113. package/assets/esri/core/workers/chunks/{64fab4e1e28c06c83403.js → c779c8b98e07fa881c1d.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{4a0257c449f31bdadf26.js → cef9ff811221a7c3812c.js} +1 -1
  115. package/assets/esri/core/workers/chunks/{b1982490762972ae023d.js → d0296368ae143de4d5ce.js} +1 -1
  116. package/assets/esri/core/workers/chunks/{3d5954478864a975e65e.js → d07d3b0e06f12aee4a8b.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{e1472dbf0795d737d6f8.js → d2371f5034b2a32e2523.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{2f65081bfedeab44d6cb.js → d35cadfb78ac9803069b.js} +1 -1
  119. package/assets/esri/core/workers/chunks/{80a69897fa3ce1eaa6e7.js → d707538b150d79050336.js} +1 -1
  120. package/assets/esri/core/workers/chunks/d7ce68667bb355ef8e5d.js +1 -0
  121. package/assets/esri/core/workers/chunks/d823277612f971a9c2f0.js +1 -0
  122. package/assets/esri/core/workers/chunks/d83bdc13c3cad3eee7be.js +1 -0
  123. package/assets/esri/core/workers/chunks/d91b80aa4f847c2e2a33.js +1 -0
  124. package/assets/esri/core/workers/chunks/{a96ac5c68d84122e7751.js → db7678104b18534482e3.js} +1 -1
  125. package/assets/esri/core/workers/chunks/dbcef57073075e9cfdfe.js +1 -0
  126. package/assets/esri/core/workers/chunks/{c4ceb267d4004d8da8cc.js → e0bbfbe1ed39c82f1bd4.js} +1 -1
  127. package/assets/esri/core/workers/chunks/e36d538915261ee0373f.js +1 -0
  128. package/assets/esri/core/workers/chunks/e58c5c8639aa837c84d1.js +1 -0
  129. package/assets/esri/core/workers/chunks/{a24762e976c1459b12de.js → e689a4849f5af3f2f641.js} +1 -1
  130. package/assets/esri/core/workers/chunks/e97250ae8da4bd0d6bc9.js +1 -0
  131. package/assets/esri/core/workers/chunks/{ef85cd0e82d59db8a26f.js → eacc7fccdc3fb670ac8f.js} +2 -2
  132. package/assets/esri/core/workers/chunks/{0df1f56df6d47dfbb6ea.js → eada3483116a5ea8baed.js} +1 -1
  133. package/assets/esri/core/workers/chunks/ed8863c3d334f438b625.js +1 -0
  134. package/assets/esri/core/workers/chunks/{47682247910271077333.js → ee78a38a0cacb19b2fd4.js} +1 -1
  135. package/assets/esri/core/workers/chunks/{f4061587ff5789fa4e1f.js → f594df2f5ce6ca41a254.js} +1 -1
  136. package/assets/esri/core/workers/chunks/{d7b3e81cc313fd0a33b0.js → f5c821ca2911a5103c9a.js} +1 -1
  137. package/assets/esri/core/workers/chunks/f636ca5c811c3a2a962f.js +1 -0
  138. package/assets/esri/core/workers/chunks/{a3ee76b7e46d3fba7cf7.js → f6d91256c4e5f8a0d5c0.js} +1 -1
  139. package/assets/esri/core/workers/chunks/f711aeba1a2c184ddb43.js +1 -0
  140. package/assets/esri/core/workers/chunks/f718f630a8b81496c646.js +1 -0
  141. package/assets/esri/core/workers/chunks/{cac060a187f3a27a19ba.js → fa0f94318173db2034de.js} +1 -1
  142. package/assets/esri/core/workers/chunks/fdae43a97537093e4b97.js +1 -0
  143. package/assets/esri/core/workers/chunks/{b6a201e86f9caef45ff0.js → ff2614d96ca5228e9685.js} +1 -1
  144. package/assets/esri/themes/base/widgets/_Editor.scss +5 -3
  145. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +6 -0
  146. package/assets/esri/themes/dark/main.css +1 -1
  147. package/assets/esri/themes/light/main.css +1 -1
  148. package/assets/esri/themes/light/view.css +1 -1
  149. package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar.json +1 -1
  150. package/assets/esri/widgets/support/SelectionToolbar/t9n/SelectionToolbar_en.json +1 -1
  151. package/chunks/BloomComposition.glsl.js +36 -18
  152. package/chunks/ColorMaterial.glsl.js +1 -1
  153. package/chunks/ComponentShader.glsl.js +3 -3
  154. package/chunks/CompositeGeographicTransformation.js +1 -1
  155. package/chunks/CutFillDepth.glsl.js +15 -0
  156. package/chunks/CutFillReduction.glsl.js +12 -0
  157. package/chunks/CutFillTargetDepth.glsl.js +6 -0
  158. package/chunks/DefaultMaterial.glsl.js +2 -2
  159. package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
  160. package/chunks/GeographicTransformation.js +1 -1
  161. package/chunks/HUDMaterial.glsl.js +4 -4
  162. package/chunks/ImageMaterial.glsl.js +2 -2
  163. package/chunks/MultiPathImpl.js +1 -1
  164. package/chunks/NativeLine.glsl.js +1 -1
  165. package/chunks/OperatorGeodesicBuffer.js +1 -1
  166. package/chunks/OperatorGeodeticArea.js +1 -1
  167. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  168. package/chunks/OperatorGeodeticLength.js +1 -1
  169. package/chunks/OperatorProximityGeodesic.js +1 -1
  170. package/chunks/OperatorShapePreservingLength.js +1 -1
  171. package/chunks/OperatorShapePreservingProject.js +1 -1
  172. package/chunks/Path.glsl.js +7 -7
  173. package/chunks/Pattern.glsl.js +1 -1
  174. package/chunks/Point2D.js +1 -1
  175. package/chunks/ProjectionTransformation.js +1 -1
  176. package/chunks/RealisticTree.glsl.js +2 -2
  177. package/chunks/RibbonLine.glsl.js +2 -2
  178. package/chunks/ShadedColorMaterial.glsl.js +1 -1
  179. package/chunks/SimpleAtmosphere.glsl.js +1 -1
  180. package/chunks/SpatialReference.js +1 -1
  181. package/chunks/Terrain.glsl.js +4 -4
  182. package/chunks/UnitFactory.js +1 -1
  183. package/chunks/WaterSurface.glsl.js +3 -3
  184. package/chunks/offsetOperator.js +1 -1
  185. package/chunks/sphere.js +1 -1
  186. package/chunks/vec42.js +1 -1
  187. package/config.js +1 -1
  188. package/copyright.txt +2 -20
  189. package/core/Clonable.js +1 -1
  190. package/core/accessorSupport/layerContainerType.js +1 -1
  191. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  192. package/core/libs/gl-matrix-2/math/vec4.js +1 -1
  193. package/core/quantityFormatUtils.js +1 -1
  194. package/core/unitFormatUtils.js +1 -1
  195. package/editing/geometry/coordUtils.js +5 -0
  196. package/editing/geometry/lineUtils.js +5 -0
  197. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  198. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  199. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  200. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  201. package/editing/sharedTemplates/executor/builders/support/shapeUtils.js +1 -1
  202. package/effects/FocusArea.js +1 -1
  203. package/geometry/coordinateFormatter.js +1 -1
  204. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  205. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  206. package/geometry/operators/gx/operatorOffset.js +1 -1
  207. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  208. package/geometry/operators/offsetOperator.js +1 -1
  209. package/geometry/operators/support/apiConverter.js +1 -1
  210. package/geometry/operators/support/initNoPeFactory.js +1 -1
  211. package/geometry/operators/support/jsonConverter.js +1 -1
  212. package/geometry/support/sphere.js +1 -1
  213. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  214. package/graphic/LinkChartGraphicOrigin.js +5 -0
  215. package/graphic/isLinkChartGraphicOrigin.js +5 -0
  216. package/interfaces.d.ts +131 -12
  217. package/kernel.js +1 -1
  218. package/layers/FeatureLayer.js +1 -1
  219. package/layers/GroundLayer.js +1 -1
  220. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  221. package/layers/IntegratedMeshLayer.js +1 -1
  222. package/layers/ParquetLayer.js +1 -1
  223. package/layers/PointCloudLayer.js +1 -1
  224. package/layers/SceneLayer.js +1 -1
  225. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  226. package/layers/catalog/catalogUtils.js +1 -1
  227. package/layers/graphics/hydratedFeatures.js +1 -1
  228. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  229. package/layers/knowledgeGraph/nodeMovementUtils.js +5 -0
  230. package/layers/mixins/ImageryTileMixin.js +1 -1
  231. package/layers/mixins/operationalLayers.js +1 -1
  232. package/layers/support/RasterStorageInfo.js +1 -1
  233. package/layers/support/SceneFilter.js +1 -1
  234. package/layers/support/Sublayer.js +1 -1
  235. package/layers/support/layersCreator.js +1 -1
  236. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  237. package/layers/support/rasterFunctions/BandArithmeticFunction.js +1 -1
  238. package/layers/support/rasterFunctions/BaseRasterFunction.js +1 -1
  239. package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
  240. package/layers/support/rasterFunctions/NDVIFunction.js +1 -1
  241. package/package.json +2 -2
  242. package/portal/schemas/definitions.js +1 -1
  243. package/renderers/support/RasterSymbolizer.js +1 -1
  244. package/support/basemapUtils.js +1 -1
  245. package/support/revision.js +1 -1
  246. package/views/2d/engine/Stage.js +1 -1
  247. package/views/2d/engine/webgl/Profiler.js +1 -1
  248. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  249. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  250. package/views/3d/camera/constraintUtils/distance.js +1 -1
  251. package/views/3d/camera/constraintUtils/tilt.js +1 -1
  252. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  253. package/views/3d/layers/CSVLayerView3D.js +1 -1
  254. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  255. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  256. package/views/3d/layers/GeoJSONLayerView3D.js +1 -1
  257. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  258. package/views/3d/layers/GraphicsView3D.js +1 -1
  259. package/views/3d/layers/I3SMeshView3D.js +1 -1
  260. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  261. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  262. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  263. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  264. package/views/3d/layers/RouteLayerView3D.js +1 -1
  265. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  266. package/views/3d/layers/SceneLayerView3D.js +1 -1
  267. package/views/3d/layers/StreamLayerView3D.js +1 -1
  268. package/views/3d/layers/WFSLayerView3D.js +1 -1
  269. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  270. package/views/3d/layers/graphics/ElevationAligners.js +1 -1
  271. package/views/3d/layers/graphics/ElevationContext.js +1 -1
  272. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  273. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  274. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  275. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  276. package/views/3d/layers/graphics/Labeler.js +1 -1
  277. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  278. package/views/3d/layers/graphics/StreamController.js +1 -1
  279. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  280. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  281. package/views/3d/layers/graphics/pointUtils.js +1 -1
  282. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  283. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  284. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  285. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  286. package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
  287. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  288. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  289. package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
  290. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  291. package/views/3d/state/utils/navigationUtils.js +1 -1
  292. package/views/3d/support/CombinedElevationProvider.js +1 -1
  293. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  294. package/views/3d/terrain/OverlayManager.js +1 -1
  295. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  296. package/views/3d/terrain/OverlayRenderer.js +1 -1
  297. package/views/3d/terrain/SphericalPatch.js +1 -1
  298. package/views/3d/terrain/TerrainRenderer.js +1 -1
  299. package/views/3d/terrain/TerrainSurface.js +1 -1
  300. package/views/3d/terrain/Tile.js +1 -1
  301. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  302. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  303. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +2 -2
  304. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  305. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  306. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  307. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
  308. package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputConfiguration.js +1 -1
  309. package/views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js +1 -1
  310. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +4 -4
  311. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +2 -0
  312. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
  313. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlightOverlay.js +1 -1
  314. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -4
  315. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
  316. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  317. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  318. package/views/3d/webgl-engine/effects/bloom/BloomComposition.glsl.js +1 -1
  319. package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechniqueConfiguration.js +5 -0
  320. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  321. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  322. package/views/3d/webgl-engine/effects/geometry/ObjectAndLayerIDRenderNode.js +1 -1
  323. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  324. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  325. package/views/3d/webgl-engine/lib/CutFillDepth.js +5 -0
  326. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  327. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  328. package/views/3d/webgl-engine/lib/Material.js +1 -1
  329. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  330. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  331. package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
  332. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  333. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  334. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  335. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  336. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  337. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  338. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  339. package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
  340. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  341. package/views/3d/webgl-engine/lib/octreeUtils.js +1 -1
  342. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  343. package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
  344. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  345. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  346. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  347. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  348. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  349. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  350. package/views/3d/webgl-engine/shaders/CutFillDepth.glsl.js +5 -0
  351. package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +5 -0
  352. package/views/3d/webgl-engine/shaders/CutFillReduction.glsl.js +5 -0
  353. package/views/3d/webgl-engine/shaders/CutFillReductionTechnique.js +5 -0
  354. package/views/3d/webgl-engine/shaders/CutFillTargetDepth.glsl.js +5 -0
  355. package/views/3d/webgl-engine/shaders/CutFillTargetDepthTechnique.js +5 -0
  356. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  357. package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +1 -1
  358. package/views/3d/webgl.js +1 -1
  359. package/views/LinkChartView.js +1 -1
  360. package/views/draw/DrawOperation.js +1 -1
  361. package/views/draw/support/GraphicMover.js +1 -1
  362. package/views/draw/support/HighlightHelper.js +1 -1
  363. package/views/draw/support/Reshape.js +1 -1
  364. package/views/draw/support/drawUtils.js +1 -1
  365. package/views/interactive/Tooltip.js +1 -1
  366. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  367. package/views/interactive/sketch/SketchLabelOptions.js +1 -1
  368. package/views/interactive/sketch/SketchOptions.js +1 -1
  369. package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
  370. package/views/interactive/sketch/SketchTooltipVisibleElements.js +1 -1
  371. package/views/interactive/sketch/SketchValueOptions.js +1 -1
  372. package/views/interactive/sketch/Units.js +1 -1
  373. package/views/interactive/sketch/constraints.js +1 -1
  374. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  375. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  376. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  377. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  378. package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
  379. package/views/interactive/tooltip/fields/fields.js +1 -1
  380. package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
  381. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  382. package/views/support/angularMeasurementUtils.js +1 -1
  383. package/webdoc/support/writeUtils.js +1 -1
  384. package/webscene/spec-certification/api.js +1 -1
  385. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  386. package/widgets/Editor/EditorViewModel.js +1 -1
  387. package/widgets/Editor/support/splitFeatureUtils.js +5 -0
  388. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  389. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  390. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  391. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  392. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  393. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  394. package/widgets/OrientedImageryViewer.js +1 -1
  395. package/widgets/Sketch.js +1 -1
  396. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  397. package/widgets/support/SelectionToolbar/VisibleElements.js +1 -1
  398. package/widgets/support/SelectionToolbar.js +1 -1
  399. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  400. package/EULA.pdf +0 -0
  401. package/assets/esri/core/workers/chunks/0390f3aa624e3f380ce2.js +0 -1
  402. package/assets/esri/core/workers/chunks/0569698a3e4eaf2bac8e.js +0 -1
  403. package/assets/esri/core/workers/chunks/06d2251d6f6b3e44800a.js +0 -1
  404. package/assets/esri/core/workers/chunks/07eea90733834313e9fa.js +0 -1
  405. package/assets/esri/core/workers/chunks/08393d9cc2ed846dd5b4.js +0 -1
  406. package/assets/esri/core/workers/chunks/094c741fa8139c3f40cf.js +0 -1
  407. package/assets/esri/core/workers/chunks/0f51e51db83f303ce5a6.js +0 -1
  408. package/assets/esri/core/workers/chunks/171ce8c64f322cd5d6d1.js +0 -1
  409. package/assets/esri/core/workers/chunks/184d3c88ac2fc1d7e2c3.js +0 -1
  410. package/assets/esri/core/workers/chunks/1ae15163af8875148fb8.js +0 -1
  411. package/assets/esri/core/workers/chunks/1eee7cf11df01a52c1bf.js +0 -1
  412. package/assets/esri/core/workers/chunks/27197b0a2ffb2b6104ea.js +0 -1
  413. package/assets/esri/core/workers/chunks/2c0241a5958aef9cda61.js +0 -1
  414. package/assets/esri/core/workers/chunks/2ded2446700f89155ccd.js +0 -1
  415. package/assets/esri/core/workers/chunks/3264d58aeef8cf074b86.js +0 -1
  416. package/assets/esri/core/workers/chunks/3445ffd752262673fb13.js +0 -1
  417. package/assets/esri/core/workers/chunks/38f09e36e174792646bd.js +0 -1
  418. package/assets/esri/core/workers/chunks/3c57b2e13628b5c1f6de.js +0 -1
  419. package/assets/esri/core/workers/chunks/4162c633efefc63c5506.js +0 -1
  420. package/assets/esri/core/workers/chunks/435169b455fd2846799b.js +0 -1
  421. package/assets/esri/core/workers/chunks/44dc7ec52c4abb700783.js +0 -1
  422. package/assets/esri/core/workers/chunks/4558f2e3e77831758fdc.js +0 -1
  423. package/assets/esri/core/workers/chunks/4fc267552939583a81a0.js +0 -1
  424. package/assets/esri/core/workers/chunks/527557b603400189d49a.js +0 -1
  425. package/assets/esri/core/workers/chunks/53873f26a2c24cd75e4a.js +0 -1
  426. package/assets/esri/core/workers/chunks/554c789f4e875d7e6fd5.js +0 -1
  427. package/assets/esri/core/workers/chunks/561a2078458bc0339f83.js +0 -1
  428. package/assets/esri/core/workers/chunks/5f28470304b57e24d94c.js +0 -1
  429. package/assets/esri/core/workers/chunks/61a294f9411bf884f2ab.js +0 -1
  430. package/assets/esri/core/workers/chunks/6acffacbb4a03af52e3b.js +0 -1
  431. package/assets/esri/core/workers/chunks/719450ccd455f503d81a.js +0 -1
  432. package/assets/esri/core/workers/chunks/71cac356874b36f9a383.js +0 -1
  433. package/assets/esri/core/workers/chunks/7388e8c905d93dea1c05.js +0 -1
  434. package/assets/esri/core/workers/chunks/749c7159e0902388e828.js +0 -1
  435. package/assets/esri/core/workers/chunks/7714228825fb44d506df.js +0 -1
  436. package/assets/esri/core/workers/chunks/77ee4afaa4a1c7047940.js +0 -1
  437. package/assets/esri/core/workers/chunks/790e97ddbe318bc75415.js +0 -1
  438. package/assets/esri/core/workers/chunks/8762928d10c3821738ad.js +0 -1
  439. package/assets/esri/core/workers/chunks/8ead467a5af0d9bba804.js +0 -1
  440. package/assets/esri/core/workers/chunks/91e04d03b0013bcaad82.js +0 -1
  441. package/assets/esri/core/workers/chunks/92b60d4fb09711919601.js +0 -1
  442. package/assets/esri/core/workers/chunks/9940e59033a8a1eff2a9.js +0 -1
  443. package/assets/esri/core/workers/chunks/998c38974372720b1c52.js +0 -1
  444. package/assets/esri/core/workers/chunks/9b10e70f28873cff44f5.js +0 -1
  445. package/assets/esri/core/workers/chunks/9b5e04d87116ce2b68b2.js +0 -1
  446. package/assets/esri/core/workers/chunks/9d920f3488d59e7f276c.js +0 -1
  447. package/assets/esri/core/workers/chunks/a999f804fc2f00b2e7ae.js +0 -1
  448. package/assets/esri/core/workers/chunks/acf13a64df2991a4cb6b.js +0 -1
  449. package/assets/esri/core/workers/chunks/b457b7dd907f06278bee.js +0 -1
  450. package/assets/esri/core/workers/chunks/b5640f9623a9c9ded92a.js +0 -1
  451. package/assets/esri/core/workers/chunks/b8158c681456d4cf2395.js +0 -1
  452. package/assets/esri/core/workers/chunks/bbdbb618a18542f7a4a2.js +0 -1
  453. package/assets/esri/core/workers/chunks/bead38898c3f4d4d3569.js +0 -1
  454. package/assets/esri/core/workers/chunks/c51e2a048df152abd901.js +0 -1
  455. package/assets/esri/core/workers/chunks/c86e339e45900c54c9f5.js +0 -1
  456. package/assets/esri/core/workers/chunks/ca7c9756802214e41c56.js +0 -1
  457. package/assets/esri/core/workers/chunks/cb8f2ce22274990b359c.js +0 -1
  458. package/assets/esri/core/workers/chunks/d6ab4d55f1023ee6ec6a.js +0 -1
  459. package/assets/esri/core/workers/chunks/db2b8d8cf7131554cf7e.js +0 -1
  460. package/assets/esri/core/workers/chunks/e7ccf067bea8f4766424.js +0 -1
  461. package/assets/esri/core/workers/chunks/f1c50f37a81c672263a1.js +0 -1
  462. package/assets/esri/core/workers/chunks/ff323db554c9e09749e8.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4575],{5834:(e,t,i)=>{i.d(t,{A:()=>y});var n=i(31635),r=i(93637),s=i(10107),o=i(56507),a=(i(44208),i(87811),i(93223)),l=i(40608),p=i(41266),u=i(41366);function c(e,t,i){(0,r.sM)(i,e instanceof Date?e.getTime():e,t)}let y=class extends((0,u.K)(p.A)){constructor(e){super(e),this.numBins=null,this.end=null,this.start=null,this.type="auto-interval"}};(0,n.Cg)([(0,s.MZ)({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],y.prototype,"numBins",void 0),(0,n.Cg)([(0,s.MZ)({json:{name:"parameters.end",write:{writer:c}}})],y.prototype,"end",void 0),(0,n.Cg)([(0,s.MZ)({json:{name:"parameters.start",write:{writer:c}}})],y.prototype,"start",void 0),(0,n.Cg)([(0,a.e)({autoIntervalBin:"auto-interval"},{readOnly:!0})],y.prototype,"type",void 0),y=(0,n.Cg)([(0,l.$)("esri.rest.support.AutoIntervalBinParameters")],y),y.from=(0,o.dp)(y)},7320:(e,t,i)=>{i.d(t,{g:()=>n});const n={convertToGEGeometry:function(e,t){return null==t?null:e.convertJSONToGeometry(t)},exportPoint:function(e,t,i){const n=new r(e.getPointX(t),e.getPointY(t),i),s=e.hasZ(t),o=e.hasM(t);return s&&(n.z=e.getPointZ(t)),o&&(n.m=e.getPointM(t)),n},exportPolygon:function(e,t,i){return new s(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportPolyline:function(e,t,i){return new o(e.exportPaths(t),i,e.hasZ(t),e.hasM(t))},exportMultipoint:function(e,t,i){return new a(e.exportPoints(t),i,e.hasZ(t),e.hasM(t))},exportExtent:function(e,t,i){const n=e.hasZ(t),r=e.hasM(t),s=new l(e.getXMin(t),e.getYMin(t),e.getXMax(t),e.getYMax(t),i);if(n){const i=e.getZExtent(t);s.zmin=i.vmin,s.zmax=i.vmax}if(r){const i=e.getMExtent(t);s.mmin=i.vmin,s.mmax=i.vmax}return s}};class r{constructor(e,t,i){this.x=e,this.y=t,this.spatialReference=i,this.z=void 0,this.m=void 0}}class s{constructor(e,t,i,n){this.rings=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),n&&(this.hasM=n)}}class o{constructor(e,t,i,n){this.paths=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),n&&(this.hasM=n)}}class a{constructor(e,t,i,n){this.points=e,this.spatialReference=t,this.hasZ=void 0,this.hasM=void 0,i&&(this.hasZ=i),n&&(this.hasM=n)}}class l{constructor(e,t,i,n,r){this.xmin=e,this.ymin=t,this.xmax=i,this.ymax=n,this.spatialReference=r,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}},11440:(e,t,i)=>{i.d(t,{A:()=>u});var n=i(31635),r=i(93637),s=i(10107),o=i(56507),a=(i(44208),i(87811),i(93223)),l=i(40608),p=i(41266);let u=class extends p.A{constructor(e){super(e),this.boundaries=[],this.type="fixed-boundaries"}};(0,n.Cg)([(0,s.MZ)({json:{name:"parameters.boundaries",write:{writer:function(e,t,i){(0,r.sM)(i,e&&function(e){return e[0]instanceof Date}(e)?e.map(e=>e.getTime()):e,t)}}}})],u.prototype,"boundaries",void 0),(0,n.Cg)([(0,a.e)({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],u.prototype,"type",void 0),u=(0,n.Cg)([(0,l.$)("esri.rest.support.FixedBoundariesBinParameters")],u),u.from=(0,o.dp)(u)},14575:(e,t,i)=>{i.r(t),i.d(t,{default:()=>j});var n=i(31635),r=i(69540),s=i(66552),o=i(25482),a=i(53966),l=i(10107),p=i(56507),u=(i(44208),i(87811),i(93223)),c=i(40608),y=i(16930),d=i(65864),m=i(50498),h=i(58727),g=i(5834),f=i(41266),v=i(59977),w=i(11440),x=i(60909),M=i(58174),Z=i(7562),C=i(64272),S=i(56400);const B=new s.J({asc:"ascending",desc:"descending"}),T={base:f.A,key:"type",typeMap:{"auto-interval":g.A,date:v.A,"fixed-boundaries":w.A,"fixed-interval":x.A}};let j=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.timeExtent=null,this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(e){this._set("outTimeZone",e),e&&!(0,S.wr)(e)&&a.A.getLogger(this).warn("#outTimeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}};(0,n.Cg)([(0,l.MZ)({types:T,json:{name:"bin",write:!0}})],j.prototype,"binParameters",void 0),(0,n.Cg)([(0,u.e)(B)],j.prototype,"binOrder",void 0),(0,n.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],j.prototype,"cacheHint",void 0),(0,n.Cg)([(0,l.MZ)({json:{write:!0}})],j.prototype,"datumTransformation",void 0),(0,n.Cg)([(0,l.MZ)({type:y.A,json:{name:"defaultSR",write:!0}})],j.prototype,"defaultSpatialReference",void 0),(0,n.Cg)([(0,l.MZ)({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],j.prototype,"distance",void 0),(0,n.Cg)([(0,l.MZ)({types:m.yR,json:{read:d.rS,write:!0}})],j.prototype,"geometry",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],j.prototype,"lowerBoundaryAlias",void 0),(0,n.Cg)([(0,l.MZ)({type:y.A,json:{name:"outSR",write:!0}})],j.prototype,"outSpatialReference",void 0),(0,n.Cg)([(0,l.MZ)({type:[Z.A],json:{write:{enabled:!0,overridePolicy(){return{enabled:null!=this.outStatistics&&this.outStatistics.length>0}}}}})],j.prototype,"outStatistics",void 0),(0,n.Cg)([(0,l.MZ)({value:null,json:{name:"outTimeReference",read:{reader:e=>e.ianaTimeZone},write:{writer:(e,t,i)=>{e&&(t[i]={ianaTimeZone:e})}}}})],j.prototype,"outTimeZone",null),(0,n.Cg)([(0,l.MZ)({type:Boolean,json:{write:!0}})],j.prototype,"returnDistinctValues",void 0),(0,n.Cg)([(0,u.e)(M.x,{name:"spatialRel"})],j.prototype,"spatialRelationship",void 0),(0,n.Cg)([(0,l.MZ)({type:C.T,json:{write:!0}})],j.prototype,"timeExtent",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],j.prototype,"upperBoundaryAlias",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{read:h.VY.read,write:{writer:h.VY.write,overridePolicy(e){return{enabled:null!=e&&null!=this.distance}}}}})],j.prototype,"units",void 0),(0,n.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],j.prototype,"where",void 0),j=(0,n.Cg)([(0,c.$)("esri.rest.support.AttributeBinsQuery")],j),j.from=(0,p.dp)(j)},31464:(e,t,i)=>{i.d(t,{Cv:()=>g,Nk:()=>d,lK:()=>v});var n=i(4576),r=i(74887),s=i(98988),o=i(7320),a=i(21325),l=i(28735);const p=[0,0];function u(e,t){if(!t)return null;if("x"in t){const i={x:0,y:0};return[i.x,i.y]=e(t.x,t.y,p),null!=t.z&&(i.z=t.z),null!=t.m&&(i.m=t.m),i}if("xmin"in t){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(t.xmin,t.ymin,p),[i.xmax,i.ymax]=e(t.xmax,t.ymax,p),t.hasZ&&(i.zmin=t.zmin,i.zmax=t.zmax,i.hasZ=!0),t.hasM&&(i.mmin=t.mmin,i.mmax=t.mmax,i.hasM=!0),i}return"rings"in t?{rings:c(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:c(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:y(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function c(e,t){const i=[];for(const n of e)i.push(y(n,t));return i}function y(e,t){const i=[];for(const n of e){const e=t(n[0],n[1],[0,0]);i.push(e),n.length>2&&e.push(n[2]),n.length>3&&e.push(n[3])}return i}async function d(e,t){if(!e||!t)return;const i=Array.isArray(e)?e.map(e=>null!=e.geometry?e.geometry.spatialReference:null).filter(n.Ru):[e];await(0,s.initializeProjection)(i.map(e=>({source:e,dest:t})))}const m=u.bind(null,l.je),h=u.bind(null,l.tD);function g(e,t,i,n){if(!e)return null;if(i||(i=t,t=e.spatialReference),!(0,a.fn)(t)||!(0,a.fn)(i)||(0,a.aI)(t,i))return e;if((0,l.y7)(t,i)){const t=(0,a.K8)(i)?m(e):h(e);return t.spatialReference=i,t}return(0,s.projectMany)(o.g,[e],t,i,null,n)[0]}const f=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i,n){if(!e?.length||!t||!i||(0,a.aI)(t,i))return e;const s={geometries:e,inSpatialReference:t,outSpatialReference:i,geographicTransformation:n,resolve:(0,r.Tw)()};return this._jobs.push(s),this._timer??=setTimeout(this._process,10),s.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:n,resolve:r,geographicTransformation:p}=e;(0,l.y7)(i,n)?(0,a.K8)(n)?r(t.map(m)):r(t.map(h)):r((0,s.projectMany)(o.g,t,i,n,p,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function v(e,t,i,n){return f.push(e,t,i,n)}},41266:(e,t,i)=>{i.d(t,{A:()=>g});var n=i(31635),r=i(69540),s=i(66552),o=i(25482),a=i(10107),l=(i(44208),i(53966),i(87811),i(93223)),p=i(40608),u=i(56507);const c=new s.J({esriFieldTypeInteger:"integer",esriFieldTypeString:"string"});let y=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.alias=null,this.responseType=null,this.type=null,this.value=null,this.valueType=null}};(0,n.Cg)([(0,a.MZ)({type:String,json:{name:"outAlias",write:!0}})],y.prototype,"alias",void 0),(0,n.Cg)([(0,a.MZ)({type:String})],y.prototype,"responseType",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],y.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],y.prototype,"value",void 0),(0,n.Cg)([(0,l.e)(c)],y.prototype,"valueType",void 0),y=(0,n.Cg)([(0,p.$)("esri.rest.support.AttributeBinsGrouping")],y);const d=y;y.from=(0,u.dp)(y);const m=new s.J({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeDate:"date",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"}),h=new s.J({naturalLog:"natural-log",squareRoot:"square-root"});let g=class extends((0,r.OU)(o.o)){constructor(e){super(e),this.expression=null,this.expressionValueType=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitBy=null,this.stackBy=null,this.transformation=null}};(0,n.Cg)([(0,a.MZ)({type:String,json:{name:"onExpression.value",write:!0}})],g.prototype,"expression",void 0),(0,n.Cg)([(0,l.e)(m,{name:"onExpression.valueType"})],g.prototype,"expressionValueType",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{name:"onField",write:!0}})],g.prototype,"field",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],g.prototype,"firstDayOfWeek",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],g.prototype,"hideUpperBound",void 0),(0,n.Cg)([(0,a.MZ)({type:d,json:{write:{overridePolicy(){return{enabled:null!=this.splitBy?.value||null!=this.splitBy?.type}}}}})],g.prototype,"splitBy",void 0),(0,n.Cg)([(0,a.MZ)({type:d,json:{write:{target:{stackBy:{type:d},jsonStyle:{type:String}},writer:(e,t)=>{e&&(t.stackBy=e.toJSON(),null!=e.responseType&&(t.jsonStyle=e.responseType))},overridePolicy(){return{enabled:null!=this.stackBy?.value||null!=this.stackBy?.type}}},read:{source:["stackBy","jsonStyle"],reader:(e,t)=>d.fromJSON({...t.stackBy,responseType:t.jsonStyle})}}})],g.prototype,"stackBy",void 0),(0,n.Cg)([(0,l.e)(h)],g.prototype,"transformation",void 0),g=(0,n.Cg)([(0,p.$)("esri.rest.support.BinParametersBase")],g)},57231:(e,t,i)=>{i.d(t,{g:()=>n});const n=(0,i(66552).O)()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"})},58727:(e,t,i)=>{i.d(t,{GC:()=>g,T2:()=>f,VY:()=>y,dO:()=>w,iJ:()=>h,v8:()=>d});var n=i(49186),r=i(66552),s=i(83047),o=i(98988),a=i(90634),l=i(65864),p=i(17136),u=i(21325),c=i(31464);const y=new r.J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),d=Object.freeze({}),m="frequency";async function h(e,t,i){const n=e.bin;return n.onField&&(n.onField=n.onField.trim()),n.onExpression?.value&&(n.onExpression.value=n.onExpression.value.trim()),n.splitBy&&(n.splitBy.value&&(n.splitBy.value=n.splitBy.value.trim()),n.splitBy.outAlias&&(n.splitBy.outAlias=n.splitBy.outAlias.trim())),n.stackBy&&(n.stackBy.value&&(n.stackBy.value=n.stackBy.value.trim()),n.stackBy.outAlias&&(n.stackBy.outAlias=n.stackBy.outAlias.trim())),"normalizationField"in n.parameters&&n.parameters.normalizationField&&(n.parameters.normalizationField=n.parameters.normalizationField.trim()),e.outStatistics?.length||(e.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:m}]),g(e,t,i)}async function g(e,t,i){const{outFields:n,orderByFields:r,groupByFieldsForStatistics:s,outStatistics:o}=e;if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(s)for(let e=0;e<s.length;e++)s[e]=s[e].trim();if(o)for(let e=0;e<o.length;e++)o[e].onStatisticField&&(o[e].onStatisticField=o[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),f(e,t,i)}async function f(e,t,r){if(!e)return null;let{where:o}=e;if(e.where=o=o?.trim(),(!o||/^1 *= *1$/.test(o)||t&&t===o)&&(e.where=null),!e.geometry)return e;let m=await async function(e){const{distance:t,units:r}=e,o=e.geometry;if(null==t||"vertexAttributes"in o)return o;const a=o.spatialReference,p=r?y.fromJSON(r):(0,s.Ij)(a),d=a&&((0,u.EA)(a)||(0,u.K8)(a))?o:await(0,c.Nk)(a,u.KK).then(()=>(0,c.Cv)(o,u.KK)),m=await i.e(9159).then(i.bind(i,49159));await m.load();const h=m.execute(d,t||1,{unit:p})??void 0;if(!h||!(0,l.Bi)(h)||0===h.rings.length)throw new n.A("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return h}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;m=(0,a.HA)(m),m.spatialReference=t}if(m){await(0,c.Nk)(m.spatialReference,r),m=function(e,t){const i=e.spatialReference;return v(e,t)&&(0,l.ZC)(e)?{spatialReference:i,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(m,r);const t=(await(0,p.el)((0,l.rS)(m)))[0];if(null==t)throw d;const i="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,n=i&&v(m,r)?{densificationStep:8*i}:void 0,s=t.toJSON(),o=(0,c.Cv)(s,s.spatialReference,r,n);if(!o)throw d;o.spatialReference=r,e.geometry=o}return e}function v(e,t){if(!e)return!1;const i=e.spatialReference;return((0,l.ZC)(e)||(0,l.Bi)(e)||(0,l.Rg)(e))&&!(0,u.aI)(i,t)&&!(0,o.canProjectWithoutEngine)(i,t)}function w(e,t){return null==e?null:"string"==typeof e?t?new Date(`1970-01-01T${e}Z`).getTime():new Date(e).getTime():e instanceof Date?e.getTime():e}},59977:(e,t,i)=>{i.d(t,{A:()=>f});var n=i(31635),r=i(93637),s=i(10107),o=i(56507),a=(i(44208),i(87811),i(93223)),l=i(40608),p=i(41266),u=i(69540),c=i(25482),y=i(57231);let d=class extends((0,u.OU)(c.o)){constructor(e){super(e),this.value=null,this.unit=null}};(0,n.Cg)([(0,s.MZ)({type:Number,json:{name:"number",write:!0}})],d.prototype,"value",void 0),(0,n.Cg)([(0,a.e)(y.g)],d.prototype,"unit",void 0),d=(0,n.Cg)([(0,l.$)("esri.rest.support.DateBinTimeInterval")],d);const m=d;function h(e,t,i){(0,r.sM)(i,"string"==typeof e?e:e?.getTime(),t)}function g(e,t){const i=e.parameters[t];return i?"string"==typeof i?i:new Date(i):null}d.from=(0,o.dp)(d);let f=class extends p.A{constructor(e){super(e),this.end=null,this.interval=null,this.offset=null,this.returnFullIntervalBin=!1,this.start=null,this.snapToData=null,this.type="date"}};(0,n.Cg)([(0,s.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.end",read:{reader:(e,t)=>g(t,"end")},write:{writer:h}}})],f.prototype,"end",void 0),(0,n.Cg)([(0,s.MZ)({type:m,json:{name:"parameters",write:!0}})],f.prototype,"interval",void 0),(0,n.Cg)([(0,s.MZ)({type:m,json:{name:"parameters.offset",write:!0}})],f.prototype,"offset",void 0),(0,n.Cg)([(0,s.MZ)({type:Boolean,json:{name:"parameters.returnFullIntervalBin",write:!0}})],f.prototype,"returnFullIntervalBin",void 0),(0,n.Cg)([(0,s.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.start",read:{reader:(e,t)=>g(t,"start")},write:{writer:h}}})],f.prototype,"start",void 0),(0,n.Cg)([(0,s.MZ)({type:String,json:{name:"parameters.snapToData",write:!0}})],f.prototype,"snapToData",void 0),(0,n.Cg)([(0,a.e)({dateBin:"date"},{readOnly:!0})],f.prototype,"type",void 0),f=(0,n.Cg)([(0,l.$)("esri.rest.support.DateBinParameters")],f),f.from=(0,o.dp)(f)},60909:(e,t,i)=>{i.d(t,{A:()=>y});var n=i(31635),r=i(93637),s=i(10107),o=i(56507),a=(i(44208),i(87811),i(93223)),l=i(40608),p=i(41266),u=i(41366);function c(e,t,i){(0,r.sM)(i,e instanceof Date?e.getTime():e,t)}let y=class extends((0,u.K)(p.A)){constructor(e){super(e),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};(0,n.Cg)([(0,s.MZ)({json:{name:"parameters.end",write:{writer:c}}})],y.prototype,"end",void 0),(0,n.Cg)([(0,s.MZ)({type:Number,json:{name:"parameters.interval",write:!0}})],y.prototype,"interval",void 0),(0,n.Cg)([(0,s.MZ)({json:{name:"parameters.start",write:{writer:c}}})],y.prototype,"start",void 0),(0,n.Cg)([(0,a.e)({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],y.prototype,"type",void 0),y=(0,n.Cg)([(0,l.$)("esri.rest.support.FixedIntervalBinParameters")],y),y.from=(0,o.dp)(y)}}]);
@@ -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}}]);