@arcgis/core 5.0.0-next.122 → 5.0.0-next.123

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 (190) hide show
  1. package/applications/Components/SketchTooltipControls.d.ts +3 -2
  2. package/applications/Components/SketchTooltipControls.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/0184b4c0c92c76c60ab2.js +1 -0
  5. package/assets/esri/core/workers/chunks/{56a296cb5c1ae1ea5ab2.js → 08616877b58b518e7461.js} +1 -1
  6. package/assets/esri/core/workers/chunks/089cef7124173a5cd5f9.js +1 -0
  7. package/assets/esri/core/workers/chunks/{4d438627dd3509f65d5a.js → 0baa0d66003d23cc76a7.js} +1 -1
  8. package/assets/esri/core/workers/chunks/0e216f0075fd531c3a2b.js +1 -0
  9. package/assets/esri/core/workers/chunks/{d5314786df52b6be5307.js → 0e6ffb02a929130ddb50.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{0fe47bf45428100cc808.js → 0e8b4543e895b615c254.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{ae0a555b047b11aa68eb.js → 1219b588f983b4f35033.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{41fe4d8fe97388498f73.js → 13512a23655258fa77f4.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{ee34f14bbfe619b85a80.js → 13e913aa5f5113fceb16.js} +1 -1
  14. package/assets/esri/core/workers/chunks/1458ef3857be3b76be95.js +1 -0
  15. package/assets/esri/core/workers/chunks/{d621cdd0aef6d77986f0.js → 1469e6d1d0d4e310b8f8.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{b9e90875943703486227.js → 15ba0296403dd4152b88.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{7595c52b1647f092c61a.js → 16abc548724e428c325a.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{dddcae86e434d93b10c0.js → 189e22df73414a1a3989.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{90aeef17af12cfbecb36.js → 1d124a55f6804be19e09.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{63831996ad82bd3b1ca9.js → 1e29a114c1cfe21121c4.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{153a9d087e0fe7072af4.js → 1ede5fa7a16839ed9444.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{6b1e1fb4e9010873c171.js → 1f30558e3ad6ac68bdb8.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{9c06b803912fcafa7f52.js → 24dd404612c35f6a3fc3.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{b6e155b42a4a423139e7.js → 27d1f8279df34d8b15b5.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{401af6d07c9f458ae067.js → 2c69d8bb1c950b95278d.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{22d12c309af9c19a1a48.js → 2c7e5b78d94e5850537b.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{120a5fa9b46084cd0c45.js → 2d376f82cdf020e1fca9.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{8c321c6bc344544ebb51.js → 2d52b137ee64469a46b2.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{5b3f2bad61a0d993bf16.js → 2e63e18df96e5a2461de.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{d4da3abbd3d88cd63cb9.js → 454150571b5b664b576a.js} +1 -1
  31. package/assets/esri/core/workers/chunks/4740d319f233b7f528fe.js +1 -0
  32. package/assets/esri/core/workers/chunks/{78ce6fcb72e97d3dc087.js → 499d594dc0d282dfe777.js} +1 -1
  33. package/assets/esri/core/workers/chunks/49d58bacb5b397246978.js +1 -0
  34. package/assets/esri/core/workers/chunks/4ba4aa6c75e3f8950e65.js +1 -0
  35. package/assets/esri/core/workers/chunks/{61ce373f00a0cad113ed.js → 4f2c29168c9de0b08741.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{5789898948cc0da78b8b.js → 552e5c413828e181f89a.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{5210bde0a05ab172ab28.js → 59f955c7d6b0589e7cc6.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{5fe0bed2a0a9f8eadb28.js → 5a347b1d87eb6f710136.js} +1 -1
  39. package/assets/esri/core/workers/chunks/5b97cdeb5949822fbef3.js +1 -0
  40. package/assets/esri/core/workers/chunks/{178c91fabf4a87bbb50b.js → 620d7cd0b0885122aa0f.js} +1 -1
  41. package/assets/esri/core/workers/chunks/6321680c8070dffa3b6c.js +1 -0
  42. package/assets/esri/core/workers/chunks/6997b4d5bcc9c4755375.js +1 -0
  43. package/assets/esri/core/workers/chunks/{b79cceeee3ed46f218a0.js → 69ab42b965bccc3bad4f.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{bb4c75479cfea67cf8a2.js → 6af14a0217077d9ab47f.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{672542d0435fbfd0647c.js → 6b3d8280a24f7a3aac40.js} +1 -1
  46. package/assets/esri/core/workers/chunks/6e0cfb76f9c2a9ec6530.js +1 -0
  47. package/assets/esri/core/workers/chunks/6e8989d61204b0b5ff52.js +1 -0
  48. package/assets/esri/core/workers/chunks/{3d78e9b3c97c0ce21d16.js → 7017c2e621236c7a7da4.js} +1 -1
  49. package/assets/esri/core/workers/chunks/7407a1e0cef508116a0b.js +1 -0
  50. package/assets/esri/core/workers/chunks/{da188d0e22ba1639928e.js → 75907e5d009b71ce723b.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{1ab4289195f5e46c6fe8.js → 78936c591fd49ff955a9.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{f0b8de5b3cfbe9223df6.js → 796f5265747ce8be910e.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{ac62411b9b4cf85a4722.js → 7a037fbfd91dd22e3bf0.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{50661f65a9c191f528bc.js → 7ee7529fcbd0d169047c.js} +1 -1
  55. package/assets/esri/core/workers/chunks/7f9b0ef7f9b3f3fd3df9.js +1 -0
  56. package/assets/esri/core/workers/chunks/{82a446e8befe9d29c8f0.js → 822a115c7d718e4e3d2b.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{6789ddaa61e6d8f20d04.js → 8eea620f770576d18809.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{10c4f5afe14c0addc418.js → 9332db133a0925d522fe.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{bc87890d00d6dba979b2.js → 99c9f35a29f9f6c9e4ce.js} +1 -1
  60. package/assets/esri/core/workers/chunks/a4b422dbb6d3cb2505e1.js +1 -0
  61. package/assets/esri/core/workers/chunks/{455fbddd814e4681f0c0.js → a5e91cf150f6cf6a5d2a.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{eb4a2dc5efdb873a7f25.js → aef2832902b270f1a594.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{b5fc0a2480a229e8891a.js → b5f291e8ed7f7cac158d.js} +1 -1
  64. package/assets/esri/core/workers/chunks/bc32a4baeb0ecabb68cc.js +1 -0
  65. package/assets/esri/core/workers/chunks/bd05e68b00b9878d0266.js +1 -0
  66. package/assets/esri/core/workers/chunks/{9a43065e51df9c21c9fa.js → bdb4f216ae8881b98604.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{bf9b2aa2e67ca746ec7c.js → c15f0769a64863cccef0.js} +1 -1
  68. package/assets/esri/core/workers/chunks/c6e0ada6f2ad74fddfec.js +1 -0
  69. package/assets/esri/core/workers/chunks/cf09408cb7729126caae.js +1 -0
  70. package/assets/esri/core/workers/chunks/e0565849281ffbe8269e.js +1 -0
  71. package/assets/esri/core/workers/chunks/{4ef60a76eeca20bcafb1.js → e4f1e584f89ffb86206b.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{2889e782ed81bb05b9e5.js → e508f8e707eb3207cfcc.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{2216264b22a605a0f1ce.js → e60684918100666bb892.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{4550b7620932cd6de20e.js → e94448b371cd17d7a472.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{bb8530ade7c40a1ed7c4.js → eb9e913fe0dfcc71cf92.js} +1 -1
  76. package/assets/esri/core/workers/chunks/{6a043be736f096d70070.js → ec2dfd89e4ce6fda4971.js} +1 -1
  77. package/assets/esri/core/workers/chunks/ede1d1cc2f315a34f4ca.js +1 -0
  78. package/assets/esri/core/workers/chunks/{a5bd7e5d71cffde68f89.js → ee89564d11c077169b31.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{b3cc7f6d953bfbc3a70d.js → f62e37863a549f72093c.js} +1 -1
  80. package/assets/esri/core/workers/chunks/fc98b8351be567d3eb62.js +1 -0
  81. package/assets/esri/core/workers/chunks/{554f389f99db430b309c.js → ff961bb6d29ab3fe129d.js} +1 -1
  82. package/assets/esri/themes/base/widgets/_Attribution.scss +4 -2
  83. package/assets/esri/themes/dark/main.css +1 -1
  84. package/assets/esri/themes/light/main.css +1 -1
  85. package/assets/esri/themes/light/view.css +1 -1
  86. package/config.js +1 -1
  87. package/core/has.js +1 -1
  88. package/core/types.d.ts +5 -0
  89. package/core/workers/workerFactory.js +1 -1
  90. package/editing/sharedTemplates/executor/builders/radialLines.js +1 -1
  91. package/editing/sharedTemplates/executor/builders/support/shapeUtils.js +1 -1
  92. package/geometry/projectionUtils.js +1 -1
  93. package/geometry/support/curves/curveUtils.js +1 -1
  94. package/kernel.js +1 -1
  95. package/layers/graphics/data/QueryEngineResult.js +1 -1
  96. package/layers/graphics/data/SnappingCandidate.js +1 -1
  97. package/layers/support/ControlPointsGeoreference.d.ts +2 -2
  98. package/layers/support/ControlPointsGeoreference.js +1 -1
  99. package/layers/support/CornersGeoreference.d.ts +2 -2
  100. package/layers/support/CornersGeoreference.js +1 -1
  101. package/layers/support/ExtentAndRotationGeoreference.d.ts +2 -2
  102. package/layers/support/ExtentAndRotationGeoreference.js +1 -1
  103. package/layers/support/GeoreferenceBaseMixin.js +2 -0
  104. package/layers/support/mediaUtils.js +1 -1
  105. package/layers/support/relativeTimeQueryUtils.js +1 -1
  106. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  107. package/package.json +1 -1
  108. package/renderers/DotDensityRenderer.d.ts +43 -0
  109. package/renderers/DotDensityRenderer.js +1 -1
  110. package/rest/featureService/FeatureService.js +1 -1
  111. package/rest/print.js +1 -1
  112. package/rest/query/operations/pbfFlatFeatureSet.js +1 -1
  113. package/support/revision.js +1 -1
  114. package/symbols/ExtrudeSymbol3DLayer.d.ts +20 -10
  115. package/symbols/FillSymbol3DLayer.d.ts +36 -16
  116. package/symbols/ObjectSymbol3DLayer.d.ts +28 -6
  117. package/symbols/PathSymbol3DLayer.d.ts +18 -6
  118. package/symbols/cim/CIMSymbolHelper.js +1 -1
  119. package/symbols/cim/rasterizingUtils.js +1 -1
  120. package/symbols/support/Symbol3DEmissive.d.ts +1 -1
  121. package/views/2d/interactive/SnappingVisualizer2D.js +1 -1
  122. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  123. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  124. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  125. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  126. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  127. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  128. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  129. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  130. package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
  131. package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +1 -1
  132. package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
  133. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  134. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  135. package/views/interactive/keybindings.js +1 -1
  136. package/views/interactive/snapping/candidates/EdgeSnappingCandidate.js +1 -1
  137. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  138. package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
  139. package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
  140. package/views/interactive/snapping/featureSources/snappingCandidateElevationFilter.js +1 -1
  141. package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
  142. package/views/layers/FeatureLikeLayerView.js +1 -1
  143. package/views/layers/support/WhereClauseVisitor.js +1 -1
  144. package/webscene/Glow.d.ts +5 -0
  145. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  146. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  147. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +1 -1
  148. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  149. package/widgets/BatchAttributeForm/inputs/TextElementInput.d.ts +2 -11
  150. package/widgets/BatchAttributeForm/inputs/TextElementInput.js +1 -1
  151. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  152. package/widgets/BatchAttributeForm/inputs/support/textElementInputUtils.js +2 -0
  153. package/widgets/BatchAttributeForm/templates/TextElementTemplate.js +1 -1
  154. package/widgets/BatchAttributeForm/templates/support/constants.js +2 -0
  155. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  156. package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
  157. package/widgets/BatchAttributeForm/templates/support/textElementTemplateUtils.js +2 -0
  158. package/widgets/Editor/components/Settings.js +1 -1
  159. package/widgets/Features/FeaturesViewModel.js +1 -1
  160. package/widgets/Print/PrintViewModel.js +1 -1
  161. package/widgets/Sketch.js +1 -1
  162. package/widgets/TimeSlider.d.ts +4 -4
  163. package/widgets/support/SketchTooltipControls.js +1 -1
  164. package/assets/esri/core/workers/chunks/0c8a676599821b9871c2.js +0 -1
  165. package/assets/esri/core/workers/chunks/2b7615cccbaeda1649f3.js +0 -1
  166. package/assets/esri/core/workers/chunks/2f0ea91afc9aa8ee9cad.js +0 -1
  167. package/assets/esri/core/workers/chunks/3a850b5e847b6b0ea53f.js +0 -1
  168. package/assets/esri/core/workers/chunks/449cf6ae6b6e6c2795e5.js +0 -1
  169. package/assets/esri/core/workers/chunks/4dcd5d5ea5875a08a7c7.js +0 -1
  170. package/assets/esri/core/workers/chunks/5058715f32ff026053a9.js +0 -1
  171. package/assets/esri/core/workers/chunks/529dbf16ffbbd39f3fa2.js +0 -1
  172. package/assets/esri/core/workers/chunks/58cf3d35771b87bd74e5.js +0 -1
  173. package/assets/esri/core/workers/chunks/652bb1b53782cdd3103c.js +0 -1
  174. package/assets/esri/core/workers/chunks/6acab23acf3b044f5215.js +0 -1
  175. package/assets/esri/core/workers/chunks/6c2a7bac3f8e32c83292.js +0 -1
  176. package/assets/esri/core/workers/chunks/6d26e5368e8952003669.js +0 -1
  177. package/assets/esri/core/workers/chunks/7cb6ccee9bcef449caea.js +0 -1
  178. package/assets/esri/core/workers/chunks/879e8439a513cb333b61.js +0 -1
  179. package/assets/esri/core/workers/chunks/a027da22acdaa6d6baa3.js +0 -1
  180. package/assets/esri/core/workers/chunks/a6006718fe22d9f2fa87.js +0 -1
  181. package/assets/esri/core/workers/chunks/b60337c471e2b855d02a.js +0 -1
  182. package/assets/esri/core/workers/chunks/bd1bbf1820e12d7a27f6.js +0 -1
  183. package/assets/esri/core/workers/chunks/c9067667290e93407dd7.js +0 -1
  184. package/assets/esri/core/workers/chunks/e59c5bcf91984aa5be6d.js +0 -1
  185. package/assets/esri/core/workers/chunks/e71d08c6f545c2c70174.js +0 -1
  186. package/assets/esri/core/workers/chunks/e8a7ff6210cd11d3a828.js +0 -1
  187. package/assets/esri/core/workers/chunks/f347dee99faa9ee5eef1.js +0 -1
  188. package/layers/support/GeoreferenceBase.d.ts +0 -4
  189. package/layers/support/GeoreferenceBase.js +0 -2
  190. package/widgets/BatchAttributeForm/inputs/support/textInputElementUtils.js +0 -2
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.122";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.123";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/core/has.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("workers-pool-size",8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-allow-editable",!1),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("featurelayer-relative-time-queries-enabled",!0),has.add("featurelayer-relative-time-queries-bin-window-public",1),has.add("featurelayer-relative-time-queries-bin-window-private",60),has.add("parquetlayer-full-query-feature-count",2e4),has.add("parquetlayer-hittest-max-feature-count",1),has.add("parquetlayer-persistence-enabled",!1),has.add("parquetlayer-cache-enabled",!0),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",50),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",6),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:oit-ground",!0),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
2
+ const e=globalThis,a={...e.esriConfig?.has};function has(d){return"function"==typeof a[d]?a[d]=a[d](e):a[d]}has.add=(e,d,r,t)=>{(t||void 0===a[e])&&(a[e]=d),r&&has(e)},has.cache=a,has.add("big-integer-warning-enabled",!0),has.add("esri-deprecation-warnings",!0),has.add("esri-tests-disable-screenshots",!1),has.add("esri-tests-use-full-window",!1),has.add("esri-tests-post-to-influx",!0),has.add("esri-cim-animations-enable-status","enabled"),has.add("esri-cim-animations-spotlight",!1),has.add("esri-cim-animations-freeze-time",!1),(()=>{has.add("host-webworker",void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope);const a="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(has.add("host-browser",a),has.add("host-node",!("object"!=typeof e.process||!e.process.versions?.node||!e.process.versions.v8)),has.add("dom",a),has("host-browser")){const e=navigator,a=e.userAgent,d=e.appVersion,r=parseFloat(d);if(has.add("wp",parseFloat(a.split("Windows Phone")[1])||void 0),has.add("msapp",parseFloat(a.split("MSAppHost/")[1])||void 0),has.add("khtml",d.includes("Konqueror")?r:void 0),has.add("edge",parseFloat(a.split("Edge/")[1])||void 0),has.add("opr",parseFloat(a.split("OPR/")[1])||void 0),has.add("webkit",!has("wp")&&!has("edge")&&parseFloat(a.split("WebKit/")[1])||void 0),has.add("chrome",!has("edge")&&!has("opr")&&parseFloat(a.split("Chrome/")[1])||void 0),has.add("android",!has("wp")&&parseFloat(a.split("Android ")[1])||void 0),has.add("safari",!d.includes("Safari")||has("wp")||has("chrome")||has("android")||has("edge")||has("opr")?void 0:parseFloat(d.split("Version/")[1])),has.add("mac",d.includes("Macintosh")),!has("wp")&&/(iPhone|iPod|iPad)/.test(a)){const e=RegExp.$1.replace(/P/,"p"),d=/OS ([\d_]+)/.test(a)?RegExp.$1:"1",r=parseFloat(d.replace(/_/,".").replaceAll("_",""));has.add(e,r),has.add("ios",r)}has("webkit")||(!a.includes("Gecko")||has("wp")||has("khtml")||has("edge")||has.add("mozilla",r),has("mozilla")&&has.add("ff",parseFloat(a.split("Firefox/")[1]||a.split("Minefield/")[1])||void 0))}})(),(()=>{if(e.navigator){const e=navigator.userAgent,a=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),d=/iPhone/i.test(e);a&&has.add("esri-mobile",a),d&&has.add("esri-iPhone",d),has.add("esri-geolocation",!!navigator.geolocation)}has.add("esri-wasm","WebAssembly"in e),has.add("esri-performance-mode-frames-between-render",20),has.add("esri-force-performance-mode",!1),has.add("esri-shared-array-buffer",()=>{const a="SharedArrayBuffer"in e,d=!1===e.crossOriginIsolated;return a&&!d}),has.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),has.add("esri-atomics","Atomics"in e),has.add("esri-workers","Worker"in e),has.add("web-feat:cache","caches"in e),has.add("esri-workers-arraybuffer-transfer",!has("safari")||Number(has("safari"))>=12),has.add("workers-pool-size",8),has.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),has.add("featurelayer-simplify-payload-size-factors",[1,1,4]),has.add("featurelayer-animation-enabled",!0),has.add("featurelayer-snapshot-enabled",!0),has.add("featurelayer-snapshot-initial-tolerance",0),has.add("featurelayer-snapshot-point-min-threshold",8e4),has.add("featurelayer-snapshot-point-max-threshold",4e5),has.add("featurelayer-snapshot-multipoint-min-threshold",2e4),has.add("featurelayer-snapshot-multipoint-max-threshold",1e5),has.add("featurelayer-snapshot-polygon-min-threshold",2e3),has.add("featurelayer-snapshot-polygon-max-threshold",2e3),has.add("featurelayer-snapshot-polyline-min-threshold",2e3),has.add("featurelayer-snapshot-polyline-max-threshold",2e3),has.add("featurelayer-snapshot-max-vertex-count",25e4),has.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),has.add("featurelayer-snapshot-concurrency",4),has.add("featurelayer-snapshot-allow-editable",!1),has.add("featurelayer-snapshot-coverage",.1),has.add("featurelayer-query-max-depth",4),has.add("featurelayer-query-max-page-size",8e3),has.add("featurelayer-query-pausing-enabled",!1),has.add("featurelayer-query-tile-concurrency",4),has.add("featurelayer-query-tile-max-features",6e5),has.add("featurelayer-advanced-symbols",!1),has.add("featurelayer-pbf",!0),has.add("featurelayer-pbf-statistics",!1),has.add("feature-layers-workers",!0),has.add("feature-polyline-generalization-factor",1),has.add("featurelayer-relative-time-queries-enabled",!0),has.add("featurelayer-relative-time-queries-bin-window-public",1),has.add("featurelayer-relative-time-queries-bin-window-private",60),has.add("parquetlayer-full-query-feature-count",2e4),has.add("parquetlayer-hittest-max-feature-count",1),has.add("parquetlayer-persistence-enabled",!1),has.add("parquetlayer-cache-enabled",!0),has.add("mapview-transitions-duration",200),has.add("mapview-essential-goto-duration",200),has.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),has.add("mapserver-pbf-version-support",10.81),has.add("mapservice-popup-identify-max-tolerance",20),has.add("request-queue-concurrency-global",50),has.add("request-queue-concurrency-hosted",16),has.add("request-queue-concurrency-non-hosted",6),has.add("curve-densification-coarse-segments",128),has.add("curve-densification-max-segments",2e3),has.add("curve-densification-min-segments",3),has.add("curve-densification-pixel-deviation",.5),has.add("view-readyState-waiting-delay",1e3),has.add("gradient-depth-bias",.01),has.add("gradient-depth-epsilon",1e-8),has.add("enable-feature:esri-compress-textures",!0),has.add("enable-feature:basemap-groundlayers",!0),has.add("enable-feature:oit-ground",!0),!has("host-webworker")&&has("host-browser")&&(has.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),has.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();export{has as default};
package/core/types.d.ts CHANGED
@@ -23,6 +23,11 @@ export interface ScreenPoint {
23
23
  /**
24
24
  * A custom log interceptor function.
25
25
  *
26
+ * > [!WARNING]
27
+ * > In 5.x, the `module` parameter uses `esri.`-style module identifiers (for example `esri.layers.FeatureLayer`) even when using the ESM build.
28
+ * >
29
+ * > In 6.0, this will change to `@arcgis/core/`-style module identifiers (for example `@arcgis/core/layers/FeatureLayer`).
30
+ *
26
31
  * @param level - The level of the message.
27
32
  * @param module - The module from which the log message originated.
28
33
  * @param args - Arguments of any type to be logged.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{getAssetUrl as e}from"../../assets.js";import r from"../../config.js";import{getLocale as t}from"../../intl.js";import{fullVersion as o}from"../../kernel.js";import has from"../has.js";import s from"../Logger.js";import{makeAbsolute as a}from"../urlUtils.js";import{loaderConfig as n}from"./loaderConfig.js";import{receiveMessage as i,MessageType as l}from"./utils.js";import f from"./WorkerFallback.js";import{commitHash as u,buildDate as c}from"../../support/revision.js";const d=()=>s.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:m}=l,p='"use strict";let globalId=0;const outgoing=new Map,configuration={CONFIGURATION};self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}self.invokeStaticMessage=(e,o,r)=>{const t=r&&r.signal,n=globalId++;let s=null;return new Promise((r,i)=>{if(t){if(t.aborted)return i(createAbortError());s=()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))},t.addEventListener("abort",s)}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}).finally(()=>{t&&t.removeEventListener("abort",s)})};let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://esriurl.com/using-local-assets.\nModules version: ${r}\nAssets version: ${n??s}\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let t;function n(e){const o=t.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],e=>{t=e.default||e,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(e=>e||new Promise(e=>{require([o.modulePath],e)})).then(n)}):"System"in self&&"function"==typeof System.import?System.import(workerPath).then(e=>(t=e.default,checkWorkerRevision(t),t.loadWorker(o.modulePath))).then(e=>e||System.import(o.modulePath)).then(n):esriConfig.workers.useDynamicImport?import(workerPath).then(e=>{t=e.default||e,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(e=>e||import(o.modulePath)).then(n)}):(self.RemoteClient||importScripts(workerPath),t=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(n));break;case 3:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let g,y;const h="Failed to create Worker. Fallback to execute module in main thread";async function k(){if(!has("esri-workers"))return w(new f);if(!g&&!y)try{const e=p.split("{CONFIGURATION}").join(b());g=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(r){y=r||{}}let e;if(g)try{e=new Worker(g,{name:"esri-worker-"+v++})}catch(r){d().warn(h,y),e=new f}else d().warn(h,y),e=new f;return w(e)}async function w(e){return new Promise(r=>{function t(s){const a=i(s);a&&a.type===m&&(e.removeEventListener("message",t),e.removeEventListener("error",o),r(e))}function o(r){r.preventDefault(),e.removeEventListener("message",t),e.removeEventListener("error",o),d().warn("Failed to create Worker. Fallback to execute module in main thread",r),(e=new f).addEventListener("message",t),e.addEventListener("error",o)}e.addEventListener("message",t),e.addEventListener("error",o)})}function b(){let s;if(null!=r.default){const e={...r};delete e.default,s=JSON.parse(JSON.stringify(e))}else s=JSON.parse(JSON.stringify(r));s.assetsPath=a(s.assetsPath),s.defaultAssetsPath=s.defaultAssetsPath?a(s.defaultAssetsPath):void 0,s.request.interceptors=[],s.log.interceptors=[],s.locale=t(),s.has={"esri-csp-restrictions":has("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":has("esri-2d-update-debug"),"esri-2d-log-updating":has("esri-2d-log-updating"),"featurelayer-pbf":has("featurelayer-pbf"),"featurelayer-simplify-thresholds":has("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":has("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":has("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":has("featurelayer-query-max-depth"),"featurelayer-query-tile-max-features":has("featurelayer-query-tile-max-features"),"featurelayer-query-tile-concurrency":has("featurelayer-query-tile-concurrency"),"featurelayer-query-pausing-enabled":has("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-concurrency":has("featurelayer-snapshot-concurrency"),"featurelayer-snapshot-enabled":has("featurelayer-snapshot-enabled"),"parquetlayer-full-query-feature-count":has("parquetlayer-full-query-feature-count"),"parquetlayer-cache-enabled":has("parquetlayer-cache-enabled"),"esri-atomics":has("esri-atomics"),"esri-shared-array-buffer":has("esri-shared-array-buffer"),"esri-tiles-debug":has("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":has("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":has("feature-polyline-generalization-factor"),"host-webworker":1},s.workers.loaderUrl&&(s.workers.loaderUrl=a(s.workers.loaderUrl)),s.workers.workerPath?s.workers.workerPath=a(s.workers.workerPath):s.workers.workerPath=a(e("esri/core/workers/RemoteClient.js")),s.workers.useDynamicImport=has("esri-esbuild-build");const i=r.workers.loaderConfig,l=n({baseUrl:i?.baseUrl,locale:t(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...i?.has},map:{...i?.map},paths:{...i?.paths},packages:i?.packages||[]}),f={buildDate:c,fullVersion:o,revision:u};return JSON.stringify({esriConfig:s,loaderConfig:l,kernelInfo:f})}let v=0;export{k as createWorker};
2
+ import{getAssetUrl as e}from"../../assets.js";import r from"../../config.js";import{getLocale as t}from"../../intl.js";import{fullVersion as o}from"../../kernel.js";import has from"../has.js";import s from"../Logger.js";import{makeAbsolute as a}from"../urlUtils.js";import{loaderConfig as n}from"./loaderConfig.js";import{receiveMessage as i,MessageType as l}from"./utils.js";import f from"./WorkerFallback.js";import{commitHash as u,buildDate as c}from"../../support/revision.js";const d=()=>s.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:m}=l,p='"use strict";let globalId=0;const outgoing=new Map,configuration={CONFIGURATION};self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}self.invokeStaticMessage=(e,o,r)=>{const t=r&&r.signal,n=globalId++;let s=null;return new Promise((r,i)=>{if(t){if(t.aborted)return i(createAbortError());s=()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))},t.addEventListener("abort",s)}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}).finally(()=>{t&&t.removeEventListener("abort",s)})};let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://esriurl.com/using-local-assets.\nModules version: ${r}\nAssets version: ${n??s}\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let t;function n(e){const o=t.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],e=>{t=e.default||e,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(e=>e||new Promise(e=>{require([o.modulePath],e)})).then(n)}):"System"in self&&"function"==typeof System.import?System.import(workerPath).then(e=>(t=e.default,checkWorkerRevision(t),t.loadWorker(o.modulePath))).then(e=>e||System.import(o.modulePath)).then(n):esriConfig.workers.useDynamicImport?import(workerPath).then(e=>{t=e.default||e,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(e=>e||import(o.modulePath)).then(n)}):(self.RemoteClient||importScripts(workerPath),t=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(t),t.loadWorker(o.modulePath).then(n));break;case 3:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let g,y;const h="Failed to create Worker. Fallback to execute module in main thread";async function k(){if(!has("esri-workers"))return w(new f);if(!g&&!y)try{const e=p.split("{CONFIGURATION}").join(b());g=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(r){y=r||{}}let e;if(g)try{e=new Worker(g,{name:"esri-worker-"+v++})}catch(r){d().warn(h,y),e=new f}else d().warn(h,y),e=new f;return w(e)}async function w(e){return new Promise(r=>{function t(s){const a=i(s);a&&a.type===m&&(e.removeEventListener("message",t),e.removeEventListener("error",o),r(e))}function o(r){r.preventDefault(),e.removeEventListener("message",t),e.removeEventListener("error",o),d().warn("Failed to create Worker. Fallback to execute module in main thread",r),(e=new f).addEventListener("message",t),e.addEventListener("error",o)}e.addEventListener("message",t),e.addEventListener("error",o)})}function b(){let s;if(null!=r.default){const e={...r};delete e.default,s=JSON.parse(JSON.stringify(e))}else s=JSON.parse(JSON.stringify(r));s.assetsPath=a(s.assetsPath),s.defaultAssetsPath=s.defaultAssetsPath?a(s.defaultAssetsPath):void 0,s.request.interceptors=[],s.log.interceptors=[],s.locale=t(),s.has={"esri-csp-restrictions":has("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":has("esri-2d-update-debug"),"esri-2d-log-updating":has("esri-2d-log-updating"),"featurelayer-pbf":has("featurelayer-pbf"),"featurelayer-simplify-thresholds":has("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":has("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":has("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":has("featurelayer-query-max-depth"),"featurelayer-query-max-page-size":has("featurelayer-query-max-page-size"),"featurelayer-query-tile-max-features":has("featurelayer-query-tile-max-features"),"featurelayer-query-tile-concurrency":has("featurelayer-query-tile-concurrency"),"featurelayer-query-pausing-enabled":has("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-concurrency":has("featurelayer-snapshot-concurrency"),"featurelayer-snapshot-enabled":has("featurelayer-snapshot-enabled"),"parquetlayer-full-query-feature-count":has("parquetlayer-full-query-feature-count"),"parquetlayer-cache-enabled":has("parquetlayer-cache-enabled"),"esri-atomics":has("esri-atomics"),"esri-shared-array-buffer":has("esri-shared-array-buffer"),"esri-tiles-debug":has("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":has("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":has("feature-polyline-generalization-factor"),"host-webworker":1},s.workers.loaderUrl&&(s.workers.loaderUrl=a(s.workers.loaderUrl)),s.workers.workerPath?s.workers.workerPath=a(s.workers.workerPath):s.workers.workerPath=a(e("esri/core/workers/RemoteClient.js")),s.workers.useDynamicImport=has("esri-esbuild-build");const i=r.workers.loaderConfig,l=n({baseUrl:i?.baseUrl,locale:t(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...i?.has},map:{...i?.map},paths:{...i?.paths},packages:i?.packages||[]}),f={buildDate:c,fullVersion:o,revision:u};return JSON.stringify({esriConfig:s,loaderConfig:l,kernelInfo:f})}let v=0;export{k as createWorker};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- function t(t){throw new Error("Method not yet implemented.")}const e=!1;export{t as execute,e as isAsync};
2
+ import{makeFeatureFromGroupPart as t}from"./support/builderUtils.js";import{convertRadialToPolylines as e}from"./support/shapeUtils.js";import{isRadial as s,maxDigitizingDisplayEdits as o}from"../support/executorUtils.js";function i({templatePart:i,shape:r,edits:p,relationships:a,mode:m,associationFeaturesByTemplate:n}){if(!s(r))return;const l=e(r);for(const e of l)if(t({templatePart:i,shape:e,edits:p,relationships:a,mode:m,associationFeaturesByTemplate:n}),"digitizing"===m&&p.length>o)break}const r=!1;export{i as execute,r as isAsync};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{equals as e}from"../../../../../core/arrayUtils.js";import{fromArray as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getHeightUnitCorrectionFactor as s,interpolateM as n}from"../../../../geometry/coordUtils.js";import{segmentLength3d as a,distanceAlongLineSegmentWithZ as r,distanceAlongLineSegment as o}from"../../../../geometry/lineUtils.js";import c from"../../../../../geometry/Point.js";import h from"../../../../../geometry/Polyline.js";import{getLength as i}from"../../../../../geometry/support/coordsUtils.js";import{getPaths as f,getEndpoint as l}from"../../../../../geometry/support/curves/curveUtils.js";function p(e){let t=0;const n=s(e.spatialReference);for(let s=0;s<e.paths.length;s++){const r=e.paths[s].length;for(let o=0;o<r;o++)o>0&&(t+=e.hasZ?a(e.paths[s][o-1],e.paths[s][o],n):i(e.paths[s][o-1],e.paths[s][o]))}return t}function u(e){const t=e.geometry.clone();return t.paths.map(s=>new h({spatialReference:e.geometry.spatialReference,paths:[s],hasZ:t.hasZ,hasM:t.hasM}))}function m(e){const t=[];for(const s of f(e))for(let n=1;n<s.length;n++){const a=[[l(s[n-1]).slice(),l(s[n]).slice()]];t.push(new h({paths:a,spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM}))}return t}function y(e,t,s){const n=t[0],a=t[1],r=i(n,a),o=e.x+s*((t[1][0]-t[0][0])/r),h=e.y+s*((t[1][1]-t[0][1])/r),f={};return e.hasM&&(f.m=e.m),new c({x:o,y:h,spatialReference:e.spatialReference,...f})}function R(e,t,s,n){const r=t[0],o=t[1],h=a(r,o,n),i=e.x+s*((t[1][0]-t[0][0])/h),f=e.y+s*((t[1][1]-t[0][1])/h),l=e.z+s*((t[1][2]-t[0][2])/h),p={};return e.hasM&&(p.m=e.m),new c({x:i,y:f,z:l,spatialReference:e.spatialReference,...p})}function g(e,t,s){const n=t[0],a=t[1],r=[a[0]-n[0],a[1]-n[1]],o=Math.sqrt(r[0]**2+r[1]**2),c=[r[0]/o,r[1]/o];return e.x+=s*c[0],e.y+=s*c[1],e}function M(e,t,s){let a=0,r=null;if(t<=0){const n=[e.paths[0][0],e.paths[0][1]];let a=w(e,0,0);return a=y(a,n,t),g(a,n,s)}const h=e.hasM?e.hasZ?3:2:-1;for(const m of e.paths)for(let f=0;f<m.length-1;f++){const l=i(m[f],m[f+1]),p=a+l;if(p===t)return r=new c({x:m[f+1][0],y:m[f+1][1],...e.hasM?{m:m[f+1][h]}:{},spatialReference:e.spatialReference}),0===s?r:g(r,[m[f],m[f+1]],s);if(p>t){const i=o(m[f],m[f+1],t-a);return r=new c({x:i[0],y:i[1],...h>-1?{m:n(m[f][h],m[f+1][h],l,t-a)??void 0}:{},spatialReference:e.spatialReference}),0===s?r:g(r,[m[f],m[f+1]],s)}a+=l}if(0===a)return null;const f=e.paths.length-1,l=e.paths[f].length-1,p=[e.paths[f][l-1],e.paths[f][l]];let u=w(e,f,l);return u=y(u,p,t-a),g(u,p,s)}function Z(e,s,o,h){let i=0;if(s<=0){const t=[e.paths[0][0],e.paths[0][1]];let n=w(e,0,0);return n=R(n,t,s,h),g(n,t,o)}const f=e.hasM?e.hasZ?3:2:-1;for(const y of e.paths)for(let l=0;l<y.length-1;l++){const p=a(y[l],y[l+1],h),u=i+p;if(u===s){const t=new c({x:y[l+1][0],y:y[l+1][1],z:y[l+1][2],...e.hasM?{m:y[l+1][f]}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?t:g(t,[y[l],y[l+1]],o)}if(u>s){const a=r(t(y[l]),t(y[l+1]),s-i,h),u=new c({x:a[0],y:a[1],z:a[2],...f>-1?{m:n(y[l][f],y[l+1][f],p,s-i)}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?u:g(u,[y[l],y[l+1]],o)}i+=p}if(0===i)return null;const l=e.paths.length-1,p=e.paths[l].length-1,u=[e.paths[l][p-1],e.paths[l][p]];let m=w(e,l,p);return m=R(m,u,s-i,h),g(m,u,o)}function x(e,t,s){const n=l(f(e)[t][s]);return new c({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function w(e,t,s){const n=l(f(e)[t][s]);return new c({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function j(t){return e(l(t.at(0)),l(t.at(-1)))}export{p as computedTotalLength,u as convertRadialToPolylines,m as convertToTwoPoint,g as offsetPointFromSegment,M as pointAlongLineAndOffset,Z as pointAlongLineWithZAndOffset,x as pointFromPolygonVertex,w as pointFromPolylineVertex,j as sameStartEndPoint};
2
+ import{equals as e}from"../../../../../core/arrayUtils.js";import{fromArray as t}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getHeightUnitCorrectionFactor as s,interpolateM as n}from"../../../../geometry/coordUtils.js";import{segmentLength3d as a,distanceAlongLineSegmentWithZ as r,distanceAlongLineSegment as o}from"../../../../geometry/lineUtils.js";import h from"../../../../../geometry/Point.js";import c from"../../../../../geometry/Polyline.js";import{getLength as i}from"../../../../../geometry/support/coordsUtils.js";import{getPaths as f,getEndpoint as l}from"../../../../../geometry/support/curves/curveUtils.js";function p(e){let t=0;const n=s(e.spatialReference);for(let s=0;s<e.paths.length;s++){const r=e.paths[s].length;for(let o=0;o<r;o++)o>0&&(t+=e.hasZ?a(e.paths[s][o-1],e.paths[s][o],n):i(e.paths[s][o-1],e.paths[s][o]))}return t}function u(e){const t=e.geometry;return t.paths.map(s=>new c({spatialReference:e.geometry.spatialReference,paths:[s],hasZ:t.hasZ,hasM:t.hasM}))}function m(e){const t=[];for(const s of f(e))for(let n=1;n<s.length;n++){const a=[[l(s[n-1]).slice(),l(s[n]).slice()]];t.push(new c({paths:a,spatialReference:e.spatialReference,hasZ:e.hasZ,hasM:e.hasM}))}return t}function y(e,t,s){const n=t[0],a=t[1],r=i(n,a),o=e.x+s*((t[1][0]-t[0][0])/r),c=e.y+s*((t[1][1]-t[0][1])/r),f={};return e.hasM&&(f.m=e.m),new h({x:o,y:c,spatialReference:e.spatialReference,...f})}function R(e,t,s,n){const r=t[0],o=t[1],c=a(r,o,n),i=e.x+s*((t[1][0]-t[0][0])/c),f=e.y+s*((t[1][1]-t[0][1])/c),l=e.z+s*((t[1][2]-t[0][2])/c),p={};return e.hasM&&(p.m=e.m),new h({x:i,y:f,z:l,spatialReference:e.spatialReference,...p})}function g(e,t,s){const n=t[0],a=t[1],r=[a[0]-n[0],a[1]-n[1]],o=Math.sqrt(r[0]**2+r[1]**2),h=[r[0]/o,r[1]/o];return e.x+=s*h[0],e.y+=s*h[1],e}function M(e,t,s){let a=0,r=null;if(t<=0){const n=[e.paths[0][0],e.paths[0][1]];let a=w(e,0,0);return a=y(a,n,t),g(a,n,s)}const c=e.hasM?e.hasZ?3:2:-1;for(const m of e.paths)for(let f=0;f<m.length-1;f++){const l=i(m[f],m[f+1]),p=a+l;if(p===t)return r=new h({x:m[f+1][0],y:m[f+1][1],...e.hasM?{m:m[f+1][c]}:{},spatialReference:e.spatialReference}),0===s?r:g(r,[m[f],m[f+1]],s);if(p>t){const i=o(m[f],m[f+1],t-a);return r=new h({x:i[0],y:i[1],...c>-1?{m:n(m[f][c],m[f+1][c],l,t-a)??void 0}:{},spatialReference:e.spatialReference}),0===s?r:g(r,[m[f],m[f+1]],s)}a+=l}if(0===a)return null;const f=e.paths.length-1,l=e.paths[f].length-1,p=[e.paths[f][l-1],e.paths[f][l]];let u=w(e,f,l);return u=y(u,p,t-a),g(u,p,s)}function Z(e,s,o,c){let i=0;if(s<=0){const t=[e.paths[0][0],e.paths[0][1]];let n=w(e,0,0);return n=R(n,t,s,c),g(n,t,o)}const f=e.hasM?e.hasZ?3:2:-1;for(const y of e.paths)for(let l=0;l<y.length-1;l++){const p=a(y[l],y[l+1],c),u=i+p;if(u===s){const t=new h({x:y[l+1][0],y:y[l+1][1],z:y[l+1][2],...e.hasM?{m:y[l+1][f]}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?t:g(t,[y[l],y[l+1]],o)}if(u>s){const a=r(t(y[l]),t(y[l+1]),s-i,c),u=new h({x:a[0],y:a[1],z:a[2],...f>-1?{m:n(y[l][f],y[l+1][f],p,s-i)}:{},hasZ:!0,spatialReference:e.spatialReference});return 0===o?u:g(u,[y[l],y[l+1]],o)}i+=p}if(0===i)return null;const l=e.paths.length-1,p=e.paths[l].length-1,u=[e.paths[l][p-1],e.paths[l][p]];let m=w(e,l,p);return m=R(m,u,s-i,c),g(m,u,o)}function x(e,t,s){const n=l(f(e)[t][s]);return new h({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function w(e,t,s){const n=l(f(e)[t][s]);return new h({spatialReference:e.spatialReference,x:n[0],y:n[1],hasZ:e.hasZ,hasM:e.hasM,z:e.hasZ?n[2]:void 0,m:e.hasM?e.hasZ?n[3]:n[2]:void 0})}function j(t){return e(l(t.at(0)),l(t.at(-1)))}export{p as computedTotalLength,u as convertRadialToPolylines,m as convertToTwoPoint,g as offsetPointFromSegment,M as pointAlongLineAndOffset,Z as pointAlongLineWithZAndOffset,x as pointFromPolygonVertex,w as pointFromPolylineVertex,j as sameStartEndPoint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import n from"../core/Error.js";import{throwIfAborted as e,waitTick as r}from"../core/promiseUtils.js";import{trackAccess as t}from"../core/accessorSupport/tracking.js";import{SimpleObservable as o}from"../core/accessorSupport/tracking/SimpleObservable.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{assertNotMeshes as s,assertNotMesh as a}from"./asserts.js";import{isSphericalECEF as l,isSphericalPCPF as u}from"./ellipsoidUtils.js";import f from"./Extent.js";import c from"./Geometry.js";import p from"./Multipoint.js";import m from"./Point.js";import g from"./Polygon.js";import h from"./Polyline.js";import d from"./SpatialReference.js";import{WGS84ECEFSpatialReference as j}from"./spatialReferenceEllipsoidUtils.js";import R from"./operators/support/GeographicTransformation.js";import{projectBuffer as y}from"./projection/projectBuffer.js";import{getProjector as x}from"./projection/projectors.js";import{projectXYZToVector as w}from"./projection/projectXYZToVector.js";import{equals as S,isValid as v,isWGS84 as M,isWebMercator as z,isCGCS2000 as T}from"./support/spatialReferenceUtils.js";import{isCurvedGeometry as A}from"./support/curves/curveUtils.js";let Z=null,k=null,b=null,P=null,E={};const G=new o;function O(){return!!(k?.isLoaded()&&b?.isLoaded()&&P?.isLoaded())}function U(){return!!O()||(t(G),W(),!1)}function C(n,e){return!n||!e||(K(n,e)||U())}function D(n,e){return!K(n,e)&&!O()}async function W(n){null==Z&&(Z=Promise.all([import("./operators/projectOperator.js").then(n=>(k=n,k.load())),import("./operators/json/projectOperator.js").then(n=>(b=n,b.load())),import("./operators/support/geographicTransformationUtils.js").then(n=>(P=n,P.load()))])),await Z,e(n),G.notify()}function I(n,e,r){return Array.isArray(n)?0===n.length?[]:(s(n),L(n,n[0].spatialReference,e,r)):(a(n),L([n],n.spatialReference,e,r)[0])}function L(n,e,r,t){if(null==e||null==r)return n;if(!n.some(n=>A(n))&&K(e,r,t))return n.map(n=>$(n,e,r));if(null==t?.geographicTransformation&&l(e)){return L(n.map(n=>$(n,e,d.WGS84)),d.WGS84,r,{zConversionDisabled:t?.zConversionDisabled})}if(null==t?.geographicTransformation&&l(r)){return L(n,e,d.WGS84).map(n=>$(n,d.WGS84,r))}if(!O())throw new q;if(!t?.geographicTransformation)if(t?.extendedParams)t={...t,geographicTransformation:P.getTransformation(e,r,t.areaOfInterestExtent)||new R};else if(!t?.areaOfInterestExtent){const n=B(e,r);let o=E[n];o||(o=P.getTransformation(e,r)||new R,E[n]=o),t={geographicTransformation:o,zConversionDisabled:t?.zConversionDisabled}}return n[0].spatialReference||(n[0].spatialReference=e),n[0]instanceof c?k.executeMany(n,r,t):b.executeMany(n,r,t)}function B(n,e){return[n.wkid?.toString()??"-1",n.wkt?.toString()??"",n.wkt2?.toString()??"",e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??""].join()}function V(n,e,r){try{return I(n,e,r)}catch(t){return null}}function X(n,e){const r=Y([n],e);return null!=r.pending?{pending:r.pending,geometry:null}:null!=r.geometries?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function Y(n,e,r){if(!O())for(const o of n)if(null!=o&&!S(o.spatialReference,e)&&v(o.spatialReference)&&v(e)&&!K(o.spatialReference,e))return t(G),{pending:W(),geometries:null};return{pending:null,geometries:n.map(n=>null==n?null:S(n.spatialReference,e)?n:v(n.spatialReference)&&v(e)?I(n,e,r):null)}}class q extends n{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function F(){Z=null,k=null,b=null,P=null,E={}}const H={get loadPromise(){return Z}};async function J(n,r,t){if(e(t),!n)return n;const o=Y(Array.isArray(n)?n:[n],r,t);if(o.pending)return await o.pending,e(t),J(n,r,t);const i=o.geometries??[];return Array.isArray(n)?i:i[0]}function K(n,e,r){return!(r?.areaOfInterestExtent||r?.extendedParams||r?.geographicTransformation)&&(!!S(n,e)||v(n)&&v(e)&&!!x(n,e))}function N(n,e){if(S(n,e))return!0;if(!v(n)||!v(e))return!1;const r=M(n)||z(n)||T(n),t=M(e)||z(e)||T(e);return r&&t}async function Q(n,e,t,o){if(O())return r(o);if(Array.isArray(n)){for(const{source:r,dest:i,options:s}of n)if(r&&i&&!K(r,i,s))return W(o)}else if(n&&e&&!K(n,e,t))return W(o);return r(o)}function $(n,e,r){return n?"x"in n?nn(n,e,new m,r,0):"xmin"in n?un(n,e,new f,r,0):"rings"in n?an(n,e,new g,r,0):"paths"in n?on(n,e,new h,r,0):"points"in n?rn(n,e,new p,r,0):null:null}function _(n,e,r=e.spatialReference,t=0){return null!=r&&null!=n.spatialReference&&null!=nn(n,n.spatialReference,e,r,t)}function nn(n,e,r,t,o){pn[0]=n.x,pn[1]=n.y;const i=n.z;return pn[2]=void 0!==i?i:o,y(pn,e,0,pn,t,0)?(r.x=pn[0],r.y=pn[1],r.spatialReference=t,void 0!==i||u(t)?(r.z=pn[2],r.hasZ=!0):(r.z=void 0,r.hasZ=!1),void 0===n.m?(r.m=void 0,r.hasM=!1):(r.m=n.m,r.hasM=!0),r):null}function en(n,e,r=e.spatialReference,t=0){return null!=n.spatialReference&&null!=r&&null!=rn(n,n.spatialReference,e,r,t)}function rn(n,e,r,t,o){const{points:i,hasZ:s,hasM:a}=n,l=[],u=i.length,f=[];for(const p of i)f.push(p[0],p[1],s?p[2]:o);if(!y(f,e,0,f,t,0,u))return null;const c=cn(s,t);for(let p=0;p<u;++p){const n=3*p,e=f[n],r=f[n+1];c&&a?l.push([e,r,f[n+2],i[p][3]]):c?l.push([e,r,f[n+2]]):a?l.push([e,r,i[p][2]]):l.push([e,r])}return r.points=l,r.spatialReference=t,r.hasZ=s,r.hasM=a,r}function tn(n,e,r=e.spatialReference,t=0){return null!=n.spatialReference&&null!=r&&null!=on(n,n.spatialReference,e,r,t)}function on(n,e,r,t,o){const{paths:i,hasZ:s,hasM:a}=n,l=[];if(!fn(i,s??!1,a??!1,e,l,t,o))return null;const u=cn(s,t);return r.paths=l,r.spatialReference=t,r.hasZ=u,r.hasM=a,r}function sn(n,e,r=e.spatialReference,t=0){return null!=n.spatialReference&&null!=r&&null!=an(n,n.spatialReference,e,r,t)}function an(n,e,r,t,o){const{rings:i,hasZ:s,hasM:a}=n,l=[];if(!fn(i,s??!1,a??!1,e,l,t,o))return null;const u=cn(s,t);return r.rings=l,r.spatialReference=t,r.hasZ=u,r.hasM=a,r}function ln(n,e,r=e.spatialReference,t=0){return null!=n.spatialReference&&null!=r&&null!=un(n,n.spatialReference,e,r,t)}function un(n,e,r,t,o){const{xmin:i,ymin:s,xmax:a,ymax:l,hasZ:u,hasM:f}=n,c=u?n.zmin:o;if(!w(i,s,c,e,pn,t))return null;const p=cn(u,t);r.xmin=pn[0],r.ymin=pn[1],p&&(r.zmin=pn[2]);const m=u?n.zmax:o;return w(a,l,m,e,pn,t)?(r.xmax=pn[0],r.ymax=pn[1],p&&(r.zmax=pn[2]),f&&(r.mmin=n.mmin,r.mmax=n.mmax),r.spatialReference=t,r):null}function fn(n,e,r,t,o,i,s=0){const a=new Array;for(const f of n)for(const n of f)a.push(n[0],n[1],e?n[2]:s);if(!y(a,t,0,a,i,0))return!1;let l=0;o.length=0;const u=cn(e,i);for(const f of n){const n=new Array;for(const e of f)u&&r?n.push([a[l++],a[l++],a[l++],e[3]]):u?n.push([a[l++],a[l++],a[l++]]):r?(n.push([a[l++],a[l++],e[2]]),l++):(n.push([a[l++],a[l++]]),l++);o.push(n)}return!0}function cn(n,e){return n||u(e)||S(e,j)}const pn=i();export{K as canProjectWithoutEngine,Q as initializeProjection,N as isEqualBaseGCS,O as isLoaded,U as isLoadedOrLoad,C as isLoadedOrLoadFor,W as load,I as project,J as projectAsync,ln as projectExtent,L as projectMany,en as projectMultipoint,X as projectOrLoad,Y as projectOrLoadMany,_ as projectPoint,sn as projectPolygon,tn as projectPolyline,$ as projectWithoutEngine,D as requiresLoad,H as test,V as tryProject,F as unload};
2
+ import n from"../core/Error.js";import{throwIfAborted as e,waitTick as r}from"../core/promiseUtils.js";import{trackAccess as t}from"../core/accessorSupport/tracking.js";import{SimpleObservable as o}from"../core/accessorSupport/tracking/SimpleObservable.js";import{create as i}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{assertNotMeshes as s,assertNotMesh as a}from"./asserts.js";import{isSphericalECEF as l,isSphericalPCPF as u}from"./ellipsoidUtils.js";import c from"./Extent.js";import f from"./Geometry.js";import p from"./Multipoint.js";import m from"./Point.js";import h from"./Polygon.js";import g from"./Polyline.js";import d from"./SpatialReference.js";import{WGS84ECEFSpatialReference as j}from"./spatialReferenceEllipsoidUtils.js";import y from"./operators/support/GeographicTransformation.js";import{projectBuffer as R}from"./projection/projectBuffer.js";import{getProjector as x}from"./projection/projectors.js";import{projectXYZToVector as w}from"./projection/projectXYZToVector.js";import{isPoint as v,isExtent as S,isPolygon as A,isPolyline as M,isMultipoint as T}from"./support/jsonTypeUtils.js";import{equals as z,isValid as Z,isWGS84 as b,isWebMercator as P,isCGCS2000 as k}from"./support/spatialReferenceUtils.js";import{isEllipticArc as U,isCircularArc as E,isBezierCurve as G,getEndpoint as O}from"./support/curves/curveUtils.js";let C=null,D=null,W=null,I=null,L={};const B=new o;function V(){return!!(D?.isLoaded()&&W?.isLoaded()&&I?.isLoaded())}function X(){return!!V()||(t(B),F(),!1)}function Y(n,e){return!n||!e||(tn(n,e)||X())}function q(n,e){return!tn(n,e)&&!V()}async function F(n){null==C&&(C=Promise.all([import("./operators/projectOperator.js").then(n=>(D=n,D.load())),import("./operators/json/projectOperator.js").then(n=>(W=n,W.load())),import("./operators/support/geographicTransformationUtils.js").then(n=>(I=n,I.load()))])),await C,e(n),B.notify()}function H(n,e,r){return Array.isArray(n)?0===n.length?[]:(s(n),J(n,n[0].spatialReference,e,r)):(a(n),J([n],n.spatialReference,e,r)[0])}function J(n,e,r,t){if(null==e||null==r)return n;if(tn(e,r,t))return n.map(n=>an(n,e,r));if(null==t?.geographicTransformation&&l(e)){return J(n.map(n=>an(n,e,d.WGS84)),d.WGS84,r,{zConversionDisabled:t?.zConversionDisabled})}if(null==t?.geographicTransformation&&l(r)){return J(n,e,d.WGS84).map(n=>an(n,d.WGS84,r))}if(!V())throw new _;if(!t?.geographicTransformation)if(t?.extendedParams)t={...t,geographicTransformation:I.getTransformation(e,r,t.areaOfInterestExtent)||new y};else if(!t?.areaOfInterestExtent){const n=K(e,r);let o=L[n];o||(o=I.getTransformation(e,r)||new y,L[n]=o),t={geographicTransformation:o,zConversionDisabled:t?.zConversionDisabled}}return n[0].spatialReference||(n[0].spatialReference=e),n[0]instanceof f?D.executeMany(n,r,t):W.executeMany(n,r,t)}function K(n,e){return[n.wkid?.toString()??"-1",n.wkt?.toString()??"",n.wkt2?.toString()??"",e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??""].join()}function N(n,e,r){try{return H(n,e,r)}catch(t){return null}}function Q(n,e){const r=$([n],e);return null!=r.pending?{pending:r.pending,geometry:null}:null!=r.geometries?{pending:null,geometry:r.geometries[0]}:{pending:null,geometry:null}}function $(n,e,r){if(!V())for(const o of n)if(null!=o&&!z(o.spatialReference,e)&&Z(o.spatialReference)&&Z(e)&&!tn(o.spatialReference,e))return t(B),{pending:F(),geometries:null};return{pending:null,geometries:n.map(n=>null==n?null:z(n.spatialReference,e)?n:Z(n.spatialReference)&&Z(e)?H(n,e,r):null)}}class _ extends n{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function nn(){C=null,D=null,W=null,I=null,L={}}const en={get loadPromise(){return C}};async function rn(n,r,t){if(e(t),!n)return n;const o=$(Array.isArray(n)?n:[n],r,t);if(o.pending)return await o.pending,e(t),rn(n,r,t);const i=o.geometries??[];return Array.isArray(n)?i:i[0]}function tn(n,e,r){return!(r?.areaOfInterestExtent||r?.extendedParams||r?.geographicTransformation)&&(!!z(n,e)||Z(n)&&Z(e)&&!!x(n,e))}function on(n,e){if(z(n,e))return!0;if(!Z(n)||!Z(e))return!1;const r=b(n)||P(n)||k(n),t=b(e)||P(e)||k(e);return r&&t}async function sn(n,e,t,o){if(V())return r(o);if(Array.isArray(n)){for(const{source:r,dest:i,options:s}of n)if(r&&i&&!tn(r,i,s))return F(o)}else if(n&&e&&!tn(n,e,t))return F(o);return r(o)}function an(n,e,r){return n?v(n)?un(n,e,new m,r,0):S(n)?jn(n,e,new c,r,0):A(n)?gn(n,e,new h,r,0):M(n)?mn(n,e,new g,r,0):T(n)?fn(n,e,new p,r,0):null:null}function ln(n,e,r=e.spatialReference,t=0){return null!=r&&null!=n.spatialReference&&null!=un(n,n.spatialReference,e,r,t)}function un(n,e,r,t,o){wn[0]=n.x,wn[1]=n.y;const i=n.z;return wn[2]=void 0!==i?i:o,R(wn,e,0,wn,t,0)?(r.x=wn[0],r.y=wn[1],r.spatialReference=t,void 0!==i||u(t)?(r.z=wn[2],r.hasZ=!0):(r.z=void 0,r.hasZ=!1),void 0===n.m?(r.m=void 0,r.hasM=!1):(r.m=n.m,r.hasM=!0),r):null}function cn(n,e,r=e.spatialReference,t=0){return null!=n.spatialReference&&null!=r&&null!=fn(n,n.spatialReference,e,r,t)}function fn(n,e,r,t,o){const{points:i,hasZ:s,hasM:a}=n,l=[],u=i.length,c=[];for(const p of i)c.push(p[0],p[1],s?p[2]:o);if(!R(c,e,0,c,t,0,u))return null;const f=xn(s,t);for(let p=0;p<u;++p){const n=3*p,e=c[n],r=c[n+1];f&&a?l.push([e,r,c[n+2],i[p][3]]):f?l.push([e,r,c[n+2]]):a?l.push([e,r,i[p][2]]):l.push([e,r])}return r.points=l,r.spatialReference=t,r.hasZ=s,r.hasM=a,r}function pn(n,e,r=e.spatialReference,t=0){return null!=n.spatialReference&&null!=r&&null!=mn(n,n.spatialReference,e,r,t)}function mn(n,e,r,t,o){const{curvePaths:i,paths:s,hasZ:a,hasM:l}=n;if(!(i?Rn(i,a??!1,l??!1,e,r.curvePaths=[],t,o):yn(s,a??!1,l??!1,e,r.paths,t,o)))return null;const u=xn(a,t);return r.spatialReference=t,r.hasZ=u,r.hasM=l,r}function hn(n,e,r=e.spatialReference,t=0){return null!=n.spatialReference&&null!=r&&null!=gn(n,n.spatialReference,e,r,t)}function gn(n,e,r,t,o){const{curveRings:i,rings:s,hasZ:a,hasM:l}=n;return(i?Rn(i,a??!1,l??!1,e,r.curveRings=[],t,o):yn(s,a??!1,l??!1,e,r.rings,t,o))?(r.spatialReference=t,r.hasZ=xn(a,t),r.hasM=l,r):null}function dn(n,e,r=e.spatialReference,t=0){return null!=n.spatialReference&&null!=r&&null!=jn(n,n.spatialReference,e,r,t)}function jn(n,e,r,t,o){const{xmin:i,ymin:s,xmax:a,ymax:l,hasZ:u,hasM:c}=n,f=u?n.zmin:o;if(!w(i,s,f,e,wn,t))return null;const p=xn(u,t);r.xmin=wn[0],r.ymin=wn[1],p&&(r.zmin=wn[2]);const m=u?n.zmax:o;return w(a,l,m,e,wn,t)?(r.xmax=wn[0],r.ymax=wn[1],p&&(r.zmax=wn[2]),c&&(r.mmin=n.mmin,r.mmax=n.mmax),r.spatialReference=t,r):null}function yn(n,e,r,t,o,i,s=0){const a=new Array;for(const f of n)for(const n of f)a.push(n[0],n[1],e?n[2]:s);if(!R(a,t,0,a,i,0))return!1;let l=0;o.length=0;const u=e?3:2,c=xn(e,i);for(const f of n){const n=new Array;for(const e of f){const t=a.slice(l,l+=3);c||t.pop(),r&&t.push(e[u]),n.push(t)}o.push(n)}return!0}function Rn(n,e,r,t,o,i,s=0){const a=new Array;for(const f of n)for(const n of f){if(U(n))return!1;if(E(n)){const[r,t]=n.c;a.push(r[0],r[1],e?r[2]:s,t[0],t[1],s);continue}if(G(n)){const[r,t,o]=n.b;a.push(r[0],r[1],e?r[2]:s,t[0],t[1],s,o[0],o[1],s);continue}const r=n;a.push(r[0],r[1],e?r[2]:s)}if(!R(a,t,0,a,i,0))return!1;let l=0;o.length=0;const u=e?3:2,c=xn(e,i);for(const f of n){const n=new Array;for(const e of f){const t=a.slice(l,l+=3);if(c||t.pop(),r&&t.push(O(e)[u]),U(e))return!1;if(E(e)){const e=a[l++],r=a[l++];++l,n.push({c:[t,[e,r]]});continue}if(G(e)){const e=a[l++],r=a[l++];++l;const o=a[l++],i=a[l++];++l,n.push({b:[t,[e,r],[o,i]]});continue}n.push(t)}o.push(n)}return!0}function xn(n,e){return n||u(e)||z(e,j)}const wn=i();export{tn as canProjectWithoutEngine,sn as initializeProjection,on as isEqualBaseGCS,V as isLoaded,X as isLoadedOrLoad,Y as isLoadedOrLoadFor,F as load,H as project,rn as projectAsync,dn as projectExtent,J as projectMany,cn as projectMultipoint,Q as projectOrLoad,$ as projectOrLoadMany,ln as projectPoint,hn as projectPolygon,pn as projectPolyline,an as projectWithoutEngine,q as requiresLoad,en as test,N as tryProject,nn as unload};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{equals as n}from"../../../core/arrayUtils.js";function r(n){return"curveRings"in n&&!!n.curveRings?.length||"curvePaths"in n&&!!n.curvePaths?.length}function t(n){return"curveRings"in n?n.curveRings:n.curvePaths}function u(n){return"b"in n}function e(n){return"c"in n}function i(n){return Array.isArray(n)}function c(n){return"a"in n}function o(n){return"a"in n&&4===n.a.length}function s(n){return"a"in n&&7===n.a.length}function f(n,r){return i(n)?i(r):u(n)?u(r):e(n)?e(r):o(n)?o(r):!!s(n)&&s(r)}function a(n){return i(n)?n:u(n)?n.b[0]:e(n)?n.c[0]:n.a[0]}function g(n){if(u(n)){const[r,t,u]=n.b;return{b:[[...r],[...t],[...u]]}}if(e(n)){const[r,t]=n.c;return{c:[[...r],[...t]]}}if(i(n))return[...n];if(o(n)){const[r,t,u,e]=n.a;return{a:[[...r],[...t],u,e]}}if(s(n)){const[r,t,u,e,i,c,o]=n.a;return{a:[[...r],[...t],u,e,i,c,o]}}return n}function h(n){return r(n)?"curveRings"in n?n.curveRings:n.curvePaths:"rings"in n?n.rings:n.paths}function l(n){return n.some(n=>!i(n))}function v(n,r=0,t=1){let u=0;const e=n.length;let i=a(n[0]);for(let c=1;c<e;c++){const e=a(n[c]);u+=(e[r]-i[r])*(e[t]+i[t]),i=e}if(R(n)){const e=a(n[0]);u+=(e[r]-i[r])*(e[t]+i[t])}return u>=0}function R(r){const t=r.length;return t>0&&!n(a(r[0]),a(r[t-1]))}export{g as cloneCurve,f as curvesAreSameType,t as getCurves,a as getEndpoint,h as getPaths,u as isBezierCurve,e as isCircularArc,v as isClockwise,i as isCoordinate,r as isCurvedGeometry,c as isEllipticArc,o as isEllipticArc4,s as isEllipticArc7,l as pathHasCurves};
2
+ import{equals as n,sliceEquals as r}from"../../../core/arrayUtils.js";function t(n){return"curveRings"in n&&!!n.curveRings?.length||"curvePaths"in n&&!!n.curvePaths?.length}function u(n){return"curveRings"in n?n.curveRings:n.curvePaths}function c(n){return"b"in n}function e(n){return"c"in n}function i(n){return Array.isArray(n)}function o(n){return"a"in n}function a(n){return"a"in n&&4===n.a.length}function s(n){return"a"in n&&7===n.a.length}function f(n,r){return i(n)?i(r):c(n)?c(r):e(n)?e(r):a(n)?a(r):!!s(n)&&s(r)}function g(n){return i(n)?n:c(n)?n.b[0]:e(n)?n.c[0]:n.a[0]}function h(n){if(c(n)){const[r,t,u]=n.b;return{b:[[...r],[...t],[...u]]}}if(e(n)){const[r,t]=n.c;return{c:[[...r],[...t]]}}if(i(n))return[...n];if(a(n)){const[r,t,u,c]=n.a;return{a:[[...r],[...t],u,c]}}if(s(n)){const[r,t,u,c,e,i,o]=n.a;return{a:[[...r],[...t],u,c,e,i,o]}}return n}function b(n){return t(n)?"curveRings"in n?n.curveRings:n.curvePaths:"rings"in n?n.rings:n.paths}function l(n){return n.some(n=>!i(n))}function v(n,r=0,t=1){let u=0;const c=n.length;let e=g(n[0]);for(let i=1;i<c;i++){const c=g(n[i]);u+=(c[r]-e[r])*(c[t]+e[t]),e=c}if(R(n)){const c=g(n[0]);u+=(c[r]-e[r])*(c[t]+e[t])}return u>=0}function R(r){const t=r.length;return t>0&&!n(g(r[0]),g(r[t-1]))}function P(t,u){return i(t)&&i(u)?n(t,u):e(t)&&e(u)?n(t.c[0],u.c[0])&&n(t.c[1],u.c[1]):c(t)&&c(u)?n(t.b[0],u.b[0])&&n(t.b[1],u.b[1])&&n(t.b[2],u.b[2]):!(!o(t)||!o(u))&&(n(t.a[0],u.a[0])&&n(t.a[1],u.a[1])&&r(t.a,2,-1,u.a,2,-1))}export{h as cloneCurve,P as curveEquals,f as curvesAreSameType,u as getCurves,g as getEndpoint,b as getPaths,c as isBezierCurve,e as isCircularArc,v as isClockwise,i as isCoordinate,t as isCurvedGeometry,o as isEllipticArc,a as isEllipticArc4,s as isEllipticArc7,l as pathHasCurves};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.122",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.123",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as i,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as n}from"../../../geometry/support/quantizationUtils.js";import{isValid as r,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{closestPointOnCurve as l}from"../../../geometry/support/curves/closestPointOnCurve.js";import{getEndpoint as u}from"../../../geometry/support/curves/curveUtils.js";import c from"./AttributesBuilder.js";import{cleanFromGeometryEngine as m,getGeometry as d,transformCentroid as p}from"./geometryUtils.js";import{project as f}from"./projectionSupport.js";import{getDateInNumber as h}from"./queryUtils.js";import{SnappingCandidateEdge as y,SnappingCandidateVertex as g}from"./SnappingCandidate.js";import{isDateField as x,isDateOnlyField as T,isTimestampOffsetField as F,isStringField as I,isTimeOnlyField as _}from"../../support/fieldUtils.js";import v from"../../../rest/support/AutoIntervalBinParameters.js";import V from"../../../rest/support/DateBinParameters.js";import{unitsDict as S}from"../../../rest/support/DateBinUtils.js";import b from"../../../rest/support/FixedBoundariesBinParameters.js";import z from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as R,calculateStringStatistics as B,calculateStatistics as M,processSummaryStatisticsResult as A,calculateUniqueValuesCount as w,createUVResult as N,calculateClassBreaks as D,resolveCBResult as P,calculateHistogram as q,getAttributeComparator as j,calculatePercentile as C,binIndex as O,getBinParams as Z}from"../../../statistics/utils.js";import{utc as G}from"../../../time/constants.js";import{DateTime as E}from"luxon";const H="bin";class U{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new c(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,a=t?.length;if(!!!a)return 1;const n=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:i}=l,a="exceedslimit"!==i?l.onStatisticField:void 0;if(!r.has(a)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,this.items,n);s.push(t)}r.set(a,this._calculateUniqueValues(s,this.items,e.returnDistinctValues))}const u=r.get(a);for(const t in u){const{data:i,items:a}=u[t],n=i.join(",");s&&!e.validateItems(a,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;r(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=m({spatialReference:this.query.outSR,...f(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=m({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,s){const i=this.featureAdapter,a=J(this.hasZ,this.hasM),{point:n}=e,r="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y;function c(e,t){const s=(e-n.x)/r,i=(t-n.y)/o;return s*s+i*i}const m={candidates:[]},d="esriGeometryPolygon"===this.geometryType,p="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,f=this._getPointCreator(t,this.spatialReference,s),h=new Q(null,0),x=new Q(null,0),T={x:0,y:0,z:0};for(const l of this.items){const e=i.getObjectId(l),t=i.getGeometryWithCurves?.(l);if(null!=t){I(t,e);continue}const s=i.getGeometry(l);null==s||F(s,e)}return m.candidates.sort((e,t)=>e.distance-t.distance),m;function F(t,s){const{coords:i}=t,r=t.isPoint?Y:t.lengths;if(h.coords=i,x.coords=i,e.returnEdge){let e=0;for(let t=0;t<r.length;t++){const i=r[t],o=e;for(let t=0;t<i;t++,e+=a){if(!d&&t===i-1)continue;if(h.coordsIndex=e,x.coordsIndex=t===i-1?o:e+a,!k(T,n,h,x))continue;const r=c(T.x,T.y);r<=1&&m.candidates.push(new y(s,f(T),Math.sqrt(r),f(h),f(x)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<r.length;t++){const i=r[t],n=e,o=x;o.coordsIndex=n;for(let t=0;t<i;t++,e+=a){if(h.coordsIndex=e,d&&t===i-1&&h.x===o.x&&h.y===o.y)continue;const a=c(h.x,h.y);a<=1&&m.candidates.push(new g(s,f(h),Math.sqrt(a)))}}}else if(p&&"ends"===e.vertexMode){let e=0;const t=[];for(let s=0;s<r.length;s++){t.push(e);const i=r[s];e+=i*a,i>1&&t.push(e-a)}for(const i of t){h.coordsIndex=i;const e=c(h.x,h.y);e<=1&&m.candidates.push(new g(s,f(h),Math.sqrt(e)))}}}function I(t,s){const{candidates:i}=m,a={x:0,y:0,z:0};if(e.returnEdge){const e=[n.x,n.y],r=new Q(e,0),o=new Q(e,0);for(const{segments:n}of t.parts)for(const{start:t,curve:m}of n){const{curvePoint:n}=l(t,m,e),d=c(...n);d>1||([a.x,a.y]=n,r.coords=t,o.coords=u(m),i.push(new y(s,f(a),Math.sqrt(d),f(r),f(o))))}}function r(e){a.x=t.vertexXY[2*e],a.y=t.vertexXY[2*e+1];const n=c(a.x,a.y);n>1||(a.z=t.vertexZ?.[e]??0,i.push(new g(s,f(a),Math.sqrt(n))))}if("all"===e.vertexMode){const{vertexCount:e}=t;for(let t=0;t<e;++t)r(t);return}if("ends"===e.vertexMode)switch(t.type){case"point":r(0);break;case"polyline":for(let e=0;e<t.partCount;++e){const s=t.partOffsets[e],i=t.partOffsets[e+1];r(s),i!==s&&r(i)}}}}_getPointCreator(e,t,s){const i=null==s||o(t,s)?e=>e:e=>f(e,t,s),{hasZ:a}=this,n=0;return a&&e?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:n})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,minValue:r,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=x(m)||T(m)||F(m),p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:l,timeZone:u},this.items),f=R({normalizationType:a,normalizationField:i,minValue:r,maxValue:o}),h={value:.5,fieldType:m?.type},y=I(m)?B({values:p,supportsNullCount:f,percentileParams:h,outStatisticTypes:c}):M({values:p,minValue:r,maxValue:o,useSampleStdDev:!a,supportsNullCount:f,percentileParams:h,outStatisticTypes:c});return A(y,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:n,timeZone:r}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n,timeZone:r},this.items,!1),l=w(o);return N(l,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items),f=D(p,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return P(f,r)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items);return q(p,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.slice().reverse()){const t=i.split(" "),a=t[0],n=this.fieldsIndex.get(a),r=!!t[1]&&"desc"===t[1].toLowerCase(),o=j(n?.type,r,"case-sensitive");e.sort((e,t)=>{const i=s(e,a,n),r=s(t,a,n);return o(i,r)})}}_createFeatureQueryResponse(e){const{items:t,geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:d,resultOffset:p,returnZ:f,returnM:h}=e,y=null!=d&&t.length>(p||0)+d,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:s,hasM:i&&h,hasZ:a&&f,objectIdFieldName:r,spatialReference:m(u||o),transform:c&&n(c)||null}}_createFeatures(e,t){const s=new c(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:m,resultOffset:f,resultRecordCount:h,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=i&&g;let F=[],I=0;const _=[...t];if(this._sortFeatures(_,r,(e,t,i)=>s.getFieldValue(e,t,i)),this.geometryType&&(l||u)){const e=n(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!u)for(const i of _){const a=this.featureAdapter.getGeometry(i),n=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),geometry:d(this.geometryType,a,m,e,x,T)});t&&a&&!n.geometry&&(n.centroid=p(this,this.featureAdapter.getCentroid(i,this),e)),F[I++]=n}else if(!l&&u)for(const i of _)F[I++]=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),centroid:p(this,this.featureAdapter.getCentroid(i,this),e)});else for(const i of _)F[I++]=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),centroid:p(this,this.featureAdapter.getCentroid(i,this),e),geometry:d(this.geometryType,this.featureAdapter.getGeometry(i),m,e,x,T)})}else for(const n of _){const e=s.getAttributes(n);e&&(F[I++]=this._addFeatureJSONMetadata(n,{attributes:e}))}const v=f||0;if(null!=h){const e=v+h;F=F.slice(v,Math.min(F.length,e))}return F}_addFeatureJSONMetadata(e,t){const s=this.featureAdapter.getMetadata?.(e);return void 0!==s&&(t.metadata=s),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,s=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,i=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>s)e=!0;else{const t=J(this.hasZ,this.hasM),s=this.featureAdapter;e=this.items.reduce((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)},0)/t>i}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,s={attributes:{}}){const i=[],a=new Map,n=new Map,r=new Map,o=new Map,l=new c(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:m,having:d,orderByFields:p,resultRecordCount:f}=e,h=m?.length,y=!!h,g=y?m[0]:null,x=y&&!this.fieldsIndex.get(g);for(const c of u??[]){const{outStatisticFieldName:e,statisticType:u}=c,p=c,f="exceedslimit"!==u?c.onStatisticField:void 0,T="percentile_disc"===u||"percentile_cont"===u,F="EnvelopeAggregate"===u||"CentroidAggregate"===u||"ConvexHullAggregate"===u,_=y&&1===h&&(f===g||x)&&"count"===u;if(y){if(!r.has(f)){const e=[];for(const s of m){const i=this._getAttributeValues(l,s,t,a);e.push(i)}r.set(f,this._calculateUniqueValues(e,t,!F&&l.returnDistinctValues))}const s=r.get(f);if(!s)continue;const i=Object.keys(s);for(const n of i){const{count:i,data:r,items:u,itemPositions:c}=s[n],h=r.join(",");if(!d||l.validateItems(u,d)){const s=o.get(h)||{attributes:{}};if(F){s.aggregateGeometries||(s.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(p,u);s.aggregateGeometries[t]=e}else{let n=null;if(_)n=i;else{const e=this._getAttributeValues(l,f,t,a),s=c.map(t=>e[t]);n=T&&"statisticParameters"in p?this._getPercentileValue(p,s):this._getStatisticValue(p,s,null,l.returnDistinctValues)}s.attributes[e]=n}let n=0;m.forEach((e,t)=>s.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++n]=r[t]),o.set(h,s)}}}else if(F){s.aggregateGeometries||(s.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:i}=await this._getAggregateGeometry(p,t);s.aggregateGeometries[i]=e}else{const i=this._getAttributeValues(l,f,t,a);s.attributes[e]=T&&"statisticParameters"in p?this._getPercentileValue(p,i):this._getStatisticValue(p,i,n,l.returnDistinctValues)}const v="min"!==u&&"max"!==u||!I(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;i.push({name:e,alias:e,type:v||"esriFieldTypeDouble"})}const T=y?Array.from(o.values()):[s];return this._sortFeatures(T,p,(e,t)=>e.attributes[t]),f&&(T.length=Math.min(f,T.length)),{fields:i,features:T}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return x(t)||T(t)||F(t)||_(t)}async _getAggregateGeometry(e,n){const{convexHull:r,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:c,spatialReference:m,geometryType:p}=this,f=n.map(e=>d(p,c.getGeometry(e))),h=r(m,f,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=h?i(h):a(o(m,f));y.aggregateGeometries={...e,spatialReference:m},y.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=h?t(h):s(a(o(m,f)));y.aggregateGeometries={x:e[0],y:e[1],spatialReference:m},y.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(y.aggregateGeometries=h,y.outStatisticFieldName=u||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:n}=e;let r=null;r=s?.has(a)?s.get(a):I(this.fieldsIndex.get(a))||this._isAnyDateField(a)?B({values:t,returnDistinct:i}):M({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,r);return r["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:n,orderBy:r}=i,o=this.fieldsIndex.get(s);return C(t,{value:n,orderBy:r,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,s,i){if(i.has(t))return i.get(t);const a=this.fieldsIndex.get(t),n=s.map(s=>e.getFieldValue(s,t,a));return i.set(t,n),n}_calculateUniqueValues(e,t,s){const i={},a=t.length;for(let n=0;n<a;n++){const a=t[n],r=[];for(const t of e)r.push(t[n]);const o=r.join(",");null==i[o]?i[o]={count:1,data:r,items:[a],itemPositions:[n]}:(s||i[o].count++,i[o].items.push(a),i[o].itemPositions.push(n))}return i}async _getDataValues(t,s,i=!0){const a=new c(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:n,scale:r,timeZone:o}=t;return n?a.getExpressionValues(s,n,{viewingMode:"map",scale:r,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(s,e(t),i)}_calculateHistogramBins(e,t,s){if(null==t.min&&null==t.max)return[];const i=t.intervals,a=t.min??0,n=t.max??0,r=i.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let o=0;o<e.length;o++){const t=e[o],l=s[o];if(null!=t&&t>=a&&t<=n){const e=O(i,t);e>-1&&(r[e].count++,r[e].items.push(l))}}return r}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:s,outAlias:i,valueType:a}=t,n=[],r=[{name:i??s,alias:i??s,type:a??"esriFieldTypeString"},{name:H,alias:H,type:"esriFieldTypeInteger"}],o=new c(e,this.featureAdapter,this.fieldsIndex),l=new Map,u=[...this.items];this._sortFeatures(u,[s],(e,t,s)=>o.getFieldValue(e,t,s));const m=this._getAttributeValues(o,s,u,l),d=this._calculateUniqueValues([m],u,o.returnDistinctValues);for(const c in d){const{items:t}=d[c],a=await this._createBinsResponse(e,t);if(n.push(...a.features.map(e=>({...e,attributes:{...e.attributes,[i??s]:c}}))),a.fields)for(const e of a.fields)r.some(t=>t.name===e.name)||r.push(e)}return{fields:r,features:n}}async _createBinsResponse(e,t){const s=e.bin;switch(t=t??this.items,s.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(v.fromJSON(s),e,t);case"dateBin":return this._createDateBinsResponse(V.fromJSON(s),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(b.fromJSON(s),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(z.fromJSON(s),e,t)}}async _createAutoIntervalBinsResponse(e,t,s){const{field:i,normalizationField:a,numBins:n,normalizationType:r,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field||e.expression,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},s),m=Z(c,{field:i,normalizationField:a,normalizationType:r,normalizationTotal:o,numBins:n,minValue:h(r?e.normalizationMinValue:l,!1),maxValue:h(r?e.normalizationMaxValue:u,!1)}),d=this._calculateHistogramBins(c,m,s);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,t,s){const{field:i,interval:a,start:n,end:r,snapToData:o,returnFullIntervalBin:l,offset:u,firstDayOfWeek:c}=e,m=a.unit,d=await this._getDataValues({field:i||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},s),p=_(this.fieldsIndex.get(i)),f=S.toJSON(m),y=d.filter(Boolean).sort((e,t)=>e-t),g=null!=n?h(n,p):y[0],x=null!=r?h(r,p):y[y.length-1],T=[];if(null!=g&&null!=x){const e={zone:t.outTimeReference?.ianaTimeZone??G},s=u?.unit?S.toJSON(u.unit):"milliseconds",i={[s]:u?.value||0},n=E.fromMillis(g,e).minus(i),r=E.fromMillis(x,e).minus(i),m="number"==typeof c&&c>=1&&c<=7?c:7,d=(e,t)=>{const s=(e.weekday-t+7)%7;return e.minus({days:s}).startOf("day")};if("last"===o){let e="week"===f?((e,t)=>d(e,t).plus({days:7}))(r,m):r;for(;e>n;){const t=e.minus({[f]:a.value});if(t<n){T.unshift([l?t.plus(i).toMillis():n.plus(i).toMillis(),e.plus(i).toMillis()]);break}T.unshift([t.plus(i).toMillis(),e.plus(i).toMillis()]),e=t}}else{let e="first"===o?n:"week"===f?d(n,m):n.startOf(f);for(;e<=r;){const t=e.plus({[f]:a.value});if(t>r){T.push([e.plus(i).toMillis(),l?t.plus(i).toMillis():r.plus(i).toMillis()]);break}T.push([e.plus(i).toMillis(),t.plus(i).toMillis()]),e=t}}}const F=this._calculateHistogramBins(d,{intervals:T,min:g,max:x},s);return this._createFeaturesFromHistogramBins(F,t)}async _createFixedBoundariesBinsResponse(e,t,s){const{field:i}=e,a=await this._getDataValues({field:i||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},s),n=_(this.fieldsIndex.get(i)),r=e.boundaries.map(e=>h(e,n)).sort((e,t)=>e-t),o=[];for(let c=0;c<r.length-1;c++)o.push([r[c],r[c+1]]);const l={intervals:o,min:r.at(0),max:r.at(-1)},u=this._calculateHistogramBins(a,l,s);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,s){const{field:i,interval:a,normalizationType:n,start:r,end:o}=e,l=await this._getDataValues({field:i||e.expression,normalizationField:e.normalizationField,normalizationType:n,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},s),u=_(this.fieldsIndex.get(i)),c=Z(l,{field:i,classificationMethod:"defined-interval",definedInterval:a,minValue:h(n?e.normalizationMinValue:r,u),maxValue:h(n?e.normalizationMaxValue:o,u)},!0),m=this._calculateHistogramBins(l,c,s);return this._createFeaturesFromHistogramBins(m,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:s,lowerBoundaryAlias:i}=t,a=i||"lowerBoundary",n=s||"upperBoundary",r=[],o=[{name:a,alias:a,type:"esriFieldTypeDouble"},{name:n,alias:n,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:H,alias:H,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const m="dateBin"===t.bin.type,d=t.outTimeReference?.ianaTimeZone;for(const p of e){const{minValue:e,maxValue:s,items:i}=p,f={attributes:{}};let h;if(f.attributes[a]=m&&d&&null!=e?E.fromMillis(e,{zone:d}).toISO():e,t.bin.hideUpperBound||(f.attributes[n]=m&&d&&null!=s?E.fromMillis(s,{zone:d}).toISO():s),l?(h=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},i),f.attributes[H]=++c,"flat"===t.bin.jsonStyle?r.push(...h.features.map(({attributes:{EXPR_1:e,...t},...s})=>({...s,attributes:u??e?{...t,[u??e]:e,...f.attributes}:{...t,...f.attributes}}))):(f.stackedAttributes=h.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),r.push(f))):(t.bin?.splitBy&&(f.attributes[H]=++c),h=await this._createStatisticsQueryResponse(t,i,f),r.push(f)),h.fields)for(const t of h.fields)o.some(e=>e.name===t.name)||o.push(t)}return"desc"===t.binOrder&&r.reverse(),{fields:o,features:r}}}function k(e,t,s,i){const a=i.x-s.x,n=i.y-s.y,r=t.x-s.x,o=t.y-s.y,l=a*a+n*n;if(0===l)return!1;const u=r*a+o*n,c=Math.min(1,Math.max(0,u/l));return e.x=s.x+a*c,e.y=s.y+n*c,!0}function J(e,t){return e?t?4:3:t?3:2}class Q{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const Y=[1];export{U as QueryEngineResult};
2
+ import{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as i,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as n}from"../../../geometry/support/quantizationUtils.js";import{isValid as r,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import{closestPointOnCurve as l}from"../../../geometry/support/curves/closestPointOnCurve.js";import{getEndpoint as u,isCoordinate as c,cloneCurve as m}from"../../../geometry/support/curves/curveUtils.js";import d from"./AttributesBuilder.js";import{cleanFromGeometryEngine as p,getGeometry as f,transformCentroid as h}from"./geometryUtils.js";import{project as y}from"./projectionSupport.js";import{getDateInNumber as g}from"./queryUtils.js";import{SnappingCandidateEdge as x,SnappingCandidateVertex as T}from"./SnappingCandidate.js";import{isDateField as F,isDateOnlyField as I,isTimestampOffsetField as _,isStringField as v,isTimeOnlyField as V}from"../../support/fieldUtils.js";import S from"../../../rest/support/AutoIntervalBinParameters.js";import b from"../../../rest/support/DateBinParameters.js";import{unitsDict as z}from"../../../rest/support/DateBinUtils.js";import R from"../../../rest/support/FixedBoundariesBinParameters.js";import B from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as M,calculateStringStatistics as A,calculateStatistics as w,processSummaryStatisticsResult as N,calculateUniqueValuesCount as D,createUVResult as P,calculateClassBreaks as q,resolveCBResult as j,calculateHistogram as C,getAttributeComparator as O,calculatePercentile as Z,binIndex as G,getBinParams as E}from"../../../statistics/utils.js";import{utc as H}from"../../../time/constants.js";import{DateTime as U}from"luxon";const k="bin";class J{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new d(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query,a=t?.length;if(!!!a)return 1;const n=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:i}=l,a="exceedslimit"!==i?l.onStatisticField:void 0;if(!r.has(a)){const s=[];for(const i of t){const t=this._getAttributeValues(e,i,this.items,n);s.push(t)}r.set(a,this._calculateUniqueValues(s,this.items,e.returnDistinctValues))}const u=r.get(a);for(const t in u){const{data:i,items:a}=u[t],n=i.join(",");s&&!e.validateItems(a,s)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;r(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=p({spatialReference:this.query.outSR,...y(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=p({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,s){const i=this.featureAdapter,a=Y(this.hasZ,this.hasM),{point:n}=e,r="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y;function d(e,t){const s=(e-n.x)/r,i=(t-n.y)/o;return s*s+i*i}const p={candidates:[]},f="esriGeometryPolygon"===this.geometryType,h="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,y=this._getPointCreator(t,this.spatialReference,s),g=new X(null,0),F=new X(null,0),I={x:0,y:0,z:0};for(const l of this.items){const e=i.getObjectId(l),t=i.getGeometryWithCurves?.(l);if(null!=t){v(t,e);continue}const s=i.getGeometry(l);null==s||_(s,e)}return p.candidates.sort((e,t)=>e.distance-t.distance),p;function _(t,s){const{coords:i}=t,r=t.isPoint?L:t.lengths;if(g.coords=i,F.coords=i,e.returnEdge){let e=0;for(let t=0;t<r.length;t++){const i=r[t],o=e;for(let t=0;t<i;t++,e+=a){if(!f&&t===i-1)continue;if(g.coordsIndex=e,F.coordsIndex=t===i-1?o:e+a,!Q(I,n,g,F))continue;const r=d(I.x,I.y);r<=1&&p.candidates.push(new x(s,y(I),Math.sqrt(r),y(g),y(F)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<r.length;t++){const i=r[t],n=e,o=F;o.coordsIndex=n;for(let t=0;t<i;t++,e+=a){if(g.coordsIndex=e,f&&t===i-1&&g.x===o.x&&g.y===o.y)continue;const a=d(g.x,g.y);a<=1&&p.candidates.push(new T(s,y(g),Math.sqrt(a)))}}}else if(h&&"ends"===e.vertexMode){let e=0;const t=[];for(let s=0;s<r.length;s++){t.push(e);const i=r[s];e+=i*a,i>1&&t.push(e-a)}for(const i of t){g.coordsIndex=i;const e=d(g.x,g.y);e<=1&&p.candidates.push(new T(s,y(g),Math.sqrt(e)))}}}function v(t,s){const{candidates:i}=p,a={x:0,y:0,z:0};if(e.returnEdge){const e=[n.x,n.y],r=new X(e,0),o=new X(e,0);for(const{segments:n}of t.parts)for(const{start:t,curve:p}of n){const{curvePoint:n}=l(t,p,e),f=d(...n);if(f>1)continue;[a.x,a.y]=n,r.coords=t,o.coords=u(p);const h=c(p)?null:m(p);i.push(new x(s,y(a),Math.sqrt(f),y(r),y(o),!1,h))}}function r(e){a.x=t.vertexXY[2*e],a.y=t.vertexXY[2*e+1];const n=d(a.x,a.y);n>1||(a.z=t.vertexZ?.[e]??0,i.push(new T(s,y(a),Math.sqrt(n))))}if("all"===e.vertexMode){const{vertexCount:e}=t;for(let t=0;t<e;++t)r(t);return}if("ends"===e.vertexMode)switch(t.type){case"point":r(0);break;case"polyline":for(let e=0;e<t.partCount;++e){const s=t.partOffsets[e],i=t.partOffsets[e+1];r(s),i!==s&&r(i)}}}}_getPointCreator(e,t,s){const i=null==s||o(t,s)?e=>e:e=>y(e,t,s),{hasZ:a}=this,n=0;return a&&e?({x:e,y:t,z:s})=>i({x:e,y:t,z:s}):({x:e,y:t})=>i({x:e,y:t,z:n})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,minValue:r,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=F(m)||I(m)||_(m),p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:l,timeZone:u},this.items),f=M({normalizationType:a,normalizationField:i,minValue:r,maxValue:o}),h={value:.5,fieldType:m?.type},y=v(m)?A({values:p,supportsNullCount:f,percentileParams:h,outStatisticTypes:c}):w({values:p,minValue:r,maxValue:o,useSampleStdDev:!a,supportsNullCount:f,percentileParams:h,outStatisticTypes:c});return N(y,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:n,timeZone:r}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:n,timeZone:r},this.items,!1),l=D(o);return P(l,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items),f=q(p,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return j(f,r)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,p=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items);return C(p,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.slice().reverse()){const t=i.split(" "),a=t[0],n=this.fieldsIndex.get(a),r=!!t[1]&&"desc"===t[1].toLowerCase(),o=O(n?.type,r,"case-sensitive");e.sort((e,t)=>{const i=s(e,a,n),r=s(t,a,n);return o(i,r)})}}_createFeatureQueryResponse(e){const{items:t,geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:m,resultOffset:d,returnZ:f,returnM:h}=e,y=null!=m&&t.length>(d||0)+m,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:s,hasM:i&&h,hasZ:a&&f,objectIdFieldName:r,spatialReference:p(u||o),transform:c&&n(c)||null}}_createFeatures(e,t){const s=new d(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:m,resultRecordCount:p,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=i&&g;let F=[],I=0;const _=[...t];if(this._sortFeatures(_,r,(e,t,i)=>s.getFieldValue(e,t,i)),this.geometryType&&(l||u)){const e=n(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!u)for(const i of _){const a=this.featureAdapter.getGeometry(i),n=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),geometry:f(this.geometryType,a,c,e,x,T)});t&&a&&!n.geometry&&(n.centroid=h(this,this.featureAdapter.getCentroid(i,this),e)),F[I++]=n}else if(!l&&u)for(const i of _)F[I++]=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),centroid:h(this,this.featureAdapter.getCentroid(i,this),e)});else for(const i of _)F[I++]=this._addFeatureJSONMetadata(i,{attributes:s.getAttributes(i),centroid:h(this,this.featureAdapter.getCentroid(i,this),e),geometry:f(this.geometryType,this.featureAdapter.getGeometry(i),c,e,x,T)})}else for(const n of _){const e=s.getAttributes(n);e&&(F[I++]=this._addFeatureJSONMetadata(n,{attributes:e}))}const v=m||0;if(null!=p){const e=v+p;F=F.slice(v,Math.min(F.length,e))}return F}_addFeatureJSONMetadata(e,t){const s=this.featureAdapter.getMetadata?.(e);return void 0!==s&&(t.metadata=s),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,s=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,i=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>s)e=!0;else{const t=Y(this.hasZ,this.hasM),s=this.featureAdapter;e=this.items.reduce((e,t)=>{const i=s.getGeometry(t);return e+(null!=i&&i.coords.length||0)},0)/t>i}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,s={attributes:{}}){const i=[],a=new Map,n=new Map,r=new Map,o=new Map,l=new d(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:m,orderByFields:p,resultRecordCount:f}=e,h=c?.length,y=!!h,g=y?c[0]:null,x=y&&!this.fieldsIndex.get(g);for(const d of u??[]){const{outStatisticFieldName:e,statisticType:u}=d,p=d,f="exceedslimit"!==u?d.onStatisticField:void 0,T="percentile_disc"===u||"percentile_cont"===u,F="EnvelopeAggregate"===u||"CentroidAggregate"===u||"ConvexHullAggregate"===u,I=y&&1===h&&(f===g||x)&&"count"===u;if(y){if(!r.has(f)){const e=[];for(const s of c){const i=this._getAttributeValues(l,s,t,a);e.push(i)}r.set(f,this._calculateUniqueValues(e,t,!F&&l.returnDistinctValues))}const s=r.get(f);if(!s)continue;const i=Object.keys(s);for(const n of i){const{count:i,data:r,items:u,itemPositions:d}=s[n],h=r.join(",");if(!m||l.validateItems(u,m)){const s=o.get(h)||{attributes:{}};if(F){s.aggregateGeometries||(s.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(p,u);s.aggregateGeometries[t]=e}else{let n=null;if(I)n=i;else{const e=this._getAttributeValues(l,f,t,a),s=d.map(t=>e[t]);n=T&&"statisticParameters"in p?this._getPercentileValue(p,s):this._getStatisticValue(p,s,null,l.returnDistinctValues)}s.attributes[e]=n}let n=0;c.forEach((e,t)=>s.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++n]=r[t]),o.set(h,s)}}}else if(F){s.aggregateGeometries||(s.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:i}=await this._getAggregateGeometry(p,t);s.aggregateGeometries[i]=e}else{const i=this._getAttributeValues(l,f,t,a);s.attributes[e]=T&&"statisticParameters"in p?this._getPercentileValue(p,i):this._getStatisticValue(p,i,n,l.returnDistinctValues)}const _="min"!==u&&"max"!==u||!v(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;i.push({name:e,alias:e,type:_||"esriFieldTypeDouble"})}const T=y?Array.from(o.values()):[s];return this._sortFeatures(T,p,(e,t)=>e.attributes[t]),f&&(T.length=Math.min(f,T.length)),{fields:i,features:T}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return F(t)||I(t)||_(t)||V(t)}async _getAggregateGeometry(e,n){const{convexHull:r,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:c,spatialReference:m,geometryType:d}=this,p=n.map(e=>f(d,c.getGeometry(e))),h=r(m,p,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=h?i(h):a(o(m,p));y.aggregateGeometries={...e,spatialReference:m},y.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=h?t(h):s(a(o(m,p)));y.aggregateGeometries={x:e[0],y:e[1],spatialReference:m},y.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(y.aggregateGeometries=h,y.outStatisticFieldName=u||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:n}=e;let r=null;r=s?.has(a)?s.get(a):v(this.fieldsIndex.get(a))||this._isAnyDateField(a)?A({values:t,returnDistinct:i}):w({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,r);return r["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:n,orderBy:r}=i,o=this.fieldsIndex.get(s);return Z(t,{value:n,orderBy:r,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,s,i){if(i.has(t))return i.get(t);const a=this.fieldsIndex.get(t),n=s.map(s=>e.getFieldValue(s,t,a));return i.set(t,n),n}_calculateUniqueValues(e,t,s){const i={},a=t.length;for(let n=0;n<a;n++){const a=t[n],r=[];for(const t of e)r.push(t[n]);const o=r.join(",");null==i[o]?i[o]={count:1,data:r,items:[a],itemPositions:[n]}:(s||i[o].count++,i[o].items.push(a),i[o].itemPositions.push(n))}return i}async _getDataValues(t,s,i=!0){const a=new d(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:n,scale:r,timeZone:o}=t;return n?a.getExpressionValues(s,n,{viewingMode:"map",scale:r,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(s,e(t),i)}_calculateHistogramBins(e,t,s){if(null==t.min&&null==t.max)return[];const i=t.intervals,a=t.min??0,n=t.max??0,r=i.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let o=0;o<e.length;o++){const t=e[o],l=s[o];if(null!=t&&t>=a&&t<=n){const e=G(i,t);e>-1&&(r[e].count++,r[e].items.push(l))}}return r}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:s,outAlias:i,valueType:a}=t,n=[],r=[{name:i??s,alias:i??s,type:a??"esriFieldTypeString"},{name:k,alias:k,type:"esriFieldTypeInteger"}],o=new d(e,this.featureAdapter,this.fieldsIndex),l=new Map,u=[...this.items];this._sortFeatures(u,[s],(e,t,s)=>o.getFieldValue(e,t,s));const c=this._getAttributeValues(o,s,u,l),m=this._calculateUniqueValues([c],u,o.returnDistinctValues);for(const d in m){const{items:t}=m[d],a=await this._createBinsResponse(e,t);if(n.push(...a.features.map(e=>({...e,attributes:{...e.attributes,[i??s]:d}}))),a.fields)for(const e of a.fields)r.some(t=>t.name===e.name)||r.push(e)}return{fields:r,features:n}}async _createBinsResponse(e,t){const s=e.bin;switch(t=t??this.items,s.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(S.fromJSON(s),e,t);case"dateBin":return this._createDateBinsResponse(b.fromJSON(s),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(R.fromJSON(s),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(B.fromJSON(s),e,t)}}async _createAutoIntervalBinsResponse(e,t,s){const{field:i,normalizationField:a,numBins:n,normalizationType:r,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field||e.expression,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},s),m=E(c,{field:i,normalizationField:a,normalizationType:r,normalizationTotal:o,numBins:n,minValue:g(r?e.normalizationMinValue:l,!1),maxValue:g(r?e.normalizationMaxValue:u,!1)}),d=this._calculateHistogramBins(c,m,s);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,t,s){const{field:i,interval:a,start:n,end:r,snapToData:o,returnFullIntervalBin:l,offset:u,firstDayOfWeek:c}=e,m=a.unit,d=await this._getDataValues({field:i||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},s),p=V(this.fieldsIndex.get(i)),f=z.toJSON(m),h=d.filter(Boolean).sort((e,t)=>e-t),y=null!=n?g(n,p):h[0],x=null!=r?g(r,p):h[h.length-1],T=[];if(null!=y&&null!=x){const e={zone:t.outTimeReference?.ianaTimeZone??H},s=u?.unit?z.toJSON(u.unit):"milliseconds",i={[s]:u?.value||0},n=U.fromMillis(y,e).minus(i),r=U.fromMillis(x,e).minus(i),m="number"==typeof c&&c>=1&&c<=7?c:7,d=(e,t)=>{const s=(e.weekday-t+7)%7;return e.minus({days:s}).startOf("day")};if("last"===o){let e="week"===f?((e,t)=>d(e,t).plus({days:7}))(r,m):r;for(;e>n;){const t=e.minus({[f]:a.value});if(t<n){T.unshift([l?t.plus(i).toMillis():n.plus(i).toMillis(),e.plus(i).toMillis()]);break}T.unshift([t.plus(i).toMillis(),e.plus(i).toMillis()]),e=t}}else{let e="first"===o?n:"week"===f?d(n,m):n.startOf(f);for(;e<=r;){const t=e.plus({[f]:a.value});if(t>r){T.push([e.plus(i).toMillis(),l?t.plus(i).toMillis():r.plus(i).toMillis()]);break}T.push([e.plus(i).toMillis(),t.plus(i).toMillis()]),e=t}}}const F=this._calculateHistogramBins(d,{intervals:T,min:y,max:x},s);return this._createFeaturesFromHistogramBins(F,t)}async _createFixedBoundariesBinsResponse(e,t,s){const{field:i}=e,a=await this._getDataValues({field:i||e.expression,timeZone:t.outTimeReference?.ianaTimeZone},s),n=V(this.fieldsIndex.get(i)),r=e.boundaries.map(e=>g(e,n)).sort((e,t)=>e-t),o=[];for(let c=0;c<r.length-1;c++)o.push([r[c],r[c+1]]);const l={intervals:o,min:r.at(0),max:r.at(-1)},u=this._calculateHistogramBins(a,l,s);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,s){const{field:i,interval:a,normalizationType:n,start:r,end:o}=e,l=await this._getDataValues({field:i||e.expression,normalizationField:e.normalizationField,normalizationType:n,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},s),u=V(this.fieldsIndex.get(i)),c=E(l,{field:i,classificationMethod:"defined-interval",definedInterval:a,minValue:g(n?e.normalizationMinValue:r,u),maxValue:g(n?e.normalizationMaxValue:o,u)},!0),m=this._calculateHistogramBins(l,c,s);return this._createFeaturesFromHistogramBins(m,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:s,lowerBoundaryAlias:i}=t,a=i||"lowerBoundary",n=s||"upperBoundary",r=[],o=[{name:a,alias:a,type:"esriFieldTypeDouble"},{name:n,alias:n,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:k,alias:k,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const m="dateBin"===t.bin.type,d=t.outTimeReference?.ianaTimeZone;for(const p of e){const{minValue:e,maxValue:s,items:i}=p,f={attributes:{}};let h;if(f.attributes[a]=m&&d&&null!=e?U.fromMillis(e,{zone:d}).toISO():e,t.bin.hideUpperBound||(f.attributes[n]=m&&d&&null!=s?U.fromMillis(s,{zone:d}).toISO():s),l?(h=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},i),f.attributes[k]=++c,"flat"===t.bin.jsonStyle?r.push(...h.features.map(({attributes:{EXPR_1:e,...t},...s})=>({...s,attributes:u??e?{...t,[u??e]:e,...f.attributes}:{...t,...f.attributes}}))):(f.stackedAttributes=h.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),r.push(f))):(t.bin?.splitBy&&(f.attributes[k]=++c),h=await this._createStatisticsQueryResponse(t,i,f),r.push(f)),h.fields)for(const t of h.fields)o.some(e=>e.name===t.name)||o.push(t)}return"desc"===t.binOrder&&r.reverse(),{fields:o,features:r}}}function Q(e,t,s,i){const a=i.x-s.x,n=i.y-s.y,r=t.x-s.x,o=t.y-s.y,l=a*a+n*n;if(0===l)return!1;const u=r*a+o*n,c=Math.min(1,Math.max(0,u/l));return e.x=s.x+a*c,e.y=s.y+n*c,!0}function Y(e,t){return e?t?4:3:t?3:2}class X{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const L=[1];export{J as QueryEngineResult};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- class t{constructor(t,s,e){this.objectId=t,this.target=s,this.distance=e}}class s extends t{constructor(t,s,e){super(t,s,e),this.type="vertex"}}class e extends t{constructor(t,s,e,r,c,i=!1){super(t,s,e),this.start=r,this.end=c,this.draped=i,this.type="edge"}}export{e as SnappingCandidateEdge,s as SnappingCandidateVertex};
2
+ class t{constructor(t,s,e){this.objectId=t,this.target=s,this.distance=e}}class s extends t{constructor(t,s,e){super(t,s,e),this.type="vertex"}}class e extends t{constructor(t,s,e,r,c,i=!1,h=null){super(t,s,e),this.start=r,this.end=c,this.draped=i,this.curve=h,this.type="edge"}}export{e as SnappingCandidateEdge,s as SnappingCandidateVertex};
@@ -1,5 +1,5 @@
1
1
  import type Point from "../../geometry/Point.js";
2
- import type GeoreferenceBase from "./GeoreferenceBase.js";
2
+ import type { Clonable } from "../../core/Clonable.js";
3
3
  import type { JSONSupportMixin } from "../../core/JSONSupport.js";
4
4
  import type { ScreenPoint } from "../../core/types.js";
5
5
  import type { ControlPointProperties } from "./ControlPoint.js";
@@ -178,4 +178,4 @@ export default class ControlPointsGeoreference extends ControlPointsGeoreference
178
178
  */
179
179
  toSource(point: Point | null | undefined): ScreenPoint | null | undefined;
180
180
  }
181
- declare const ControlPointsGeoreferenceSuperclass: typeof GeoreferenceBase & typeof JSONSupportMixin
181
+ declare const ControlPointsGeoreferenceSuperclass: typeof Clonable & typeof JSONSupportMixin
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import o from"../../core/Error.js";import{JSONSupportMixin as e,JSONSupport as r}from"../../core/JSONSupport.js";import n from"../../core/Logger.js";import{transformProjective as i,getProjectiveTransform as s}from"../../core/perspectiveUtils.js";import{createScreenPoint as l}from"../../core/screenUtils.js";import{property as c,subclass as a}from"../../core/accessorSupport/decorators.js";import{invert as u}from"../../core/libs/gl-matrix-2/math/mat3.js";import{fromValues as p,create as m}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as f,lerp as P,rotate as h}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as d,fromValues as y}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import g from"../../geometry/Point.js";import w from"../../geometry/Polygon.js";import{projectOrLoad as j}from"../../geometry/projectionUtils.js";import R from"../../geometry/SpatialReference.js";import x from"./ControlPoint.js";import v from"./GeoreferenceBase.js";import{reader as b}from"../../core/accessorSupport/decorators/reader.js";import{writer as S}from"../../core/accessorSupport/decorators/writer.js";const N=m(),C=d();let _=class extends r{};t([c({type:Number,json:{write:{isRequired:!0}}})],_.prototype,"x",void 0),t([c({type:Number,json:{write:{isRequired:!0}}})],_.prototype,"y",void 0),_=t([a("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],_);let q=class extends(e(v)){constructor(t){super(t),this.height=0,this.type="control-points",this.width=0}get controlPoints(){return this._get("controlPoints")??null}set controlPoints(t){this._set("controlPoints",t)}readControlPoints(t,o){const e=R.fromJSON(o.spatialReference),r=p(...o.coefficients,1);return t.map(t=>(f(C,t.x,t.y),i(C,C,r),{sourcePoint:t,mapPoint:new g({x:C[0],y:C[1],spatialReference:e})}))}writeControlPoints(t,e,r,i){if(null==this.transform){const t=new o("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:i?.layer,georeference:this});return void(i?.messages?i.messages.push(t):n.getLogger(this).error(t.name,t.message))}null!=t&&T(t[0])&&(e.controlPoints=t.map(t=>{const o=t.sourcePoint;return{x:o.x,y:o.y}}),e.spatialReference=t[0].mapPoint.spatialReference.toJSON(),e.coefficients=this.transform.slice(0,8))}get coords(){if(null==this.controlPoints)return null;const t=this._updateTransform(N);if(null==t||!T(this.controlPoints[0]))return null;const o=this.controlPoints[0].mapPoint.spatialReference;return K(t,this.width,this.height,o)}set coords(t){if(null==this.controlPoints||!T(this.controlPoints[0]))return;const o=this.controlPoints[0].mapPoint.spatialReference;if(null==(t=this.projectOrWarn(t,o)))return;const{width:e,height:r}=this,{rings:[[n,s,c,a]]}=t,u=new x({sourcePoint:l(0,r),mapPoint:new g({x:n[0],y:n[1],spatialReference:o})}),p=new x({sourcePoint:l(0,0),mapPoint:new g({x:s[0],y:s[1],spatialReference:o})}),m=new x({sourcePoint:l(e,0),mapPoint:new g({x:c[0],y:c[1],spatialReference:o})}),P=new x({sourcePoint:l(e,r),mapPoint:new g({x:a[0],y:a[1],spatialReference:o})});T(u)&&T(p)&&T(m)&&T(P)&&(B(N,u,p,m,P),this.controlPoints=this.controlPoints.map(({sourcePoint:t})=>(f(C,t.x,t.y),i(C,C,N),{sourcePoint:t,mapPoint:new g({x:C[0],y:C[1],spatialReference:o})})))}get inverseTransform(){return null==this.transform?null:u(m(),this.transform)}get transform(){return this._updateTransform()}toMap(t){if(null==t||null==this.transform||null==this.controlPoints||!T(this.controlPoints[0]))return null;f(C,t.x,t.y);const o=this.controlPoints[0].mapPoint.spatialReference;return i(C,C,this.transform),new g({x:C[0],y:C[1],spatialReference:o})}toSource(t){if(null==t||null==this.inverseTransform||null==this.controlPoints||!T(this.controlPoints[0]))return null;const o=this.controlPoints[0].mapPoint.spatialReference;return t=t.normalize(),null==(t=j(t,o).geometry)?null:(f(C,t.x,t.y),i(C,C,this.inverseTransform),l(C[0],C[1]))}toSourceNormalized(t){const o=this.toSource(t);return null!=o&&(o.x/=this.width,o.y/=this.height),o}_updateTransform(t){const{controlPoints:o,width:e,height:r}=this;if(!(null!=o&&e>0&&r>0))return null;const[n,i,s,l]=o;if(!T(n))return null;const c=n.mapPoint.spatialReference,a=this._projectControlPoint(i,c),u=this._projectControlPoint(s,c),p=this._projectControlPoint(l,c);if(!a.valid||!u.valid||!p.valid)return null;if(!T(a.controlPoint))return null;null==t&&(t=m());let f=null;return f=T(u.controlPoint)&&T(p.controlPoint)?B(t,n,a.controlPoint,u.controlPoint,p.controlPoint):T(u.controlPoint)?k(t,n,a.controlPoint,u.controlPoint):V(t,n,a.controlPoint),f.every(t=>0===t)?null:f}_projectControlPoint(t,o){if(!T(t))return{valid:!0,controlPoint:t};const{sourcePoint:e,mapPoint:r}=t,{geometry:i,pending:s}=j(r,o);return s?{valid:!1,controlPoint:null}:s||i?{valid:!0,controlPoint:new x({sourcePoint:e,mapPoint:i})}:(n.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:t,sourceSpatialReference:r.spatialReference,targetSpatialReference:o}),{valid:!1,controlPoint:null})}};function T(t){return null!=t?.sourcePoint&&null!=t.mapPoint}t([c({type:[x],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[_],isRequired:!0},coefficients:{type:[Number],isRequired:!0},spatialReference:{type:R,isRequired:!0}}}}})],q.prototype,"controlPoints",null),t([b("controlPoints")],q.prototype,"readControlPoints",null),t([S("controlPoints")],q.prototype,"writeControlPoints",null),t([c({clonable:!1})],q.prototype,"coords",null),t([c({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],q.prototype,"height",void 0),t([c({readOnly:!0})],q.prototype,"inverseTransform",null),t([c({readOnly:!0})],q.prototype,"transform",null),t([c({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],q.prototype,"width",void 0),q=t([a("esri.layers.support.ControlPointsGeoreference")],q);const O=d(),M=d(),I=d(),J=d(),L=d(),E=d(),G=d(),U=d(),z=Math.PI/2;function A(t,o,e){f(t,e.sourcePoint.x,e.sourcePoint.y),f(o,e.mapPoint.x,e.mapPoint.y)}function V(t,o,e){return A(O,L,o),A(M,E,e),h(I,M,O,z),h(J,O,M,z),h(G,E,L,-z),h(U,L,E,-z),H(t,O,M,I,J,L,E,G,U)}function k(t,o,e,r){return A(O,L,o),A(M,E,e),A(I,G,r),P(J,O,M,.5),h(J,I,J,Math.PI),P(U,L,E,.5),h(U,G,U,Math.PI),H(t,O,M,I,J,L,E,G,U)}function B(t,o,e,r,n){return A(O,L,o),A(M,E,e),A(I,G,r),A(J,U,n),H(t,O,M,I,J,L,E,G,U)}const W=new Array(8).fill(0),D=new Array(8).fill(0);function F(t,o,e,r,n){return t[0]=o[0],t[1]=o[1],t[2]=e[0],t[3]=e[1],t[4]=r[0],t[5]=r[1],t[6]=n[0],t[7]=n[1],t}function H(t,o,e,r,n,i,l,c,a){return s(t,F(W,o,e,r,n),F(D,i,l,c,a))}function K(t,o,e,r){const n=y(0,e),s=y(0,0),l=y(o,0),c=y(o,e);return i(n,n,t),i(s,s,t),i(l,l,t),i(c,c,t),new w({rings:[[n,s,l,c,n]],spatialReference:r})}export{q as default};
2
+ import{__decorate as t}from"tslib";import{Clonable as o}from"../../core/Clonable.js";import e from"../../core/Error.js";import{JSONSupportMixin as r,JSONSupport as n}from"../../core/JSONSupport.js";import i from"../../core/Logger.js";import{transformProjective as s,getProjectiveTransform as l}from"../../core/perspectiveUtils.js";import{createScreenPoint as c}from"../../core/screenUtils.js";import{property as a,subclass as u}from"../../core/accessorSupport/decorators.js";import{invert as p}from"../../core/libs/gl-matrix-2/math/mat3.js";import{fromValues as m,create as f}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as P,lerp as h,rotate as d}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as y,fromValues as g}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import w from"../../geometry/Point.js";import j from"../../geometry/Polygon.js";import{projectOrLoad as R}from"../../geometry/projectionUtils.js";import x from"../../geometry/SpatialReference.js";import v from"./ControlPoint.js";import{GeoreferenceBaseMixin as b}from"./GeoreferenceBaseMixin.js";import{reader as S}from"../../core/accessorSupport/decorators/reader.js";import{writer as C}from"../../core/accessorSupport/decorators/writer.js";const N=f(),_=y();let q=class extends n{};t([a({type:Number,json:{write:{isRequired:!0}}})],q.prototype,"x",void 0),t([a({type:Number,json:{write:{isRequired:!0}}})],q.prototype,"y",void 0),q=t([u("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],q);let T=class extends(r(b(o))){constructor(t){super(t),this.height=0,this.type="control-points",this.width=0}get controlPoints(){return this._get("controlPoints")??null}set controlPoints(t){this._set("controlPoints",t)}readControlPoints(t,o){const e=x.fromJSON(o.spatialReference),r=m(...o.coefficients,1);return t.map(t=>(P(_,t.x,t.y),s(_,_,r),{sourcePoint:t,mapPoint:new w({x:_[0],y:_[1],spatialReference:e})}))}writeControlPoints(t,o,r,n){if(null==this.transform){const t=new e("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:n?.layer,georeference:this});return void(n?.messages?n.messages.push(t):i.getLogger(this).error(t.name,t.message))}null!=t&&M(t[0])&&(o.controlPoints=t.map(t=>{const o=t.sourcePoint;return{x:o.x,y:o.y}}),o.spatialReference=t[0].mapPoint.spatialReference.toJSON(),o.coefficients=this.transform.slice(0,8))}get coords(){if(null==this.controlPoints)return null;const t=this._updateTransform(N);if(null==t||!M(this.controlPoints[0]))return null;const o=this.controlPoints[0].mapPoint.spatialReference;return Q(t,this.width,this.height,o)}set coords(t){if(null==this.controlPoints||!M(this.controlPoints[0]))return;const o=this.controlPoints[0].mapPoint.spatialReference;if(null==(t=this.projectOrWarn(t,o)))return;const{width:e,height:r}=this,{rings:[[n,i,l,a]]}=t,u=new v({sourcePoint:c(0,r),mapPoint:new w({x:n[0],y:n[1],spatialReference:o})}),p=new v({sourcePoint:c(0,0),mapPoint:new w({x:i[0],y:i[1],spatialReference:o})}),m=new v({sourcePoint:c(e,0),mapPoint:new w({x:l[0],y:l[1],spatialReference:o})}),f=new v({sourcePoint:c(e,r),mapPoint:new w({x:a[0],y:a[1],spatialReference:o})});M(u)&&M(p)&&M(m)&&M(f)&&(W(N,u,p,m,f),this.controlPoints=this.controlPoints.map(({sourcePoint:t})=>(P(_,t.x,t.y),s(_,_,N),{sourcePoint:t,mapPoint:new w({x:_[0],y:_[1],spatialReference:o})})))}get inverseTransform(){return null==this.transform?null:p(f(),this.transform)}get transform(){return this._updateTransform()}toMap(t){if(null==t||null==this.transform||null==this.controlPoints||!M(this.controlPoints[0]))return null;P(_,t.x,t.y);const o=this.controlPoints[0].mapPoint.spatialReference;return s(_,_,this.transform),new w({x:_[0],y:_[1],spatialReference:o})}toSource(t){if(null==t||null==this.inverseTransform||null==this.controlPoints||!M(this.controlPoints[0]))return null;const o=this.controlPoints[0].mapPoint.spatialReference;return t=t.normalize(),null==(t=R(t,o).geometry)?null:(P(_,t.x,t.y),s(_,_,this.inverseTransform),c(_[0],_[1]))}toSourceNormalized(t){const o=this.toSource(t);return null!=o&&(o.x/=this.width,o.y/=this.height),o}_updateTransform(t){const{controlPoints:o,width:e,height:r}=this;if(!(null!=o&&e>0&&r>0))return null;const[n,i,s,l]=o;if(!M(n))return null;const c=n.mapPoint.spatialReference,a=this._projectControlPoint(i,c),u=this._projectControlPoint(s,c),p=this._projectControlPoint(l,c);if(!a.valid||!u.valid||!p.valid)return null;if(!M(a.controlPoint))return null;null==t&&(t=f());let m=null;return m=M(u.controlPoint)&&M(p.controlPoint)?W(t,n,a.controlPoint,u.controlPoint,p.controlPoint):M(u.controlPoint)?B(t,n,a.controlPoint,u.controlPoint):k(t,n,a.controlPoint),m.every(t=>0===t)?null:m}_projectControlPoint(t,o){if(!M(t))return{valid:!0,controlPoint:t};const{sourcePoint:e,mapPoint:r}=t,{geometry:n,pending:s}=R(r,o);return s?{valid:!1,controlPoint:null}:s||n?{valid:!0,controlPoint:new v({sourcePoint:e,mapPoint:n})}:(i.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:t,sourceSpatialReference:r.spatialReference,targetSpatialReference:o}),{valid:!1,controlPoint:null})}};function M(t){return null!=t?.sourcePoint&&null!=t.mapPoint}t([a({type:[v],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[q],isRequired:!0},coefficients:{type:[Number],isRequired:!0},spatialReference:{type:x,isRequired:!0}}}}})],T.prototype,"controlPoints",null),t([S("controlPoints")],T.prototype,"readControlPoints",null),t([C("controlPoints")],T.prototype,"writeControlPoints",null),t([a({clonable:!1})],T.prototype,"coords",null),t([a({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],T.prototype,"height",void 0),t([a({readOnly:!0})],T.prototype,"inverseTransform",null),t([a({readOnly:!0})],T.prototype,"transform",null),t([a({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],T.prototype,"width",void 0),T=t([u("esri.layers.support.ControlPointsGeoreference")],T);const O=y(),I=y(),J=y(),L=y(),E=y(),G=y(),U=y(),z=y(),A=Math.PI/2;function V(t,o,e){P(t,e.sourcePoint.x,e.sourcePoint.y),P(o,e.mapPoint.x,e.mapPoint.y)}function k(t,o,e){return V(O,E,o),V(I,G,e),d(J,I,O,A),d(L,O,I,A),d(U,G,E,-A),d(z,E,G,-A),K(t,O,I,J,L,E,G,U,z)}function B(t,o,e,r){return V(O,E,o),V(I,G,e),V(J,U,r),h(L,O,I,.5),d(L,J,L,Math.PI),h(z,E,G,.5),d(z,U,z,Math.PI),K(t,O,I,J,L,E,G,U,z)}function W(t,o,e,r,n){return V(O,E,o),V(I,G,e),V(J,U,r),V(L,z,n),K(t,O,I,J,L,E,G,U,z)}const D=new Array(8).fill(0),F=new Array(8).fill(0);function H(t,o,e,r,n){return t[0]=o[0],t[1]=o[1],t[2]=e[0],t[3]=e[1],t[4]=r[0],t[5]=r[1],t[6]=n[0],t[7]=n[1],t}function K(t,o,e,r,n,i,s,c,a){return l(t,H(D,o,e,r,n),H(F,i,s,c,a))}function Q(t,o,e,r){const n=g(0,e),i=g(0,0),l=g(o,0),c=g(o,e);return s(n,n,t),s(i,i,t),s(l,l,t),s(c,c,t),new j({rings:[[n,i,l,c,n]],spatialReference:r})}export{T as default};
@@ -1,5 +1,5 @@
1
1
  import type Point from "../../geometry/Point.js";
2
- import type GeoreferenceBase from "./GeoreferenceBase.js";
2
+ import type { Clonable } from "../../core/Clonable.js";
3
3
  import type { PointProperties } from "../../geometry/Point.js";
4
4
 
5
5
  export interface CornersGeoreferenceProperties {
@@ -84,7 +84,7 @@ export interface CornersGeoreferenceProperties {
84
84
  * @see [VideoElement.georeference](https://developers.arcgis.com/javascript/latest/references/core/layers/support/VideoElement/#georeference)
85
85
  * @see [Sample - MediaLayer with video](https://developers.arcgis.com/javascript/latest/sample-code/layers-medialayer-video/)
86
86
  */
87
- export default class CornersGeoreference extends GeoreferenceBase {
87
+ export default class CornersGeoreference extends Clonable {
88
88
  constructor(properties?: CornersGeoreferenceProperties);
89
89
  /**
90
90
  * The bottom left [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) of the bounding box representing the geographic location of the image or video element being added
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{getProjectiveTransform as e,transformProjective as o}from"../../core/perspectiveUtils.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{property as s,subclass as l}from"../../core/accessorSupport/decorators.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as n}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import c from"../../geometry/Point.js";import m from"../../geometry/Polygon.js";import{projectOrLoad as f}from"../../geometry/projectionUtils.js";import a from"./GeoreferenceBase.js";const u=p();let y=class extends a{constructor(t){super(t),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:t,topRight:e,bottomLeft:o,bottomRight:r}=this;if(null==t||null==e||null==o||null==r)return null;const s=t.spatialReference;return e=this.projectOrWarn(e,s),o=this.projectOrWarn(o,s),r=this.projectOrWarn(r,s),null==e||null==o||null==r?null:new m({rings:[[[o.x,o.y],[t.x,t.y],[e.x,e.y],[r.x,r.y],[o.x,o.y]]],spatialReference:s})}set coords(t){const{topLeft:e}=this;if(null==e)return;const o=e.spatialReference;if(null==(t=this.projectOrWarn(t,o)))return;const{rings:[[r,s,l,i]]}=t;this.bottomLeft=new c({x:r[0],y:r[1],spatialReference:o}),this.topLeft=new c({x:s[0],y:s[1],spatialReference:o}),this.topRight=new c({x:l[0],y:l[1],spatialReference:o}),this.bottomRight=new c({x:i[0],y:i[1],spatialReference:o})}toSourceNormalized(t){const{topLeft:s,topRight:l,bottomRight:p,bottomLeft:c}=this;if(null==t||null==s||null==l||null==p||null==c)return null;const m=s.spatialReference;t=t.normalize();const a=f(t,m).geometry;if(null==a)return null;n(u,a.x,a.y);const y=e(i(),[s.x,s.y,c.x,c.y,l.x,l.y,p.x,p.y],[0,0,0,1,1,0,1,1]);return o(u,u,y),r(u[0],u[1])}};t([s({clonable:!1})],y.prototype,"coords",null),t([s({type:c})],y.prototype,"bottomLeft",void 0),t([s({type:c})],y.prototype,"bottomRight",void 0),t([s({type:c})],y.prototype,"topLeft",void 0),t([s({type:c})],y.prototype,"topRight",void 0),y=t([l("esri.layers.support.CornersGeoreference")],y);const h=y;export{h as default};
2
+ import{__decorate as t}from"tslib";import{Clonable as e}from"../../core/Clonable.js";import{getProjectiveTransform as o,transformProjective as r}from"../../core/perspectiveUtils.js";import{createScreenPoint as l}from"../../core/screenUtils.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/mat3f64.js";import{set as p}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as c}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import m from"../../geometry/Point.js";import f from"../../geometry/Polygon.js";import{projectOrLoad as a}from"../../geometry/projectionUtils.js";import{GeoreferenceBaseMixin as u}from"./GeoreferenceBaseMixin.js";const y=c();let h=class extends(u(e)){constructor(t){super(t),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:t,topRight:e,bottomLeft:o,bottomRight:r}=this;if(null==t||null==e||null==o||null==r)return null;const l=t.spatialReference;return e=this.projectOrWarn(e,l),o=this.projectOrWarn(o,l),r=this.projectOrWarn(r,l),null==e||null==o||null==r?null:new f({rings:[[[o.x,o.y],[t.x,t.y],[e.x,e.y],[r.x,r.y],[o.x,o.y]]],spatialReference:l})}set coords(t){const{topLeft:e}=this;if(null==e)return;const o=e.spatialReference;if(null==(t=this.projectOrWarn(t,o)))return;const{rings:[[r,l,s,i]]}=t;this.bottomLeft=new m({x:r[0],y:r[1],spatialReference:o}),this.topLeft=new m({x:l[0],y:l[1],spatialReference:o}),this.topRight=new m({x:s[0],y:s[1],spatialReference:o}),this.bottomRight=new m({x:i[0],y:i[1],spatialReference:o})}toSourceNormalized(t){const{topLeft:e,topRight:s,bottomRight:i,bottomLeft:c}=this;if(null==t||null==e||null==s||null==i||null==c)return null;const m=e.spatialReference;t=t.normalize();const f=a(t,m).geometry;if(null==f)return null;p(y,f.x,f.y);const u=o(n(),[e.x,e.y,c.x,c.y,s.x,s.y,i.x,i.y],[0,0,0,1,1,0,1,1]);return r(y,y,u),l(y[0],y[1])}};t([s({clonable:!1})],h.prototype,"coords",null),t([s({type:m})],h.prototype,"bottomLeft",void 0),t([s({type:m})],h.prototype,"bottomRight",void 0),t([s({type:m})],h.prototype,"topLeft",void 0),t([s({type:m})],h.prototype,"topRight",void 0),h=t([i("esri.layers.support.CornersGeoreference")],h);const g=h;export{g as default};
@@ -1,5 +1,5 @@
1
1
  import type Extent from "../../geometry/Extent.js";
2
- import type GeoreferenceBase from "./GeoreferenceBase.js";
2
+ import type { Clonable } from "../../core/Clonable.js";
3
3
  import type { ExtentProperties } from "../../geometry/Extent.js";
4
4
 
5
5
  export interface ExtentAndRotationGeoreferenceProperties extends Partial<Pick<ExtentAndRotationGeoreference, "rotation">> {
@@ -42,7 +42,7 @@ export interface ExtentAndRotationGeoreferenceProperties extends Partial<Pick<Ex
42
42
  * @see [VideoElement.georeference](https://developers.arcgis.com/javascript/latest/references/core/layers/support/VideoElement/#georeference)
43
43
  * @see [Sample - MediaLayer with images](https://developers.arcgis.com/javascript/latest/sample-code/layers-medialayer-images/)
44
44
  */
45
- export default class ExtentAndRotationGeoreference extends GeoreferenceBase {
45
+ export default class ExtentAndRotationGeoreference extends Clonable {
46
46
  constructor(properties?: ExtentAndRotationGeoreferenceProperties);
47
47
  /**
48
48
  * An extent of the image or video element representing its geographic location when added to the [MediaLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/MediaLayer/).
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{rad2deg as e,scale as r}from"../../core/mathUtils.js";import{createScreenPoint as o}from"../../core/screenUtils.js";import{property as n,subclass as s}from"../../core/accessorSupport/decorators.js";import{toRadian as i}from"../../core/libs/gl-matrix-2/math/common.js";import l from"../../geometry/Extent.js";import a from"../../geometry/Polygon.js";import{projectOrLoad as m}from"../../geometry/projectionUtils.js";import c from"./GeoreferenceBase.js";let x=class extends c{constructor(t){super(t),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(null==this.extent)return null;const{xmin:t,ymin:e,xmax:r,ymax:o,spatialReference:n}=this.extent;let s;if(this.rotation){const{x:n,y:i}=this.extent.center,l=p(n,i,this.rotation);s=[l(t,e),l(t,o),l(r,o),l(r,e)],s.push(s[0])}else s=[[t,e],[t,o],[r,o],[r,e],[t,e]];return new a({rings:[s],spatialReference:n})}set coords(t){if(null==t||null==this.extent)return;const r=this.extent.spatialReference;if(t=this.projectOrWarn(t,r),null==t?.extent)return;const{rings:[[o,n,s]],extent:{center:{x:i,y:a}}}=t,m=e(Math.PI/2-Math.atan2(n[1]-o[1],n[0]-o[0])),c=p(i,a,-m),[x,u]=c(o[0],o[1]),[f,y]=c(s[0],s[1]);this.extent=new l({xmin:x,ymin:u,xmax:f,ymax:y,spatialReference:r}),this.rotation=m}toSourceNormalized(t){const{extent:e,rotation:n}=this;if(null==t||null==e)return null;const{xmin:s,ymin:i,xmax:l,ymax:a,center:c,spatialReference:x}=e;t=t.normalize();const u=m(t,x).geometry;if(null==u)return null;let f=u.x,y=u.y;return n&&([f,y]=p(c.x,c.y,-n)(f,y)),o(r(f,s,l,0,1),r(y,a,i,0,1))}};function p(t,e,r){const o=i(r),n=Math.cos(o),s=Math.sin(o);return(r,o)=>[n*(r-t)+s*(o-e)+t,n*(o-e)-s*(r-t)+e]}t([n({clonable:!1})],x.prototype,"coords",null),t([n({type:l})],x.prototype,"extent",void 0),t([n({type:Number})],x.prototype,"rotation",void 0),x=t([s("esri.layers.support.ExtentAndRotationGeoreference")],x);const u=x;export{u as default};
2
+ import{__decorate as t}from"tslib";import{Clonable as e}from"../../core/Clonable.js";import{rad2deg as o,scale as r}from"../../core/mathUtils.js";import{createScreenPoint as n}from"../../core/screenUtils.js";import{property as i,subclass as s}from"../../core/accessorSupport/decorators.js";import{toRadian as l}from"../../core/libs/gl-matrix-2/math/common.js";import a from"../../geometry/Extent.js";import m from"../../geometry/Polygon.js";import{projectOrLoad as c}from"../../geometry/projectionUtils.js";import{GeoreferenceBaseMixin as x}from"./GeoreferenceBaseMixin.js";let p=class extends(x(e)){constructor(t){super(t),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(null==this.extent)return null;const{xmin:t,ymin:e,xmax:o,ymax:r,spatialReference:n}=this.extent;let i;if(this.rotation){const{x:n,y:s}=this.extent.center,l=u(n,s,this.rotation);i=[l(t,e),l(t,r),l(o,r),l(o,e)],i.push(i[0])}else i=[[t,e],[t,r],[o,r],[o,e],[t,e]];return new m({rings:[i],spatialReference:n})}set coords(t){if(null==t||null==this.extent)return;const e=this.extent.spatialReference;if(t=this.projectOrWarn(t,e),null==t?.extent)return;const{rings:[[r,n,i]],extent:{center:{x:s,y:l}}}=t,m=o(Math.PI/2-Math.atan2(n[1]-r[1],n[0]-r[0])),c=u(s,l,-m),[x,p]=c(r[0],r[1]),[f,y]=c(i[0],i[1]);this.extent=new a({xmin:x,ymin:p,xmax:f,ymax:y,spatialReference:e}),this.rotation=m}toSourceNormalized(t){const{extent:e,rotation:o}=this;if(null==t||null==e)return null;const{xmin:i,ymin:s,xmax:l,ymax:a,center:m,spatialReference:x}=e;t=t.normalize();const p=c(t,x).geometry;if(null==p)return null;let f=p.x,y=p.y;return o&&([f,y]=u(m.x,m.y,-o)(f,y)),n(r(f,i,l,0,1),r(y,a,s,0,1))}};function u(t,e,o){const r=l(o),n=Math.cos(r),i=Math.sin(r);return(o,r)=>[n*(o-t)+i*(r-e)+t,n*(r-e)-i*(o-t)+e]}t([i({clonable:!1})],p.prototype,"coords",null),t([i({type:a})],p.prototype,"extent",void 0),t([i({type:Number})],p.prototype,"rotation",void 0),p=t([s("esri.layers.support.ExtentAndRotationGeoreference")],p);const f=p;export{f as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
+ import e from"../../core/Logger.js";import{projectOrLoad as r}from"../../geometry/projectionUtils.js";const t=t=>{const o=t;class n extends o{projectOrWarn(t,o){if(null==t)return t;const{geometry:n,pending:c}=r(t,o);return c?null:c||n?n:(e.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:t,sourceSpatialReference:t.spatialReference,targetSpatialReference:o}),null)}}return n};export{t as GeoreferenceBaseMixin};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{createScreenPoint as e}from"../../core/screenUtils.js";import{nameToId as n}from"../../core/accessorSupport/PropertyOrigin.js";import t from"../../geometry/Extent.js";import o from"../../geometry/Point.js";import{getInfo as r}from"../../geometry/support/spatialReferenceUtils.js";import i from"./ControlPoint.js";import s from"./ControlPointsGeoreference.js";import a from"./CornersGeoreference.js";import c from"./ExtentAndRotationGeoreference.js";import p from"./GeoreferenceBase.js";const l=100,y=.5;async function m(e,n){e.loaded||await e.load();const{contentWidth:a,contentHeight:c}=e,{spatialReference:p}=n,m=r(p);let f=!1;if(m){const e=m.valid[1]-m.valid[0];n.width>e&&(n=new t({xmin:m.valid[0],ymin:n.ymin,xmax:m.valid[1],ymax:n.ymax,spatialReference:n.spatialReference}),f=!0)}const u=n.expand(y),{center:w,width:P,height:d}=u,x=a/c,g=f||x>1,h=g?l:l*x,R=g?l/x:l,j=g?P:d*x,v=g?P/x:d,b=w.x-j/2,G=w.x+j/2,O=w.y+v/2,k=w.y-v/2;return new s({controlPoints:[new i({sourcePoint:{x:h,y:c-R},mapPoint:new o({x:b,y:k,spatialReference:p})}),new i({sourcePoint:{x:h,y:R},mapPoint:new o({x:b,y:O,spatialReference:p})}),new i({sourcePoint:{x:a-h,y:R},mapPoint:new o({x:G,y:O,spatialReference:p})}),new i({sourcePoint:{x:a-h,y:c-R},mapPoint:new o({x:G,y:k,spatialReference:p})})],width:a,height:c})}function f(e){const n=e.georeference;if("control-points"!==n.type)return null;const t={wkid:0},{width:r,height:i}=n,a=n.controlPoints;return new s({controlPoints:a.map(e=>{const{x:n,y:r}=e.sourcePoint;return{sourcePoint:{x:n,y:r},mapPoint:new o({x:n,y:i-r,spatialReference:t})}}),width:r,height:i})}function u(e){return"media"===e?.type}function w(e,t){const o=n(t);return u(e)&&!!e.portalItem&&null!=o&&o>3}function P(n,t,r){if(!n||"control-points"===n.type)return n;const{coords:a}=n;if(5!==a?.rings[0]?.length)return null;const[c,p,l,y]=a.rings[0],{spatialReference:m}=a;return new s({controlPoints:[new i({mapPoint:new o({x:c[0],y:c[1],spatialReference:m}),sourcePoint:e(0,r)}),new i({mapPoint:new o({x:p[0],y:p[1],spatialReference:m}),sourcePoint:e(0,0)}),new i({mapPoint:new o({x:l[0],y:l[1],spatialReference:m}),sourcePoint:e(t,0)}),new i({mapPoint:new o({x:y[0],y:y[1],spatialReference:m}),sourcePoint:e(t,r)})],width:t,height:r})}function d(e,n,t){return{enabled:!w(t?.layer,t?.origin),ignoreOrigin:!0}}const x={json:{name:"url",type:String,write:{overridePolicy:d}}},g={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:d}}},h={types:{key:"type",base:p,typeMap:{"control-points":s,corners:a,"extent-and-rotation":c}},json:{types:{key:"type",base:p,typeMap:{"control-points":s}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};export{m as createDefaultControlPointsGeoreference,f as createLocalModeControlPointsGeoreference,w as isWritingLayerFromItemToWebDocument,x as mediaElementUrlProperty,h as mediaGeoreferenceProperty,g as mediaTypeProperty,P as toControlPointsGeoreference};
2
+ import{createScreenPoint as e}from"../../core/screenUtils.js";import{nameToId as n}from"../../core/accessorSupport/PropertyOrigin.js";import t from"../../geometry/Extent.js";import o from"../../geometry/Point.js";import{getInfo as r}from"../../geometry/support/spatialReferenceUtils.js";import i from"./ControlPoint.js";import s from"./ControlPointsGeoreference.js";import a from"./CornersGeoreference.js";import c from"./ExtentAndRotationGeoreference.js";const p=100,l=.5;async function y(e,n){e.loaded||await e.load();const{contentWidth:a,contentHeight:c}=e,{spatialReference:y}=n,m=r(y);let f=!1;if(m){const e=m.valid[1]-m.valid[0];n.width>e&&(n=new t({xmin:m.valid[0],ymin:n.ymin,xmax:m.valid[1],ymax:n.ymax,spatialReference:n.spatialReference}),f=!0)}const u=n.expand(l),{center:w,width:P,height:d}=u,x=a/c,g=f||x>1,h=g?p:p*x,R=g?p/x:p,j=g?P:d*x,v=g?P/x:d,b=w.x-j/2,O=w.x+j/2,k=w.y+v/2,C=w.y-v/2;return new s({controlPoints:[new i({sourcePoint:{x:h,y:c-R},mapPoint:new o({x:b,y:C,spatialReference:y})}),new i({sourcePoint:{x:h,y:R},mapPoint:new o({x:b,y:k,spatialReference:y})}),new i({sourcePoint:{x:a-h,y:R},mapPoint:new o({x:O,y:k,spatialReference:y})}),new i({sourcePoint:{x:a-h,y:c-R},mapPoint:new o({x:O,y:C,spatialReference:y})})],width:a,height:c})}function m(e){const n=e.georeference;if("control-points"!==n.type)return null;const t={wkid:0},{width:r,height:i}=n,a=n.controlPoints;return new s({controlPoints:a.map(e=>{const{x:n,y:r}=e.sourcePoint;return{sourcePoint:{x:n,y:r},mapPoint:new o({x:n,y:i-r,spatialReference:t})}}),width:r,height:i})}function f(e){return"media"===e?.type}function u(e,t){const o=n(t);return f(e)&&!!e.portalItem&&null!=o&&o>3}function w(n,t,r){if(!n||"control-points"===n.type)return n;const{coords:a}=n;if(5!==a?.rings[0]?.length)return null;const[c,p,l,y]=a.rings[0],{spatialReference:m}=a;return new s({controlPoints:[new i({mapPoint:new o({x:c[0],y:c[1],spatialReference:m}),sourcePoint:e(0,r)}),new i({mapPoint:new o({x:p[0],y:p[1],spatialReference:m}),sourcePoint:e(0,0)}),new i({mapPoint:new o({x:l[0],y:l[1],spatialReference:m}),sourcePoint:e(t,0)}),new i({mapPoint:new o({x:y[0],y:y[1],spatialReference:m}),sourcePoint:e(t,r)})],width:t,height:r})}function P(e,n,t){return{enabled:!u(t?.layer,t?.origin),ignoreOrigin:!0}}const d={json:{name:"url",type:String,write:{overridePolicy:P}}},x={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:P}}},g={types:{key:"type",base:null,typeMap:{"control-points":s,corners:a,"extent-and-rotation":c}},json:{types:{key:"type",base:null,typeMap:{"control-points":s}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};export{y as createDefaultControlPointsGeoreference,m as createLocalModeControlPointsGeoreference,u as isWritingLayerFromItemToWebDocument,d as mediaElementUrlProperty,g as mediaGeoreferenceProperty,x as mediaTypeProperty,w as toControlPointsGeoreference};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import has from"../../core/has.js";import{getOrCreateMapValue as e}from"../../core/MapUtils.js";import{parseWhereClause as t,sqlTimestampOffsetLiteral as r}from"../../core/sql.js";import{visitSqlNode as n}from"../../core/sql/sqlVisitor.js";import{isAgolSecuredProxyService as i,isHostedAgolService as o}from"./arcgisLayerUrl.js";function a(e,t){if(!e||!has("featurelayer-relative-time-queries-enabled"))return 0;const r=i(e);return o(e)||r?(t??0)>0||r?has("featurelayer-relative-time-queries-bin-window-public")??1:has("featurelayer-relative-time-queries-bin-window-private")??60:0}function s(e){return(has("featurelayer-relative-time-queries-enabled")??!0)&&u(e)}function u(e){return null!=e&&/CURRENT_TIMESTAMP/gi.test(e)}const l=new WeakMap;async function f(r,n,i=Date.now()){if(!r||!n||!u(r))return r;const o=await t(r);if(!o.isStandardized)return r;const[a,s]=c(i,n),f=e(l,o,()=>p(o.parseTree)).flatMap(e=>[{replacement:"BETWEEN"===e.operator?a:s,start:e.right.value[0].left.location.start.offset,end:e.right.value[0].left.location.end.offset},{replacement:"BETWEEN"===e.operator?s:a,start:e.right.value[1].location.start.offset,end:e.right.value[1].location.end.offset}]).sort((e,t)=>t.start-e.start);let m=r;for(const{replacement:e,start:t,end:u}of f)m=m.slice(0,t)+e+m.slice(u);return m}function c(e,t){const n=60*t*1e3,i=e-e%n,o=i+n;return[r(new Date(i),"date"),r(new Date(o),"date")]}function p(e){const t=[],r={"binary-expression":e=>{"AND"===e.operator||"OR"===e.operator?(n(e.left,r),n(e.right,r)):m(e)&&t.push(e)}};return n(e,r),t}function m(e){return"binary-expression"===e.type&&("BETWEEN"===e.operator||"NOTBETWEEN"===e.operator)&&"column-reference"===e.left.type&&y(e.right)}function y(e){if("expression-list"!==e.type||2!==e.value.length)return!1;const[t,r]=e.value;return(d(t)||E(t))&&v(r)}function d(e){return"binary-expression"===e.type&&v(e.left)&&g(e.right)}function E(e){return"binary-expression"===e.type&&v(e.left)&&h(e.right)}function v(e){return"current-time"===e.type&&"timestamp"===e.mode}function g(e){return"interval"===e.type}function h(e){return"number"===e.type}export{s as canConvertSqlRelativeTime,a as getRelativeTimeQueryBinWindowSize,u as hasSqlRelativeTime,f as sqlRelativeTimeToAbsolute};
2
+ import has from"../../core/has.js";import{getOrCreateMapValue as e}from"../../core/MapUtils.js";import{parseWhereClause as t,sqlTimestampOffsetLiteral as r}from"../../core/sql.js";import{visitSqlNode as n}from"../../core/sql/sqlVisitor.js";import{isAgolSecuredProxyService as i,isHostedAgolService as o}from"./arcgisLayerUrl.js";import{collectSQLFieldNames as a}from"./fieldUtils.js";function s(e,t){if(!e||!has("featurelayer-relative-time-queries-enabled"))return 0;const r=i(e);return o(e)||r?(t??0)>0||r?has("featurelayer-relative-time-queries-bin-window-public")??1:has("featurelayer-relative-time-queries-bin-window-private")??60:0}function u(e){return(has("featurelayer-relative-time-queries-enabled")??!0)&&f(e)}function f(e){return null!=e&&/CURRENT_TIMESTAMP/gi.test(e)}const l=new WeakMap;async function c(e,r){if(!r||!f(r))return[];const n=await t(r,e);if(!n.isStandardized)return[];const i=y(n),o=new Set(i.map(e=>e.left.column));return Array.from(o)}async function p(e,t,r){(await c(t,r)).length>0&&await a(e,t,r)}async function m(e,r,n,i=Date.now()){if(!r||!n||!f(r))return r;const o=await t(r,e);if(!o.isStandardized)return r;const[a,s]=d(i,n),u=y(o).flatMap(e=>[{replacement:"BETWEEN"===e.operator?a:s,start:e.right.value[0].left.location.start.offset,end:e.right.value[0].left.location.end.offset},{replacement:"BETWEEN"===e.operator?s:a,start:e.right.value[1].location.start.offset,end:e.right.value[1].location.end.offset}]).sort((e,t)=>t.start-e.start);let l=r;for(const{replacement:t,start:f,end:c}of u)l=l.slice(0,f)+t+l.slice(c);return l}function y(t){return e(l,t,()=>E(t.parseTree))}function d(e,t){const n=60*t*1e3,i=e-e%n,o=i+n;return[r(new Date(i),"date"),r(new Date(o),"date")]}function E(e){const t=[],r={"binary-expression":e=>{"AND"===e.operator||"OR"===e.operator?(n(e.left,r),n(e.right,r)):w(e)&&t.push(e)}};return n(e,r),t}function w(e){return"binary-expression"===e.type&&("BETWEEN"===e.operator||"NOTBETWEEN"===e.operator)&&"column-reference"===e.left.type&&g(e.right)}function g(e){if("expression-list"!==e.type||2!==e.value.length)return!1;const[t,r]=e.value;return(h(t)||v(t))&&b(r)}function h(e){return"binary-expression"===e.type&&b(e.left)&&T(e.right)}function v(e){return"binary-expression"===e.type&&b(e.left)&&q(e.right)}function b(e){return"current-time"===e.type&&"timestamp"===e.mode}function T(e){return"interval"===e.type}function q(e){return"number"===e.type}export{u as canConvertSqlRelativeTime,p as collectRelativeTimeFields,c as getRelativeTimeFields,s as getRelativeTimeQueryBinWindowSize,f as hasSqlRelativeTime,m as sqlRelativeTimeToAbsolute};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{isSome as t}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{curveTypeDict as s}from"../../geometry/support/typeUtils.js";import{isHostedAgolService as e,parse as r}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as p}from"./infoFor3D.js";import{getRelativeTimeQueryBinWindowSize as o}from"./relativeTimeQueryUtils.js";import{readNumber as u,readBoolean as i}from"../../rest/support/jsonUtils.js";const a={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},n=["cubic-bezier","circular-arc","elliptic-arc"];function c(t){const s=t?.supportedSpatialAggregationStatistics?.map(t=>t.toLowerCase());return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function l(t,s){const e=t?.supportedOperationsWithCacheHint?.map(t=>t.toLowerCase());return!!e?.includes(s.toLowerCase())}function d(t){const s=t?.supportedStatisticTypes?.map(t=>t.toLowerCase());return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_cont"),percentileDiscrete:!!s?.includes("percentile_disc"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function y(t){const s=t?.supportedNormalizationTypes?.map(t=>t.toLowerCase());return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function m(t,s){return{analytics:C(t),attachment:v(t),data:g(t),metadata:h(t),operations:Q(t.capabilities,t,s),query:f(t,s),queryAttributeBins:T(t),queryRelated:A(t),queryTopFeatures:S(t),editing:x(t)}}function C(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryAnalytics")}}function v(t){const s=t.attachmentProperties,e={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:l(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:i(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:i(t,"supportsAttachmentsResizing",!1),supportsTypeWildcard:i(t.advancedQueryCapabilities,"supportsQueryAttachmentWithTypeWildcard",!1)};return s&&Array.isArray(s)&&s.forEach(t=>{const s=a[t.name];s&&(e[s]=!!t.isEnabled)}),e}function g(t){const s=i(t.advancedQueryCapabilities,"supportsTrueCurve",!1);return{isVersioned:i(t,"isDataVersioned",!1),isBranchVersioned:i(t,"isDataBranchVersioned",!1),supportsAttachment:i(t,"hasAttachments",!1),supportsM:i(t,"hasM",!1),supportsTrueCurve:s,supportedCurveTypes:F(t,s),supportsZ:i(t,"hasZ",!1)}}function h(t){return{supportsAdvancedFieldProperties:i(t,"supportsFieldDescriptionProperty",!1)}}function Q(t,s,p){const o=e(p),u=t?.toLowerCase().split(",").map(t=>t.trim())??[],a=p?r(p):null,n=u.includes("MapServer"===a?.serverType?"data":"query"),c=u.includes("editing")&&!s.datesInUnknownTimezone&&!(!0===s.uniqueIdInfo?.OIDFieldContainsHashValue);let l=c&&u.includes("create"),d=c&&u.includes("delete"),y=c&&u.includes("update");const m=u.includes("changetracking"),C=s.advancedQueryCapabilities;let v=i(s,"supportsExceedsLimitStatistics",!1);if(!o){i(C,"supportsUseEstimateForExceedsLimit",!1)||(v=!1)}return c&&!(l||d||y)&&(l=d=y=!0),{supportsCalculate:i(s,"supportsCalculate",!1),supportsTruncate:i(s,"supportsTruncate",!1),supportsValidateSql:i(s,"supportsValidateSql",!1),supportsAdd:l,supportsDelete:d,supportsEditing:c,supportsChangeTracking:m,supportsQuery:n,supportsQueryAnalytics:i(C,"supportsQueryAnalytic",!1),supportsQueryAttachments:i(C,"supportsQueryAttachments",!1),supportsQueryBins:i(C,"supportsQueryBins",!1)||!!s.queryBinsCapabilities,supportsQueryPivot:i(C,"supportsQueryPivot",!1),supportsQueryTopFeatures:i(C,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:i(s,"supportsAttachmentsResizing",!1),supportsSync:u.includes("sync"),supportsUpdate:y,supportsExceedsLimitStatistics:v,supportsAsyncConvert3D:i(s,"supportsAsyncConvert3D",!1)}}function f(t,s){const r=t.advancedQueryCapabilities,a=t.ownershipBasedAccessControlForFeatures,n=t.archivingInfo,d=t.currentVersion,y=o(s,t.cacheMaxAge),m=s?.includes("MapServer"),C=!m||d>=has("mapserver-pbf-version-support"),v=e(s),g=new Set((t.supportedQueryFormats??"").split(",").map(t=>t.toLowerCase().trim()));return{maxRecordCount:u(t,"maxRecordCount",void 0),maxRecordCountFactor:u(t,"maxRecordCountFactor",void 0),maxUniqueIDCount:u(t,"maxUniqueIDCount",void 0),relativeTimeBinWindow:y,standardMaxRecordCount:u(t,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:c(r),supportsCacheHint:i(r,"supportsQueryWithCacheHint",!1)||l(r,"query"),supportsCentroid:i(r,"supportsReturningGeometryCentroid",!1),supportsCentroidOnDegeneratedQuantizedGeometry:v||null==s,supportsCompactGeometry:v,supportsCurrentUser:i(r,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:i(r,"supportsDefaultSR",!1),supportsDegeneratedQuantizedGeometry:i(r,"supportsDegeneratedQuantizedGeometry",!1),supportsDisjointSpatialRelationship:i(r,"supportsDisjointSpatialRel",!1),supportsDistance:i(r,"supportsQueryWithDistance",!1),supportsDistinct:i(r,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:i(r,"supportsReturningQueryExtent",!1),supportsFormatPBF:C&&g.has("pbf"),supportsFullTextSearch:i(r,"supportsFullTextSearch",!1),supportsGeometryProperties:i(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:i(r,"supportsHavingClause",!1),supportsHistoricMoment:i(n,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:i(r,"supportsMaxRecordCountFactor",!1),supportsOrderBy:i(r,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:i(r,"supportsPagination",!1),supportsPaginationOnAggregatedQueries:i(r,"supportsPaginationOnAggregatedQueries",!1),supportsPercentileStatistics:i(r,"supportsPercentileStatistics",!1),supportsQuantization:i(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:i(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:i(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:i(a,"allowOthersToQuery",!0),supportsQueryGeometry:i(t,"supportsReturningQueryGeometry",!1),supportsResultType:i(r,"supportsQueryWithResultType",!1),supportsReturnMesh:!!p(t.infoFor3D),supportsSpatialAggregationStatistics:i(r,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:i(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:i(t,"useStandardizedQueries",!1),supportsStatistics:i(r,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:i(r,"supportsTopFeaturesQuery",!1),supportsTrueCurve:i(r,"supportsTrueCurve",!1),tileMaxRecordCount:u(t,"tileMaxRecordCount",void 0)}}function A(t){const s=t.advancedQueryCapabilities,e=i(s,"supportsAdvancedQueryRelated",!1);return{supportsPagination:i(s,"supportsQueryRelatedPagination",!1),supportsCount:e,supportsOrderBy:e,supportsCacheHint:l(s,"queryRelated")}}function S(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryTopFilter")}}function T(t){const s=t?t.queryBinsCapabilities:void 0;return{supportsDate:i(s,"supportsDateBin",!1),supportsFixedInterval:i(s,"supportsFixedIntervalBin",!1),supportsAutoInterval:i(s,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:i(s,"supportsFixedBoundariesBin",!1),supportsStackBy:i(s,"supportsStackBy",!1),supportsSplitBy:i(s,"supportsSplitBy",!1),supportsSnapToData:i(s,"supportsSnapToData",!1),supportsReturnFullIntervalBin:i(s,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:i(s,"supportsFirstDayOfWeek",!1),supportsNormalization:i(s,"supportsNormalization",!1),supportedStatistics:d(s),supportedNormalizationTypes:y(s)}}function x(t){const s=t.ownershipBasedAccessControlForFeatures,e=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:i(t,"allowGeometryUpdates",!0),supportsGlobalId:i(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:i(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:i(t,"supportsRollbackOnFailureParameter",!1),supportsTrueCurveUpdate:i(t,"allowTrueCurveUpdates",!0),supportsTrueCurveUpdateByTrueCurveClientsOnly:i(t,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0),supportsUpdateWithoutM:i(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:i(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:i(s,"allowAnonymousToDelete",!0),supportsDeleteByOthers:i(s,"allowOthersToDelete",!0),supportsUpdateByAnonymous:i(s,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:i(s,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:i(e,"supportsAsyncApplyEdits",!1),zDefault:u(t,"zDefault",void 0)}}function F(e,r){const p=e.supportedCurveTypes??e.advancedQueryCapabilities?.supportedCurveTypes;return Array.isArray(p)?p.map(t=>s.fromJSON(t)).filter(t):r?n:[]}function R(t){return{operations:{supportsAppend:i(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:i(t,"supportsExportClip",!1),supportsExportFrameset:i(t,"supportsExportFrameset",!1),supportsMensuration:i(t,"supportsMensuration",!1),supportsPreviews:i(t,"supportsPreviews",!1),supportsUpdate:i(t,"supportsUpdate",!1)}}}export{n as allCurveTypes,m as getFeatureLayerCapabilities,R as getVideoLayerCapabilities};
2
+ import{isSome as t}from"../../core/arrayUtils.js";import has from"../../core/has.js";import{curveTypeDict as s}from"../../geometry/support/typeUtils.js";import{isHostedAgolService as e,parse as r}from"./arcgisLayerUrl.js";import{getGltfQueryFormat as p}from"./infoFor3D.js";import{getRelativeTimeQueryBinWindowSize as o}from"./relativeTimeQueryUtils.js";import{readNumber as u,readBoolean as i}from"../../rest/support/jsonUtils.js";const a={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},n=["cubic-bezier","circular-arc","elliptic-arc"];function c(t){const s=t?.supportedSpatialAggregationStatistics?.map(t=>t.toLowerCase());return{envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function l(t,s){const e=t?.supportedOperationsWithCacheHint?.map(t=>t.toLowerCase());return!!e?.includes(s.toLowerCase())}function d(t){const s=t?.supportedStatisticTypes?.map(t=>t.toLowerCase());return{count:!!s?.includes("count"),sum:!!s?.includes("sum"),min:!!s?.includes("min"),max:!!s?.includes("max"),avg:!!s?.includes("avg"),var:!!s?.includes("var"),stddev:!!s?.includes("stddev"),percentileContinuous:!!s?.includes("percentile_cont"),percentileDiscrete:!!s?.includes("percentile_disc"),envelope:!!s?.includes("envelopeaggregate"),centroid:!!s?.includes("centroidaggregate"),convexHull:!!s?.includes("convexhullaggregate")}}function y(t){const s=t?.supportedNormalizationTypes?.map(t=>t.toLowerCase());return{field:!!s?.includes("field"),log:!!s?.includes("log"),naturalLog:!!s?.includes("naturallog"),percentOfTotal:!!s?.includes("percentoftotal"),squareRoot:!!s?.includes("squareroot")}}function m(t,s){return{analytics:C(t),attachment:v(t),data:g(t),metadata:h(t),operations:Q(t.capabilities,t,s),query:f(t,s),queryAttributeBins:T(t),queryRelated:A(t),queryTopFeatures:S(t),editing:x(t)}}function C(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryAnalytics")}}function v(t){const s=t.attachmentProperties,e={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:l(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:i(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:i(t,"supportsAttachmentsResizing",!1),supportsTypeWildcard:i(t.advancedQueryCapabilities,"supportsQueryAttachmentWithTypeWildcard",!1)};return s&&Array.isArray(s)&&s.forEach(t=>{const s=a[t.name];s&&(e[s]=!!t.isEnabled)}),e}function g(t){const s=i(t.advancedQueryCapabilities,"supportsTrueCurve",!1);return{isVersioned:i(t,"isDataVersioned",!1),isBranchVersioned:i(t,"isDataBranchVersioned",!1),supportsAttachment:i(t,"hasAttachments",!1),supportsM:i(t,"hasM",!1),supportsTrueCurve:s,supportedCurveTypes:F(t,s),supportsZ:i(t,"hasZ",!1)}}function h(t){return{supportsAdvancedFieldProperties:i(t,"supportsFieldDescriptionProperty",!1)}}function Q(t,s,p){const o=e(p),u=t?.toLowerCase().split(",").map(t=>t.trim())??[],a=p?r(p):null,n=u.includes("MapServer"===a?.serverType?"data":"query"),c=u.includes("editing")&&!s.datesInUnknownTimezone&&!(!0===s.uniqueIdInfo?.OIDFieldContainsHashValue);let l=c&&u.includes("create"),d=c&&u.includes("delete"),y=c&&u.includes("update");const m=u.includes("changetracking"),C=s.advancedQueryCapabilities;let v=i(s,"supportsExceedsLimitStatistics",!1);if(!o){i(C,"supportsUseEstimateForExceedsLimit",!1)||(v=!1)}return c&&!(l||d||y)&&(l=d=y=!0),{supportsCalculate:i(s,"supportsCalculate",!1),supportsTruncate:i(s,"supportsTruncate",!1),supportsValidateSql:i(s,"supportsValidateSql",!1),supportsAdd:l,supportsDelete:d,supportsEditing:c,supportsChangeTracking:m,supportsQuery:n,supportsQueryAnalytics:i(C,"supportsQueryAnalytic",!1),supportsQueryAttachments:i(C,"supportsQueryAttachments",!1),supportsQueryBins:i(C,"supportsQueryBins",!1)||!!s.queryBinsCapabilities,supportsQueryPivot:i(C,"supportsQueryPivot",!1),supportsQueryTopFeatures:i(C,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:i(s,"supportsAttachmentsResizing",!1),supportsSync:u.includes("sync"),supportsUpdate:y,supportsExceedsLimitStatistics:v,supportsAsyncConvert3D:i(s,"supportsAsyncConvert3D",!1)}}function f(t,s){const r=t.advancedQueryCapabilities,a=t.ownershipBasedAccessControlForFeatures,n=t.archivingInfo,d=t.currentVersion,y=o(s,t.cacheMaxAge),m=s?.includes("MapServer"),C=!m||d>=has("mapserver-pbf-version-support"),v=e(s),g=new Set((t.supportedQueryFormats??"").split(",").map(t=>t.toLowerCase().trim()));return{maxRecordCount:u(t,"maxRecordCount",void 0),maxRecordCountFactor:u(t,"maxRecordCountFactor",void 0),maxUniqueIDCount:u(t,"maxUniqueIDCount",void 0),relativeTimeBinWindow:y,standardMaxRecordCount:u(t,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:c(r),supportsCacheHint:i(r,"supportsQueryWithCacheHint",!1)||l(r,"query"),supportsCentroid:i(r,"supportsReturningGeometryCentroid",!1),supportsCentroidOnDegeneratedQuantizedGeometry:v||null==s,supportsCompactGeometry:v,supportsCurrentUser:i(r,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:i(r,"supportsDefaultSR",!1),supportsDegeneratedQuantizedGeometry:i(r,"supportsDegeneratedQuantizedGeometry",!1),supportsDisjointSpatialRelationship:i(r,"supportsDisjointSpatialRel",!1),supportsDistance:i(r,"supportsQueryWithDistance",!1),supportsDistinct:i(r,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:i(r,"supportsReturningQueryExtent",!1),supportsFormatPBF:C&&g.has("pbf"),supportsFullTextSearch:i(r,"supportsFullTextSearch",!1),supportsGeometryProperties:i(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:i(r,"supportsHavingClause",!1),supportsHistoricMoment:i(n,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:i(r,"supportsMaxRecordCountFactor",!1),supportsOrderBy:i(r,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:i(r,"supportsPagination",!1),supportsPaginationOnAggregatedQueries:i(r,"supportsPaginationOnAggregatedQueries",!1),supportsPercentileStatistics:i(r,"supportsPercentileStatistics",!1),supportsQuantization:i(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:i(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:i(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:i(a,"allowOthersToQuery",!0),supportsQueryGeometry:i(t,"supportsReturningQueryGeometry",!1),supportsResultType:i(r,"supportsQueryWithResultType",!1),supportsReturnMesh:!!p(t.infoFor3D),supportsSpatialAggregationStatistics:i(r,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:i(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:i(t,"useStandardizedQueries",!1),supportsStatistics:i(r,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:i(r,"supportsTopFeaturesQuery",!1),supportsTrueCurve:i(r,"supportsTrueCurve",!1),tileMaxRecordCount:u(t,"tileMaxRecordCount",void 0)}}function A(t){const s=t.advancedQueryCapabilities,e=i(s,"supportsAdvancedQueryRelated",!1);return{supportsPagination:i(s,"supportsQueryRelatedPagination",!1),supportsCount:e,supportsOrderBy:e,supportsCacheHint:l(s,"queryRelated")}}function S(t){return{supportsCacheHint:l(t.advancedQueryCapabilities,"queryTopFilter")}}function T(t){const s=t?t.queryBinsCapabilities:void 0;return{supportsDate:i(s,"supportsDateBin",!1),supportsFixedInterval:i(s,"supportsFixedIntervalBin",!1),supportsAutoInterval:i(s,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:i(s,"supportsFixedBoundariesBin",!1),supportsStackBy:i(s,"supportsStackBy",!1),supportsSplitBy:i(s,"supportsSplitBy",!1),supportsSnapToData:i(s,"supportsSnapToData",!1),supportsReturnFullIntervalBin:i(s,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:i(s,"supportsFirstDayOfWeek",!1),supportsNormalization:i(s,"supportsNormalization",!1),supportedStatistics:d(s),supportedNormalizationTypes:y(s)}}function x(t){const s=t.ownershipBasedAccessControlForFeatures,e=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:i(t,"allowGeometryUpdates",!0),supportsGlobalId:i(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:i(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:i(t,"supportsRollbackOnFailureParameter",!1),supportsTrueCurveUpdate:i(t,"allowTrueCurvesUpdates",!0),supportsTrueCurveUpdateByTrueCurveClientsOnly:i(t,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0),supportsUpdateWithoutM:i(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:i(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:i(s,"allowAnonymousToDelete",!0),supportsDeleteByOthers:i(s,"allowOthersToDelete",!0),supportsUpdateByAnonymous:i(s,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:i(s,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:i(e,"supportsAsyncApplyEdits",!1),zDefault:u(t,"zDefault",void 0)}}function F(e,r){const p=e.supportedCurveTypes??e.advancedQueryCapabilities?.supportedCurveTypes;return Array.isArray(p)?p.map(t=>s.fromJSON(t)).filter(t):r?n:[]}function R(t){return{operations:{supportsAppend:i(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:i(t,"supportsExportClip",!1),supportsExportFrameset:i(t,"supportsExportFrameset",!1),supportsMensuration:i(t,"supportsMensuration",!1),supportsPreviews:i(t,"supportsPreviews",!1),supportsUpdate:i(t,"supportsUpdate",!1)}}}export{n as allCurveTypes,m as getFeatureLayerCapabilities,R as getVideoLayerCapabilities};