@arcgis/core 5.2.0-next.126 → 5.2.0-next.128

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 (234) hide show
  1. package/WebScene.js +1 -1
  2. package/applications/Components/basemapToggleUtils.d.ts +53 -0
  3. package/applications/Components/basemapToggleUtils.js +2 -0
  4. package/applications/SceneViewer/sceneViewerUtils.d.ts +14 -1
  5. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  6. package/applications/WebEditor/sketchUtils.js +1 -1
  7. package/arcgisGlobal.d.ts +1 -0
  8. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  9. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  10. package/assets/esri/core/workers/RemoteClient.js +1 -1
  11. package/assets/esri/core/workers/chunks/{e35eb93c0fb1f6de8db0.js → 00d9e41deecf5828975c.js} +1 -1
  12. package/assets/esri/core/workers/chunks/038d2b80d96237c25b6f.js +1 -0
  13. package/assets/esri/core/workers/chunks/{ab8a1140bf31f46f8ebf.js → 1262918b2161d79851c0.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{d3ef23923424ad8c5048.js → 1c2723f9630e7d597843.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{9ca98fffd43e63d5ade3.js → 1c33aa349beea9a3792f.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{54eeb4cac4fa092359ab.js → 2226c20c38e20713bcb5.js} +2 -2
  17. package/assets/esri/core/workers/chunks/{54eeb4cac4fa092359ab.js.LICENSE.txt → 2226c20c38e20713bcb5.js.LICENSE.txt} +2 -2
  18. package/assets/esri/core/workers/chunks/{4d18451e0ea6ca54101a.js → 2ebad7e588b26e74cefe.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{a8258636096416c837a2.js → 3b7dff15a0058ea29886.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{4716693eca44e8f89f5c.js → 3bf56c33876ba56c4b21.js} +1 -1
  21. package/assets/esri/core/workers/chunks/3c6ee445e49da0076ac1.js +1 -0
  22. package/assets/esri/core/workers/chunks/3f045f09ac95e7f22a97.js +1 -0
  23. package/assets/esri/core/workers/chunks/500f6d6f0ffa235cae85.js +1 -0
  24. package/assets/esri/core/workers/chunks/{56acda1eed3a013430e2.js → 58fb92775d668cfd295c.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{e6637f9176566382ed3e.js → 606cca69eaea84bfcdc6.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{fdbda3d2afea25142b86.js → 6267a1fe1603daa399b4.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{b013b70e40dfb6ce013e.js → 668ec0bdfb2095e90c9e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{806f96ad09e882be41af.js → 67fd2cdb2e6834bfa710.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{5fe5ef5ccf480634d159.js → 75294f515c7f8393181c.js} +1 -1
  30. package/assets/esri/core/workers/chunks/75879ae88fd87b089a87.js +1 -0
  31. package/assets/esri/core/workers/chunks/761ea719ec1b4d562db2.js +1 -0
  32. package/assets/esri/core/workers/chunks/{24673aac70d6c949b6fa.js → 86d7a3ae672a51b75fcc.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{30604a29df320d7a4c6b.js → 88e11b645a1361f1bdbe.js} +1 -1
  34. package/assets/esri/core/workers/chunks/89dad6c1bfd81e4d7f8e.js +1 -0
  35. package/assets/esri/core/workers/chunks/{8daed13400d9e63e65ae.js → 8a842cde240aef12e417.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{c692e583e87af58f6d91.js → 8b0d6205ceeec1ab446f.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{57ab87e70ef85b9405f9.js → 8cb216404a6254bc695c.js} +1 -0
  38. package/assets/esri/core/workers/chunks/92509dd25996c6390a31.js +1 -0
  39. package/assets/esri/core/workers/chunks/9ccc2c8f7416943cc373.js +29 -0
  40. package/assets/esri/core/workers/chunks/a0a9c41400ae98df1912.js +1 -0
  41. package/assets/esri/core/workers/chunks/{b96358d475dc98034aa4.js → a15ed056e7493ddf3b4c.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{25e212fe9a2ea37c9e81.js → a3a33ffa34f4d645ddfe.js} +1 -1
  43. package/assets/esri/core/workers/chunks/af0704494398f33aa315.js +1 -0
  44. package/assets/esri/core/workers/chunks/{ce1ccf9ec90b786591e5.js → b396c4b4bb144200acc7.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{97602019a1ccad22a03a.js → bbfb80a6983574007ce5.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{d5f72670634e73c0b53a.js → bcf2e5cf6b9c6d0442bb.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{17218d714cb07b607c2f.js → c35e9dee87937f483a3d.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{85739ed6af0f0a3cb302.js → c94bdfed831c775e04c0.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{2e3fd81653dc0d86456c.js → cfeba0ffb7fdc2a9af05.js} +1 -1
  50. package/assets/esri/core/workers/chunks/d1187ad6cc4959683819.js +1 -0
  51. package/assets/esri/core/workers/chunks/d94a2b3b2ef49af9c2e3.js +1 -0
  52. package/assets/esri/core/workers/chunks/{cb7cb7d57c4e7f76600f.js → dc92710a8fdfb9135e55.js} +1 -1
  53. package/assets/esri/core/workers/chunks/ec187933b42fe65594b7.js +1 -0
  54. package/assets/esri/core/workers/chunks/eec5a93dbc258a90b6de.js +1 -0
  55. package/assets/esri/core/workers/chunks/{e1ae83ff3e0225708d4d.js → f479b4a4cee4bb2e046c.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{78abd6c42f39e6f6ffbb.js → f983296b6f4a62a911eb.js} +1 -1
  57. package/assets/esri/images/portal/gaussiansplatlayer16.png +0 -0
  58. package/assets/esri/images/portal/knowledgegraphlayer16.png +0 -0
  59. package/assets/esri/images/portal/propresentation16.png +0 -0
  60. package/assets/esri/images/portal/urbanproject16.png +0 -0
  61. package/assets/esri/images/support/loading-throb.gif +0 -0
  62. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  63. package/assets/esri/themes/base/icons/style.scss +0 -0
  64. package/assets/esri/themes/base/icons/variables.scss +0 -0
  65. package/assets/esri/themes/base/images/files/archive-32.svg +0 -0
  66. package/assets/esri/themes/base/images/files/cad-32.svg +0 -0
  67. package/assets/esri/themes/base/images/files/code-32.svg +0 -0
  68. package/assets/esri/themes/base/images/files/csv-32.svg +0 -0
  69. package/assets/esri/themes/base/images/files/excel-32.svg +0 -0
  70. package/assets/esri/themes/base/images/files/generic-32.svg +0 -0
  71. package/assets/esri/themes/base/images/files/gpx-32.svg +0 -0
  72. package/assets/esri/themes/base/images/files/image-32.svg +0 -0
  73. package/assets/esri/themes/base/images/files/pdf-32.svg +0 -0
  74. package/assets/esri/themes/base/images/files/report-32.svg +0 -0
  75. package/assets/esri/themes/base/images/files/sound-32.svg +0 -0
  76. package/assets/esri/themes/base/images/files/text-32.svg +0 -0
  77. package/assets/esri/themes/base/images/files/video-32.svg +0 -0
  78. package/assets/esri/themes/base/images/files/word-32.svg +0 -0
  79. package/assets/esri/themes/base/images/files/zip-32.svg +0 -0
  80. package/assets/esri/themes/base/images/loading-throb.gif +0 -0
  81. package/assets/esri/themes/base/widgets/_Bookmarks.scss +0 -0
  82. package/assets/esri/themes/base/widgets/_Tooltip.scss +42 -3
  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/assets/esri/views/interactive/tooltip/t9n/messages.en.json +1 -1
  87. package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
  88. package/chunks/GlobalIllumination.glsl.js +1 -0
  89. package/config.js +1 -1
  90. package/core/Accessor.d.ts +1 -1
  91. package/core/lang.js +1 -1
  92. package/core/units.js +1 -1
  93. package/geometry/HeightModelInfo.js +1 -1
  94. package/geometry/ellipsoidUtils.js +1 -1
  95. package/geometry/support/heightModelInfoUtils.js +1 -1
  96. package/interfaces.d.ts +1 -0
  97. package/kernel.js +1 -1
  98. package/layers/ElevationLayer.js +1 -1
  99. package/layers/OrientedImageryLayer.js +1 -1
  100. package/layers/ParquetLayer.d.ts +21 -13
  101. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  102. package/layers/graphics/dehydratedFeatures.js +1 -1
  103. package/layers/graphics/transferFeatures.js +2 -0
  104. package/layers/mixins/FeatureLayerBase.js +1 -1
  105. package/layers/mixins/HeightModelInfoMixin.js +2 -0
  106. package/layers/mixins/SceneService.js +1 -1
  107. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  108. package/layers/raster/datasets/RasterFactory.js +1 -1
  109. package/package.json +3 -3
  110. package/popup/FeatureContentCollection.d.ts +15 -25
  111. package/popup/FeatureContentCollection.js +1 -1
  112. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  113. package/rest/query/operations/pbfFeatureServiceParser.js +1 -1
  114. package/support/revision.js +1 -1
  115. package/symbols/cim/callouts/calloutAnalysisUtils.js +2 -0
  116. package/symbols/cim/callouts/effects/BackgroundCallout.js +1 -1
  117. package/symbols/cim/callouts/effects/BalloonCallout.js +1 -1
  118. package/symbols/cim/callouts/effects/PointSymbolCallout.js +1 -1
  119. package/symbols/cim/callouts/effects/SimpleLineCallout.js +1 -1
  120. package/symbols/cim/callouts/effects/calloutUtils.js +1 -1
  121. package/symbols/cim/cimAnalyzer.js +1 -1
  122. package/views/2d/engine/webgl/ClipMesh.js +1 -1
  123. package/views/2d/engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js +1 -1
  124. package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +1 -1
  125. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  126. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  127. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  128. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  129. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  130. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  131. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  132. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js +1 -1
  133. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  134. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  135. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  136. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  137. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js +1 -1
  138. package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
  139. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  140. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +1 -1
  141. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  144. package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
  145. package/views/2d/engine/webgl/util/Matcher.js +1 -1
  146. package/views/2d/layers/LayerView2D.js +1 -1
  147. package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +1 -1
  148. package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +1 -1
  149. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  150. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  151. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  152. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  153. package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
  154. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  155. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  156. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +5 -3
  157. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  158. package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +1 -1
  159. package/views/3d/camera/constraintUtils/surfaceCollision.js +1 -1
  160. package/views/3d/camera/intersectionUtils.js +1 -1
  161. package/views/3d/interactive/editingTools/manipulatedObjectUtils.js +1 -1
  162. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  163. package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
  164. package/views/3d/layers/I3SMeshView3D.js +1 -1
  165. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  166. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  167. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  168. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  169. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  170. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  171. package/views/3d/layers/support/FeatureMemory.js +2 -0
  172. package/views/3d/layers/support/FeatureTile.js +1 -1
  173. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  174. package/views/3d/layers/support/featureReference.js +1 -1
  175. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  176. package/views/3d/state/Constraints.js +1 -1
  177. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  178. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  179. package/views/3d/state/utils/groundNavigationUtils.js +1 -1
  180. package/views/3d/support/PBFDecoder.js +1 -1
  181. package/views/3d/support/PBFDecoderWorker.js +1 -1
  182. package/views/3d/support/QualityProfile.js +1 -1
  183. package/views/3d/support/popupHitTest.js +1 -1
  184. package/views/3d/terrain/TerrainRenderer.js +1 -1
  185. package/views/3d/terrain/TerrainSurface.js +1 -1
  186. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  187. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  188. package/views/DOMContainer.d.ts +2 -2
  189. package/views/DOMContainer.js +1 -1
  190. package/views/PopupView.d.ts +1 -1
  191. package/views/SceneView.js +1 -1
  192. package/views/ToolViewManager.js +1 -1
  193. package/views/interactive/options/TooltipVisibleElements.d.ts +11 -1
  194. package/views/interactive/options/TooltipVisibleElements.js +1 -1
  195. package/views/interactive/tooltip/components/ElevationModeSelect.js +2 -0
  196. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  197. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  198. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
  199. package/views/interactive/tooltip/infos/SketchTooltipInfo.js +1 -1
  200. package/views/support/hitTestSelectUtils.js +1 -1
  201. package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +1 -0
  202. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  203. package/widgets/BasemapToggle.js +1 -1
  204. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +9 -1
  205. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  206. package/widgets/BatchAttributeForm.js +1 -1
  207. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +1 -0
  208. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  209. package/widgets/DirectionalPad.js +1 -1
  210. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  211. package/widgets/Editor/legacy/UpdateFeatureWorkflow.js +1 -1
  212. package/widgets/Editor/workflowUtils.js +1 -1
  213. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  214. package/widgets/OrientedImageryViewer/utils.js +1 -1
  215. package/widgets/Popup/types.d.ts +0 -7
  216. package/widgets/Popup.d.ts +7 -7
  217. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +2 -0
  218. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  219. package/widgets/TimeSlider.js +1 -1
  220. package/assets/esri/core/workers/chunks/0a2b7c691a577cb3d189.js +0 -1
  221. package/assets/esri/core/workers/chunks/2146c25c01c9fc11b16c.js +0 -1
  222. package/assets/esri/core/workers/chunks/4678a8170d8a3ccd1a7b.js +0 -1
  223. package/assets/esri/core/workers/chunks/56e97b98dcb8a3f2bcb7.js +0 -1
  224. package/assets/esri/core/workers/chunks/6c3535aa7250c08b9e5b.js +0 -1
  225. package/assets/esri/core/workers/chunks/6e75f09fb9452bd5f9fb.js +0 -1
  226. package/assets/esri/core/workers/chunks/7441d121f00ce747c08e.js +0 -1
  227. package/assets/esri/core/workers/chunks/76548469fe1b9c3b2051.js +0 -1
  228. package/assets/esri/core/workers/chunks/82ce034b5ba54de9b970.js +0 -29
  229. package/assets/esri/core/workers/chunks/ba435cc73956d9c64a11.js +0 -1
  230. package/assets/esri/core/workers/chunks/c77496c350004ee66eb2.js +0 -1
  231. package/assets/esri/core/workers/chunks/d371d9279b30548efa02.js +0 -1
  232. package/assets/esri/core/workers/chunks/dc52e036547612949d32.js +0 -1
  233. package/assets/esri/core/workers/chunks/e5ee64e2fb5bfcb716d8.js +0 -1
  234. package/views/2d/engine/webgl/mesh/bufcut.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{baseObjectMemory as e,estimateNumberArrayMemory as t,estimateNestedObjectMemory as s,estimateAttributesMemory as n}from"../../core/memoryEstimations.js";import{generateUID as r}from"../../core/uid.js";import i from"../../geometry/SpatialReference.js";import{empty as o,expandWithNestedArray as a}from"../../geometry/support/aaBoundingBox.js";import{empty as l,expandWithNestedArray as u}from"../../geometry/support/aaBoundingRect.js";import{unquantizePolyline as c,unquantizePolygon as p,unquantizeMultipoint as m,unquantizePoint as h}from"../../geometry/support/quantizationUtils.js";import{featureGeometryTypeKebabDictionary as f}from"../../geometry/support/typeUtils.js";import y from"../support/Field.js";import{getApproximateMaxDensificationSegments as g}from"../../views/2d/layers/graphics/densificationConstants.js";export{equals}from"./dehydratedFeatureComparison.js";class d{constructor(e,t,s){this.uid=e,this.geometry=t,this.attributes=s,this.visible=!0,this.objectId=null,this.centroid=null}}function b(e){return null!=e.geometry}class x{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}function j(e,t){const s=f.fromJSON(e.geometryType),n=i.fromJSON(e.spatialReference),r=e.transform,o=e.objectIdFieldName,a=t?.maxStringAttributeLength,l=t?.maxStringAttributeFields;let u;const g=e.features.map(t=>{const i=N(t,s,n,e.objectIdFieldName),f=i.geometry;if(w(i.attributes,l,a,e=>{u??=[];const t=R(i,o);null!=t&&u.push({objectId:t,attribute:e})}),null!=f&&r)switch(f.type){case"point":i.geometry=h(r,f,f);break;case"multipoint":i.geometry=m(r,f,f);break;case"polygon":i.geometry=p(r,f,f);break;case"polyline":i.geometry=c(r,f,f);break;case"extent":case"mesh":i.geometry=f}return i});return{geometryType:s,features:g,spatialReference:n,fields:e.fields?.map(e=>y.fromJSON(e))??[],objectIdFieldName:e.objectIdFieldName,globalIdFieldName:e.globalIdFieldName,geohashFieldName:e.geohashFieldName,geometryProperties:e.geometryProperties,hasZ:e.hasZ,hasM:e.hasM,exceededTransferLimit:e.exceededTransferLimit,transform:null,missingAttributes:u}}function N(e,t,s,n){return{uid:r(),objectId:n&&e.attributes?e.attributes[n]:null,attributes:e.attributes,geometry:Z(e.geometry,t,s),visible:!0}}function Z(e,t,s){if(null==e)return null;switch(t){case"point":{const t=e;return{x:t.x,y:t.y,z:t.z,m:t.m,hasZ:null!=t.z,hasM:null!=t.m,type:"point",spatialReference:s}}case"polyline":{const t=e;return{paths:t.paths,hasZ:!!t.hasZ,hasM:!!t.hasM,type:"polyline",spatialReference:s}}case"polygon":{const t=e;return{rings:t.rings,hasZ:!!t.hasZ,hasM:!!t.hasM,type:"polygon",spatialReference:s}}case"multipoint":{const t=e;return{points:t.points,hasZ:!!t.hasZ,hasM:!!t.hasM,type:"multipoint",spatialReference:s}}}}function F(n){if(null==n)return 0;switch(n.type){case"point":return e+10+8+24;case"polyline":case"polygon":{let t=0;const r=2+(n.hasZ?1:0)+(n.hasM?1:0),i="polyline"===n.type?n.paths:n.rings,o="polyline"===n.type?n.curvePaths:n.curveRings;if(o?.length){const e=3*g()*128;t=8*e*r+128*e+32*(i.length+1)}else t=s(i);return e+64+t+34}case"multipoint":{const t=s(n.points);return e+t+64+34+32}case"extent":return e+10+64+34;case"mesh":{const s=n.vertexAttributes;return e+t(s.position,s.normal,s.uv,s.tangent)}default:return e}}function I(e){let t=32;return t+=n(e.attributes),t+=3,t+=8+F(e.geometry),t}function k(e){if(null==e)return 0;switch(e.type){case"point":return 1;case"polyline":{let t=0;for(const s of e.paths)t+=s.length;return t}case"polygon":{let t=0;for(const s of e.rings)t+=s.length;return t}case"multipoint":return e.points.length;case"extent":return 2;case"mesh":{const t=e.vertexAttributes&&e.vertexAttributes.position;return t?t.length/3:0}default:return}}function M(e){if(null==e)return!1;switch(e.type){case"extent":case"point":return!0;case"polyline":for(const t of e.paths)if(t.length>0)return!0;return!1;case"polygon":for(const t of e.rings)if(t.length>0)return!0;return!1;case"multipoint":return e.points.length>0;case"mesh":return!e.loaded||e.vertexAttributes.position.length>0}}function v(e,t){switch(o(t),"mesh"===e.type&&(e=e.extent),e.type){case"point":t[0]=t[3]=e.x,t[1]=t[4]=e.y,e.hasZ&&(t[2]=t[5]=e.z);break;case"polyline":for(let s=0;s<e.paths.length;s++)a(t,e.paths[s],!!e.hasZ);break;case"polygon":for(let s=0;s<e.rings.length;s++)a(t,e.rings[s],!!e.hasZ);break;case"multipoint":a(t,e.points,!!e.hasZ);break;case"extent":t[0]=e.xmin,t[1]=e.ymin,t[3]=e.xmax,t[4]=e.ymax,null!=e.zmin&&(t[2]=e.zmin),null!=e.zmax&&(t[5]=e.zmax)}return t}function z(e,t){switch(l(t),"mesh"===e.type&&(e=e.extent),e.type){case"point":t[0]=t[2]=e.x,t[1]=t[3]=e.y;break;case"polyline":for(let s=0;s<e.paths.length;s++)u(t,e.paths[s]);break;case"polygon":for(let s=0;s<e.rings.length;s++)u(t,e.rings[s]);break;case"multipoint":u(t,e.points);break;case"extent":t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax}}function R(e,t){return null!=e.objectId?e.objectId:e.attributes&&t?e.attributes[t]:null}function w(e,t,s,n){if(t?.size&&null!=s&&e)for(const r in e){if(!t.has(r))continue;const i=e[r];"string"==typeof i&&i.length>s&&(n(r),e[r]="")}}export{d as DehydratedFeatureClass,x as DehydratedFeatureSetClass,v as computeAABB,z as computeAABR,F as estimateGeometryMemory,I as estimateSize,j as fromFeatureSetJSON,Z as fromJSONGeometry,R as getObjectId,b as hasGeometry,M as hasVertices,k as numVertices,w as removeLargeStringAttributes};
2
+ import{baseObjectMemory as e,estimateNumberArrayMemory as t,estimateNestedObjectMemory as s,estimateAttributesMemory as n}from"../../core/memoryEstimations.js";import{generateUID as r}from"../../core/uid.js";import i from"../../geometry/SpatialReference.js";import{empty as o,expandWithNestedArray as a}from"../../geometry/support/aaBoundingBox.js";import{empty as l,expandWithNestedArray as u}from"../../geometry/support/aaBoundingRect.js";import{unquantizePolyline as c,unquantizePolygon as p,unquantizeMultipoint as m,unquantizePoint as h}from"../../geometry/support/quantizationUtils.js";import{featureGeometryTypeKebabDictionary as y}from"../../geometry/support/typeUtils.js";import{getApproximateMaxDensificationSegments as g}from"../../views/2d/layers/graphics/densificationConstants.js";export{equals}from"./dehydratedFeatureComparison.js";class f{constructor(e,t,s){this.uid=e,this.geometry=t,this.attributes=s,this.visible=!0,this.objectId=null,this.centroid=null}}function d(e){return null!=e.geometry}class b{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null,this.missingAttributes=null}}function x(e,t){const s=y.fromJSON(e.geometryType),n=i.fromJSON(e.spatialReference),r=e.transform,o=e.objectIdFieldName,a=t?.maxStringAttributeLength,l=t?.maxStringAttributeFields;let u;const g=e.features.map(t=>{const i=j(t,s,n,e.objectIdFieldName),y=i.geometry;if(A(i.attributes,l,a,e=>{u??=[];const t=R(i,o);null!=t&&u.push({objectId:t,attribute:e})}),null!=y&&r)switch(y.type){case"point":i.geometry=h(r,y,y);break;case"multipoint":i.geometry=m(r,y,y);break;case"polygon":i.geometry=p(r,y,y);break;case"polyline":i.geometry=c(r,y,y);break;case"extent":case"mesh":i.geometry=y}return i});return{geometryType:s,features:g,spatialReference:n,fields:e.fields??[],objectIdFieldName:e.objectIdFieldName,globalIdFieldName:e.globalIdFieldName,geohashFieldName:e.geohashFieldName,geometryProperties:e.geometryProperties,hasZ:e.hasZ,hasM:e.hasM,exceededTransferLimit:e.exceededTransferLimit,transform:null,missingAttributes:u}}function j(e,t,s,n){return{uid:r(),objectId:n&&e.attributes?e.attributes[n]:null,attributes:e.attributes,geometry:Z(e.geometry,t,s),visible:!0}}function Z(e,t,s){if(null==e)return null;switch(t){case"point":{const t=e;return{x:t.x,y:t.y,z:t.z,m:t.m,hasZ:null!=t.z,hasM:null!=t.m,type:"point",spatialReference:s}}case"polyline":{const t=e;return{paths:t.paths,hasZ:!!t.hasZ,hasM:!!t.hasM,type:"polyline",spatialReference:s}}case"polygon":{const t=e;return{rings:t.rings,hasZ:!!t.hasZ,hasM:!!t.hasM,type:"polygon",spatialReference:s}}case"multipoint":{const t=e;return{points:t.points,hasZ:!!t.hasZ,hasM:!!t.hasM,type:"multipoint",spatialReference:s}}}}function N(n){if(null==n)return 0;switch(n.type){case"point":return e+10+8+24;case"polyline":case"polygon":{let t=0;const r=2+(n.hasZ?1:0)+(n.hasM?1:0),i="polyline"===n.type?n.paths:n.rings,o="polyline"===n.type?n.curvePaths:n.curveRings;if(o?.length){const e=3*g()*128;t=8*e*r+128*e+32*(i.length+1)}else t=s(i);return e+64+t+34}case"multipoint":{const t=s(n.points);return e+t+64+34+32}case"extent":return e+10+64+34;case"mesh":{const s=n.vertexAttributes;return e+t(s.position,s.normal,s.uv,s.tangent)}default:return e}}const F=43;function I(e){return F+n(e.attributes)+N(e.geometry)}function k(e){if(null==e)return 0;switch(e.type){case"point":return 1;case"polyline":{let t=0;for(const s of e.paths)t+=s.length;return t}case"polygon":{let t=0;for(const s of e.rings)t+=s.length;return t}case"multipoint":return e.points.length;case"extent":return 2;case"mesh":{const t=e.vertexAttributes&&e.vertexAttributes.position;return t?t.length/3:0}default:return}}function M(e){if(null==e)return!1;switch(e.type){case"extent":case"point":return!0;case"polyline":for(const t of e.paths)if(t.length>0)return!0;return!1;case"polygon":for(const t of e.rings)if(t.length>0)return!0;return!1;case"multipoint":return e.points.length>0;case"mesh":return!e.loaded||e.vertexAttributes.position.length>0}}function v(e,t){switch(o(t),"mesh"===e.type&&(e=e.extent),e.type){case"point":t[0]=t[3]=e.x,t[1]=t[4]=e.y,e.hasZ&&(t[2]=t[5]=e.z);break;case"polyline":for(let s=0;s<e.paths.length;s++)a(t,e.paths[s],!!e.hasZ);break;case"polygon":for(let s=0;s<e.rings.length;s++)a(t,e.rings[s],!!e.hasZ);break;case"multipoint":a(t,e.points,!!e.hasZ);break;case"extent":t[0]=e.xmin,t[1]=e.ymin,t[3]=e.xmax,t[4]=e.ymax,null!=e.zmin&&(t[2]=e.zmin),null!=e.zmax&&(t[5]=e.zmax)}return t}function z(e,t){switch(l(t),"mesh"===e.type&&(e=e.extent),e.type){case"point":t[0]=t[2]=e.x,t[1]=t[3]=e.y;break;case"polyline":for(let s=0;s<e.paths.length;s++)u(t,e.paths[s]);break;case"polygon":for(let s=0;s<e.rings.length;s++)u(t,e.rings[s]);break;case"multipoint":u(t,e.points);break;case"extent":t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax}}function R(e,t){return null!=e.objectId?e.objectId:e.attributes&&t?e.attributes[t]:null}function A(e,t,s,n){if(t?.size&&null!=s&&e)for(const r in e){if(!t.has(r))continue;const i=e[r];"string"==typeof i&&i.length>s&&(n(r),e[r]="")}}export{f as DehydratedFeatureClass,b as DehydratedFeatureSetClass,F as baseDehydratedGraphicMemory,v as computeAABB,z as computeAABR,N as estimateGeometryMemory,I as estimateSize,x as fromFeatureSetJSON,Z as fromJSONGeometry,R as getObjectId,d as hasGeometry,M as hasVertices,k as numVertices,A as removeLargeStringAttributes};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ function t(t,e,o){if(!t||"extent"===t.type||"mesh"===t.type)return t;if("point"===t.type)return t.spatialReference=o,t;const{coords:s,lengths:n}=e,{hasZ:p,hasM:r}=t,f=2+Number(!!p)+Number(!!r),i="multipoint"===t.type?[s.length/f]:n,u=[];let l=0;if(2===f)for(const h of i){const t=[];for(let e=0;e<h;e++,l+=2)t.push([s[l],s[l+1]]);u.push(t)}else if(3===f)for(const h of i){const t=[];for(let e=0;e<h;e++,l+=3)t.push([s[l],s[l+1],s[l+2]]);u.push(t)}else for(const h of i){const t=[];for(let e=0;e<h;e++,l+=4)t.push([s[l],s[l+1],s[l+2],s[l+3]]);u.push(t)}return t.spatialReference=o,"multipoint"===t.type?t.points=u[0]:"polygon"===t.type?t.rings=u:t.paths=u,t}export{t as toDehydratedGeometry};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{clone as i}from"../../core/lang.js";import{hasSameOrigin as r,getHost as o,changeHost as s}from"../../core/urlUtils.js";import{property as n,subclass as p}from"../../core/accessorSupport/decorators.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import{idToName as d}from"../../core/accessorSupport/PropertyOrigin.js";import a from"../../geometry/Extent.js";import u from"../../geometry/HeightModelInfo.js";import c from"../../geometry/SpatialReference.js";import{elevationInfo as y,maxScale as f,minScale as m,timeInfo as h}from"../support/commonProperties.js";import v from"../support/EditFieldsInfo.js";import{FeatureIndex as g}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as I,hasCurrentUser as F,isLayerCacheStale as S,supportsQueryOnly as b,readGlobalIdField as j,readObjectIdField as E,readVersion as U}from"../support/featureLayerUtils.js";import x from"../support/GeometryFieldsInfo.js";import O from"../support/LayerFloorInfo.js";import{isPreferredUrlApplicable as M,getPreferredUrl as D,applyPreferredHostToPortalItem as T,getPreferredHost as w}from"../support/layerUtils.js";import{urlProperty as C,normalizeParsedUrlObject as H}from"../support/multiLayerServiceUtils.js";import R from"../support/Relationship.js";import{getFeatureLayerCapabilities as B}from"../support/serviceCapabilitiesUtils.js";import A from"../support/Subtype.js";import{hasTypeKeyword as q,typeKeyword as Q}from"../../portal/support/portalItemUtils.js";import{timeZoneProperty as P}from"../../time/timeZoneUtils.js";import{reader as G}from"../../core/accessorSupport/decorators/reader.js";const V=V=>{const Z=V;let _=class extends Z{constructor(){super(...arguments),this.cacheMaxAge=0,this.capabilities=null,this.copyright=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(g)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=c.WGS84,this.subtypeField=null,this.subtypes=null,this.timeInfo=null,this.trackIdField=null,this.uniqueIdFields=null,this.url=null,this.version=void 0,this._isUrlHostModified=!1,this._isUrlHostModificationEnabled=!1}getFieldDomain(e,t){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:i,editing:r}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(i.supportsEditing&&!(r.supportsUpdateByOthers&&r.supportsUpdateByAnonymous&&r.supportsDeleteByOthers&&r.supportsDeleteByAnonymous))return"load"}if(F(this.serviceDefinitionExpression)||F(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(S(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return B(t,this.url)}readEditingInfo(e,t){const{editingInfo:i}=t;return i?{lastEditDate:null!=i.lastEditDate?new Date(i.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=i(e),{operations:r,editing:o}=t;return b(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}get effectiveUniqueIdFields(){return this.uniqueIdFields?[...this.uniqueIdFields]:[this.objectIdField]}readGlobalIdFieldFromService(e,t){return j(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||b(this))return!1;const{operations:t,editing:i}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&i.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:i}=e;return b(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&i.supportsDeleteByOthers&&i.supportsGeometryUpdate&&i.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return E(t)}get parsedUrl(){return H(this)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readUniqueIdFields(e,t){return t.uniqueIdInfo?.OIDFieldContainsHashValue?t.uniqueIdInfo.fields:null}readVersion(e,t){return U(t)}get isUrlHostModified(){const{loaded:e,url:t,_isUrlHostModified:i}=this;if(i)return!0;if(!e||!t)return!1;if(this.originIdOf("url")<7)return!1;const o=this.sourceJSON?.preferredHost;if(!o)return!1;if(!r(t,`https://${o}`,!0))return!1;for(let s=6;s>=3;s--){const e=this.getAtOrigin("url",d(s));if(e)return!r(t,e,!0)}return!1}applyPreferredHost(e){const{url:t,portalItem:i}=this;if(!t||!M(i))return;const r=D();r&&this._isUrlHostModificationEnabled&&(this._set("url",r),this._isUrlHostModified=!0,i&&T(i,w()))}applyHostFromPortalItem(){const{url:e,portalItem:t}=this;if(!e||7===this.originIdOf("url")||!t?.url||!M(t)||!q(t,Q.HOSTED_SERVICE)||r(e,t.url,!0)||!this._isUrlHostModificationEnabled)return;const i=o(t.url);this._set("url",s(e,i)),this._isUrlHostModified=!0}};return e([n({readOnly:!0})],_.prototype,"authenticationTriggerEvent",null),e([n({readOnly:!0,json:{read:e=>e/60}})],_.prototype,"cacheMaxAge",void 0),e([n({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","maxUniqueIDCount","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","standardMaxRecordCountNoGeometry","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],_.prototype,"capabilities",void 0),e([G("service","capabilities")],_.prototype,"readCapabilitiesFromService",null),e([n({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],_.prototype,"copyright",void 0),e([n(P("dateFieldsTimeReference"))],_.prototype,"dateFieldsTimeZone",void 0),e([n({type:Boolean})],_.prototype,"datesInUnknownTimezone",void 0),e([n({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_.prototype,"definitionExpression",void 0),e([n({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],_.prototype,"displayField",void 0),e([n({readOnly:!0,type:v})],_.prototype,"editFieldsInfo",void 0),e([n({readOnly:!0})],_.prototype,"editingInfo",void 0),e([G("editingInfo")],_.prototype,"readEditingInfo",null),e([n({readOnly:!0})],_.prototype,"effectiveCapabilities",null),e([n()],_.prototype,"effectiveEditingEnabled",null),e([n({readOnly:!0,type:[String]})],_.prototype,"effectiveUniqueIdFields",null),e([n((()=>{const e=i(y),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],_.prototype,"elevationInfo",void 0),e([n()],_.prototype,"fieldsIndex",void 0),e([n({type:O,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:l}}})],_.prototype,"floorInfo",void 0),e([n({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],_.prototype,"fullExtent",void 0),e([n()],_.prototype,"gdbVersion",void 0),e([n({readOnly:!0,type:x,json:{read:{source:"geometryProperties"}}})],_.prototype,"geometryFieldsInfo",void 0),e([n({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:I.read}}}})],_.prototype,"geometryType",void 0),e([n({type:String})],_.prototype,"globalIdField",void 0),e([G("service","globalIdField",["globalIdField","fields"])],_.prototype,"readGlobalIdFieldFromService",null),e([n({readOnly:!0})],_.prototype,"hasFullEditingRestrictions",null),e([n({type:Boolean,json:{origins:{service:{read:!0}}}})],_.prototype,"hasM",void 0),e([n({readOnly:!0})],_.prototype,"hasUpdateItemRestrictions",null),e([n({type:Boolean,json:{origins:{service:{read:!0}}}})],_.prototype,"hasZ",void 0),e([n({readOnly:!0,type:u})],_.prototype,"heightModelInfo",void 0),e([n({type:Date})],_.prototype,"historicMoment",void 0),e([n({type:t.ofType(g),readOnly:!0})],_.prototype,"indexes",void 0),e([n({readOnly:!0})],_.prototype,"isTable",void 0),e([G("service","isTable",["type"])],_.prototype,"readIsTableFromService",null),e([n({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],_.prototype,"layerId",void 0),e([n(f)],_.prototype,"maxScale",void 0),e([G("service","maxScale",["maxScale","effectiveMaxScale"])],_.prototype,"readMaxScale",null),e([n(m)],_.prototype,"minScale",void 0),e([G("service","minScale",["minScale","effectiveMinScale"])],_.prototype,"readMinScale",null),e([n({type:String})],_.prototype,"objectIdField",void 0),e([G("service","objectIdField",["objectIdField","fields"])],_.prototype,"readObjectIdFieldFromService",null),e([n({readOnly:!0})],_.prototype,"parsedUrl",null),e([n(P("preferredTimeReference"))],_.prototype,"preferredTimeZone",void 0),e([n({type:[R],readOnly:!0})],_.prototype,"relationships",void 0),e([n({type:Boolean})],_.prototype,"returnM",void 0),e([n({type:Boolean})],_.prototype,"returnZ",void 0),e([n({readOnly:!0,json:{write:!1}})],_.prototype,"serverGens",void 0),e([n({readOnly:!0})],_.prototype,"serviceDefinitionExpression",void 0),e([G("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],_.prototype,"readServiceDefinitionExpression",null),e([n({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_.prototype,"serviceItemId",void 0),e([n()],_.prototype,"sourceJSON",void 0),e([n({type:c,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],_.prototype,"spatialReference",void 0),e([n({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],_.prototype,"subtypeField",void 0),e([n({type:[A],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_.prototype,"subtypes",void 0),e([n(h())],_.prototype,"timeInfo",void 0),e([n({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],_.prototype,"trackIdField",void 0),e([n({type:[String]})],_.prototype,"uniqueIdFields",void 0),e([G("service","uniqueIdFields",["uniqueIdInfo.OIDFieldContainsHashValue","uniqueIdInfo.fields"])],_.prototype,"readUniqueIdFields",null),e([n(C({nonStandardUrlAllowed:!0}))],_.prototype,"url",void 0),e([n({json:{origins:{service:{read:!0}},read:!1}})],_.prototype,"version",void 0),e([G("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],_.prototype,"readVersion",null),e([n({readOnly:!0})],_.prototype,"isUrlHostModified",null),_=e([p("esri.layers.mixins.FeatureLayerBase")],_),_};export{V as FeatureLayerBase};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Collection.js";import{clone as i}from"../../core/lang.js";import{hasSameOrigin as r,getHost as o,changeHost as s}from"../../core/urlUtils.js";import{property as n,subclass as p}from"../../core/accessorSupport/decorators.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import{idToName as d}from"../../core/accessorSupport/PropertyOrigin.js";import a from"../../geometry/Extent.js";import u from"../../geometry/SpatialReference.js";import{HeightModelInfoMixin as c}from"./HeightModelInfoMixin.js";import{elevationInfo as y,maxScale as f,minScale as m,timeInfo as h}from"../support/commonProperties.js";import v from"../support/EditFieldsInfo.js";import{FeatureIndex as g}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as I,hasCurrentUser as F,isLayerCacheStale as S,supportsQueryOnly as b,readGlobalIdField as j,readObjectIdField as E,readVersion as U}from"../support/featureLayerUtils.js";import x from"../support/GeometryFieldsInfo.js";import O from"../support/LayerFloorInfo.js";import{isPreferredUrlApplicable as M,getPreferredUrl as D,applyPreferredHostToPortalItem as T,getPreferredHost as w}from"../support/layerUtils.js";import{urlProperty as C,normalizeParsedUrlObject as H}from"../support/multiLayerServiceUtils.js";import R from"../support/Relationship.js";import{getFeatureLayerCapabilities as B}from"../support/serviceCapabilitiesUtils.js";import A from"../support/Subtype.js";import{hasTypeKeyword as q,typeKeyword as Q}from"../../portal/support/portalItemUtils.js";import{timeZoneProperty as P}from"../../time/timeZoneUtils.js";import{reader as G}from"../../core/accessorSupport/decorators/reader.js";const V=V=>{const Z=c(V);let _=class extends Z{constructor(){super(...arguments),this.cacheMaxAge=0,this.capabilities=null,this.copyright=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.historicMoment=null,this.indexes=new(t.ofType(g)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=u.WGS84,this.subtypeField=null,this.subtypes=null,this.timeInfo=null,this.trackIdField=null,this.uniqueIdFields=null,this.url=null,this.version=void 0,this._isUrlHostModified=!1,this._isUrlHostModificationEnabled=!1}getFieldDomain(e,t){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:i,editing:r}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(i.supportsEditing&&!(r.supportsUpdateByOthers&&r.supportsUpdateByAnonymous&&r.supportsDeleteByOthers&&r.supportsDeleteByAnonymous))return"load"}if(F(this.serviceDefinitionExpression)||F(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(S(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return B(t,this.url)}readEditingInfo(e,t){const{editingInfo:i}=t;return i?{lastEditDate:null!=i.lastEditDate?new Date(i.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=i(e),{operations:r,editing:o}=t;return b(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}get effectiveUniqueIdFields(){return this.uniqueIdFields?[...this.uniqueIdFields]:[this.objectIdField]}readGlobalIdFieldFromService(e,t){return j(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||b(this))return!1;const{operations:t,editing:i}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&i.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:i}=e;return b(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&i.supportsDeleteByOthers&&i.supportsGeometryUpdate&&i.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return E(t)}get parsedUrl(){return H(this)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readUniqueIdFields(e,t){return t.uniqueIdInfo?.OIDFieldContainsHashValue?t.uniqueIdInfo.fields:null}readVersion(e,t){return U(t)}get isUrlHostModified(){const{loaded:e,url:t,_isUrlHostModified:i}=this;if(i)return!0;if(!e||!t)return!1;if(this.originIdOf("url")<7)return!1;const o=this.sourceJSON?.preferredHost;if(!o)return!1;if(!r(t,`https://${o}`,!0))return!1;for(let s=6;s>=3;s--){const e=this.getAtOrigin("url",d(s));if(e)return!r(t,e,!0)}return!1}applyPreferredHost(e){const{url:t,portalItem:i}=this;if(!t||!M(i))return;const r=D();r&&this._isUrlHostModificationEnabled&&(this._set("url",r),this._isUrlHostModified=!0,i&&T(i,w()))}applyHostFromPortalItem(){const{url:e,portalItem:t}=this;if(!e||7===this.originIdOf("url")||!t?.url||!M(t)||!q(t,Q.HOSTED_SERVICE)||r(e,t.url,!0)||!this._isUrlHostModificationEnabled)return;const i=o(t.url);this._set("url",s(e,i)),this._isUrlHostModified=!0}};return e([n({readOnly:!0})],_.prototype,"authenticationTriggerEvent",null),e([n({readOnly:!0,json:{read:e=>e/60}})],_.prototype,"cacheMaxAge",void 0),e([n({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","maxUniqueIDCount","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","standardMaxRecordCountNoGeometry","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],_.prototype,"capabilities",void 0),e([G("service","capabilities")],_.prototype,"readCapabilitiesFromService",null),e([n({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],_.prototype,"copyright",void 0),e([n(P("dateFieldsTimeReference"))],_.prototype,"dateFieldsTimeZone",void 0),e([n({type:Boolean})],_.prototype,"datesInUnknownTimezone",void 0),e([n({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_.prototype,"definitionExpression",void 0),e([n({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],_.prototype,"displayField",void 0),e([n({readOnly:!0,type:v})],_.prototype,"editFieldsInfo",void 0),e([n({readOnly:!0})],_.prototype,"editingInfo",void 0),e([G("editingInfo")],_.prototype,"readEditingInfo",null),e([n({readOnly:!0})],_.prototype,"effectiveCapabilities",null),e([n()],_.prototype,"effectiveEditingEnabled",null),e([n({readOnly:!0,type:[String]})],_.prototype,"effectiveUniqueIdFields",null),e([n((()=>{const e=i(y),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],_.prototype,"elevationInfo",void 0),e([n()],_.prototype,"fieldsIndex",void 0),e([n({type:O,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:l}}})],_.prototype,"floorInfo",void 0),e([n({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],_.prototype,"fullExtent",void 0),e([n()],_.prototype,"gdbVersion",void 0),e([n({readOnly:!0,type:x,json:{read:{source:"geometryProperties"}}})],_.prototype,"geometryFieldsInfo",void 0),e([n({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:I.read}}}})],_.prototype,"geometryType",void 0),e([n({type:String})],_.prototype,"globalIdField",void 0),e([G("service","globalIdField",["globalIdField","fields"])],_.prototype,"readGlobalIdFieldFromService",null),e([n({readOnly:!0})],_.prototype,"hasFullEditingRestrictions",null),e([n({type:Boolean,json:{origins:{service:{read:!0}}}})],_.prototype,"hasM",void 0),e([n({readOnly:!0})],_.prototype,"hasUpdateItemRestrictions",null),e([n({type:Boolean,json:{origins:{service:{read:!0}}}})],_.prototype,"hasZ",void 0),e([n({type:Date})],_.prototype,"historicMoment",void 0),e([n({type:t.ofType(g),readOnly:!0})],_.prototype,"indexes",void 0),e([n({readOnly:!0})],_.prototype,"isTable",void 0),e([G("service","isTable",["type"])],_.prototype,"readIsTableFromService",null),e([n({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],_.prototype,"layerId",void 0),e([n(f)],_.prototype,"maxScale",void 0),e([G("service","maxScale",["maxScale","effectiveMaxScale"])],_.prototype,"readMaxScale",null),e([n(m)],_.prototype,"minScale",void 0),e([G("service","minScale",["minScale","effectiveMinScale"])],_.prototype,"readMinScale",null),e([n({type:String})],_.prototype,"objectIdField",void 0),e([G("service","objectIdField",["objectIdField","fields"])],_.prototype,"readObjectIdFieldFromService",null),e([n({readOnly:!0})],_.prototype,"parsedUrl",null),e([n(P("preferredTimeReference"))],_.prototype,"preferredTimeZone",void 0),e([n({type:[R],readOnly:!0})],_.prototype,"relationships",void 0),e([n({type:Boolean})],_.prototype,"returnM",void 0),e([n({type:Boolean})],_.prototype,"returnZ",void 0),e([n({readOnly:!0,json:{write:!1}})],_.prototype,"serverGens",void 0),e([n({readOnly:!0})],_.prototype,"serviceDefinitionExpression",void 0),e([G("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],_.prototype,"readServiceDefinitionExpression",null),e([n({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_.prototype,"serviceItemId",void 0),e([n()],_.prototype,"sourceJSON",void 0),e([n({type:u,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],_.prototype,"spatialReference",void 0),e([n({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],_.prototype,"subtypeField",void 0),e([n({type:[A],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_.prototype,"subtypes",void 0),e([n(h())],_.prototype,"timeInfo",void 0),e([n({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],_.prototype,"trackIdField",void 0),e([n({type:[String]})],_.prototype,"uniqueIdFields",void 0),e([G("service","uniqueIdFields",["uniqueIdInfo.OIDFieldContainsHashValue","uniqueIdInfo.fields"])],_.prototype,"readUniqueIdFields",null),e([n(C({nonStandardUrlAllowed:!0}))],_.prototype,"url",void 0),e([n({json:{origins:{service:{read:!0}},read:!1}})],_.prototype,"version",void 0),e([G("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],_.prototype,"readVersion",null),e([n({readOnly:!0})],_.prototype,"isUrlHostModified",null),_=e([p("esri.layers.mixins.FeatureLayerBase")],_),_};export{V as FeatureLayerBase};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{property as o,subclass as t}from"../../core/accessorSupport/decorators.js";import r from"../../geometry/HeightModelInfo.js";const i=i=>{const s=i;let n=class extends s{constructor(){super(...arguments),this.heightModelInfo=null}read(e,o){super.read(e,o),"service"===o?.origin&&2===this.heightModelInfo?.origin&&(this.heightModelInfo.associatedSpatialReference=this.getAtOrigin("spatialReference","service"))}};return e([o({readOnly:!0,type:r})],n.prototype,"heightModelInfo",void 0),n=e([t("esri.layers.mixins.HeightModelInfoMixin")],n),n};export{i as HeightModelInfoMixin};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{debounce as o}from"../../core/promiseUtils.js";import{property as s,subclass as a}from"../../core/accessorSupport/decorators.js";import{updateOrigins as n}from"../../core/accessorSupport/originUtils.js";import l from"../../geometry/Extent.js";import p from"../../geometry/HeightModelInfo.js";import c from"../../geometry/SpatialReference.js";import{titleFromUrlAndName as u,parse as d,cleanTitle as y,sanitizeUrlWithLayerId as m}from"../support/arcgisLayerUrl.js";import{id as h}from"../support/commonProperties.js";import{fetchIndexInfo as f}from"../support/I3SIndexInfo.js";import{urlProperty as v,normalizeParsedUrlObject as S}from"../support/multiLayerServiceUtils.js";import{getLoader as g}from"../support/schemaValidatorLoader.js";import w from"../../portal/Portal.js";import x from"../../portal/PortalItem.js";import{createForItemWrite as I}from"../../portal/support/jsonContext.js";import{saveResources as j,updateItemWithResources as b}from"../../webdoc/support/resourceUtils.js";import{evaluateWriteErrors as N}from"../../webdoc/support/saveUtils.js";import{reader as _}from"../../core/accessorSupport/decorators/reader.js";const R=m=>{const R=m;let E=class extends R{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=o(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return T(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=null==e.spatialReference?{...e,spatialReference:T(t)}:e;return l.fromJSON(i,r)}const i=t.store,o=T(t);return null==o||null==i?.extent||!Array.isArray(i.extent)||i.extent.some(e=>e<L)?null:new l({xmin:i.extent[0],ymin:i.extent[1],xmax:i.extent[2],ymax:i.extent[3],spatialReference:o})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,i=null!=r.version?r.version.toString():"";return this.parseVersionString(i)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){if("item-title"===this.sublayerTitleMode)return this.url?u(this.url,t.name):t.name;let r=t.name;if(!r&&this.url){const e=d(this.url);null!=e&&(r=e.title)}const i=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&i&&(r=i+" - "+r),y(r)}get parsedUrl(){return S(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=f(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,i.getLogger(this),t),this.indexInfo.catch(()=>{});const{fullExtent:r}=this;null==r||r.hasZ||this._updateExtent(r,await this.indexInfo)}_updateExtent(e,t){if("page"===t?.type){const r=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[r];A(e,i?.obb)}else if("node"===t?.type){const r=t.rootNode?.mbs;if(!Array.isArray(r)||4!==r.length||r[0]<L)return;const i=r[2],o=r[3];e.zmin=i-o,e.zmax=i+o}}async _fetchService(e){if(null==this.url)throw new r("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const r=await t(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(r.data&&Array.isArray(r.data.layers)&&r.data.layers.length>0)return r.data.layers[0].id}async _fetchServiceLayer(e){const r=await t(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});r.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(r.data.layerType&&"Voxel"===r.data.layerType&&(i=!0),i)return this._fetchVoxelServiceLayer();const o=r.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const r=(await t(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,this._getServiceContext()),this.validateLayer(r)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const i={...P,...t};let o=x.from(e);if(!o)throw new r("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");o.id&&(o=o.clone(),o.id=null);const s=o.portal||w.getDefault();await this._ensureLoadBeforeSave(),o.type=U,o.portal=s;const a=I(o,"portal-item",{withResources:!0}),l={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(l,a,i),this.url&&(o.url=this.url),o.title||(o.title=this.title),O(o,i,1),await s.signIn(),await s.user.addItem({item:o,folder:i?.folder,data:l}),await j(this.resourceReferences,a),this.portalItem=o,n(a),a.portalItem=o,o}async _save(e){const t={...P,...e};if(!this.portalItem)throw new r("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==U)throw new r("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${U}"`);await this._ensureLoadBeforeSave();const i=I(this.portalItem,"portal-item",{withResources:!0}),o=this.write({},i),s=await C(this.portalItem,o);await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(s,i,t);const a=q(this.portalItem,this.url);return a&&(this.portalItem.url=a),this.portalItem.title||(this.portalItem.title=this.title),O(this.portalItem,t,0),await b(this.portalItem,s,this.resourceReferences,i),n(i),this.portalItem}async _validateAgainstJSONSchema(e,t,o){const s=o?.validationOptions;N(t,{errorName:"sceneservice:save"},{ignoreUnsupported:s?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const a=s?.enabled,n=g();if(a&&n){const t=(await n()).validate(e,o.portalItemLayerType);if(!t.length)return;const a=`Layer item did not validate:\n${t.join("\n")}`;if(i.getLogger(this).error(`_validateAgainstJSONSchema(): ${a}`),"throw"===s.failPolicy){const e=t.map(e=>new r("sceneservice:schema-validation",e));throw new r("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return e([s(h)],E.prototype,"id",void 0),e([s({type:c})],E.prototype,"spatialReference",void 0),e([_("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readSpatialReference",null),e([s({type:l})],E.prototype,"fullExtent",void 0),e([_("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readFullExtent",null),e([s({readOnly:!0,type:p})],E.prototype,"heightModelInfo",void 0),e([s({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],E.prototype,"minScale",void 0),e([s({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],E.prototype,"maxScale",void 0),e([s({readOnly:!0})],E.prototype,"version",void 0),e([_("version",["store.version"])],E.prototype,"readVersion",null),e([s({type:String,json:{read:{source:"copyrightText"}}})],E.prototype,"copyright",void 0),e([s({type:String,json:{read:!1}})],E.prototype,"sublayerTitleMode",void 0),e([s({type:String})],E.prototype,"title",void 0),e([_("portal-item","title")],E.prototype,"readTitlePortalItem",null),e([_("service","title",["name"])],E.prototype,"readTitleService",null),e([s({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],E.prototype,"layerId",void 0),e([s(v({separator:"layers"}))],E.prototype,"url",void 0),e([s({readOnly:!0})],E.prototype,"parsedUrl",null),e([s({readOnly:!0})],E.prototype,"store",void 0),e([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],E.prototype,"rootNode",void 0),E=e([a("esri.layers.mixins.SceneService")],E),E},L=-1e38;function T(e){if(null!=e.spatialReference)return c.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,i=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=i?new c(i):null}function A(e,t){if(null==t?.center||null==t.halfSize)throw new r("sceneservice:invalid-node-page","Invalid node page.");if(t.center[0]<L)return;const i=t.halfSize,o=t.center[2],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);e.zmin=o-s,e.zmax=o+s}function O(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const i=t.getTypeKeywords();for(const o of i)e.typeKeywords.push(o);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const U="Scene Service",P={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}},E={layerId:null};function K(e,t){const r=e.findIndex(({id:e})=>e===t.id);-1===r?e.push(t):e[r]=t}async function C(e,t){const r=await e.fetchData("json")??{};return Array.isArray(r.layers)||(r.layers=await V(e,t)),K(r.layers,t),r}function q(e,t){return t&&M(e.url,t)?e.url:t}function M(e,t){const r=J(e);return!!r&&r===F(t).url}async function V(e,t){const r=await z(e).catch(()=>null);return r?.some(({id:e})=>e===t.id)?r:[t]}async function z(e){const r=J(e.url);if(!r)return null;const i=(await t(r,{query:{f:"json"},responseType:"json"})).data.layers;if(!Array.isArray(i))return null;const o=i.filter(({id:e})=>null!=e).map(({id:e})=>({id:e}));return o.length?o:null}function J(e){if(!e)return null;const t=F(e);if(null!=t.layerId)return null;const r=d(t.url);return null==r||"SceneServer"===r.serverType?t.url:null}function F(e){return m({layer:E,url:e,nonStandardUrlAllowed:!0})}export{R as SceneService,U as sceneServiceItemType,A as updateExtentFromPageObb};
2
+ import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{debounce as o}from"../../core/promiseUtils.js";import{property as s,subclass as a}from"../../core/accessorSupport/decorators.js";import{updateOrigins as n}from"../../core/accessorSupport/originUtils.js";import l from"../../geometry/Extent.js";import p from"../../geometry/SpatialReference.js";import{HeightModelInfoMixin as c}from"./HeightModelInfoMixin.js";import{titleFromUrlAndName as u,parse as d,cleanTitle as m,sanitizeUrlWithLayerId as y}from"../support/arcgisLayerUrl.js";import{id as h}from"../support/commonProperties.js";import{fetchIndexInfo as f}from"../support/I3SIndexInfo.js";import{urlProperty as v,normalizeParsedUrlObject as S}from"../support/multiLayerServiceUtils.js";import{getLoader as g}from"../support/schemaValidatorLoader.js";import w from"../../portal/Portal.js";import x from"../../portal/PortalItem.js";import{createForItemWrite as I}from"../../portal/support/jsonContext.js";import{saveResources as j,updateItemWithResources as b}from"../../webdoc/support/resourceUtils.js";import{evaluateWriteErrors as N}from"../../webdoc/support/saveUtils.js";import{reader as _}from"../../core/accessorSupport/decorators/reader.js";const R=y=>{const R=c(y);let E=class extends R{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=o(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return T(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=null==e.spatialReference?{...e,spatialReference:T(t)}:e;return l.fromJSON(i,r)}const i=t.store,o=T(t);return null==o||null==i?.extent||!Array.isArray(i.extent)||i.extent.some(e=>e<L)?null:new l({xmin:i.extent[0],ymin:i.extent[1],xmax:i.extent[2],ymax:i.extent[3],spatialReference:o})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,i=null!=r.version?r.version.toString():"";return this.parseVersionString(i)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){if("item-title"===this.sublayerTitleMode)return this.url?u(this.url,t.name):t.name;let r=t.name;if(!r&&this.url){const e=d(this.url);null!=e&&(r=e.title)}const i=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&i&&(r=i+" - "+r),m(r)}get parsedUrl(){return S(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=f(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,i.getLogger(this),t),this.indexInfo.catch(()=>{});const{fullExtent:r}=this;null==r||r.hasZ||this._updateExtent(r,await this.indexInfo)}_updateExtent(e,t){if("page"===t?.type){const r=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[r];A(e,i?.obb)}else if("node"===t?.type){const r=t.rootNode?.mbs;if(!Array.isArray(r)||4!==r.length||r[0]<L)return;const i=r[2],o=r[3];e.zmin=i-o,e.zmax=i+o}}async _fetchService(e){if(null==this.url)throw new r("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const r=await t(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(r.data&&Array.isArray(r.data.layers)&&r.data.layers.length>0)return r.data.layers[0].id}async _fetchServiceLayer(e){const r=await t(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});r.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(r.data.layerType&&"Voxel"===r.data.layerType&&(i=!0),i)return this._fetchVoxelServiceLayer();const o=r.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const r=(await t(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,this._getServiceContext()),this.validateLayer(r)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const i={...P,...t};let o=x.from(e);if(!o)throw new r("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");o.id&&(o=o.clone(),o.id=null);const s=o.portal||w.getDefault();await this._ensureLoadBeforeSave(),o.type=U,o.portal=s;const a=I(o,"portal-item",{withResources:!0}),l={layers:[this.write({},a)]};return await Promise.all(a.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(l,a,i),this.url&&(o.url=this.url),o.title||(o.title=this.title),O(o,i,1),await s.signIn(),await s.user.addItem({item:o,folder:i?.folder,data:l}),await j(this.resourceReferences,a),this.portalItem=o,n(a),a.portalItem=o,o}async _save(e){const t={...P,...e};if(!this.portalItem)throw new r("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==U)throw new r("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${U}"`);await this._ensureLoadBeforeSave();const i=I(this.portalItem,"portal-item",{withResources:!0}),o=this.write({},i),s=await C(this.portalItem,o);await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(s,i,t);const a=q(this.portalItem,this.url);return a&&(this.portalItem.url=a),this.portalItem.title||(this.portalItem.title=this.title),O(this.portalItem,t,0),await b(this.portalItem,s,this.resourceReferences,i),n(i),this.portalItem}async _validateAgainstJSONSchema(e,t,o){const s=o?.validationOptions;N(t,{errorName:"sceneservice:save"},{ignoreUnsupported:s?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const a=s?.enabled,n=g();if(a&&n){const t=(await n()).validate(e,o.portalItemLayerType);if(!t.length)return;const a=`Layer item did not validate:\n${t.join("\n")}`;if(i.getLogger(this).error(`_validateAgainstJSONSchema(): ${a}`),"throw"===s.failPolicy){const e=t.map(e=>new r("sceneservice:schema-validation",e));throw new r("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return e([s(h)],E.prototype,"id",void 0),e([s({type:p})],E.prototype,"spatialReference",void 0),e([_("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readSpatialReference",null),e([s({type:l})],E.prototype,"fullExtent",void 0),e([_("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],E.prototype,"readFullExtent",null),e([s({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],E.prototype,"minScale",void 0),e([s({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],E.prototype,"maxScale",void 0),e([s({readOnly:!0})],E.prototype,"version",void 0),e([_("version",["store.version"])],E.prototype,"readVersion",null),e([s({type:String,json:{read:{source:"copyrightText"}}})],E.prototype,"copyright",void 0),e([s({type:String,json:{read:!1}})],E.prototype,"sublayerTitleMode",void 0),e([s({type:String})],E.prototype,"title",void 0),e([_("portal-item","title")],E.prototype,"readTitlePortalItem",null),e([_("service","title",["name"])],E.prototype,"readTitleService",null),e([s({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],E.prototype,"layerId",void 0),e([s(v({separator:"layers"}))],E.prototype,"url",void 0),e([s({readOnly:!0})],E.prototype,"parsedUrl",null),e([s({readOnly:!0})],E.prototype,"store",void 0),e([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],E.prototype,"rootNode",void 0),E=e([a("esri.layers.mixins.SceneService")],E),E},L=-1e38;function T(e){if(null!=e.spatialReference)return p.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,i=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=i?new p(i):null}function A(e,t){if(null==t?.center||null==t.halfSize)throw new r("sceneservice:invalid-node-page","Invalid node page.");if(t.center[0]<L)return;const i=t.halfSize,o=t.center[2],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);e.zmin=o-s,e.zmax=o+s}function O(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const i=t.getTypeKeywords();for(const o of i)e.typeKeywords.push(o);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const U="Scene Service",P={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}},E={layerId:null};function K(e,t){const r=e.findIndex(({id:e})=>e===t.id);-1===r?e.push(t):e[r]=t}async function C(e,t){const r=await e.fetchData("json")??{};return Array.isArray(r.layers)||(r.layers=await V(e,t)),K(r.layers,t),r}function q(e,t){return t&&M(e.url,t)?e.url:t}function M(e,t){const r=J(e);return!!r&&r===F(t).url}async function V(e,t){const r=await z(e).catch(()=>null);return r?.some(({id:e})=>e===t.id)?r:[t]}async function z(e){const r=J(e.url);if(!r)return null;const i=(await t(r,{query:{f:"json"},responseType:"json"})).data.layers;if(!Array.isArray(i))return null;const o=i.filter(({id:e})=>null!=e).map(({id:e})=>({id:e}));return o.length?o:null}function J(e){if(!e)return null;const t=F(e);if(null!=t.layerId)return null;const r=d(t.url);return null==r||"SceneServer"===r.serverType?t.url:null}function F(e){return y({layer:E,url:e,nonStandardUrlAllowed:!0})}export{R as SceneService,U as sceneServiceItemType,A as updateExtentFromPageObb};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../../../core/Clonable.js";import r from"../../../core/Error.js";import{JSONSupport as o}from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{property as i,cast as n,subclass as s}from"../../../core/accessorSupport/decorators.js";import l from"../../../geometry/Point.js";import{getGeometryZScaler as p}from"../../../geometry/support/zscale.js";import c from"./CameraOrientation.js";import m from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as u,getEffectiveElevationSource as y,getArcGISServerUrl as d,getMetersPerUnitOfSR as f,orientedImageryTypeMap as g}from"./utils.js";import{ltpToGeographic as h}from"../transformations/utils.js";import{reader as v}from"../../../core/accessorSupport/decorators/reader.js";import{writer as w}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as O}from"../../../core/accessorSupport/decorators/enumeration.js";function b(e){throw new r("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function j(e,t){throw new r("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:t})}const S=e=>({cast:e=>{const t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,r)=>{t[r]=Number.isFinite(e)?e:void 0}}}}),N=e=>({cast:e=>"string"==typeof e?e.split(";").map(Number):e,json:{default:e,write:{writer:(e,t,r)=>{t[r]=e?.join(";")}}}}),I="$virtualCacheDirectory:",x="/rest/directories/dsid_",z=new Set(["location"]);let C=class extends(t(o)){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){const r={},{attributes:o,geometry:a}=e,i={};for(const p in o)z.has(p.toLowerCase())||(r[p.toLowerCase()]=o[p],i[p.toLowerCase()]=p);const n=e.layer??{},s=n.effectiveSequenceOrderField;let l=null;if(s?.length){s.map(e=>e.fieldName).forEach(e=>{i[e.toLowerCase()]=e}),l=s.map(e=>({value:o[e.fieldName],...e}))}super.read({geometry:a,layer:n,sourceMap:i,sequenceOrder:l,...r},t)}write(e,t){const r=super.write(e,t),{sourceMap:o}=this;if(!o||!r)return r;const a={};for(const i in r){const e=o[i.toLowerCase()];e&&(a[e]=r[i])}return a}readCameraHeading(e,t){const{cameraheading:r,camheading:o,layer:a}=t;return r??o??a.cameraHeading}readCameraHeight(e,t){const{cameraheight:r,avghtag:o,layer:a}=t;return r??o??a.cameraHeight}readCamOffset(e,t){const{cameraoffset:r,camoffset:o}=t;return r?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(";"))}readCameraOrientation(e,t){const{cameraorientation:r,camori:o}=t;return r??o}readCameraPitch(e,t){const{camerapitch:r,campitch:o,layer:a}=t;return r??o??a.cameraPitch}readCameraRoll(e,t){const{cameraroll:r,camroll:o,layer:a}=t;return r??o??a.cameraRoll}readDepthImage(e,t){const{depthimage:r,depthimg:o,layer:a}=t,i=r??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:s}=a??{};return u(i,n,s)}readElevationSource(e,t){const{elevationsource:r,layer:o}=t,{demPathSuffix:a,demPathPrefix:i}=o;if(r){const e=this._parseIfJSON(r);return y(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,t){const{fardistance:r,fardist:o,layer:a}=t;return r??o??a.farDistance}get geometry(){const e=this._geometry.clone();if(!e)return null;const{cameraOffset:t}=this;if(t){const[r,o,a]=t;e.x+=r,e.y+=o,null!=e.z&&null!=a&&(e.z+=a)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){const{horizontalfieldofview:r,hfov:o,layer:a}=t;return r??o??a.horizontalFieldOfView}readImageURL(e,t){const{imagepath:r,layer:o}=t;r||j("imagePath",this);const{imagePathPrefix:a,imagePathSuffix:i}=o;if(r.startsWith(I)){return`${d(o.url)}${x}${r.replace(I,o.dataStoreID+"/")}`}return u(r,a,i)}readImageRotation(e,t){const{imagerotation:r,imgrot:o,layer:a}=t;return r??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return this.orientedImageryType?.includes("360")??!1}get location(){const{cameraOrientation:e,cameraHeight:t,elevation:r}=this;if(e){const{type:t,x:r,y:o,z:a,horizontalWKID:i,verticalWKID:n}=e,s="number"==typeof i?{wkid:i}:{wkt:i};if(4===t){const{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:a,properties:i}=e,{x:n,y:s,z:p}=i;return new l(h([n,s,p],[t,r,o,a]))}const c=new l({x:r,y:o,z:a,spatialReference:s}),m=n?p("point",{wkid:n},s):null;return m&&m(c),c}if("number"!=typeof t)throw b("cameraHeight");const o=this.geometry.clone(),i=(r??0)+t/f(o.spatialReference);if("360"===this.orientedImageryType&&o.hasZ){const e=i-o.z;return null!=r&&Math.abs(e)>.001&&(a.getLogger(this).warnOnce("The elevation value is different from the geometry's z value. The geometry's z value will be updated.",{elevation:r,geometryZ:o.z}),o.z=i),o}return o.z=o.hasZ?o.z:i,o}set matrix(e){if(e)return 9!==e.length?(a.getLogger(this).warnOnce("Ignoring rotation matrix because it doesn't have 9 values",{value:e}),void this._set("matrix",null)):void this._set("matrix",e)}readNearDistance(e,t){const{neardistance:r,neardist:o,layer:a}=t;return r??o??a.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){const{accuracy:r,orientationaccuracy:o}=t;return o?.split(";").map(Number)??r?.split(";").map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(";"))}readOIType(e,t){const{orientedimagerytype:r,oitype:o,camerapitch:a,campitch:i,layer:n}=t,s=g.read(r??o??n.orientedImageryType),l=a??i??n.cameraPitch;return"oblique"===s?l<10?"nadir":"oblique":s}set radial(e){if(e){if("string"==typeof e){const[t,r,o]=e.split(";").map(Number);return void this._set("radial",[t??0,r??0,o??0])}this._set("radial",e)}else this._set("radial",[0,0,0])}set tangential(e){if(e){if("string"==typeof e){const[t,r]=e.split(";").map(Number);return void this._set("tangential",[t??0,r??0])}this._set("tangential",e)}else this._set("tangential",[0,0])}readVFOV(e,t){const{verticalfieldofview:r,vfov:o,layer:a}=t;return r??o??a.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(r){a.getLogger(this).error("couldn't parse the given elevation source JSON",e,r)}return t}clone(){const e=super.clone();return e._geometry=this._geometry.clone(),e}};e([i()],C.prototype,"_geometry",void 0),e([i(S())],C.prototype,"a0",void 0),e([i(S())],C.prototype,"a1",void 0),e([i(S())],C.prototype,"a2",void 0),e([i({type:Date,json:{write:{enabled:!0,target:"acquisitionDate"},name:"acquisitiondate"}})],C.prototype,"acquisitionDate",void 0),e([i(S())],C.prototype,"b0",void 0),e([i(S())],C.prototype,"b1",void 0),e([i(S())],C.prototype,"b2",void 0),e([i({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],C.prototype,"cameraHeading",void 0),e([v("cameraHeading")],C.prototype,"readCameraHeading",null),e([i({type:Number,json:{write:!0}})],C.prototype,"cameraHeight",void 0),e([v("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],C.prototype,"readCameraHeight",null),e([i()],C.prototype,"cameraOffset",void 0),e([v("cameraOffset",["cameraoffset","camoffset"])],C.prototype,"readCamOffset",null),e([w("cameraOffset")],C.prototype,"writeCameraOffset",null),e([i({json:{write:{writer:(e,t,r)=>{t[r]=e.toString()}}},type:c}),n(e=>e?m.getCameraOrientation(e):null)],C.prototype,"cameraOrientation",void 0),e([v("cameraOrientation",["cameraorientation","camori"])],C.prototype,"readCameraOrientation",null),e([i({type:Number,json:{write:!0}})],C.prototype,"cameraPitch",void 0),e([v("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],C.prototype,"readCameraPitch",null),e([i({type:Number,json:{write:!0}})],C.prototype,"cameraRoll",void 0),e([v("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],C.prototype,"readCameraRoll",null),e([i({json:{write:!0},type:String})],C.prototype,"depthImage",void 0),e([v("depthImage",["depthimage","depthimg"])],C.prototype,"readDepthImage",null),e([i({type:Number,json:{write:!0}})],C.prototype,"elevation",void 0),e([i({json:{write:!0},clonable:"reference"})],C.prototype,"elevationSource",void 0),e([v("elevationSource",["elevationsource","layer.effectiveElevationSource"])],C.prototype,"readElevationSource",null),e([i({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],C.prototype,"exposureStationId",void 0),e([i({type:Number,json:{write:!0}})],C.prototype,"farDistance",void 0),e([v("farDistance",["fardistance","fardist","layer.farDistance"])],C.prototype,"readFarDistance",null),e([i(S("focallength"))],C.prototype,"focalLength",void 0),e([i({type:l,json:{name:"geometry"}})],C.prototype,"geometry",null),e([w("geometry")],C.prototype,"writeGeometry",null),e([i({type:Number,json:{write:!0}})],C.prototype,"horizontalFieldOfView",void 0),e([v("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],C.prototype,"readHFOV",null),e([i({json:{write:!0},type:String})],C.prototype,"imagePath",void 0),e([v("imagePath",["imagepath"])],C.prototype,"readImageURL",null),e([i({type:Number,json:{write:!0}})],C.prototype,"imageRotation",void 0),e([v("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],C.prototype,"readImageRotation",null),e([i()],C.prototype,"isHorizontal",null),e([i()],C.prototype,"isInspection",null),e([i()],C.prototype,"isNadir",null),e([i()],C.prototype,"isOblique",null),e([i()],C.prototype,"isSpherical",null),e([i()],C.prototype,"location",null),e([i(N())],C.prototype,"matrix",null),e([i({json:{write:!0},type:String})],C.prototype,"name",void 0),e([i({type:Number,json:{write:!0}})],C.prototype,"nearDistance",void 0),e([v("nearDistance",["neardistance","neardist","layer.nearDistance"])],C.prototype,"readNearDistance",null),e([i({json:{write:!0,name:"objectid"},type:Number})],C.prototype,"objectId",void 0),e([i({type:Number,json:{write:!0}})],C.prototype,"offsetFromStart",void 0),e([v("offsetFromStart",["offsetfromstart"])],C.prototype,"readOffsetFromStart",null),e([i()],C.prototype,"orientationAccuracy",void 0),e([v("orientationAccuracy",["accuracy","orientationaccuracy"])],C.prototype,"readOrientationAccuracy",null),e([w("orientationAccuracy")],C.prototype,"writeOrientationAccuracy",null),e([O(g)],C.prototype,"orientedImageryType",void 0),e([v("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],C.prototype,"readOIType",null),e([i({type:Number,json:{write:!0,read:{source:"principalx"}}})],C.prototype,"principalX",void 0),e([i({type:Number,json:{write:!0,read:{source:"principaly"}}})],C.prototype,"principalY",void 0),e([i(N([0,0,0]))],C.prototype,"radial",null),e([i({json:{write:(e,t)=>{e&&e.forEach(e=>t[e.fieldName]=e.value)}}})],C.prototype,"sequenceOrder",void 0),e([i({type:Object})],C.prototype,"sourceMap",void 0),e([i(N([0,0]))],C.prototype,"tangential",null),e([i({type:Number,json:{write:!0}})],C.prototype,"verticalFieldOfView",void 0),e([v("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],C.prototype,"readVFOV",null),C=e([s("esri.layers.orientedImagery.core.ExposurePoint")],C);const F=C;export{F as default};
2
+ import{__decorate as e}from"tslib";import{id as t}from"../../../kernel.js";import{ClonableMixin as r}from"../../../core/Clonable.js";import o from"../../../core/Error.js";import{JSONSupport as a}from"../../../core/JSONSupport.js";import i from"../../../core/Logger.js";import{isAbsolute as n,addQueryParameter as s}from"../../../core/urlUtils.js";import{property as l,cast as p,subclass as c}from"../../../core/accessorSupport/decorators.js";import m from"../../../geometry/Point.js";import{getGeometryZScaler as u}from"../../../geometry/support/zscale.js";import y from"./CameraOrientation.js";import d from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as f,getEffectiveElevationSource as g,getArcGISServerUrl as h,getMetersPerUnitOfSR as v,orientedImageryTypeMap as w}from"./utils.js";import{ltpToGeographic as O}from"../transformations/utils.js";import{reader as b}from"../../../core/accessorSupport/decorators/reader.js";import{writer as j}from"../../../core/accessorSupport/decorators/writer.js";import{enumeration as S}from"../../../core/accessorSupport/decorators/enumeration.js";function N(e){throw new o("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function I(e,t){throw new o("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:t})}function x(e){return e.trim().replaceAll("\\","/").replace(/^\/+/,"")}function C(e,t){return n(e)?e:f(e,t.imagePathPrefix,t.imagePathSuffix)}function z(e,t){if(n(e))return e;const r=t.url?h(t.url):null;return r?`${r}/${x(e)}`:null}function F(e){const r=t?.findCredential(e.url)?.token;return r??null}function P(e,t){const r=F(t);return r?s(e,"token",r):e}const D=e=>({cast:e=>{const t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,r)=>{t[r]=Number.isFinite(e)?e:void 0}}}}),H=e=>({cast:e=>"string"==typeof e?e.split(";").map(Number):e,json:{default:e,write:{writer:(e,t,r)=>{t[r]=e?.join(";")}}}}),_="$virtualCacheDirectory:",R="/rest/directories/dsid_",T=new Set(["location"]);let V=class extends(r(a)){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){const r={},{attributes:o,geometry:a}=e,i={};for(const p in o)T.has(p.toLowerCase())||(r[p.toLowerCase()]=o[p],i[p.toLowerCase()]=p);const n=e.layer??{},s=n.effectiveSequenceOrderField;let l=null;if(s?.length){s.map(e=>e.fieldName).forEach(e=>{i[e.toLowerCase()]=e}),l=s.map(e=>({value:o[e.fieldName],...e}))}super.read({geometry:a,layer:n,sourceMap:i,sequenceOrder:l,...r},t)}write(e,t){const r=super.write(e,t),{sourceMap:o}=this;if(!o||!r)return r;const a={};for(const i in r){const e=o[i.toLowerCase()];e&&(a[e]=r[i])}return a}readCameraHeading(e,t){const{cameraheading:r,camheading:o,layer:a}=t;return r??o??a.cameraHeading}readCameraHeight(e,t){const{cameraheight:r,avghtag:o,layer:a}=t;return r??o??a.cameraHeight}readCamOffset(e,t){const{cameraoffset:r,camoffset:o}=t;return r?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(";"))}readCameraOrientation(e,t){const{cameraorientation:r,camori:o}=t;return r??o}readCameraPitch(e,t){const{camerapitch:r,campitch:o,layer:a}=t;return r??o??a.cameraPitch}readCameraRoll(e,t){const{cameraroll:r,camroll:o,layer:a}=t;return r??o??a.cameraRoll}readDepthImage(e,t){const{depthimage:r,depthimg:o,layer:a}=t,i=r??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:s}=a??{};return f(i,n,s)}readElevationSource(e,t){const{elevationsource:r,layer:o}=t,{demPathSuffix:a,demPathPrefix:i}=o;if(r){const e=this._parseIfJSON(r);return g(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,t){const{fardistance:r,fardist:o,layer:a}=t;return r??o??a.farDistance}get geometry(){const e=this._geometry.clone();if(!e)return null;const{cameraOffset:t}=this;if(t){const[r,o,a]=t;e.x+=r,e.y+=o,null!=e.z&&null!=a&&(e.z+=a)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){const{horizontalfieldofview:r,hfov:o,layer:a}=t;return r??o??a.horizontalFieldOfView}readImageURL(e,t){const{connectionid:r,imagepath:o,layer:a}=t;if(o||I("imagePath",this),o.startsWith(_)){return`${h(a.url)}${R}${o.replace(_,a.dataStoreID+"/")}`}if(null==r)return C(o,a);const i=a.imageAccessPaths?.[r];if(!i)return C(o,a);const n=z(i,a);if(!n)return C(o,a);return P(`${n}/${x(o)}`,a)}readImageRotation(e,t){const{imagerotation:r,imgrot:o,layer:a}=t;return r??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return this.orientedImageryType?.includes("360")??!1}get location(){const{cameraOrientation:e,cameraHeight:t,elevation:r}=this;if(e){const{type:t,x:r,y:o,z:a,horizontalWKID:i,verticalWKID:n}=e,s="number"==typeof i?{wkid:i}:{wkt:i};if(4===t){const{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:a,properties:i}=e,{x:n,y:s,z:l}=i;return new m(O([n,s,l],[t,r,o,a]))}const l=new m({x:r,y:o,z:a,spatialReference:s}),p=n?u("point",{wkid:n},s):null;return p&&p(l),l}if("number"!=typeof t)throw N("cameraHeight");const o=this.geometry.clone(),a=(r??0)+t/v(o.spatialReference);if("360"===this.orientedImageryType&&o.hasZ){const e=a-o.z;return null!=r&&Math.abs(e)>.001&&(i.getLogger(this).warnOnce("The elevation value is different from the geometry's z value. The geometry's z value will be updated.",{elevation:r,geometryZ:o.z}),o.z=a),o}return o.z=o.hasZ?o.z:a,o}set matrix(e){if(e)return 9!==e.length?(i.getLogger(this).warnOnce("Ignoring rotation matrix because it doesn't have 9 values",{value:e}),void this._set("matrix",null)):void this._set("matrix",e)}readNearDistance(e,t){const{neardistance:r,neardist:o,layer:a}=t;return r??o??a.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){const{accuracy:r,orientationaccuracy:o}=t;return o?.split(";").map(Number)??r?.split(";").map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(";"))}readOIType(e,t){const{orientedimagerytype:r,oitype:o,camerapitch:a,campitch:i,layer:n}=t,s=w.read(r??o??n.orientedImageryType),l=a??i??n.cameraPitch;return"oblique"===s?l<10?"nadir":"oblique":s}set radial(e){if(e){if("string"==typeof e){const[t,r,o]=e.split(";").map(Number);return void this._set("radial",[t??0,r??0,o??0])}this._set("radial",e)}else this._set("radial",[0,0,0])}set tangential(e){if(e){if("string"==typeof e){const[t,r]=e.split(";").map(Number);return void this._set("tangential",[t??0,r??0])}this._set("tangential",e)}else this._set("tangential",[0,0])}readVFOV(e,t){const{verticalfieldofview:r,vfov:o,layer:a}=t;return r??o??a.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(r){i.getLogger(this).error("couldn't parse the given elevation source JSON",e,r)}return t}clone(){const e=super.clone();return e._geometry=this._geometry.clone(),e}};e([l()],V.prototype,"_geometry",void 0),e([l(D())],V.prototype,"a0",void 0),e([l(D())],V.prototype,"a1",void 0),e([l(D())],V.prototype,"a2",void 0),e([l({type:Date,json:{write:{enabled:!0,target:"acquisitionDate"},name:"acquisitiondate"}})],V.prototype,"acquisitionDate",void 0),e([l(D())],V.prototype,"b0",void 0),e([l(D())],V.prototype,"b1",void 0),e([l(D())],V.prototype,"b2",void 0),e([l({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],V.prototype,"cameraHeading",void 0),e([b("cameraHeading")],V.prototype,"readCameraHeading",null),e([l({type:Number,json:{write:!0}})],V.prototype,"cameraHeight",void 0),e([b("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],V.prototype,"readCameraHeight",null),e([l()],V.prototype,"cameraOffset",void 0),e([b("cameraOffset",["cameraoffset","camoffset"])],V.prototype,"readCamOffset",null),e([j("cameraOffset")],V.prototype,"writeCameraOffset",null),e([l({json:{write:{writer:(e,t,r)=>{t[r]=e.toString()}}},type:y}),p(e=>e?d.getCameraOrientation(e):null)],V.prototype,"cameraOrientation",void 0),e([b("cameraOrientation",["cameraorientation","camori"])],V.prototype,"readCameraOrientation",null),e([l({type:Number,json:{write:!0}})],V.prototype,"cameraPitch",void 0),e([b("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],V.prototype,"readCameraPitch",null),e([l({type:Number,json:{write:!0}})],V.prototype,"cameraRoll",void 0),e([b("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],V.prototype,"readCameraRoll",null),e([l({json:{write:!0},type:String})],V.prototype,"depthImage",void 0),e([b("depthImage",["depthimage","depthimg"])],V.prototype,"readDepthImage",null),e([l({type:Number,json:{write:!0}})],V.prototype,"elevation",void 0),e([l({json:{write:!0},clonable:"reference"})],V.prototype,"elevationSource",void 0),e([b("elevationSource",["elevationsource","layer.effectiveElevationSource"])],V.prototype,"readElevationSource",null),e([l({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],V.prototype,"exposureStationId",void 0),e([l({type:Number,json:{write:!0}})],V.prototype,"farDistance",void 0),e([b("farDistance",["fardistance","fardist","layer.farDistance"])],V.prototype,"readFarDistance",null),e([l(D("focallength"))],V.prototype,"focalLength",void 0),e([l({type:m,json:{name:"geometry"}})],V.prototype,"geometry",null),e([j("geometry")],V.prototype,"writeGeometry",null),e([l({type:Number,json:{write:!0}})],V.prototype,"horizontalFieldOfView",void 0),e([b("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],V.prototype,"readHFOV",null),e([l({json:{write:!0},type:String})],V.prototype,"imagePath",void 0),e([b("imagePath",["imagepath"])],V.prototype,"readImageURL",null),e([l({type:Number,json:{write:!0}})],V.prototype,"imageRotation",void 0),e([b("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],V.prototype,"readImageRotation",null),e([l()],V.prototype,"isHorizontal",null),e([l()],V.prototype,"isInspection",null),e([l()],V.prototype,"isNadir",null),e([l()],V.prototype,"isOblique",null),e([l()],V.prototype,"isSpherical",null),e([l()],V.prototype,"location",null),e([l(H())],V.prototype,"matrix",null),e([l({json:{write:!0},type:String})],V.prototype,"name",void 0),e([l({type:Number,json:{write:!0}})],V.prototype,"nearDistance",void 0),e([b("nearDistance",["neardistance","neardist","layer.nearDistance"])],V.prototype,"readNearDistance",null),e([l({json:{write:!0,name:"objectid"},type:Number})],V.prototype,"objectId",void 0),e([l({type:Number,json:{write:!0}})],V.prototype,"offsetFromStart",void 0),e([b("offsetFromStart",["offsetfromstart"])],V.prototype,"readOffsetFromStart",null),e([l()],V.prototype,"orientationAccuracy",void 0),e([b("orientationAccuracy",["accuracy","orientationaccuracy"])],V.prototype,"readOrientationAccuracy",null),e([j("orientationAccuracy")],V.prototype,"writeOrientationAccuracy",null),e([S(w)],V.prototype,"orientedImageryType",void 0),e([b("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],V.prototype,"readOIType",null),e([l({type:Number,json:{write:!0,read:{source:"principalx"}}})],V.prototype,"principalX",void 0),e([l({type:Number,json:{write:!0,read:{source:"principaly"}}})],V.prototype,"principalY",void 0),e([l(H([0,0,0]))],V.prototype,"radial",null),e([l({json:{write:(e,t)=>{e&&e.forEach(e=>t[e.fieldName]=e.value)}}})],V.prototype,"sequenceOrder",void 0),e([l({type:Object})],V.prototype,"sourceMap",void 0),e([l(H([0,0]))],V.prototype,"tangential",null),e([l({type:Number,json:{write:!0}})],V.prototype,"verticalFieldOfView",void 0),e([b("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],V.prototype,"readVFOV",null),V=e([c("esri.layers.orientedImagery.core.ExposurePoint")],V);const q=V;export{q as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import r from"../../../core/Error.js";import e from"./CovJSONRaster.js";import t from"./ImageAuxRaster.js";import s from"./ImageServerRaster.js";import o from"./InMemoryRaster.js";import a from"./MRFRaster.js";import n from"./TIFFRaster.js";const c=new Map;c.set("MRF",{desc:"Meta Raster Format",constructor:a}),c.set("TIFF",{desc:"GeoTIFF",constructor:n}),c.set("RasterTileServer",{desc:"Raster Tile Server",constructor:s}),c.set("JPG",{desc:"JPG Raster Format",constructor:t}),c.set("PNG",{desc:"PNG Raster Format",constructor:t}),c.set("GIF",{desc:"GIF Raster Format",constructor:t}),c.set("BMP",{desc:"BMP Raster Format",constructor:t}),c.set("CovJSON",{desc:"COVJSON Raster Format",constructor:e}),c.set("MEMORY",{desc:"In Memory Raster Format",constructor:o});class l{static get supportedFormats(){const r=new Set;return c.forEach((e,t)=>r.add(t)),r}static async open(e){const{url:t,ioConfig:s,source:o,sourceJSON:a}=e;let n=e.datasetFormat??s?.datasetFormat;null==n&&(t.includes(".")?n=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===o?.type?.toLowerCase()?n="CovJSON":o?.extent&&o.pixelblocks&&(n="MEMORY")),"OVR"===n||"TIF"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:t,source:o,sourceJSON:a,datasetFormat:n,ioConfig:s??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(r=>{null==l[r]&&delete l[r]}),n){if(!this.supportedFormats.has(n))throw new r("rasterfactory:open","not a supported format "+n);if("CRF"===n)throw new r("rasterfactory:open",`cannot open raster: ${t}`);const s=new(0,c.get(n).constructor)(l);return s.rasterJobHandler=e.rasterJobHandler,s.rasterInfo=e.rasterInfo,await s.open({signal:e.signal}),s}const u=Array.from(c.keys()).filter(r=>"CovJSON"!==r&&"Memory"!==r);let i=0;const m=()=>{if(n=u[i++],!n)return null;if("CRF"===n)return null;const r=new(0,c.get(n).constructor)(l);return r.rasterJobHandler=e.rasterJobHandler,r.open({signal:e.signal}).then(()=>r).catch(()=>m())};return m()}static register(r,e,t){c.has(r.toUpperCase())||c.set(r.toUpperCase(),{desc:e,constructor:t})}}export{l as default};
2
+ import r from"../../../core/Error.js";import e from"./CovJSONRaster.js";import t from"./ImageAuxRaster.js";import s from"./ImageServerRaster.js";import o from"./InMemoryRaster.js";import a from"./MRFRaster.js";import n from"./TIFFRaster.js";const c=new Map;c.set("MRF",{desc:"Meta Raster Format",constructor:a}),c.set("TIFF",{desc:"GeoTIFF",constructor:n}),c.set("RasterTileServer",{desc:"Raster Tile Server",constructor:s}),c.set("JPG",{desc:"JPG Raster Format",constructor:t}),c.set("PNG",{desc:"PNG Raster Format",constructor:t}),c.set("GIF",{desc:"GIF Raster Format",constructor:t}),c.set("BMP",{desc:"BMP Raster Format",constructor:t}),c.set("CovJSON",{desc:"COVJSON Raster Format",constructor:e}),c.set("MEMORY",{desc:"In Memory Raster Format",constructor:o});class l{static get supportedFormats(){const r=new Set;return c.forEach((e,t)=>r.add(t)),r}static async open(e){const{url:t,ioConfig:s,source:o,sourceJSON:a}=e;let n=e.datasetFormat??s?.datasetFormat;null==n&&(t.includes(".")?n=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===o?.type?.toLowerCase()?n="CovJSON":o?.extent&&o.pixelblocks&&(n="MEMORY")),"OVR"===n||"TIF"===n||"DM"===n?n="TIFF":"JPG"===n||"JPEG"===n||"JFIF"===n?n="JPG":"COVJSON"===n&&(n="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:t,source:o,sourceJSON:a,datasetFormat:n,ioConfig:s??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(r=>{null==l[r]&&delete l[r]}),n){if(!this.supportedFormats.has(n))throw new r("rasterfactory:open","not a supported format "+n);if("CRF"===n)throw new r("rasterfactory:open",`cannot open raster: ${t}`);const s=new(0,c.get(n).constructor)(l);return s.rasterJobHandler=e.rasterJobHandler,s.rasterInfo=e.rasterInfo,await s.open({signal:e.signal}),s}const u=Array.from(c.keys()).filter(r=>"CovJSON"!==r&&"Memory"!==r);let i=0;const m=()=>{if(n=u[i++],!n)return null;if("CRF"===n)return null;const r=new(0,c.get(n).constructor)(l);return r.rasterJobHandler=e.rasterJobHandler,r.open({signal:e.signal}).then(()=>r).catch(()=>m())};return m()}static register(r,e,t){c.has(r.toUpperCase())||c.set(r.toUpperCase(),{desc:e,constructor:t})}}export{l as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.2.0-next.126",
3
+ "version": "5.2.0-next.128",
4
4
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -20,8 +20,8 @@
20
20
  "license": "SEE LICENSE IN LICENSE.md",
21
21
  "dependencies": {
22
22
  "@amcharts/amcharts5": "~5.20.8",
23
- "@arcgis/toolkit": "5.2.0-next.126",
24
- "@esri/arcgis-html-sanitizer": "~4.1.0",
23
+ "@arcgis/toolkit": "5.2.0-next.128",
24
+ "@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
25
25
  "@esri/calcite-components": "^5.2.0-next.80",
26
26
  "@vaadin/grid": "~25.3.0",
27
27
  "@zip.js/zip.js": "~2.18.2",
@@ -20,7 +20,7 @@ import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
20
20
  import type { FeatureAbilitiesProperties } from "./support/FeatureAbilities.js";
21
21
  import type { PointProperties } from "../geometry/Point.js";
22
22
 
23
- export interface FeatureContentCollectionProperties extends GoToProperties, Partial<Pick<FeatureContentCollection, "activeFeature" | "aggregatedFeaturesEnabled" | "content" | "defaultPopupTemplateEnabled" | "diagnostics" | "featurePage" | "features" | "featuresPerPage" | "featureStream" | "heading" | "highlightEnabled" | "includeDefaultActions" | "initialDisplayMode" | "map" | "open" | "promises" | "selectedFeatureIndex" | "updateLocationEnabled" | "view" | "zoomFactor">> {
23
+ export interface FeatureContentCollectionProperties extends GoToProperties, Partial<Pick<FeatureContentCollection, "activeFeature" | "aggregatedFeaturesEnabled" | "content" | "defaultPopupTemplateEnabled" | "featurePage" | "features" | "featuresPerPage" | "featureStream" | "heading" | "highlightEnabled" | "includeDefaultActions" | "initialDisplayMode" | "map" | "open" | "selectedFeatureIndex" | "updateLocationEnabled" | "view" | "zoomFactor">> {
24
24
  /**
25
25
  * [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) of [action](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionButton/) or [action toggle](https://developers.arcgis.com/javascript/latest/references/core/support/actions/ActionToggle/) objects.
26
26
  * Each action may be executed by clicking the icon or image symbolizing them.
@@ -179,7 +179,7 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
179
179
  *
180
180
  * @since 5.2
181
181
  */
182
- accessor diagnostics: FetchPopupFeaturesDiagnostics | null | undefined;
182
+ get diagnostics(): FetchPopupFeaturesDiagnostics | null | undefined;
183
183
  /**
184
184
  * The heading currently displayed for the selected feature item.
185
185
  *
@@ -325,28 +325,6 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
325
325
  * @see [waitingForResult](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#waitingForResult)
326
326
  */
327
327
  accessor open: boolean;
328
- /**
329
- * The number of pending promises remaining to be resolved.
330
- *
331
- * @internal
332
- * @see [promises property](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#promises)
333
- */
334
- get pendingPromisesCount(): number;
335
- /**
336
- * The number of selected [promises](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#promises) available.
337
- *
338
- * @internal
339
- */
340
- get promiseCount(): number;
341
- /**
342
- * An array of pending Promises that have not yet been fulfilled. If there are
343
- * no pending Promises, the value is `null`. When the pending Promises are
344
- * resolved they are removed from this array and the features they return
345
- * are pushed into the [features](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#features) array.
346
- *
347
- * @internal
348
- */
349
- accessor promises: Promise<Graphic[]>[];
350
328
  /**
351
329
  * The selected feature accessed. The [content](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#content) is
352
330
  * determined based on the [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) assigned to
@@ -379,7 +357,7 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
379
357
  *
380
358
  * @since 5.2
381
359
  */
382
- get streamingFeatures(): false;
360
+ get streamingFeatures(): boolean;
383
361
  /**
384
362
  * Dates and times will be displayed in this time zone. By default this time zone is
385
363
  * inherited from the associated [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#timeZone) if the [view](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#view) property is set. When a view is not associated, then the property will fallback to the `system` time zone.
@@ -447,6 +425,18 @@ export default class FeatureContentCollection extends FeatureContentCollectionSu
447
425
  * @see [selectedFeatureIndex](https://developers.arcgis.com/javascript/latest/references/core/popup/FeatureContentCollection/#selectedFeatureIndex)
448
426
  */
449
427
  next(): void;
428
+ /**
429
+ * Opens the collection with a location and a feature stream. While waiting, the collection remains at its current location and becomes active when the first feature is available.
430
+ * If the location is `null` or `undefined`, the first feature's geometry determines the location. If no features become available, the collection closes without changing its location.
431
+ *
432
+ * @param options - The feature source and location used to open the collection.
433
+ * @internal
434
+ */
435
+ openFeatureStream(options: {
436
+ featureStream: AsyncGenerator<Graphic>;
437
+ diagnostics?: FetchPopupFeaturesDiagnostics;
438
+ location: Point | null | undefined;
439
+ }): void;
450
440
  /**
451
441
  * Selects the feature at the previous index in relation to the selected feature.
452
442
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import{deprecatedProperty as i}from"../core/deprecate.js";import r from"../core/Error.js";import{EventedAccessor as s}from"../core/Evented.js";import a from"../core/Logger.js";import{abortMaybe as o}from"../core/maybe.js";import{debounce as n,logOnError as l,isAbortError as u}from"../core/promiseUtils.js";import h from"../core/ReactiveSet.js";import{watch as c,when as p,sync as d}from"../core/reactiveUtils.js";import{addMany as g}from"../core/SetUtils.js";import{property as m,subclass as f}from"../core/accessorSupport/decorators.js";import y from"../geometry/Point.js";import{project as _}from"../geometry/projectionUtils.js";import F from"../geometry/SpatialReference.js";import{geographicToWebMercator as v}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as w}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as b}from"../layers/LayerConstants.js";import{ActionsCollection as I,zoomToAggregatedFeatures as C,browseAggregatedFeatures as P,zoomToFeature as S}from"./actions.js";import{getSelectedTarget as A}from"./actionUtils.js";import L from"./FeatureContent.js";import x from"./support/FeatureAbilities.js";import{getDisplayedSymbol as j}from"../symbols/support/symbolUtils.js";import{system as E}from"../time/constants.js";import{highlightsSupported as R}from"../views/support/layerViewUtils.js";import{GoTo as O}from"../widgets/support/GoTo.js";const U=()=>[S.clone()],T=()=>[C.clone(),P.clone()];let M=null;function H(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let V=class extends(O(s)){constructor(e){super(e),this._pendingPromises=new h,this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new x,this._featureStreamVersion=0,this._activeFeatureStream=null,this.actions=new I,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.streamingFeatures=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=n(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([c(()=>this.view?.scale,()=>{this.open&&l(this._debouncedLocationUpdate(),a.getLogger(this))}),c(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),c(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),c(()=>this.location,e=>this._locationChange(e)),c(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),c(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),c(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),c(()=>this.featureItems,()=>this._featureItemsChange()),c(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),p(()=>!this.waitingForResult,()=>this._waitingForResultChange(),d),p(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this._pendingPromises.clear(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new I;e.removeAll();const{actions:i,defaultActions:r,defaultPopupTemplateEnabled:s,includeDefaultActions:a,selectedFeature:o}=this,n=a?r.concat(i):i,l=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(s)||o.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(n)??n;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.promises=[],this.diagnostics=null,this.featureStream=null,this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new I;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?T():U()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){if(this._get("featureStream")===e)return;if(this.diagnostics=null,this._set("featureStream",e),this._cancelFeatureStream(),!e)return;this.promises=[];const t=this._featureStreamVersion;this._activeFeatureStream=e,this._setStreamingFeatures(!0),this._consumeFeatureStream(e,t).catch(()=>{})}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?"list":"feature")}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?v(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){const e=this._get("promises")||[];return e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),e}set promises(e){Array.isArray(e)&&e.length>0&&i(a.getLogger(this),"promises",{replacement:"featureStream",warnOnce:!0}),this._get("promises")!==e&&(this._cancelFeatureStream(),this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),e=e.slice(),g(this._pendingPromises,e),e.reduce((e,t)=>e.finally(()=>t.then(e=>{this._pendingPromises.has(t)&&this._updateFeatures(e)}).finally(()=>this._pendingPromises.delete(t)).catch(()=>{})),Promise.resolve())):this._set("promises",[]))}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??E}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return(this.streamingFeatures||this.pendingPromisesCount>0)&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this.set({diagnostics:null,featureStream:null,promises:[],features:[],content:null,heading:null,location:null,activeFeature:null})}async fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new r("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:i});const s={},a=i.fetchPopupFeatures(e,{diagnostics:s,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this.featureStream=a,this.diagnostics=s}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{pendingPromisesCount:t,promiseCount:i,selectedFeatureIndex:r}=this,s=i>0&&e.length>0,a=null!=this._activeFeatureStream&&e.length>0,o=s||a;"list"!==this.initialDisplayMode?o&&-1===r?this.selectedFeatureIndex=0:o&&-1!==r||(this.selectedFeatureIndex=e.length?0:-1):(!o||s&&t===i)&&(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=A(this);this._cancelCenterAtLocation();const i=new AbortController,{signal:s}=i;return this._centerAtLocationController=i,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{u(e)||a.getLogger(this).error(e)}):Promise.reject(new r("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:r}=this;r&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){-1!==this.selectedFeatureIndex&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:r,featureItems:s}=this;if(null==i)return;const a=((i-1)*r+t)%t,o=Math.min(a+r,s.length);for(let n=a;n<o;n++){const t=s[n];t&&(t.graphic??=e[n])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:r}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!r)return;const s=w(e)?.type;if("map-image"!==s&&"imagery"!==s&&"imagery-tile"!==s||(e.symbol=await j(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=r.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&(this.promises.length>0||this.featureStream)&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,r=this.view,s=this.spatialReference,a=this.map,o=this.timeZone,n=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new L({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s,graphic:t===e?t:null,location:n,map:a,view:r,timeZone:o});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=o(this._centerAtLocationController)}_cancelFeatureStream(){this._featureStreamVersion++,this._setStreamingFeatures(!1);const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,r=i?.geometry?.type,s=this.location;if(r&&"mesh"!==r&&t&&s&&i){if("point"===r){const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t(i.geometry))}try{let r=i.geometry;const a=this._getHighlightLayer(i),o=i.getObjectId();if(!a||!this.view)return;if(null!=o){const i=this.view?.allLayerViews.find(e=>e.layer.uid===a.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[o],s.returnGeometry=!0;const{features:n}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;r=n[0]?.geometry}if(!r||"mesh"===r.type)return;r=_(r,t),M??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[{intersectsExecute:n},{proximityGetNearestCoordinate:l}]=M;if(!n(r,s)){const e=l(r,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(o){u(o)||a.getLogger(this).error(o)}}}_cancelLocationUpdate(){this._locationUpdateController=o(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=w(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(H(t.type,i))return e;const r=e.getObjectId();if(null!=r)return r;const s="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||b:null,a=e.attributes;return a&&s&&a[s]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:r,view:s,open:a}=this;if(!s||!r||!a)return;const o=this._getHighlightLayer(i);if(!o)return;const n=this._getHighlightLayerView(s,o);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&R(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,o,s.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(t!==this._featureStreamVersion)return;this._updateFeatures([i])}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._setStreamingFeatures(!1),this._waitingForResultChange())}}_setStreamingFeatures(e){this._set("streamingFeatures",e)}_updateFeatures(e){const{features:t}=this,i=new Set(t),r=e.filter(e=>!i.has(e));r?.length&&(this.features=t.concat(r))}};e([m()],V.prototype,"_initialDisplayMode",void 0),e([m({type:I})],V.prototype,"actions",void 0),e([m({readOnly:!0})],V.prototype,"active",null),e([m()],V.prototype,"activeFeature",void 0),e([m({readOnly:!0})],V.prototype,"allActions",null),e([m()],V.prototype,"aggregatedFeaturesEnabled",void 0),e([m({value:null})],V.prototype,"content",null),e([m({type:I,readOnly:!0})],V.prototype,"defaultActions",null),e([m({type:Boolean})],V.prototype,"defaultPopupTemplateEnabled",void 0),e([m()],V.prototype,"diagnostics",void 0),e([m({readOnly:!0})],V.prototype,"effectiveHeading",null),e([m({readOnly:!0})],V.prototype,"featureCount",null),e([m()],V.prototype,"featurePage",void 0),e([m({value:[]})],V.prototype,"features",null),e([m()],V.prototype,"featureStream",null),e([m()],V.prototype,"featuresPerPage",void 0),e([m()],V.prototype,"featureMenuOpen",void 0),e([m({type:x})],V.prototype,"featureItemAbilities",void 0),e([m({readOnly:!0})],V.prototype,"featureItems",void 0),e([m()],V.prototype,"heading",void 0),e([m()],V.prototype,"highlightEnabled",void 0),e([m()],V.prototype,"includeDefaultActions",void 0),e([m()],V.prototype,"initialDisplayMode",null),e([m({type:y})],V.prototype,"location",null),e([m()],V.prototype,"map",null),e([m()],V.prototype,"open",void 0),e([m({readOnly:!0})],V.prototype,"streamingFeatures",void 0),e([m({readOnly:!0})],V.prototype,"pendingPromisesCount",null),e([m({readOnly:!0})],V.prototype,"promiseCount",null),e([m()],V.prototype,"promises",null),e([m({value:null,readOnly:!0})],V.prototype,"selectedFeature",null),e([m({value:-1})],V.prototype,"selectedFeatureIndex",null),e([m({readOnly:!0})],V.prototype,"selectedFeatureItem",null),e([m({type:F})],V.prototype,"spatialReference",null),e([m({readOnly:!0})],V.prototype,"state",null),e([m()],V.prototype,"timeZone",null),e([m()],V.prototype,"updateLocationEnabled",void 0),e([m()],V.prototype,"view",void 0),e([m({readOnly:!0})],V.prototype,"waitingForContents",null),e([m({readOnly:!0})],V.prototype,"waitingForResult",null),e([m()],V.prototype,"zoomFactor",void 0),V=e([f("esri.popup.FeatureContentCollection")],V);const D=V;export{D as default};
2
+ import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Error.js";import{EventedAccessor as a}from"../core/Evented.js";import r from"../core/Logger.js";import{abortMaybe as s}from"../core/maybe.js";import{debounce as o,logOnError as n,isAbortError as l}from"../core/promiseUtils.js";import{watch as u,when as h,sync as c}from"../core/reactiveUtils.js";import{property as p,subclass as d}from"../core/accessorSupport/decorators.js";import g from"../geometry/Point.js";import{project as m}from"../geometry/projectionUtils.js";import f from"../geometry/SpatialReference.js";import{geographicToWebMercator as y}from"../geometry/support/webMercatorUtils.js";import{getGraphicLayer as _}from"../graphic/graphicOriginUtils.js";import{fallbackObjectIDAttribute as F}from"../layers/LayerConstants.js";import{ActionsCollection as v,zoomToAggregatedFeatures as w,browseAggregatedFeatures as b,zoomToFeature as I}from"./actions.js";import{getSelectedTarget as C}from"./actionUtils.js";import A from"./FeatureContent.js";import S from"./support/FeatureAbilities.js";import{getDisplayedSymbol as P}from"../symbols/support/symbolUtils.js";import{system as x}from"../time/constants.js";import{highlightsSupported as L}from"../views/support/layerViewUtils.js";import{GoTo as E}from"../widgets/support/GoTo.js";const j=()=>[I.clone()],R=()=>[w.clone(),b.clone()];let O=null;function U(e,t){switch(e){case"building-scene":case"map-image":case"tile":case"imagery":return!0;case"imagery-tile":return"2d"===t;default:return!1}}let T=class extends(E(a)){constructor(e){super(e),this._centerAtLocationController=null,this._locationUpdateController=null,this._highlightPromises={"highlight-active-feature":null,"highlight-selected-feature":null},this._defaultFeatureAbilities=new S,this._activeFeatureStream=null,this.actions=new v,this.activeFeature=null,this.aggregatedFeaturesEnabled=!1,this.defaultPopupTemplateEnabled=!1,this.diagnostics=null,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureItemAbilities=null,this.featureItems=[],this.heading=null,this.highlightEnabled=!0,this.includeDefaultActions=!0,this.open=!1,this.updateLocationEnabled=!1,this.view=null,this.zoomFactor=4,this._debouncedLocationUpdate=o(async()=>{this._cancelLocationUpdate();const e=new AbortController,{signal:t}=e;this._locationUpdateController=e,await this._locationUpdate({signal:t}).catch(()=>{}).finally(()=>{this._locationUpdateController===e&&(this._locationUpdateController=null)})})}initialize(){this.addHandles([u(()=>this.view?.scale,()=>{this.open&&n(this._debouncedLocationUpdate(),r.getLogger(this))}),u(()=>[this.highlightEnabled,this.selectedFeature,this.open,this.view],()=>this._highlightSelectedFeature()),u(()=>[this.highlightEnabled,this.activeFeature,this.open,this.view],()=>this._highlightActiveFeature()),u(()=>this.location,e=>this._locationChange(e)),u(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),u(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),u(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureItems],()=>this._setGraphicOnFeatureItems()),u(()=>this.featureItems,()=>this._featureItemsChange()),u(()=>[this.featureItemAbilities?.attachmentsContent,this.featureItemAbilities?.chartAnimation,this.featureItemAbilities?.customContent,this.featureItemAbilities?.expressionContent,this.featureItemAbilities?.fieldsContent,this.featureItemAbilities?.mediaContent,this.featureItemAbilities?.relationshipContent,this.featureItemAbilities?.textContent,this.featureItemAbilities?.utilityNetworkAssociationsContent,this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureItems()),h(()=>!this.waitingForResult,()=>this._waitingForResultChange(),c),h(()=>!this.open,()=>this.aggregatedFeaturesEnabled=!1)])}destroy(){this._cancelLocationUpdate(),this._cancelCenterAtLocation(),this._cancelFeatureStream(),this.aggregatedFeaturesEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return this.open&&!this.waitingForResult}get allActions(){const e=this._get("allActions")||new v;e.removeAll();const{actions:i,defaultActions:a,defaultPopupTemplateEnabled:r,includeDefaultActions:s,selectedFeature:o}=this,n=s?a.concat(i):i,l=o&&("function"==typeof o.getEffectivePopupTemplate&&o.getEffectivePopupTemplate(r)||o.popupTemplate),u=l?.actions,h=l?.overwriteActions?u:u?.concat(n)??n;return h?.filter(t).forEach(t=>e.add(t)),e}set content(e){this.featureStream=null,this._set("diagnostics",null),this.features=[],this._set("content",e)}get defaultActions(){const e=this._get("defaultActions")||new v;return e.removeAll(),e.addMany(this.selectedFeature?.isAggregate?R():j()),e}get effectiveHeading(){return this.selectedFeatureItem?.heading??this.heading}get featureCount(){return this.features.length}set features(e){if(this._get("features")===e)return;const t=e||[];this._set("features",t),this._syncSelectedFeatureIndex(t)}get featureStream(){return this._get("featureStream")||null}set featureStream(e){this._setFeatureStream(e)}_setFeatureStream(e,t,i){this._set("diagnostics",i??null),this._get("featureStream")!==e&&(this._set("featureStream",e),this._cancelFeatureStream(),e&&(this.features=[],this._activeFeatureStream=e,this._consumeFeatureStream(e,t).catch(()=>{})))}get initialDisplayMode(){return this._initialDisplayMode??(this.view?.focusRegionEnabled?"list":"feature")}set initialDisplayMode(e){this._initialDisplayMode=e,this._syncSelectedFeatureIndex(this.features)}set location(e){const t=e?.spatialReference?.isWGS84&&this.spatialReference?.isWebMercator?y(e):e;this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get streamingFeatures(){return null!=this._activeFeatureStream}get selectedFeature(){return-1===this.selectedFeatureIndex?null:this.features[this.selectedFeatureIndex]??null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;(isNaN(e)||e<0||!t)&&(e=-1),this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureItem(){return this.featureItems[this.selectedFeatureIndex]||null}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){return this.view?this.view.ready?"ready":"disabled":this.map?"ready":"disabled"}get timeZone(){return this.view?.timeZone??x}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureItems.some(e=>e.waitingForContent)}get waitingForResult(){return this.streamingFeatures&&0===this.featureCount}zoomTo(e){return this.callGoTo(e)}clear(){this._cancelFeatureStream(),this._set("diagnostics",null),this.set({featureStream:null,features:[],content:null,heading:null,location:null,activeFeature:null})}openFeatureStream(e){this._setFeatureStream(e.featureStream,e.location??null,e.diagnostics),this.open=!0}async fetchFeatures(e,t){const{view:a}=this;if(!a||!e)throw new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screen point/screen area and view.",{screenPoint:e,view:a});const r={},s=a.fetchPopupFeatures(e,{diagnostics:r,pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t?.signal});this._setFeatureStream(s,void 0,r)}next(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex+1,this.featureCount)}previous(){this.selectedFeatureIndex=this._getRoundRobinIndex(this.selectedFeatureIndex-1,this.featureCount)}_syncSelectedFeatureIndex(e){const{selectedFeatureIndex:t}=this,i=null!=this._activeFeatureStream&&e.length>0;"list"!==this.initialDisplayMode?i&&-1===t?this.selectedFeatureIndex=0:i&&-1!==t||(this.selectedFeatureIndex=e.length?0:-1):i||(this.selectedFeatureIndex=-1)}_centerAtLocation(){const{view:e}=this,t=C(this);this._cancelCenterAtLocation();const a=new AbortController,{signal:s}=a;return this._centerAtLocationController=a,t&&e?this.callGoTo({target:{target:t,scale:e.scale},options:{signal:s}}).catch(e=>{l(e)||r.getLogger(this).error(e)}):Promise.reject(new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}_getRoundRobinIndex(e,t){return(e+t)%t}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:a}=this;a&&!this._locationUpdateController&&i&&e&&(!t||t.geometry)&&this._centerAtLocation()}_selectedFeatureIndexChange(){-1!==this.selectedFeatureIndex&&(this.featurePage=this.featureCount>0?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null)}_featureItemsChange(){this.featurePage=this.featureCount>0?1:null}_setGraphicOnFeatureItems(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:a,featureItems:r}=this;if(null==i)return;const s=((i-1)*a+t)%t,o=Math.min(s+a,r.length);for(let n=s;n<o;n++){const t=r[n];t&&(t.graphic??=e[n])}}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:a}=this;if(this.aggregatedFeaturesEnabled=!1,!e||!a)return;const r=_(e)?.type;if("map-image"!==r&&"imagery"!==r&&"imagery-tile"!==r||(e.symbol=await P(e)),(i||!t)&&e.geometry){if("point"===e.geometry.type)return void(this.location=e.geometry);const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));return void(this.location=t(e.geometry))}if(i&&!e.geometry){await this._centerAtLocation();const e=a.center?.clone();e&&(this.location=e)}}_waitingForResultChange(){!this.featureCount&&this.featureStream&&(this.open=!1)}_destroyFeatureItems(){this.featureItems.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureItems",[])}_updateFeatureItems(){const e=this.selectedFeature,t=this.features,i=this.featureItems,a=this.view,r=this.spatialReference,s=this.map,o=this.timeZone,n=this.location,l=this.featureItemAbilities??this._defaultFeatureAbilities;if(!t?.length)return void this._destroyFeatureItems();const u=[],h=new Map,c=new Set;i.forEach(e=>{const t=e?.graphic;e&&t&&h.set(t,e)}),t.forEach((t,p)=>{if(!t)return;const d=i[p];if(d&&!c.has(d)&&(null==d.graphic||d.graphic===t))return d.abilities=l,u[p]=d,void c.add(d);const g=h.get(t);if(g&&!c.has(g))return g.abilities=l,u[p]=g,void c.add(g);const m=new A({abilities:l,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:r,graphic:t===e?t:null,location:n,map:s,view:a,timeZone:o});u[p]=m,c.add(m)}),i.forEach(e=>{!e||c.has(e)||e.destroyed||e.destroy()}),this._set("featureItems",u)}_cancelCenterAtLocation(){this._centerAtLocationController=s(this._centerAtLocationController)}_cancelFeatureStream(){const e=this._activeFeatureStream;this._activeFeatureStream=null,this._get("featureStream")===e&&this._set("featureStream",null),e?.return&&e.return(void 0).catch(()=>{})}async _locationUpdate(e){const{spatialReference:t}=this,i=this.selectedFeature,a=i?.geometry?.type,s=this.location;if(a&&"mesh"!==a&&t&&s&&i){if("point"===a){const{labelPointExecute:t}=await(import("../geometry/operators/labelPointOperator.js"));if(e?.signal?.aborted||this.selectedFeature!==i||!i.geometry)return;return void(this.location=t(i.geometry))}try{let a=i.geometry;const r=this._getHighlightLayer(i),o=i.getObjectId();if(!r||!this.view)return;if(null!=o){const i=this.view?.allLayerViews.find(e=>e.layer.uid===r.uid);if(!i||!("queryFeatures"in i))return;const s=i.createQuery();s.outSpatialReference=t,s.objectIds=[o],s.returnGeometry=!0;const{features:n}=await i.queryFeatures(s,e);if(e?.signal?.aborted)return;a=n[0]?.geometry}if(!a||"mesh"===a.type)return;a=m(a,t),O??=await Promise.all([import("../geometry/operators/intersectsOperator.js"),import("../geometry/operators/proximityOperator.js")]);const[{intersectsExecute:n},{proximityGetNearestCoordinate:l}]=O;if(!n(a,s)){const e=l(a,s).coordinate??s;this.selectedFeature===i&&(this.location=e)}}catch(o){l(o)||r.getLogger(this).error(o)}}}_cancelLocationUpdate(){this._locationUpdateController=s(this._locationUpdateController)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const t=_(e),{layer:i}=e;return t&&"layer"in t&&t.layer?t.layer:"map-notes"===t?.type||"subtype-group"===t?.type?t:i??t}_getHighlightLayerView(e,t){return"subtype-sublayer"===t.type&&t.parent&&this._mapIncludesLayer(t.parent)?this._getLayerView(e,t.parent):t&&this._mapIncludesLayer(t)?this._getLayerView(e,t):null}_getHighlightTarget(e,t,i){if(U(t.type,i))return e;const a=e.getObjectId();if(null!=a)return a;const r="imagery"===t.type?void 0:"objectIdField"in t?t.objectIdField||F:null,s=e.attributes;return s&&r&&s[r]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightFeature(e,t){this.removeHandles(e);const i=this[t];if(!i)return;const{highlightEnabled:a,view:r,open:s}=this;if(!r||!a||!s)return;const o=this._getHighlightLayer(i);if(!o)return;const n=this._getHighlightLayerView(r,o);if(!n)return;this._highlightPromises[e]=n;const l=await n;if(!(l&&L(l)&&this._highlightPromises[e]===n&&this[t]&&this.highlightEnabled))return;const u=l.highlight(this._getHighlightTarget(i,o,r.type));this.addHandles(u,e)}async _highlightActiveFeature(){return this._highlightFeature("highlight-active-feature","activeFeature")}async _highlightSelectedFeature(){return this._highlightFeature("highlight-selected-feature","selectedFeature")}async _consumeFeatureStream(e,t){try{for await(const i of e){if(e!==this._activeFeatureStream)return;void 0!==t&&(this.location=t,t=void 0),this._addFeature(i)}}finally{this._activeFeatureStream===e&&(this._activeFeatureStream=null,this._waitingForResultChange())}}_addFeature(e){const{features:t}=this;t.includes(e)||(this.features=t.concat(e))}};e([p()],T.prototype,"_initialDisplayMode",void 0),e([p()],T.prototype,"_activeFeatureStream",void 0),e([p({type:v})],T.prototype,"actions",void 0),e([p({readOnly:!0})],T.prototype,"active",null),e([p()],T.prototype,"activeFeature",void 0),e([p({readOnly:!0})],T.prototype,"allActions",null),e([p()],T.prototype,"aggregatedFeaturesEnabled",void 0),e([p({value:null})],T.prototype,"content",null),e([p({type:v,readOnly:!0})],T.prototype,"defaultActions",null),e([p({type:Boolean})],T.prototype,"defaultPopupTemplateEnabled",void 0),e([p({readOnly:!0})],T.prototype,"diagnostics",void 0),e([p({readOnly:!0})],T.prototype,"effectiveHeading",null),e([p({readOnly:!0})],T.prototype,"featureCount",null),e([p()],T.prototype,"featurePage",void 0),e([p({value:[]})],T.prototype,"features",null),e([p()],T.prototype,"featureStream",null),e([p()],T.prototype,"featuresPerPage",void 0),e([p()],T.prototype,"featureMenuOpen",void 0),e([p({type:S})],T.prototype,"featureItemAbilities",void 0),e([p({readOnly:!0})],T.prototype,"featureItems",void 0),e([p()],T.prototype,"heading",void 0),e([p()],T.prototype,"highlightEnabled",void 0),e([p()],T.prototype,"includeDefaultActions",void 0),e([p()],T.prototype,"initialDisplayMode",null),e([p({type:g})],T.prototype,"location",null),e([p()],T.prototype,"map",null),e([p()],T.prototype,"open",void 0),e([p({readOnly:!0})],T.prototype,"streamingFeatures",null),e([p({value:null,readOnly:!0})],T.prototype,"selectedFeature",null),e([p({value:-1})],T.prototype,"selectedFeatureIndex",null),e([p({readOnly:!0})],T.prototype,"selectedFeatureItem",null),e([p({type:f})],T.prototype,"spatialReference",null),e([p({readOnly:!0})],T.prototype,"state",null),e([p()],T.prototype,"timeZone",null),e([p()],T.prototype,"updateLocationEnabled",void 0),e([p()],T.prototype,"view",void 0),e([p({readOnly:!0})],T.prototype,"waitingForContents",null),e([p({readOnly:!0})],T.prototype,"waitingForResult",null),e([p()],T.prototype,"zoomFactor",void 0),T=e([d("esri.popup.FeatureContentCollection")],T);const M=T;export{M as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{generateUID as t}from"../../../core/uid.js";import e from"../../../geometry/SpatialReference.js";import{zScale as s}from"../../../geometry/support/zscale.js";import{DehydratedFeatureSetClass as i,DehydratedFeatureClass as r,removeLargeStringAttributes as a}from"../../../layers/graphics/dehydratedFeatures.js";import n from"../../../layers/support/Field.js";import{makeVertexTransformer as h,makeAttributesClass as o}from"./pbfFeatureSetUtils.js";class p{constructor(t){this._options=t,this.featureSet=new i,this.usesShortGeometryTypes=!0,this._queryGeometryType=null,this._queryGeometry=null,this.parseOnly=null,this.missingAttributes=[],this._transformInPlace=null,this._attributesClass=null,this._previousX=0,this._previousY=0,this._point=null,this._lengths=null,this._vertex=[],this._part=null,this._parts=null,this._i=0,this._finishVertex=p._finishVertexNonPoint}queryGeometryType(){return this._queryGeometryType}queryGeometry(){return this._queryGeometry}idField(t){"string"==typeof t&&(this.featureSet.objectIdFieldName=t)}finish(){this._options.applyTransform&&(this.featureSet.transform=null);let{spatialReference:t,features:s,fields:i}=this.featureSet;if(!t||t instanceof e||(this.featureSet.spatialReference=t=e.fromJSON(t)),t)for(const{geometry:e}of s)e&&(e.spatialReference=t);i.forEach((t,e)=>{t instanceof n||(i[e]=n.fromJSON(t))})}_setVertexTransformer(){const{sourceSpatialReference:t}=this._options,{spatialReference:e,hasZ:i}=this.featureSet,r=i?s(t,e):1;this._transformInPlace??=h(this.featureSet,r)}feature(){this._attributesClass??=o(this.featureSet.fields?.map(t=>t.name)??[]),this.featureSet.features.push(new r(t(),null,new this._attributesClass)),this._options.applyTransform&&this._setVertexTransformer()}finishFeature(){const{maxStringAttributeLength:t,maxStringAttributeFields:e}=this._options,{attributes:s}=this.featureSet.features.at(-1),i=s[this.featureSet.objectIdFieldName];a(s,e,t,t=>{null!=i&&this.missingAttributes.push({objectId:i,attribute:t})})}_createPoint(){const{hasZ:t,hasM:e,spatialReference:s}=this.featureSet,i={type:"point",x:0,y:0,spatialReference:s,hasZ:t,hasM:e};return t&&(i.z=0),e&&(i.m=0),i}centroid(t){const{hasZ:e,hasM:s}=this.featureSet,i=this._createPoint();[i.x,i.y]=t,e&&(i.z=t[2]),s&&(i.m=t.at(-1)),this.featureSet.features.at(-1).centroid=i}geometry(t,e,s){this._previousX=this._previousY=0,this._lengths=s;let i,{spatialReference:r,hasZ:a,hasM:n}=this.featureSet;switch(a??=!1,n??=!1,this._vertex=[0,0],a&&this._vertex.push(0),n&&this._vertex.push(0),this._finishVertex=p._finishVertexNonPoint,e){case"esriGeometryPoint":this._point=this._createPoint(),i=this._point,this._finishVertex=a?n?p._finishVertexPointXYZM:p._finishVertexPointXYZ:n?p._finishVertexPointXYM:p._finishVertexPointXY;break;case"esriGeometryMultipoint":i={type:"multipoint",points:[],spatialReference:r,hasZ:a,hasM:n},this._part=i.points,this._parts=[];break;case"esriGeometryPolyline":i={type:"polyline",paths:[],spatialReference:r,hasZ:a,hasM:n},this._parts=i.paths,this._part=[];break;case"esriGeometryPolygon":i={type:"polygon",rings:[],spatialReference:r,hasZ:a,hasM:n},this._parts=i.rings,this._part=[]}1===t?(this._queryGeometry=i,this._queryGeometryType=e,this._options.applyTransform||this._setVertexTransformer()):this.featureSet.features.at(-1).geometry=i}coord(t){const e=this._vertex;e[this._i++]=t,this._i<e.length||(this._i=0,this._transformInPlace&&(e[0]+=this._previousX,e[1]+=this._previousY,[this._previousX,this._previousY]=e,this._transformInPlace(e)),this._finishVertex(this))}static _finishVertexPointXY({_point:t,_vertex:e}){[t.x,t.y]=e}static _finishVertexPointXYZ({_point:t,_vertex:e}){[t.x,t.y,t.z]=e}static _finishVertexPointXYM({_point:t,_vertex:e}){[t.x,t.y,t.m]=e}static _finishVertexPointXYZM({_point:t,_vertex:e}){[t.x,t.y,t.z,t.m]=e}static _finishVertexNonPoint(t){const{_part:e,_parts:s,_lengths:i,_vertex:r}=t;e.push([...r]),e.length<i[s.length]||(t._previousX=t._previousY=0,t._part=[],s.push(e))}}export{p as DehydratedFeatureSetParserContext};
2
+ import{generateUID as t}from"../../../core/uid.js";import{zScale as e}from"../../../geometry/support/zscale.js";import{DehydratedFeatureSetClass as s,DehydratedFeatureClass as i,removeLargeStringAttributes as r}from"../../../layers/graphics/dehydratedFeatures.js";import{makeVertexTransformer as n,makeAttributesClass as o}from"./pbfFeatureSetUtils.js";class a{constructor(t){this._options=t,this.featureSet=new s,this.usesShortGeometryTypes=!0,this.transferList=[],this.coordinates=[],this._queryGeometryType=null,this._queryGeometry=null,this._queryCoordinates=null,this.parseOnly=null,this.missingAttributes=[],this._transformInPlace=null,this._attributesClass=null,this._previousX=0,this._previousY=0,this._point=null,this._lengths=null,this._coords=null,this._coordinateIndex=0,this._partIndex=0,this._partEnd=0,this._vertex=[],this._i=0,this._finishVertex=null}queryGeometryType(){return this._queryGeometryType}queryGeometry(){return this._queryGeometry}queryCoordinates(){return this._queryCoordinates}idField(t){"string"==typeof t&&(this.featureSet.objectIdFieldName=t)}finish(){this._options.applyTransform&&(this.featureSet.transform=null)}_setVertexTransformer(){const{sourceSpatialReference:t}=this._options,{spatialReference:s,hasZ:i}=this.featureSet,r=i?e(t,s):1;this._transformInPlace??=n(this.featureSet,r)}feature(){this._attributesClass??=o(this.featureSet.fields?.map(t=>t.name)??[]),this.featureSet.features.push(new i(t(),null,new this._attributesClass)),this.coordinates.push(null),this._options.applyTransform&&this._setVertexTransformer()}finishFeature(){const{maxStringAttributeLength:t,maxStringAttributeFields:e}=this._options,{attributes:s}=this.featureSet.features.at(-1),i=s[this.featureSet.objectIdFieldName];r(s,e,t,t=>{null!=i&&this.missingAttributes.push({objectId:i,attribute:t})})}_createPoint(){const{hasZ:t,hasM:e}=this.featureSet,s={type:"point",x:0,y:0,spatialReference:null,hasZ:t,hasM:e};return t&&(s.z=0),e&&(s.m=0),s}centroid(t){const{hasZ:e,hasM:s}=this.featureSet,i={type:"point",x:0,y:0,spatialReference:null,hasZ:e,hasM:s};[i.x,i.y]=t,e&&(i.z=t[2]),s&&(i.m=t.at(-1)),this.featureSet.features.at(-1).centroid=i}geometry(t,e,s){this._previousX=this._previousY=0,this._lengths=s;let i,{hasZ:r,hasM:n}=this.featureSet;r??=!1,n??=!1,this._vertex=[0,0],r&&this._vertex.push(0),n&&this._vertex.push(0);let o=null;switch(e){case"esriGeometryPoint":this._point=this._createPoint(),i=this._point,this._finishVertex=r?n?a._finishVertexPointXYZM:a._finishVertexPointXYZ:n?a._finishVertexPointXYM:a._finishVertexPointXY;break;case"esriGeometryMultipoint":this._createPackedCoordinates(s),o={coords:this._coords,lengths:s.slice()},i={type:"multipoint",points:null,spatialReference:null,hasZ:r,hasM:n};break;case"esriGeometryPolyline":case"esriGeometryPolygon":this._createPackedCoordinates(s),o={coords:this._coords,lengths:s.slice()},i="esriGeometryPolygon"===e?{type:"polygon",rings:null,spatialReference:null,hasZ:r,hasM:n}:{type:"polyline",paths:null,spatialReference:null,hasZ:r,hasM:n}}1===t?(this._queryGeometry=i,this._queryCoordinates=o,this._queryGeometryType=e,this._options.applyTransform||this._setVertexTransformer()):(this.featureSet.features.at(-1).geometry=i,this.coordinates[this.coordinates.length-1]=o)}_createPackedCoordinates(t){const e=this._vertex.length;for(this._coords=new Float64Array(t.reduce((t,e)=>t+e,0)*e),this._coordinateIndex=this._partIndex=0,this._partEnd=(t[0]??0)*e;0===this._partEnd&&++this._partIndex<t.length;)this._partEnd+=t[this._partIndex]*e;this._finishVertex=a._finishVertexPacked,this.transferList.push(this._coords.buffer)}coord(t){const e=this._vertex;e[this._i++]=t,this._i<e.length||(this._i=0,this._transformInPlace&&(e[0]+=this._previousX,e[1]+=this._previousY,[this._previousX,this._previousY]=e,this._transformInPlace(e)),this._finishVertex(this))}static _finishVertexPointXY({_point:t,_vertex:e}){[t.x,t.y]=e}static _finishVertexPointXYZ({_point:t,_vertex:e}){[t.x,t.y,t.z]=e}static _finishVertexPointXYM({_point:t,_vertex:e}){[t.x,t.y,t.m]=e}static _finishVertexPointXYZM({_point:t,_vertex:e}){[t.x,t.y,t.z,t.m]=e}static _finishVertexPacked(t){const{_vertex:e,_coords:s,_lengths:i}=t;if(s.set(e,t._coordinateIndex),t._coordinateIndex+=e.length,t._coordinateIndex===t._partEnd)for(t._previousX=t._previousY=0;t._coordinateIndex===t._partEnd&&++t._partIndex<i.length;)t._partEnd+=i[t._partIndex]*e.length}}export{a as DehydratedFeatureSetParserContext};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t}from"tslib";import s from"../../../core/Error.js";import r from"../../../core/pbf.js";import{featureGeometryTypeKebabDictionary as n}from"../../../geometry/support/typeUtils.js";const a=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],o=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],i=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],c=["upperLeft","lowerLeft"];function l(e,t){const s=e.getEnum();return s<t.length?t[s]:void 0}function u(e,t){e.featureSet.geometryType=e.usesShortGeometryTypes?n.fromJSON(t):t}function g(e,t=e.featureSet.geometryType){return e.usesShortGeometryTypes?n.toJSON(t):t}function p(e){const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:return t.getString();case 2:return t.getFloat();case 3:return t.getDouble();case 4:return t.getSInt32();case 5:return t.getUInt32();case 6:return t.getInt64();case 7:return t.getUInt64();case 8:return t.getSInt64();case 9:return t.getBool();default:return t.skip(),null}return null}function f(e){const t=e.asUnsafe(),s={type:o[0]};for(;t.next();)switch(t.tag()){case 1:s.name=t.getString();break;case 2:s.type=l(t,o);break;case 3:s.alias=t.getString();break;case 4:s.sqlType=l(t,i);break;case 5:default:t.skip();break;case 6:s.defaultValue=t.getString()}return s}function y(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.name=s.getString();break;case 2:t.isSystemMaintained=s.getBool();break;default:s.skip()}return t}let d=[];function h(e,t,s){let r=g(t),n=0;const o=e.asUnsafe();for(;o.next();)switch(o.tag()){case 1:1===s?r=g(t,l(o,a)):o.skip();continue;case 2:for(const e=o.getPackedEnd();o.pos()<e;)d[n++]=o.getUInt32();continue;case 3:n>0?(d.length=n,null!=t.geometry(s,r,d)&&(d=[])):t.geometry(s,r,[]);for(const e=o.getPackedEnd();o.pos()<e;)t.coord(o.getSInt64());continue;default:o.skip()}}function m(e,t){const s=[],r=e.asUnsafe();for(;r.next();)if(3!==r.tag())r.skip();else for(const e=r.getPackedEnd();r.pos()<e;)s.push(r.getSInt64());t.centroid(s)}let k=[],b=[],T=[];function S(s,r){const n={stack:[],error:void 0,hasError:!1};try{let o=0;const i=d;let c=0;const l=s.asUnsafe(),u=e(n,l.clonePooled().asUnsafe(),!1);for(;l.next();)switch(l.tag()){case 2:for(const p=l.getPackedEnd();l.pos()<p;)i[o++]=l.getUInt32();continue;case 3:if(!("curvedGeometry"in r))throw new Error(`Tried to parse curved geometry in a ${r.constructor.name}, which doesn't support them.`);l.processMessageWithArgs(I,c++);continue;case 4:{const f=l.getUInt32(),y=l.pos()+f;if(0===c||0===o||0===f){l.move(y);continue}i.length=o,T.length=b.length=c,r.curvedGeometry(g(r),i,b,T);const{hasZ:h,hasM:m}=r.featureSet,S=[],q=[0,0];function w(){for(let e=0;e<q.length;++e)S[e]=q[e],q[e]=l.getSInt64()}h&&q.push(0),m&&q.push(0);const F=[0,0],D=[0,0],U=F,M=F;let x=0;for(let G=0;G<o;++G){w(),S.fill(0),r.startCurvedPart(q);for(const E=x+i[G];x<E;++x){const v=b[x],A=T[x];switch(v){case 0:for(let P=0;P<A;++P)w(),q[0]+=S[0],q[1]+=S[1],r.lineSegment(S,q);continue;case 1:for(let W=0;W<A;++W)w(),U[0]=l.getSInt64(),U[1]=l.getSInt64(),r.circularArcSegment(S,q,U);continue;case 2:for(let O=0;O<A;++O)w(),F[0]=l.getSInt64(),F[1]=l.getSInt64(),D[0]=l.getSInt64(),D[1]=l.getSInt64(),r.bezierSegment(S,q,F,D);continue;case 3:u.move(k[x]);if(u.getUInt32()<7*A)throw new Error("Not implemented: compressed full circle encoding");for(let B=0;B<A;++B){w(),M[0]=u.getDouble(),M[1]=u.getDouble();const N=u.getDouble(),V=u.getDouble(),L=u.getDouble(),C=u.getDouble(),R=u.getDouble();r.ellipticArcSegment(S,q,M,N,V,L,C,R)}continue}}r.finishCurvedPart(q)}continue}default:l.skip()}}catch(a){n.error=a,n.hasError=!0}finally{t(n)}}function I(e,t){const s=e.asUnsafe();let r=0,n=0,a=0;for(;s.next();)switch(s.tag()){case 1:r=s.getEnum();continue;case 2:n=s.getUInt32();continue;case 3:a=s.pos(),s.skip();continue;default:s.skip()}if(3===r&&0===a)throw new Error("An elliptic arc segment set did not include a parameters array");b[t]=r,T[t]=n,k[t]=a}function q(e,t){t.feature();const s=t.featureSet.features.at(-1);let r=0;const{fields:n}=t.featureSet;for(;e.next();)switch(e.tag()){case 1:if(null==n)throw new Error("A Feature had attributes but the FeatureResult didn't include any fields");s.attributes[n[r++].name]=e.processMessage(p);continue;case 2:e.processMessageWithArgs(h,t,0);continue;case 4:e.processMessageWithArgs(m,t);continue;case 7:e.processMessageWithArgs(S,t);continue;case 11:s.distance=e.getDouble();continue;default:e.skip();continue}t.finishFeature?.()}function w(e){const t=[1,1,1,1],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function F(e){const t=[0,0,0,0],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function D(e){const t={originPosition:c[0]},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.originPosition=l(s,c);break;case 2:t.scale=s.processMessage(w);break;case 3:t.translate=s.processMessage(F);break;default:s.skip()}return t}function U(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.shapeAreaFieldName=s.getString();break;case 2:t.shapeLengthFieldName=s.getString();break;case 3:t.units=s.getString();break;default:s.skip()}return t}function M(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.wkid=e.getUInt32();break;case 5:t.wkt=e.getString();break;case 2:t.latestWkid=e.getUInt32();break;case 3:t.vcsWkid=e.getUInt32();break;case 4:t.latestVcsWkid=e.getUInt32();break;default:e.skip()}return t}function x(e,t){const s=e.asUnsafe();if(t.featureSet.features.length=0,"features"===t.parseOnly?.type){const e=t.parseOnly.indices.values();let r=0,n=e.next().value;for(;s.next();)15===s.tag()&&r++===n?(n=e.next().value,s.processMessageWithArgs(q,t)):s.skip();return}let r=!1;for("metadata"===t.parseOnly?.type&&(r=!0,t.parseOnly.featureCount=0),u(t,"esriGeometryPoint");s.next();)switch(s.tag()){case 1:t.idField(s.getString());continue;case 3:t.featureSet.globalIdFieldName=s.getString();continue;case 4:t.featureSet.geohashFieldName=s.getString();continue;case 5:t.featureSet.geometryProperties=s.processMessage(U);continue;case 7:u(t,l(s,a));continue;case 8:t.featureSet.spatialReference=s.processMessageWithArgs(M);continue;case 10:t.featureSet.hasZ=s.getBool();continue;case 11:t.featureSet.hasM=s.getBool();continue;case 12:t.featureSet.transform=s.processMessage(D);continue;case 9:t.featureSet.exceededTransferLimit=s.getBool();continue;case 13:t.featureSet.fields??=[],t.featureSet.fields.push(s.processMessage(f));continue;case 15:if(r){++t.parseOnly.featureCount,s.skip();continue}s.processMessageWithArgs(q,t);continue;case 2:t.idField(s.processMessage(y));continue;default:s.skip()}}function G(e,t,s){let r=-1;for(;e.next();)switch(e.tag()){case 4:r=e.pos(),e.skip();continue;case 1:e.processMessageWithArgs(x,t);continue;default:e.skip()}if(-1!==r){if(!t.queryGeometry()){const s=e.pos();e.move(r),e.processMessageWithArgs(h,t,1),e.move(s)}s.queryGeometryType=t.queryGeometryType(),s.queryGeometry=t.queryGeometry()}t.finish(),s.featureResult=t.featureSet}function E(n,a){const o={stack:[],error:void 0,hasError:!1};try{e(o,{[Symbol.dispose](){d=[],k=[],b=[],T=[]}},!1);try{const s={stack:[],error:void 0,hasError:!1};try{const t=e(s,r.constructPooled(new Uint8Array(n),new DataView(n)),!1);let o;for(;t.next();)if(2===t.tag())o={},t.processMessageWithArgs(G,a,o);else t.skip();return o}catch(i){s.error=i,s.hasError=!0}finally{t(s)}}catch(c){throw new s("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:c})}}catch(l){o.error=l,o.hasError=!0}finally{t(o)}}export{E as parseFeatureQuery,f as parseField,D as parseTransform};
2
+ import{__addDisposableResource as e,__disposeResources as t}from"tslib";import s from"../../../core/Error.js";import r from"../../../core/pbf.js";import{featureGeometryTypeKebabDictionary as n}from"../../../geometry/support/typeUtils.js";const a=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],o=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],i=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],c=["upperLeft","lowerLeft"];function l(e,t){const s=e.getEnum();return s<t.length?t[s]:void 0}function u(e,t){e.featureSet.geometryType=e.usesShortGeometryTypes?n.fromJSON(t):t}function g(e,t=e.featureSet.geometryType){return e.usesShortGeometryTypes?n.toJSON(t):t}function p(e){const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:return t.getString();case 2:return t.getFloat();case 3:return t.getDouble();case 4:return t.getSInt32();case 5:return t.getUInt32();case 6:return t.getInt64();case 7:return t.getUInt64();case 8:return t.getSInt64();case 9:return t.getBool();default:return t.skip(),null}return null}function f(e){const t=e.asUnsafe(),s={type:o[0]};for(;t.next();)switch(t.tag()){case 1:s.name=t.getString();break;case 2:s.type=l(t,o);break;case 3:s.alias=t.getString();break;case 4:s.sqlType=l(t,i);break;case 5:default:t.skip();break;case 6:s.defaultValue=t.getString()}return s}function y(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.name=s.getString();break;case 2:t.isSystemMaintained=s.getBool();break;default:s.skip()}return t}let d=[];function h(e,t,s){let r=g(t),n=0;const o=e.asUnsafe();for(;o.next();)switch(o.tag()){case 1:1===s?r=l(o,a):o.skip();continue;case 2:for(const e=o.getPackedEnd();o.pos()<e;)d[n++]=o.getUInt32();continue;case 3:n>0?(d.length=n,null!=t.geometry(s,r,d)&&(d=[])):t.geometry(s,r,[]);for(const e=o.getPackedEnd();o.pos()<e;)t.coord(o.getSInt64());continue;default:o.skip()}}function m(e,t){const s=[],r=e.asUnsafe();for(;r.next();)if(3!==r.tag())r.skip();else for(const e=r.getPackedEnd();r.pos()<e;)s.push(r.getSInt64());t.centroid(s)}let k=[],b=[],T=[];function S(s,r){const n={stack:[],error:void 0,hasError:!1};try{let o=0;const i=d;let c=0;const l=s.asUnsafe(),u=e(n,l.clonePooled().asUnsafe(),!1);for(;l.next();)switch(l.tag()){case 2:for(const p=l.getPackedEnd();l.pos()<p;)i[o++]=l.getUInt32();continue;case 3:if(!("curvedGeometry"in r))throw new Error(`Tried to parse curved geometry in a ${r.constructor.name}, which doesn't support them.`);l.processMessageWithArgs(I,c++);continue;case 4:{const f=l.getUInt32(),y=l.pos()+f;if(0===c||0===o||0===f){l.move(y);continue}i.length=o,T.length=b.length=c,r.curvedGeometry(g(r),i,b,T);const{hasZ:h,hasM:m}=r.featureSet,S=[],q=[0,0];function w(){for(let e=0;e<q.length;++e)S[e]=q[e],q[e]=l.getSInt64()}h&&q.push(0),m&&q.push(0);const F=[0,0],D=[0,0],U=F,M=F;let x=0;for(let G=0;G<o;++G){w(),S.fill(0),r.startCurvedPart(q);for(const E=x+i[G];x<E;++x){const v=b[x],A=T[x];switch(v){case 0:for(let P=0;P<A;++P)w(),q[0]+=S[0],q[1]+=S[1],r.lineSegment(S,q);continue;case 1:for(let W=0;W<A;++W)w(),U[0]=l.getSInt64(),U[1]=l.getSInt64(),r.circularArcSegment(S,q,U);continue;case 2:for(let O=0;O<A;++O)w(),F[0]=l.getSInt64(),F[1]=l.getSInt64(),D[0]=l.getSInt64(),D[1]=l.getSInt64(),r.bezierSegment(S,q,F,D);continue;case 3:u.move(k[x]);if(u.getUInt32()<7*A)throw new Error("Not implemented: compressed full circle encoding");for(let B=0;B<A;++B){w(),M[0]=u.getDouble(),M[1]=u.getDouble();const N=u.getDouble(),V=u.getDouble(),L=u.getDouble(),C=u.getDouble(),R=u.getDouble();r.ellipticArcSegment(S,q,M,N,V,L,C,R)}continue}}r.finishCurvedPart(q)}continue}default:l.skip()}}catch(a){n.error=a,n.hasError=!0}finally{t(n)}}function I(e,t){const s=e.asUnsafe();let r=0,n=0,a=0;for(;s.next();)switch(s.tag()){case 1:r=s.getEnum();continue;case 2:n=s.getUInt32();continue;case 3:a=s.pos(),s.skip();continue;default:s.skip()}if(3===r&&0===a)throw new Error("An elliptic arc segment set did not include a parameters array");b[t]=r,T[t]=n,k[t]=a}function q(e,t){t.feature();const s=t.featureSet.features.at(-1);let r=0;const{fields:n}=t.featureSet;for(;e.next();)switch(e.tag()){case 1:if(null==n)throw new Error("A Feature had attributes but the FeatureResult didn't include any fields");s.attributes[n[r++].name]=e.processMessage(p);continue;case 2:e.processMessageWithArgs(h,t,0);continue;case 4:e.processMessageWithArgs(m,t);continue;case 7:e.processMessageWithArgs(S,t);continue;case 11:s.distance=e.getDouble();continue;default:e.skip();continue}t.finishFeature?.()}function w(e){const t=[1,1,1,1],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function F(e){const t=[0,0,0,0],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function D(e){const t={originPosition:c[0]},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.originPosition=l(s,c);break;case 2:t.scale=s.processMessage(w);break;case 3:t.translate=s.processMessage(F);break;default:s.skip()}return t}function U(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.shapeAreaFieldName=s.getString();break;case 2:t.shapeLengthFieldName=s.getString();break;case 3:t.units=s.getString();break;default:s.skip()}return t}function M(e){const t={};for(;e.next();)switch(e.tag()){case 1:t.wkid=e.getUInt32();break;case 5:t.wkt=e.getString();break;case 2:t.latestWkid=e.getUInt32();break;case 3:t.vcsWkid=e.getUInt32();break;case 4:t.latestVcsWkid=e.getUInt32();break;default:e.skip()}return t}function x(e,t){const s=e.asUnsafe();if(t.featureSet.features.length=0,"features"===t.parseOnly?.type){const e=t.parseOnly.indices.values();let r=0,n=e.next().value;for(;s.next();)15===s.tag()&&r++===n?(n=e.next().value,s.processMessageWithArgs(q,t)):s.skip();return}let r=!1;for("metadata"===t.parseOnly?.type&&(r=!0,t.parseOnly.featureCount=0),u(t,"esriGeometryPoint");s.next();)switch(s.tag()){case 1:t.idField(s.getString());continue;case 3:t.featureSet.globalIdFieldName=s.getString();continue;case 4:t.featureSet.geohashFieldName=s.getString();continue;case 5:t.featureSet.geometryProperties=s.processMessage(U);continue;case 7:u(t,l(s,a));continue;case 8:t.featureSet.spatialReference=s.processMessageWithArgs(M);continue;case 10:t.featureSet.hasZ=s.getBool();continue;case 11:t.featureSet.hasM=s.getBool();continue;case 12:t.featureSet.transform=s.processMessage(D);continue;case 9:t.featureSet.exceededTransferLimit=s.getBool();continue;case 13:t.featureSet.fields??=[],t.featureSet.fields.push(s.processMessage(f));continue;case 15:if(r){++t.parseOnly.featureCount,s.skip();continue}s.processMessageWithArgs(q,t);continue;case 2:t.idField(s.processMessage(y));continue;default:s.skip()}}function G(e,t,s){let r=-1;for(;e.next();)switch(e.tag()){case 4:r=e.pos(),e.skip();continue;case 1:e.processMessageWithArgs(x,t);continue;default:e.skip()}if(-1!==r){if(!t.queryGeometry()){const s=e.pos();e.move(r),e.processMessageWithArgs(h,t,1),e.move(s)}s.queryGeometryType=t.queryGeometryType(),s.queryGeometry=t.queryGeometry()}t.finish(),s.featureResult=t.featureSet}function E(n,a){const o={stack:[],error:void 0,hasError:!1};try{e(o,{[Symbol.dispose](){d=[],k=[],b=[],T=[]}},!1);try{const s={stack:[],error:void 0,hasError:!1};try{const t=e(s,r.constructPooled(new Uint8Array(n),new DataView(n)),!1);let o;for(;t.next();)if(2===t.tag())o={},t.processMessageWithArgs(G,a,o);else t.skip();return o}catch(i){s.error=i,s.hasError=!0}finally{t(s)}}catch(c){throw new s("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:c})}}catch(l){o.error=l,o.hasError=!0}finally{t(o)}}export{E as parseFeatureQuery,f as parseField,D as parseTransform};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- const e="20260929",c="7012c974759d1222c40beaeef038078e481a19db";export{e as buildDate,c as revision};
2
+ const a="20261001",f="1c6e2bf6465f0a010185724df7819334a3a0958d";export{a as buildDate,f as revision};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{create as t}from"../../../geometry/support/aaBoundingRect.js";import{getRingsOrPathsBounds as e}from"../../../geometry/support/boundsUtils.js";import{isCurvedGeometry as n}from"../../../geometry/support/curves/curveUtils.js";import{getExtent as r}from"../SDFHelper.js";import{getNumericValue as o}from"../utils.js";function i(t){return"CIMSimpleLineCallout"===t.type||"CIMBackgroundCallout"===t.type||"CIMBalloonCallout"===t.type||"CIMPointSymbolCallout"===t.type||"CIMCompositeCallout"===t.type}function u(t,e){const n=o(t.angle,0);return 0===n?e:[...e,{offsetX:0,offsetY:0,rotation:n,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:!1,scaleSymbolsProportionally:!1}]}function a(t){const e=t.symbolLayers?.filter(t=>"CIMVectorMarker"===t.type&&!1!==t.enable);if(!e?.length)return{contentWidthRatio:1,contentHeightRatio:1,contentRequiresRadialFit:!1};let r=1,o=1,i=!1;for(const u of e){const e=u.markerGraphics,a=u.frame;if(!a||1!==e?.length)return{contentWidthRatio:1,contentHeightRatio:1,contentRequiresRadialFit:!1};const l=e[0].geometry;if("vertexAttributes"in l&&"components"in l)throw new Error("InternalError: point symbol callout marker geometry cannot be a mesh");const f=n(l),m=c(l)??s(l),p=a.xmax-a.xmin,h=a.ymax-a.ymin;if(!m||p<=0||h<=0)return{contentWidthRatio:1,contentHeightRatio:1,contentRequiresRadialFit:!1};const g=((t.angle??0)+(u.rotation??0))*Math.PI/180,y=Math.abs(Math.cos(g)),R=Math.abs(Math.sin(g)),d=m[2]-m[0],C=m[3]-m[1],M=d*y+C*R,b=d*R+C*y,P=p*y+h*R,I=p*R+h*y;r=Math.min(r,M/P),o=Math.min(o,b/I),i||=f}return{contentWidthRatio:r,contentHeightRatio:o,contentRequiresRadialFit:i}}function c(t){const e=t.curveRings??t.rings;if(2!==e?.length)return null;const n=l([e[0]]),r=l([e[1]]);return n&&r?f(n,r)?r:f(r,n)?n:null:null}function s(t){const e=t.curveRings??t.curvePaths;return e?l(e):r(t)}function l(n){const r=e(t(),n);return r?[r[0],r[1],r[2],r[3]]:null}function f(t,e){return t[0]<e[0]&&t[1]<e[1]&&t[2]>e[2]&&t[3]>e[3]}function m(t,e){return"marker"===e?a(t):null}function p(t){switch(t){case"RoundedRectangle":return 1;case"Oval":return 2;case"Rectangle":return 0;default:return"number"==typeof t?t:0}}function h(t){switch(t){case"MidPoint":return 1;case"ThreePoint":return 2;case"FourPoint":return 3;case"Underline":return 4;case"CircularCW":return 5;case"CircularCCW":return 6;case"Base":return 0;default:return null==t||"number"==typeof t?t:0}}function g(t){if("number"==typeof t)return t;switch(t){case"PropUniform":return 1;case"PropNonuniform":return 2;case"DifUniform":return 3;case"DifNonuniform":return 4;default:return 0}}export{a as getPointSymbolCalloutContentRatios,m as getPointSymbolCalloutFitProperties,u as getPointSymbolCalloutTransforms,i as isSupportedCallout,p as normalizeBalloonCalloutStyle,h as normalizeLeaderLineStyle,g as normalizePointSymbolCalloutScale};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{scaleMargins as t,extractCalloutData as e,inflateBounds as o,contains as r,distance as n,autoSnap as a,createLeaderPath as l,createRectangle as s,createAccentBar as c}from"./calloutUtils.js";class i{constructor(){this.type="CIMBackgroundCallout"}static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,o){if("CIMBackgroundCallout"!==e?.type)throw new Error("Invalid effect type for BackgroundCalloutEffect");return new u(t,e,o)}}class u{constructor(e,o,r){const{geomUnitsPerPoint:n}=r;if(!n)throw new Error("geomUnitsPerPoint is required in EffectExecutionContext for BackgroundCalloutEffect");const a=n*(r.scaleFactor??1);this._inputGeometries=e,this._part=o.part,this._leaderTolerance=(o.leaderTolerance??0)*a,this._leaderOffset=(o.leaderOffset??0)*a,this._gap=(o.gap??0)*a,this._lineStyle=o.lineStyle,this._margins=t(o.margin,a),this._relativeCalloutAnchor=r.relativeCalloutAnchor,this._absoluteCalloutAnchor=r.absoluteCalloutAnchor,this._calloutBodyBounds=r.calloutBodyBounds}next(){let t;for(;t=this._inputGeometries.next();){const i=e(t,this._relativeCalloutAnchor,this._calloutBodyBounds,this._absoluteCalloutAnchor);if(!i)continue;const u=o(i.bounds,this._margins);switch(this._part){case"accent-bar":return c(u,i.anchor,this._gap,t.yFactor);case"background":return s(u,t.yFactor);default:return r(u,i.anchor)||n(a(u,i.anchor),i.anchor)<this._leaderTolerance?null:l(u,i.anchor,this._lineStyle,this._leaderOffset,t.yFactor)}}return null}}export{i as default};
2
+ import{scaleMargins as t,extractCalloutData as e,inflateBounds as r,contains as n,distance as o,autoSnap as a,createLeaderPath as l,createRectangle as c,createAccentBar as s}from"./calloutUtils.js";class i{constructor(){this.type="CIMBackgroundCallout"}static{this.instance=null}static local(){return null===i.instance&&(i.instance=new i),i.instance}execute(t,e,r){if("CIMBackgroundCallout"!==e?.type)throw new Error("Invalid effect type for BackgroundCalloutEffect");return new u(t,e,r)}}class u{constructor(e,r,n){const{geomUnitsPerPoint:o}=n;if(!o)throw new Error("geomUnitsPerPoint is required in EffectExecutionContext for BackgroundCalloutEffect");const a=o*(n.scaleFactor??1);this._inputGeometries=e,this._part=r.part,this._leaderTolerance=(r.leaderTolerance??0)*a,this._leaderOffset=(r.leaderOffset??0)*a,this._gap=(r.gap??0)*a,this._lineStyle=r.lineStyle,this._margins=t(r.margin,a),this._calloutContext=n.callout}next(){let t;for(;t=this._inputGeometries.next();){const i=e(t,this._calloutContext);if(!i)continue;const u=r(i.bounds,this._margins);switch(this._part){case"accent-bar":return s(u,i.layoutAnchor,this._gap,t.yFactor);case"background":return c(u,t.yFactor);default:return n(u,i.layoutAnchor)||o(a(u,i.layoutAnchor),i.layoutAnchor)<this._leaderTolerance?null:l(u,i.layoutAnchor,this._lineStyle,this._leaderOffset,t.yFactor,i.anchor)}}return null}}export{i as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{scaleMargins as t,extractCalloutData as l,createBalloonGeometry as o,inflateBounds as e}from"./calloutUtils.js";class n{constructor(){this.type="CIMBalloonCallout"}static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,l,o){if("CIMBalloonCallout"!==l?.type)throw new Error("Invalid effect type for BalloonCalloutEffect");return new r(t,l,o)}}class r{constructor(l,o,e){const{geomUnitsPerPoint:n}=e;if(!n)throw new Error("geomUnitsPerPoint is required in EffectExecutionContext for BalloonCalloutEffect");const r=n*(e.scaleFactor??1);this._inputGeometries=l,this._balloonStyle=o.balloonStyle,this._dartWidth=null!=o.dartWidth?o.dartWidth*r:null,this._leaderTolerance=(o.leaderTolerance??0)*r,this._margins=t(o.margin,r),this._relativeCalloutAnchor=e.relativeCalloutAnchor,this._absoluteCalloutAnchor=e.absoluteCalloutAnchor,this._calloutBodyBounds=e.calloutBodyBounds}next(){let t;for(;t=this._inputGeometries.next();){const n=l(t,this._relativeCalloutAnchor,this._calloutBodyBounds,this._absoluteCalloutAnchor);if(n)return o(e(n.bounds,this._margins),n.anchor,this._balloonStyle,this._leaderTolerance,t.yFactor,this._dartWidth)}return null}}export{n as default};
2
+ import{scaleMargins as t,extractCalloutData as e,createBalloonGeometry as l,inflateBounds as o}from"./calloutUtils.js";class n{constructor(){this.type="CIMBalloonCallout"}static{this.instance=null}static local(){return null===n.instance&&(n.instance=new n),n.instance}execute(t,e,l){if("CIMBalloonCallout"!==e?.type)throw new Error("Invalid effect type for BalloonCalloutEffect");return new r(t,e,l)}}class r{constructor(e,l,o){const{geomUnitsPerPoint:n}=o;if(!n)throw new Error("geomUnitsPerPoint is required in EffectExecutionContext for BalloonCalloutEffect");const r=n*(o.scaleFactor??1);this._inputGeometries=e,this._balloonStyle=l.balloonStyle,this._dartWidth=null!=l.dartWidth?l.dartWidth*r:null,this._leaderTolerance=(l.leaderTolerance??0)*r,this._margins=t(l.margin,r),this._calloutContext=o.callout}next(){let t;for(;t=this._inputGeometries.next();){const n=e(t,this._calloutContext);if(n)return l(o(n.bounds,this._margins),n.anchor,this._balloonStyle,this._leaderTolerance,t.yFactor,this._dartWidth,n.layoutAnchor)}return null}}export{n as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{extractCalloutData as t,createPointGeometry as e,center as o,contains as l,distance as n,autoSnap as r,createLeaderPath as s}from"./calloutUtils.js";class a{constructor(){this.type="CIMPointSymbolCallout"}static{this.instance=null}static local(){return null===a.instance&&(a.instance=new a),a.instance}execute(t,e,o){if("CIMPointSymbolCallout"!==e?.type)throw new Error("Invalid effect type for PointSymbolCalloutEffect");return new i(t,e,o)}}class i{constructor(t,e,o){const{geomUnitsPerPoint:l}=o;if(!l)throw new Error("geomUnitsPerPoint is required in EffectExecutionContext for PointSymbolCalloutEffect");const n=l*(o.scaleFactor??1);this._inputGeometries=t,this._part=e.part,this._leaderTolerance=(e.leaderTolerance??0)*n,this._leaderOffset=(e.leaderOffset??0)*n,this._lineStyle=e.lineStyle,this._relativeCalloutAnchor=o.relativeCalloutAnchor,this._absoluteCalloutAnchor=o.absoluteCalloutAnchor,this._calloutBodyBounds=o.calloutBodyBounds}next(){let a;for(;a=this._inputGeometries.next();){const i=t(a,this._relativeCalloutAnchor,this._calloutBodyBounds,this._absoluteCalloutAnchor);if(i)return"marker"===this._part?e(o(i.bounds),a.yFactor):l(i.bounds,i.anchor)||n(r(i.bounds,i.anchor),i.anchor)<this._leaderTolerance?null:s(i.bounds,i.anchor,this._lineStyle,this._leaderOffset,a.yFactor)}return null}}export{a as default};
2
+ import{extractCalloutData as t,createPointGeometry as e,center as o,contains as n,distance as l,autoSnap as r,createLeaderPath as i}from"./calloutUtils.js";class s{constructor(){this.type="CIMPointSymbolCallout"}static{this.instance=null}static local(){return null===s.instance&&(s.instance=new s),s.instance}execute(t,e,o){if("CIMPointSymbolCallout"!==e?.type)throw new Error("Invalid effect type for PointSymbolCalloutEffect");return new a(t,e,o)}}class a{constructor(t,e,o){const{geomUnitsPerPoint:n}=o;if(!n)throw new Error("geomUnitsPerPoint is required in EffectExecutionContext for PointSymbolCalloutEffect");const l=n*(o.scaleFactor??1);this._inputGeometries=t,this._part=e.part,this._leaderTolerance=(e.leaderTolerance??0)*l,this._leaderOffset=(e.leaderOffset??0)*l,this._lineStyle=e.lineStyle,this._calloutContext=o.callout}next(){let s;for(;s=this._inputGeometries.next();){const a=t(s,this._calloutContext);if(a)return"marker"===this._part?e(o(a.bounds),s.yFactor):n(a.bounds,a.layoutAnchor)||l(r(a.bounds,a.layoutAnchor),a.layoutAnchor)<this._leaderTolerance?null:i(a.bounds,a.layoutAnchor,this._lineStyle,this._leaderOffset,s.yFactor,a.anchor)}return null}}export{s as default};