@arcgis/core 5.2.0-next.116 → 5.2.0-next.118

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 (189) hide show
  1. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
  2. package/analysis/featureReferenceUtils.js +1 -1
  3. package/arcade.d.ts +1 -1
  4. package/arcade.js +1 -1
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/03918a862455191a8910.js +1 -0
  7. package/assets/esri/core/workers/chunks/{9b9a60f1e0c48aa701f0.js → 066b7f6866d602f963e0.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{4bfd63f3cf9208eb839b.js → 0dc317d022807af92e3f.js} +41 -41
  9. package/assets/esri/core/workers/chunks/{564fdf0d663b773806cc.js → 114bc14c49176f64a2c5.js} +1 -1
  10. package/assets/esri/core/workers/chunks/1630913399384030d0b9.js +1 -0
  11. package/assets/esri/core/workers/chunks/{db141122060d8d9b38da.js → 1742dbc6a827cfda471b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{045ff98313b06a2188b7.js → 1a39335aa2dce6d564d9.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{caf38cf4d8542fb11c46.js → 20e4277a4a6c57957202.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{f42243c62dd0b6993816.js → 24014f3701c31ee74bc2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/37cf4ca2083cd3b6002e.js +1 -0
  16. package/assets/esri/core/workers/chunks/{44d3fe10cb35d16f0b33.js → 4396ef5ab3eb9e9a7df2.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{3b499cfc89c8f87cdb20.js → 4925d0b29a166cc8fee1.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{56989b48c0a5d7fe85e6.js → 4c4ba466e23159991322.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{b9023cc3298ee4fddea7.js → 54f3bc940cea15fce2c7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{7e42be27ead91a4cc0f1.js → 581285e4d7bbe1b7c27a.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{05584d8828ae7bca0fc5.js → 64ee22134fda2f09c094.js} +1 -1
  22. package/assets/esri/core/workers/chunks/6efc5873747b9cd44fb9.js +1 -0
  23. package/assets/esri/core/workers/chunks/{0463c807b37f01bbc35c.js → 70347d25968975126fa7.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{1eafb214519d8fc63ccb.js → 8465e2c7221125fd3cc4.js} +1 -1
  25. package/assets/esri/core/workers/chunks/862e1acd80c4e43831dc.js +1 -0
  26. package/assets/esri/core/workers/chunks/{fd808d38ae2d475ac442.js → 8675ab3c4dec2f13b9c6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{925a0b29d3ed7165b8dd.js → 8984d02c0ce828fd223a.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{57328c206f1e699ac06f.js → 89edaa1ffa566908ebca.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{bb4cbf6b7c35e8c78cc7.js → a917a1df8270860dc514.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{996438b3afec92c5c68e.js → b0058619e0363002ad86.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{9fb46ccd4be4c3b61c31.js → b5a102cf9f4377fb9842.js} +1 -1
  32. package/assets/esri/core/workers/chunks/b6409d89914030d5854a.js +1 -0
  33. package/assets/esri/core/workers/chunks/{2e0fd0536408053ac6f5.js → b961e0aaa6b3ea75315c.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{fa869977ac2abb063925.js → b9c834e3c0701e9b14a2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{32dd990a3bd93cbad309.js → c0ec87800faf99cbd8bd.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{20de0ea9fa08a6545978.js → cf1106eda10f3cccb1bd.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{ed988360264574cd8f6b.js → cf7c06702babd6fa88b4.js} +1 -1
  38. package/assets/esri/core/workers/chunks/cfd8317ecd2e63af7c40.js +1 -0
  39. package/assets/esri/core/workers/chunks/d090baaa974e1e83fa44.js +1 -0
  40. package/assets/esri/core/workers/chunks/{c5ceceb0683671f92efa.js → da6583e8d88441a1c02a.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{e1f2b07be33e33117313.js → dd02cc18ebebb90778c6.js} +1 -1
  42. package/assets/esri/core/workers/chunks/de8a3a0796bd115426c0.js +1 -0
  43. package/assets/esri/core/workers/chunks/{05b373a663cb5d4d722f.js → deb5b1d772ca407654d4.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{10fa8fbade8ae084c307.js → e22a013ec38989caf9de.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c7e6b5594fed5bb16691.js → e4016ae9cb8f16e3efc3.js} +1 -1
  46. package/assets/esri/core/workers/chunks/e5f0c47957a4e9663720.js +1 -0
  47. package/assets/esri/core/workers/chunks/{a3f4818f4190fa92331d.js → edd36e98355f1655e5c8.js} +1 -1
  48. package/assets/esri/core/workers/chunks/ef6e52f9b656751eebaf.js +1 -0
  49. package/assets/esri/core/workers/chunks/f0709c48daca93e759c8.js +1 -0
  50. package/assets/esri/core/workers/chunks/f5423006fb07db7dd6ee.js +1 -0
  51. package/assets/esri/core/workers/chunks/{d926bffc3ff9f87e9081.js → f890359d972cce54459e.js} +1 -1
  52. package/assets/esri/core/workers/chunks/fb11ff3f2eae5f072560.js +1 -0
  53. package/assets/esri/core/workers/chunks/fdad31bbe8aee68a6eaf.js +1 -0
  54. package/assets/esri/core/workers/chunks/fe1787a8d499832996b3.js +1 -0
  55. package/chunks/CloudsComposition.glsl.js +2 -2
  56. package/chunks/ColorMaterial.glsl.js +3 -3
  57. package/chunks/Compositing.glsl.js +4 -4
  58. package/chunks/DeepSky.glsl.js +3 -3
  59. package/chunks/EdgeShader.glsl.js +6 -6
  60. package/chunks/FocusArea.glsl.js +1 -1
  61. package/chunks/GlobalIllumination.glsl.js +7 -7
  62. package/chunks/HUDMaterial.glsl.js +5 -5
  63. package/chunks/LaserlinePath.glsl.js +5 -5
  64. package/chunks/LineCallout.glsl.js +2 -2
  65. package/chunks/LineMarker.glsl.js +30 -30
  66. package/chunks/NavigationDepth.glsl.js +1 -1
  67. package/chunks/OccludedGeometryDepth.glsl.js +2 -2
  68. package/chunks/Path.glsl.js +12 -12
  69. package/chunks/PointRenderer.glsl.js +5 -5
  70. package/chunks/Precipitation.glsl.js +7 -7
  71. package/chunks/RibbonLine.glsl.js +50 -50
  72. package/chunks/SimpleAtmosphere.glsl.js +9 -9
  73. package/chunks/Stars.glsl.js +5 -5
  74. package/chunks/Terrain.glsl.js +18 -16
  75. package/chunks/Viewshed.glsl.js +3 -3
  76. package/chunks/VolumeMask.glsl.js +2 -2
  77. package/chunks/Water.glsl.js +20 -19
  78. package/config.js +1 -1
  79. package/core/NestedMap.js +1 -1
  80. package/kernel.js +1 -1
  81. package/layers/AnnotationFeatureLayer.d.ts +2 -1
  82. package/layers/AnnotationFeatureLayer.js +1 -1
  83. package/layers/CatalogLayer.d.ts +2 -1
  84. package/layers/CatalogLayer.js +1 -1
  85. package/layers/DimensionFeatureLayer.d.ts +2 -1
  86. package/layers/DimensionFeatureLayer.js +1 -1
  87. package/layers/FeatureLayer.d.ts +2 -30
  88. package/layers/FeatureLayer.js +1 -1
  89. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  90. package/layers/SubtypeGroupLayer.d.ts +2 -1
  91. package/layers/SubtypeGroupLayer.js +1 -1
  92. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  93. package/layers/mixins/FeatureLayerBase.js +1 -1
  94. package/layers/mixins/FeatureLayerReload.d.ts +26 -0
  95. package/layers/mixins/FeatureLayerReload.js +2 -0
  96. package/layers/mixins/PortalLayer.js +1 -1
  97. package/layers/support/TimeInfo.d.ts +2 -2
  98. package/layers/support/TimeInfo.js +1 -1
  99. package/layers/support/fieldUtils.js +1 -1
  100. package/package.json +2 -2
  101. package/support/revision.js +1 -1
  102. package/time/timeZoneUtils.js +1 -1
  103. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  104. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  105. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  106. package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
  107. package/views/3d/support/engineContent/line.js +1 -1
  108. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
  109. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepthToWriteShadowMap.glsl.js +4 -4
  110. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +9 -9
  111. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +15 -15
  112. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +3 -3
  113. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +23 -23
  114. package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +8 -8
  115. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +7 -7
  116. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +7 -7
  117. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  118. package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +2 -0
  119. package/views/3d/webgl-engine/effects/AmbientIllumination.js +1 -1
  120. package/views/3d/webgl-engine/effects/atmosphere/SimpleAtmosphere.glsl.js +1 -1
  121. package/views/3d/webgl-engine/effects/clouds/CloudsComposition.glsl.js +1 -1
  122. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  123. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  124. package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +1 -1
  125. package/views/3d/webgl-engine/effects/precipitation/Precipitation.glsl.js +1 -1
  126. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  127. package/views/3d/webgl-engine/effects/stars/DeepSky.glsl.js +1 -1
  128. package/views/3d/webgl-engine/effects/stars/Stars.glsl.js +1 -1
  129. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  130. package/views/3d/webgl-engine/lib/Program.js +1 -1
  131. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  132. package/views/3d/webgl-engine/lib/edgeRendering/AdjustProjectedPosition.glsl.js +4 -4
  133. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  134. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  135. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  136. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  137. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  138. package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
  139. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  140. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  141. package/views/3d/webgl-engine/materials/ViewingModeConfiguration.js +1 -1
  142. package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
  143. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  144. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  145. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  146. package/views/3d/webgl-engine/shaders/Compositing.glsl.js +1 -1
  147. package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +26 -26
  148. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  149. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  150. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  151. package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
  152. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  153. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  154. package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
  155. package/views/3d/webgl-engine/shaders/LineTechniqueConfiguration.js +2 -0
  156. package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
  157. package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
  158. package/views/3d/webgl-engine/shaders/NavigationDepth.glsl.js +1 -1
  159. package/views/3d/webgl-engine/shaders/OccludedGeometryDepth.glsl.js +1 -1
  160. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  161. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  162. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  163. package/views/3d/webgl-engine/shaders/ScreenSpacePassAtmosphere.glsl.js +1 -1
  164. package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
  165. package/views/3d/webgl-engine/shaders/Viewshed.glsl.js +1 -1
  166. package/views/3d/webgl-engine/shaders/VolumeMask.glsl.js +1 -1
  167. package/widgets/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
  168. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  169. package/widgets/ValuePicker.d.ts +1 -1
  170. package/widgets/ValuePicker.js +1 -1
  171. package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +4 -2
  172. package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
  173. package/widgets/VideoPlayer.js +1 -1
  174. package/assets/esri/core/workers/chunks/0630e650abdfea1792e4.js +0 -1
  175. package/assets/esri/core/workers/chunks/0edebc6c516f0b9dac7b.js +0 -1
  176. package/assets/esri/core/workers/chunks/25c5e1b14b184b1228a3.js +0 -1
  177. package/assets/esri/core/workers/chunks/573e8fa0af8711ffec45.js +0 -1
  178. package/assets/esri/core/workers/chunks/5b9925f23d4b10a7087e.js +0 -1
  179. package/assets/esri/core/workers/chunks/66c46c5a7147550ea3ed.js +0 -1
  180. package/assets/esri/core/workers/chunks/6c7cb7974969e3167f2b.js +0 -1
  181. package/assets/esri/core/workers/chunks/7bbc3d22383388d11345.js +0 -1
  182. package/assets/esri/core/workers/chunks/7edf57e31ff07af9032b.js +0 -1
  183. package/assets/esri/core/workers/chunks/8bd187b48a4e4296e3d8.js +0 -1
  184. package/assets/esri/core/workers/chunks/9acaabe950319d031f2e.js +0 -1
  185. package/assets/esri/core/workers/chunks/ac02df176f9ea94278bb.js +0 -1
  186. package/assets/esri/core/workers/chunks/b4222152efaf73b37b53.js +0 -1
  187. package/assets/esri/core/workers/chunks/c0855be20ffcd52c7026.js +0 -1
  188. package/assets/esri/core/workers/chunks/e606be4ece4eac1e9bbe.js +0 -1
  189. package/assets/esri/core/workers/chunks/f05622413cadfd14553e.js +0 -1
@@ -1,14 +1,14 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../core/Error.js";import{isColor as o}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{OutputHighlight as t}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{EvaluateAmbientLighting as n}from"../views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js";import{mainLightDirection as s,mainLightIntensity as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{ReadShadowMapDrawFragment as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{WaterColor as c}from"../views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js";import{WaterDistortion as g}from"../views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ColorConversion as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as p,addCameraPosition as u}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as w}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as f}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as h}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{outputColorHighlightOLID as b}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as y}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as j}from"../webscene/support/AlphaCutoff.js";function C(C){const L=new y,{vertex:P,fragment:x,varyings:S}=L,{output:_,draped:O,receiveShadows:M}=C;p(P,C),L.include(i),L.attributes.add("position","vec3"),L.attributes.add("uv0","vec2");const D=new w("waterColor",e=>e.color);if(S.add("vpos","vec3",{invariant:!0}),P.uniforms.add(D),o(_)){if(O)return P.main.add(h`
3
- if (waterColor.a < ${h.float(j)}) {
2
+ import e from"../core/Error.js";import{isColor as o}from"../views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js";import{SliceDraw as r}from"../views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js";import{Transform as i}from"../views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js";import{ObjectAndLayerIdColor as a}from"../views/3d/webgl-engine/core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import{OutputHighlight as t}from"../views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js";import{mainLightDirection as n,mainLightIntensity as s}from"../views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js";import{NormalUtils as l}from"../views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js";import{ReadShadowMapDrawFragment as d}from"../views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js";import{WaterColor as m}from"../views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js";import{WaterDistortion as c}from"../views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js";import{ColorConversion as v}from"../views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js";import{addProjViewLocalOrigin as g,addCameraPosition as p}from"../views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js";import{Float4PassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js";import{FloatPassUniform as w}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{glsl as f}from"../views/3d/webgl-engine/core/shaderModules/glsl.js";import{outputColorHighlightOLID as h}from"../views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js";import{ShaderBuilder as b}from"../views/webgl/ShaderBuilder.js";import{alphaCutoff as y}from"../webscene/support/AlphaCutoff.js";function j(j){const C=new b,{vertex:P,fragment:L,varyings:x}=C,{output:S,draped:_,receiveShadows:O}=j;g(P,j),C.include(i),C.attributes.add("position","vec3"),C.attributes.add("uv0","vec2");const D=new u("waterColor",e=>e.color);if(x.add("vpos","vec3",{invariant:!0}),P.uniforms.add(D),o(S)){if(_)return P.main.add(f`
3
+ if (waterColor.a < ${f.float(y)}) {
4
4
  // Discard this vertex
5
5
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
6
6
  return;
7
7
  }
8
8
 
9
9
  vpos = position;
10
- gl_Position = transformPosition(proj, view, vpos);`),x.uniforms.add(D),x.main.add(h`fragColor = waterColor;`),L;P.include(d,C),S.add("vuv","vec2"),S.add("vnormal","vec3"),S.add("vtbnMatrix","mat3"),P.main.add(h`
11
- if (waterColor.a < ${h.float(j)}) {
10
+ gl_Position = transformPosition(proj, view, vpos);`),L.uniforms.add(D),L.main.add(f`fragColor = waterColor;`),C;P.include(l,j),x.add("vuv","vec2"),x.add("vnormal","vec3"),x.add("vtbnMatrix","mat3"),P.main.add(f`
11
+ if (waterColor.a < ${f.float(y)}) {
12
12
  // Discard this vertex
13
13
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
14
14
  return;
@@ -21,7 +21,7 @@ import e from"../core/Error.js";import{isColor as o}from"../views/3d/webgl-engin
21
21
  vtbnMatrix = getTBNMatrix(vnormal);
22
22
 
23
23
  gl_Position = transformPosition(proj, view, vpos);
24
- forwardLinearDepthToReadShadowMap();`)}switch(L.include(m,C),_){case 0:case 1:case 2:x.include(n,{pbrMode:0}),L.include(g),L.include(c,C),x.include(r,C),L.include(b,C),x.include(v),u(x,C),x.uniforms.add(s,l,D,new f("timeElapsed",({timeElapsed:e})=>e),P.uniforms.get("view"),P.uniforms.get("localOrigin")).main.add(h`
24
+ forwardLinearDepthToReadShadowMap();`)}switch(C.include(d,j),S){case 0:case 1:case 2:C.include(c),C.include(m,j),C.include(h,j),L.include(r,j),L.include(v),p(L,j),L.uniforms.add(n,s,D,new w("timeElapsed",({timeElapsed:e})=>e),P.uniforms.get("view"),P.uniforms.get("localOrigin")).main.add(f`
25
25
  discardBySlice(vpos);
26
26
  vec3 localUp = vnormal;
27
27
  // the created normal is in tangent space
@@ -30,13 +30,13 @@ import e from"../core/Error.js";import{isColor as o}from"../views/3d/webgl-engin
30
30
  // we rotate the normal according to the tangent-bitangent-normal-Matrix
31
31
  vec3 n = normalize(vtbnMatrix * tangentNormalFoam.xyz);
32
32
  vec3 v = -normalize(vpos - cameraPosition);
33
- float shadow = ${M?h`1.0 - readShadowMap(vpos, linearDepth)`:"1.0"};
33
+ float shadow = ${O?f`1.0 - readShadowMap(vpos, linearDepth)`:"1.0"};
34
34
  vec4 vPosView = view * vec4(vpos, 1.0);
35
35
  vec4 final = vec4(getWaterColor(n, v, mainLightDirection, waterColor.rgb, mainLightIntensity, localUp, shadow, tangentNormalFoam.w, vPosView.xyz, vpos + localOrigin), waterColor.w);
36
36
 
37
37
  fragColor = delinearizeGamma(final);
38
- outputColorHighlightOLID(applySlice(fragColor, vpos), final.rgb);`);break;case 4:P.include(d,C),L.include(g,C),x.include(r,C),S.add("vuv","vec2"),P.main.add(h`
39
- if (waterColor.a < ${h.float(j)}) {
38
+ outputColorHighlightOLID(applySlice(fragColor, vpos), final.rgb);`);break;case 4:P.include(l,j),C.include(c,j),L.include(r,j),x.add("vuv","vec2"),P.main.add(f`
39
+ if (waterColor.a < ${f.float(y)}) {
40
40
  // Discard this vertex
41
41
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
42
42
  return;
@@ -45,7 +45,7 @@ import e from"../core/Error.js";import{isColor as o}from"../views/3d/webgl-engin
45
45
  vuv = uv0;
46
46
  vpos = position;
47
47
 
48
- gl_Position = transformPosition(proj, view, vpos);`),x.uniforms.add(new f("timeElapsed",({timeElapsed:e})=>e)).main.add(h`
48
+ gl_Position = transformPosition(proj, view, vpos);`),L.uniforms.add(new w("timeElapsed",({timeElapsed:e})=>e)).main.add(f`
49
49
  discardBySlice(vpos);
50
50
 
51
51
  // the created normal is in tangent space and foam
@@ -56,26 +56,27 @@ import e from"../core/Error.js";import{isColor as o}from"../views/3d/webgl-engin
56
56
  // Non-draped water opts out of ambient illumination by writing 0.0.
57
57
  fragColor = vec4(
58
58
  (tangentNormalFoam.xyz + vec3(1.0)) * 0.5,
59
- ${O?h`tangentNormalFoam.w`:h`0.0`}
60
- );`);break;case 3:P.main.add(h`
61
- if (waterColor.a < ${h.float(j)}) {
59
+ ${_?f`tangentNormalFoam.w`:f`0.0`}
60
+ );`);break;case 3:P.main.add(f`
61
+ if (waterColor.a < ${f.float(y)}) {
62
62
  // Discard this vertex
63
63
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
64
64
  return;
65
65
  }
66
66
 
67
67
  vpos = position;
68
- gl_Position = transformPosition(proj, view, vpos);`),x.include(r,C),x.main.add("discardBySlice(vpos);");break;case 10:L.include(t,C),P.main.add(h`
69
- if (waterColor.a < ${h.float(j)}) {
68
+ gl_Position = transformPosition(proj, view, vpos);
69
+ `),L.include(r,j),L.main.add("discardBySlice(vpos);");break;case 10:C.include(t,j),P.main.add(f`
70
+ if (waterColor.a < ${f.float(y)}) {
70
71
  // Discard this vertex
71
72
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
72
73
  return;
73
74
  }
74
75
 
75
76
  vpos = position;
76
- gl_Position = transformPosition(proj, view, vpos);`),x.include(r,C),x.main.add(h`discardBySlice(vpos);
77
- calculateOcclusionAndOutputHighlight();`);break;case 11:L.include(a,C),P.main.add(h`
78
- if (waterColor.a < ${h.float(j)}) {
77
+ gl_Position = transformPosition(proj, view, vpos);`),L.include(r,j),L.main.add(f`discardBySlice(vpos);
78
+ calculateOcclusionAndOutputHighlight();`);break;case 11:C.include(a,j),P.main.add(f`
79
+ if (waterColor.a < ${f.float(y)}) {
79
80
  // Discard this vertex
80
81
  gl_Position = vec4(1e38, 1e38, 1e38, 1.0);
81
82
  return;
@@ -83,5 +84,5 @@ calculateOcclusionAndOutputHighlight();`);break;case 11:L.include(a,C),P.main.ad
83
84
 
84
85
  vpos = position;
85
86
  gl_Position = transformPosition(proj, view, vpos);
86
- forwardObjectAndLayerIdColor();`),x.include(r,C),x.main.add(h`discardBySlice(vpos);
87
- outputObjectAndLayerIdColor();`);break;default:throw new e("shaderbuilder:missing-output",`Unimplemented shader output ${_} for WaterTechnique`)}return L}const L=Object.freeze(Object.defineProperty({__proto__:null,build:C},Symbol.toStringTag,{value:"Module"}));export{L as W,C as b};
87
+ forwardObjectAndLayerIdColor();`),L.include(r,j),L.main.add(f`discardBySlice(vpos);
88
+ outputObjectAndLayerIdColor();`);break;default:throw new e("shaderbuilder:missing-output",`Unimplemented shader output ${S} for WaterTechnique`)}return C}const C=Object.freeze(Object.defineProperty({__proto__:null,build:j},Symbol.toStringTag,{value:"Module"}));export{C as W,j as b};
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.2.0-next.116";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.2.0-next.118";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/core/NestedMap.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- class t{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let t=0;for(const e of this._outer.values())t+=e.size;return t}get(t,e){return this._outer.get(t)?.get(e)}getInner(t){return this._outer.get(t)}set(t,e,r){const o=this._outer.get(t);o?o.set(e,r):this._outer.set(t,new Map([[e,r]]))}delete(t,e){const r=this._outer.get(t);r&&(r.delete(e),0===r.size&&this._outer.delete(t))}pop(t,e){const r=this.get(t,e);return this.delete(t,e),r}*outerMap(){for(const t of this._outer)yield t}*values(){for(const t of this._outer.values())yield*t.values()}*[Symbol.iterator](){for(const[t,e]of this._outer)for(const[r,o]of e)yield[t,r,o]}forEach(t){this._outer.forEach((e,r)=>t(e,r))}forAll(t){this._outer.forEach((e,r)=>e.forEach((e,o)=>t(e,r,o)))}copy(){const e=new t;return this.forAll((t,r,o)=>e.set(r,o,t)),e}}export{t as NestedMap};
2
+ class t{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let t=0;for(const e of this._outer.values())t+=e.size;return t}get(t,e){return this._outer.get(t)?.get(e)}getInner(t){return this._outer.get(t)}set(t,e,r){const o=this._outer.get(t);o?o.set(e,r):this._outer.set(t,new Map([[e,r]]))}delete(t,e){const r=this._outer.get(t);r&&(r.delete(e),0===r.size&&this._outer.delete(t))}pop(t,e){const r=this.get(t,e);return this.delete(t,e),r}*outerMap(){for(const t of this._outer)yield t}*values(){for(const t of this._outer.values())yield*t.values()}*[Symbol.iterator](){for(const[t,e]of this._outer)for(const[r,o]of e)yield[t,r,o]}forEach(t){this._outer.forEach((e,r)=>t(e,r))}forAll(t){this._outer.forEach((e,r)=>e.forEach((e,o)=>t(e,r,o)))}clone(){const e=new t;return this.forAll((t,r,o)=>e.set(r,o,t)),e}}export{t as NestedMap};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let r,s=e;function i(o){r=o}function t(e){const s=r?.findCredential(e);return s?.token?o(e,"token",s.token):e}s="5.2.0-next.116",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,s as fullVersion,r as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.2";let r,s=e;function i(o){r=o}function t(e){const s=r?.findCredential(e);return s?.token?o(e,"token",s.token):e}s="5.2.0-next.118",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,s as fullVersion,r as id,i as setId,e as version};
@@ -17,6 +17,7 @@ import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
17
17
  import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
18
18
  import type { EditBusLayer, EditBusLayerEvents } from "./mixins/EditBusLayer.js";
19
19
  import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
20
+ import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
20
21
  import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
21
22
  import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
22
23
  import type { RefreshableLayer, RefreshableLayerEvents, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
@@ -456,4 +457,4 @@ export default class AnnotationFeatureLayer extends AnnotationFeatureLayerSuperc
456
457
  */
457
458
  saveAs(portalItem: PortalItemProperties, options?: LayerSaveAsOptions): Promise<PortalItem>;
458
459
  }
459
- declare const AnnotationFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof EditBusLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase
460
+ declare const AnnotationFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof EditBusLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase & typeof FeatureLayerReload
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import s from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as c,onAbort as h}from"../core/promiseUtils.js";import{watch as m,sync as f}from"../core/reactiveUtils.js";import{property as b,subclass as v}from"../core/accessorSupport/decorators.js";import g from"../geometry/SpatialReference.js";import S from"../graphic/AnnotationFeatureGraphicOrigin.js";import j from"./Layer.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as w}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as O}from"./mixins/DataElementMixin.js";import{EditBusLayer as x}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as E}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as P}from"./mixins/PortalLayer.js";import{RefreshableLayer as _}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as A}from"./mixins/TemporalLayer.js";import q from"./support/AnnotationFeatureSublayer.js";import{parse as M,cleanTitle as k,titleFromUrlAndName as D}from"./support/arcgisLayerUrl.js";import{barrierWeight as U,id as G,popupEnabled as R}from"./support/commonProperties.js";import{ensureLayerCredential as N,createQuery as Q,getFieldDomain as H,hasDataChanged as J}from"./support/featureLayerUtils.js";import{defineFieldProperties as $}from"./support/fieldProperties.js";import{fixTimeInfoFields as V}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as B}from"./support/versionUtils.js";import K from"../rest/support/Query.js";import{createPopupTemplate as W}from"../support/popupUtils.js";import{reader as Z}from"../core/accessorSupport/decorators/reader.js";const z="annotation-feature-layer",X=$(),Y=a.ofType(q);function ee(e){return e.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,t)=>e-t)??null}let te=class extends(O(E(L(A(x(C(_(w(T(P(u(I(F(o(j))))))))))))))){constructor(e){super(e),this._sublayerLookup=new Map,this.barrierWeight="high",this.elementField="element",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new S(this,null),this.operationalLayerType="ArcGISAnnotationLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.statusField="status",this.sublayers=new Y,this.sublayerTitleMode="item-title",this.supportedSourceTypes=new Set(["Annotation Layer"]),this.symbolCollection=null,this.type="annotation-feature",this.unplacedAnnotationsVisible=!1,this._debouncedSaveOperations=d(async(e,t,r)=>{const{save:i,saveAs:s}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,t);case 1:return s(this,r,t)}}),this.addHandles(m(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),f))}destroy(){this.source?.destroy()}load(e){const t=e?.signal,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(y).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url)throw new n(`${z}:missing-url`,"AnnotationFeatureLayer must be created with a url");return Promise.all([this.loadDataElement(e).then(()=>{if(!this.symbolCollection)throw new n(`${z}:missing-symbol-collection`,"Invalid service with no symbol collection")}),this.initLayerProperties(await this.createGraphicsSource(t))])}).then(()=>N(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,t){const r=new Y(t.subtypes.map(({code:e})=>new q({subtypeCode:e})).reverse());if(this.visibleLayers){const e=new Set(this.visibleLayers);r.forEach(t=>{t.visible=e.has(t.subtypeCode)})}return r}readTitleFromService(e,t){const{url:r}=this,i=t.name||M(r)?.title;switch(this.sublayerTitleMode){case"item-title":if(r)return D(r,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=k(e),i?`${e} - ${k(i)}`:e;break}}return i?k(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}get visibleLayers(){return 0===this.sublayers.length?this._get("visibleLayers")??null:Array.from(new Set(ee(this)))}set visibleLayers(e){this._set("visibleLayers",e)}createPopupTemplate(e){return W(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{const{default:t}=await c(import("./graphics/sources/FeatureLayerSource.js"),r),s=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(h(r,()=>s.cancelLoad())??p()),!1);return await s.load({signal:r}),s}catch(s){i.error=s,i.hasError=!0}finally{t(i)}}createQuery(){const e=Q(this);return e.where=this.definitionExpression||"1=1",e}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return H(this,e,t,this.getField(e)?.domain??null)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(K.from(e)??r.createQuery(),t);if(i?.features)for(const s of i.features){const e=this.findSublayerForFeature(s);s.origin=e?.graphicOrigin??this.graphicOrigin,s.layer=s.sourceLayer=this}return i}async queryObjectIds(e,t){const r=await this.load();return r.source.queryObjectIds(K.from(e)??r.createQuery(),t)}async queryFeatureCount(e,t){const r=await this.load();return r.source.queryFeatureCount(K.from(e)??r.createQuery(),t)}async queryExtent(e,t){const r=await this.load();return r.source.queryExtent(K.from(e)??r.createQuery(),t)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}serviceSupportsSpatialReference(e){return this.loaded&&B(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),V(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return J(this)}_verifySource(){if(this.version&&this.version<10.8)throw new n(z+":unsupported-version","The feature service must be version 10.8 or above.");const e=["ZOrder","AnnotationClassID","Element","SymbolID","Status"],t=e.filter(e=>!this.fieldsIndex.has(e));if(this.fieldsIndex.has("FeatureID")||this.fieldsIndex.has("FeatureGlobalID")||t.unshift("FeatureID","FeatureGlobalID"),t.length)throw new n(z+":missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})}_fetchFirstValidLayerId(e){return s(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(!t)return;this.applyPreferredHost(t);const r=[...t.layers||[],...t.tables||[]];return r.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on("after-remove",({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],"sublayers-owner"))}};r([b({type:g,json:{origins:{service:{read:{source:"sourceSpatialReference"}}}}})],te.prototype,"attributeSpatialReference",void 0),r([b(U)],te.prototype,"barrierWeight",void 0),r([b({nonNullable:!0,json:{name:"enableEditing",write:!0}})],te.prototype,"editingEnabled",null),r([b({readOnly:!0})],te.prototype,"effectiveEditingEnabled",null),r([b({readOnly:!0})],te.prototype,"elementField",void 0),r([b({...X.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],te.prototype,"fields",void 0),r([b(X.fieldsIndex)],te.prototype,"fieldsIndex",void 0),r([b({readOnly:!0,clonable:!1})],te.prototype,"graphicOrigin",void 0),r([b(G)],te.prototype,"id",void 0),r([b({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],te.prototype,"listMode",void 0),r([b({type:["ArcGISAnnotationLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],te.prototype,"operationalLayerType",void 0),r([b(X.outFields)],te.prototype,"outFields",void 0),r([b(R)],te.prototype,"popupEnabled",void 0),r([b({type:i,json:{name:"popupInfo",write:!0}})],te.prototype,"popupTemplate",void 0),r([b({readOnly:!0})],te.prototype,"defaultPopupTemplate",null),r([b({readOnly:!0})],te.prototype,"referenceScale",void 0),r([b({clonable:!1,readOnly:!0})],te.prototype,"source",void 0),r([b({readOnly:!0})],te.prototype,"statusField",void 0),r([b({type:Y,json:{name:"layers",write:{ignoreOrigin:!0}}})],te.prototype,"sublayers",void 0),r([Z("service","sublayers",["subtypes"])],te.prototype,"readSublayers",null),r([b({type:String})],te.prototype,"sublayerTitleMode",void 0),r([b({readOnly:!0})],te.prototype,"symbolCollection",void 0),r([Z("service","title",["name"])],te.prototype,"readTitleFromService",null),r([Z("portal-item","title")],te.prototype,"readTitleFromPortalItem",null),r([b({json:{read:!1},value:"annotation-feature",readOnly:!0})],te.prototype,"type",void 0),r([b()],te.prototype,"unplacedAnnotationsVisible",void 0),r([b({type:[Number]})],te.prototype,"visibleLayers",null),te=r([v("esri.layers.AnnotationFeatureLayer")],te);const re=te;export{re as default};
2
+ import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import s from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{debounce as d,throwIfAbortError as y,whenOrAbort as m,onAbort as h}from"../core/promiseUtils.js";import{watch as c,sync as f}from"../core/reactiveUtils.js";import{property as b,subclass as v}from"../core/accessorSupport/decorators.js";import g from"../geometry/SpatialReference.js";import S from"../graphic/AnnotationFeatureGraphicOrigin.js";import j from"./Layer.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as w}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as O}from"./mixins/DataElementMixin.js";import{EditBusLayer as T}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as x}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as E}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{RefreshableLayer as C}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as q}from"./mixins/TemporalLayer.js";import D from"./support/AnnotationFeatureSublayer.js";import{parse as M,cleanTitle as k,titleFromUrlAndName as U}from"./support/arcgisLayerUrl.js";import{barrierWeight as R,id as G,popupEnabled as N}from"./support/commonProperties.js";import{ensureLayerCredential as Q,createQuery as H,getFieldDomain as J,hasDataChanged as $}from"./support/featureLayerUtils.js";import{defineFieldProperties as V}from"./support/fieldProperties.js";import{fixTimeInfoFields as B}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as K}from"./support/versionUtils.js";import W from"../rest/support/Query.js";import{createPopupTemplate as Z}from"../support/popupUtils.js";import{reader as z}from"../core/accessorSupport/decorators/reader.js";const X="annotation-feature-layer",Y=V(),ee=a.ofType(D);function te(e){return e.sublayers?.toArray().filter(e=>e.visible).map(e=>e.subtypeCode).sort((e,t)=>e-t)??null}let re=class extends(E(O(x(L(q(T(A(C(w(P(_(u(I(F(o(j)))))))))))))))){constructor(e){super(e),this._sublayerLookup=new Map,this.barrierWeight="high",this.elementField="element",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new S(this,null),this.operationalLayerType="ArcGISAnnotationLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.statusField="status",this.sublayers=new ee,this.sublayerTitleMode="item-title",this.supportedPortalItemTypes=["Feature Service"],this.supportedSourceTypes=new Set(["Annotation Layer"]),this.symbolCollection=null,this.type="annotation-feature",this.unplacedAnnotationsVisible=!1,this._debouncedSaveOperations=d(async(e,t,r)=>{const{save:i,saveAs:s}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,t);case 1:return s(this,r,t)}}),this.addHandles(c(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),f))}destroy(){this.source?.destroy()}load(e){const t=e?.signal,r=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(y).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url)throw new n(`${X}:missing-url`,"AnnotationFeatureLayer must be created with a url");return Promise.all([this.loadDataElement(e).then(()=>{if(!this.symbolCollection)throw new n(`${X}:missing-symbol-collection`,"Invalid service with no symbol collection")}),this.initLayerProperties(await this.createGraphicsSource(t))])}).then(()=>Q(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readSublayers(e,t){const r=new ee(t.subtypes.map(({code:e})=>new D({subtypeCode:e})).reverse());if(this.visibleLayers){const e=new Set(this.visibleLayers);r.forEach(t=>{t.visible=e.has(t.subtypeCode)})}return r}readTitleFromService(e,t){const{url:r}=this,i=t.name||M(r)?.title;switch(this.sublayerTitleMode){case"item-title":if(r)return U(r,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=k(e),i?`${e} - ${k(i)}`:e;break}}return i?k(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}get visibleLayers(){return 0===this.sublayers.length?this._get("visibleLayers")??null:Array.from(new Set(te(this)))}set visibleLayers(e){this._set("visibleLayers",e)}createPopupTemplate(e){return Z(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{const{default:t}=await m(import("./graphics/sources/FeatureLayerSource.js"),r),s=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(h(r,()=>s.cancelLoad())??p()),!1);return await s.load({signal:r}),s}catch(s){i.error=s,i.hasError=!0}finally{t(i)}}createQuery(){const e=H(this);return e.where=this.definitionExpression||"1=1",e}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return J(this,e,t,this.getField(e)?.domain??null)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(W.from(e)??r.createQuery(),t);if(i?.features)for(const s of i.features){const e=this.findSublayerForFeature(s);s.origin=e?.graphicOrigin??this.graphicOrigin,s.layer=s.sourceLayer=this}return i}async queryObjectIds(e,t){const r=await this.load();return r.source.queryObjectIds(W.from(e)??r.createQuery(),t)}async queryFeatureCount(e,t){const r=await this.load();return r.source.queryFeatureCount(W.from(e)??r.createQuery(),t)}async queryExtent(e,t){const r=await this.load();return r.source.queryExtent(W.from(e)??r.createQuery(),t)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}serviceSupportsSpatialReference(e){return this.loaded&&K(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),B(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){const t=this.source;await Promise.all([t.reload({signal:e}),this.loadDataElement({signal:e})]),await this.initLayerProperties(t)}async hasDataChanged(){return $(this)}_verifySource(){if(this.version&&this.version<10.8)throw new n(X+":unsupported-version","The feature service must be version 10.8 or above.");const e=["ZOrder","AnnotationClassID","Element","SymbolID","Status"],t=e.filter(e=>!this.fieldsIndex.has(e));if(this.fieldsIndex.has("FeatureID")||this.fieldsIndex.has("FeatureGlobalID")||t.unshift("FeatureID","FeatureGlobalID"),t.length)throw new n(X+":missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})}_fetchFirstValidLayerId(e){return s(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(!t)return;this.applyPreferredHost(t);const r=[...t.layers||[],...t.tables||[]];return r.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on("after-remove",({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],"sublayers-owner"))}};r([b({type:g,json:{origins:{service:{read:{source:"sourceSpatialReference"}}}}})],re.prototype,"attributeSpatialReference",void 0),r([b(R)],re.prototype,"barrierWeight",void 0),r([b({nonNullable:!0,json:{name:"enableEditing",write:!0}})],re.prototype,"editingEnabled",null),r([b({readOnly:!0})],re.prototype,"effectiveEditingEnabled",null),r([b({readOnly:!0})],re.prototype,"elementField",void 0),r([b({...Y.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],re.prototype,"fields",void 0),r([b(Y.fieldsIndex)],re.prototype,"fieldsIndex",void 0),r([b({readOnly:!0,clonable:!1})],re.prototype,"graphicOrigin",void 0),r([b(G)],re.prototype,"id",void 0),r([b({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],re.prototype,"listMode",void 0),r([b({type:["ArcGISAnnotationLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],re.prototype,"operationalLayerType",void 0),r([b(Y.outFields)],re.prototype,"outFields",void 0),r([b(N)],re.prototype,"popupEnabled",void 0),r([b({type:i,json:{name:"popupInfo",write:!0}})],re.prototype,"popupTemplate",void 0),r([b({readOnly:!0})],re.prototype,"defaultPopupTemplate",null),r([b({readOnly:!0})],re.prototype,"referenceScale",void 0),r([b({clonable:!1,readOnly:!0})],re.prototype,"source",void 0),r([b({readOnly:!0})],re.prototype,"statusField",void 0),r([b({type:ee,json:{name:"layers",write:{ignoreOrigin:!0}}})],re.prototype,"sublayers",void 0),r([z("service","sublayers",["subtypes"])],re.prototype,"readSublayers",null),r([b({type:String})],re.prototype,"sublayerTitleMode",void 0),r([b({readOnly:!0})],re.prototype,"symbolCollection",void 0),r([z("service","title",["name"])],re.prototype,"readTitleFromService",null),r([z("portal-item","title")],re.prototype,"readTitleFromPortalItem",null),r([b({json:{read:!1},value:"annotation-feature",readOnly:!0})],re.prototype,"type",void 0),r([b()],re.prototype,"unplacedAnnotationsVisible",void 0),r([b({type:[Number]})],re.prototype,"visibleLayers",null),re=r([v("esri.layers.AnnotationFeatureLayer")],re);const ie=re;export{ie as default};
@@ -15,6 +15,7 @@ import type { CustomParametersMixin, CustomParametersMixinProperties } from "./m
15
15
  import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mixins/DisplayFilteredLayer.js";
16
16
  import type { EditBusLayer } from "./mixins/EditBusLayer.js";
17
17
  import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
18
+ import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
18
19
  import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
19
20
  import type { OrderedLayer, OrderedLayerProperties } from "./mixins/OrderedLayer.js";
20
21
  import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
@@ -672,4 +673,4 @@ export default class CatalogLayer extends CatalogLayerSuperclass {
672
673
  */
673
674
  queryObjectIds(query?: QueryProperties | null | undefined, options?: RequestOptions): Promise<ObjectId[]>;
674
675
  }
675
- declare const CatalogLayerSuperclass: typeof Layer & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof EditBusLayer & typeof FeatureLayerBase & typeof DisplayFilteredLayer
676
+ declare const CatalogLayerSuperclass: typeof Layer & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof EditBusLayer & typeof FeatureLayerBase & typeof DisplayFilteredLayer & typeof FeatureLayerReload
@@ -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/Collection.js";import i from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{hasSamePortal as n}from"../core/urlUtils.js";import{property as l,subclass as p}from"../core/accessorSupport/decorators.js";import y from"./Layer.js";import d from"./catalog/CatalogDynamicGroupLayer.js";import u from"./catalog/CatalogFootprintLayer.js";import m from"./graphics/sources/FeatureLayerSource.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{ArcGISService as f}from"./mixins/ArcGISService.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as F}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as w}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as j}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as L}from"./mixins/OperationalLayer.js";import{OrderedLayer as v}from"./mixins/OrderedLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as I}from"./mixins/TemporalLayer.js";import{legendEnabled as O,id as E}from"./support/commonProperties.js";import{ensureLayerCredential as T,applyEdits as P,getFeatureType as _,hasDataChanged as C,validateBinsQuery as q}from"./support/featureLayerUtils.js";import A from"./support/FeatureType.js";import{defineFieldProperties as G}from"./support/fieldProperties.js";import{serviceSupportsSpatialReference as U}from"./support/versionUtils.js";import Q from"../portal/Portal.js";import B from"../portal/PortalItem.js";import{normalizeArcGISOnlineOrgDomain as D}from"../portal/support/urlUtils.js";import N from"../rest/support/Query.js";const M=G();function R(e){return"object"==typeof e&&null!=e&&"itemId"in e&&"portalUrl"in e}function V(e){return"object"==typeof e&&null!=e&&"url"in e}function J(e){if(null==e)return!0;const t=Object.keys(e);return!t.length||1===t.length&&"id"===t[0]}function k(e,t,r,i){const o=e.write({},i);J(o)||(t[r]=o)}let H=class extends(F(j(w(h(v(I(b(x(f(L(S(s(g(c(y))))))))))))))){constructor(e){super(e),this.legendEnabled=!0,this._portals=new Map,this._layerToFootprint=new WeakMap,this.drawOrderField="cd_draworder",this.dynamicGroupLayer=new d({parent:this}),this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.footprintLayer=new u({parent:this}),this.itemNameField="cd_itemname",this.itemSourceField="cd_itemsource",this.itemTypeField="cd_itemtype",this.layers=new r([this.dynamicGroupLayer,this.footprintLayer]),this.maxScaleField="cd_maxscale",this.minScaleField="cd_minscale",this.orderBy=null,this.outFields=null,this.supportedSourceTypes=new Set(["Catalog Layer"]),this.source=new m({layer:this,supportedSourceTypes:this.supportedSourceTypes}),this.type="catalog",this.typeIdField=null,this.types=null}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(a).then(async()=>{const{url:e,source:r,portalItem:o}=this;if(!e)throw new i("catalog-layer:missing-url","Catalog layer must be created with a url");if(null==this.layerId){const r=await this._fetchFirstValidLayerId(t);if(null==r)throw new i("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:e});this.layerId=r}await r.load({signal:t});const{sourceJSON:s}=r;s&&(this.sourceJSON=s,this.read(s,{origin:"service",portalItem:o,portal:o?.portal,url:this.parsedUrl}))}).then(()=>{const e=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],t=e.filter(e=>!this.fieldsIndex.has(e));if(t.length)throw new i("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})}).then(()=>T(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}async applyEdits(e,t){return P(this,e,t)}async createLayerFromFootprint(e){const t=await this._createLayer(e);return this._configureLayer(t,e),this._layerToFootprint.set(t,e),t}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new N,t=this.capabilities?.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return _(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this.getField(e)?.domain}async hasDataChanged(){return C(this)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(N.from(e)??r.createQuery(),t),o=r.footprintLayer.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r.footprintLayer,s.origin=o;return i}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(N.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(N.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(N.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&U(this,e)}read(e,t){if(super.read(e,t),e){const{footprintLayer:r,dynamicGroupLayer:i}=e;r&&this.footprintLayer.read(r,t),i&&this.dynamicGroupLayer.read(i,t)}}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();q(e,i,"CatalogLayer");const o=await(import("../rest/support/AttributeBinsQuery.js")),s=await r.queryAttributeBins(o.default.from(e),t);if(s.features)for(const a of s.features)a.layer=a.sourceLayer=this.footprintLayer;return s}async _fetchFirstValidLayerId(e){const{data:r}=await t(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(this.applyPreferredHost(r),Array.isArray(r?.layers))return r.layers.find(({type:e})=>!!e&&this.supportedSourceTypes.has(e))?.id}async _createLayer(e){const t=e.getAttribute(this.itemSourceField);if(!t)throw new i("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const r=JSON.parse(t);if(R(r)){const{itemId:e,portalUrl:t}=r,i=D(t),s=this.portalItem?.portal,a=Q.getDefault();let l,p=!0;s&&n(t,s.url)?l=s:n(t,a.url)?l=a:(l=o(this._portals,i,()=>new Q({url:i})),p=!1);const d=await y.fromPortalItem(new B({id:e,portal:l}));return p||await K(d),d}if(V(r))return y.fromArcGISServerUrl({url:r.url});const{default:s}=await(import("./UnsupportedLayer.js"));return new s}_configureLayer(e,t){const r=t.getAttribute(this.itemNameField);r&&(e.title=r);const i=t.getAttribute(this.maxScaleField);null!=i&&"maxScale"in e&&(e.maxScale=i);const o=t.getAttribute(this.minScaleField);null!=o&&"minScale"in e&&(e.minScale=o)}};async function K(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,"group"===e.type&&await Promise.allSettled([...e.layers.map(e=>K(e)),...e.tables.map(e=>K(e))])}}e([l(O)],H.prototype,"legendEnabled",void 0),e([l({readOnly:!0})],H.prototype,"createQueryVersion",null),e([l({readOnly:!0})],H.prototype,"drawOrderField",void 0),e([l({type:d,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:k}}})],H.prototype,"dynamicGroupLayer",void 0),e([l({readOnly:!0})],H.prototype,"editingEnabled",null),e([l({readOnly:!0})],H.prototype,"effectiveEditingEnabled",null),e([l({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],H.prototype,"elevationInfo",void 0),e([l({...M.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],H.prototype,"fields",void 0),e([l(M.fieldsIndex)],H.prototype,"fieldsIndex",void 0),e([l({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],H.prototype,"floorInfo",void 0),e([l({type:u,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:k}}})],H.prototype,"footprintLayer",void 0),e([l(E)],H.prototype,"id",void 0),e([l({readOnly:!0})],H.prototype,"itemNameField",void 0),e([l({readOnly:!0})],H.prototype,"itemSourceField",void 0),e([l({readOnly:!0})],H.prototype,"itemTypeField",void 0),e([l({readOnly:!0})],H.prototype,"layers",void 0),e([l({type:["show","hide","hide-children"]})],H.prototype,"listMode",void 0),e([l({readOnly:!0})],H.prototype,"maxScaleField",void 0),e([l({readOnly:!0})],H.prototype,"minScaleField",void 0),e([l({value:"CatalogLayer",type:["CatalogLayer"]})],H.prototype,"operationalLayerType",void 0),e([l({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],H.prototype,"orderBy",void 0),e([l(M.outFields)],H.prototype,"outFields",void 0),e([l({readOnly:!0})],H.prototype,"source",void 0),e([l({json:{read:!1}})],H.prototype,"type",void 0),e([l({type:String})],H.prototype,"typeIdField",void 0),e([l({type:[A]})],H.prototype,"types",void 0),H=e([p("esri.layers.CatalogLayer")],H);const W=H;export{W as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Collection.js";import i from"../core/Error.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{hasSamePortal as n}from"../core/urlUtils.js";import{property as l,subclass as p}from"../core/accessorSupport/decorators.js";import y from"./Layer.js";import d from"./catalog/CatalogDynamicGroupLayer.js";import u from"./catalog/CatalogFootprintLayer.js";import m from"./graphics/sources/FeatureLayerSource.js";import{APIKeyMixin as c}from"./mixins/APIKeyMixin.js";import{ArcGISService as f}from"./mixins/ArcGISService.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as F}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as w}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as j}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{OrderedLayer as S}from"./mixins/OrderedLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as O}from"./mixins/TemporalLayer.js";import{legendEnabled as _,id as P}from"./support/commonProperties.js";import{ensureLayerCredential as T,applyEdits as E,getFeatureType as C,hasDataChanged as q,validateBinsQuery as A}from"./support/featureLayerUtils.js";import G from"./support/FeatureType.js";import{defineFieldProperties as U}from"./support/fieldProperties.js";import{serviceSupportsSpatialReference as Q}from"./support/versionUtils.js";import B from"../portal/Portal.js";import D from"../portal/PortalItem.js";import{normalizeArcGISOnlineOrgDomain as N}from"../portal/support/urlUtils.js";import M from"../rest/support/Query.js";const R=U();function V(e){return"object"==typeof e&&null!=e&&"itemId"in e&&"portalUrl"in e}function J(e){return"object"==typeof e&&null!=e&&"url"in e}function k(e){if(null==e)return!0;const t=Object.keys(e);return!t.length||1===t.length&&"id"===t[0]}function H(e,t,r,i){const o=e.write({},i);k(o)||(t[r]=o)}let K=class extends(j(F(L(w(h(S(O(b(I(f(v(x(s(g(c(y)))))))))))))))){constructor(e){super(e),this.legendEnabled=!0,this._portals=new Map,this._layerToFootprint=new WeakMap,this.drawOrderField="cd_draworder",this.dynamicGroupLayer=new d({parent:this}),this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.footprintLayer=new u({parent:this}),this.itemNameField="cd_itemname",this.itemSourceField="cd_itemsource",this.itemTypeField="cd_itemtype",this.layers=new r([this.dynamicGroupLayer,this.footprintLayer]),this.maxScaleField="cd_maxscale",this.minScaleField="cd_minscale",this.orderBy=null,this.outFields=null,this.supportedPortalItemTypes=["Feature Service"],this.supportedSourceTypes=new Set(["Catalog Layer"]),this.source=new m({layer:this,supportedSourceTypes:this.supportedSourceTypes}),this.type="catalog",this.typeIdField=null,this.types=null}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(a).then(async()=>{const{url:e,source:r}=this;if(!e)throw new i("catalog-layer:missing-url","Catalog layer must be created with a url");if(null==this.layerId){const r=await this._fetchFirstValidLayerId(t);if(null==r)throw new i("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:e});this.layerId=r}await r.load({signal:t}),this._initLayerProperties(),this._verifyFields()}).then(()=>T(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}async applyEdits(e,t){return E(this,e,t)}async createLayerFromFootprint(e){const t=await this._createLayer(e);return this._configureLayer(t,e),this._layerToFootprint.set(t,e),t}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new M,t=this.capabilities?.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=null!=r&&null!=i?i.offset(-r.value,r.unit):i||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return C(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const t=i.domains&&i.domains[e];if(t&&"inherited"!==t.type)return t}return this.getField(e)?.domain}async reloadFromService(e){await this.source.reload({signal:e}),this._initLayerProperties(),this._verifyFields()}async hasDataChanged(){return q(this)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(M.from(e)??r.createQuery(),t),o=r.footprintLayer.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r.footprintLayer,s.origin=o;return i}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(M.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(M.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(M.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&Q(this,e)}read(e,t){if(super.read(e,t),e){const{footprintLayer:r,dynamicGroupLayer:i}=e;r&&this.footprintLayer.read(r,t),i&&this.dynamicGroupLayer.read(i,t)}}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();A(e,i,"CatalogLayer");const o=await(import("../rest/support/AttributeBinsQuery.js")),s=await r.queryAttributeBins(o.default.from(e),t);if(s.features)for(const a of s.features)a.layer=a.sourceLayer=this.footprintLayer;return s}_initLayerProperties(){const{portalItem:e,source:t}=this,{sourceJSON:r}=t;r&&(this.sourceJSON=r,this.read(r,{origin:"service",portalItem:e,portal:e?.portal,url:this.parsedUrl}))}_verifyFields(){const e=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],t=e.filter(e=>!this.fieldsIndex.has(e));if(t.length)throw new i("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:t})}async _fetchFirstValidLayerId(e){const{data:r}=await t(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(this.applyPreferredHost(r),Array.isArray(r?.layers))return r.layers.find(({type:e})=>!!e&&this.supportedSourceTypes.has(e))?.id}async _createLayer(e){const t=e.getAttribute(this.itemSourceField);if(!t)throw new i("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const r=JSON.parse(t);if(V(r)){const{itemId:e,portalUrl:t}=r,i=N(t),s=this.portalItem?.portal,a=B.getDefault();let l,p=!0;s&&n(t,s.url)?l=s:n(t,a.url)?l=a:(l=o(this._portals,i,()=>new B({url:i})),p=!1);const d=await y.fromPortalItem(new D({id:e,portal:l}));return p||await W(d),d}if(J(r))return y.fromArcGISServerUrl({url:r.url});const{default:s}=await(import("./UnsupportedLayer.js"));return new s}_configureLayer(e,t){const r=t.getAttribute(this.itemNameField);r&&(e.title=r);const i=t.getAttribute(this.maxScaleField);null!=i&&"maxScale"in e&&(e.maxScale=i);const o=t.getAttribute(this.minScaleField);null!=o&&"minScale"in e&&(e.minScale=o)}};async function W(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,"group"===e.type&&await Promise.allSettled([...e.layers.map(e=>W(e)),...e.tables.map(e=>W(e))])}}e([l(_)],K.prototype,"legendEnabled",void 0),e([l({readOnly:!0})],K.prototype,"createQueryVersion",null),e([l({readOnly:!0})],K.prototype,"drawOrderField",void 0),e([l({type:d,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:H}}})],K.prototype,"dynamicGroupLayer",void 0),e([l({readOnly:!0})],K.prototype,"editingEnabled",null),e([l({readOnly:!0})],K.prototype,"effectiveEditingEnabled",null),e([l({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],K.prototype,"elevationInfo",void 0),e([l({...R.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],K.prototype,"fields",void 0),e([l(R.fieldsIndex)],K.prototype,"fieldsIndex",void 0),e([l({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],K.prototype,"floorInfo",void 0),e([l({type:u,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:H}}})],K.prototype,"footprintLayer",void 0),e([l(P)],K.prototype,"id",void 0),e([l({readOnly:!0})],K.prototype,"itemNameField",void 0),e([l({readOnly:!0})],K.prototype,"itemSourceField",void 0),e([l({readOnly:!0})],K.prototype,"itemTypeField",void 0),e([l({readOnly:!0})],K.prototype,"layers",void 0),e([l({type:["show","hide","hide-children"]})],K.prototype,"listMode",void 0),e([l({readOnly:!0})],K.prototype,"maxScaleField",void 0),e([l({readOnly:!0})],K.prototype,"minScaleField",void 0),e([l({value:"CatalogLayer",type:["CatalogLayer"]})],K.prototype,"operationalLayerType",void 0),e([l({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],K.prototype,"orderBy",void 0),e([l(R.outFields)],K.prototype,"outFields",void 0),e([l({readOnly:!0})],K.prototype,"source",void 0),e([l({json:{read:!1}})],K.prototype,"type",void 0),e([l({type:String})],K.prototype,"typeIdField",void 0),e([l({type:[G]})],K.prototype,"types",void 0),K=e([p("esri.layers.CatalogLayer")],K);const $=K;export{$ as default};
@@ -14,6 +14,7 @@ import type { BlendLayer, BlendLayerProperties } from "./mixins/BlendLayer.js";
14
14
  import type { CustomParametersMixin, CustomParametersMixinProperties } from "./mixins/CustomParametersMixin.js";
15
15
  import type { EditBusLayerEvents } from "./mixins/EditBusLayer.js";
16
16
  import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
17
+ import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
17
18
  import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
18
19
  import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
19
20
  import type { RefreshableLayer, RefreshableLayerEvents, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
@@ -380,4 +381,4 @@ export default class DimensionFeatureLayer extends DimensionFeatureLayerSupercla
380
381
  */
381
382
  saveAs(portalItem: PortalItemProperties, options?: LayerSaveAsOptions): Promise<PortalItem>;
382
383
  }
383
- declare const DimensionFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase
384
+ declare const DimensionFeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof FeatureLayerBase & typeof FeatureLayerReload
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Error.js";import{disposable as n,makeHandle as l}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{debounce as u,throwIfAbortError as d,whenOrAbort as m,onAbort as c}from"../core/promiseUtils.js";import{property as y,subclass as h}from"../core/accessorSupport/decorators.js";import f from"../geometry/SpatialReference.js";import v from"../graphic/DimensionFeatureGraphicOrigin.js";import E from"./Layer.js";import{APIKeyMixin as T}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{BlendLayer as S}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as j}from"./mixins/DataElementMixin.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as D}from"./mixins/PortalLayer.js";import{RefreshableLayer as w}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as P}from"./mixins/TemporalLayer.js";import{parse as F,cleanTitle as M,titleFromUrlAndName as x}from"./support/arcgisLayerUrl.js";import{barrierWeight as N,id as G,popupEnabled as A}from"./support/commonProperties.js";import{ensureLayerCredential as X,createQuery as Y,getFieldDomain as U,hasDataChanged as q}from"./support/featureLayerUtils.js";import{defineFieldProperties as C}from"./support/fieldProperties.js";import{fixTimeInfoFields as R}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as _}from"./support/versionUtils.js";import H from"../rest/support/Query.js";import{createPopupTemplate as B}from"../support/popupUtils.js";import{reader as Q}from"../core/accessorSupport/decorators/reader.js";const J="dimension-feature-layer",$=C();let k=class extends(j(L(S(P(O(w(g(b(D(p(I(T(s(E)))))))))))))){constructor(e){super(e),this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new v(this),this.operationalLayerType="ArcGISDimensionLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.styleCollection=null,this.sublayerTitleMode="item-title",this.supportedSourceTypes=new Set(["Dimension Layer"]),this.symbolFields=["STYLEID","BEGINX","BEGINY","ENDX","ENDY","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","DIMX","DIMY","TEXTX","TEXTY","DIMLENGTH","DIMTYPE","EXTANGLE","TEXTANGLE","USECUSTOMLENGTH","CUSTOMLENGTH "],this.type="dimension-feature",this._debouncedSaveOperations=u(async(e,r,t)=>{const{save:i,saveAs:o}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,r);case 1:return o(this,t,r)}})}destroy(){this.source?.destroy()}load(e){const r=e?.signal,t=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(d).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(r);null!=e&&(this.layerId=e)}if(!this.url)throw new a(`${J}:missing-url`,"DimensionFeatureLayer must be created with a url");return Promise.all([this.loadDataElement(e).then(()=>{if(!this.styleCollection)throw new a(`${J}:missing-style-collection`,"Invalid service with no style collection")}),this.initLayerProperties(await this.createGraphicsSource(r))])}).then(()=>X(this,"load",e));return this.addResolvingPromise(t),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readTitleFromService(e,r){const{url:t}=this,i=r.name||F(t)?.title;switch(this.sublayerTitleMode){case"item-title":if(t)return x(t,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=M(e),i?`${e} - ${M(i)}`:e;break}}return i?M(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}createPopupTemplate(e){return B(this,e)}async createGraphicsSource(t){const i={stack:[],error:void 0,hasError:!1};try{const{default:r}=await m(import("./graphics/sources/FeatureLayerSource.js"),t),o=new r({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,n(c(t,()=>o.cancelLoad())??l()),!1);return await o.load({signal:t}),o}catch(o){i.error=o,i.hasError=!0}finally{r(i)}}createQuery(){const e=Y(this);return e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,r){return U(this,e,r,this.getField(e)?.domain??null)}async queryFeatures(e,r){const t=await this.load(),i=await t.source.queryFeatures(H.from(e)??t.createQuery(),r),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=t,s.origin=o;return i}async queryObjectIds(e,r){const t=await this.load();return t.source.queryObjectIds(H.from(e)??t.createQuery(),r)}async queryFeatureCount(e,r){const t=await this.load();return t.source.queryFeatureCount(H.from(e)??t.createQuery(),r)}async queryExtent(e,r){const t=await this.load();return t.source.queryExtent(H.from(e)??t.createQuery(),r)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return this.loaded&&_(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),R(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return q(this)}_verifySource(){if(this.version&&this.version<10.8)throw new a(J+":unsupported-version","The feature service must be version 10.8 or above.");const e=["DIMLENGTH","BEGINX","BEGINY","ENDX","ENDY","DIMX","DIMY","TEXTX","TEXTY","DIMTYPE","EXTANGLE","STYLEID","USECUSTOMLENGTH","CUSTOMLENGTH","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","TEXTANGLE"],r=e.filter(e=>!this.fieldsIndex.has(e));if(r.length)throw new a(J+":missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:r})}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const r=e.data;if(!r)return;this.applyPreferredHost(r);const t=[...r.layers||[],...r.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}};t([y({type:f,json:{origins:{service:{read:{source:"sourceSpatialReference"}}}}})],k.prototype,"attributeSpatialReference",void 0),t([y(N)],k.prototype,"barrierWeight",void 0),t([y({nonNullable:!0,json:{name:"enableEditing",write:!0}})],k.prototype,"editingEnabled",null),t([y({readOnly:!0})],k.prototype,"effectiveEditingEnabled",null),t([y({...$.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],k.prototype,"fields",void 0),t([y($.fieldsIndex)],k.prototype,"fieldsIndex",void 0),t([y({readOnly:!0,clonable:!1})],k.prototype,"graphicOrigin",void 0),t([y(G)],k.prototype,"id",void 0),t([y({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],k.prototype,"listMode",void 0),t([y({type:["ArcGISDimensionLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],k.prototype,"operationalLayerType",void 0),t([y($.outFields)],k.prototype,"outFields",void 0),t([y(A)],k.prototype,"popupEnabled",void 0),t([y({type:i,json:{name:"popupInfo",write:!0}})],k.prototype,"popupTemplate",void 0),t([y({readOnly:!0})],k.prototype,"defaultPopupTemplate",null),t([y({readOnly:!0})],k.prototype,"referenceScale",void 0),t([y({clonable:!1,readOnly:!0})],k.prototype,"source",void 0),t([y()],k.prototype,"styleCollection",void 0),t([y({type:String})],k.prototype,"sublayerTitleMode",void 0),t([y({readOnly:!0})],k.prototype,"symbolFields",void 0),t([Q("service","title",["name"])],k.prototype,"readTitleFromService",null),t([Q("portal-item","title")],k.prototype,"readTitleFromPortalItem",null),t([y({json:{read:!1},value:"dimension-feature",readOnly:!0})],k.prototype,"type",void 0),k=t([h("esri.layers.DimensionFeatureLayer")],k);const K=k;export{K as default};
2
+ import{__addDisposableResource as e,__disposeResources as r,__decorate as t}from"tslib";import i from"../PopupTemplate.js";import s from"../request.js";import{ClonableMixin as o}from"../core/Clonable.js";import a from"../core/Error.js";import{disposable as n,makeHandle as l}from"../core/handleUtils.js";import{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{debounce as u,throwIfAbortError as d,whenOrAbort as m,onAbort as c}from"../core/promiseUtils.js";import{property as y,subclass as h}from"../core/accessorSupport/decorators.js";import f from"../geometry/SpatialReference.js";import v from"../graphic/DimensionFeatureGraphicOrigin.js";import E from"./Layer.js";import{APIKeyMixin as T}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{BlendLayer as S}from"./mixins/BlendLayer.js";import{CustomParametersMixin as I}from"./mixins/CustomParametersMixin.js";import{DataElementMixin as j}from"./mixins/DataElementMixin.js";import{FeatureLayerBase as L}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as b}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as D}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as F}from"./mixins/TemporalLayer.js";import{parse as M,cleanTitle as x,titleFromUrlAndName as N}from"./support/arcgisLayerUrl.js";import{barrierWeight as G,id as A,popupEnabled as X}from"./support/commonProperties.js";import{ensureLayerCredential as Y,createQuery as U,getFieldDomain as R,hasDataChanged as q}from"./support/featureLayerUtils.js";import{defineFieldProperties as C}from"./support/fieldProperties.js";import{fixTimeInfoFields as _}from"./support/fieldUtils.js";import{serviceSupportsSpatialReference as H}from"./support/versionUtils.js";import B from"../rest/support/Query.js";import{createPopupTemplate as Q}from"../support/popupUtils.js";import{reader as J}from"../core/accessorSupport/decorators/reader.js";const $="dimension-feature-layer",k=C();let K=class extends(b(j(L(S(F(O(P(g(w(D(p(I(T(o(E))))))))))))))){constructor(e){super(e),this.barrierWeight="high",this.fields=null,this.fieldsIndex=null,this.graphicOrigin=new v(this),this.operationalLayerType="ArcGISDimensionLayer",this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.referenceScale=0,this.source=null,this.styleCollection=null,this.sublayerTitleMode="item-title",this.supportedPortalItemTypes=["Feature Service"],this.supportedSourceTypes=new Set(["Dimension Layer"]),this.symbolFields=["STYLEID","BEGINX","BEGINY","ENDX","ENDY","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","DIMX","DIMY","TEXTX","TEXTY","DIMLENGTH","DIMTYPE","EXTANGLE","TEXTANGLE","USECUSTOMLENGTH","CUSTOMLENGTH "],this.type="dimension-feature",this._debouncedSaveOperations=u(async(e,r,t)=>{const{save:i,saveAs:s}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,r);case 1:return s(this,t,r)}})}destroy(){this.source?.destroy()}load(e){const r=e?.signal,t=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(d).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(r);null!=e&&(this.layerId=e)}if(!this.url)throw new a(`${$}:missing-url`,"DimensionFeatureLayer must be created with a url");return Promise.all([this.loadDataElement(e).then(()=>{if(!this.styleCollection)throw new a(`${$}:missing-style-collection`,"Invalid service with no style collection")}),this.initLayerProperties(await this.createGraphicsSource(r))])}).then(()=>Y(this,"load",e));return this.addResolvingPromise(t),Promise.resolve(this)}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.loaded&&null!=this.capabilities&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get effectiveEditingEnabled(){return!1}get defaultPopupTemplate(){return this.createPopupTemplate()}readTitleFromService(e,r){const{url:t}=this,i=r.name||M(t)?.title;switch(this.sublayerTitleMode){case"item-title":if(t)return N(t,i);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==i)return e=x(e),i?`${e} - ${x(i)}`:e;break}}return i?x(i):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}createPopupTemplate(e){return Q(this,e)}async createGraphicsSource(t){const i={stack:[],error:void 0,hasError:!1};try{const{default:r}=await m(import("./graphics/sources/FeatureLayerSource.js"),t),s=new r({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,n(c(t,()=>s.cancelLoad())??l()),!1);return await s.load({signal:t}),s}catch(s){i.error=s,i.hasError=!0}finally{r(i)}}createQuery(){const e=U(this);return e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,r){return R(this,e,r,this.getField(e)?.domain??null)}async queryFeatures(e,r){const t=await this.load(),i=await t.source.queryFeatures(B.from(e)??t.createQuery(),r),s=this.graphicOrigin;if(i?.features)for(const o of i.features)o.layer=o.sourceLayer=t,o.origin=s;return i}async queryObjectIds(e,r){const t=await this.load();return t.source.queryObjectIds(B.from(e)??t.createQuery(),r)}async queryFeatureCount(e,r){const t=await this.load();return t.source.queryFeatureCount(B.from(e)??t.createQuery(),r)}async queryExtent(e,r){const t=await this.load();return t.source.queryExtent(B.from(e)??t.createQuery(),r)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return this.loaded&&H(this,e)}async initLayerProperties(e){this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),_(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){const r=this.source;await Promise.all([r.reload({signal:e}),this.loadDataElement({signal:e})]),await this.initLayerProperties(r)}async hasDataChanged(){return q(this)}_verifySource(){if(this.version&&this.version<10.8)throw new a($+":unsupported-version","The feature service must be version 10.8 or above.");const e=["DIMLENGTH","BEGINX","BEGINY","ENDX","ENDY","DIMX","DIMY","TEXTX","TEXTY","DIMTYPE","EXTANGLE","STYLEID","USECUSTOMLENGTH","CUSTOMLENGTH","DIMDISPLAY","EXTDISPLAY","MARKERDISPLAY","TEXTANGLE"],r=e.filter(e=>!this.fieldsIndex.has(e));if(r.length)throw new a($+":missing-fields","There are missing fields to operate properly",{requiredFields:e,missingFields:r})}_fetchFirstValidLayerId(e){return s(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const r=e.data;if(!r)return;this.applyPreferredHost(r);const t=[...r.layers||[],...r.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id})}};t([y({type:f,json:{origins:{service:{read:{source:"sourceSpatialReference"}}}}})],K.prototype,"attributeSpatialReference",void 0),t([y(G)],K.prototype,"barrierWeight",void 0),t([y({nonNullable:!0,json:{name:"enableEditing",write:!0}})],K.prototype,"editingEnabled",null),t([y({readOnly:!0})],K.prototype,"effectiveEditingEnabled",null),t([y({...k.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],K.prototype,"fields",void 0),t([y(k.fieldsIndex)],K.prototype,"fieldsIndex",void 0),t([y({readOnly:!0,clonable:!1})],K.prototype,"graphicOrigin",void 0),t([y(A)],K.prototype,"id",void 0),t([y({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],K.prototype,"listMode",void 0),t([y({type:["ArcGISDimensionLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}}})],K.prototype,"operationalLayerType",void 0),t([y(k.outFields)],K.prototype,"outFields",void 0),t([y(X)],K.prototype,"popupEnabled",void 0),t([y({type:i,json:{name:"popupInfo",write:!0}})],K.prototype,"popupTemplate",void 0),t([y({readOnly:!0})],K.prototype,"defaultPopupTemplate",null),t([y({readOnly:!0})],K.prototype,"referenceScale",void 0),t([y({clonable:!1,readOnly:!0})],K.prototype,"source",void 0),t([y()],K.prototype,"styleCollection",void 0),t([y({type:String})],K.prototype,"sublayerTitleMode",void 0),t([y({readOnly:!0})],K.prototype,"symbolFields",void 0),t([J("service","title",["name"])],K.prototype,"readTitleFromService",null),t([J("portal-item","title")],K.prototype,"readTitleFromPortalItem",null),t([y({json:{read:!1},value:"dimension-feature",readOnly:!0})],K.prototype,"type",void 0),K=t([h("esri.layers.DimensionFeatureLayer")],K);const V=K;export{V as default};
@@ -32,6 +32,7 @@ import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mix
32
32
  import type { EditBusLayer, EditBusLayerEvents } from "./mixins/EditBusLayer.js";
33
33
  import type { FeatureEffectLayer, FeatureEffectLayerProperties } from "./mixins/FeatureEffectLayer.js";
34
34
  import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
35
+ import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
35
36
  import type { FeatureReductionLayer, FeatureReductionLayerProperties } from "./mixins/FeatureReductionLayer.js";
36
37
  import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
37
38
  import type { OrderedLayer, OrderedLayerProperties } from "./mixins/OrderedLayer.js";
@@ -1196,22 +1197,6 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
1196
1197
  * layer.refreshInterval = 1;
1197
1198
  */
1198
1199
  accessor refreshInterval: number;
1199
- /**
1200
- * Indicates if the layer is in the process of reloading its properties and schema, after a call to `reload()`.
1201
- *
1202
- * During the reload process, the layer properties are updated in parallel at different times, and may not be in sync for a brief moment.
1203
- * For example, the layer's [renderer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#renderer) may reference a field not yet available in the [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#fields) array.
1204
- *
1205
- * @default false
1206
- * @since 5.1
1207
- * @see [reload()](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#reload)
1208
- * @example
1209
- * layer.reload();
1210
- *
1211
- * // Wait for a stable state.
1212
- * await whenOnce(() => !layer.reloading);
1213
- */
1214
- get reloading(): boolean;
1215
1200
  /**
1216
1201
  * The renderer assigned to the layer. The renderer defines how to
1217
1202
  * visualize each feature in the layer. Depending on the renderer type,
@@ -2142,19 +2127,6 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
2142
2127
  * @see [refresh event](https://developers.arcgis.com/javascript/latest/references/core/layers/mixins/RefreshableLayer/#event-refresh)
2143
2128
  */
2144
2129
  refresh(): void;
2145
- /**
2146
- * Reloads the layer's schema and properties from its [portalItem](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#portalItem), provided the layer was created from an ArcGIS portal item.
2147
- *
2148
- * Returns `true` when the layer is successfully updated with data from the portal item or service.
2149
- * Returns `false` when the layer is not updated, not loaded, or composed of client-side features.
2150
- *
2151
- * This method is debounced to prevent redundant, concurrent network requests.
2152
- * If called while an update is already in progress, a single subsequent execution is queued,
2153
- * and any other intermediate calls are discarded.
2154
- *
2155
- * @since 5.1
2156
- */
2157
- reload(): Promise<boolean>;
2158
2130
  /**
2159
2131
  * Saves the layer to its existing portal item in the [Portal](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/)
2160
2132
  * authenticated within the user's current session. If the layer is not saved to a
@@ -2207,4 +2179,4 @@ export abstract class __FeatureLayerSansType extends FeatureLayerSuperclass {
2207
2179
  */
2208
2180
  updateAttachment(feature: Graphic, attachmentId: number, attachment: HTMLFormElement | FormData, options?: AttachmentEditOptions): Promise<FeatureEditResult>;
2209
2181
  }
2210
- declare const FeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TrackableLayer & typeof DataSeriesLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof DisplayFilteredLayer & typeof EditBusLayer & typeof PublishableLayer & typeof FeatureEffectLayer & typeof FeatureReductionLayer & typeof FeatureLayerBase
2182
+ declare const FeatureLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TrackableLayer & typeof DataSeriesLayer & typeof TemporalLayer & typeof OrderedLayer & typeof BlendLayer & typeof DisplayFilteredLayer & typeof EditBusLayer & typeof PublishableLayer & typeof FeatureEffectLayer & typeof FeatureReductionLayer & typeof FeatureLayerBase & typeof FeatureLayerReload
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p,abortHandle as u}from"../core/handleUtils.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{debounce as f,throwIfAbortError as b,whenOrAbort as g,onAbort as w}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{property as F,subclass as T}from"../core/accessorSupport/decorators.js";import{excludeTables as j}from"../core/accessorSupport/layerContainerType.js";import S from"../form/FormTemplate.js";import I from"../geometry/SpatialReference.js";import L from"../graphic/FeatureGraphicOrigin.js";import D from"./Layer.js";import{MemorySource as E}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as C}from"./mixins/ArcGISService.js";import{BlendLayer as P}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as q}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as M}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as A}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as R}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as Q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as N}from"./mixins/PortalLayer.js";import{PublishableLayer as G}from"./mixins/PublishableLayer.js";import{RefreshableLayer as J}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as W}from"./mixins/TemporalLayer.js";import{TrackableLayer as H}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as Z,parse as $,cleanTitle as k}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as z,id as K,labelsVisible as X,opacityDrawingInfo as Y,legendEnabled as ee,listMode as te,popupEnabled as re,screenSizePerspectiveEnabled as ie}from"./support/commonProperties.js";import{ensureLayerCredential as oe,computeEffectiveEditingEnabled as se,readGlobalIdField as ae,readObjectIdField as ne,createDefaultRenderer as le,addAttachment as pe,updateAttachment as ue,applyEdits as de,uploadAssets as ye,createQuery as ce,deleteAttachments as me,fetchRecomputedExtents as he,getFeatureType as fe,getFieldDomain as be,queryAttachments as ge,queryObjectIds as we,queryFeatureCount as ve,queryExtent as Fe,queryRelatedFeatures as Te,queryRelatedFeaturesCount as je,validateBinsQuery as Se,hasDataChanged as Ie,geometryTypeKebabDict as Le}from"./support/featureLayerUtils.js";import De from"./support/FeatureTemplate.js";import Ee from"./support/FeatureType.js";import _e from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as Ce,fieldConfigurationsFromPopupTemplate as Pe,fieldConfigurationsFromFields as Oe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as xe}from"./support/fieldProperties.js";import{fixRendererFields as qe,fixTimeInfoFields as Me}from"./support/fieldUtils.js";import Ae from"./support/LabelClass.js";import{reader as Re}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Qe}from"./support/serviceCapabilitiesUtils.js";import Ue from"./support/SymbolLayerDrawing.js";import Ve from"./support/TimeInfo.js";import Ne from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ge}from"./support/versionUtils.js";import{read as Je}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Be}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as We,rendererTypes as He}from"../renderers/support/typeUtils.js";import Ze from"../rest/layerSources/DynamicDataLayer.js";import $e from"../rest/support/FeatureSet.js";import ke from"../rest/support/Query.js";import{isNumber as ze}from"../support/guards.js";import{createPopupTemplate as Ke}from"../support/popupUtils.js";import{symbolTypes as Xe}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Ye}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as et}from"../webdoc/support/unsupportedErrors.js";import{reader as tt}from"../core/accessorSupport/decorators/reader.js";import{writer as rt}from"../core/accessorSupport/decorators/writer.js";const it="FeatureLayer";function ot(e){return e&&e instanceof a}const st=xe();function at(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let nt=class extends(R(Q(A(G(M(q(P(V(W(x(H(B(J(C(U(N(m(O(_(s(D))))))))))))))))))))){constructor(...e){super(...e),this._debounceReload=f(async()=>{if(this.destroyed||!this.loaded||this._hasMemorySource())return!1;const e=new AbortController,t=u(e);this.addHandles(t,"reload"),this._set("reloading",!0);try{const t=await this.reloadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]});return t&&(this.sourceJSON=null,await this.initLayerProperties(await this.createGraphicsSource(e.signal))),e.signal.throwIfAborted(),t}finally{this.removeHandles("reload"),this._set("reloading",!1)}}),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new L(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.reloading=!1,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=I.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(b).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>oe(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}reload(){return this._debounceReload()}get _titleCreator(){const e=this._get("_titleCreator");return c(e),new Ne({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Qe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return se(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=Ce(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Pe(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readSymbolLayerDrawing(e,t){const r=t.layerDefinition?.drawingInfo,i=r?.renderer,o=r?.symbolLayerDrawing;return i&&o?new Ue(o):null}readGlobalIdField(e,t){return ae(t.layerDefinition||t)}readObjectIdField(e,t){return ne(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){qe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Je(i,t,r)??void 0;return e||y.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return le(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new E({layer:this,items:e})),ot(t)&&this._resetMemorySource(t),ot(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=$e.fromJSON(t.featureSet);return new E({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>De.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?Z(this.url,r):r;let e=r;if(!e&&this.url){const t=$(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),k(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===r);e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=Ee.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t,r){const i=await pe(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,r,i){const o=await ue(this,e,t,r,it,i);return this.lastEditsEventDate=new Date,o}async applyEdits(e,t){return de(this,e,t)}async uploadAssets(e,t){return ye(this,e,t)}createFieldConfigurations(){return Oe(this)}createPopupTemplate(e){return Ke(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await g(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(w(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ce(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t,r){const i=await me(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return he(this,e,it)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return fe(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return be(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return ge(this,e,t,it)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(ke.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await we(this,e,t,it)}async queryFeatureCount(e,t){return ve(this,e,t,it)}async queryExtent(e,t){return Fe(this,e,t,it)}async queryRelatedFeatures(e,t){return Te(this,e,t,it)}async queryRelatedFeaturesCount(e,t){return je(this,e,t,it)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(it,"Layer source does not support queryPivot capability");const o=await(import("../rest/support/PivotQuery.js")),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopFeatures capability");const o=await(import("../rest/support/TopFeaturesQuery.js")),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(it,"Layer source does not support queryAttributeBins capability");Se(e,i,it);const o=await(import("../rest/support/AttributeBinsQuery.js")),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopObjectIds capability");const o=await(import("../rest/support/TopFeaturesQuery.js"));return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ze)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopExtents capability");const o=await(import("../rest/support/TopFeaturesQuery.js"));return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryFeatureCount capability");const o=await(import("../rest/support/TopFeaturesQuery.js"));return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return et(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return et(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return et(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return et(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(it,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ge(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),qe(this.renderer,this.fieldsIndex),Me(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Be(this,{origin:"service"})}async hasDataChanged(){return Ie(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([F({clonable:!1,readOnly:!0})],nt.prototype,"_titleCreator",null),r([F(z)],nt.prototype,"attributeTableTemplate",void 0),r([tt("service","capabilities")],nt.prototype,"readCapabilities",null),r([F({json:{origins:{"web-scene":{write:!1}},write:!0}})],nt.prototype,"charts",void 0),r([F({readOnly:!0})],nt.prototype,"createQueryVersion",null),r([F({json:{read:{source:"layerDefinition.copyrightText"}}})],nt.prototype,"copyright",void 0),r([F({json:{read:{source:"layerDefinition.displayField"}}})],nt.prototype,"displayField",void 0),r([F({types:Xe,readOnly:!0})],nt.prototype,"defaultSymbol",void 0),r([F({type:Ze})],nt.prototype,"dynamicDataSource",void 0),r([F({type:Boolean})],nt.prototype,"editingEnabled",null),r([tt(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],nt.prototype,"readEditingEnabled",null),r([tt("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],nt.prototype,"readEditingEnabledFromWebMap",null),r([rt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabled",null),r([rt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabledToWebMap",null),r([F({readOnly:!0})],nt.prototype,"effectiveEditingEnabled",null),r([F({clonable:!1,readOnly:!0})],nt.prototype,"featureTitleFields",null),r([F({type:[_e],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],nt.prototype,"fieldConfigurations",null),r([F({...st.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:at}}}}})],nt.prototype,"fields",void 0),r([F(st.fieldsIndex)],nt.prototype,"fieldsIndex",void 0),r([F({type:S,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],nt.prototype,"formTemplate",void 0),r([F({json:{read:{source:"layerDefinition.extent"}}})],nt.prototype,"fullExtent",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:at,writer(e,t,r){const i=e?Le.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Le.read}}})],nt.prototype,"geometryType",void 0),r([F({readOnly:!0,clonable:!1})],nt.prototype,"graphicOrigin",void 0),r([F({json:{read:{source:"layerDefinition.hasM"}}})],nt.prototype,"hasM",void 0),r([F({json:{read:{source:"layerDefinition.hasZ"}}})],nt.prototype,"hasZ",void 0),r([F(K)],nt.prototype,"id",void 0),r([F({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],nt.prototype,"infoFor3D",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],nt.prototype,"isTable",void 0),r([tt("service","isTable",["type","geometryType"]),tt("isTable",["layerDefinition.type","layerDefinition.geometryType"])],nt.prototype,"readIsTable",null),r([rt("web-map","isTable")],nt.prototype,"writeIsTable",null),r([F(X)],nt.prototype,"labelsVisible",void 0),r([F({type:[Ae],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Re,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Re,write:{layerContainerTypes:j}}})],nt.prototype,"labelingInfo",void 0),r([F({type:Ue,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],nt.prototype,"symbolLayerDrawing",void 0),r([tt(["portal-item","web-map"],"symbolLayerDrawing",["layerDefinition.drawingInfo.renderer","layerDefinition.drawingInfo.symbolLayerDrawing"])],nt.prototype,"readSymbolLayerDrawing",null),r([F((()=>{const e=d(Y);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Ye(e),t)}}},e})())],nt.prototype,"opacity",void 0),r([F(ee)],nt.prototype,"legendEnabled",void 0),r([F({type:["show","hide"],json:(()=>{const e=d(te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],nt.prototype,"listMode",void 0),r([tt("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],nt.prototype,"readGlobalIdField",null),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:at}}}}})],nt.prototype,"objectIdField",void 0),r([tt("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],nt.prototype,"readObjectIdField",null),r([F({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:j}}})],nt.prototype,"operationalLayerType",void 0),r([F(st.outFields)],nt.prototype,"outFields",void 0),r([F({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],nt.prototype,"path",void 0),r([F(re)],nt.prototype,"popupEnabled",void 0),r([F({type:i,json:{name:"popupInfo",write:!0}})],nt.prototype,"popupTemplate",void 0),r([rt("popupTemplate")],nt.prototype,"writePopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"defaultPopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"reloading",void 0),r([F({types:He,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:We,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:j,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}})],nt.prototype,"renderer",null),r([tt("service","renderer",["drawingInfo.renderer","defaultSymbol"]),tt("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],nt.prototype,"readRenderer",null),r([F()],nt.prototype,"resourceInfo",void 0),r([F((()=>{const e=d(ie);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],nt.prototype,"screenSizePerspectiveEnabled",void 0),r([F({clonable:!1})],nt.prototype,"source",null),r([tt("portal-item","source",["featureSet"]),tt("web-map","source",["featureSet"])],nt.prototype,"readSource",null),r([F({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],nt.prototype,"spatialReference",void 0),r([F({type:Number})],nt.prototype,"subtypeCode",void 0),r([F({readOnly:!1})],nt.prototype,"subtypeField",void 0),r([F({readOnly:!1})],nt.prototype,"subtypes",void 0),r([F({type:[De]})],nt.prototype,"templates",void 0),r([tt("templates",["editFieldsInfo","creatorField","editorField","templates"])],nt.prototype,"readTemplates",null),r([F({type:Ve})],nt.prototype,"timeInfo",void 0),r([F()],nt.prototype,"title",void 0),r([tt("service","title",["name"]),tt("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],nt.prototype,"readTitle",null),r([tt("web-map","title",["layerDefinition.name","title"])],nt.prototype,"readTitleFromWebMap",null),r([F({type:String})],nt.prototype,"sublayerTitleMode",void 0),r([F({json:{read:!1}})],nt.prototype,"type",void 0),r([F({type:String})],nt.prototype,"typeIdField",void 0),r([tt("service","typeIdField"),tt("typeIdField",["layerDefinition.typeIdField"])],nt.prototype,"readTypeIdField",null),r([F({type:[Ee]})],nt.prototype,"types",void 0),r([tt("service","types",["types"]),tt("types",["layerDefinition.types"])],nt.prototype,"readTypes",null),r([F({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:j}}}}})],nt.prototype,"visible",void 0),r([tt("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],nt.prototype,"readVisible",null),nt=r([T("esri.layers.FeatureLayer")],nt);export{nt as default};
2
+ import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p}from"../core/handleUtils.js";import{clone as u}from"../core/lang.js";import d from"../core/Logger.js";import{destroyMaybe as y}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as c}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as m}from"../core/object.js";import{debounce as f,throwIfAbortError as h,whenOrAbort as b,onAbort as g}from"../core/promiseUtils.js";import{sqlAnd as w}from"../core/sql.js";import{property as v,subclass as F}from"../core/accessorSupport/decorators.js";import{excludeTables as T}from"../core/accessorSupport/layerContainerType.js";import j from"../form/FormTemplate.js";import S from"../geometry/SpatialReference.js";import I from"../graphic/FeatureGraphicOrigin.js";import L from"./Layer.js";import{MemorySource as D}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as E}from"./mixins/APIKeyMixin.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as C}from"./mixins/BlendLayer.js";import{CustomParametersMixin as P}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as O}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as q}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as M}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as R}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as A}from"./mixins/FeatureLayerReload.js";import{FeatureReductionLayer as Q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as N}from"./mixins/PortalLayer.js";import{PublishableLayer as B}from"./mixins/PublishableLayer.js";import{RefreshableLayer as G}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as J}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as W}from"./mixins/TemporalLayer.js";import{TrackableLayer as Z}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as $,parse as H,cleanTitle as k}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as z,id as K,labelsVisible as X,opacityDrawingInfo as Y,legendEnabled as ee,listMode as te,popupEnabled as re,screenSizePerspectiveEnabled as ie}from"./support/commonProperties.js";import{ensureLayerCredential as oe,computeEffectiveEditingEnabled as se,readGlobalIdField as ae,readObjectIdField as ne,createDefaultRenderer as le,addAttachment as pe,updateAttachment as ue,applyEdits as de,uploadAssets as ye,createQuery as ce,deleteAttachments as me,fetchRecomputedExtents as fe,getFeatureType as he,getFieldDomain as be,queryAttachments as ge,queryObjectIds as we,queryFeatureCount as ve,queryExtent as Fe,queryRelatedFeatures as Te,queryRelatedFeaturesCount as je,validateBinsQuery as Se,hasDataChanged as Ie,geometryTypeKebabDict as Le}from"./support/featureLayerUtils.js";import De from"./support/FeatureTemplate.js";import Ee from"./support/FeatureType.js";import _e from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as Ce,fieldConfigurationsFromPopupTemplate as Pe,fieldConfigurationsFromFields as xe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Oe}from"./support/fieldProperties.js";import{fixRendererFields as qe,fixTimeInfoFields as Me}from"./support/fieldUtils.js";import Re from"./support/LabelClass.js";import{reader as Ae}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Qe}from"./support/serviceCapabilitiesUtils.js";import Ue from"./support/SymbolLayerDrawing.js";import Ve from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ne}from"./support/versionUtils.js";import{read as Be}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Ge}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Je,rendererTypes as We}from"../renderers/support/typeUtils.js";import Ze from"../rest/layerSources/DynamicDataLayer.js";import $e from"../rest/support/FeatureSet.js";import He from"../rest/support/Query.js";import{isNumber as ke}from"../support/guards.js";import{createPopupTemplate as ze}from"../support/popupUtils.js";import{symbolTypes as Ke}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Xe}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as Ye}from"../webdoc/support/unsupportedErrors.js";import{reader as et}from"../core/accessorSupport/decorators/reader.js";import{writer as tt}from"../core/accessorSupport/decorators/writer.js";const rt="FeatureLayer";function it(e){return e&&e instanceof a}const ot=Oe();function st(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let at=class extends(A(R(Q(M(B(q(O(C(V(W(x(Z(J(G(_(U(N(c(P(E(s(L)))))))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new I(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=S.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedPortalItemTypes=["Feature Service","Feature Collection","Scene Service"],this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await(import("./save/featureLayerUtils.js"));switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(h).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>oe(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return y(e),new Ve({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Qe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return se(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=Ce(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Pe(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&m(r,e?"Table":"Feature Layer",t)}readSymbolLayerDrawing(e,t){const r=t.layerDefinition?.drawingInfo,i=r?.renderer,o=r?.symbolLayerDrawing;return i&&o?new Ue(o):null}readGlobalIdField(e,t){return ae(t.layerDefinition||t)}readObjectIdField(e,t){return ne(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){qe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Be(i,t,r)??void 0;return e||d.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return le(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new D({layer:this,items:e})),it(t)&&this._resetMemorySource(t),it(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=$e.fromJSON(t.featureSet);return new D({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>De.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?$(this.url,r):r;let e=r;if(!e&&this.url){const t=H(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),k(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===r);e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=Ee.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t,r){const i=await pe(this,e,t,rt,r);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,r,i){const o=await ue(this,e,t,r,rt,i);return this.lastEditsEventDate=new Date,o}async applyEdits(e,t){return de(this,e,t)}async uploadAssets(e,t){return ye(this,e,t)}createFieldConfigurations(){return xe(this)}createPopupTemplate(e){return ze(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await b(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(g(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ce(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=w(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t,r){const i=await me(this,e,t,rt,r);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return fe(this,e,rt)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return he(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return be(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return ge(this,e,t,rt)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(He.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await we(this,e,t,rt)}async queryFeatureCount(e,t){return ve(this,e,t,rt)}async queryExtent(e,t){return Fe(this,e,t,rt)}async queryRelatedFeatures(e,t){return Te(this,e,t,rt)}async queryRelatedFeaturesCount(e,t){return je(this,e,t,rt)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(rt,"Layer source does not support queryPivot capability");const o=await(import("../rest/support/PivotQuery.js")),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopFeatures capability");const o=await(import("../rest/support/TopFeaturesQuery.js")),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(rt,"Layer source does not support queryAttributeBins capability");Se(e,i,rt);const o=await(import("../rest/support/AttributeBinsQuery.js")),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopObjectIds capability");const o=await(import("../rest/support/TopFeaturesQuery.js"));return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ke)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopExtents capability");const o=await(import("../rest/support/TopFeaturesQuery.js"));return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryFeatureCount capability");const o=await(import("../rest/support/TopFeaturesQuery.js"));return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),it(this.source)&&"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>{this.revertToOrigin(e,"service")}),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return Ye(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return Ye(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return Ye(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return Ye(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(rt,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ne(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";m("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),qe(this.renderer,this.fieldsIndex),Me(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Ge(this,{origin:"service"})}canReload(){return super.canReload()&&!this._hasMemorySource()}async reloadFromService(e){const t=this.source;await t.reload({signal:e}),await this.initLayerProperties(t)}async hasDataChanged(){return Ie(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([v({clonable:!1,readOnly:!0})],at.prototype,"_titleCreator",null),r([v(z)],at.prototype,"attributeTableTemplate",void 0),r([et("service","capabilities")],at.prototype,"readCapabilities",null),r([v({json:{origins:{"web-scene":{write:!1}},write:!0}})],at.prototype,"charts",void 0),r([v({readOnly:!0})],at.prototype,"createQueryVersion",null),r([v({json:{read:{source:"layerDefinition.copyrightText"}}})],at.prototype,"copyright",void 0),r([v({json:{read:{source:"layerDefinition.displayField"}}})],at.prototype,"displayField",void 0),r([v({types:Ke,readOnly:!0})],at.prototype,"defaultSymbol",void 0),r([v({type:Ze})],at.prototype,"dynamicDataSource",void 0),r([v({type:Boolean})],at.prototype,"editingEnabled",null),r([et(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],at.prototype,"readEditingEnabled",null),r([et("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],at.prototype,"readEditingEnabledFromWebMap",null),r([tt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabled",null),r([tt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabledToWebMap",null),r([v({readOnly:!0})],at.prototype,"effectiveEditingEnabled",null),r([v({clonable:!1,readOnly:!0})],at.prototype,"featureTitleFields",null),r([v({type:[_e],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],at.prototype,"fieldConfigurations",null),r([v({...ot.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:st}}}}})],at.prototype,"fields",void 0),r([v(ot.fieldsIndex)],at.prototype,"fieldsIndex",void 0),r([v({type:j,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],at.prototype,"formTemplate",void 0),r([v({json:{read:{source:"layerDefinition.extent"}}})],at.prototype,"fullExtent",void 0),r([v({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:st,writer(e,t,r){const i=e?Le.toJSON(e):null;i&&m(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Le.read}}})],at.prototype,"geometryType",void 0),r([v({readOnly:!0,clonable:!1})],at.prototype,"graphicOrigin",void 0),r([v({json:{read:{source:"layerDefinition.hasM"}}})],at.prototype,"hasM",void 0),r([v({json:{read:{source:"layerDefinition.hasZ"}}})],at.prototype,"hasZ",void 0),r([v(K)],at.prototype,"id",void 0),r([v({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],at.prototype,"infoFor3D",void 0),r([v({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],at.prototype,"isTable",void 0),r([et("service","isTable",["type","geometryType"]),et("isTable",["layerDefinition.type","layerDefinition.geometryType"])],at.prototype,"readIsTable",null),r([tt("web-map","isTable")],at.prototype,"writeIsTable",null),r([v(X)],at.prototype,"labelsVisible",void 0),r([v({type:[Re],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Ae,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Ae,write:{layerContainerTypes:T}}})],at.prototype,"labelingInfo",void 0),r([v({type:Ue,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],at.prototype,"symbolLayerDrawing",void 0),r([et(["portal-item","web-map"],"symbolLayerDrawing",["layerDefinition.drawingInfo.renderer","layerDefinition.drawingInfo.symbolLayerDrawing"])],at.prototype,"readSymbolLayerDrawing",null),r([v((()=>{const e=u(Y);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){m(r,Xe(e),t)}}},e})())],at.prototype,"opacity",void 0),r([v(ee)],at.prototype,"legendEnabled",void 0),r([v({type:["show","hide"],json:(()=>{const e=u(te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],at.prototype,"listMode",void 0),r([et("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],at.prototype,"readGlobalIdField",null),r([v({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:st}}}}})],at.prototype,"objectIdField",void 0),r([et("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],at.prototype,"readObjectIdField",null),r([v({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:T}}})],at.prototype,"operationalLayerType",void 0),r([v(ot.outFields)],at.prototype,"outFields",void 0),r([v({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],at.prototype,"path",void 0),r([v(re)],at.prototype,"popupEnabled",void 0),r([v({type:i,json:{name:"popupInfo",write:!0}})],at.prototype,"popupTemplate",void 0),r([tt("popupTemplate")],at.prototype,"writePopupTemplate",null),r([v({readOnly:!0})],at.prototype,"defaultPopupTemplate",null),r([v({types:We,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Je,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:T,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:T})}}})],at.prototype,"renderer",null),r([et("service","renderer",["drawingInfo.renderer","defaultSymbol"]),et("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],at.prototype,"readRenderer",null),r([v()],at.prototype,"resourceInfo",void 0),r([v((()=>{const e=u(ie);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],at.prototype,"screenSizePerspectiveEnabled",void 0),r([v({clonable:!1})],at.prototype,"source",null),r([et("portal-item","source",["featureSet"]),et("web-map","source",["featureSet"])],at.prototype,"readSource",null),r([v({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],at.prototype,"spatialReference",void 0),r([v({type:Number})],at.prototype,"subtypeCode",void 0),r([v({readOnly:!1})],at.prototype,"subtypeField",void 0),r([v({readOnly:!1})],at.prototype,"subtypes",void 0),r([v({type:[De]})],at.prototype,"templates",void 0),r([et("templates",["editFieldsInfo","creatorField","editorField","templates"])],at.prototype,"readTemplates",null),r([v()],at.prototype,"title",void 0),r([et("service","title",["name"]),et("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],at.prototype,"readTitle",null),r([et("web-map","title",["layerDefinition.name","title"])],at.prototype,"readTitleFromWebMap",null),r([v({type:String})],at.prototype,"sublayerTitleMode",void 0),r([v({json:{read:!1}})],at.prototype,"type",void 0),r([v({type:String})],at.prototype,"typeIdField",void 0),r([et("service","typeIdField"),et("typeIdField",["layerDefinition.typeIdField"])],at.prototype,"readTypeIdField",null),r([v({type:[Ee]})],at.prototype,"types",void 0),r([et("service","types",["types"]),et("types",["layerDefinition.types"])],at.prototype,"readTypes",null),r([v({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:T}}}}})],at.prototype,"visible",void 0),r([et("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],at.prototype,"readVisible",null),at=r([F("esri.layers.FeatureLayer")],at);export{at as default};