@arcgis/core 4.27.0-next.20230321 → 4.27.0-next.20230322

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 (136) hide show
  1. package/analysis/LineOfSightAnalysisObserver.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/02b6227c156ee0d8eb66.js +1 -0
  4. package/assets/esri/core/workers/chunks/{7e0c65aa61c2ff0c3504.js → 1c98b92933a48cf96c1e.js} +1 -1
  5. package/assets/esri/core/workers/chunks/321f272d4c7ed6b0cb46.js +1 -0
  6. package/assets/esri/core/workers/chunks/47bd558e2ce89f47f908.js +1 -0
  7. package/assets/esri/core/workers/chunks/76d6c1fc25f02bcf258e.js +1 -0
  8. package/assets/esri/core/workers/chunks/{c5d872adce711ec61ede.js → 8980c5dc389c27368b73.js} +1 -1
  9. package/assets/esri/core/workers/chunks/8d0143c0ff009b98a31f.js +1 -0
  10. package/assets/esri/core/workers/chunks/{6acaf28cba5d49a98fb6.js → 91b292f310f06a0cbf72.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{ff9efa829497557ec26a.js → aa4640a0207e0be224e2.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{92951b85676df776961f.js → ab8139e3a875a8b8dab9.js} +23 -25
  13. package/assets/esri/core/workers/chunks/{c8cd3fde6d8d43ddb954.js → b6cdf4daf07d9e55f61e.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{6b14673a4afd6ef81487.js → c76cabd2d2510a653dff.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{4be7647605300e07e843.js → c90fff7e28ba5b443b11.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{e637e47000f4dc48054d.js → cc7f4fd20443a2acf0f1.js} +1 -1
  17. package/assets/esri/core/workers/chunks/d19e9fab4f4fb765c6a3.js +1 -0
  18. package/assets/esri/core/workers/chunks/d9ef4891c8b0bdd90f5b.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d92d6a43270fb0d366b4.js → de4f5c48efbcee82c3c1.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{32f9b488915a4a8864e5.js → f8b9e0c1671e55b61904.js} +1 -1
  21. package/assets/esri/views/3d/analysis/Slice/images/heading-rotate.ts.svg +7 -28
  22. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.svg +11 -0
  23. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  24. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  25. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  26. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  27. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  28. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  29. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  30. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  31. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  32. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  33. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  34. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  35. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  36. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  37. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  38. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  39. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  40. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  41. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  42. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  43. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  44. package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
  45. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  46. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  47. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  48. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  49. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  50. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  51. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  52. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  53. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  54. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  55. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  56. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  57. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  58. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  59. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  60. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  61. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  62. package/chunks/ComponentShader.glsl.js +1 -1
  63. package/chunks/DefaultMaterial.glsl.js +4 -4
  64. package/chunks/vec42.js +1 -1
  65. package/core/Loadable.js +1 -1
  66. package/core/accessorSupport/Property.js +1 -1
  67. package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
  68. package/geometry/support/buffer/math/vec4.js +1 -1
  69. package/interfaces.d.ts +1 -1
  70. package/layers/LineOfSightLayer.js +1 -1
  71. package/layers/SceneLayer.js +1 -1
  72. package/layers/mixins/ImageryTileMixin.js +1 -1
  73. package/layers/mixins/RefreshableLayer.js +1 -1
  74. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  75. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  76. package/package.json +1 -1
  77. package/support/revision.js +1 -1
  78. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  79. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  80. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  81. package/views/3d/analysis/Slice/images/Factory.js +1 -1
  82. package/views/3d/analysis/Slice/images/generateTextures.js +1 -1
  83. package/views/3d/analysis/Slice/images/heading-rotate-svg.js +1 -1
  84. package/views/3d/analysis/Slice/images/tilt-rotate-svg.js +5 -0
  85. package/views/3d/analysis/Slice/settings.js +5 -0
  86. package/views/3d/environment/Stars.js +1 -1
  87. package/views/3d/interactive/Manipulator3D.js +1 -1
  88. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  89. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  90. package/views/3d/layers/PointCloudWorker.js +1 -1
  91. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  92. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  93. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  94. package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
  95. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  96. package/views/3d/layers/i3s/PointGraphic.js +1 -1
  97. package/views/3d/state/ViewState.js +1 -1
  98. package/views/3d/state/controllers/SurfaceCollisionCorrectionController.js +1 -1
  99. package/views/3d/terrain/GeometryState.js +1 -1
  100. package/views/3d/terrain/PatchGeometry.js +1 -1
  101. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  102. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  103. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  104. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  105. package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +6 -5
  106. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +1 -1
  107. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +11 -11
  108. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +1 -1
  109. package/views/3d/webgl-engine/lib/AnimationTimeStep.js +1 -1
  110. package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
  111. package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
  112. package/views/3d/webgl-engine/lib/Normals.js +5 -0
  113. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  114. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  115. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  116. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  117. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  118. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  119. package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
  120. package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
  121. package/views/LayerViewManager.js +1 -1
  122. package/views/SceneView.js +1 -1
  123. package/views/layers/SceneLayerView.js +1 -1
  124. package/views/webgl/ShaderTranspiler.js +1 -1
  125. package/widgets/Expand.js +1 -1
  126. package/assets/esri/core/workers/chunks/0487ab23a20ec356ab4c.js +0 -1
  127. package/assets/esri/core/workers/chunks/29ee4f14602caf6967e4.js +0 -1
  128. package/assets/esri/core/workers/chunks/2c0775541cfec9d43acb.js +0 -1
  129. package/assets/esri/core/workers/chunks/4879164b48da9ad4547a.js +0 -1
  130. package/assets/esri/core/workers/chunks/69060e5cffc19e76062a.js +0 -1
  131. package/assets/esri/core/workers/chunks/a71a5c8a9aa302bf6f01.js +0 -1
  132. package/assets/esri/core/workers/chunks/bc002e4dff8859571a7a.js +0 -1
  133. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.svg +0 -80
  134. package/assets/esri/views/3d/analysis/Slice/images/tilt-rotate.ts.png +0 -0
  135. package/views/3d/analysis/Slice/images/tilt-rotate-png.js +0 -5
  136. package/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js +0 -8
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as f,BufferViewFloat as o,BufferViewVec4u8 as r,BufferViewVec2f as s,BufferViewVec3f as n}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as i}from"../../lib/Util.js";import{VertexAttribute as l}from"../../lib/VertexAttribute.js";function c(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let l=0;l<i;++l)s[o]=t[e[l]],o+=n;else for(let l=0;l<i;++l){const f=t[e[l]];for(let e=0;e<r;e++)s[o]=f,o+=n}}function d(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=2*e[i];r[o]=t[f],r[o+1]=t[f+1],o+=s}}function u(e,t,f,o,r){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,null==r||1===r)for(let l=0;l<i;++l){const f=3*e[l];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}else for(let l=0;l<i;++l){const f=3*e[l];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}}function a(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let l=0;l<i;++l){const f=4*e[l];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}else for(let l=0;l<i;++l){const f=4*e[l];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}}function p(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride;t*=r;for(let s=0;s<f;++s)o[t]=0,o[t+1]=0,o[t+2]=0,o[t+3]=0,t+=r}function y(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=9*e[i];for(let e=0;e<9;++e)r[o+e]=t[f+e];o+=s}}function B(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=16*e[i];for(let e=0;e<16;++e)r[o+e]=t[f+e];o+=s}}function g(t,f,o,r,s,n=1){if(!o)return void u(t,f,r,s,n);const i=r.typedBuffer,l=r.typedBufferStride,c=t.length,d=o[0],a=o[1],p=o[2],y=o[4],B=o[5],g=o[6],b=o[8],h=o[9],O=o[10],N=o[12],S=o[13],A=o[14];s*=l;let R=0,E=0,L=0;const z=e(o)?e=>{R=f[e]+N,E=f[e+1]+S,L=f[e+2]+A}:e=>{const t=f[e],o=f[e+1],r=f[e+2];R=d*t+y*o+b*r+N,E=a*t+B*o+h*r+S,L=p*t+g*o+O*r+A};if(1===n)for(let e=0;e<c;++e)z(3*t[e]),i[s]=R,i[s+1]=E,i[s+2]=L,s+=l;else for(let e=0;e<c;++e){z(3*t[e]);for(let e=0;e<n;++e)i[s]=R,i[s+1]=E,i[s+2]=L,s+=l}}function b(f,o,r,s,n,i=1){if(!r)return void u(f,o,s,n,i);const l=r,c=s.typedBuffer,d=s.typedBufferStride,a=f.length,p=l[0],y=l[1],B=l[2],g=l[4],b=l[5],h=l[6],O=l[8],N=l[9],S=l[10],A=!t(l),R=1e-6,E=1-R;n*=d;let L=0,z=0,F=0;const v=e(l)?e=>{L=o[e],z=o[e+1],F=o[e+2]}:e=>{const t=o[e],f=o[e+1],r=o[e+2];L=p*t+g*f+O*r,z=y*t+b*f+N*r,F=B*t+h*f+S*r};if(1===i)if(A)for(let e=0;e<a;++e){v(3*f[e]);const t=L*L+z*z+F*F;if(t<E&&t>R){const e=1/Math.sqrt(t);c[n]=L*e,c[n+1]=z*e,c[n+2]=F*e}else c[n]=L,c[n+1]=z,c[n+2]=F;n+=d}else for(let e=0;e<a;++e)v(3*f[e]),c[n]=L,c[n+1]=z,c[n+2]=F,n+=d;else for(let e=0;e<a;++e){if(v(3*f[e]),A){const e=L*L+z*z+F*F;if(e<E&&e>R){const t=1/Math.sqrt(e);L*=t,z*=t,F*=t}}for(let e=0;e<i;++e)c[n]=L,c[n+1]=z,c[n+2]=F,n+=d}}function h(e,f,o,r,s,n=1){if(!o)return void a(e,f,r,s,n);const i=o,l=r.typedBuffer,c=r.typedBufferStride,d=e.length,u=i[0],p=i[1],y=i[2],B=i[4],g=i[5],b=i[6],h=i[8],O=i[9],N=i[10],S=!t(i),A=1e-6,R=1-A;if(s*=c,1===n)for(let t=0;t<d;++t){const o=4*e[t],r=f[o],n=f[o+1],i=f[o+2],d=f[o+3];let a=u*r+B*n+h*i,E=p*r+g*n+O*i,L=y*r+b*n+N*i;if(S){const e=a*a+E*E+L*L;if(e<R&&e>A){const t=1/Math.sqrt(e);a*=t,E*=t,L*=t}}l[s]=a,l[s+1]=E,l[s+2]=L,l[s+3]=d,s+=c}else for(let t=0;t<d;++t){const o=4*e[t],r=f[o],i=f[o+1],d=f[o+2],a=f[o+3];let E=u*r+B*i+h*d,L=p*r+g*i+O*d,z=y*r+b*i+N*d;if(S){const e=E*E+L*L+z*z;if(e<R&&e>A){const t=1/Math.sqrt(e);E*=t,L*=t,z*=t}}for(let e=0;e<n;++e)l[s]=E,l[s+1]=L,l[s+2]=z,l[s+3]=a,s+=c}}function O(e,t,f,o,r,s=1){const n=o.typedBuffer,i=o.typedBufferStride,l=e.length;if(r*=i,f!==t.length||4!==f)if(1!==s)if(4!==f)for(let c=0;c<l;++c){const f=3*e[c];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=255,r+=i}else for(let c=0;c<l;++c){const f=4*e[c];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=t[f+3],r+=i}else{if(4===f){for(let f=0;f<l;++f){const o=4*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=t[o+3],r+=i}return}for(let f=0;f<l;++f){const o=3*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=255,r+=i}}else{n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3];const e=new Uint32Array(o.typedBuffer.buffer,o.start),f=i/4,c=e[r/=4];r+=f;const d=l*s;for(let t=1;t<d;++t)e[r]=c,r+=f}}function N(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length,i=t[0];o*=s;for(let l=0;l<n;++l)r[o]=i,o+=s}function S(e,t,f,o,r=1){const s=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let i=0;i<f;++i)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n;else for(let i=0;i<f;++i)for(let t=0;t<r;++t)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n}function A(e,t,c,u,p,y){for(const B of t.fields.keys()){const t=e.vertexAttributes.get(B),A=e.indices.get(B);if(t&&A)switch(B){case l.POSITION:{i(3===t.size);const e=p.getField(B,n);i(!!e,`No buffer view for ${B}`),e&&g(A,t.data,c,e,y);break}case l.NORMAL:{i(3===t.size);const e=p.getField(B,n);i(!!e,`No buffer view for ${B}`),e&&b(A,t.data,u,e,y);break}case l.UV0:{i(2===t.size);const e=p.getField(B,s);i(!!e,`No buffer view for ${B}`),e&&d(A,t.data,e,y);break}case l.COLOR:case l.SYMBOLCOLOR:{const e=p.getField(B,r);i(!!e,`No buffer view for ${B}`),i(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||O(A,t.data,t.size,e,y);break}case l.COLORFEATUREATTRIBUTE:{const e=p.getField(B,o);i(!!e,`No buffer view for ${B}`),i(1===t.size),e&&1===t.size&&N(A,t.data,e,y);break}case l.TANGENT:{i(4===t.size);const e=p.getField(B,f);i(!!e,`No buffer view for ${B}`),e&&h(A,t.data,u,e,y);break}case l.PROFILERIGHT:case l.PROFILEUP:case l.PROFILEVERTEXANDNORMAL:case l.FEATUREVALUE:{i(4===t.size);const e=p.getField(B,f);i(!!e,`No buffer view for ${B}`),e&&a(A,t.data,e,y)}}else if(B===l.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(l.POSITION);if(i(!!t,`No buffer view for ${B}`),t){const f=t.length,o=p.getField(B,r);S(e.objectAndLayerIdColor,o,f,y)}}}}export{c as writeBufferFloat,y as writeBufferMat3f,B as writeBufferMat4f,d as writeBufferVec2,u as writeBufferVec3,a as writeBufferVec4,p as writeBufferVec4Zeros,O as writeColor,N as writeColorFeatureAttribute,A as writeDefaultAttributes,b as writeNormal,S as writeObjectAndLayerIdColor,g as writePosition,h as writeTangent};
5
+ import{y as e,z as t}from"../../../../../chunks/mat4.js";import{BufferViewVec4f as f,BufferViewFloat as o,BufferViewVec4u8 as r,BufferViewVec2f as s,BufferViewVec2i16 as n,BufferViewVec3f as i}from"../../../../../geometry/support/buffer/BufferView.js";import{assert as c}from"../../lib/Util.js";import{VertexAttribute as l}from"../../lib/VertexAttribute.js";function d(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let c=0;c<i;++c)s[o]=t[e[c]],o+=n;else for(let c=0;c<i;++c){const f=t[e[c]];for(let e=0;e<r;e++)s[o]=f,o+=n}}function u(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=2*e[i];r[o]=t[f],r[o+1]=t[f+1],o+=s}}function a(e,t,f,o,r){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,null==r||1===r)for(let c=0;c<i;++c){const f=3*e[c];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}else for(let c=0;c<i;++c){const f=3*e[c];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],o+=n}}function p(e,t,f,o,r=1){const s=f.typedBuffer,n=f.typedBufferStride,i=e.length;if(o*=n,1===r)for(let c=0;c<i;++c){const f=4*e[c];s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}else for(let c=0;c<i;++c){const f=4*e[c];for(let e=0;e<r;++e)s[o]=t[f],s[o+1]=t[f+1],s[o+2]=t[f+2],s[o+3]=t[f+3],o+=n}}function y(e,t,f){const o=e.typedBuffer,r=e.typedBufferStride;t*=r;for(let s=0;s<f;++s)o[t]=0,o[t+1]=0,o[t+2]=0,o[t+3]=0,t+=r}function B(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=9*e[i];for(let e=0;e<9;++e)r[o+e]=t[f+e];o+=s}}function g(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length;o*=s;for(let i=0;i<n;++i){const f=16*e[i];for(let e=0;e<16;++e)r[o+e]=t[f+e];o+=s}}function b(t,f,o,r,s,n=1){if(!o)return void a(t,f,r,s,n);const i=r.typedBuffer,c=r.typedBufferStride,l=t.length,d=o[0],u=o[1],p=o[2],y=o[4],B=o[5],g=o[6],b=o[8],O=o[9],h=o[10],N=o[12],S=o[13],R=o[14];s*=c;let A=0,E=0,L=0;const z=e(o)?e=>{A=f[e]+N,E=f[e+1]+S,L=f[e+2]+R}:e=>{const t=f[e],o=f[e+1],r=f[e+2];A=d*t+y*o+b*r+N,E=u*t+B*o+O*r+S,L=p*t+g*o+h*r+R};if(1===n)for(let e=0;e<l;++e)z(3*t[e]),i[s]=A,i[s+1]=E,i[s+2]=L,s+=c;else for(let e=0;e<l;++e){z(3*t[e]);for(let e=0;e<n;++e)i[s]=A,i[s+1]=E,i[s+2]=L,s+=c}}function O(f,o,r,s,n,i=1){if(!r)return void a(f,o,s,n,i);const c=r,l=s.typedBuffer,d=s.typedBufferStride,u=f.length,p=c[0],y=c[1],B=c[2],g=c[4],b=c[5],O=c[6],h=c[8],N=c[9],S=c[10],R=!t(c),A=1e-6,E=1-A;n*=d;let L=0,z=0,F=0;const v=e(c)?e=>{L=o[e],z=o[e+1],F=o[e+2]}:e=>{const t=o[e],f=o[e+1],r=o[e+2];L=p*t+g*f+h*r,z=y*t+b*f+N*r,F=B*t+O*f+S*r};if(1===i)if(R)for(let e=0;e<u;++e){v(3*f[e]);const t=L*L+z*z+F*F;if(t<E&&t>A){const e=1/Math.sqrt(t);l[n]=L*e,l[n+1]=z*e,l[n+2]=F*e}else l[n]=L,l[n+1]=z,l[n+2]=F;n+=d}else for(let e=0;e<u;++e)v(3*f[e]),l[n]=L,l[n+1]=z,l[n+2]=F,n+=d;else for(let e=0;e<u;++e){if(v(3*f[e]),R){const e=L*L+z*z+F*F;if(e<E&&e>A){const t=1/Math.sqrt(e);L*=t,z*=t,F*=t}}for(let e=0;e<i;++e)l[n]=L,l[n+1]=z,l[n+2]=F,n+=d}}function h(e,f,o,r,s,n=1){if(!o)return void p(e,f,r,s,n);const i=o,c=r.typedBuffer,l=r.typedBufferStride,d=e.length,u=i[0],a=i[1],y=i[2],B=i[4],g=i[5],b=i[6],O=i[8],h=i[9],N=i[10],S=!t(i),R=1e-6,A=1-R;if(s*=l,1===n)for(let t=0;t<d;++t){const o=4*e[t],r=f[o],n=f[o+1],i=f[o+2],d=f[o+3];let p=u*r+B*n+O*i,E=a*r+g*n+h*i,L=y*r+b*n+N*i;if(S){const e=p*p+E*E+L*L;if(e<A&&e>R){const t=1/Math.sqrt(e);p*=t,E*=t,L*=t}}c[s]=p,c[s+1]=E,c[s+2]=L,c[s+3]=d,s+=l}else for(let t=0;t<d;++t){const o=4*e[t],r=f[o],i=f[o+1],d=f[o+2],p=f[o+3];let E=u*r+B*i+O*d,L=a*r+g*i+h*d,z=y*r+b*i+N*d;if(S){const e=E*E+L*L+z*z;if(e<A&&e>R){const t=1/Math.sqrt(e);E*=t,L*=t,z*=t}}for(let e=0;e<n;++e)c[s]=E,c[s+1]=L,c[s+2]=z,c[s+3]=p,s+=l}}function N(e,t,f,o,r,s=1){const n=o.typedBuffer,i=o.typedBufferStride,c=e.length;if(r*=i,f!==t.length||4!==f)if(1!==s)if(4!==f)for(let l=0;l<c;++l){const f=3*e[l];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=255,r+=i}else for(let l=0;l<c;++l){const f=4*e[l];for(let e=0;e<s;++e)n[r]=t[f],n[r+1]=t[f+1],n[r+2]=t[f+2],n[r+3]=t[f+3],r+=i}else{if(4===f){for(let f=0;f<c;++f){const o=4*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=t[o+3],r+=i}return}for(let f=0;f<c;++f){const o=3*e[f];n[r]=t[o],n[r+1]=t[o+1],n[r+2]=t[o+2],n[r+3]=255,r+=i}}else{n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3];const e=new Uint32Array(o.typedBuffer.buffer,o.start),f=i/4,l=e[r/=4];r+=f;const d=c*s;for(let t=1;t<d;++t)e[r]=l,r+=f}}function S(e,t,f,o){const r=f.typedBuffer,s=f.typedBufferStride,n=e.length,i=t[0];o*=s;for(let c=0;c<n;++c)r[o]=i,o+=s}function R(e,t,f,o,r=1){const s=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===r)for(let i=0;i<f;++i)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n;else for(let i=0;i<f;++i)for(let t=0;t<r;++t)s[o]=e[0],s[o+1]=e[1],s[o+2]=e[2],s[o+3]=e[3],o+=n}function A(e,t,d,a,y,B){for(const g of t.fields.keys()){const t=e.vertexAttributes.get(g),A=e.indices.get(g);if(t&&A)switch(g){case l.POSITION:{c(3===t.size);const e=y.getField(g,i);c(!!e,`No buffer view for ${g}`),e&&b(A,t.data,d,e,B);break}case l.NORMAL:{c(3===t.size);const e=y.getField(g,i);c(!!e,`No buffer view for ${g}`),e&&O(A,t.data,a,e,B);break}case l.NORMALCOMPRESSED:{c(2===t.size);const e=y.getField(g,n);c(!!e,`No buffer view for ${g}`),e&&u(A,t.data,e,B);break}case l.UV0:{c(2===t.size);const e=y.getField(g,s);c(!!e,`No buffer view for ${g}`),e&&u(A,t.data,e,B);break}case l.COLOR:case l.SYMBOLCOLOR:{const e=y.getField(g,r);c(!!e,`No buffer view for ${g}`),c(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||N(A,t.data,t.size,e,B);break}case l.COLORFEATUREATTRIBUTE:{const e=y.getField(g,o);c(!!e,`No buffer view for ${g}`),c(1===t.size),e&&1===t.size&&S(A,t.data,e,B);break}case l.TANGENT:{c(4===t.size);const e=y.getField(g,f);c(!!e,`No buffer view for ${g}`),e&&h(A,t.data,a,e,B);break}case l.PROFILERIGHT:case l.PROFILEUP:case l.PROFILEVERTEXANDNORMAL:case l.FEATUREVALUE:{c(4===t.size);const e=y.getField(g,f);c(!!e,`No buffer view for ${g}`),e&&p(A,t.data,e,B)}}else if(g===l.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(l.POSITION);if(c(!!t,`No buffer view for ${g}`),t){const f=t.length,o=y.getField(g,r);R(e.objectAndLayerIdColor,o,f,B)}}}}export{d as writeBufferFloat,B as writeBufferMat3f,g as writeBufferMat4f,u as writeBufferVec2,a as writeBufferVec3,p as writeBufferVec4,y as writeBufferVec4Zeros,N as writeColor,S as writeColorFeatureAttribute,A as writeDefaultAttributes,O as writeNormal,R as writeObjectAndLayerIdColor,b as writePosition,h as writeTangent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{f as e,c as t}from"../../../../chunks/vec3f64.js";import{f as i}from"../../../../chunks/vec4f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as o}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as l,VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as h}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ReloadableShaderModule as c}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as p,DepthTestFunction as d,AlphaDiscardMode as m}from"../lib/basicInterfaces.js";import{Default3D as f}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as b}from"../lib/Material.js";import{blendingDefault as g,oitBlending as S,oitDepthTest as y,getOITPolygonOffset as T}from"../lib/OrderIndependentTransparency.js";import{Program as P}from"../lib/Program.js";import{stencilWriteMaskOn as j,stencilToolMaskBaseParams as x,stencilBaseAllZerosParams as v}from"../lib/StencilUtils.js";import{TransparencyPassType as O}from"../lib/TransparencyPassType.js";import{D as A}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as C}from"../../../webgl/enums.js";import{makePipelineState as L,cullingParams as M,defaultDepthWriteParams as D,defaultColorWriteParams as w}from"../../../webgl/renderState.js";class F extends l{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=e(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=e(0,0,0),this.instancedDoublePrecision=!1,this.normalType=o.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=e(.2,.2,.2),this.diffuse=e(.8,.8,.8),this.externalColor=i(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=t(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=d.Less,this.textureAlphaMode=m.Blend,this.textureAlphaCutoff=h,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=b.Occlude}}class _ extends n{constructor(){super(...arguments),this.origin=t(),this.slicePlaneLocalOrigin=this.origin}}class k extends u{initializeConfiguration(e,t){t.spherical=e.viewingMode===r.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?a.Default:a.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,k.shader)}_initializeProgram(e,t){return new P(e.rctx,t.get().build(this.configuration),f)}_convertDepthTestFunction(e){return e===d.Lequal?C.LEQUAL:C.LESS}_makePipeline(e,t){const i=this.configuration,r=e===O.NONE,o=e===O.FrontFace;return L({blending:i.output!==s.Color&&i.output!==s.Alpha||!i.transparent?null:r?g:S(e),culling:N(i)?M(i.cullFace):null,depthTest:{func:y(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:(r||o)&&i.writeDepth?D:null,colorWrite:w,stencilWrite:i.hasOccludees?j:null,stencilTest:i.hasOccludees?t?x:v:null,polygonOffset:r||o?null:T(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function N(e){return e.cullFace!==p.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}k.shader=new c(A,(()=>import("./DefaultMaterial.glsl.js")));export{_ as DefaultMaterialDrawParameters,F as DefaultMaterialPassParameters,k as DefaultMaterialTechnique};
5
+ import{f as e,c as t}from"../../../../chunks/vec3f64.js";import{f as i}from"../../../../chunks/vec4f64.js";import{ViewingMode as r}from"../../../ViewingMode.js";import{ShaderOutput as s}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as o}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as a}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexNormalPassParameters as l,VertexNormalDrawParameters as n}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{defaultMaskAlphaCutoff as h}from"../core/shaderLibrary/util/AlphaCutoff.js";import{ReloadableShaderModule as c}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{CullFaceOptions as p,DepthTestFunction as d,AlphaDiscardMode as m}from"../lib/basicInterfaces.js";import{Default3D as f}from"../lib/DefaultVertexAttributeLocations.js";import{RenderOccludedFlag as b}from"../lib/Material.js";import{blendingDefault as g,oitBlending as S,oitDepthTest as y,getOITPolygonOffset as T}from"../lib/OrderIndependentTransparency.js";import{Program as P}from"../lib/Program.js";import{stencilWriteMaskOn as j,stencilToolMaskBaseParams as x,stencilBaseAllZerosParams as v}from"../lib/StencilUtils.js";import{TransparencyPassType as O}from"../lib/TransparencyPassType.js";import{D as A}from"../../../../chunks/DefaultMaterial.glsl.js";import{CompareFunction as C}from"../../../webgl/enums.js";import{makePipelineState as L,cullingParams as M,defaultDepthWriteParams as D,defaultColorWriteParams as w}from"../../../webgl/renderState.js";class F extends l{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=e(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=p.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=e(0,0,0),this.instancedDoublePrecision=!1,this.normalType=o.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=e(.2,.2,.2),this.diffuse=e(.8,.8,.8),this.externalColor=i(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=t(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=d.Less,this.textureAlphaMode=m.Blend,this.textureAlphaCutoff=h,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=b.Occlude}}class _ extends n{constructor(){super(...arguments),this.origin=t(),this.slicePlaneLocalOrigin=this.origin}}class k extends u{initializeConfiguration(e,t){t.spherical=e.viewingMode===r.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?a.Default:a.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,k.shader)}_initializeProgram(e,t){return new P(e.rctx,t.get().build(this.configuration),f)}_convertDepthTestFunction(e){return e===d.Lequal?C.LEQUAL:C.LESS}_makePipeline(e,t){const i=this.configuration,r=e===O.NONE,o=e===O.FrontFace;return L({blending:i.output!==s.Color&&i.output!==s.Alpha||!i.transparent?null:r?g:S(e),culling:N(i)?M(i.cullFace):null,depthTest:{func:y(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:(r||o)&&i.writeDepth?D:null,colorWrite:w,stencilWrite:i.hasOccludees?j:null,stencilTest:i.hasOccludees?t?x:v:null,polygonOffset:r||o?null:T(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function N(e){return e.cullFace!==p.None||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}k.shader=new c(A,(()=>import("./DefaultMaterial.glsl.js")));export{_ as DefaultMaterialDrawParameters,F as DefaultMaterialPassParameters,k as DefaultMaterialTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as r}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as s}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{AlphaDiscardMode as p,CullFaceOptions as h,DepthTestFunction as n}from"../lib/basicInterfaces.js";import{TransparencyPassType as d}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as l}from"../materials/DefaultTechniqueConfiguration.js";class c extends l{constructor(){super(...arguments),this.output=t.Color,this.alphaDiscardMode=p.Opaque,this.doubleSidedMode=s.None,this.pbrMode=i.Disabled,this.cullFace=h.None,this.transparencyPassType=d.NONE,this.normalType=e.Attribute,this.textureCoordinateType=r.None,this.customDepthTest=n.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}o([a({count:t.COUNT})],c.prototype,"output",void 0),o([a({count:p.COUNT})],c.prototype,"alphaDiscardMode",void 0),o([a({count:s.COUNT})],c.prototype,"doubleSidedMode",void 0),o([a({count:i.COUNT})],c.prototype,"pbrMode",void 0),o([a({count:h.COUNT})],c.prototype,"cullFace",void 0),o([a({count:d.COUNT})],c.prototype,"transparencyPassType",void 0),o([a({count:e.COUNT})],c.prototype,"normalType",void 0),o([a({count:r.COUNT})],c.prototype,"textureCoordinateType",void 0),o([a({count:n.COUNT})],c.prototype,"customDepthTest",void 0),o([a()],c.prototype,"spherical",void 0),o([a()],c.prototype,"hasVertexColors",void 0),o([a()],c.prototype,"hasSymbolColors",void 0),o([a()],c.prototype,"hasVerticalOffset",void 0),o([a()],c.prototype,"hasSlicePlane",void 0),o([a()],c.prototype,"hasSliceHighlight",void 0),o([a()],c.prototype,"hasColorTexture",void 0),o([a()],c.prototype,"hasMetallicRoughnessTexture",void 0),o([a()],c.prototype,"hasEmissionTexture",void 0),o([a()],c.prototype,"hasOcclusionTexture",void 0),o([a()],c.prototype,"hasNormalTexture",void 0),o([a()],c.prototype,"hasScreenSizePerspective",void 0),o([a()],c.prototype,"hasVertexTangents",void 0),o([a()],c.prototype,"hasOccludees",void 0),o([a()],c.prototype,"hasMultipassTerrain",void 0),o([a()],c.prototype,"hasModelTransformation",void 0),o([a()],c.prototype,"offsetBackfaces",void 0),o([a()],c.prototype,"vvSize",void 0),o([a()],c.prototype,"vvColor",void 0),o([a()],c.prototype,"receiveShadows",void 0),o([a()],c.prototype,"receiveAmbientOcclusion",void 0),o([a()],c.prototype,"textureAlphaPremultiplied",void 0),o([a()],c.prototype,"instanced",void 0),o([a()],c.prototype,"instancedColor",void 0),o([a()],c.prototype,"objectAndLayerIdColorInstanced",void 0),o([a()],c.prototype,"instancedDoublePrecision",void 0),o([a()],c.prototype,"doublePrecisionRequiresObfuscation",void 0),o([a()],c.prototype,"writeDepth",void 0),o([a()],c.prototype,"transparent",void 0),o([a()],c.prototype,"enableOffset",void 0),o([a()],c.prototype,"cullAboveGround",void 0),o([a()],c.prototype,"snowCover",void 0),o([a()],c.prototype,"hasColorTextureTransform",void 0),o([a()],c.prototype,"hasEmissionTextureTransform",void 0),o([a()],c.prototype,"hasNormalTextureTransform",void 0),o([a()],c.prototype,"hasOcclusionTextureTransform",void 0),o([a()],c.prototype,"hasMetallicRoughnessTextureTransform",void 0),o([a({constValue:!0})],c.prototype,"hasVvInstancing",void 0),o([a({constValue:!1})],c.prototype,"useCustomDTRExponentForWater",void 0),o([a({constValue:!1})],c.prototype,"supportsTextureAtlas",void 0),o([a({constValue:!0})],c.prototype,"useFillLights",void 0);export{c as DefaultMaterialTechniqueConfiguration};
5
+ import{_ as o}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as r}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{NormalsDoubleSidedMode as s}from"../core/shaderLibrary/shading/Normals.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{AlphaDiscardMode as p,CullFaceOptions as h,DepthTestFunction as n}from"../lib/basicInterfaces.js";import{TransparencyPassType as d}from"../lib/TransparencyPassType.js";import{DefaultTechniqueConfiguration as l}from"../materials/DefaultTechniqueConfiguration.js";class c extends l{constructor(){super(...arguments),this.output=t.Color,this.alphaDiscardMode=p.Opaque,this.doubleSidedMode=s.None,this.pbrMode=i.Disabled,this.cullFace=h.None,this.transparencyPassType=d.NONE,this.normalType=e.Attribute,this.textureCoordinateType=r.None,this.customDepthTest=n.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}o([a({count:t.COUNT})],c.prototype,"output",void 0),o([a({count:p.COUNT})],c.prototype,"alphaDiscardMode",void 0),o([a({count:s.COUNT})],c.prototype,"doubleSidedMode",void 0),o([a({count:i.COUNT})],c.prototype,"pbrMode",void 0),o([a({count:h.COUNT})],c.prototype,"cullFace",void 0),o([a({count:d.COUNT})],c.prototype,"transparencyPassType",void 0),o([a({count:e.COUNT})],c.prototype,"normalType",void 0),o([a({count:r.COUNT})],c.prototype,"textureCoordinateType",void 0),o([a({count:n.COUNT})],c.prototype,"customDepthTest",void 0),o([a()],c.prototype,"spherical",void 0),o([a()],c.prototype,"hasVertexColors",void 0),o([a()],c.prototype,"hasSymbolColors",void 0),o([a()],c.prototype,"hasVerticalOffset",void 0),o([a()],c.prototype,"hasSlicePlane",void 0),o([a()],c.prototype,"hasSliceHighlight",void 0),o([a()],c.prototype,"hasColorTexture",void 0),o([a()],c.prototype,"hasMetallicRoughnessTexture",void 0),o([a()],c.prototype,"hasEmissionTexture",void 0),o([a()],c.prototype,"hasOcclusionTexture",void 0),o([a()],c.prototype,"hasNormalTexture",void 0),o([a()],c.prototype,"hasScreenSizePerspective",void 0),o([a()],c.prototype,"hasVertexTangents",void 0),o([a()],c.prototype,"hasOccludees",void 0),o([a()],c.prototype,"hasMultipassTerrain",void 0),o([a()],c.prototype,"hasModelTransformation",void 0),o([a()],c.prototype,"offsetBackfaces",void 0),o([a()],c.prototype,"vvSize",void 0),o([a()],c.prototype,"vvColor",void 0),o([a()],c.prototype,"receiveShadows",void 0),o([a()],c.prototype,"receiveAmbientOcclusion",void 0),o([a()],c.prototype,"textureAlphaPremultiplied",void 0),o([a()],c.prototype,"instanced",void 0),o([a()],c.prototype,"instancedColor",void 0),o([a()],c.prototype,"objectAndLayerIdColorInstanced",void 0),o([a()],c.prototype,"instancedDoublePrecision",void 0),o([a()],c.prototype,"doublePrecisionRequiresObfuscation",void 0),o([a()],c.prototype,"writeDepth",void 0),o([a()],c.prototype,"transparent",void 0),o([a()],c.prototype,"enableOffset",void 0),o([a()],c.prototype,"cullAboveGround",void 0),o([a()],c.prototype,"snowCover",void 0),o([a()],c.prototype,"hasColorTextureTransform",void 0),o([a()],c.prototype,"hasEmissionTextureTransform",void 0),o([a()],c.prototype,"hasNormalTextureTransform",void 0),o([a()],c.prototype,"hasOcclusionTextureTransform",void 0),o([a()],c.prototype,"hasMetallicRoughnessTextureTransform",void 0),o([a({constValue:!0})],c.prototype,"hasVvInstancing",void 0),o([a({constValue:!1})],c.prototype,"useCustomDTRExponentForWater",void 0),o([a({constValue:!1})],c.prototype,"supportsTextureAtlas",void 0),o([a({constValue:!0})],c.prototype,"useFillLights",void 0);export{c as DefaultMaterialTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{NormalAttributeType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as r}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{DefaultMaterialTechnique as a}from"./DefaultMaterialTechnique.js";import{R as s}from"../../../../chunks/RealisticTree.glsl.js";class t extends a{initializeConfiguration(i,a){super.initializeConfiguration(i,a),a.hasMetallicRoughnessTexture=!1,a.hasEmissionTexture=!1,a.hasOcclusionTexture=!1,a.hasNormalTexture=!1,a.hasModelTransformation=!1,a.normalType=e.Attribute,a.doubleSidedMode=r.WindingOrder,a.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,t.shader)}}t.shader=new i(s,(()=>import("./RealisticTree.glsl.js")));export{t as RealisticTreeTechnique};
5
+ import{NormalType as e}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{NormalsDoubleSidedMode as r}from"../core/shaderLibrary/shading/Normals.glsl.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{DefaultMaterialTechnique as a}from"./DefaultMaterialTechnique.js";import{R as s}from"../../../../chunks/RealisticTree.glsl.js";class t extends a{initializeConfiguration(i,a){super.initializeConfiguration(i,a),a.hasMetallicRoughnessTexture=!1,a.hasEmissionTexture=!1,a.hasOcclusionTexture=!1,a.hasNormalTexture=!1,a.hasModelTransformation=!1,a.normalType=e.Attribute,a.doubleSidedMode=r.WindingOrder,a.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,t.shader)}}t.shader=new i(s,(()=>import("./RealisticTree.glsl.js")));export{t as RealisticTreeTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{NormalAttributeType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as r}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as s}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{TileBlendInput as p}from"../core/shaderLibrary/terrain/TileBlendInput.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as d}from"../materials/DefaultTechniqueConfiguration.js";class l extends d{constructor(){super(...arguments),this.output=o.Color,this.overlayMode=s.Disabled,this.tileBlendInput=p.LayerOnly,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.atmosphere=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1,this.invisible=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1,this.pbrMode=i.Terrain}}e([a({count:o.COUNT})],l.prototype,"output",void 0),e([a({count:s.COUNT})],l.prototype,"overlayMode",void 0),e([a({count:p.COUNT})],l.prototype,"tileBlendInput",void 0),e([a()],l.prototype,"spherical",void 0),e([a()],l.prototype,"doublePrecisionRequiresObfuscation",void 0),e([a()],l.prototype,"atmosphere",void 0),e([a()],l.prototype,"receiveShadows",void 0),e([a()],l.prototype,"hasSlicePlane",void 0),e([a()],l.prototype,"backfaceCullingEnabled",void 0),e([a()],l.prototype,"textureFadingEnabled",void 0),e([a()],l.prototype,"renderOccluded",void 0),e([a()],l.prototype,"hasScreenSpaceReflections",void 0),e([a()],l.prototype,"hasCloudsReflections",void 0),e([a()],l.prototype,"invisible",void 0),e([a()],l.prototype,"tileBorders",void 0),e([a()],l.prototype,"visualizeNormals",void 0),e([a()],l.prototype,"screenSizePerspective",void 0),e([a()],l.prototype,"receiveAmbientOcclusion",void 0),e([a({count:i.COUNT})],l.prototype,"pbrMode",void 0),e([a({constValue:t.CompressedAttribute})],l.prototype,"normalType",void 0),e([a({constValue:r.Compressed})],l.prototype,"textureCoordinateType",void 0),e([a({constValue:!1})],l.prototype,"highStepCount",void 0),e([a({constValue:!1})],l.prototype,"useCustomDTRExponentForWater",void 0),e([a({constValue:!1})],l.prototype,"useFillLights",void 0);export{l as TerrainTechniqueConfiguration};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import{ShaderOutput as o}from"../core/shaderLibrary/ShaderOutput.js";import{NormalType as t}from"../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{TextureCoordinateAttributeType as r}from"../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{PBRMode as i}from"../core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js";import{OverlayMode as s}from"../core/shaderLibrary/terrain/Overlay.glsl.js";import{TileBlendInput as p}from"../core/shaderLibrary/terrain/TileBlendInput.js";import{parameter as a}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as d}from"../materials/DefaultTechniqueConfiguration.js";class l extends d{constructor(){super(...arguments),this.output=o.Color,this.overlayMode=s.Disabled,this.tileBlendInput=p.LayerOnly,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.atmosphere=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.backfaceCullingEnabled=!1,this.textureFadingEnabled=!1,this.renderOccluded=!1,this.hasScreenSpaceReflections=!1,this.hasCloudsReflections=!1,this.invisible=!1,this.tileBorders=!1,this.visualizeNormals=!1,this.screenSizePerspective=!1,this.receiveAmbientOcclusion=!1,this.pbrMode=i.Terrain}}e([a({count:o.COUNT})],l.prototype,"output",void 0),e([a({count:s.COUNT})],l.prototype,"overlayMode",void 0),e([a({count:p.COUNT})],l.prototype,"tileBlendInput",void 0),e([a()],l.prototype,"spherical",void 0),e([a()],l.prototype,"doublePrecisionRequiresObfuscation",void 0),e([a()],l.prototype,"atmosphere",void 0),e([a()],l.prototype,"receiveShadows",void 0),e([a()],l.prototype,"hasSlicePlane",void 0),e([a()],l.prototype,"backfaceCullingEnabled",void 0),e([a()],l.prototype,"textureFadingEnabled",void 0),e([a()],l.prototype,"renderOccluded",void 0),e([a()],l.prototype,"hasScreenSpaceReflections",void 0),e([a()],l.prototype,"hasCloudsReflections",void 0),e([a()],l.prototype,"invisible",void 0),e([a()],l.prototype,"tileBorders",void 0),e([a()],l.prototype,"visualizeNormals",void 0),e([a()],l.prototype,"screenSizePerspective",void 0),e([a()],l.prototype,"receiveAmbientOcclusion",void 0),e([a({count:i.COUNT})],l.prototype,"pbrMode",void 0),e([a({constValue:t.CompressedAttribute})],l.prototype,"normalType",void 0),e([a({constValue:r.Compressed})],l.prototype,"textureCoordinateType",void 0),e([a({constValue:!1})],l.prototype,"highStepCount",void 0),e([a({constValue:!1})],l.prototype,"useCustomDTRExponentForWater",void 0),e([a({constValue:!1})],l.prototype,"useFillLights",void 0);export{l as TerrainTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/Accessor.js";import t from"../core/Error.js";import i from"../core/Logger.js";import{someMap as s}from"../core/MapUtils.js";import{removeMaybe as a}from"../core/maybe.js";import{createDeferred as o,createAbortError as l,isAbortError as n,onAbort as y,throwIfAborted as h}from"../core/promiseUtils.js";import{on as c,watch as w,syncAndInitial as p}from"../core/reactiveUtils.js";import{schedule as d}from"../core/scheduling.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as u}from"../core/support/WatchUpdatingTracking.js";import{destroyMap as _}from"../support/collectionUtils.js";function g(e){return"tryRecycleWith"in e}class v{constructor(e,r,i){this.layer=e,this.view=r,this.layerViewImporter=i,this._controller=new AbortController,this._deferred=o(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,y(this._controller.signal,(()=>{const r=new t("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(r)}))}tryRecycle(e){if(!this.done||!this.layerView||!g(this.layerView))return null;const r=this.layer.type,t=this._controller.signal;for(let i=0;i<e.length;i++){const s=e[i];if(s.type!==r)continue;const a=this.layerView.tryRecycleWith(s,{signal:t});if(a){e.splice(i,1),this.layer=s;const r=this.layerView,t=r.view;return this.promise=Promise.race([a.then((()=>(h(this._controller.signal),s.emit("layerview-destroy",{view:t,layerView:r}),t.emit("layerview-destroy",{view:t,layerView:r}),s.emit("layerview-create",{view:t,layerView:r}),t.emit("layerview-create",{view:t,layerView:r}),r))),new Promise(((e,r)=>y(this._controller.signal,(()=>r(l())))))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:t}=this;r.emit("layerview-destroy",{view:t,layerView:e}),t.emit("layerview-destroy",{layer:r,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:r,view:i}=this;this._map=i.map;try{let o,l;if(await r.load({signal:e}),"prefetchResources"in r&&await(r.prefetchResources?.({signal:e})),M(r))o=await r.createLayerView(i,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(r))throw new t("layer:view-not-supported","No layerview implementation was found");const s=await this.layerViewImporter.importLayerView(r);h(e),o="default"in s?new s.default({layer:r,view:i}):new s({layer:r,view:i})}const n=()=>{l=a(l),o.destroyed||o.destroy(),o.layer=null,o.parent=null,o.view=null,this.done=!0};l=y(e,n),h(e);try{await o.when()}catch(s){throw n(),s}const c=this._map?.allLayers?.includes(r);if(!c)return n(),void this._deferred.reject(new t("view:no-layerview-for-layer","The layer has been removed from the map",{layer:r}));this.layerView=o,r.emit("layerview-create",{view:i,layerView:o}),i.emit("layerview-create",{layer:r,layerView:o}),this.done=!0,this._deferred.resolve(o)}catch(s){r.emit("layerview-create-error",{view:i,error:s}),i.emit("layerview-create-error",{layer:r,error:s}),this.done=!0,this._deferred.reject(new t("layerview:create-error","layerview creation failed",{layer:r,error:s}))}}}let V=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new u,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=o(),this._workPromise.promise.catch((()=>{}))),this.removeHandles("reschedule"),this.addHandles(d(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const e=this.view.map;if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,t=[],i=this.view.ready,s=e=>{if(null!=e)for(const a of e)if(a){r.add(a);const e=this._layerLayerViewInfoMap.get(a);e&&i?e.start():e||this._recyclingInfoMap.has(a)||t.push(a),"layers"in a&&a.layers&&s(a.layers)}};for(const o of this._rootCollectionNames)s(this.get(o));for(const[o,l]of this._layerLayerViewInfoMap)if(!r.has(o)){this._layerLayerViewInfoMap.delete(l.layer);const e=l.tryRecycle(t);e?(this._recyclingInfoMap.set(l.layer,l),e.then((()=>{this._recyclingInfoMap.delete(l.layer),this._layerLayerViewInfoMap.set(l.layer,l),this._reschedule()})).catch((()=>{this._recyclingInfoMap.delete(l.layer),l.destroy(),this._reschedule()}))):l.destroy()}for(const[o,l]of this._recyclingInfoMap)r.has(o)||(this._recyclingInfoMap.delete(l.layer),l.destroy());for(const o of t)this._createLayerView(o);this._refreshCollections();const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter((e=>!!e));r.forEach((e=>"layers"in e&&a.push(e.layers))),this.addHandles(a.map((e=>this._watchUpdatingTracking.addOnCollectionChange((()=>e),this._reschedule))),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.own([c((()=>this.view?.map?.allLayers),"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),w((()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]}),(()=>this._reschedule()),p)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),_(this._recyclingInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(l()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,(e=>!e.done))}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),this._refreshCollections()}}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e)){if(this._recyclingInfoMap.has(e))return this._recyclingInfoMap.get(e).promise;throw new t("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e})}return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,r,t){if(!e||!r)return void(r&&r.removeAll());let i=0;for(const s of e){const e=this._layerLayerViewInfoMap.get(s);if(!e||!e.layerView)continue;const a=e.layerView;a.layer=s,a.parent=t,r.getItemAt(i)!==a&&r.splice(i,0,a),s.layers&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),i+=1}i<r.length&&r.splice(i,r.length)}_createLayerView(e){e.load().catch((()=>{})),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new v(e,this.view,this.layerViewImporter);r.promise.then((()=>this._refreshCollections()),(r=>{r&&(n(r)||"cancelled:layerview-create"===r.name)||i.getLogger(this.declaredClass).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this._refreshCollections()})),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([m()],V.prototype,"_workPromise",void 0),e([m({readOnly:!0})],V.prototype,"_watchUpdatingTracking",void 0),e([m({readOnly:!0})],V.prototype,"_layersToLayerViews",null),e([m({readOnly:!0})],V.prototype,"_rootCollectionNames",null),e([m()],V.prototype,"layerViewImporter",void 0),e([m()],V.prototype,"supportsGround",void 0),e([m({readOnly:!0})],V.prototype,"updating",null),e([m({readOnly:!0})],V.prototype,"updatingRemaining",null),e([m({constructOnly:!0})],V.prototype,"view",void 0),V=e([f("esri.views.LayerViewManager")],V);const L=V;function M(e){return"createLayerView"in e&&null!=e.createLayerView}export{L as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import r from"../core/Accessor.js";import i from"../core/Error.js";import t from"../core/Logger.js";import{someMap as s}from"../core/MapUtils.js";import{removeMaybe as a}from"../core/maybe.js";import{createDeferred as o,createAbortError as l,isAbortError as n,onAbort as y,throwIfAborted as h}from"../core/promiseUtils.js";import{on as c,watch as w,syncAndInitial as p}from"../core/reactiveUtils.js";import{schedule as d}from"../core/scheduling.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as u}from"../core/support/WatchUpdatingTracking.js";import{destroyMap as _}from"../support/collectionUtils.js";function g(e){return"tryRecycleWith"in e}class v{constructor(e,r,t){this.layer=e,this.view=r,this.layerViewImporter=t,this._controller=new AbortController,this._deferred=o(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,y(this._controller.signal,(()=>{const r=new i("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(r)}))}tryRecycle(e){if(!this.done||!this.layerView||!g(this.layerView))return null;const r=this.layer.type,i=this._controller.signal;for(let t=0;t<e.length;t++){const s=e[t];if(s.type!==r)continue;const a=this.layerView.tryRecycleWith(s,{signal:i});if(a){e.splice(t,1),this.layer=s;const r=this.layerView,i=r.view;return this.promise=Promise.race([a.then((()=>(h(this._controller.signal),s.emit("layerview-destroy",{view:i,layerView:r}),i.emit("layerview-destroy",{view:i,layerView:r}),s.emit("layerview-create",{view:i,layerView:r}),i.emit("layerview-create",{view:i,layerView:r}),r))),new Promise(((e,r)=>y(this._controller.signal,(()=>r(l())))))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:r,view:i}=this;r.emit("layerview-destroy",{view:i,layerView:e}),i.emit("layerview-destroy",{layer:r,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:r,view:t}=this;this._map=t.map;try{let o,l;if(await r.load({signal:e}),"prefetchResources"in r&&await(r.prefetchResources?.({signal:e})),M(r))o=await r.createLayerView(t,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(r))throw new i("layer:view-not-supported","No layerview implementation was found");const s=await this.layerViewImporter.importLayerView(r);h(e),o="default"in s?new s.default({layer:r,view:t}):new s({layer:r,view:t})}const n=()=>{l=a(l),o.destroyed||o.destroy(),o.layer=null,o.parent=null,o.view=null,this.done=!0};l=y(e,n),h(e);try{await o.when()}catch(s){throw n(),s}const c=this._map?.allLayers?.includes(r);if(!c)return n(),void this._deferred.reject(new i("view:no-layerview-for-layer","The layer has been removed from the map",{layer:r}));this.layerView=o,r.emit("layerview-create",{view:t,layerView:o}),t.emit("layerview-create",{layer:r,layerView:o}),this.done=!0,this._deferred.resolve(o)}catch(s){r.emit("layerview-create-error",{view:t,error:s}),t.emit("layerview-create-error",{layer:r,error:s}),this.done=!0,this._deferred.reject(new i("layerview:create-error","layerview creation failed",{layer:r,error:s}))}}}let V=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new u,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=o(),this._workPromise.promise.catch((()=>{}))),this.removeHandles("reschedule"),this.addHandles(d(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const e=this.view.map;if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,i=[],t=this.view.ready,s=e=>{if(null!=e)for(const a of e)if(a){r.add(a);const e=this._layerLayerViewInfoMap.get(a);e&&t?e.start():e||this._recyclingInfoMap.has(a)||i.push(a),"layers"in a&&a.layers&&s(a.layers)}};for(const o of this._rootCollectionNames)s(this.get(o));for(const[o,l]of this._layerLayerViewInfoMap)if(!r.has(o)){this._layerLayerViewInfoMap.delete(l.layer);const e=l.tryRecycle(i);e?(this._recyclingInfoMap.set(l.layer,l),e.then((()=>{this._recyclingInfoMap.delete(l.layer),this._layerLayerViewInfoMap.set(l.layer,l),this._reschedule()})).catch((()=>{this._recyclingInfoMap.delete(l.layer),l.destroy(),this._reschedule()}))):l.destroy()}for(const[o,l]of this._recyclingInfoMap)r.has(o)||(this._recyclingInfoMap.delete(l.layer),l.destroy());for(const o of i)this._createLayerView(o);this._refreshCollections();const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter((e=>!!e));r.forEach((e=>"layers"in e&&a.push(e.layers))),this.addHandles(a.map((e=>this._watchUpdatingTracking.addOnCollectionChange((()=>e),this._reschedule))),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.own([c((()=>this.view?.map?.allLayers),"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),w((()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]}),(()=>this._reschedule()),p)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),_(this._recyclingInfoMap),_(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(l()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,(e=>!e.done))}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(_(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e)){if(this._recyclingInfoMap.has(e))return this._recyclingInfoMap.get(e).promise;throw new i("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e})}return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void(r&&r.removeAll());let t=0;for(const s of e){const e=this._layerLayerViewInfoMap.get(s);if(!e||!e.layerView)continue;const a=e.layerView;a.layer=s,a.parent=i,r.getItemAt(t)!==a&&r.splice(t,0,a),s.layers&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),t+=1}t<r.length&&r.splice(t,r.length)}_createLayerView(e){e.load().catch((()=>{})),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new v(e,this.view,this.layerViewImporter);r.promise.then((()=>this._refreshCollections()),(r=>{r&&(n(r)||"cancelled:layerview-create"===r.name)||t.getLogger(this.declaredClass).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this._refreshCollections()})),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([m()],V.prototype,"_workPromise",void 0),e([m({readOnly:!0})],V.prototype,"_watchUpdatingTracking",void 0),e([m({readOnly:!0})],V.prototype,"_layersToLayerViews",null),e([m({readOnly:!0})],V.prototype,"_rootCollectionNames",null),e([m()],V.prototype,"layerViewImporter",void 0),e([m()],V.prototype,"supportsGround",void 0),e([m({readOnly:!0})],V.prototype,"updating",null),e([m({readOnly:!0})],V.prototype,"updatingRemaining",null),e([m({constructOnly:!0})],V.prototype,"view",void 0),V=e([f("esri.views.LayerViewManager")],V);const L=V;function M(e){return"createLayerView"in e&&null!=e.createLayerView}export{L 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Viewpoint.js";import s from"../core/Collection.js";import{byId as n}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{handlesGroup as l,makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isIterable as h}from"../core/iteratorUtils.js";import d from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{ObservableChangesType as u}from"../core/ObservableChangesType.js";import{throwIfAborted as g}from"../core/promiseUtils.js";import{on as m,watch as y,initial as f,syncAndInitial as w,whenOnce as v,sync as _}from"../core/reactiveUtils.js";import{setFrameDuration as b}from"../core/scheduling.js";import{screenPointObjectToArray as M,createScreenPoint as S,createScreenPointArray as C}from"../core/screenUtils.js";import{initialize as R}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as x}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import{subclass as T}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as O,ensureClass as j}from"../core/accessorSupport/ensureType.js";import{c as E}from"../chunks/vec3f64.js";import{owningCollectionProperty as I}from"../core/support/OwningCollection.js";import L from"../geometry/HeightModelInfo.js";import{projectPointToVector as P,projectVectorToVector as H,canProjectWithoutEngine as A,project as G,projectBoundingRect as U}from"../geometry/projection.js";import{create as D,toExtent as F}from"../geometry/support/aaBoundingRect.js";import{B as W,c as k}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as q}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as z}from"../geometry/support/scaleUtils.js";import{fallbackObjectIDAttribute as B}from"../layers/LayerConstants.js";import{isImageryTileLayer as N,isTiledLayer as Q,isVoxelLayer as $}from"../layers/support/layerUtils.js";import{AnalysesCollection as X}from"../support/AnalysesCollection.js";import{BreakpointsOwner as Y}from"./BreakpointsOwner.js";import{DOMContainer as Z}from"./DOMContainer.js";import J from"./GroundView.js";import{PopupView as K}from"./PopupView.js";import ee from"./View.js";import te from"./ViewAnimation.js";import{ViewingMode as ie,stringFromViewingMode as re,viewingModeFromString as se}from"./ViewingMode.js";import{layerView3DImporter as ne}from"./3d/layerViewModuleImportUtils.js";import ae from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as oe}from"./3d/constraints/Constraints.js";import le from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as pe}from"./3d/environment/SceneViewEnvironmentManager.js";import he from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as de}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ce}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as ue}from"./3d/layers/support/FeatureTileTree3D.js";import ge from"./3d/state/ViewState.js";import{ViewStateManager as me}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as fe}from"./3d/support/CombinedElevationProvider.js";import we from"./3d/support/debugFlags.js";import ve from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as _e}from"./3d/support/ElevationProvider.js";import be from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as Me}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Se}from"./3d/support/PropertiesPool.js";import Ce from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Re}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ve}from"./3d/support/ResourceController.js";import xe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Te}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Oe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import je from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ee,getTiledLayerInfo as Ie,checkIfTileInfoSupportedForView as Le}from"./3d/terrain/terrainUtils.js";import{Stage as Pe}from"./3d/webgl-engine/Stage.js";import{newIntersector as He,DEFAULT_TOLERANCE as Ae}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as Ge,IntersectorType as Ue}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as De}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toHit as Fe,toOwner as We}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as ke}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSimilarDistance as qe}from"./support/hitTestSelectUtils.js";import{occludeesSupported as ze}from"./support/layerViewUtils.js";import{RenderState as Be}from"./support/RenderState.js";import{encode as Ne,encodeData as Qe,toRenderSettings as $e,screenshotSuperSampleSettings as Xe}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Ye,createScreenPointFromSupportedEvent as Ze}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Je}from"./support/spatialReferenceSupport.js";import{check as Ke}from"./support/WebGLRequirements.js";import et from"./ui/DefaultUI.js";import tt from"./ui/3d/DefaultUI3D.js";import it from"../webscene/Environment.js";import rt from"../geometry/Extent.js";import st from"../geometry/SpatialReference.js";import nt from"../geometry/Point.js";let at=class extends(Y(Z(K(ee)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new Se({slicePlane:W},this),this._resourceController=Ve(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new de({view:this}),this.labeler=new ce({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new X,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new oe,this.environmentManager=new pe,this.floors=new s,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ae({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ge,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new tt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.highlightOptions=new be,this.voxelWasm=null,this.voxelWasmPromise=null,R(),e&&e.environment||(this._defaults.environment=new le,this.environment=this._defaults.environment);const t=(e=null)=>{null!=e&&e.type===u.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([m((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),y((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new he({view:this}),this.stateManager=new me({view:this})}initialize(){this.groundView=new J({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.addHandles(m((()=>this.map?.allLayers),"after-changes",e,{onListenerAdd:e,onListenerRemove:e})),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),f),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),f),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>b(e>0?1e3/Math.ceil(e):0)),f),this.updatingHandles.add((()=>this.map?.ground),e,w),this.updatingHandles.add((()=>this.map?.ground?.opacity),(()=>this._updateDefaultHitTestOptions()),w),this.addHandles(y((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),_))}destroy(){this.destroyed||(this.updatingHandles.removeAll(),this.removeAllHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this.environmentManager.destroy(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=c(this.sharedSymbolResources),this._set("labeler",c(this.labeler)),this._set("deconflictor",c(this.deconflictor)),this._resourceController=c(this._resourceController),this._set("stateManager",c(this.stateManager)),this._set("inputManager",c(this.inputManager)),this.state.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",c(this.environmentManager)),this.groundView=c(this.groundView),this._exitBasemapTerrain(),this._stage?.destroy(),this.removeAllHandles(),this.updatingHandles.removeAll(),this.handles.removeAll())}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||("clippingArea"in this.map?this.map?.clippingArea:void 0);return!this._userClippingArea&&!this.get("map.clippingEnabled")||null==e?(this._clippingArea=null,null):e instanceof rt?this.spatialReference&&(e=pt(e,this.spatialReference),null==e)?(d.getLogger(this.declaredClass).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),null==e.intersection(this._groundAndLayersExtent)&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(d.getLogger(this.declaredClass).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?d.getLogger(this.declaredClass).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ie.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:pt(t,e)}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||st.WGS84,i=pt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||st.WGS84;let t;const i=i=>{const r=pt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new rt({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const s=this._get("_groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof le?e:e instanceof it?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):le.fromWebsceneEnvironment(e):O(le,e):new le}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||this.toolViewManager?.interacting}get stationary(){return!this.animation&&!this.resizing&&(null==this.state||this.state.stationary)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){ve.isValidProfile(e)&&(ve.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||ve.getDefaultProfile()}set slicePlane(e){if(null!=this._stage&&this._stage.renderer.setParameters({slicePlane:e}),null==e)return void this._set("slicePlane",null);const t=this._propertiesPool.get("slicePlane");k(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?z(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?L.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ee(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of[this.deconflictor,this.labeler,this.basemapTerrain])null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=this.stateManager.test.updatingIgnoreRenderState?Be.IDLE:this.state.mode;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r!==Be.IDLE||this._createGraphicsViewController||this.inputManager?.hasPendingInputs||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return re(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?re(this.defaultsFromMap.viewingMode):Je(t,ie.Global)?"global":"local":"global"}set viewingMode(e){this.ready?d.getLogger(this.declaredClass).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get performanceInfo(){return new xe(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return d.getLogger(this.declaredClass).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=null!=i.graphics&&(null!=i.graphics.include||null!=i.graphics.exclude),s=Ye(e)?Ze(this,e):e,n=M(s);i.enableDraped=i.include&&!i.include.has(ke)||i.exclude&&i.exclude.has(ke);const a=this.sceneIntersectionHelper,o=He(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?Ge.ALL:Ge.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=Fe(e,this);if(null==t)return this._intersectResultToMapPoint(e);if("graphic"!==t.type||this._testGraphicUidFilter(i.graphics,t.graphic))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return d.getLogger(this.declaredClass).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?_e(this.elevationProvider,e):null)??0;return P(e,dt,this.renderSpatialReference,t),this.state.camera.projectToScreen(dt,ct),S(ct[0],ct[1])}pixelSizeAt(e){return this.ready?e?(P(e,dt,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(dt)):0:(d.getLogger(this.declaredClass).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return d.getLogger(this.declaredClass).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Ye(e)?Ze(this,e):e,r=C(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=He(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=Ge.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=We(o,this),p=null!=l&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:De(o)?o.distanceInRenderSpace:0,layer:p}};return we.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}async popupHitTest(e){const{results:t,ground:i}=await qe(this,e);let r=null;return!(0===t.length||Math.abs((t[0].distance??0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new a("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Ne(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Qe(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshotWithOID(t);return[Qe(i[0],this._pixelFormat()),Qe(i[1],this._pixelFormat())]}_completeSettings(e){const t=$e(e,this);return t.pixelRatio/=this.state.pixelRatio,Xe(t,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){return{takeScreenshot:e=>this._takeScreenshot(e),takeScreenshotWithObjectAndLayerId:e=>this._takeScreenshotWithObjectAndLayerId(e)}}async takeScreenshotWithObjectAndLayerId(e){if(!has("enable-feature:objectAndLayerId-rendering"))throw new Error("has enable-feature:objectAndLayerId-rendering must be true");const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshotWithOID(t),r=Ne(i[0],t,this._pixelFormat()),s=this._completeSettings(e);s.format="png";return[r,Ne(i[1],s,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){if(null==this._stage.renderView.objectAndLayerIdRenderHelper)throw new Error("has enable-feature:objectAndLayerId-rendering must be true");return this._stage.renderView.objectAndLayerIdRenderHelper.getColorToObjectAndLayerIdMapping()}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ne.importLayerView(e)}hasLayerViewModule(e){return ne.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=Ke(this.type);const t=has("safari");if(t&&t<9&&(e=new a("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw d.getLogger(this.declaredClass).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=e?se(e):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ie.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ie.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Je(e,i)&&(null==t||(!!N(t)||(!Q(t)||null!=Ie(t,e,i))&&(!$(t)||i!==ie.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const r=e.isWebMercator,s=e.isWGS84;if(N(t)&&(r||s)){return!s||i===ie.Local||null===Le(t.tileInfo,t.fullExtent,e,ie.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:st.WebMercator,viewingMode:i}]:[{spatialReference:r?st.WGS84:st.WebMercator,viewingMode:i}]}return Q(t)||$(t)||!r&&!s?Q(t)&&r&&i!==ie.Global?[{spatialReference:e,viewingMode:i},{spatialReference:st.WGS84,viewingMode:ie.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?st.WGS84:st.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport({spatialReference:e}),i=this._predeterminedViewingMode;return t||(null!=i?d.getLogger(this.declaredClass).warnOnce(`Spatial reference defined on view not supported in ${re(i)} viewing mode.`):e.isGeographic&&d.getLogger(this.declaredClass).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||st.WGS84;return H(e,this.renderSpatialReference,e,i)||(i=st.WGS84,H(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new nt(e,i),t}trackGraphicState(e){if(!e.graphic)return d.getLogger(this.declaredClass).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,null!=i&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return l(e.map((e=>this.highlight(e))));if(s.isCollection(e))return l(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):p()}maskOccludee(e){if(!e)return d.getLogger(this.declaredClass).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ze(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,null!=i&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await v((()=>this.graphicsView)),this.graphicsView;if(!e.layer||!this.map)throw new a("no-view-for-graphic");return t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,ht.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,ht.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(dt)?(t=this.computeMapPointFromVec3d(dt,t),e.intersector===Ue.TERRAIN&&this.basemapTerrain&&(t.z=_e(this.basemapTerrain,t)??0),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=We(n,this);if(null!=a&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=Fe(n,this);if(null==o)continue;if("graphic"===o.type){if(null==r&&s!==e.length-1&&(r=new Set),null!=r){const e=this._getGraphicFilterUid(o.graphic);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o.graphic))continue}const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({...o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){const t=e.sourceLayer,i=e.layer,r=t&&"objectIdField"in t?t:i&&"objectIdField"in i?i:t;if(r){const t=r.objectIdField??B,i=e.attributes?.[t];if(i)return`o-${r.id}-${i}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return null==e||(null==e.include||e.include.has(i))&&(null==e.exclude||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,r={layerUids:void 0,graphicUids:void 0}){if(!e)return r;if(e instanceof i)lt(r,this._getGraphicFilterUid(e)),t===ht.INCLUDE&&(null!=this.graphicsView&&e.layer===this?ot(r,this.graphicsView.processor.layer.id):e.layer&&ot(r,e.layer.uid));else if(h(e))for(const i of e)i===this.graphics&&null!=this.graphicsView?ot(r,this.graphicsView.processor.layer.id):i===this.map.ground?ot(r,ke):this._externalToInternalRenderItems(i,t,r);else"uid"in e&&ot(r,e.uid);return r}_initBasemapTerrain(){this._set("basemapTerrain",new je({view:this})),this._set("elevationProvider",new fe({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Oe({view:this})),this._set("featureTiles",new ue({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?G(F(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;null!=this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>we.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&we.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||we.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),w),this.updatingHandles.add((()=>this.clippingArea),e,w),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,w)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Me(this.map,e));const t=this.state.isGlobal,i=q(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Re.create(this.state.viewingMode,i)),t||this.addHandles(y((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!U(e,this.basemapTerrain.spatialReference,ut,t)||(this.renderCoordsHelper.extent=ut)}),_),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Ae/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===u.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(y((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),_),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new ye(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=n(this.surface);this._stage=new Pe({view:this,options:e,container:i}),this._stage.renderer.setParameters({slicePlane:this.slicePlane}),this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.antialiasingEnabled),(()=>this._stage.renderer.setParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})),f),this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this._stage.renderer.setParameters({highQualityTransparency:e})),f),y((()=>this.magnifier),(e=>this._stage.renderView.magnifier=e),w),this.on("pointer-move",(()=>this._stage?.renderer.resetAnimation())),o(this._stage.renderView.canvas,"webglcontextlost",(e=>this.fatalError=new a("webgl-context-lost",e.statusMessage)))],"stage");const r=()=>{this._stage.renderer.setParameters({defaultHighlightOptions:be.toEngineOptions(this.highlightOptions)})};this.addHandles(this.updatingHandles.add((()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference]),r),"stage"),r(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Ae/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=c(this._stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Te({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;g(e),await v((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=se(this.viewingMode);if(e===ie.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(m((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(ke);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(ke);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultHitTestOptions.exclude.add(e.uid)}}addVoxelLayerViewToWasm(e){return null==this.voxelWasm?(null==this.voxelWasmPromise&&(this.voxelWasmPromise=import("../layers/VoxelWasmPerSceneView.js").then((e=>(this.voxelWasm=new e.default(this),this.voxelWasm)))),this.voxelWasmPromise.then((t=>t.addVoxelLayer(e)))):this.voxelWasm.addVoxelLayer(e)}removeVoxelLayerViewFromWasm(e){if(null!=this.voxelWasm){this.voxelWasm.removeVoxelLayer(e)<1&&(this.voxelWasm=null,this.voxelWasmPromise=null)}}};function ot(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function lt(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function pt(e,t){return null!=e&&A(e.spatialReference,t)?G(e,t):null}var ht;at.type="3d",e([V()],at.prototype,"_userClippingArea",void 0),e([V()],at.prototype,"_resourceController",void 0),e([V()],at.prototype,"_stage",void 0),e([V({readOnly:!0})],at.prototype,"deconflictor",void 0),e([V({readOnly:!0})],at.prototype,"labeler",void 0),e([V(I(X,"analyses"))],at.prototype,"analyses",void 0),e([V({type:te,readOnly:!0})],at.prototype,"animation",null),e([V({readOnly:!0})],at.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],at.prototype,"elevationProvider",void 0),e([V()],at.prototype,"camera",null),e([V({type:t})],at.prototype,"contentCamera",null),e([V({readOnly:!0})],at.prototype,"canvas",void 0),e([V({type:nt})],at.prototype,"center",null),e([V({type:rt})],at.prototype,"clippingArea",null),e([V({type:oe})],at.prototype,"constraints",void 0),e([V({type:rt,readOnly:!0})],at.prototype,"renderDataExtent",null),e([V({type:rt,readOnly:!0})],at.prototype,"dataExtent",null),e([V({type:rt,readOnly:!0})],at.prototype,"_groundAndLayersExtent",null),e([V({value:null,type:le})],at.prototype,"environment",null),e([x("environment")],at.prototype,"castEnvironment",null),e([V({readOnly:!0})],at.prototype,"environmentManager",void 0),e([V({type:rt})],at.prototype,"extent",null),e([V()],at.prototype,"floors",void 0),e([V()],at.prototype,"screenCenter",null),e([V()],at.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],at.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],at.prototype,"graphicsView",void 0),e([V({readOnly:!0})],at.prototype,"analysisViewManager",void 0),e([V()],at.prototype,"groundView",void 0),e([V({type:Boolean})],at.prototype,"initialExtentRequired",null),e([V()],at.prototype,"_defaultsFromMapSettings",null),e([V()],at.prototype,"interacting",null),e([V()],at.prototype,"stationary",null),e([V()],at.prototype,"navigating",null),e([V()],at.prototype,"map",void 0),e([V({readOnly:!0})],at.prototype,"mapCoordsHelper",void 0),e([V()],at.prototype,"padding",null),e([V({type:Oe,readOnly:!0})],at.prototype,"pointsOfInterest",void 0),e([V({type:ue,readOnly:!0})],at.prototype,"featureTiles",void 0),e([V()],at.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],at.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],at.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],at.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],at.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],at.prototype,"state",void 0),e([V({readOnly:!0})],at.prototype,"inputManager",void 0),e([V({readOnly:!0})],at.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],at.prototype,"qualityProfile",null),e([V({type:Ce,get(){let e=this._get("qualitySettings");return e||(e=new Ce,ve.apply(this.qualityProfile,e)),e}})],at.prototype,"qualitySettings",void 0),e([V()],at.prototype,"slicePlane",null),e([V({readOnly:!0})],at.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],at.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],at.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],at.prototype,"resolution",null),e([V({type:Number})],at.prototype,"scale",null),e([V()],at.prototype,"heightModelInfo",null),e([V()],at.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],at.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],at.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],at.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],at.prototype,"type",void 0),e([V(),x((e=>e instanceof et?e:j(tt,e)))],at.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating","state.mode"]})],at.prototype,"updating",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],at.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],at.prototype,"viewingMode",null),e([V({type:r})],at.prototype,"viewpoint",null),e([V({type:Number})],at.prototype,"zoom",null),e([V({type:be})],at.prototype,"highlightOptions",void 0),at=e([T("esri.views.SceneView")],at),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(ht||(ht={}));const dt=E(),ct=C(),ut=D(),gt=at;export{gt as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import"../geometry.js";import i from"../Graphic.js";import r from"../Viewpoint.js";import s from"../core/Collection.js";import{byId as n}from"../core/domUtils.js";import a from"../core/Error.js";import{on as o}from"../core/events.js";import{handlesGroup as l,makeHandle as p}from"../core/handleUtils.js";import has from"../core/has.js";import{isIterable as h}from"../core/iteratorUtils.js";import d from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{ObservableChangesType as u}from"../core/ObservableChangesType.js";import{throwIfAborted as g}from"../core/promiseUtils.js";import{on as m,watch as y,initial as f,syncAndInitial as w,whenOnce as v,sync as _}from"../core/reactiveUtils.js";import{setFrameDuration as b}from"../core/scheduling.js";import{screenPointObjectToArray as M,createScreenPoint as S,createScreenPointArray as C}from"../core/screenUtils.js";import{initialize as R}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as x}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import{subclass as T}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as O,ensureClass as j}from"../core/accessorSupport/ensureType.js";import{c as E}from"../chunks/vec3f64.js";import{owningCollectionProperty as I}from"../core/support/OwningCollection.js";import L from"../geometry/HeightModelInfo.js";import{projectPointToVector as P,projectVectorToVector as H,canProjectWithoutEngine as A,project as G,projectBoundingRect as U}from"../geometry/projection.js";import{create as D,toExtent as F}from"../geometry/support/aaBoundingRect.js";import{B as W,c as k}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as q}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as z}from"../geometry/support/scaleUtils.js";import{fallbackObjectIDAttribute as B}from"../layers/LayerConstants.js";import{isImageryTileLayer as N,isTiledLayer as Q,isVoxelLayer as $}from"../layers/support/layerUtils.js";import{AnalysesCollection as X}from"../support/AnalysesCollection.js";import{BreakpointsOwner as Y}from"./BreakpointsOwner.js";import{DOMContainer as Z}from"./DOMContainer.js";import J from"./GroundView.js";import{PopupView as K}from"./PopupView.js";import ee from"./View.js";import te from"./ViewAnimation.js";import{ViewingMode as ie,stringFromViewingMode as re,viewingModeFromString as se}from"./ViewingMode.js";import{layerView3DImporter as ne}from"./3d/layerViewModuleImportUtils.js";import ae from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as oe}from"./3d/constraints/Constraints.js";import le from"./3d/environment/SceneViewEnvironment.js";import{SceneViewEnvironmentManager as pe}from"./3d/environment/SceneViewEnvironmentManager.js";import he from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as de}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ce}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as ue}from"./3d/layers/support/FeatureTileTree3D.js";import ge from"./3d/state/ViewState.js";import{ViewStateManager as me}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as ye}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as fe}from"./3d/support/CombinedElevationProvider.js";import we from"./3d/support/debugFlags.js";import ve from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as _e}from"./3d/support/ElevationProvider.js";import be from"./3d/support/HighlightOptions.js";import{MapCoordsHelper as Me}from"./3d/support/MapCoordsHelper.js";import{PropertiesPool as Se}from"./3d/support/PropertiesPool.js";import Ce from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Re}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ve}from"./3d/support/ResourceController.js";import xe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Te}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Oe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import je from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ee,getTiledLayerInfo as Ie,checkIfTileInfoSupportedForView as Le}from"./3d/terrain/terrainUtils.js";import{Stage as Pe}from"./3d/webgl-engine/Stage.js";import{newIntersector as He,DEFAULT_TOLERANCE as Ae}from"./3d/webgl-engine/lib/Intersector.js";import{StoreResults as Ge,IntersectorType as Ue}from"./3d/webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as De}from"./3d/webgl-engine/lib/intersectorUtils.js";import{toHit as Fe,toOwner as We}from"./3d/webgl-engine/lib/intersectorUtilsConversions.js";import{TERRAIN_ID as ke}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{hitTestSelectSimilarDistance as qe}from"./support/hitTestSelectUtils.js";import{occludeesSupported as ze}from"./support/layerViewUtils.js";import{RenderState as Be}from"./support/RenderState.js";import{encode as Ne,encodeData as Qe,toRenderSettings as $e,screenshotSuperSampleSettings as Xe}from"./support/screenshotUtils.js";import{isSupportedScreenPointEvent as Ye,createScreenPointFromSupportedEvent as Ze}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Je}from"./support/spatialReferenceSupport.js";import{check as Ke}from"./support/WebGLRequirements.js";import et from"./ui/DefaultUI.js";import tt from"./ui/3d/DefaultUI3D.js";import it from"../webscene/Environment.js";import rt from"../geometry/Extent.js";import st from"../geometry/SpatialReference.js";import nt from"../geometry/Point.js";let at=class extends(Y(Z(K(ee)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new Se({slicePlane:W},this),this._resourceController=Ve(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new de({view:this}),this.labeler=new ce({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new X,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new oe,this.environmentManager=new pe,this.floors=new s,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ae({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ge,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new tt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.highlightOptions=new be,this.voxelWasm=null,this.voxelWasmPromise=null,R(),e&&e.environment||(this._defaults.environment=new le,this.environment=this._defaults.environment);const t=(e=null)=>{null!=e&&e.type===u.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([m((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),y((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new he({view:this}),this.stateManager=new me({view:this})}initialize(){this.groundView=new J({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.addHandles(m((()=>this.map?.allLayers),"after-changes",e,{onListenerAdd:e,onListenerRemove:e})),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),f),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),f),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>b(e>0?1e3/Math.ceil(e):0)),f),this.updatingHandles.add((()=>this.map?.ground),e,w),this.updatingHandles.add((()=>this.map?.ground?.opacity),(()=>this._updateDefaultHitTestOptions()),w),this.addHandles(y((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),_))}destroy(){this.destroyed||(this.updatingHandles.removeAll(),this.removeAllHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this.environmentManager.destroy(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=c(this.sharedSymbolResources),this._set("labeler",c(this.labeler)),this._set("deconflictor",c(this.deconflictor)),this._resourceController=c(this._resourceController),this._set("stateManager",c(this.stateManager)),this._set("inputManager",c(this.inputManager)),this.state.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",c(this.environmentManager)),this.groundView=c(this.groundView),this._exitBasemapTerrain(),this._stage?.destroy(),this.state.destroy(),this.removeAllHandles(),this.updatingHandles.removeAll(),this.handles.removeAll())}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;let e=this._userClippingArea||("clippingArea"in this.map?this.map?.clippingArea:void 0);return!this._userClippingArea&&!this.get("map.clippingEnabled")||null==e?(this._clippingArea=null,null):e instanceof rt?this.spatialReference&&(e=pt(e,this.spatialReference),null==e)?(d.getLogger(this.declaredClass).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(e=e.clone(),null==e.intersection(this._groundAndLayersExtent)&&(e.xmin=e.xmax,e.ymin=e.ymax),e.zmin=void 0,e.zmax=void 0,e.equals(this._clippingArea)||(this._clippingArea=e),this._clippingArea):(d.getLogger(this.declaredClass).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?d.getLogger(this.declaredClass).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===ie.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:pt(t,e)}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||st.WGS84,i=pt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||st.WGS84;let t;const i=i=>{const r=pt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new rt({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const s=this._get("_groundAndLayersExtent");return t.equals(s)?s:t}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof le?e:e instanceof it?null!=this.environment?this.environment.cloneWithWebsceneEnvironment(e):le.fromWebsceneEnvironment(e):O(le,e):new le}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||this.toolViewManager?.interacting}get stationary(){return!this.animation&&!this.resizing&&(null==this.state||this.state.stationary)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){ve.isValidProfile(e)&&(ve.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||ve.getDefaultProfile()}set slicePlane(e){if(null!=this._stage&&this._stage.renderer.setParameters({slicePlane:e}),null==e)return void this._set("slicePlane",null);const t=this._propertiesPool.get("slicePlane");k(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return null!=this.spatialReference?z(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?L.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ee(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager])if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of[this.deconflictor,this.labeler,this.basemapTerrain])null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=this.stateManager.test.updatingIgnoreRenderState?Be.IDLE:this.state.mode;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r!==Be.IDLE||this._createGraphicsViewController||this.inputManager?.hasPendingInputs||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return re(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?re(this.defaultsFromMap.viewingMode):Je(t,ie.Global)?"global":"local":"global"}set viewingMode(e){this.ready?d.getLogger(this.declaredClass).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get performanceInfo(){return new xe(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return d.getLogger(this.declaredClass).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=t?this.externalToInternalIntersectOptions(t):this._defaultToMapOptions,r=null!=i.graphics&&(null!=i.graphics.include||null!=i.graphics.exclude),s=Ye(e)?Ze(this,e):e,n=M(s);i.enableDraped=i.include&&!i.include.has(ke)||i.exclude&&i.exclude.has(ke);const a=this.sceneIntersectionHelper,o=He(this.state.viewingMode);if(o.options.selectionMode=!0,o.options.store=r?Ge.ALL:Ge.MIN,a.intersectIntersectorScreen(n,o,i),r){for(const e of o.results.all){const t=Fe(e,this);if(null==t)return this._intersectResultToMapPoint(e);if("graphic"!==t.type||this._testGraphicUidFilter(i.graphics,t.graphic))return this._intersectResultToMapPoint(e)}return null}return this._intersectResultToMapPoint(o.results.min)}toScreen(e){if(!this.ready)return d.getLogger(this.declaredClass).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?_e(this.elevationProvider,e):null)??0;return P(e,dt,this.renderSpatialReference,t),this.state.camera.projectToScreen(dt,ct),S(ct[0],ct[1])}pixelSizeAt(e){return this.ready?e?(P(e,dt,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(dt)):0:(d.getLogger(this.declaredClass).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e):1}hitTest(e,t){if(!this.ready)return d.getLogger(this.declaredClass).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=Ye(e)?Ze(this,e):e,r=C(i.x,i.y),s=t?this.externalToInternalIntersectOptions(t):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const n=He(this.state.viewingMode);n.options.selectionMode=!0,n.options.store=Ge.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(r,n,s);const a=this._intersectResultsToHits(n.results.all,s.graphics),o=n.results.ground,l=We(o,this),p=null!=l&&"type"in l&&"integrated-mesh"===l.type?l:null,h={screenPoint:i,results:a,ground:{mapPoint:this._intersectResultToMapPoint(o),distance:De(o)?o.distanceInRenderSpace:0,layer:p}};return we.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(h.intersector=n),Promise.resolve(h)}async popupHitTest(e){const{results:t,ground:i}=await qe(this,e);let r=null;return!(0===t.length||Math.abs((t[0].distance??0)-i.distance)<1e-5)||i.layer&&"integrated-mesh"===i.layer.type||(r=i.mapPoint),{results:t,screenPoint:e,mapPoint:r}}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new a("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Ne(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshot(t);return Qe(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshotWithOID(t);return[Qe(i[0],this._pixelFormat()),Qe(i[1],this._pixelFormat())]}_completeSettings(e){const t=$e(e,this);return t.pixelRatio/=this.state.pixelRatio,Xe(t,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){return{takeScreenshot:e=>this._takeScreenshot(e),takeScreenshotWithObjectAndLayerId:e=>this._takeScreenshotWithObjectAndLayerId(e)}}async takeScreenshotWithObjectAndLayerId(e){if(!has("enable-feature:objectAndLayerId-rendering"))throw new Error("has enable-feature:objectAndLayerId-rendering must be true");const t=this._completeSettings(e);await this.whenReady();const i=await this._stage.renderView.takeScreenshotWithOID(t),r=Ne(i[0],t,this._pixelFormat()),s=this._completeSettings(e);s.format="png";return[r,Ne(i[1],s,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){if(null==this._stage.renderView.objectAndLayerIdRenderHelper)throw new Error("has enable-feature:objectAndLayerId-rendering must be true");return this._stage.renderView.objectAndLayerIdRenderHelper.getColorToObjectAndLayerIdMapping()}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return ne.importLayerView(e)}hasLayerViewModule(e){return ne.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=Ke(this.type);const t=has("safari");if(t&&t<9&&(e=new a("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw d.getLogger(this.declaredClass).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=e?se(e):null}getSpatialReferenceSupport({spatialReference:e,layer:t}){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,ie.Local),s=this._validateSpatialReferenceForViewingMode(e,t,ie.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,ie.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Je(e,i)&&(null==t||(!!N(t)||(!Q(t)||null!=Ie(t,e,i))&&(!$(t)||i!==ie.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const r=e.isWebMercator,s=e.isWGS84;if(N(t)&&(r||s)){return!s||i===ie.Local||null===Le(t.tileInfo,t.fullExtent,e,ie.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:st.WebMercator,viewingMode:i}]:[{spatialReference:r?st.WGS84:st.WebMercator,viewingMode:i}]}return Q(t)||$(t)||!r&&!s?Q(t)&&r&&i!==ie.Global?[{spatialReference:e,viewingMode:i},{spatialReference:st.WGS84,viewingMode:ie.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?st.WGS84:st.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport({spatialReference:e}),i=this._predeterminedViewingMode;return t||(null!=i?d.getLogger(this.declaredClass).warnOnce(`Spatial reference defined on view not supported in ${re(i)} viewing mode.`):e.isGeographic&&d.getLogger(this.declaredClass).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}computeMapPointFromVec3d(e,t){let i=this.spatialReference||st.WGS84;return H(e,this.renderSpatialReference,e,i)||(i=st.WGS84,H(e,this.renderSpatialReference,e,i)),t?(t.x=e[0],t.y=e[1],t.z=e[2],t.spatialReference=i):t=new nt(e,i),t}trackGraphicState(e){if(!e.graphic)return d.getLogger(this.declaredClass).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,null!=i&&(i.remove(),i=null)}}}highlight(e){if(Array.isArray(e))return l(e.map((e=>this.highlight(e))));if(s.isCollection(e))return l(e.toArray().map((e=>this.highlight(e))));const t=this.getViewForGraphic(e);return t&&"highlight"in t?t.highlight(e):p()}maskOccludee(e){if(!e)return d.getLogger(this.declaredClass).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ze(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),{remove:()=>{r=!0,null!=i&&(i.remove(),i=null)}}}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){if(e.layer===this)return await v((()=>this.graphicsView)),this.graphicsView;if(!e.layer||!this.map)throw new a("no-view-for-graphic");return t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer)}externalToInternalIntersectOptions(e){const t=this._externalToInternalRenderItems(e.include,ht.INCLUDE),i=this._externalToInternalRenderItems(e.exclude,ht.EXCLUDE);return{include:t.layerUids,exclude:i.layerUids,graphics:{include:t.graphicUids,exclude:i.graphicUids}}}_intersectResultToMapPoint(e,t){return e.getIntersectionPoint(dt)?(t=this.computeMapPointFromVec3d(dt,t),e.intersector===Ue.TERRAIN&&this.basemapTerrain&&(t.z=_e(this.basemapTerrain,t)??0),t):null}_intersectResultsToHits(e,t){const i=new Array;let r=null;for(let s=0;s<e.length;s++){const n=e[s],a=We(n,this);if(null!=a&&(a===this.map.ground||"type"in a&&"integrated-mesh"===a.type))break;const o=Fe(n,this);if(null==o)continue;if("graphic"===o.type){if(null==r&&s!==e.length-1&&(r=new Set),null!=r){const e=this._getGraphicFilterUid(o.graphic);if(r.has(e))continue;r.add(e)}if(!this._testGraphicUidFilter(t,o.graphic))continue}const l=this._intersectResultToMapPoint(n),p=n.distanceInRenderSpace;i.push({...o,mapPoint:l,distance:p})}return i}_getGraphicFilterUid(e){const t=e.sourceLayer,i=e.layer,r=t&&"objectIdField"in t?t:i&&"objectIdField"in i?i:t;if(r){const t=r.objectIdField??B,i=e.attributes?.[t];if(i)return`o-${r.id}-${i}`}return`u-${e.uid}`}_testGraphicUidFilter(e,t){const i=this._getGraphicFilterUid(t);return null==e||(null==e.include||e.include.has(i))&&(null==e.exclude||!e.exclude.has(i))}_externalToInternalRenderItems(e,t,r={layerUids:void 0,graphicUids:void 0}){if(!e)return r;if(e instanceof i)lt(r,this._getGraphicFilterUid(e)),t===ht.INCLUDE&&(null!=this.graphicsView&&e.layer===this?ot(r,this.graphicsView.processor.layer.id):e.layer&&ot(r,e.layer.uid));else if(h(e))for(const i of e)i===this.graphics&&null!=this.graphicsView?ot(r,this.graphicsView.processor.layer.id):i===this.map.ground?ot(r,ke):this._externalToInternalRenderItems(i,t,r);else"uid"in e&&ot(r,e.uid);return r}_initBasemapTerrain(){this._set("basemapTerrain",new je({view:this})),this._set("elevationProvider",new fe({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Oe({view:this})),this._set("featureTiles",new ue({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?G(F(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;null!=this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>we.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&we.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||we.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),w),this.updatingHandles.add((()=>this.clippingArea),e,w),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,w)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new Me(this.map,e));const t=this.state.isGlobal,i=q(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Re.create(this.state.viewingMode,i)),t||this.addHandles(y((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!U(e,this.basemapTerrain.spatialReference,ut,t)||(this.renderCoordsHelper.extent=ut)}),_),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(Ae/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===u.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(y((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),_),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t){if(!this.overlay||!this.overlay.hasVisibleItems)return t;const i=e.getContext("2d");return i.putImageData(t,0,0),this.overlay.renderCanvas(e),i.getImageData(0,0,t.width,t.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t)=>this._renderScreenshotOverlay(e,t)}},t=new ye(this.state.viewingMode,(e=>this._stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=n(this.surface);this._stage=new Pe({view:this,options:e,container:i}),this._stage.renderer.setParameters({slicePlane:this.slicePlane}),this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.antialiasingEnabled),(()=>this._stage.renderer.setParameters({antialiasingEnabled:this.qualitySettings.antialiasingEnabled})),f),this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this._stage.renderer.setParameters({highQualityTransparency:e})),f),y((()=>this.magnifier),(e=>this._stage.renderView.magnifier=e),w),this.on("pointer-move",(()=>this._stage?.renderer.resetAnimation())),o(this._stage.renderView.canvas,"webglcontextlost",(e=>this.fatalError=new a("webgl-context-lost",e.statusMessage)))],"stage");const r=()=>{this._stage.renderer.setParameters({defaultHighlightOptions:be.toEngineOptions(this.highlightOptions)})};this.addHandles(this.updatingHandles.add((()=>[this.highlightOptions.color,this.highlightOptions.haloColor,this.highlightOptions.haloOpacity,this.highlightOptions.fillOpacity,this.highlightOptions.shadowOpacity,this.highlightOptions.shadowColor,this.highlightOptions.shadowDifference]),r),"stage"),r(),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(Ae/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=c(this._stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Te({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;g(e),await v((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=se(this.viewingMode);if(e===ie.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(m((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const e=this.get("map.initialViewProperties.environment");e&&(this.environment=e)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const t=this._resolveWhenReady;this._resolveWhenReady=[],t.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(ke);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(ke);for(const e of this.map.allLayers.items)"integrated-mesh"===e.type&&e.opacity<1&&this._defaultHitTestOptions.exclude.add(e.uid)}}addVoxelLayerViewToWasm(e){return null==this.voxelWasm?(null==this.voxelWasmPromise&&(this.voxelWasmPromise=import("../layers/VoxelWasmPerSceneView.js").then((e=>(this.voxelWasm=new e.default(this),this.voxelWasm)))),this.voxelWasmPromise.then((t=>t.addVoxelLayer(e)))):this.voxelWasm.addVoxelLayer(e)}removeVoxelLayerViewFromWasm(e){if(null!=this.voxelWasm){this.voxelWasm.removeVoxelLayer(e)<1&&(this.voxelWasm=null,this.voxelWasmPromise=null)}}};function ot(e,t){e.layerUids||(e.layerUids=new Set),e.layerUids.add(t)}function lt(e,t){e.graphicUids||(e.graphicUids=new Set),e.graphicUids.add(t)}function pt(e,t){return null!=e&&A(e.spatialReference,t)?G(e,t):null}var ht;at.type="3d",e([V()],at.prototype,"_userClippingArea",void 0),e([V()],at.prototype,"_resourceController",void 0),e([V()],at.prototype,"_stage",void 0),e([V({readOnly:!0})],at.prototype,"deconflictor",void 0),e([V({readOnly:!0})],at.prototype,"labeler",void 0),e([V(I(X,"analyses"))],at.prototype,"analyses",void 0),e([V({type:te,readOnly:!0})],at.prototype,"animation",null),e([V({readOnly:!0})],at.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],at.prototype,"elevationProvider",void 0),e([V()],at.prototype,"camera",null),e([V({type:t})],at.prototype,"contentCamera",null),e([V({readOnly:!0})],at.prototype,"canvas",void 0),e([V({type:nt})],at.prototype,"center",null),e([V({type:rt})],at.prototype,"clippingArea",null),e([V({type:oe})],at.prototype,"constraints",void 0),e([V({type:rt,readOnly:!0})],at.prototype,"renderDataExtent",null),e([V({type:rt,readOnly:!0})],at.prototype,"dataExtent",null),e([V({type:rt,readOnly:!0})],at.prototype,"_groundAndLayersExtent",null),e([V({value:null,type:le})],at.prototype,"environment",null),e([x("environment")],at.prototype,"castEnvironment",null),e([V({readOnly:!0})],at.prototype,"environmentManager",void 0),e([V({type:rt})],at.prototype,"extent",null),e([V()],at.prototype,"floors",void 0),e([V()],at.prototype,"screenCenter",null),e([V()],at.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],at.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],at.prototype,"graphicsView",void 0),e([V({readOnly:!0})],at.prototype,"analysisViewManager",void 0),e([V()],at.prototype,"groundView",void 0),e([V({type:Boolean})],at.prototype,"initialExtentRequired",null),e([V()],at.prototype,"_defaultsFromMapSettings",null),e([V()],at.prototype,"interacting",null),e([V()],at.prototype,"stationary",null),e([V()],at.prototype,"navigating",null),e([V()],at.prototype,"map",void 0),e([V({readOnly:!0})],at.prototype,"mapCoordsHelper",void 0),e([V()],at.prototype,"padding",null),e([V({type:Oe,readOnly:!0})],at.prototype,"pointsOfInterest",void 0),e([V({type:ue,readOnly:!0})],at.prototype,"featureTiles",void 0),e([V()],at.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],at.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],at.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],at.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],at.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],at.prototype,"state",void 0),e([V({readOnly:!0})],at.prototype,"inputManager",void 0),e([V({readOnly:!0})],at.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],at.prototype,"qualityProfile",null),e([V({type:Ce,get(){let e=this._get("qualitySettings");return e||(e=new Ce,ve.apply(this.qualityProfile,e)),e}})],at.prototype,"qualitySettings",void 0),e([V()],at.prototype,"slicePlane",null),e([V({readOnly:!0})],at.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],at.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],at.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],at.prototype,"resolution",null),e([V({type:Number})],at.prototype,"scale",null),e([V()],at.prototype,"heightModelInfo",null),e([V()],at.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],at.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],at.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],at.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],at.prototype,"type",void 0),e([V(),x((e=>e instanceof et?e:j(tt,e)))],at.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.hasPendingInputs","toolViewManager.updating","analysisViewManager.updating","state.mode"]})],at.prototype,"updating",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],at.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],at.prototype,"viewingMode",null),e([V({type:r})],at.prototype,"viewpoint",null),e([V({type:Number})],at.prototype,"zoom",null),e([V({type:be})],at.prototype,"highlightOptions",void 0),at=e([T("esri.views.SceneView")],at),function(e){e[e.INCLUDE=0]="INCLUDE",e[e.EXCLUDE=1]="EXCLUDE"}(ht||(ht={}));const dt=E(),ct=C(),ut=D(),gt=at;export{gt 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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Logger.js";import{isSome as r}from"../../core/maybe.js";import{unwrapUpdating as o,updating as i,isUpdating as n}from"../../core/maybeUpdating.js";import{whenOnce as l}from"../../core/reactiveUtils.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{project as m,canProjectWithoutEngine as p,isLoaded as u,load as y}from"../../geometry/projection.js";import c from"./LayerView.js";const g="esri.views.layers.SceneLayerView",d=t.getLogger(g);let h=class extends c{constructor(){super(...arguments),this.layer=null,this.filter=null,this._geometryEngine=null,this._projectionEngineLoaded=!1}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return o(this._layerFilter)}get _layerFilter(){const e=this.layer.filter;if(null==e||e.geometries.length<1)return null;const t=this._geometryEngine;if(null==t||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return i;const o=e.geometries.getItemAt(0).spatialReference,n=e.geometries.toArray().map((e=>{try{e=t.simplify(e)}catch(r){return d.warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(null==e)return null;if(e.spatialReference.equals(o))return e;try{return m(e,o)}catch(r){return d.warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),null}})).filter(r).sort(((e,t)=>e.extent.xmin-t.extent.xmin)),l=new Set,s=new Array,a=new Array;for(let r of n){const e=r.extent.xmin;if(s.length=0,l.forEach((o=>{if(e>=o.extent.xmax)return a.push(o),void l.delete(o);r.extent.ymin<=o.extent.ymax&&r.extent.ymax>=o.extent.ymin&&t.intersects(r,o)&&s.push(o)})),s.length>0){s.push(r);try{r=t.union(s)}catch(p){d.warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}s.pop(),s.forEach((e=>l.delete(e)))}l.add(r)}return l.forEach((e=>a.push(e))),a.length>0?{spatialRelationship:e.spatialRelationship,geometries:a}:null}get _filterNeedsProjectionEngine(){const e=this.layer.filter;if(null==e||e.geometries.length<=1)return!1;const t=e.geometries.getItemAt(0).spatialReference;return e.geometries.some((({spatialReference:e})=>!e.equals(t)&&!p(e,t)))}get layerFilterUpdating(){return n(this._layerFilter)}initialize(){l((()=>this.destroyed||!this._geometryEngine&&this.layer?.filter?.geometries?.length)).then((async()=>{this.destroyed||(this._geometryEngine=await import("../../geometry/geometryEngine.js"))})),this._projectionEngineLoaded=u(),l((()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)).then((async()=>{this.destroyed||(await y(),this._projectionEngineLoaded=!0)}))}destroy(){}highlight(e){throw new Error("Not implemented")}queryFeatures(e,t){throw new Error("Not implemented")}queryObjectIds(e,t){throw new Error("Not implemented")}queryFeatureCount(e,t){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,t){throw new Error("Not implemented")}};e([s()],h.prototype,"layer",void 0),e([s()],h.prototype,"availableFields",null),e([s()],h.prototype,"maximumNumberOfFeatures",null),e([s({readOnly:!0})],h.prototype,"maximumNumberOfFeaturesExceeded",null),e([s()],h.prototype,"filter",void 0),e([s({readOnly:!0})],h.prototype,"layerFilter",null),e([s({readOnly:!0})],h.prototype,"_layerFilter",null),e([s()],h.prototype,"_geometryEngine",void 0),e([s()],h.prototype,"_projectionEngineLoaded",void 0),e([s()],h.prototype,"_filterNeedsProjectionEngine",null),e([s()],h.prototype,"layerFilterUpdating",null),h=e([a(g)],h);const f=h;export{f as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Logger.js";import{isSome as r,abortMaybe as o}from"../../core/maybe.js";import{unwrapUpdating as i,updating as n,isUpdating as l}from"../../core/maybeUpdating.js";import{throwIfAbortError as s,throwIfNotAbortError as a}from"../../core/promiseUtils.js";import{whenOnce as m}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{project as u,canProjectWithoutEngine as y,isLoaded as g,load as d}from"../../geometry/projection.js";import h from"./LayerView.js";const f="esri.views.layers.SceneLayerView",w=t.getLogger(f);let E=class extends h{constructor(){super(...arguments),this.layer=null,this.filter=null,this._geometryEngine=null,this._projectionEngineLoaded=!1,this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return i(this._layerFilter)}get _layerFilter(){const e=this.layer.filter;if(null==e||e.geometries.length<1)return null;const t=this._geometryEngine;if(null==t||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return n;const o=e.geometries.getItemAt(0).spatialReference,i=e.geometries.toArray().map((e=>{try{e=t.simplify(e)}catch(r){return w.warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(null==e)return null;if(e.spatialReference.equals(o))return e;try{return u(e,o)}catch(r){return w.warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),null}})).filter(r).sort(((e,t)=>e.extent.xmin-t.extent.xmin)),l=new Set,s=new Array,a=new Array;for(let r of i){const e=r.extent.xmin;if(s.length=0,l.forEach((o=>{if(e>=o.extent.xmax)return a.push(o),void l.delete(o);r.extent.ymin<=o.extent.ymax&&r.extent.ymax>=o.extent.ymin&&t.intersects(r,o)&&s.push(o)})),s.length>0){s.push(r);try{r=t.union(s)}catch(m){w.warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}s.pop(),s.forEach((e=>l.delete(e)))}l.add(r)}return l.forEach((e=>a.push(e))),a.length>0?{spatialRelationship:e.spatialRelationship,geometries:a}:null}get _filterNeedsProjectionEngine(){const e=this.layer.filter;if(null==e||e.geometries.length<=1)return!1;const t=e.geometries.getItemAt(0).spatialReference;return e.geometries.some((({spatialReference:e})=>!e.equals(t)&&!y(e,t)))}get layerFilterUpdating(){return l(this._layerFilter)}initialize(){const{signal:e}=this._abortController;m((()=>this.destroyed||!this._geometryEngine&&this.layer?.filter?.geometries?.length),e).then((async()=>{s(e),this._geometryEngine=await import("../../geometry/geometryEngine.js")})).catch(a),this._projectionEngineLoaded=g(),m((()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine),e).then((async()=>{s(e),await d(),this._projectionEngineLoaded=!0})).catch(a)}destroy(){this._abortController=o(this._abortController)}highlight(e){throw new Error("Not implemented")}queryFeatures(e,t){throw new Error("Not implemented")}queryObjectIds(e,t){throw new Error("Not implemented")}queryFeatureCount(e,t){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,t){throw new Error("Not implemented")}};e([p()],E.prototype,"layer",void 0),e([p()],E.prototype,"availableFields",null),e([p()],E.prototype,"maximumNumberOfFeatures",null),e([p({readOnly:!0})],E.prototype,"maximumNumberOfFeaturesExceeded",null),e([p()],E.prototype,"filter",void 0),e([p({readOnly:!0})],E.prototype,"layerFilter",null),e([p({readOnly:!0})],E.prototype,"_layerFilter",null),e([p()],E.prototype,"_geometryEngine",void 0),e([p()],E.prototype,"_projectionEngineLoaded",void 0),e([p()],E.prototype,"_filterNeedsProjectionEngine",null),e([p()],E.prototype,"layerFilterUpdating",null),E=e([c(f)],E);const j=E;export{j 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.27/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{ShaderType as t}from"./enums.js";import e from"./reservedWordsGLSL3.js";import{shaderTranspiler as a}from"./testUtils.js";import{o as r,l as n,b as o}from"../../chunks/builtins.js";var i=999,s=9999,c=0,u=1,p=2,d=3,f=4,l=5,h=6,y=7,w=8,g=9,m=10,k=11,b=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function E(){var t,e,a,E=0,_=0,v=i,j=[],x=[],D=1,R=0,T=0,A=!1,G=!1,S="";return function(t){return x=[],null!==t?F(t.replace?t.replace(/\r\n/g,"\n"):t):L()};function X(t){t.length&&x.push({type:b[v],data:t,position:T,line:D,column:R})}function F(e){var r;for(E=0,a=(S+=e).length;t=S[E],E<a;){switch(r=E,v){case c:E=V();break;case u:E=P();break;case p:E=M();break;case d:E=O();break;case f:E=z();break;case k:E=$();break;case l:E=I();break;case s:E=U();break;case g:E=H();break;case i:E=C()}if(r!==E)if("\n"===S[r])R=0,++D;else++R}return _+=E,S=S.slice(E),x}function L(t){return j.length&&X(j.join("")),v=m,X("(eof)"),x}function C(){return j=j.length?[]:j,"/"===e&&"*"===t?(T=_+E-1,v=c,e=t,E+1):"/"===e&&"/"===t?(T=_+E-1,v=u,e=t,E+1):"#"===t?(v=p,T=_+E,E):/\s/.test(t)?(v=g,T=_+E,E):(A=/\d/.test(t),G=/[^\w_]/.test(t),T=_+E,v=A?f:G?d:s,E)}function H(){return/[^\s]/g.test(t)?(X(j.join("")),v=i,E):(j.push(t),e=t,E+1)}function M(){return"\r"!==t&&"\n"!==t||"\\"===e?(j.push(t),e=t,E+1):(X(j.join("")),v=i,E)}function P(){return M()}function V(){return"/"===t&&"*"===e?(j.push(t),X(j.join("")),v=i,E+1):(j.push(t),e=t,E+1)}function O(){if("."===e&&/\d/.test(t))return v=l,E;if("/"===e&&"*"===t)return v=c,E;if("/"===e&&"/"===t)return v=u,E;if("."===t&&j.length){for(;N(j););return v=l,E}if(";"===t||")"===t||"("===t){if(j.length)for(;N(j););return X(t),v=i,E+1}var a=2===j.length&&"="!==t;if(/[\w_\d\s]/.test(t)||a){for(;N(j););return v=i,E}return j.push(t),e=t,E+1}function N(t){for(var e,a,n=0;;){if(e=r.indexOf(t.slice(0,t.length+n).join("")),a=r[e],-1===e){if(n--+t.length>0)continue;a=t.slice(0,1).join("")}return X(a),T+=a.length,(j=j.slice(a.length)).length}}function $(){return/[^a-fA-F0-9]/.test(t)?(X(j.join("")),v=i,E):(j.push(t),e=t,E+1)}function z(){return"."===t||/[eE]/.test(t)?(j.push(t),v=l,e=t,E+1):"x"===t&&1===j.length&&"0"===j[0]?(v=k,j.push(t),e=t,E+1):/[^\d]/.test(t)?(X(j.join("")),v=i,E):(j.push(t),e=t,E+1)}function I(){return"f"===t&&(j.push(t),e=t,E+=1),/[eE]/.test(t)||"-"===t&&/[eE]/.test(e)?(j.push(t),e=t,E+1):/[^\d]/.test(t)?(X(j.join("")),v=i,E):(j.push(t),e=t,E+1)}function U(){if(/[^\d\w_]/.test(t)){var a=j.join("");return v=n.indexOf(a)>-1?w:o.indexOf(a)>-1?y:h,X(j.join("")),v=i,E}return j.push(t),e=t,E+1}}function _(t){var e=E(),a=[];return a=(a=a.concat(e(t))).concat(e(null))}function v(t){return _(t)}function j(t){return t.map((t=>"eof"!==t.type?t.data:"")).join("")}const x=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function D(t,e="100",a="300 es"){const r=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of t)if("preprocessor"===n.type){const t=r.exec(n.data);if(t){const r=t[1].replace(/\s\s+/g," ");if(r===a)return r;if(r===e)return n.data="#version "+a,e;throw new Error("unknown glsl version: "+r)}}return t.splice(0,0,{type:"preprocessor",data:"#version "+a},{type:"whitespace",data:"\n"}),null}function R(t,e){for(let a=e-1;a>=0;a--){const e=t[a];if("whitespace"!==e.type&&"block-comment"!==e.type){if("keyword"!==e.type)break;if("attribute"===e.data||"in"===e.data)return!0}}return!1}function T(t,e,a,r){r=r||a;for(const n of t)if("ident"===n.type&&n.data===a){r in e?e[r]++:e[r]=0;return T(t,e,r+"_"+e[r],r)}return a}function A(t,e,a="afterVersion"){function r(t,e){for(let a=e;a<t.length;a++){const e=t[a];if("operator"===e.type&&";"===e.data)return a}return null}function n(t){let e=-1,n=0,o=-1;for(let i=0;i<t.length;i++){const s=t[i];if("preprocessor"===s.type&&(s.data.match(/\#(if|ifdef|ifndef)\s+.+/)?++n:s.data.match(/\#endif\s*.*/)&&--n),"afterVersion"!==a&&"afterPrecision"!==a||"preprocessor"===s.type&&/^#version/.test(s.data)&&(o=Math.max(o,i)),"afterPrecision"===a&&"keyword"===s.type&&"precision"===s.data){const e=r(t,i);if(null===e)throw new Error("precision statement not followed by any semicolons!");o=Math.max(o,e)}e<o&&0===n&&(e=i)}return e+1}const o={data:"\n",type:"whitespace"},i=e=>e<t.length&&/[^\r\n]$/.test(t[e].data);let s=n(t);i(s-1)&&t.splice(s++,0,o);for(const c of e)t.splice(s++,0,c);i(s-1)&&i(s)&&t.splice(s,0,o)}function G(t,e,a,r="lowp"){A(t,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"keyword",data:a},{type:"whitespace",data:" "},{type:"ident",data:e},{type:"operator",data:";"}],"afterPrecision")}function S(t,e,a,r,n="lowp"){A(t,[{type:"keyword",data:"layout"},{type:"operator",data:"("},{type:"keyword",data:"location"},{type:"whitespace",data:" "},{type:"operator",data:"="},{type:"whitespace",data:" "},{type:"integer",data:r.toString()},{type:"operator",data:")"},{type:"whitespace",data:" "},{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:n},{type:"whitespace",data:" "},{type:"keyword",data:a},{type:"whitespace",data:" "},{type:"ident",data:e},{type:"operator",data:";"}],"afterPrecision")}function X(t,e){let a,r,n=-1;for(let o=e;o<t.length;o++){const e=t[o];if("operator"===e.type&&("["===e.data&&(a=o),"]"===e.data)){r=o;break}"integer"===e.type&&(n=parseInt(e.data,10))}return a&&r&&t.splice(a,r-a+1),n}function F(a,r){const n=C(a);if(null!=n)return n;const o=v(a);if("300 es"===D(o,"100","300 es"))return a;let i=null,s=null;const c={},u={};for(let p=0;p<o.length;++p){const a=o[p];switch(a.type){case"keyword":r===t.VERTEX_SHADER&&"attribute"===a.data?a.data="in":"varying"===a.data&&(a.data=r===t.VERTEX_SHADER?"out":"in");break;case"builtin":if(/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(a.data.trim())&&(a.data=a.data.replace(/(2D|Cube|EXT)/g,"")),r===t.FRAGMENT_SHADER&&"gl_FragColor"===a.data&&(i||(i=T(o,c,"fragColor"),G(o,i,"vec4")),a.data=i),r===t.FRAGMENT_SHADER&&"gl_FragData"===a.data){const t=X(o,p+1),e=T(o,c,"fragData");S(o,e,"vec4",t,"mediump"),a.data=e}else r===t.FRAGMENT_SHADER&&"gl_FragDepthEXT"===a.data&&(s||(s=T(o,c,"gl_FragDepth")),a.data=s);break;case"ident":if(e.includes(a.data)){if(r===t.VERTEX_SHADER&&R(o,p))throw new Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");a.data in u||(u[a.data]=T(o,c,a.data)),a.data=u[a.data]}}}for(let t=o.length-1;t>=0;--t){const e=o[t];if("preprocessor"===e.type){const a=e.data.match(/\#extension\s+(.*)\:/);if(a&&a[1]&&x.includes(a[1].trim())){const e=o[t+1];o.splice(t,e&&"whitespace"===e.type?2:1)}const r=e.data.match(/\#ifdef\s+(.*)/);r&&r[1]&&x.includes(r[1].trim())&&(e.data="#if 1");const n=e.data.match(/\#ifndef\s+(.*)/);n&&n[1]&&x.includes(n[1].trim())&&(e.data="#if 0")}}return H(a,j(o))}const L=new Map;function C(t){return a.enableCache?L.get(t):null}function H(t,e){return a.enableCache&&L.set(t,e),e}export{F as transpileShader};
5
+ import"../../core/has.js";import{ShaderType as t}from"./enums.js";import e from"./reservedWordsGLSL3.js";import{shaderTranspiler as a}from"./testUtils.js";import{o as r,l as n,b as o}from"../../chunks/builtins.js";var i=999,s=9999,c=0,u=1,p=2,d=3,f=4,l=5,h=6,y=7,w=8,g=9,m=10,k=11,b=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function E(){var t,e,a,E=0,_=0,v=i,j=[],x=[],D=1,R=0,T=0,A=!1,G=!1,S="";return function(t){return x=[],null!==t?F(t.replace?t.replace(/\r\n/g,"\n"):t):L()};function X(t){t.length&&x.push({type:b[v],data:t,position:T,line:D,column:R})}function F(e){var r;for(E=0,a=(S+=e).length;t=S[E],E<a;){switch(r=E,v){case c:E=V();break;case u:E=P();break;case p:E=M();break;case d:E=O();break;case f:E=$();break;case k:E=W();break;case l:E=z();break;case s:E=I();break;case g:E=H();break;case i:E=C()}if(r!==E)if("\n"===S[r])R=0,++D;else++R}return _+=E,S=S.slice(E),x}function L(t){return j.length&&X(j.join("")),v=m,X("(eof)"),x}function C(){return j=j.length?[]:j,"/"===e&&"*"===t?(T=_+E-1,v=c,e=t,E+1):"/"===e&&"/"===t?(T=_+E-1,v=u,e=t,E+1):"#"===t?(v=p,T=_+E,E):/\s/.test(t)?(v=g,T=_+E,E):(A=/\d/.test(t),G=/[^\w_]/.test(t),T=_+E,v=A?f:G?d:s,E)}function H(){return/[^\s]/g.test(t)?(X(j.join("")),v=i,E):(j.push(t),e=t,E+1)}function M(){return"\r"!==t&&"\n"!==t||"\\"===e?(j.push(t),e=t,E+1):(X(j.join("")),v=i,E)}function P(){return M()}function V(){return"/"===t&&"*"===e?(j.push(t),X(j.join("")),v=i,E+1):(j.push(t),e=t,E+1)}function O(){if("."===e&&/\d/.test(t))return v=l,E;if("/"===e&&"*"===t)return v=c,E;if("/"===e&&"/"===t)return v=u,E;if("."===t&&j.length){for(;N(j););return v=l,E}if(";"===t||")"===t||"("===t){if(j.length)for(;N(j););return X(t),v=i,E+1}var a=2===j.length&&"="!==t;if(/[\w_\d\s]/.test(t)||a){for(;N(j););return v=i,E}return j.push(t),e=t,E+1}function N(t){for(var e,a,n=0;;){if(e=r.indexOf(t.slice(0,t.length+n).join("")),a=r[e],-1===e){if(n--+t.length>0)continue;a=t.slice(0,1).join("")}return X(a),T+=a.length,(j=j.slice(a.length)).length}}function W(){return/[^a-fA-F0-9]/.test(t)?(X(j.join("")),v=i,E):(j.push(t),e=t,E+1)}function $(){return"."===t||/[eE]/.test(t)?(j.push(t),v=l,e=t,E+1):"x"===t&&1===j.length&&"0"===j[0]?(v=k,j.push(t),e=t,E+1):/[^\d]/.test(t)?(X(j.join("")),v=i,E):(j.push(t),e=t,E+1)}function z(){return"f"===t&&(j.push(t),e=t,E+=1),/[eE]/.test(t)||"-"===t&&/[eE]/.test(e)?(j.push(t),e=t,E+1):/[^\d]/.test(t)?(X(j.join("")),v=i,E):(j.push(t),e=t,E+1)}function I(){if(/[^\d\w_]/.test(t)){var a=j.join("");return v=n.indexOf(a)>-1?w:o.indexOf(a)>-1?y:h,X(j.join("")),v=i,E}return j.push(t),e=t,E+1}}function _(t){var e=E(),a=[];return a=(a=a.concat(e(t))).concat(e(null))}function v(t){return _(t)}function j(t){return t.map((t=>"eof"!==t.type?t.data:"")).join("")}const x=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function D(t,e="100",a="300 es"){const r=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of t)if("preprocessor"===n.type){const t=r.exec(n.data);if(t){const r=t[1].replace(/\s\s+/g," ");if(r===a)return r;if(r===e)return n.data="#version "+a,e;throw new Error("unknown glsl version: "+r)}}return t.splice(0,0,{type:"preprocessor",data:"#version "+a},{type:"whitespace",data:"\n"}),null}function R(t,e){for(let a=e-1;a>=0;a--){const e=t[a];if("whitespace"!==e.type&&"block-comment"!==e.type){if("keyword"!==e.type)break;if("attribute"===e.data||"in"===e.data)return!0}}return!1}function T(t,e,a,r){r=r||a;for(const n of t)if("ident"===n.type&&n.data===a){r in e?e[r]++:e[r]=0;return T(t,e,r+"_"+e[r],r)}return a}function A(t,e,a="afterVersion"){function r(t,e){for(let a=e;a<t.length;a++){const e=t[a];if("operator"===e.type&&";"===e.data)return a}return null}function n(t){let e=-1,n=0,o=-1;for(let i=0;i<t.length;i++){const s=t[i];if("preprocessor"===s.type&&(s.data.match(/\#(if|ifdef|ifndef)\s+.+/)?++n:s.data.match(/\#endif\s*.*/)&&--n),"afterVersion"!==a&&"afterPrecision"!==a||"preprocessor"===s.type&&/^#version/.test(s.data)&&(o=Math.max(o,i)),"afterPrecision"===a&&"keyword"===s.type&&"precision"===s.data){const e=r(t,i);if(null===e)throw new Error("precision statement not followed by any semicolons!");o=Math.max(o,e)}e<o&&0===n&&(e=i)}return e+1}const o={data:"\n",type:"whitespace"},i=e=>e<t.length&&/[^\r\n]$/.test(t[e].data);let s=n(t);i(s-1)&&t.splice(s++,0,o);for(const c of e)t.splice(s++,0,c);i(s-1)&&i(s)&&t.splice(s,0,o)}function G(t,e,a,r="lowp"){A(t,[{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:r},{type:"whitespace",data:" "},{type:"keyword",data:a},{type:"whitespace",data:" "},{type:"ident",data:e},{type:"operator",data:";"}],"afterPrecision")}function S(t,e,a,r,n="lowp"){A(t,[{type:"keyword",data:"layout"},{type:"operator",data:"("},{type:"keyword",data:"location"},{type:"whitespace",data:" "},{type:"operator",data:"="},{type:"whitespace",data:" "},{type:"integer",data:r.toString()},{type:"operator",data:")"},{type:"whitespace",data:" "},{type:"keyword",data:"out"},{type:"whitespace",data:" "},{type:"keyword",data:n},{type:"whitespace",data:" "},{type:"keyword",data:a},{type:"whitespace",data:" "},{type:"ident",data:e},{type:"operator",data:";"}],"afterPrecision")}function X(t,e){let a,r,n=-1;for(let o=e;o<t.length;o++){const e=t[o];if("operator"===e.type&&("["===e.data&&(a=o),"]"===e.data)){r=o;break}"integer"===e.type&&(n=parseInt(e.data,10))}return a&&r&&t.splice(a,r-a+1),n}function F(a,r){if(a.startsWith("#version 300"))return a;const n=C(a);if(null!=n)return n;const o=v(a);if("300 es"===D(o,"100","300 es"))return a;let i=null,s=null;const c={},u={};for(let p=0;p<o.length;++p){const a=o[p];switch(a.type){case"keyword":r===t.VERTEX_SHADER&&"attribute"===a.data?a.data="in":"varying"===a.data&&(a.data=r===t.VERTEX_SHADER?"out":"in");break;case"builtin":if(/^texture(2D|Cube)(Proj)?(Lod|Grad)?(EXT)?$/.test(a.data.trim())&&(a.data=a.data.replace(/(2D|Cube|EXT)/g,"")),r===t.FRAGMENT_SHADER&&"gl_FragColor"===a.data&&(i||(i=T(o,c,"fragColor"),G(o,i,"vec4")),a.data=i),r===t.FRAGMENT_SHADER&&"gl_FragData"===a.data){const t=X(o,p+1),e=T(o,c,"fragData");S(o,e,"vec4",t,"mediump"),a.data=e}else r===t.FRAGMENT_SHADER&&"gl_FragDepthEXT"===a.data&&(s||(s=T(o,c,"gl_FragDepth")),a.data=s);break;case"ident":if(e.includes(a.data)){if(r===t.VERTEX_SHADER&&R(o,p))throw new Error("attribute in vertex shader uses a name that is a reserved word in glsl 300 es");a.data in u||(u[a.data]=T(o,c,a.data)),a.data=u[a.data]}}}for(let t=o.length-1;t>=0;--t){const e=o[t];if("preprocessor"===e.type){const a=e.data.match(/\#extension\s+(.*)\:/);if(a&&a[1]&&x.includes(a[1].trim())){const e=o[t+1];o.splice(t,e&&"whitespace"===e.type?2:1)}const r=e.data.match(/\#ifdef\s+(.*)/);r&&r[1]&&x.includes(r[1].trim())&&(e.data="#if 1");const n=e.data.match(/\#ifndef\s+(.*)/);n&&n[1]&&x.includes(n[1].trim())&&(e.data="#if 0")}}return H(a,j(o))}const L=new Map;function C(t){return a.enableCache?L.get(t):null}function H(t,e){return a.enableCache&&L.set(t,e),e}export{F as transpileShader};
package/widgets/Expand.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.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import s from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as r}from"./support/componentsUtils.js";import{isWidget as i,hasDomNode as a}from"./support/widget.js";import{tsx as d}from"./support/jsxFactory.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{accessibleHandler as p}from"./support/decorators/accessibleHandler.js";const c="esri-expand",u={base:`${c} esri-widget`,modeAuto:`${c}--auto`,modeDrawer:`${c}--drawer`,modeFloating:`${c}--floating`,container:`${c}__container`,containerExpanded:`${c}__container--expanded`,panel:`${c}__panel`,button:"esri-widget--button",text:"esri-icon-font-fallback-text",icon:"esri-collapse__icon",iconExpanded:`${c}__icon--expanded`,iconNumber:`${c}__icon-number`,iconNumberExpanded:`${c}__icon-number--expanded`,expandIcon:"esri-icon-expand",collapseIcon:"esri-icon-collapse",content:`${c}__content`,contentExpanded:`${c}__content--expanded`,expandMask:`${c}__mask`,expandMaskExpanded:`${c}__mask--expanded`};let h=class extends n{constructor(e,t){super(e,t),this.closeOnEsc=!0,this.collapseIcon=null,this.collapseTooltip="",this.content="",this.expandIcon=null,this.expandTooltip="",this.iconClass=null,this.icon=null,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.viewModel=new s,this._handleKeyDown=e=>{const{closeOnEsc:t,_toggleButtonEl:o,expanded:n}=this;if(!n||!t||e.target===o||"Escape"!==e.key)return;("function"==typeof t?t(e):t)&&(this.expanded=!1,o?.focus())}}loadDependencies(){return r({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}get contentId(){return`${this.id}_controls_content`}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIconClass(){return u.collapseIcon}set collapseIconClass(e){this._overrideIfSome("collapseIconClass",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIconClass(){return i(this.content)?this.content.iconClass:u.expandIcon}set expandIconClass(e){this._overrideIfSome("expandIconClass",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}toggle(){this.viewModel.expanded=!this.viewModel.expanded}render(){const{mode:e}=this,t={[u.modeAuto]:"auto"===e,[u.modeDrawer]:"drawer"===e,[u.modeFloating]:"floating"===e};return d("div",{class:this.classes(u.base,t),onkeydown:this._handleKeyDown},this._renderMask(),this._renderContainer())}_renderContainer(){const{expanded:e}=this,t={[u.containerExpanded]:e};return d("div",{class:this.classes(u.container,t)},this._renderPanel(),this._renderContent())}_renderMask(){const{expanded:e}=this,t={[u.expandMaskExpanded]:e};return d("div",{bind:this,onclick:this._toggle,class:this.classes(u.expandMask,t)})}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?d("span",{key:"expand__icon-number",class:u.iconNumber},t):null}_renderPanelNumber(){const{iconNumber:e,expanded:t}=this;return e&&t?d("span",{key:"expand__expand-icon-number",class:this.classes(u.iconNumber,u.iconNumberExpanded)},e):null}_renderIcon(){const e=(this.expanded?this.collapseIcon:this.expandIcon)??"";return d("calcite-icon",{class:u.icon,icon:e,scale:"s"})}_renderLegacyIcon(){const{collapseIconClass:e,expandIconClass:t,expanded:o}=this,n={[u.iconExpanded]:o};return null!=t&&(n[t]=!o),null!=e&&(n[e]=e===t||o),d("span",{"aria-hidden":"true",class:this.classes(u.icon,n)})}_renderTitle(){return d("span",{class:u.text},this.expandTitle)}_renderExpandButton(){const{expanded:e,expandTitle:t,contentId:o}=this;return d("div",{afterCreate:this._storeToggleButtonEl,"aria-controls":o,"aria-expanded":e?"true":"false",bind:this,class:u.button,onclick:this._toggle,onkeydown:this._toggle,role:"button",tabindex:"0",title:t},this._renderBadgeNumber(),null!=this.expandIcon||null!=this.collapseIcon?this._renderIcon():this._renderLegacyIcon(),this._renderTitle())}_renderPanel(){return d("div",{class:u.panel},this._renderExpandButton(),this._renderPanelNumber())}_renderContent(){const{expanded:e,contentId:t,content:o}=this,n={[u.contentExpanded]:e},s={id:t,role:"region",class:this.classes(u.content,n)};return"string"==typeof o?d("div",{key:"content__string",innerHTML:o,...s}):i(o)?d("div",{key:"content__widget",...s},o.render()):o instanceof HTMLElement?d("div",{key:"content__html-element",bind:o,afterCreate:this._attachToNode,...s}):a(o)?d("div",{key:"content__node",bind:o.domNode,afterCreate:this._attachToNode,...s}):null}_toggle(){this.toggle()}_attachToNode(e){const t=this;e.appendChild(t)}_storeToggleButtonEl(e){this._toggleButtonEl=e}};e([t({readOnly:!0})],h.prototype,"contentId",null),e([t({readOnly:!0})],h.prototype,"expandTitle",null),e([t()],h.prototype,"autoCollapse",null),e([t()],h.prototype,"closeOnEsc",void 0),e([t()],h.prototype,"collapseIconClass",null),e([t()],h.prototype,"collapseIcon",void 0),e([t()],h.prototype,"collapseTooltip",void 0),e([t()],h.prototype,"content",void 0),e([t()],h.prototype,"expanded",null),e([t()],h.prototype,"expandIconClass",null),e([t()],h.prototype,"expandIcon",void 0),e([t()],h.prototype,"expandTooltip",void 0),e([t()],h.prototype,"group",null),e([t()],h.prototype,"iconClass",void 0),e([t()],h.prototype,"icon",void 0),e([t()],h.prototype,"iconNumber",void 0),e([t()],h.prototype,"label",null),e([t(),l("esri/widgets/Expand/t9n/Expand")],h.prototype,"messages",void 0),e([t(),l("esri/t9n/common")],h.prototype,"messagesCommon",void 0),e([t()],h.prototype,"mode",void 0),e([t()],h.prototype,"view",null),e([t({type:s})],h.prototype,"viewModel",void 0),e([p()],h.prototype,"_toggle",null),h=e([o("esri.widgets.Expand")],h);const x=h;export{x as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import s from"./Expand/ExpandViewModel.js";import{loadCalciteComponents as r}from"./support/componentsUtils.js";import{isWidget as i,hasDomNode as a}from"./support/widget.js";import{tsx as d}from"./support/jsxFactory.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{accessibleHandler as p}from"./support/decorators/accessibleHandler.js";const c="esri-expand",u={base:`${c} esri-widget`,modeAuto:`${c}--auto`,modeDrawer:`${c}--drawer`,modeFloating:`${c}--floating`,container:`${c}__container`,containerExpanded:`${c}__container--expanded`,panel:`${c}__panel`,button:"esri-widget--button",text:"esri-icon-font-fallback-text",icon:"esri-collapse__icon",iconExpanded:`${c}__icon--expanded`,iconNumber:`${c}__icon-number`,iconNumberExpanded:`${c}__icon-number--expanded`,expandIcon:"esri-icon-expand",collapseIcon:"esri-icon-collapse",content:`${c}__content`,contentExpanded:`${c}__content--expanded`,expandMask:`${c}__mask`,expandMaskExpanded:`${c}__mask--expanded`};let h=class extends n{constructor(e,t){super(e,t),this.closeOnEsc=!0,this.collapseIcon=null,this.collapseTooltip="",this.content="",this.expandIcon=null,this.expandTooltip="",this.iconClass=null,this.icon=null,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.viewModel=new s,this._handleKeyDown=e=>{const{closeOnEsc:t,_toggleButtonEl:o,expanded:n}=this;if(!n||!t||e.target===o||"Escape"!==e.key)return;("function"==typeof t?t(e):t)&&(this.expanded=!1,o?.focus())}}loadDependencies(){return r({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js")})}get contentId(){return`${this.id}_controls_content`}get expandTitle(){const{expanded:e,messagesCommon:t,collapseTooltip:o,expandTooltip:n}=this;return(e?o||t?.collapse:n||t?.expand)??""}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIconClass(){return u.collapseIcon}set collapseIconClass(e){this._overrideIfSome("collapseIconClass",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIconClass(){return i(this.content)?this.content.iconClass:u.expandIcon}set expandIconClass(e){this._overrideIfSome("expandIconClass",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}toggle(){this.viewModel.expanded=!this.viewModel.expanded}render(){const{mode:e}=this,t={[u.modeAuto]:"auto"===e,[u.modeDrawer]:"drawer"===e,[u.modeFloating]:"floating"===e};return d("div",{class:this.classes(u.base,t),onkeydown:this._handleKeyDown},this._renderMask(),this._renderContainer())}_renderContainer(){const{expanded:e}=this,t={[u.containerExpanded]:e};return d("div",{class:this.classes(u.container,t)},this._renderPanel(),this._renderContent())}_renderMask(){const{expanded:e}=this,t={[u.expandMaskExpanded]:e};return d("div",{bind:this,onclick:this._toggle,class:this.classes(u.expandMask,t)})}_renderBadgeNumber(){const{expanded:e,iconNumber:t}=this;return t&&!e?d("span",{key:"expand__icon-number",class:u.iconNumber},t):null}_renderPanelNumber(){const{iconNumber:e,expanded:t}=this;return e&&t?d("span",{key:"expand__expand-icon-number",class:this.classes(u.iconNumber,u.iconNumberExpanded)},e):null}_renderIcon(){const e=(this.expanded?this.collapseIcon:this.expandIcon)??"";return d("calcite-icon",{key:"icon",icon:e,scale:"s"})}_renderLegacyIcon(){const{collapseIconClass:e,expandIconClass:t,expanded:o}=this,n={[u.iconExpanded]:o};return null!=t&&(n[t]=!o),null!=e&&(n[e]=e===t||o),d("span",{key:"legacy-icon","aria-hidden":"true",class:this.classes(u.icon,n)})}_renderTitle(){return d("span",{class:u.text},this.expandTitle)}_renderExpandButton(){const{expanded:e,expandTitle:t,expandIcon:o,collapseIcon:n,contentId:s}=this;return d("div",{afterCreate:this._storeToggleButtonEl,"aria-controls":s,"aria-expanded":e?"true":"false",bind:this,class:u.button,onclick:this._toggle,onkeydown:this._toggle,role:"button",tabindex:"0",title:t},this._renderBadgeNumber(),!e&&null!=o||e&&null!=n?this._renderIcon():this._renderLegacyIcon(),this._renderTitle())}_renderPanel(){return d("div",{class:u.panel},this._renderExpandButton(),this._renderPanelNumber())}_renderContent(){const{expanded:e,contentId:t,content:o}=this,n={[u.contentExpanded]:e},s={id:t,role:"region",class:this.classes(u.content,n)};return"string"==typeof o?d("div",{key:"content__string",innerHTML:o,...s}):i(o)?d("div",{key:"content__widget",...s},o.render()):o instanceof HTMLElement?d("div",{key:"content__html-element",bind:o,afterCreate:this._attachToNode,...s}):a(o)?d("div",{key:"content__node",bind:o.domNode,afterCreate:this._attachToNode,...s}):null}_toggle(){this.toggle()}_attachToNode(e){const t=this;e.appendChild(t)}_storeToggleButtonEl(e){this._toggleButtonEl=e}};e([t({readOnly:!0})],h.prototype,"contentId",null),e([t({readOnly:!0})],h.prototype,"expandTitle",null),e([t()],h.prototype,"autoCollapse",null),e([t()],h.prototype,"closeOnEsc",void 0),e([t()],h.prototype,"collapseIconClass",null),e([t()],h.prototype,"collapseIcon",void 0),e([t()],h.prototype,"collapseTooltip",void 0),e([t()],h.prototype,"content",void 0),e([t()],h.prototype,"expanded",null),e([t()],h.prototype,"expandIconClass",null),e([t()],h.prototype,"expandIcon",void 0),e([t()],h.prototype,"expandTooltip",void 0),e([t()],h.prototype,"group",null),e([t()],h.prototype,"iconClass",void 0),e([t()],h.prototype,"icon",void 0),e([t()],h.prototype,"iconNumber",void 0),e([t()],h.prototype,"label",null),e([t(),l("esri/widgets/Expand/t9n/Expand")],h.prototype,"messages",void 0),e([t(),l("esri/t9n/common")],h.prototype,"messagesCommon",void 0),e([t()],h.prototype,"mode",void 0),e([t()],h.prototype,"view",null),e([t({type:s})],h.prototype,"viewModel",void 0),e([p()],h.prototype,"_toggle",null),h=e([o("esri.widgets.Expand")],h);const x=h;export{x as default};