@arcgis/core 4.34.0-next.85 → 4.34.0-next.86

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 (142) hide show
  1. package/Basemap.js +1 -1
  2. package/arcade/functions/measures.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/06c389283ee5b60573f2.js +1 -0
  5. package/assets/esri/core/workers/chunks/0b679d5a1bfdbd006d6e.js +1 -0
  6. package/assets/esri/core/workers/chunks/1537b02e674f8ef77f4a.js +1 -0
  7. package/assets/esri/core/workers/chunks/{9eb1bfcb9b05f2a36748.js → 1f2d13466c60a6b57717.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{7a23b127f551bf13ef54.js → 268f5b233640a9dbbf89.js} +2 -2
  9. package/assets/esri/core/workers/chunks/2896ada406074f754b00.js +1 -0
  10. package/assets/esri/core/workers/chunks/28d30be414e59eabd963.js +1 -0
  11. package/assets/esri/core/workers/chunks/29471e0b3f7296dee096.js +1 -0
  12. package/assets/esri/core/workers/chunks/{3192b68675ff2afcb1d6.js → 2d3ae187f8aa3495d4ae.js} +1 -1
  13. package/assets/esri/core/workers/chunks/336b54144afec0c7d396.js +2 -0
  14. package/assets/esri/core/workers/chunks/42bc1e981624ce9844a4.js +1 -0
  15. package/assets/esri/core/workers/chunks/436bbe99bedd7b331edb.js +1 -0
  16. package/assets/esri/core/workers/chunks/{d66cdb9bb494da19696b.js → 47e4f66c33bb697fbe6b.js} +2 -2
  17. package/assets/esri/core/workers/chunks/4840bd93d8fe15c7aefd.js +1 -0
  18. package/assets/esri/core/workers/chunks/4a06ab00d095f63598b5.js +1 -0
  19. package/assets/esri/core/workers/chunks/4d4db6854aff7656f6e1.js +1 -0
  20. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +1 -0
  21. package/assets/esri/core/workers/chunks/655a878ddea4907d830e.js +1 -0
  22. package/assets/esri/core/workers/chunks/68f5a2d2666636c3f807.js +1 -0
  23. package/assets/esri/core/workers/chunks/6c36cef0b58b87a1f17f.js +316 -0
  24. package/assets/esri/core/workers/chunks/72fe4f1f789abb5b4035.js +1 -0
  25. package/assets/esri/core/workers/chunks/8307f635a5c0c4a95825.js +1 -0
  26. package/assets/esri/core/workers/chunks/{afb76f9d6abedef771df.js → 8380a092ffc8e92ede7a.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{f8f85207b382c1ea038c.js → 97489bf16a1d327992b2.js} +3 -3
  28. package/assets/esri/core/workers/chunks/9d7a22746dae1451deaf.js +1 -0
  29. package/assets/esri/core/workers/chunks/a2652d10bb0bc41c9a8d.js +1 -0
  30. package/assets/esri/core/workers/chunks/a845c68e76382a73da5e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{9c64b78c5c9b35b31d98.js → aa78b69219d9a0ef1c54.js} +2 -2
  32. package/assets/esri/core/workers/chunks/{1859a11df9f579b993d7.js → b2fbb44e219232e61cbd.js} +1 -1
  33. package/assets/esri/core/workers/chunks/b4349db7155673329432.js +1 -0
  34. package/assets/esri/core/workers/chunks/{d153b29c542c37ae1636.js → c50e8d5f554cf151865c.js} +2 -2
  35. package/assets/esri/core/workers/chunks/c5cc0fc652432a9264cc.js +1 -0
  36. package/assets/esri/core/workers/chunks/cab2a1382bdd32bb34d8.js +1 -0
  37. package/assets/esri/core/workers/chunks/ce937ff0dd1147ea297e.js +1 -0
  38. package/assets/esri/core/workers/chunks/d142a42755a78bb157ed.js +1 -0
  39. package/assets/esri/core/workers/chunks/{280af3640f8e93c1024e.js → d6e0528eacee7ea4c1ce.js} +2 -2
  40. package/assets/esri/core/workers/chunks/d9d86cf0500fa29d1d43.js +1 -0
  41. package/assets/esri/core/workers/chunks/{b15ff6c9ef2de8a49853.js → f651c05604eab83aef5f.js} +2 -2
  42. package/assets/esri/core/workers/chunks/{ed773dab5965e42a2879.js → f6e18668f728dfd8ba5e.js} +2 -2
  43. package/assets/esri/core/workers/chunks/ff8e2f998169ca3a7a68.js +1 -0
  44. package/assets/esri/libs/dracoMeshDecoder/draco_mesh_decoder.wasm +0 -0
  45. package/assets/esri/libs/i3s/i3s.wasm +0 -0
  46. package/chunks/CloudsComposition.glsl.js +2 -2
  47. package/chunks/HUDMaterial.glsl.js +49 -50
  48. package/chunks/LineMarker.glsl.js +34 -34
  49. package/chunks/PointRenderer.glsl.js +4 -4
  50. package/chunks/ShadowHighlight.glsl.js +3 -3
  51. package/chunks/draco_mesh_decoder.js +1 -1
  52. package/config.js +1 -1
  53. package/core/NestedMap.js +1 -1
  54. package/core/iteratorUtils.js +1 -1
  55. package/editing/geometry/lineUtils.js +1 -1
  56. package/interfaces.d.ts +55 -7
  57. package/kernel.js +1 -1
  58. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  59. package/layers/IntegratedMeshLayer.js +1 -1
  60. package/layers/SceneLayer.js +1 -1
  61. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  62. package/layers/knowledgeGraph/cypherUtils.js +1 -1
  63. package/layers/support/layerUtils.js +1 -1
  64. package/package.json +5 -5
  65. package/support/basemapEnsureType.js +1 -1
  66. package/support/revision.js +1 -1
  67. package/support/userTypeGuards/isBasemap.js +5 -0
  68. package/symbols/support/previewSymbol2D.js +1 -1
  69. package/views/3d/FocusAreasView.js +1 -1
  70. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  71. package/views/3d/glTF/internal/Resource.js +1 -1
  72. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  73. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  74. package/views/3d/support/engineContent/marker.js +1 -1
  75. package/views/3d/support/engineContent/sdfPrimitives.js +1 -1
  76. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +11 -11
  77. package/views/3d/webgl-engine/lib/BasisUtil.js +1 -1
  78. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  79. package/views/3d/webgl-engine/materials/renderers/InstancedCommandVAO.js +5 -0
  80. package/views/3d/webgl-engine/materials/renderers/InstancedCommandVAOs.js +5 -0
  81. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  82. package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
  83. package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
  84. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  85. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +14 -9
  86. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  87. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  88. package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
  89. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  90. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +8 -8
  91. package/views/BasemapView.js +1 -1
  92. package/views/GroundView.js +1 -1
  93. package/views/SceneView.js +1 -1
  94. package/views/View.js +1 -1
  95. package/views/View2D.js +1 -1
  96. package/views/support/LayerViewManager.js +1 -1
  97. package/views/webgl/RenderbufferDescriptor.js +1 -1
  98. package/views/webgl/TextureDescriptor.js +1 -1
  99. package/views/webgl/Util.js +1 -1
  100. package/views/webgl/VertexArrayObject.js +1 -1
  101. package/webscene/Slide.js +1 -1
  102. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  103. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  104. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  105. package/widgets/Editor/support/SketchController.js +1 -1
  106. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  107. package/widgets/Editor/workflowUtils.js +1 -1
  108. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  109. package/widgets/Sketch/SketchViewModel.js +1 -1
  110. package/widgets/Sketch/adapters/layer/GraphicsLayerAdapter.js +5 -0
  111. package/widgets/Sketch/adapters/layer/MapNotesLayerAdapter.js +5 -0
  112. package/assets/esri/core/workers/chunks/25ea02dd7d45a90cbb3b.js +0 -1
  113. package/assets/esri/core/workers/chunks/264a9a916e1e972b69d7.js +0 -1
  114. package/assets/esri/core/workers/chunks/30c85a1a4f118cc45a25.js +0 -1
  115. package/assets/esri/core/workers/chunks/3ef8a7468d7e3b2f0b69.js +0 -351
  116. package/assets/esri/core/workers/chunks/5c1cdc2ec06c4c6bd0b3.js +0 -1
  117. package/assets/esri/core/workers/chunks/609abf071c4ea24955c2.js +0 -1
  118. package/assets/esri/core/workers/chunks/71c2a8e5a17803d3e949.js +0 -1
  119. package/assets/esri/core/workers/chunks/7889a909394c61a9d3e0.js +0 -1
  120. package/assets/esri/core/workers/chunks/99ac292a858bbedc6a89.js +0 -1
  121. package/assets/esri/core/workers/chunks/9a6fa91dd204f64d2590.js +0 -1
  122. package/assets/esri/core/workers/chunks/9cdeead9d444e8d95477.js +0 -1
  123. package/assets/esri/core/workers/chunks/aa1eb7b4d9ccda725da5.js +0 -1
  124. package/assets/esri/core/workers/chunks/b4a053063e6022080d31.js +0 -1
  125. package/assets/esri/core/workers/chunks/b4b26cc2ba3ff30e1d03.js +0 -1
  126. package/assets/esri/core/workers/chunks/bbb585f0b484ab5eabb3.js +0 -1
  127. package/assets/esri/core/workers/chunks/c2bc70b65f5c2a2c9671.js +0 -1
  128. package/assets/esri/core/workers/chunks/cd1869e183001266c4c1.js +0 -2
  129. package/assets/esri/core/workers/chunks/d2fe403d6ab237bc89c2.js +0 -1
  130. package/assets/esri/core/workers/chunks/d51e8eeb1e1eb0605cc9.js +0 -1
  131. package/assets/esri/core/workers/chunks/e080628ac6e1cf25dc72.js +0 -1
  132. package/assets/esri/core/workers/chunks/e8e0f73fb94e63e2abc3.js +0 -1
  133. package/assets/esri/core/workers/chunks/f45c343527709f6f91c2.js +0 -1
  134. package/assets/esri/core/workers/chunks/fcac475e4e82911b3126.js +0 -1
  135. /package/assets/esri/core/workers/chunks/{7a23b127f551bf13ef54.js.LICENSE.txt → 268f5b233640a9dbbf89.js.LICENSE.txt} +0 -0
  136. /package/assets/esri/core/workers/chunks/{cd1869e183001266c4c1.js.LICENSE.txt → 336b54144afec0c7d396.js.LICENSE.txt} +0 -0
  137. /package/assets/esri/core/workers/chunks/{280af3640f8e93c1024e.js.LICENSE.txt → 47e4f66c33bb697fbe6b.js.LICENSE.txt} +0 -0
  138. /package/assets/esri/core/workers/chunks/{9c64b78c5c9b35b31d98.js.LICENSE.txt → aa78b69219d9a0ef1c54.js.LICENSE.txt} +0 -0
  139. /package/assets/esri/core/workers/chunks/{d153b29c542c37ae1636.js.LICENSE.txt → c50e8d5f554cf151865c.js.LICENSE.txt} +0 -0
  140. /package/assets/esri/core/workers/chunks/{b15ff6c9ef2de8a49853.js.LICENSE.txt → d6e0528eacee7ea4c1ce.js.LICENSE.txt} +0 -0
  141. /package/assets/esri/core/workers/chunks/{d66cdb9bb494da19696b.js.LICENSE.txt → f651c05604eab83aef5f.js.LICENSE.txt} +0 -0
  142. /package/assets/esri/core/workers/chunks/{ed773dab5965e42a2879.js.LICENSE.txt → f6e18668f728dfd8ba5e.js.LICENSE.txt} +0 -0
package/core/NestedMap.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- 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(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))}*outerMap(){for(const t of this._outer)yield t}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)))}}export{t as NestedMap};
5
+ 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,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- function n(n){const o=[];return function*(){yield*o;for(const t of n)o.push(t),yield t}}function o(n,o){for(const t of n)if(null!=t&&o(t))return t}function t(n){return null!=n&&"function"==typeof n[Symbol.iterator]}export{n as cache,o as find,t as isIterable};
5
+ function n(n){const t=[];return function*(){yield*t;let e,o=t.length;for(;!(e=n.next()).done;)for(t.push(e.value),yield e.value;++o<t.length;)yield t[o]}}function t(n,t){for(const e of n)if(null!=e&&t(e))return e}function e(n){return null!=n&&"function"==typeof n[Symbol.iterator]}export{n as cache,t as find,e as isIterable};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{fromArray as e,fromValues as t,create as r}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{n,b as o}from"../../chunks/vec32.js";import{interpolateM as s}from"./coordUtils.js";import a from"../../geometry/Point.js";import{getLength as i}from"../../geometry/support/coordsUtils.js";import{isCoordinate as f,getEndpoint as c}from"../../geometry/support/curves/curveUtils.js";import{splitCurveAtPoint as l}from"../../geometry/support/curves/splitCurveAtPoint.js";function p(e,t,r){let n=t[0]-e[0],o=t[1]-e[1];const s=Math.hypot(n,o);return n/=s,o/=s,n*=r,o*=r,[e[0]+n,e[1]+o]}function u(e,s,a,i){const f=t(s[0]-e[0],s[1]-e[1],s[2]*i-e[2]*i);return n(f,f),o(r(),e,f,a)}function m(e,t){let r=0,n=null;const o=e.hasM,f=e.hasZ?3:2;for(const c of e.paths){if(0===t){n=new a({x:c[0][0],y:c[0][1],...o?{m:c[0][f]}:{},spatialReference:e.spatialReference,hasM:o});break}for(let l=0;l<c.length-1;l++){const u=i(c[l],c[l+1]),m=r+u;if(m===t){n=new a({x:c[l+1][0],y:c[l+1][1],...o?{m:c[l+1][f]}:{},spatialReference:e.spatialReference,hasM:o});break}if(m>t){const i=p(c[l],c[l+1],t-r);n=new a({x:i[0],y:i[1],...o?{m:s(c[l][f],c[l+1][f],u,t-r)??void 0}:{},spatialReference:e.spatialReference,hasM:o});break}r+=u}if(null!==n)break}return n}function h(t,r,n){let o=0;const i=t.hasM;for(const f of t.paths){if(0===r)return new a({x:f[0][0],y:f[0][1],z:f[0][2],...i?{m:f[0][3]}:{},hasZ:!0,hasM:i,spatialReference:t.spatialReference});for(let c=0;c<f.length-1;c++){const l=y(f[c],f[c+1],n),p=o+l;if(p===r)return new a({x:f[c+1][0],y:f[c+1][1],z:f[c+1][2],...i?{m:f[c+1][3]}:{},hasZ:!0,hasM:i,spatialReference:t.spatialReference});if(p>r){const p=u(e(f[c]),e(f[c+1]),r-o,n);return new a({x:p[0],y:p[1],z:p[2],...i?{m:s(f[c][3],f[c+1][3],l,r-o)??void 0}:{},hasZ:!0,hasM:i,spatialReference:t.spatialReference})}o+=l}}return null}function y(e,t,r){return Math.hypot(e[0]-t[0],e[1]-t[1],void 0!==e[2]&&void 0!==t[2]?e[2]*r-t[2]*r:0)}function R(e,t,r,n=.001){if(f(t)){return[[e,r],[r,t]]}const[o,s]=l(e,t,r,n);return[[e,o],[c(o),s]]}export{p as distanceAlongLineSegment,u as distanceAlongLineSegmentWithZ,m as pointAlongLine,h as pointAlongLineWithZ,y as segmentLength3d,R as splitSegmentAtPoint};
5
+ import{fromArray as e,fromValues as t,create as r}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{n,b as o}from"../../chunks/vec32.js";import{interpolateM as s}from"./coordUtils.js";import a from"../../geometry/Point.js";import{getLength as i}from"../../geometry/support/coordsUtils.js";import{isCoordinate as f,getEndpoint as c}from"../../geometry/support/curves/curveUtils.js";import{splitCurveAtPoint as l}from"../../geometry/support/curves/splitCurveAtPoint.js";function p(e,t,r){let n=t[0]-e[0],o=t[1]-e[1];const s=Math.hypot(n,o);return n/=s,o/=s,n*=r,o*=r,[e[0]+n,e[1]+o]}function u(e,s,a,i){const f=t(s[0]-e[0],s[1]-e[1],s[2]*i-e[2]*i);return n(f,f),o(r(),e,f,a)}function m(e,t){let r=0,n=null;const o=e.hasM,f=e.hasZ?3:2;for(const c of e.paths){if(0===t){n=new a({x:c[0][0],y:c[0][1],...o?{m:c[0][f]}:{},spatialReference:e.spatialReference,hasM:o});break}for(let l=0;l<c.length-1;l++){const u=i(c[l],c[l+1]),m=r+u;if(m===t){n=new a({x:c[l+1][0],y:c[l+1][1],...o?{m:c[l+1][f]}:{},spatialReference:e.spatialReference,hasM:o});break}if(m>t){const i=p(c[l],c[l+1],t-r);n=new a({x:i[0],y:i[1],...o?{m:s(c[l][f],c[l+1][f],u,t-r)??void 0}:{},spatialReference:e.spatialReference,hasM:o});break}r+=u}if(null!==n)break}return n}function h(t,r,n){let o=0;const i=t.hasM;for(const f of t.paths){if(0===r)return new a({x:f[0][0],y:f[0][1],z:f[0][2],...i?{m:f[0][3]}:{},hasZ:!0,hasM:i,spatialReference:t.spatialReference});for(let c=0;c<f.length-1;c++){const l=y(f[c],f[c+1],n),p=o+l;if(p===r)return new a({x:f[c+1][0],y:f[c+1][1],z:f[c+1][2],...i?{m:f[c+1][3]}:{},hasZ:!0,hasM:i,spatialReference:t.spatialReference});if(p>r){const p=u(e(f[c]),e(f[c+1]),r-o,n);return new a({x:p[0],y:p[1],z:p[2],...i?{m:s(f[c][3],f[c+1][3],l,r-o)??void 0}:{},hasZ:!0,hasM:i,spatialReference:t.spatialReference})}o+=l}}return null}function y(e,t,r){return Math.hypot(e[0]-t[0],e[1]-t[1],void 0!==e[2]&&void 0!==t[2]?e[2]*r-t[2]*r:0)}function R(e,t,r,n,o=.001){if(f(t)){return[[e,r],[r,t]]}const[s,a]=l(e,t,r,o);if(n&&null!=r[2]){const e=r[2];c(s)[2]=e}return[[e,s],[c(s),a]]}export{p as distanceAlongLineSegment,u as distanceAlongLineSegmentWithZ,m as pointAlongLine,h as pointAlongLineWithZ,y as segmentLength3d,R as splitSegmentAtPoint};
package/interfaces.d.ts CHANGED
@@ -31254,7 +31254,7 @@ declare namespace __esri {
31254
31254
  */
31255
31255
  clone(): this;
31256
31256
  /**
31257
- * Converts a file or list of files to mesh geometry.
31257
+ * Converts a file or list of files to a mesh geometry.
31258
31258
  *
31259
31259
  * @param files The files from which to create the mesh.
31260
31260
  * @param options Options to configure the conversion.
@@ -31619,6 +31619,8 @@ declare namespace __esri {
31619
31619
  */
31620
31620
  export interface ConvertMeshOptions {
31621
31621
  location?: Point;
31622
+ origin?: Point;
31623
+ defaultOrigin?: Point;
31622
31624
  signal?: AbortSignal | nullish;
31623
31625
  }
31624
31626
 
@@ -133472,7 +133474,7 @@ declare namespace __esri {
133472
133474
  *
133473
133475
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer Read more...}
133474
133476
  */
133475
- layer: GraphicsLayer;
133477
+ layer: GraphicsLayer | MapNotesLayer | nullish;
133476
133478
  /**
133477
133479
  * Determines the layout/orientation of the Sketch widget.
133478
133480
  *
@@ -133688,7 +133690,7 @@ declare namespace __esri {
133688
133690
  *
133689
133691
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#layer Read more...}
133690
133692
  */
133691
- layer?: GraphicsLayer;
133693
+ layer?: GraphicsLayer | MapNotesLayer | nullish;
133692
133694
  /**
133693
133695
  * Determines the layout/orientation of the Sketch widget.
133694
133696
  *
@@ -133810,11 +133812,11 @@ declare namespace __esri {
133810
133812
  */
133811
133813
  defaultUpdateOptions: SketchViewModelDefaultUpdateOptions;
133812
133814
  /**
133813
- * The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html GraphicsLayer} associated with the SketchViewModel.
133815
+ * The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html GraphicsLayer} or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapNotesLayer.html MapNotesLayer} associated with the SketchViewModel.
133814
133816
  *
133815
133817
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer Read more...}
133816
133818
  */
133817
- layer: GraphicsLayer;
133819
+ layer: GraphicsLayer | MapNotesLayer | nullish;
133818
133820
  /**
133819
133821
  * The sketch view model's state.
133820
133822
  *
@@ -133924,6 +133926,22 @@ declare namespace __esri {
133924
133926
  */
133925
133927
  get valueOptions(): SketchValueOptions;
133926
133928
  set valueOptions(value: SketchValueOptionsProperties);
133929
+ /**
133930
+ * Convenience method for adding a graphic to the appropriate Sketch layer.
133931
+ *
133932
+ * @param graphic
133933
+ *
133934
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#addGraphic Read more...}
133935
+ */
133936
+ addGraphic(graphic: Graphic): void;
133937
+ /**
133938
+ * Convenience method for adding multiple graphics to the appropriate Sketch layer.
133939
+ *
133940
+ * @param graphics
133941
+ *
133942
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#addGraphics Read more...}
133943
+ */
133944
+ addGraphics(graphics: Graphic[]): void;
133927
133945
  /**
133928
133946
  * Cancels the active operation and fires the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event-create create} or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#event-update update} event
133929
133947
  * If called in the middle of a create operation, `cancel()` discards the partially created graphic.
@@ -133999,6 +134017,14 @@ declare namespace __esri {
133999
134017
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#hasEventListener Read more...}
134000
134018
  */
134001
134019
  hasEventListener(type: string): boolean;
134020
+ /**
134021
+ * Convenience method for determining if a Graphic belongs to a current Sketch layer or sublayer.
134022
+ *
134023
+ * @param graphic
134024
+ *
134025
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#hasGraphic Read more...}
134026
+ */
134027
+ hasGraphic(graphic: Graphic): boolean;
134002
134028
  /**
134003
134029
  * Allows creation of a graphic similar to create with the
134004
134030
  * difference that the geometry can be provided directly for the graphic being created.
@@ -134014,6 +134040,28 @@ declare namespace __esri {
134014
134040
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#redo Read more...}
134015
134041
  */
134016
134042
  redo(): void;
134043
+ /**
134044
+ * Convenience method for removing multiple graphics from the appropriate Sketch layer.
134045
+ *
134046
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#removeAllGraphics Read more...}
134047
+ */
134048
+ removeAllGraphics(): void;
134049
+ /**
134050
+ * Convenience method for removing a graphic from the appropriate Sketch layer.
134051
+ *
134052
+ * @param graphic
134053
+ *
134054
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#removeGraphic Read more...}
134055
+ */
134056
+ removeGraphic(graphic: Graphic): void;
134057
+ /**
134058
+ * Convenience method for removing multiple graphics from the appropriate Sketch layer.
134059
+ *
134060
+ * @param graphics
134061
+ *
134062
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#removeGraphics Read more...}
134063
+ */
134064
+ removeGraphics(graphics: Graphic[]): void;
134017
134065
  /**
134018
134066
  * Incrementally undo actions recorded in the stack.
134019
134067
  *
@@ -134070,11 +134118,11 @@ declare namespace __esri {
134070
134118
  */
134071
134119
  labelOptions?: SketchLabelOptionsProperties;
134072
134120
  /**
134073
- * The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html GraphicsLayer} associated with the SketchViewModel.
134121
+ * The {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html GraphicsLayer} or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapNotesLayer.html MapNotesLayer} associated with the SketchViewModel.
134074
134122
  *
134075
134123
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html#layer Read more...}
134076
134124
  */
134077
- layer?: GraphicsLayer;
134125
+ layer?: GraphicsLayer | MapNotesLayer | nullish;
134078
134126
  /**
134079
134127
  * A {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-SimpleMarkerSymbol.html SimpleMarkerSymbol}, {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-PointSymbol3D.html PointSymbol3D}, {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-TextSymbol.html TextSymbol}, {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-CIMSymbol.html CIMSymbol}, or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-WebStyleSymbol.html WebStyleSymbol} used for representing the point geometry that is being drawn.
134080
134128
  *
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.85",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.86",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Error.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as n,sync as a}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as c}from"../core/accessorSupport/decorators/persistable.js";import d from"../geometry/Extent.js";import h from"../geometry/SpatialReference.js";import u from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as T,url as v}from"./support/commonProperties.js";import w from"./support/SceneModifications.js";import{initFullExtent as x}from"./support/tiles3DUtils.js";import L from"../portal/Portal.js";import{logInvalidElevationInfoWarning as b,elevationModeRequiredMessage as I,featureExpressionUnsupportedMessage as P}from"../support/elevationInfoUtils.js";import{f as R}from"../chunks/persistableUrlUtils.js";let k=class extends(y(S(_(j(r(g(f(u)))))))){readModifications(e,t,i){this._modificationsSource={url:R(e,i),context:i}}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,a))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new h({wkid:4326,vcsWkid:115700}),this.fullExtent=new d(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[o,r]of Object.entries(e)){if("uri"===o)try{const e=new URL("https://tmp"+r).searchParams.get("session");if(e)return e}catch(i){}"object"==typeof r&&null!==r&&t.push(r)}}return null}async requestRootAndSession(e){const r=(e,t)=>new i("request-root-and-session:"+e,"requestRootAndSession: "+t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((i,n)=>{this.url||n(r("url-missing","requestRootAndSession: url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,i)=>{if(this.replacesTerrain&&!this._key){const o=this.portalItem?.portal||this.parent?.portalItem?.portal||L.getDefault();o.signIn().then(()=>{o.g3dTilesEnabled||i(r("g3dTilesEnabled-false","g3dTilesEnabled is false")),t(o.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>i(r("session-key-not-found","can't get session key")))},()=>i(r("sign-in.failed","can't sign in to portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",signal:e}).then(e=>{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data)),this._rootTilesetJSON?(this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=x(this._rootTilesetJSON),i(),this._rootRequestPromise=null):n(r("root-parse-failed","Error parsing root tile"))},e=>{s(e),n(e),this._rootRequestPromise=null,o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>n(e))})),this._rootRequestPromise}async _doLoad(e){const t=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(o){s(o)}if(null!=this._modificationsSource){const t=await w.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this.requestRootAndSession(t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},e=>{o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})}get hasAttributionData(){return!1}async fetchAttributionData(){return{}}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";b(o.getLogger(this),I(t,"absolute-height",e)),b(o.getLogger(this),P(t,e))}get replacesTerrain(){return!!this.parent&&"type"in this.parent&&"Basemap"===this.parent.type&&this.hasGoogleUrl}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],k.prototype,"operationalLayerType",void 0),e([l({type:w,clonable:e=>e.clone()}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],k.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],k.prototype,"readModifications",null),e([l({type:h})],k.prototype,"spatialReference",void 0),e([l({type:d})],k.prototype,"fullExtent",void 0),e([l(T)],k.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],k.prototype,"listMode",void 0),e([l(v)],k.prototype,"url",void 0),e([l({readOnly:!0})],k.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],k.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],k.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],k.prototype,"maxScale",void 0),k=e([m("esri.layers.IntegratedMesh3DTilesLayer")],k);const q=k;export{q as default};
5
+ import{__decorate as e}from"tslib";import t from"../request.js";import o from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as n,sync as a}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as c}from"../core/accessorSupport/decorators/persistable.js";import d from"../geometry/Extent.js";import u from"../geometry/SpatialReference.js";import h from"./Layer.js";import{APIKeyMixin as f}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as T,url as v}from"./support/commonProperties.js";import L from"./support/SceneModifications.js";import{initFullExtent as w}from"./support/tiles3DUtils.js";import x from"../portal/Portal.js";import{logInvalidElevationInfoWarning as b,elevationModeRequiredMessage as I,featureExpressionUnsupportedMessage as P}from"../support/elevationInfoUtils.js";import{f as R}from"../chunks/persistableUrlUtils.js";import{isBasemap as k}from"../support/userTypeGuards/isBasemap.js";let O=class extends(y(S(_(j(i(g(f(h)))))))){readModifications(e,t,o){this._modificationsSource={url:R(e,o),context:o}}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,a))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new u({wkid:4326,vcsWkid:115700}),this.fullExtent=new d(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this._rootTilesetJSON=null,this._rootTileset=null,this._key=null,this._session=null,this._rootRequestPromise=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}get rootTilesetJSON(){return this._rootTilesetJSON}get rootTileset(){return this._rootTileset}get key(){return this._key}get session(){return this._session}_findSessionParameter(e){const t=[e];for(;t?.length>0;){const e=t.pop();if(!e)return;for(const[r,i]of Object.entries(e)){if("uri"===r)try{const e=new URL("https://tmp"+i).searchParams.get("session");if(e)return e}catch(o){}"object"==typeof i&&null!==i&&t.push(i)}}return null}async requestRootAndSession(e){const i=(e,t)=>new o("request-root-and-session:"+e,"requestRootAndSession: "+t);return this._rootRequestPromise||(this._rootRequestPromise=new Promise((o,n)=>{this.url||n(i("url-missing","requestRootAndSession: url missing")),this._key=this.customParameters?this.customParameters.key:null;new Promise((e,o)=>{if(this.replacesTerrain&&!this._key){const r=this.portalItem?.portal||this.parent?.portalItem?.portal||x.getDefault();r.signIn().then(()=>{r.g3dTilesEnabled||o(i("g3dTilesEnabled-false","g3dTilesEnabled is false")),t(r.restUrl+"/portals/self/modules/g3dtiles",{responseType:"json",query:{f:"json"}}).then(t=>{this._key=t.data.keyString,e()},()=>o(i("session-key-not-found","can't get session key")))},()=>o(i("sign-in.failed","can't sign in to portal")))}else e()}).then(()=>{t(this.url,{query:this._key?{key:this._key,token:this.apiKey}:{token:this.apiKey},responseType:"array-buffer",signal:e}).then(e=>{this._rootTilesetJSON=JSON.parse((new TextDecoder).decode(e.data)),this._rootTilesetJSON?(this._session=this._findSessionParameter(this._rootTilesetJSON),this._rootTileset=e.data,this.fullExtent=w(this._rootTilesetJSON),o(),this._rootRequestPromise=null):n(i("root-parse-failed","Error parsing root tile"))},e=>{s(e),n(e),this._rootRequestPromise=null,r.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})},e=>n(e))})),this._rootRequestPromise}async _doLoad(e){const t=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new o("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(r){s(r)}if(null!=this._modificationsSource){const t=await L.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this.requestRootAndSession(t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},e=>{r.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})}get hasAttributionData(){return!1}async fetchAttributionData(){return{}}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";b(r.getLogger(this),I(t,"absolute-height",e)),b(r.getLogger(this),P(t,e))}get replacesTerrain(){return this.hasGoogleUrl&&this._isUsedAsGroundLayer}get _isUsedAsGroundLayer(){return k(this.parent)}get hasGoogleUrl(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],O.prototype,"operationalLayerType",void 0),e([l({type:L,clonable:e=>e.clone()}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],O.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],O.prototype,"readModifications",null),e([l({type:u})],O.prototype,"spatialReference",void 0),e([l({type:d})],O.prototype,"fullExtent",void 0),e([l(T)],O.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],O.prototype,"listMode",void 0),e([l(v)],O.prototype,"url",void 0),e([l({readOnly:!0})],O.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],O.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],O.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],O.prototype,"maxScale",void 0),e([l({readOnly:!0})],O.prototype,"replacesTerrain",null),e([l({readOnly:!0})],O.prototype,"_isUsedAsGroundLayer",null),e([l()],O.prototype,"hasGoogleUrl",null),O=e([m("esri.layers.IntegratedMesh3DTilesLayer")],O);const U=O;export{U as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as n,sync as a}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as d}from"../core/accessorSupport/decorators/persistable.js";import c from"./Layer.js";import{APIKeyMixin as y}from"./mixins/APIKeyMixin.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as u}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{SceneService as S}from"./mixins/SceneService.js";import{elevationInfo as j}from"./support/commonProperties.js";import{I3SNodePageDefinition as w,I3SMaterialDefinition as x,I3STextureSetDefinition as L,I3SGeometryDefinition as I}from"./support/I3SLayerDefinitions.js";import b from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as T,elevationModeRequiredMessage as _,featureExpressionUnsupportedMessage as M}from"../support/elevationInfoUtils.js";import{f as O}from"../chunks/persistableUrlUtils.js";let P=class extends(S(h(u(v(g(r(f(y(t(c)))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,a))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:O(e,o),context:o}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){s(o)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await b.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new o("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(e){const t="Integrated mesh layers";T(i.getLogger(this),_(t,"absolute-height",e)),T(i.getLogger(this),M(t,e))}};e([p({type:String,readOnly:!0})],P.prototype,"geometryType",void 0),e([p({type:["show","hide"]})],P.prototype,"listMode",void 0),e([p({type:["IntegratedMeshLayer"]})],P.prototype,"operationalLayerType",void 0),e([p({json:{read:!1},readOnly:!0})],P.prototype,"type",void 0),e([p({type:w,readOnly:!0,clonable:!1})],P.prototype,"nodePages",void 0),e([p({type:[x],readOnly:!0,clonable:!1})],P.prototype,"materialDefinitions",void 0),e([p({type:[L],readOnly:!0,clonable:!1})],P.prototype,"textureSetDefinitions",void 0),e([p({type:[I],readOnly:!0,clonable:!1})],P.prototype,"geometryDefinitions",void 0),e([p({readOnly:!0})],P.prototype,"serviceUpdateTimeStamp",void 0),e([p({type:b,clonable:e=>e?.clone()??e}),d({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],P.prototype,"modifications",void 0),e([l(["web-scene","portal-item"],"modifications")],P.prototype,"readModifications",null),e([p(j)],P.prototype,"elevationInfo",null),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],P.prototype,"path",void 0),P=e([m("esri.layers.IntegratedMeshLayer")],P);const U=P;export{U as default};
5
+ import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import r from"../core/Error.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as a,sync as n}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{persistable as m}from"../core/accessorSupport/decorators/persistable.js";import c from"./Layer.js";import{APIKeyMixin as y}from"./mixins/APIKeyMixin.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as u}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{SceneService as S}from"./mixins/SceneService.js";import{elevationInfo as j}from"./support/commonProperties.js";import{I3SNodePageDefinition as L,I3SMaterialDefinition as T,I3STextureSetDefinition as _,I3SGeometryDefinition as w}from"./support/I3SLayerDefinitions.js";import x from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as I,elevationModeRequiredMessage as b,featureExpressionUnsupportedMessage as O}from"../support/elevationInfoUtils.js";import{f as M}from"../chunks/persistableUrlUtils.js";import{isBasemap as U}from"../support/userTypeGuards/isBasemap.js";let A=class extends(S(h(u(v(g(i(f(y(t(c)))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this.path=null,this.definitionExpression=null,this._canReplaceTerrain=!1}initialize(){this.addHandles(a(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,n))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,r){this._modificationsSource={url:M(e,r),context:r}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){s(r)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await x.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new r("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new r("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new r("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(e){const t="Integrated mesh layers";I(o.getLogger(this),b(t,"absolute-height",e)),I(o.getLogger(this),O(t,e))}get replacesTerrain(){return this._canReplaceTerrain&&this._isUsedAsGroundLayer}get _isUsedAsGroundLayer(){return U(this.parent)}};e([p({type:String,readOnly:!0})],A.prototype,"geometryType",void 0),e([p({type:["show","hide"]})],A.prototype,"listMode",void 0),e([p({type:["IntegratedMeshLayer"]})],A.prototype,"operationalLayerType",void 0),e([p({json:{read:!1},readOnly:!0})],A.prototype,"type",void 0),e([p({type:L,readOnly:!0,clonable:!1})],A.prototype,"nodePages",void 0),e([p({type:[T],readOnly:!0,clonable:!1})],A.prototype,"materialDefinitions",void 0),e([p({type:[_],readOnly:!0,clonable:!1})],A.prototype,"textureSetDefinitions",void 0),e([p({type:[w],readOnly:!0,clonable:!1})],A.prototype,"geometryDefinitions",void 0),e([p({readOnly:!0})],A.prototype,"serviceUpdateTimeStamp",void 0),e([p({type:x,clonable:e=>e?.clone()??e}),m({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],A.prototype,"modifications",void 0),e([l(["web-scene","portal-item"],"modifications")],A.prototype,"readModifications",null),e([p(j)],A.prototype,"elevationInfo",null),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],A.prototype,"path",void 0),e([p({readOnly:!0})],A.prototype,"replacesTerrain",null),e([p({readOnly:!0})],A.prototype,"_isUsedAsGroundLayer",null),e([p()],A.prototype,"_canReplaceTerrain",void 0),A=e([d("esri.layers.IntegratedMeshLayer")],A);const P=A;export{P as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import o from"../core/Error.js";import{abortHandle as a}from"../core/handleUtils.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y,throwIfNotAbortError as u}from"../core/promiseUtils.js";import{whenOnce as c}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as f}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import v from"../geometry/Point.js";import b from"../graphic/SceneGraphicOrigin.js";import w from"./Layer.js";import{NoModelError as I,MultipleModelsError as L}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as j}from"./mixins/APIKeyMixin.js";import{ArcGISService as F}from"./mixins/ArcGISService.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as O}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as P}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{SceneService as T}from"./mixins/SceneService.js";import{useViewTimeProperty as x}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as E}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as D}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as U}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as R}from"./support/capabilities.js";import{elevationInfo as q,labelsVisible as C,legendEnabled as G,popupEnabled as N,attributeTableTemplate as Q,screenSizePerspectiveEnabled as V}from"./support/commonProperties.js";import{getFieldDomain as M,computeEffectiveEditingEnabled as k,getGlobalIdToObjectIdMap as K}from"./support/featureLayerUtils.js";import{FeatureReduction as $}from"./support/FeatureReduction.js";import H from"./support/FeatureReductionSelection.js";import{defineFieldProperties as z}from"./support/fieldProperties.js";import W from"./support/FieldsIndex.js";import{fixRendererFields as Z,unpackFieldNames as B}from"./support/fieldUtils.js";import{I3SNodePageDefinition as J,I3SMaterialDefinition as X,I3STextureSetDefinition as Y,I3SGeometryDefinition as ee}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as te,isFileSupported as re}from"./support/infoFor3D.js";import ie from"./support/LabelClass.js";import{reader as se}from"./support/labelingInfo.js";import oe from"./support/LayerFloorInfo.js";import{layerLookupMap as ae}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as ne}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as le}from"./support/RangeInfo.js";import pe from"./support/SceneFilter.js";import{cacheIsOutOfSync as de}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ye}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ue}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as ce}from"../renderers/support/typeUtils.js";import he from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as fe,elevationModeUnsupportedMessage as me,featureExpressionUnsupportedMessage as ge}from"../support/elevationInfoUtils.js";import{createPopupTemplate as ve}from"../support/popupUtils.js";import{extractZipFiles as be}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as we}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Ie,getFetchPopupTemplate as Le}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as je}from"../webdoc/support/opacityUtils.js";const Fe=new Set(["3DObject","Point"]),Se=z();let Oe=class extends(E(O(T(F(_(P(A(p(S(j(i(w)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.graphicOrigin=new b(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?M(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new W(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:J.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&k(this.associatedLayer)}get geometryType(){return Pe[this.profile]||"mesh"}set renderer(e){Z(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:R;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&_e[r]?_e[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ue(this,{origin:"service"},t),Z(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new he;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=B(this.fieldsIndex,await Ie(this,Le(this)));return we(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new o("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s.origin=this.graphicOrigin,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return ve(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new o("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new o("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:a}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==a)throw new o(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new o(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return D(s.url)&&n&&null!=e.deleteFeatures&&null!=a&&(i={...i,globalIdToObjectId:await K(s,e.deleteFeatures,a)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new o(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new o("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce((e,t)=>te(this.infoFor3D,t)?e+1:e,0);0===s&&r(new I),s>1&&r(new L);const a=this.spatialReference,l=t.location??new v({x:0,y:0,z:0,spatialReference:a}),p=l.spatialReference.isGeographic?"local":"georeferenced",{default:d}=await import("../geometry/Mesh.js"),y=d.createWithExternalSource(l,{type:"client",files:i},{vertexSpace:p,transform:ne(l.spatialReference),unitConversionDisabled:!0}),[u]=await this.uploadAssets([y],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await be(e)).filter(e=>re(t,e))}validateLayer(e){if(e.layerType&&!Fe.has(e.layerType))throw new o("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new o("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new o("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new o("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=f(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!D(this.associatedLayer?.url)||!de(this))return;f(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await U(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ae.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){y(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(a(e));try{await c(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void u(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&fe(n.getLogger(this),me("Mesh scene layers","relative-to-scene",e)),fe(n.getLogger(this),ge("Scene layers",e))}async fetchStatistics(e,t){return await ye({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([h({types:{key:"type",base:$,typeMap:{selection:H}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],Oe.prototype,"featureReduction",void 0),e([h({type:[le],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],Oe.prototype,"rangeInfos",void 0),e([h({json:{read:!1}})],Oe.prototype,"associatedLayer",void 0),e([h({type:["show","hide"]})],Oe.prototype,"listMode",void 0),e([h({type:["ArcGISSceneServiceLayer"]})],Oe.prototype,"operationalLayerType",void 0),e([h({json:{read:!1},readOnly:!0})],Oe.prototype,"type",void 0),e([h({...Se.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Oe.prototype,"fields",void 0),e([h()],Oe.prototype,"types",null),e([h()],Oe.prototype,"typeIdField",null),e([h()],Oe.prototype,"templates",null),e([h()],Oe.prototype,"formTemplate",null),e([h({readOnly:!0})],Oe.prototype,"graphicOrigin",void 0),e([h({readOnly:!0,clonable:!1})],Oe.prototype,"fieldsIndex",null),e([h({type:oe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Oe.prototype,"floorInfo",void 0),e([h(Se.outFields)],Oe.prototype,"outFields",void 0),e([h({type:J,readOnly:!0,json:{read:!1},clonable:!1})],Oe.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],Oe.prototype,"readNodePages",null),e([h({type:[X],readOnly:!0,clonable:!1})],Oe.prototype,"materialDefinitions",void 0),e([h({type:[Y],readOnly:!0,clonable:!1})],Oe.prototype,"textureSetDefinitions",void 0),e([h({type:[ee],readOnly:!0,clonable:!1})],Oe.prototype,"geometryDefinitions",void 0),e([h({readOnly:!0})],Oe.prototype,"serviceUpdateTimeStamp",void 0),e([h({readOnly:!0})],Oe.prototype,"attributeStorageInfo",void 0),e([h({readOnly:!0})],Oe.prototype,"statisticsInfo",void 0),e([h({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Oe.prototype,"excludeObjectIds",void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Oe.prototype,"definitionExpression",void 0),e([h({type:pe,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Oe.prototype,"filter",void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Oe.prototype,"path",void 0),e([h(q)],Oe.prototype,"elevationInfo",null),e([h({readOnly:!0,json:{read:!1}})],Oe.prototype,"effectiveCapabilities",null),e([h({readOnly:!0})],Oe.prototype,"effectiveEditingEnabled",null),e([h({type:String})],Oe.prototype,"geometryType",null),e([h(C)],Oe.prototype,"labelsVisible",void 0),e([h({type:[ie],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:se},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:se},write:!0}})],Oe.prototype,"labelingInfo",void 0),e([h(G)],Oe.prototype,"legendEnabled",void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?je(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Oe.prototype,"opacity",void 0),e([h({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Oe.prototype,"priority",void 0),e([h({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Oe.prototype,"semantic",void 0),e([h({types:ce,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Oe.prototype,"renderer",null),e([h({json:{read:!1}})],Oe.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],Oe.prototype,"readCachedDrawingInfo",null),e([h({readOnly:!0,json:{read:!1}})],Oe.prototype,"capabilities",null),e([h({type:Boolean,json:{read:!1}})],Oe.prototype,"editingEnabled",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Oe.prototype,"infoFor3D",null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Oe.prototype,"relationships",null),e([h(N)],Oe.prototype,"popupEnabled",void 0),e([h({type:r,json:{name:"popupInfo",write:!0}})],Oe.prototype,"popupTemplate",void 0),e([h({readOnly:!0,json:{read:!1}})],Oe.prototype,"defaultPopupTemplate",null),e([h(Q)],Oe.prototype,"attributeTableTemplate",void 0),e([h({type:String,json:{read:!1}})],Oe.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],Oe.prototype,"readObjectIdField",null),e([h({type:String,json:{read:!1}})],Oe.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],Oe.prototype,"readGlobalIdField",null),e([h({readOnly:!0,type:String,json:{read:!1}})],Oe.prototype,"displayField",null),e([h({type:String,json:{read:!1}})],Oe.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],Oe.prototype,"readProfile",null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Oe.prototype,"normalReferenceFrame",void 0),e([h(V)],Oe.prototype,"screenSizePerspectiveEnabled",void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Oe.prototype,"serviceItemId",void 0),e([h(x)],Oe.prototype,"useViewTime",null),Oe=e([g("esri.layers.SceneLayer")],Oe);const _e={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Pe={"mesh-pyramids":"mesh",points:"point"},Ae=Oe;export{Ae as default};
5
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../PopupTemplate.js";import{ClonableMixin as i}from"../core/Clonable.js";import s from"../core/Collection.js";import{deprecated as o}from"../core/deprecate.js";import a from"../core/Error.js";import{abortHandle as n}from"../core/handleUtils.js";import l from"../core/Logger.js";import{destroyMaybe as p}from"../core/maybe.js";import{MultiOriginJSONMixin as d}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as y,isAbortError as u,throwIfNotAbortError as c}from"../core/promiseUtils.js";import{whenOnce as h}from"../core/reactiveUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as m}from"../core/accessorSupport/utils.js";import{reader as g}from"../core/accessorSupport/decorators/reader.js";import{subclass as v}from"../core/accessorSupport/decorators/subclass.js";import b from"../geometry/Point.js";import w from"../graphic/SceneGraphicOrigin.js";import L from"./Layer.js";import{NoModelError as I,MultipleModelsError as j}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as F}from"./mixins/APIKeyMixin.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as _}from"./mixins/EditBusLayer.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{SceneService as x}from"./mixins/SceneService.js";import{useViewTimeProperty as E}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as D}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as U}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as R}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as q}from"./support/capabilities.js";import{elevationInfo as C,labelsVisible as G,legendEnabled as N,popupEnabled as Q,attributeTableTemplate as V,screenSizePerspectiveEnabled as M}from"./support/commonProperties.js";import{getFieldDomain as k,computeEffectiveEditingEnabled as K,getGlobalIdToObjectIdMap as $}from"./support/featureLayerUtils.js";import{FeatureReduction as H}from"./support/FeatureReduction.js";import z from"./support/FeatureReductionSelection.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import Z from"./support/FieldsIndex.js";import{fixRendererFields as B,unpackFieldNames as J}from"./support/fieldUtils.js";import{I3SNodePageDefinition as X,I3SMaterialDefinition as Y,I3STextureSetDefinition as ee,I3SGeometryDefinition as te}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as re,isFileSupported as ie}from"./support/infoFor3D.js";import se from"./support/LabelClass.js";import{reader as oe}from"./support/labelingInfo.js";import ae from"./support/LayerFloorInfo.js";import{layerLookupMap as ne}from"./support/lazyLayerLoader.js";import{getMeshTransformForMetersToSpatialReference as le}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as pe}from"./support/RangeInfo.js";import de from"./support/SceneFilter.js";import{cacheIsOutOfSync as ye}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ue}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as ce}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as he}from"../renderers/support/typeUtils.js";import fe from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as me,elevationModeUnsupportedMessage as ge,featureExpressionUnsupportedMessage as ve}from"../support/elevationInfoUtils.js";import{createPopupTemplate as be}from"../support/popupUtils.js";import{extractZipFiles as we}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as Le}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as Ie,getFetchPopupTemplate as je}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Fe}from"../webdoc/support/opacityUtils.js";const Se=new Set(["3DObject","Point"]),Oe=W();let _e=class extends(D(_(x(S(P(T(A(d(O(F(i(L)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.graphicOrigin=new w(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new s,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=p(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getField(e)?.domain??null;return this.associatedLayer?k(this.associatedLayer,e,t,r):r}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new Z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:X.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&K(this.associatedLayer)}get geometryType(){return Te[this.profile]||"mesh"}set renderer(e){B(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:q;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:y},operations:{supportsEditing:u,supportsAdd:c,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:y,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:u&&b,supportsAdd:w&&c&&b,supportsDelete:w&&f&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&Pe[r]?Pe[r]:(l.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await ce(this,{origin:"service"},t),B(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){l.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new fe;return"mesh"===this.geometryType?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=J(this.fieldsIndex,await Ie(this,je(this)));return Le(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new a("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s.origin=this.graphicOrigin,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(l.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return be(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(0,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:o}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==o)throw new a(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new a(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return U(s.url)&&n&&null!=e.deleteFeatures&&null!=o&&(i={...i,globalIdToObjectId:await $(s,e.deleteFeatures,o)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={},null!=t.location&&o(l.getLogger(this),"The 'location' option of convertMesh() has been deprecated in favour of 'origin'.",{version:"4.34",replacement:"origin",warnOnce:!0});const r=e=>{throw l.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new a("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce((e,t)=>re(this.infoFor3D,t)?e+1:e,0);0===s&&r(new I),s>1&&r(new j);const n=this.spatialReference,p=t.origin??t.location,d=p??t.defaultOrigin??new b({x:0,y:0,z:0,spatialReference:n}),y=d.spatialReference.isGeographic?"local":"georeferenced",{default:u}=await import("../geometry/Mesh.js"),c=u.createWithExternalSource(d,{type:"client",files:i},{vertexSpace:y,transform:le(d.spatialReference),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!p});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await we(e)).filter(e=>ie(t,e))}validateLayer(e){if(e.layerType&&!Se.has(e.layerType))throw new a("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new a("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new a("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new a("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new a("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),r=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled","attributeTableTemplate"],t=m(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(2===o||3===o)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!U(this.associatedLayer?.url)||!ye(this))return;m(this).setAtOrigin("fullExtent",e.clone(),2)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await R(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await ne.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){u(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){const e=new AbortController;this.addHandles(n(e));try{await h(()=>this.popupEnabled&&null!=this.popupTemplate,e.signal)}catch(r){return void c(r)}const t=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?l.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):l.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&me(l.getLogger(this),ge("Mesh scene layers","relative-to-scene",e)),me(l.getLogger(this),ve("Scene layers",e))}async fetchStatistics(e,t){return await ue({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([f({types:{key:"type",base:H,typeMap:{selection:z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:{allowNull:!0}},"portal-item":{name:"layerDefinition.featureReduction",write:{allowNull:!0}}}}})],_e.prototype,"featureReduction",void 0),e([f({type:[pe],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}},clonable:!1})],_e.prototype,"rangeInfos",void 0),e([f({json:{read:!1}})],_e.prototype,"associatedLayer",void 0),e([f({type:["show","hide"]})],_e.prototype,"listMode",void 0),e([f({type:["ArcGISSceneServiceLayer"]})],_e.prototype,"operationalLayerType",void 0),e([f({json:{read:!1},readOnly:!0})],_e.prototype,"type",void 0),e([f({...Oe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"fields",void 0),e([f()],_e.prototype,"types",null),e([f()],_e.prototype,"typeIdField",null),e([f()],_e.prototype,"templates",null),e([f()],_e.prototype,"formTemplate",null),e([f({readOnly:!0})],_e.prototype,"graphicOrigin",void 0),e([f({readOnly:!0,clonable:!1})],_e.prototype,"fieldsIndex",null),e([f({type:ae,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],_e.prototype,"floorInfo",void 0),e([f(Oe.outFields)],_e.prototype,"outFields",void 0),e([f({type:X,readOnly:!0,json:{read:!1},clonable:!1})],_e.prototype,"nodePages",void 0),e([g("service","nodePages",["nodePages","pointNodePages"])],_e.prototype,"readNodePages",null),e([f({type:[Y],readOnly:!0,clonable:!1})],_e.prototype,"materialDefinitions",void 0),e([f({type:[ee],readOnly:!0,clonable:!1})],_e.prototype,"textureSetDefinitions",void 0),e([f({type:[te],readOnly:!0,clonable:!1})],_e.prototype,"geometryDefinitions",void 0),e([f({readOnly:!0})],_e.prototype,"serviceUpdateTimeStamp",void 0),e([f({readOnly:!0})],_e.prototype,"attributeStorageInfo",void 0),e([f({readOnly:!0})],_e.prototype,"statisticsInfo",void 0),e([f({type:s.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],_e.prototype,"excludeObjectIds",void 0),e([f({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_e.prototype,"definitionExpression",void 0),e([f({type:de,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],_e.prototype,"filter",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],_e.prototype,"path",void 0),e([f(C)],_e.prototype,"elevationInfo",null),e([f({readOnly:!0,json:{read:!1}})],_e.prototype,"effectiveCapabilities",null),e([f({readOnly:!0})],_e.prototype,"effectiveEditingEnabled",null),e([f({type:String})],_e.prototype,"geometryType",null),e([f(G)],_e.prototype,"labelsVisible",void 0),e([f({type:[se],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:oe},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:oe},write:!0}})],_e.prototype,"labelingInfo",void 0),e([f(N)],_e.prototype,"legendEnabled",void 0),e([f({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?Fe(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],_e.prototype,"opacity",void 0),e([f({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"priority",void 0),e([f({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"semantic",void 0),e([f({types:he,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],_e.prototype,"renderer",null),e([f({json:{read:!1}})],_e.prototype,"cachedDrawingInfo",void 0),e([g("service","cachedDrawingInfo")],_e.prototype,"readCachedDrawingInfo",null),e([f({readOnly:!0,json:{read:!1}})],_e.prototype,"capabilities",null),e([f({type:Boolean,json:{read:!1}})],_e.prototype,"editingEnabled",null),e([f({readOnly:!0,json:{write:!1,read:!1}})],_e.prototype,"infoFor3D",null),e([f({readOnly:!0,json:{write:!1,read:!1}})],_e.prototype,"relationships",null),e([f(Q)],_e.prototype,"popupEnabled",void 0),e([f({type:r,json:{name:"popupInfo",write:!0}})],_e.prototype,"popupTemplate",void 0),e([f({readOnly:!0,json:{read:!1}})],_e.prototype,"defaultPopupTemplate",null),e([f(V)],_e.prototype,"attributeTableTemplate",void 0),e([f({type:String,json:{read:!1}})],_e.prototype,"objectIdField",void 0),e([g("service","objectIdField",["objectIdField","fields"])],_e.prototype,"readObjectIdField",null),e([f({type:String,json:{read:!1}})],_e.prototype,"globalIdField",void 0),e([g("service","globalIdField",["globalIdField","fields"])],_e.prototype,"readGlobalIdField",null),e([f({readOnly:!0,type:String,json:{read:!1}})],_e.prototype,"displayField",null),e([f({type:String,json:{read:!1}})],_e.prototype,"profile",void 0),e([g("service","profile",["store.profile"])],_e.prototype,"readProfile",null),e([f({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],_e.prototype,"normalReferenceFrame",void 0),e([f(M)],_e.prototype,"screenSizePerspectiveEnabled",void 0),e([f({json:{read:!1,origins:{service:{read:!0}}}})],_e.prototype,"serviceItemId",void 0),e([f(E)],_e.prototype,"useViewTime",null),_e=e([v("esri.layers.SceneLayer")],_e);const Pe={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Te={"mesh-pyramids":"mesh",points:"point"},Ae=_e;export{Ae as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import l from"../../geometry/Polygon.js";import{initializeProjection as m,project as h}from"../../geometry/projectionUtils.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as T}from"./supportUtils.js";import{executeQueryStreaming as I}from"../../rest/knowledgeGraphService.js";import M from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import D from"../../rest/support/Query.js";let E=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach(e=>{o(this.memberIdTypeLookup,e.id,()=>new Set).add(s)}),this.sublayerCaches.set(s,a)})}addToLayer(e){e.forEach(({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}})}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new D({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach(i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)}),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[l,m]of s){const e=`${l}_ids`;a[e]=m,t&&0!==t?.length?r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await I(this.knowledgeGraph,new M({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,l]of n.entries()){const e=`${d}_ids`;o[e]=l,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await I(this.knowledgeGraph,new M({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[m,h]of o.entries()){const e=`${m}_ids`;s[e]=h,a.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await I(this.knowledgeGraph,new M({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const l=[];for(const[m,h]of p)for(const e of h)l.push({id:e,typeName:m});return l}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],l=new Map,m=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&m.set(e.name,e)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&m.set(e.name,e)}),e||this.inclusionModeDefinition?e?e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))l.has(t)?l.get(t)?.push(e):l.set(t,[e])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e.useAllData?l.set(t,null):e.members&&e.members.forEach(e=>{l.has(t)&&null!==l.get(t)?l.get(t)?.push(e.id):l.set(t,[e.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,null)}));for(const[s,h]of l){const e=new Set(h),l=new Promise((d,l)=>{const c=async()=>{const d=new Set,l=[];let c,u="",f=!1;if(t||m.get(s)?.properties?.forEach(e=>{e.name&&d.add(e.name)}),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach(e=>{u+=`, n.${e}`,l.push(e)});else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach(e=>{u+=`, n.${e}`,l.push(e)})}c=new M(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await I(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,()=>new Set).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,()=>new Set).add(p.id),o(this.relationshipConnectionsLookup,p.id,()=>[p.originId,p.destinationId]));a<t.length;a++)p.properties[l[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach(e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],()=>new Set).add(s))})}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then(()=>{d(null)}).catch(e=>{"AbortError"===e.name?d(null):l(e)})});d.push(l),this._processingCacheUpdatesLookup.get(s)?.push(l)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map(e=>e.id));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)});t.forEach(e=>{this.sublayerCaches.get(e)?.forEach((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)})})}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,D=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let E=!b&&D?Array.from(D).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(E=e.objectIds);else if(null!=e.objectIds&&E&&E.length>0){const t=e.objectIds;e.objectIds=E.filter(e=>t.includes(e))}else if(null!=e.objectIds)E=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=E}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach(e=>{s.add(e.name)}):i.forEach(e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)})}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let w=b?.geometryMaxBoundingRectangleSizeX,I=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await m(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await m(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(w&&I&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:w,ymax:I}),t=h(e,c);w=t.xmax,I=t.ymax}if(o.xmax-o.xmin>w)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${w}° latitude, limit exceeded`);if(o.ymax-o.ymin>I)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${I}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(e=>{i.fieldNames.includes(e.name)&&s.add(e.name)})}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{u+=`, n.${e}`,r.push(e)}),p=new M({openCypherQuery:u,bindParameters:{param_filter_geom:new l({rings:T(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach(e=>{n.fieldNames.includes(e.name)&&s.add(e.name)});const o=new Set(["column-reference","string","number","binary-expression"]),r=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let p=!1;const d=e=>{if("column-reference"===e.type)return`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&o.has(e.left.type)&&o.has(e.right.type)&&r.has(e.operator))return`${d(e.left)} ${e.operator} ${d(e.right)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let t="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return p=!0,"";t+=`lower(n.${e.left.column})`}if(t+=" CONTAINS (","string"!==e.right.type)return p=!0,"";{let i=e.right.value;i.startsWith("%")&&(i=i.slice(1)),i.endsWith("%")&&(i=i.slice(0,-1)),t+=`'${i.toLowerCase()}')`}return t}return p=!0,""};i=d(n.parseTree),p&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;E&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{n+=`, n.${e}`,r.push(e)}),p=new M(E?{openCypherQuery:n,bindParameters:{ids:E}}:{openCypherQuery:n})}const N=(await I(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await N.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}}),t}};e([r()],E.prototype,"knowledgeGraph",void 0),e([r()],E.prototype,"inclusionModeDefinition",void 0),e([r()],E.prototype,"entityTypeNames",void 0),e([r()],E.prototype,"relationshipTypeNames",void 0),e([r()],E.prototype,"geographicLookup",void 0),e([r()],E.prototype,"sublayerCaches",void 0),e([r()],E.prototype,"nodeConnectionsLookup",void 0),e([r()],E.prototype,"relationshipConnectionsLookup",void 0),e([r()],E.prototype,"memberIdTypeLookup",void 0),E=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],E);export{E as KnowledgeGraphLayerDataManager};
5
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import m from"../../geometry/Polygon.js";import{initializeProjection as l,project as h}from"../../geometry/projectionUtils.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import{recursiveParseSqlToCypher as T}from"./cypherUtils.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as I}from"./supportUtils.js";import{executeQueryStreaming as M}from"../../rest/knowledgeGraphService.js";import D from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import E from"../../rest/support/Query.js";let N=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach(e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach(e=>{o(this.memberIdTypeLookup,e.id,()=>new Set).add(s)}),this.sublayerCaches.set(s,a)})}addToLayer(e){e.forEach(({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,()=>new Set).add(e)}})}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new E({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach(i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)}),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[m,l]of s){const e=`${m}_ids`;a[e]=l,t&&0!==t?.length?r.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await M(this.knowledgeGraph,new D({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,m]of n.entries()){const e=`${d}_ids`;o[e]=m,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await M(this.knowledgeGraph,new D({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[l,h]of o.entries()){const e=`${l}_ids`;s[e]=h,a.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await M(this.knowledgeGraph,new D({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const m=[];for(const[l,h]of p)for(const e of h)m.push({id:e,typeName:l});return m}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],m=new Map,l=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&l.set(e.name,e)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&l.set(e.name,e)}),e||this.inclusionModeDefinition?e?e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))m.has(t)?m.get(t)?.push(e):m.set(t,[e])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e.useAllData?m.set(t,null):e.members&&e.members.forEach(e=>{m.has(t)&&null!==m.get(t)?m.get(t)?.push(e.id):m.set(t,[e.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&m.set(e.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&m.set(e.name,null)}));for(const[s,h]of m){const e=new Set(h),m=new Promise((d,m)=>{const c=async()=>{const d=new Set,m=[];let c,u="",f=!1;if(t||l.get(s)?.properties?.forEach(e=>{e.name&&d.add(e.name)}),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach(e=>{u+=`, n.${e}`,m.push(e)});else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach(e=>{u+=`, n.${e}`,m.push(e)})}c=new D(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await M(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,()=>new Set).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,()=>new Set).add(p.id),o(this.relationshipConnectionsLookup,p.id,()=>[p.originId,p.destinationId]));a<t.length;a++)p.properties[m[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach(e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],()=>new Set).add(s))})}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then(()=>{d(null)}).catch(e=>{"AbortError"===e.name?d(null):m(e)})});d.push(m),this._processingCacheUpdatesLookup.get(s)?.push(m)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map(e=>e.id));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)});t.forEach(e=>{this.sublayerCaches.get(e)?.forEach((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)})})}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,E=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let N=!b&&E?Array.from(E).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(N=e.objectIds);else if(null!=e.objectIds&&N&&N.length>0){const t=e.objectIds;e.objectIds=N.filter(e=>t.includes(e))}else if(null!=e.objectIds)N=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=N}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach(e=>{s.add(e.name)}):i.forEach(e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)})}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let T=b?.geometryMaxBoundingRectangleSizeX,w=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await l(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await l(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(T&&w&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:T,ymax:w}),t=h(e,c);T=t.xmax,w=t.ymax}if(o.xmax-o.xmin>T)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${T}° latitude, limit exceeded`);if(o.ymax-o.ymin>w)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${w}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(e=>{i.fieldNames.includes(e.name)&&s.add(e.name)})}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{u+=`, n.${e}`,r.push(e)}),p=new D({openCypherQuery:u,bindParameters:{param_filter_geom:new m({rings:I(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach(e=>{n.fieldNames.includes(e.name)&&s.add(e.name)});const o={systemOidFieldName:y,supportedSqlTypes:new Set(["column-reference","string","number","binary-expression"]),supportedSqlOperators:new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]),unsupportedOperationFound:!1};i=T(n.parseTree,o),o.unsupportedOperationFound&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;N&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach(e=>{n+=`, n.${e}`,r.push(e)}),p=new D(N?{openCypherQuery:n,bindParameters:{ids:N}}:{openCypherQuery:n})}const k=(await M(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await k.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach(e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}}),t}};e([r()],N.prototype,"knowledgeGraph",void 0),e([r()],N.prototype,"inclusionModeDefinition",void 0),e([r()],N.prototype,"entityTypeNames",void 0),e([r()],N.prototype,"relationshipTypeNames",void 0),e([r()],N.prototype,"geographicLookup",void 0),e([r()],N.prototype,"sublayerCaches",void 0),e([r()],N.prototype,"nodeConnectionsLookup",void 0),e([r()],N.prototype,"relationshipConnectionsLookup",void 0),e([r()],N.prototype,"memberIdTypeLookup",void 0),N=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],N);export{N as KnowledgeGraphLayerDataManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- async function r(r){const{CharStream:e,CommonTokenStream:a,ParseTreeWalker:t}=await import("../../chunks/antlr4.web.js"),{default:n}=await import("./antlr/BindParamsListener.js"),{default:s}=await import("../../chunks/CypherLexer.js"),{default:o}=await import("../../chunks/CypherParser.js"),{default:i}=await import("./antlr/SimpleErrorListener.js"),m=new i,w=new s(new e(r));w.removeErrorListeners(),w.addErrorListener(m);const p=new o(new a(w));p.removeErrorListeners(),p.addErrorListener(m);const d=p.oC_Cypher(),l=new n;return(new t).walk(l,d),{bindParameters:Array.from(new Set(l.bindParams)).map(r=>r.slice(1)),parseErrors:m.errors}}export{r as getBindParametersFromCypherQuery};
5
+ async function e(e){const{CharStream:r,CommonTokenStream:t,ParseTreeWalker:n}=await import("../../chunks/antlr4.web.js"),{default:s}=await import("./antlr/BindParamsListener.js"),{default:a}=await import("../../chunks/CypherLexer.js"),{default:o}=await import("../../chunks/CypherParser.js"),{default:i}=await import("./antlr/SimpleErrorListener.js"),p=new i,u=new a(new r(e));u.removeErrorListeners(),u.addErrorListener(p);const l=new o(new t(u));l.removeErrorListeners(),l.addErrorListener(p);const m=l.oC_Cypher(),f=new s;return(new n).walk(f,m),{bindParameters:Array.from(new Set(f.bindParams)).map(e=>e.slice(1)),parseErrors:p.errors}}const r=(e,t)=>{if("column-reference"===e.type)return e.column===t.systemOidFieldName?"ID(n)":`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&t.supportedSqlTypes.has(e.left.type)&&t.supportedSqlTypes.has(e.right.type)&&t.supportedSqlOperators.has(e.operator))return`${r(e.left,t)} ${e.operator} ${r(e.right,t)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let r="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)r+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return t.unsupportedOperationFound=!0,"";r+=`lower(n.${e.left.column})`}if(r+=" CONTAINS (","string"!==e.right.type)return t.unsupportedOperationFound=!0,"";{let t=e.right.value;t.startsWith("%")&&(t=t.slice(1)),t.endsWith("%")&&(t=t.slice(0,-1)),r+=`'${t.toLowerCase()}')`}return r}return t.unsupportedOperationFound=!0,""};export{e as getBindParametersFromCypherQuery,r as recursiveParseSqlToCypher};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";function i(e){return b(e)||y(e)}function u(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}function s(e){return null!=e&&"object"==typeof e&&"type"in e&&"graphics"===e.type}function o(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-image"===e.type}function a(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-notes"===e.type&&"sublayers"in e}function c(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph"===e.type&&"layers"in e}function l(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph-sublayer"===e.type}function f(e){return null!=e&&"object"==typeof e&&"type"in e&&"link-chart"===e.type&&"layers"in e}function y(e){return"scene"===e?.type}function p(e){return null!=e&&"object"==typeof e&&"type"in e&&"subtype-group"===e.type&&"sublayers"in e}function g(e){return"subtype-sublayer"===e?.type}function b(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function d(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function m(e){return null!=e&&"type"in e&&"group"===e.type}const h={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function j(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function v(e){return"IntegratedMeshLayer"===e||"IntegratedMesh3DTilesLayer"===e}function w(e){return"integrated-mesh"===e||"integrated-mesh-3dtiles"===e}function L(e){return"integrated-mesh-3dtiles"===e}function S(e){return"voxel"===e?.type}function E(e){return"imagery-tile"===e?.type}function C(e,t){return null!=e?.parent&&"declaredClass"in e.parent&&"esri.Basemap"===e.parent.declaredClass&&e.parent[t].includes(e)}function M(e){return C(e,"baseLayers")}function k(e){return C(e,"referenceLayers")}function x(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function I(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function T(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function U(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function O(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function B(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function P(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const s=`${n.slice(0,u)}/rest/info`,o=null!=r?r.signal:null,{data:a}=await t(s,{query:{f:"json"},responseType:"json",signal:o});return a?.owningSystemUrl||null}function q(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function D(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function J(e){return q(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function N(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function F(e){return!!N(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function V(e){if(!e)return[];return("subtypes"in e?e.subtypes:p(e.parent)?e.parent.subtypes:[])??[]}function $(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function z(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))"csv"===n.type||r(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function A(e,t){return null}function G(e){return null}function H(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function K(e,t){if(!t||!H(e))return;const n=A(e.url);n&&(e.url=n)}export{K as applyPreferredHostToPortalItem,F as getEffectiveEditingEnabled,J as getEffectiveLayerCapabilities,z as getLayersWithChartSupport,P as getOwningPortalUrl,G as getPreferredHost,A as getPreferredUrl,V as getSubtypesFromLayer,B as getTileMaxtrixSetFromActiveLayer,M as isBaseLayer,i as isBasemap3DSupportedLayer,b as isBasemapSupportedTiledLayer,x as isFeatureCollectionLayer,u as isFeatureLayer,T as isFeatureServiceLayer,s as isGraphicsLayer,m as isGroupLayer,E as isImageryTileLayer,L as isIntegratedMesh3DTilesLayer,w as isIntegratedMeshLayer,v as isIntegratedMeshOperationalLayer,c as isKnowledgeGraphLayer,l as isKnowledgeGraphSublayer,q as isLayerWithFeatureCapabilities,I as isLayerWithFeatureLayerSource,$ as isLayerWithFlowRenderer,f as isLinkChartLayer,o as isMapImageLayer,a as isMapNotesLayer,H as isPreferredUrlApplicable,k as isReferenceLayer,y as isSceneLayer,j as isSceneServiceLayer,p as isSubtypeGroupLayer,g as isSubtypeSublayer,D as isTable,d as isTiledLayer,S as isVoxelLayer,h as sceneServiceLayerTypeToClassName,U as serializeLayerDefinitions,O as serializeTimeOptions};
5
+ import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";import{isBasemap as i}from"../../support/userTypeGuards/isBasemap.js";function u(e){return d(e)||y(e)}function o(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}function s(e){return null!=e&&"object"==typeof e&&"type"in e&&"graphics"===e.type}function c(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-image"===e.type}function a(e){return null!=e&&"object"==typeof e&&"type"in e&&"map-notes"===e.type&&"sublayers"in e}function l(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph"===e.type&&"layers"in e}function f(e){return null!=e&&"object"==typeof e&&"type"in e&&"knowledge-graph-sublayer"===e.type}function p(e){return null!=e&&"object"==typeof e&&"type"in e&&"link-chart"===e.type&&"layers"in e}function y(e){return"scene"===e?.type}function g(e){return null!=e&&"object"==typeof e&&"type"in e&&"subtype-group"===e.type&&"sublayers"in e}function b(e){return"subtype-sublayer"===e?.type}function d(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function m(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function h(e){return null!=e&&"type"in e&&"group"===e.type}const j={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function v(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function w(e){return"IntegratedMeshLayer"===e||"IntegratedMesh3DTilesLayer"===e}function L(e){return"integrated-mesh"===e||"integrated-mesh-3dtiles"===e}function S(e){return"integrated-mesh-3dtiles"===e}function E(e){return"voxel"===e?.type}function C(e){return"imagery-tile"===e?.type}function M(e,t){return i(e?.parent)&&e.parent[t].includes(e)}function T(e){return M(e,"baseLayers")}function k(e){return M(e,"referenceLayers")}function x(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function I(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function U(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function O(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function B(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function P(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function q(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const o=`${n.slice(0,u)}/rest/info`,s=null!=r?r.signal:null,{data:c}=await t(o,{query:{f:"json"},responseType:"json",signal:s});return c?.owningSystemUrl||null}function D(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function J(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function N(e){return D(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function F(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function G(e){return!!F(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function V(e){if(!e)return[];return("subtypes"in e?e.subtypes:g(e.parent)?e.parent.subtypes:[])??[]}function $(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function z(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))"csv"===n.type||r(n)||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function A(e,t){return null}function H(e){return null}function K(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function Q(e,t){if(!t||!K(e))return;const n=A(e.url);n&&(e.url=n)}export{Q as applyPreferredHostToPortalItem,G as getEffectiveEditingEnabled,N as getEffectiveLayerCapabilities,z as getLayersWithChartSupport,q as getOwningPortalUrl,H as getPreferredHost,A as getPreferredUrl,V as getSubtypesFromLayer,P as getTileMaxtrixSetFromActiveLayer,T as isBaseLayer,u as isBasemap3DSupportedLayer,d as isBasemapSupportedTiledLayer,x as isFeatureCollectionLayer,o as isFeatureLayer,U as isFeatureServiceLayer,s as isGraphicsLayer,h as isGroupLayer,C as isImageryTileLayer,S as isIntegratedMesh3DTilesLayer,L as isIntegratedMeshLayer,w as isIntegratedMeshOperationalLayer,l as isKnowledgeGraphLayer,f as isKnowledgeGraphSublayer,D as isLayerWithFeatureCapabilities,I as isLayerWithFeatureLayerSource,$ as isLayerWithFlowRenderer,p as isLinkChartLayer,c as isMapImageLayer,a as isMapNotesLayer,K as isPreferredUrlApplicable,k as isReferenceLayer,y as isSceneLayer,v as isSceneServiceLayer,g as isSubtypeGroupLayer,b as isSubtypeSublayer,J as isTable,m as isTiledLayer,E as isVoxelLayer,j as sceneServiceLayerTypeToClassName,O as serializeLayerDefinitions,B as serializeTimeOptions};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.34.0-next.85",
3
+ "version": "4.34.0-next.86",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -18,13 +18,13 @@
18
18
  ],
19
19
  "license": "SEE LICENSE IN copyright.txt",
20
20
  "dependencies": {
21
- "@arcgis/toolkit": "^4.34.0-next.125",
21
+ "@arcgis/toolkit": "^4.34.0-next.132",
22
22
  "@esri/arcgis-html-sanitizer": "~4.1.0",
23
23
  "@esri/calcite-components": "^3.3.0-next.95",
24
- "@vaadin/grid": "~24.8.7",
25
- "@zip.js/zip.js": "~2.8.1",
24
+ "@vaadin/grid": "~24.9.0",
25
+ "@zip.js/zip.js": "~2.8.2",
26
26
  "luxon": "~3.7.2",
27
- "marked": "~16.2.1",
27
+ "marked": "~16.3.0",
28
28
  "tslib": "^2.8.1"
29
29
  },
30
30
  "type": "module"
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../Basemap.js";import r from"../core/Collection.js";import s from"../core/Logger.js";import{destroyMaybe as o}from"../core/maybe.js";import{ensureType as n}from"../core/accessorSupport/ensureType.js";import{hasBasemapStylesApiKey as t}from"./apiKeyUtils.js";import{esriBasemapDefinitions as i}from"./basemapDefinitions.js";import{layerDefinitionEquals as a,layerToDefinition as c}from"./basemapUtils.js";const f=()=>s.getLogger("esri.support.basemapUtils");function p(){return{}}function l(e){for(const r in e){const s=e[r];o(s),delete e[r]}}function m(r,s){let o;if("string"==typeof r){const n=r in i,a=!n&&r.includes("/");if(!n&&!a){if(t())f().warn(`Unable to find basemap definition for: ${r}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const e=Object.entries(i).filter(([e,r])=>r.classic||r.is3d).map(([e])=>`"${e}"`).sort().join(", ");f().warn(`Unable to find basemap definition for: ${r}. Try one of these: ${e}`)}return null}s&&(o=s[r]),o||(o=n?e.fromId(r):new e({style:{id:r}}),s&&(s[r]=o))}else o=n(e,r);return o?.destroyed&&(f().warn("The provided basemap is already destroyed",{basemap:o}),o=null),o}function u(e,r=null){const s=m(e);if(!s)return null;const o=s.clone();return r&&(o.baseLayers=d(o.baseLayers,r.baseLayers),o.referenceLayers=d(o.referenceLayers,r.referenceLayers)),o}function d(e,s){const o=new r;return e.forEach(e=>{const r=s.find(r=>"scene"!==r.type&&a(c(e),c(r)))||e;o.includes(r)?o.push(e):o.push(r)}),o}export{m as basemapEnsureType,u as clonePreservingTiledLayers,p as createCache,l as destroyCache};
5
+ import e from"../Basemap.js";import r from"../core/Collection.js";import s from"../core/Logger.js";import{ensureType as o}from"../core/accessorSupport/ensureType.js";import{hasBasemapStylesApiKey as t}from"./apiKeyUtils.js";import{esriBasemapDefinitions as n}from"./basemapDefinitions.js";import{layerDefinitionEquals as i,layerToDefinition as a}from"./basemapUtils.js";const c=()=>s.getLogger("esri.support.basemapUtils");function f(){return{}}function l(e){for(const r in e){const s=e[r];s?.destroyed||s.destroy(),delete e[r]}}function p(r,s){let i;if("string"==typeof r){const o=r in n,a=!o&&r.includes("/");if(!o&&!a){if(t())c().warn(`Unable to find basemap definition for: ${r}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const e=Object.entries(n).filter(([e,r])=>r.classic||r.is3d).map(([e])=>`"${e}"`).sort().join(", ");c().warn(`Unable to find basemap definition for: ${r}. Try one of these: ${e}`)}return null}s&&(i=s[r]),i||(i=o?e.fromId(r):new e({style:{id:r}}),s&&(s[r]=i))}else i=o(e,r);return i?.destroyed&&(c().warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function m(e,r=null){const s=p(e);if(!s)return null;const o=s.clone();return r&&(o.baseLayers=d(o.baseLayers,r.baseLayers),o.referenceLayers=d(o.referenceLayers,r.referenceLayers)),o}function d(e,s){const o=new r;return e.forEach(e=>{const r=s.find(r=>"scene"!==r.type&&i(a(e),a(r)))||e;o.includes(r)?o.push(e):o.push(r)}),o}export{p as basemapEnsureType,m as clonePreservingTiledLayers,f as createCache,l as destroyCache};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const a="20250915",e="0206e15379bec981a2260525342f8a8416ab571f";export{a as buildDate,e as commitHash};
5
+ const c="20250916",d="13c8d40014c08b43e67dfa84b31c39857d2d64c0";export{c as buildDate,d as commitHash};