@arcgis/core 6.0.0-next.58 → 6.0.0-next.59

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 (73) hide show
  1. package/Graphic.d.ts +1 -0
  2. package/applications/SceneViewer/sceneViewerUtils.d.ts +74 -0
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/arcgisGlobal.d.ts +2 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{5e4de4ddd3bdc74100e0.js → 75667b1427a7f02f2cda.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{b4018b21a03c0c909d23.js → 75a48b122254deb3ad59.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{690041373d03d02a3044.js → 956810d6f553c2198aae.js} +1 -1
  9. package/assets/esri/core/workers/chunks/a27c2edd7e043643cdd1.js +1 -0
  10. package/assets/esri/core/workers/chunks/bd8ee0205f0a01d6d4d7.js +1 -0
  11. package/assets/esri/core/workers/chunks/{423c7a981b9a06b76cbd.js → d833fc1fe63c9917ae3e.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{32d5aae2e0953420216a.js → dca6abf260c0bfb7c9c0.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{fc8cb947a677aa12348d.js → e38ffdb19132529beda7.js} +1 -1
  14. package/chunks/BlurEmission.glsl.js +6 -6
  15. package/chunks/EmissionComposite.glsl.js +2 -2
  16. package/chunks/Fog.glsl.js +4 -4
  17. package/chunks/RibbonLine.glsl.js +154 -108
  18. package/config.js +1 -1
  19. package/core/urlUtils.js +1 -1
  20. package/interfaces.d.ts +8 -0
  21. package/kernel.js +1 -1
  22. package/layers/graphics/sources/CSVSource.js +1 -1
  23. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  24. package/layers/raster/formats/tiffParser.js +1 -1
  25. package/package.json +2 -2
  26. package/popup/FeatureModel.js +1 -1
  27. package/popup/FeaturesModel.js +1 -1
  28. package/rest/support/AttributeBinsQuery.d.ts +41 -1
  29. package/rest/support/AttributeBinsQuery.js +1 -1
  30. package/rest/support/Query.d.ts +1 -2
  31. package/rest/versionManagement/gdbVersion/post.js +1 -1
  32. package/rest/versionManagement/gdbVersion/reconcile.js +1 -1
  33. package/rest/versionManagement/gdbVersion/serverVersionUtils.js +1 -1
  34. package/rest/versionManagement/gdbVersion/support/PostResult.d.ts +1 -1
  35. package/rest/versionManagement/gdbVersion/support/ReconcileResult.d.ts +1 -1
  36. package/smartMapping/statistics/histogram.js +1 -1
  37. package/smartMapping/statistics/types.d.ts +18 -0
  38. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  39. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  40. package/symbols/LineSymbol3DLayer.js +1 -1
  41. package/tables/support/templateUtils.js +1 -1
  42. package/versionManagement/VersionManagementService.d.ts +47 -1
  43. package/versionManagement/VersionManagementService.js +1 -1
  44. package/versionManagement/support/PostJobInfo.d.ts +61 -0
  45. package/versionManagement/support/PostJobInfo.js +2 -0
  46. package/versionManagement/support/ReconcileJobInfo.d.ts +61 -0
  47. package/versionManagement/support/ReconcileJobInfo.js +2 -0
  48. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  49. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  50. package/views/3d/terrain/OverlayRenderer.js +1 -1
  51. package/views/3d/terrain/PatchGeometry.js +1 -1
  52. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  53. package/views/3d/terrain/TerrainRenderer.js +1 -1
  54. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
  55. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +21 -12
  56. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  57. package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
  58. package/views/3d/webgl-engine/effects/glow/BlurEmission.glsl.js +1 -1
  59. package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +20 -15
  60. package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
  61. package/views/3d/webgl-engine/lib/TriangleRangeBVH.js +1 -1
  62. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  63. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  64. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  65. package/views/Attribution.js +2 -2
  66. package/views/DOMContainer.d.ts +3 -2
  67. package/views/DOMContainer.js +1 -1
  68. package/views/SceneView.js +1 -1
  69. package/views/View.d.ts +2 -2
  70. package/views/View.js +1 -1
  71. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  72. package/assets/esri/core/workers/chunks/294097140e349e073b7e.js +0 -1
  73. package/assets/esri/core/workers/chunks/6a202ef9ba9b89e09153.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{copy as e,set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as r,subtract as i,dot as a,scale as o,add as s,copy as c,length as l,distance as u,lerp as d,transformMat4 as f,normalize as p,applyTranslation as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import _ from"../../../../core/Logger.js";import{clamp as v}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as y,createScreenPointArray as b}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as x,Seconds as S}from"../../../../core/time.js";import{BufferViewVec3f as ee,BufferViewUint32 as te}from"../../../../geometry/support/buffer/BufferView.js";import{fromPoints as C,distance2 as ne,closestLineSegmentPoint as re,projectPoint as ie,projectPointFraction as ae,create as oe}from"../../../../geometry/support/lineSegment.js";import{fromPoints as w,signedDistance as T,getNormal as se,create as E}from"../../../../geometry/support/plane.js";import{alphaCutoff as ce}from"../../../../webscene/support/AlphaCutoff.js";import{isHighlightOrOLID as le,isColor as D,isDepth as ue,isColorHighlightOLIDOrDepth as de,is2DGeometryOutput as fe}from"../core/shaderLibrary/ShaderOutput.js";import{getScalarAttributeView as O}from"../lib/attributeViewUtils.js";import pe from"../lib/GLMaterial.js";import{LineMaterial as me}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as he}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as ge,screenPolygonIntersectsBufferedSegment as _e}from"../lib/screenPolygonOverlapUtils.js";import{Hit as ve,DrapedHit as ye}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as be}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as xe,assert as k}from"../lib/Util.js";import{createVerticesView as Se}from"../lib/VerticesView.js";import{getLayout as Ce,getTextureBufferLayout as we}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as Te}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Ee}from"../shaders/RibbonLineTechniqueConfiguration.js";import{getNumJoinSubdivisions as De,getRibbonLinePositions as A,isClosed as j,getUnpaddedRibbonLinePositionCount as Oe,ribbonLineVertexCount as ke,writeRibbonLineTextureBuffer as Ae,writeRibbonLineVertices as je}from"./internal/ribbonLineBufferUtils.js";import{intersectRayWithWorldSizedLineSegment as Me,intersectScreenPolygonWithWorldSizedLineSegment as Ne}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{isImagePattern as Pe}from"./lineStippleUtils.js";import{VisualVariablePassParameters as Fe}from"./VisualVariablePassParameters.js";class Ie extends me{constructor(e,t){super(e,Re),this.produces=new Map([[2,e=>le(e)||D(e)&&this.parameters.renderOccluded===8],[3,e=>ue(e)&&this._writesGeometryDepthPrepass],[10,e=>de(e)&&this.parameters.renderOccluded===8],[11,e=>de(e)&&this.parameters.renderOccluded===8],[4,e=>D(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>D(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>fe(e)]]),this._configuration=new Ee(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=De(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&Ve(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=ce||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>ce}get _writesGeometryDepthPrepass(){return this.parameters.animation!==3}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped(e,t,n,r,i,a,o){if(!t.options.selectionMode)return;let s=this._getLineSize(e,!0),c=A(e,!!this.parameters.isClosed),l=n[0],u=n[1],d=M(s,a,o,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let e of Be(F,I,c,j(this.parameters,c.count))){let t=l-F[0],n=u-F[1],r=I[0]-F[0],i=I[1]-F[1],a=r*t+i*n,o=r*r+i*i,s=v(a/o,0,1),c=r*s-t,d=i*s-n,m=c*c+d*d;m<f&&(f=m,p=e)}f<d*d&&r(i.distance,i.renderDistance,i.normal,p)}intersectRay(e,t,n,r,i,a){let{options:o,camera:s}=n;if(!o.selectionMode||!e.visible||!s)return;if(!xe(t)){_.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let c=this._getLineSize(e);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(e,t,n,c,a):this._intersectRayWithScreenSizedLine(e,t,n,c,a)}_intersectRayWithScreenSizedLine(t,n,d,f,p){let{camera:m}=d,h=A(t,!!this.parameters.isClosed),g=V;e(g,d.point);let _=f*m.pixelRatio,v=Q*m.pixelRatio,y=_/2+v;r(K[0],g[0]-y,g[1]+y,0),r(K[1],g[0]+y,g[1]+y,0),r(K[2],g[0]+y,g[1]-y,0),r(K[3],g[0]-y,g[1]-y,0);for(let e=0;e<4;e++)if(!m.unprojectFromRenderScreen(K[e],q[e]))return;w(m.eye,q[0],q[1],J),w(m.eye,q[1],q[2],Y),w(m.eye,q[2],q[3],X),w(m.eye,q[3],q[0],Z);let b=Number.MAX_VALUE,x=0;for(let e of this._forEachTransformedLineSegment(N,P,h,n,j(this.parameters,h.count))){if(T(J,N)<0&&T(J,P)<0||T(Y,N)<0&&T(Y,P)<0||T(X,N)<0&&T(X,P)<0||T(Z,N)<0&&T(Z,P)<0)continue;let t=m.projectToRenderScreen(N,H),n=m.projectToRenderScreen(P,U);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){i(z,N,P);let e=m.frustum,n=-T(e[4],N)/a(z,se(e[4]));if(o(z,z,n),s(N,N,z),!m.projectToRenderScreen(N,t))continue}else if(t[2]>0&&n[2]<0){i(z,P,N);let e=m.frustum,t=-T(e[4],P)/a(z,se(e[4]));if(o(z,z,t),s(P,P,z),!m.projectToRenderScreen(P,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let r=C(t,n,W),l=ne(r,g);if(!(l>=b)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(r,N,P,g,m,f,v);if(l>=e*e)continue}b=l,c(Ke,N),c(qe,P),x=e}}if(b<y*y){let{rayBegin:e,rayEnd:t}=d,n=Number.MAX_VALUE;if(re(C(Ke,qe,W),C(e,t,G),B)){i(B,B,e);let r=l(B);o(B,B,1/r),n=r/u(e,t)}p(n,n,B,x)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,l=A(e,!!this.parameters.isClosed),u=r/(2*s),d=1/0,f=0;for(let e of this._forEachTransformedLineSegment(N,P,l,t,j(this.parameters,l.count))){let t=Me(N,P,u,a,o,Je);if(t!=null&&t<d&&(d=t,f=e,c(B,Je),t===0))break}d<1/0&&i(d,d,B,f)}intersectScreenPolygon(e,t,n,r){let{options:i}=n;if(!i.selectionMode||!e.visible)return null;if(!xe(t))return _.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let a=this._getLineSize(e);return this.parameters.worldSized?this._intersectWorldSizedPolygon(e,t,n,r,a):this._intersectScreenSizedPolygon(e,t,n,r,a)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=A(e,!!this.parameters.isClosed),c=Q,l=c*a.pixelRatio,f=new ve(4);for(let e of this._forEachTransformedLineSegment(N,P,s,t,j(this.parameters,s.count)))for(let[t,n]of o.processLineSegment($,N,P)){if(!ge(a,t,n,H,U))continue;let o=C(H,U,W),s=i/2+c;this.parameters.screenSizePerspective&&(d(V,H,U,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,V,a,i,l)/a.pixelRatio)),a.renderToScreen(H,We),a.renderToScreen(U,Ge),_e(r,We,Ge,s)&&(ie(C(t,n,G),a.eye,L),f.updateIfCloserFromValues(u(a.eye,L),e,L,null))}return f}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,c=A(e,!!this.parameters.isClosed),l=i/(2*s),d=new ve(4);for(let e of this._forEachTransformedLineSegment(N,P,c,t,j(this.parameters,c.count)))for(let[t,n]of o.processLineSegment($,N,P)){ie(C(t,n,G),a.eye,L);let i=u(a.eye,L);d.valid&&i>=d.distance||Ne(t,n,l,a,r)&&d.updateIfCloserFromValues(i,e,L,null)}return d}intersectScreenPolygonDraped(e,t,n,r,i,a){if(!n.options.selectionMode)return null;let o=this._getLineSize(e,!0),s=A(e,!!this.parameters.isClosed),c=M(o,i,a,this.parameters.usesWorldSizedWidth());for(let e of Be(F,I,s,j(this.parameters,s.count),t))if(_e(r,F,I,c))return new ye(e);return null}getPrimitivePositionCount(e,t){let n=(t??e).storage.getField(`position`,ee),r=Oe(n.count,this.parameters.isClosed);return 2*Math.max(0,r-1)}createPrimitivePositionReader(e,t){let n=(t??e).storage.getField(`position`,ee);return(e,t)=>n.getVec(1+Math.ceil(t/2),e)}computeAttachmentOrigin(e,t,n){return!this.parameters.wireframe&&super.computeAttachmentOrigin(e,t,n)}createBufferWriter(){return new ze(Ce(this.parameters),we(this.parameters),this.parameters)}createGLMaterial(e){return new Le(e)}validateParameters(e){k(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:x(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=ae(e,r);d(L,t,n,s),f(Ue,L,i.viewMatrix);let c=l(Ue),u=this.computeCameraAbsCosAngle(L,i,this._configuration.spherical);return He.update(u,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),He.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?p(B,e):r(B,0,0,1),i(R,e,t.eye),p(R,R),Math.abs(a(B,R))}_getLineSize(e,t=!1){let n=this.parameters.width;if(this.parameters.vvSize){let r=O(e,`sizeFeatureAttribute`).get(0);Number.isNaN(r)?t&&(n*=this.parameters.vvSize.fallback[0]):n*=v(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else if(this.parameters.hasVertexSize){let t=O(e,`size`);t!=null&&(n*=t.get(0))}return n}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.count:n.count-1;for(let i=0;i<a;i++)n.getVec(i,e),m(e,e,r),n.getVec((i+1)%n.count,t),m(t,t,r),yield i}}class Le extends pe{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(Te,e)}}class Re extends Fe{constructor(){super(...arguments),this._width=0,this.color=g,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=S(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=S(0),this.endTime=S(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Pe(this.stipplePattern)&&this.stippleTexture!=null}}class ze{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=he.getField(0).max}_isClosed(e){return j(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){let t=e.get(`position`);return t.data.length/3+(this._isClosed(t.data.length/t.stride)?3:2)}elementCount(e){let t=e.get(`position`),n=t.indices.length/2+1;return ke(n,this._isClosed(t.data.length/t.stride),this._parameters)}rebaseBuffers(e,t,n,r){if(r?.buffer.copyFrom(e.storage,0,r.offset),t!=null){let r=n.from,i=e.vertex.getField(`ribbonLineVertexInfo`,te),a=t.buffer.getField(`ribbonLineVertexInfo`,te),o=he.getField(0);for(let e=0;e<i.count;e++){let n=i.get(e),s=o.get(n)+r;a.set(t.offset+e,n===0?0:o.set(n,s))}}}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=Se(t.get(`position`),3),i=t.get(`timeStamps`);i!=null&&n.buffer.layout.fields.has(`timeStamps`)&&k(i.size===4),Ae({position:r,color:t.get(`color`)?.data,size:t.get(`size`)?.data,colorFeature:t.get(`colorFeatureAttribute`)?.data,sizeFeature:t.get(`sizeFeatureAttribute`)?.data,opacityFeature:t.get(`opacityFeatureAttribute`)?.data,distancesToStart:t.get(`distanceToStart`)?.data,timeStamps:i?.data,olidColor:t.get(`olidColor`)?.data},this._isClosed(r.count),n,e)}_writeVertexBuffer(e,t,n){let r=e.get(`position`),i=r.indices,a=r.data.length/3,o=this._isClosed(r.data.length/r.stride),s=a+(o?3:2);i&&i.length!==2*(a-1)&&console.warn(`RibbonLineMaterial does not support indices`),k(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let c=n.from;k(n.numElements===s,`Expected number of elements in TextureBuffer to equal number of points`),je(a,o,this._parameters,t,c)}}function M(e,t,n,r){return r?e/(2*n)+Q*t:(e/2+Q)*t}function*Be(n,r,i,a,o){let s=a?i.count:i.count-1,c=o?.[0]??0,l=o?.[1]??0;t(n,i.get(0,0)+c,i.get(0,1)+l);for(let a=1;a<=s;a++){let o=a%i.count;t(r,i.get(o,0)+c,i.get(o,1)+l),yield a,e(n,r)}}function Ve(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}const He=new be,N=h(),P=h(),F=n(),I=n(),L=h(),Ue=h(),R=h(),z=h(),B=h(),V=h(),H=y(),U=y(),We=b(),Ge=b(),Ke=h(),qe=h(),Je=h(),W=oe(),G=oe(),K=[y(),y(),y(),y()],q=[h(),h(),h(),h()],J=E(),Y=E(),X=E(),Z=E(),Q=4,Ye={getDrapedRibbonLineMaxDistance:M},$=[h(),h()];export{Re as Parameters,Ie as RibbonLineMaterial,Ye as test};
2
+ import{copy as e,set as t}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as r,subtract as i,dot as a,scale as o,add as s,copy as c,length as l,distance as u,lerp as d,transformMat4 as f,normalize as p,applyTranslation as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import _ from"../../../../core/Logger.js";import{clamp as v}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as y,createScreenPointArray as b}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as x,Seconds as S}from"../../../../core/time.js";import{BufferViewVec3f as ee,BufferViewUint32 as te}from"../../../../geometry/support/buffer/BufferView.js";import{fromPoints as C,distance2 as ne,closestLineSegmentPoint as re,projectPoint as ie,projectPointFraction as ae,create as oe}from"../../../../geometry/support/lineSegment.js";import{fromPoints as w,signedDistance as T,getNormal as se,create as E}from"../../../../geometry/support/plane.js";import{alphaCutoff as ce}from"../../../../webscene/support/AlphaCutoff.js";import{isShadow as le,isHighlightOrOLID as ue,isColor as D,isDepth as de,isColorHighlightOLIDOrDepth as fe,is2DGeometryOutput as pe}from"../core/shaderLibrary/ShaderOutput.js";import{getScalarAttributeView as me}from"../lib/attributeViewUtils.js";import he from"../lib/GLMaterial.js";import{LineMaterial as ge}from"../lib/LineMaterial.js";import{ribbonLineVertexInfoPacking as _e}from"../lib/RibbonLineVertexInfo.js";import{projectWorldLineSegmentToRenderScreen as ve,screenPolygonIntersectsBufferedSegment as ye}from"../lib/screenPolygonOverlapUtils.js";import{Hit as be,DrapedHit as xe}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as Se}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as Ce,assert as O}from"../lib/Util.js";import{createVerticesView as we}from"../lib/VerticesView.js";import{getLayout as Te,getTextureBufferLayout as Ee}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as De}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as Oe}from"../shaders/RibbonLineTechniqueConfiguration.js";import{getNumJoinSubdivisions as ke,getRibbonLinePositions as k,isClosed as A,getUnpaddedRibbonLinePositionCount as Ae,ribbonLineVertexCount as je,writeRibbonLineTextureBuffer as Me,writeRibbonLineVertices as Ne}from"./internal/ribbonLineBufferUtils.js";import{intersectRayWithWorldSizedLineSegment as Pe,intersectScreenPolygonWithWorldSizedLineSegment as Fe}from"./internal/worldSizedRibbonLineIntersectionUtils.js";import{isImagePattern as Ie}from"./lineStippleUtils.js";import{VisualVariablePassParameters as Le}from"./VisualVariablePassParameters.js";class Re extends ge{constructor(e,t){super(e,j),this.produces=new Map([[2,e=>le(e)&&this.parameters.shadingEnabled&&this.parameters.castShadows||ue(e)||D(e)&&this.parameters.renderOccluded===8],[3,e=>de(e)&&this._writesGeometryDepthPrepass],[10,e=>fe(e)&&this.parameters.renderOccluded===8],[11,e=>fe(e)&&this.parameters.renderOccluded===8],[4,e=>D(e)&&this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[8,e=>D(e)&&!this.parameters.writeDepth&&this.parameters.renderOccluded!==8],[18,e=>pe(e)]]),this._configuration=new Oe(t.state.isGlobal),this._isAssumedMetalDriver=t.stage.renderer.renderContext.rctx.isAssumedMetalDriver}updateConfiguration(e){super.updateConfiguration(e),this._configuration.useFlatJoinVarying=!this._isAssumedMetalDriver;let t=this.parameters.stipplePattern!=null&&this.parameters.stippleTexture!=null&&e.output!==10,n=t&&this.parameters.isImagePattern()&&this._configuration.draped,r=this.parameters.usesWorldSizedWidth(n);this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=t,this._configuration.stippleOffColorEnabled=t&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=t&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=ke(this.parameters.join,t),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins=this.parameters.join===`round`,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&He(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=+!!this.emissions,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSized=r,this._configuration.imagePattern=n,this._configuration.hasVertexColor=this.parameters.hasVertexColor,this._configuration.hasVertexSize=this.parameters.hasVertexSize,this._configuration.hasLineDistance=this.parameters.hasLineDistance}get visible(){return this.parameters.color[3]>=ce||this.parameters.stipplePattern!=null&&(this.parameters.stippleOffColor?.[3]??0)>ce}get _writesGeometryDepthPrepass(){return this.parameters.animation!==3}get emissions(){return this.parameters.emissiveStrength>0?this.parameters.renderOccluded===8?1:2:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped(e,t,n,r,i,a,o){if(!t.options.selectionMode)return;let s=this._getLineSize(e,!0),c=k(e,!!this.parameters.isClosed),l=n[0],u=n[1],d=M(s,a,o,this.parameters.usesWorldSizedWidth()),f=Number.MAX_VALUE,p=0;for(let e of Ve(F,I,c,A(this.parameters,c.count))){let t=l-F[0],n=u-F[1],r=I[0]-F[0],i=I[1]-F[1],a=r*t+i*n,o=r*r+i*i,s=v(a/o,0,1),c=r*s-t,d=i*s-n,m=c*c+d*d;m<f&&(f=m,p=e)}f<d*d&&r(i.distance,i.renderDistance,i.normal,p)}intersectRay(e,t,n,r,i,a){let{options:o,camera:s}=n;if(!o.selectionMode||!e.visible||!s)return;if(!Ce(t)){_.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`);return}let c=this._getLineSize(e);this.parameters.worldSized?this._intersectRayWithWorldSizedLine(e,t,n,c,a):this._intersectRayWithScreenSizedLine(e,t,n,c,a)}_intersectRayWithScreenSizedLine(t,n,d,f,p){let{camera:m}=d,h=k(t,!!this.parameters.isClosed),g=V;e(g,d.point);let _=f*m.pixelRatio,v=Q*m.pixelRatio,y=_/2+v;r(K[0],g[0]-y,g[1]+y,0),r(K[1],g[0]+y,g[1]+y,0),r(K[2],g[0]+y,g[1]-y,0),r(K[3],g[0]-y,g[1]-y,0);for(let e=0;e<4;e++)if(!m.unprojectFromRenderScreen(K[e],q[e]))return;w(m.eye,q[0],q[1],J),w(m.eye,q[1],q[2],Y),w(m.eye,q[2],q[3],X),w(m.eye,q[3],q[0],Z);let b=Number.MAX_VALUE,x=0;for(let e of this._forEachTransformedLineSegment(N,P,h,n,A(this.parameters,h.count))){if(T(J,N)<0&&T(J,P)<0||T(Y,N)<0&&T(Y,P)<0||T(X,N)<0&&T(X,P)<0||T(Z,N)<0&&T(Z,P)<0)continue;let t=m.projectToRenderScreen(N,H),n=m.projectToRenderScreen(P,U);if(t==null||n==null)continue;if(t[2]<0&&n[2]>0){i(z,N,P);let e=m.frustum,n=-T(e[4],N)/a(z,se(e[4]));if(o(z,z,n),s(N,N,z),!m.projectToRenderScreen(N,t))continue}else if(t[2]>0&&n[2]<0){i(z,P,N);let e=m.frustum,t=-T(e[4],P)/a(z,se(e[4]));if(o(z,z,t),s(P,P,z),!m.projectToRenderScreen(P,n))continue}else if(t[2]<0&&n[2]<0)continue;t[2]=0,n[2]=0;let r=C(t,n,W),l=ne(r,g);if(!(l>=b)){if(this.parameters.screenSizePerspective){let e=this.computeScreenSizePerspectiveWidth(r,N,P,g,m,f,v);if(l>=e*e)continue}b=l,c(qe,N),c(Je,P),x=e}}if(b<y*y){let{rayBegin:e,rayEnd:t}=d,n=Number.MAX_VALUE;if(re(C(qe,Je,W),C(e,t,G),B)){i(B,B,e);let r=l(B);o(B,B,1/r),n=r/u(e,t)}p(n,n,B,x)}}_intersectRayWithWorldSizedLine(e,t,n,r,i){let{camera:a,ray:o,metersPerRenderUnit:s}=n,l=k(e,!!this.parameters.isClosed),u=r/(2*s),d=1/0,f=0;for(let e of this._forEachTransformedLineSegment(N,P,l,t,A(this.parameters,l.count))){let t=Pe(N,P,u,a,o,Ye);if(t!=null&&t<d&&(d=t,f=e,c(B,Ye),t===0))break}d<1/0&&i(d,d,B,f)}intersectScreenPolygon(e,t,n,r){let{options:i}=n;if(!i.selectionMode||!e.visible)return null;if(!Ce(t))return _.getLogger(`esri.views.3d.webgl-engine.materials.RibbonLineMaterial`).error(`intersection assumes a translation-only matrix`),null;let a=this._getLineSize(e);return this.parameters.worldSized?this._intersectWorldSizedPolygon(e,t,n,r,a):this._intersectScreenSizedPolygon(e,t,n,r,a)}_intersectScreenSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o}=n,s=k(e,!!this.parameters.isClosed),c=Q,l=c*a.pixelRatio,f=new be(4);for(let e of this._forEachTransformedLineSegment(N,P,s,t,A(this.parameters,s.count)))for(let[t,n]of o.processLineSegment($,N,P)){if(!ve(a,t,n,H,U))continue;let o=C(H,U,W),s=i/2+c;this.parameters.screenSizePerspective&&(d(V,H,U,.5),s=Math.max(s,this.computeScreenSizePerspectiveWidth(o,t,n,V,a,i,l)/a.pixelRatio)),a.renderToScreen(H,Ge),a.renderToScreen(U,Ke),ye(r,Ge,Ke,s)&&(ie(C(t,n,G),a.eye,L),f.updateIfCloserFromValues(u(a.eye,L),e,L,null))}return f}_intersectWorldSizedPolygon(e,t,n,r,i){let{camera:a,screenPolygonPrimitiveProcessor:o,metersPerRenderUnit:s}=n,c=k(e,!!this.parameters.isClosed),l=i/(2*s),d=new be(4);for(let e of this._forEachTransformedLineSegment(N,P,c,t,A(this.parameters,c.count)))for(let[t,n]of o.processLineSegment($,N,P)){ie(C(t,n,G),a.eye,L);let i=u(a.eye,L);d.valid&&i>=d.distance||Fe(t,n,l,a,r)&&d.updateIfCloserFromValues(i,e,L,null)}return d}intersectScreenPolygonDraped(e,t,n,r,i,a){if(!n.options.selectionMode)return null;let o=this._getLineSize(e,!0),s=k(e,!!this.parameters.isClosed),c=M(o,i,a,this.parameters.usesWorldSizedWidth());for(let e of Ve(F,I,s,A(this.parameters,s.count),t))if(ye(r,F,I,c))return new xe(e);return null}getPrimitivePositionCount(e,t){let n=(t??e).storage.getField(`position`,ee),r=Ae(n.count,this.parameters.isClosed);return 2*Math.max(0,r-1)}createPrimitivePositionReader(e,t){let n=(t??e).storage.getField(`position`,ee);return(e,t)=>n.getVec(1+Math.ceil(t/2),e)}computeAttachmentOrigin(e,t,n){return!this.parameters.wireframe&&super.computeAttachmentOrigin(e,t,n)}createBufferWriter(){return new Be(Te(this.parameters),Ee(this.parameters),this.parameters)}createGLMaterial(e){return new ze(e)}validateParameters(e){O(e.hasLineDistance||e.stipplePattern==null,`Patterned ribbon lines require line distances`),e.join!==`miter`&&(e.miterLimit=0),e.markerParameters!=null&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return this.parameters.hasAnimation?(this.setParameters({timeElapsed:x(e.time)},!1),e.dt!==0):!1}computeScreenSizePerspectiveWidth(e,t,n,r,i,a,o){let s=ae(e,r);d(L,t,n,s),f(We,L,i.viewMatrix);let c=l(We),u=this.computeCameraAbsCosAngle(L,i,this._configuration.spherical);return Ue.update(u,c,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize),Ue.apply(a)*i.pixelRatio/2+o}computeCameraAbsCosAngle(e,t,n){return n?p(B,e):r(B,0,0,1),i(R,e,t.eye),p(R,R),Math.abs(a(B,R))}_getLineSize(e,t=!1){let n=this.parameters.width;if(this.parameters.vvSize){let r=me(e,`sizeFeatureAttribute`).get(0);Number.isNaN(r)?t&&(n*=this.parameters.vvSize.fallback[0]):n*=v(this.parameters.vvSize.offset[0]+r*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else if(this.parameters.hasVertexSize){let t=me(e,`size`);t!=null&&(n*=t.get(0))}return n}*_forEachTransformedLineSegment(e,t,n,r,i){let a=i?n.count:n.count-1;for(let i=0;i<a;i++)n.getVec(i,e),m(e,e,r),n.getVec((i+1)%n.count,t),m(t,t,r),yield i}}class ze extends he{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){let{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(De,e)}}class j extends Le{constructor(){super(...arguments),this._width=0,this.color=g,this.hasVertexColor=!0,this.hasVertexSize=!0,this.hasLineDistance=!0,this.join=`miter`,this.cap=0,this.miterLimit=5,this.shadingEnabled=!1,this.castShadows=!0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=S(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=S(0),this.endTime=S(1/0),this.worldSized=!1}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||this.stipplePattern!=null&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return this.animation!==0}usesWorldSizedWidth(e=this.isImagePattern()){return this.worldSized||e}isImagePattern(){return Ie(this.stipplePattern)&&this.stippleTexture!=null}}class Be{constructor(e,t,n){this.layout=e,this.textureBufferLayout=t,this._parameters=n,this.maxTextureBufferItemIndex=_e.getField(0).max}_isClosed(e){return A(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){let t=e.get(`position`);return t.data.length/3+(this._isClosed(t.data.length/t.stride)?3:2)}elementCount(e){let t=e.get(`position`),n=t.indices.length/2+1;return je(n,this._isClosed(t.data.length/t.stride),this._parameters)}rebaseBuffers(e,t,n,r){if(r?.buffer.copyFrom(e.storage,0,r.offset),t!=null){let r=n.from,i=e.vertex.getField(`ribbonLineVertexInfo`,te),a=t.buffer.getField(`ribbonLineVertexInfo`,te),o=_e.getField(0);for(let e=0;e<i.count;e++){let n=i.get(e),s=o.get(n)+r;a.set(t.offset+e,n===0?0:o.set(n,s))}}}write(e,t,n,r,i,a){a!=null&&this._writeTextureBuffer(e,n,a),r!=null&&this._writeVertexBuffer(n,r,i)}_writeTextureBuffer(e,t,n){let r=we(t.get(`position`),3),i=t.get(`timeStamps`);i!=null&&n.buffer.layout.fields.has(`timeStamps`)&&O(i.size===4),Me({position:r,color:t.get(`color`)?.data,size:t.get(`size`)?.data,colorFeature:t.get(`colorFeatureAttribute`)?.data,sizeFeature:t.get(`sizeFeatureAttribute`)?.data,opacityFeature:t.get(`opacityFeatureAttribute`)?.data,distancesToStart:t.get(`distanceToStart`)?.data,timeStamps:i?.data,olidColor:t.get(`olidColor`)?.data},this._isClosed(r.count),n,e)}_writeVertexBuffer(e,t,n){let r=e.get(`position`),i=r.indices,a=r.data.length/3,o=this._isClosed(r.data.length/r.stride),s=a+(o?3:2);i&&i.length!==2*(a-1)&&console.warn(`RibbonLineMaterial does not support indices`),O(n!=null,`Using a texture layout, but the texture range for this instance was not provided`);let c=n.from;O(n.numElements===s,`Expected number of elements in TextureBuffer to equal number of points`),Ne(a,o,this._parameters,t,c)}}function M(e,t,n,r){return r?e/(2*n)+Q*t:(e/2+Q)*t}function*Ve(n,r,i,a,o){let s=a?i.count:i.count-1,c=o?.[0]??0,l=o?.[1]??0;t(n,i.get(0,0)+c,i.get(0,1)+l);for(let a=1;a<=s;a++){let o=a%i.count;t(r,i.get(o,0)+c,i.get(o,1)+l),yield a,e(n,r)}}function He(e){return e.anchor===1&&e.hideOnShortSegments&&e.placement===`begin-end`&&e.worldSpace}const Ue=new Se,N=h(),P=h(),F=n(),I=n(),L=h(),We=h(),R=h(),z=h(),B=h(),V=h(),H=y(),U=y(),Ge=b(),Ke=b(),qe=h(),Je=h(),Ye=h(),W=oe(),G=oe(),K=[y(),y(),y(),y()],q=[h(),h(),h(),h()],J=E(),Y=E(),X=E(),Z=E(),Q=4,Xe={getDrapedRibbonLineMaxDistance:M},$=[h(),h()];export{j as Parameters,Re as RibbonLineMaterial,Xe as test};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import"../../../webgl/ShaderBuilder.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/forwardLocalUp.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/readFragmentShadow.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/PackedUint32.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../lib/RibbonLineVertexInfo.js";import"./alphaCutoff.glsl.js";import"./animatedAlpha.glsl.js";import"./lineUniforms.js";import"./OutputColorHighlightOLID.glsl.js";import"./RibbonLineTextureBuffer.glsl.js";export{b as build,n as numRoundJoinSubdivisions}from"../../../../chunks/RibbonLine.glsl.js";
2
+ import"../../../../core/libs/gl-matrix-2/math/mat4.js";import"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import"../../../webgl/ShaderBuilder.js";import"../core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js";import"../core/shaderLibrary/forwardLinearDepthToWriteShadow.glsl.js";import"../core/shaderLibrary/output/OutputDepth.glsl.js";import"../core/shaderLibrary/ShaderOutput.js";import"../core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js";import"../core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js";import"../core/shaderLibrary/shading/forwardLocalUp.glsl.js";import"../core/shaderLibrary/shading/lightingUniforms.js";import"../core/shaderLibrary/shading/LineStipple.glsl.js";import"../core/shaderLibrary/shading/MarkerSizing.glsl.js";import"../core/shaderLibrary/shading/PiUtils.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/readFragmentShadow.glsl.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/util/cameraUniforms.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/NoPerspective.glsl.js";import"../core/shaderLibrary/util/PackedUint32.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2BindUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Matrix4BindUniform.js";import"../core/shaderModules/Matrix4DrawUniform.js";import"../lib/RibbonLineVertexInfo.js";import"./alphaCutoff.glsl.js";import"./animatedAlpha.glsl.js";import"./lineUniforms.js";import"./OutputColorHighlightOLID.glsl.js";import"./RibbonLineTextureBuffer.glsl.js";export{b as build,n as numRoundJoinSubdivisions}from"../../../../chunks/RibbonLine.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{PrimitiveType as n}from"../../../webgl/enums.js";import{makePipelineState as r,defaultColorWrite as i,unpremultipliedAlphaToPremultipliedAlpha as a}from"../../../webgl/renderState.js";import{glLayout as o}from"../../support/buffer/glUtil.js";import{ReloadableShader as s}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as c}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as l,depthTest as u,blending as d}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as f,stencilBaseAllZeros as p,stencilWriteMaskOn as m,stencilToolTransparentOccluder as h,depthCompareAlways as g,stencilToolMaskOccluder as _,stencilWriteMaskOff as v,depthCompareLess as y}from"../lib/StencilUtils.js";import{getRibbonLineLayerPolygonOffset as b}from"../materials/PolygonOffset.js";import{R as x}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as S}from"./RibbonLineLayouts.js";let C=class extends c{constructor(e,t){super(e,t,o(S())),this.shader=new s(x,()=>import(`./RibbonLine.glsl.js`)),this.ignoreUnused=!0,this.primitiveType=t.wireframe?n.LINES:n.TRIANGLE_STRIP}_makePipelineState(e,t){let{output:n,hasOccludees:a}=e;return r({blending:d(n,!1,e.emissionDimmingPass),depthTest:u(n),depthWrite:l(e),colorWrite:i,stencilWrite:a?m:null,stencilTest:a?t?f:p:null,polygonOffset:b(e)})}initializePipeline(e){if(e.occluder){let{hasOccludees:t}=e;this._occluderPipelineTransparent=r({blending:a,polygonOffset:b(e),depthTest:g,depthWrite:null,colorWrite:i,stencilWrite:null,stencilTest:t?h:null}),this._occluderPipelineOpaque=r({blending:a,polygonOffset:b(e),depthTest:t?g:y,depthWrite:null,colorWrite:i,stencilWrite:t?v:null,stencilTest:t?_:null}),this._occluderPipelineMaskWrite=r({blending:null,polygonOffset:b(e),depthTest:y,depthWrite:null,colorWrite:null,stencilWrite:t?m:null,stencilTest:t?f:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t,n){if(n)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e,t,n);case 10:return this._occluderPipelineOpaque??super.getPipeline(e,t,n);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e,t,n)}}};C=e([t(`esri.views.3d.webgl-engine.shaders.RibbonLineTechnique`)],C);export{C as RibbonLineTechnique};
2
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{PrimitiveType as n}from"../../../webgl/enums.js";import{makePipelineState as r,defaultColorWrite as i,unpremultipliedAlphaToPremultipliedAlpha as a,defaultDepthWrite as o}from"../../../webgl/renderState.js";import{glLayout as s}from"../../support/buffer/glUtil.js";import{isShadow as c}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShader as l}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as u}from"../core/shaderTechnique/ShaderTechnique.js";import{depthWrite as d,depthTest as f,blending as p}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBase as m,stencilBaseAllZeros as h,stencilWriteMaskOn as g,stencilToolTransparentOccluder as _,depthCompareAlways as v,stencilToolMaskOccluder as y,stencilWriteMaskOff as b,depthCompareLess as x}from"../lib/StencilUtils.js";import{getRibbonLineLayerPolygonOffset as S}from"../materials/PolygonOffset.js";import{R as C}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as w}from"./RibbonLineLayouts.js";let T=class extends u{constructor(e,t){super(e,t,s(w())),this.shader=new l(C,()=>import(`./RibbonLine.glsl.js`)),this.ignoreUnused=!0,this.primitiveType=t.wireframe?n.LINES:n.TRIANGLE_STRIP}_makePipelineState(e,t){let{output:n,hasOccludees:a}=e;return r({blending:p(n,!1,e.emissionDimmingPass),depthTest:f(n),depthWrite:d(e),colorWrite:i,stencilWrite:a?g:null,stencilTest:a?t?m:h:null,polygonOffset:S(e)})}initializePipeline(e){if(e.occluder){let{hasOccludees:t}=e;this._occluderPipelineTransparent=r({blending:a,polygonOffset:S(e),depthTest:v,depthWrite:null,colorWrite:i,stencilWrite:null,stencilTest:t?_:null}),this._occluderPipelineOpaque=r({blending:a,polygonOffset:S(e),depthTest:t?v:x,depthWrite:null,colorWrite:i,stencilWrite:t?b:null,stencilTest:t?y:null}),this._occluderPipelineMaskWrite=r({blending:null,polygonOffset:S(e),depthTest:x,depthWrite:null,colorWrite:null,stencilWrite:t?g:null,stencilTest:t?m:null})}return this._shadowPipeline=r({depthTest:x,depthWrite:o,colorWrite:null}),this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t,n){if(c(e.output)&&this._shadowPipeline)return this._shadowPipeline;if(n)return this._occludeePipeline;switch(e.occluder){case 11:return this._occluderPipelineTransparent??super.getPipeline(e,t,n);case 10:return this._occluderPipelineOpaque??super.getPipeline(e,t,n);default:e.occluder;case void 0:case null:return this._occluderPipelineMaskWrite??super.getPipeline(e,t,n)}}};T=e([t(`esri.views.3d.webgl-engine.shaders.RibbonLineTechnique`)],T);export{T as RibbonLineTechnique};
@@ -1,7 +1,7 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../core/Accessor.js";import{property as n,subclass as r}from"../core/accessorSupport/decorators.js";import{makeHandle as i}from"../core/handleUtils.js";import{isActivationKey as a}from"../core/keyboard.js";import{watch as o,initial as s}from"../core/reactiveUtils.js";import{renderingSanitizer as c}from"../core/sanitizerUtils.js";import{addFrameTask as l}from"../core/scheduling.js";import{globalCss as u}from"../widgets/support/globalCss.js";const d=`esri-attribution`,f={poweredBy:`${d}__powered-by`,sources:`${d}__sources`,sourcesOpen:`${d}__sources--open`,link:`${d}__link`};let p=class extends t{constructor(e){super(e),this._previousSourceHeight=0,this._opened=!1,this._overflowing=!1,this._changeSet=new Set,this.height=0,this._toggleState=()=>{(this._opened||this._overflowing)&&(this._opened=!this._opened,this._invalidate(`opened`))},this.surface=document.createElement(`div`),this._task=l({render:()=>{this._update(),this._task.pause(),this._changeSet.clear()}}),this.addHandles(this._task)}appendBefore(e,t){e.insertBefore(this.surface,t)}initialize(){let e=document.createElement(`div`);e.setAttribute(`dir`,`ltr`),e.dataset.testid=`arcgis-attribution`,e.classList.add(`esri-widget`,`esri-view-attribution`,`esri-attribution`),this._set(`surface`,e);let t=new ResizeObserver(()=>{this.height=e.clientHeight});t.observe(e),this.addHandles(i(()=>t.disconnect())),e.innerHTML=`
2
+ import{__decorate as e}from"tslib";import t from"../core/Accessor.js";import{property as n,subclass as r}from"../core/accessorSupport/decorators.js";import{makeHandle as i}from"../core/handleUtils.js";import{isActivationKey as a}from"../core/keyboard.js";import{watch as o,initial as s}from"../core/reactiveUtils.js";import{renderingSanitizer as c}from"../core/sanitizerUtils.js";import{addFrameTask as l}from"../core/scheduling.js";import{globalCss as u}from"../widgets/support/globalCss.js";const d=`esri-attribution`,f={poweredBy:`${d}__powered-by`,sources:`${d}__sources`,sourcesOpen:`${d}__sources--open`,link:`${d}__link`};let p=class extends t{constructor(e){super(e),this._previousSourceHeight=0,this._opened=!1,this._overflowing=!1,this._changeSet=new Set,this.height=0,this.mode=`auto`,this._toggleState=()=>{(this._opened||this._overflowing)&&(this._opened=!this._opened,this._invalidate(`opened`))},this.surface=document.createElement(`div`),this._task=l({render:()=>{this._update(),this._task.pause(),this._changeSet.clear()}}),this.addHandles(this._task)}appendBefore(e,t){e.insertBefore(this.surface,t)}initialize(){let e=document.createElement(`div`);e.setAttribute(`dir`,`ltr`),e.dataset.testid=`arcgis-attribution`,e.classList.add(`esri-widget`,`esri-view-attribution`,`esri-attribution`),this._set(`surface`,e);let t=new ResizeObserver(()=>{this.height=e.clientHeight});t.observe(e),this.addHandles(i(()=>t.disconnect())),e.innerHTML=`
3
3
  <div class="${f.sources}"></div>
4
4
  <div class="${f.poweredBy}">
5
5
  Powered by
6
6
  <a class="${f.link}" href="https://www.esri.com/" rel="noreferrer" target="_blank">Esri</a>
7
- </div>`,this.addHandles([this.surface,o(()=>this.attributionItems,()=>this._invalidate(`attributionItems`),s),o(()=>this.mode,()=>this._invalidate(`mode`),s)]);let n=e.querySelector(`.${f.sources}`);this._previousSourceHeight=n.clientHeight;let r=new ResizeObserver(()=>{this._invalidate(`overflow`)});r.observe(n),this.addHandles(i(()=>r.disconnect()));let c=new MutationObserver(()=>{this._invalidate(`overflow`)});c.observe(n,{childList:!0,subtree:!0,characterData:!0}),this.addHandles(i(()=>c.disconnect())),n.onclick=this._toggleState,n.onkeydown=e=>{a(e.key)&&(e.preventDefault(),this._toggleState())}}_invalidate(e){this._changeSet.add(e),this._task.resume()}_update(){let e=this.surface.querySelector(`.${f.sources}`);if(this._changeSet.has(`overflow`)){let{clientHeight:t,clientWidth:n,scrollWidth:r}=e,i=t<this._previousSourceHeight;this._previousSourceHeight=t,this._opened?i&&(this._opened=!1):i||(this._overflowing=r>n)}if(this._changeSet.has(`overflow`)||this._changeSet.has(`opened`)){let t=this._opened||this._overflowing,n=t?`0`:``;e.setAttribute(`tabindex`,n),e.classList.toggle(u.interactive,t),e.classList.toggle(f.sourcesOpen,this._opened)}this._changeSet.has(`attributionItems`)&&(e.innerHTML=c.sanitize(this.attributionItems?.map(e=>e.text).join(` | `)??``)),this._changeSet.has(`mode`)&&(this.surface.style.colorScheme=this.mode??``)}};e([n()],p.prototype,`attributionItems`,void 0),e([n()],p.prototype,`height`,void 0),e([n({type:[`dark`,`light`]})],p.prototype,`mode`,void 0),e([n({readOnly:!0})],p.prototype,`surface`,void 0),p=e([r(`esri.views.Attribution`)],p);export{p as Attribution};
7
+ </div>`,this.addHandles([this.surface,o(()=>this.attributionItems,()=>this._invalidate(`attributionItems`),s),o(()=>this.mode,()=>this._invalidate(`mode`),s)]);let n=e.querySelector(`.${f.sources}`);this._previousSourceHeight=n.clientHeight;let r=new ResizeObserver(()=>{this._invalidate(`overflow`)});r.observe(n),this.addHandles(i(()=>r.disconnect()));let c=new MutationObserver(()=>{this._invalidate(`overflow`)});c.observe(n,{childList:!0,subtree:!0,characterData:!0}),this.addHandles(i(()=>c.disconnect())),n.onclick=this._toggleState,n.onkeydown=e=>{a(e.key)&&(e.preventDefault(),this._toggleState())}}_invalidate(e){this._changeSet.add(e),this._task.resume()}_update(){let e=this.surface.querySelector(`.${f.sources}`);if(this._changeSet.has(`overflow`)){let{clientHeight:t,clientWidth:n,scrollWidth:r}=e,i=t<this._previousSourceHeight;this._previousSourceHeight=t,this._opened?i&&(this._opened=!1):i||(this._overflowing=r>n)}if(this._changeSet.has(`overflow`)||this._changeSet.has(`opened`)){let t=this._opened||this._overflowing,n=t?`0`:``;e.setAttribute(`tabindex`,n),e.classList.toggle(u.interactive,t),e.classList.toggle(f.sourcesOpen,this._opened)}this._changeSet.has(`attributionItems`)&&(e.innerHTML=c.sanitize(this.attributionItems?.map(e=>e.text).join(` | `)??``)),this._changeSet.has(`mode`)&&(this.surface.style.colorScheme=this.mode===`auto`?``:this.mode)}};e([n()],p.prototype,`attributionItems`,void 0),e([n()],p.prototype,`height`,void 0),e([n({type:[`auto`,`dark`,`light`],nonNullable:!0})],p.prototype,`mode`,void 0),e([n({readOnly:!0})],p.prototype,`surface`,void 0),p=e([r(`esri.views.Attribution`)],p);export{p as Attribution};
@@ -97,13 +97,14 @@ export abstract class DOMContainer {
97
97
  get attributionHeight(): number;
98
98
  /**
99
99
  * The light or dark mode used to display the attribution.
100
- * By default, the mode is inherited from the CSS
100
+ * When set to `"auto"` (the default), the mode is inherited from the CSS
101
101
  * [`color-scheme`](https://developer.mozilla.org/docs/Web/CSS/color-scheme). Calcite mode classes are also supported because they set `color-scheme`.
102
102
  * You can override the value to style the attribution alongside the map or scene content.
103
103
  *
104
+ * @default "auto"
104
105
  * @since 5.0
105
106
  */
106
- accessor attributionMode: "dark" | "light" | null | undefined;
107
+ accessor attributionMode: "auto" | "dark" | "light";
107
108
  /**
108
109
  * The `id` or node representing the DOM element containing the view. This is typically set in the view's constructor.
109
110
  *
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{byId as r,reparent as i}from"../core/domUtils.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import s from"../core/Logger.js";import{destroyMaybe as c,removeMaybe as l}from"../core/maybe.js";import{watch as u,initial as d,syncAndInitial as f}from"../core/reactiveUtils.js";import{addFrameTask as p}from"../core/scheduling.js";import{Attribution as m}from"./Attribution.js";import h from"./overlay/FocusRegionOverlayItem.js";import g from"./overlay/ViewOverlay.js";const _=[0,0];function v(e){let t=(e.ownerDocument||window.document).defaultView,n=e.getBoundingClientRect();return _[0]=n.left+(t?.pageXOffset??0),_[1]=n.top+(t?.pageYOffset??0),_}function y(e){e&&(e.textContent=``,e.parentNode&&e.parentNode.removeChild(e))}const b=process.env.NODE_ENV===`test`,x=b?0:16,S=b?0:750,C=b?0:512,w={left:0,top:0,right:0,bottom:0},T={toggle:`KeyO`,resizeLarger:`ArrowUp`,resizeSmaller:`ArrowDown`,select:new Set([`Enter`,`Space`])},E=_=>{let b=_,E=class extends b{constructor(...e){super(...e),this._freqInfo={freq:x,time:S},this._overlayRenderTaskHandle=null,this._focusRegionOverlayItem=new h,this.aria={},this.attributionMode=null,this.height=0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([u(()=>[this.focusRegionVisible,this.overlay,this.ready],()=>this._syncFocusRegionOverlayItemVisibility(this.focusRegionVisible&&this.ready),{initial:!0}),u(()=>this.cursor,e=>{let{surface:t}=this;t&&t.setAttribute(`data-cursor`,e)}),u(()=>this.navigating,e=>{let{surface:t}=this;t&&t.setAttribute(`data-navigating`,e.toString())}),u(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0}),u(()=>{let{left:e,top:t,right:n,bottom:r}=this.padding??w;return[this.width,this.height,e,t,n,r]},([e,t,n,r,i,a])=>{let{_focusRegionOverlayItem:o}=this;o.backgroundHeight=t,o.backgroundWidth=e,o.padding={left:n,top:r,right:i,bottom:a},o.updateBoxSize()})])}initialize(){let e=this;this.addHandles([u(()=>this.ui,(e,t)=>this._handleUIChange(e,t),d),e.on(`focus`,()=>this.notifyChange(`focused`)),e.on(`blur`,()=>this.notifyChange(`focused`)),e.on(`key-down`,t=>{let{shiftKey:n,altKey:r,code:i,defaultPrevented:a}=t.native,{toggle:o,resizeLarger:s,resizeSmaller:c,select:l}=T,u=this.focusRegionVisible&&n&&r&&(i===s||i===c);if(!t.repeat||u){if(!a&&n&&r&&i===o&&this.focusRegionShortcutEnabled)this._toggleFocusRegion(),t.preventDefault();else if(!a&&u){let{_focusRegionOverlayItem:e}=this;e.resizeBoxSize(i===s?50:-50),t.preventDefault(),t.native.stopPropagation(),t.stopPropagation()}else!a&&this.focusRegionVisible&&l.has(i)&&this._selectFocusRegion(t,e)}})])}destroy(){this.destroyed||(this.focusRegionVisible=!1,this._syncFocusRegionOverlayItemVisibility(!1),this.ui?.destroy(),this.container=null)}get attributionHeight(){return this._attribution?.height??0}get container(){return this._get(`container`)??null}set container(e){let t=this._get(`container`),n=r(e);if(!n&&typeof e==`string`&&s.getLogger(this).error(`#container`,`element with id '${e}' not found`),t===n)return;if(this._stopMeasuring(),this.removeHandles(`container`),t&&(t.classList.remove(`esri-view`),this._overlayRenderTaskHandle&&=(this._overlayRenderTaskHandle.remove(),null),this.overlay&&(this.overlay.destroy(),this._set(`overlay`,null)),this._attribution=c(this._attribution),this.root&&(y(this.root),this._set(`root`,null)),this.userContent&&(i(this.userContent,t),y(this.userContent),this._set(`userContent`,null))),!n){this._set(`width`,0),this._set(`height`,0),this._set(`position`,null),this._set(`suspended`,!0),this._set(`surface`,null),this._set(`container`,null);return}n.classList.add(`esri-view`);let a=document.createElement(`div`);a.className=`esri-view-user-storage`,i(n,a),n.appendChild(a),this._set(`userContent`,a);let o=document.createElement(`div`);o.className=`esri-view-root`,n.insertBefore(o,n.firstChild),this._set(`root`,o);let h=document.createElement(`div`);h.className=`esri-view-surface`,h.setAttribute(`role`,`application`),h.tabIndex=0,o.appendChild(h),this._set(`surface`,h);let _=new g;o.appendChild(_.surface),this._set(`overlay`,_),this._syncFocusRegionOverlayItemVisibility(!1),this.addHandles(u(()=>_.needsRender,e=>{this._overlayRenderTaskHandle=e&&!this._overlayRenderTaskHandle?p({render:()=>this.overlay?.render()}):l(this._overlayRenderTaskHandle)},d),`container`),this.addHandles([u(()=>({visible:this.attributionVisible,items:this.attributionItems,mode:this.attributionMode}),({visible:e,items:t,mode:n})=>{e?(this._attribution||=new m({attributionItems:this.attributionItems,mode:this.attributionMode}),this._attribution.appendBefore(o,this.ui?.container??null),this._attribution.attributionItems=t,this._attribution.mode=n):this._attribution=c(this._attribution)},f)],`container`),this.forceDOMReadyCycle(),this._set(`container`,n),this._startMeasuring()}get focused(){let e=document.activeElement===this.surface;return document.hasFocus()&&e}get focusRegion(){return this.focusRegionVisible?this._focusRegionOverlayItem.getScreenRect():null}get size(){return[this.width,this.height]}get ui(){return this._get(`ui`)}set ui(e){let t=this._get(`ui`);t!==e&&t?.destroy(),this._set(`ui`,e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,n){let r=this.position;return e-=r?r[0]:0,t-=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}containerToPage(e,t,n){let r=this.position;return e+=r?r[0]:0,t+=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}_updateAria(){let{surface:e,aria:t}=this;e&&(e.ariaLabelledByElements=t?.labelledByElements??null,e.ariaDescribedByElements=t?.describedByElements??null,e.ariaLabel=t?.label??null,e.ariaDescription=t?.description??null)}_selectFocusRegion(e,t){let n=this._makeFocusRegionSelectEvent(e);t.emit(`focus-region-select`,n),e.preventDefault()}_makeFocusRegionSelectEvent(e){let t={type:`focus-region-select`,native:e.native,defaultPrevented:!1,preventDefault:()=>{t.defaultPrevented=!0},stopPropagation:()=>{e.stopPropagation()}};return t}_toggleFocusRegion(){this.focusRegionVisible=!this.focusRegionVisible}_updateFocusRegionOverlayItem(){let{_focusRegionOverlayItem:e}=this;e.backgroundHeight=this.height,e.backgroundWidth=this.width,e.padding=this.padding??w,e.updateBoxSize()}_syncFocusRegionOverlayItemVisibility(e){let{_focusRegionOverlayItem:t,overlay:n}=this,r=e;t.visible=r,n&&(n.removeItem(t),r&&(this._updateFocusRegionOverlayItem(),n.addItem(t)))}_handleUIChange(e,t){this.removeHandles(`ui`),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(u(()=>this.root,t=>{if(!t)e.container=null;else{let n=document.createElement(`div`);t.insertBefore(n,this._attribution?.surface??null),e.container=n}},d),`ui`)),this._set(`ui`,e)}_stopMeasuring(){this.removeHandles(`measuring`),this._get(`resizing`)&&this._set(`resizing`,!1)}_startMeasuring(){let e=this._freqInfo;e.freq=x,e.time=S;let t=p({prepare:e=>{let n=this._measure(),r=this._freqInfo;r.time+=e.deltaTime,n&&(r.freq=x,this._get(`resizing`)||this._set(`resizing`,!0)),r.time<r.freq||(r.time=0,r.freq=this._position()||n?x:Math.min(S,r.freq*2),!n&&r.freq>=C&&(t.pause(),this._get(`resizing`)&&this._set(`resizing`,!1)))}}),n=new ResizeObserver(n=>{e.freq=x,e.time=S,t.resume()});this.container!=null&&n.observe(this.container);let r=o(()=>n.disconnect());this.addHandles([a(window,`resize`,()=>{e.freq=x,e.time=S,t.resume()}),r,t],`measuring`),this._measure(),this._position()}_measure(){let e=this.container,t=e?e.clientWidth:0,n=e?e.clientHeight:0;if(t===0||n===0)return this.suspended||this._set(`suspended`,!0),!1;let r=this.width,i=this.height;return t===r&&n===i?(this.suspended&&this._set(`suspended`,!1),!1):(this._set(`width`,t),this._set(`height`,n),this.suspended&&this._set(`suspended`,!1),this.emit(`resize`,{oldWidth:r,oldHeight:i,width:t,height:n}),!0)}_position(){let e=this.container,t=this.position,n=e&&v(e);return n&&(!t||n[0]!==t[0]||n[1]!==t[1])?(this._set(`position`,[n[0],n[1]]),!0):!1}forceDOMReadyCycle(){}};return e([t()],E.prototype,`_attribution`,void 0),e([t()],E.prototype,`aria`,void 0),e([t()],E.prototype,`attributionHeight`,null),e([t()],E.prototype,`attributionMode`,void 0),e([t()],E.prototype,`container`,null),e([t({readOnly:!0})],E.prototype,`focused`,null),e([t({readOnly:!0})],E.prototype,`height`,void 0),e([t()],E.prototype,`focusRegionVisible`,void 0),e([t()],E.prototype,`focusRegionShortcutEnabled`,void 0),e([t()],E.prototype,`focusRegion`,null),e([t()],E.prototype,`messagesCommon`,void 0),e([t({type:g})],E.prototype,`overlay`,void 0),e([t({readOnly:!0})],E.prototype,`position`,void 0),e([t({readOnly:!0})],E.prototype,`resizing`,void 0),e([t({readOnly:!0})],E.prototype,`root`,void 0),e([t({value:null,readOnly:!0})],E.prototype,`size`,null),e([t({readOnly:!0})],E.prototype,`surface`,void 0),e([t({readOnly:!0})],E.prototype,`suspended`,void 0),e([t({nonNullable:!0})],E.prototype,`ui`,null),e([t({readOnly:!0})],E.prototype,`userContent`,void 0),e([t({readOnly:!0})],E.prototype,`width`,void 0),e([t()],E.prototype,`widthBreakpoint`,void 0),E=e([n(`esri.views.DOMContainer`)],E)};export{E as DOMContainer};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{byId as r,reparent as i}from"../core/domUtils.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import s from"../core/Logger.js";import{destroyMaybe as c,removeMaybe as l}from"../core/maybe.js";import{watch as u,initial as d,syncAndInitial as f}from"../core/reactiveUtils.js";import{addFrameTask as p}from"../core/scheduling.js";import{Attribution as m}from"./Attribution.js";import h from"./overlay/FocusRegionOverlayItem.js";import g from"./overlay/ViewOverlay.js";const _=[0,0];function v(e){let t=(e.ownerDocument||window.document).defaultView,n=e.getBoundingClientRect();return _[0]=n.left+(t?.pageXOffset??0),_[1]=n.top+(t?.pageYOffset??0),_}function y(e){e&&(e.textContent=``,e.parentNode&&e.parentNode.removeChild(e))}const b=process.env.NODE_ENV===`test`,x=b?0:16,S=b?0:750,C=b?0:512,w={left:0,top:0,right:0,bottom:0},T={toggle:`KeyO`,resizeLarger:`ArrowUp`,resizeSmaller:`ArrowDown`,select:new Set([`Enter`,`Space`])},E=_=>{let b=_,E=class extends b{constructor(...e){super(...e),this._freqInfo={freq:x,time:S},this._overlayRenderTaskHandle=null,this._focusRegionOverlayItem=new h,this.aria={},this.height=0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([u(()=>[this.focusRegionVisible,this.overlay,this.ready],()=>this._syncFocusRegionOverlayItemVisibility(this.focusRegionVisible&&this.ready),{initial:!0}),u(()=>this.cursor,e=>{let{surface:t}=this;t&&t.setAttribute(`data-cursor`,e)}),u(()=>this.navigating,e=>{let{surface:t}=this;t&&t.setAttribute(`data-navigating`,e.toString())}),u(()=>[this.aria,this.surface],()=>this._updateAria(),{initial:!0}),u(()=>{let{left:e,top:t,right:n,bottom:r}=this.padding??w;return[this.width,this.height,e,t,n,r]},([e,t,n,r,i,a])=>{let{_focusRegionOverlayItem:o}=this;o.backgroundHeight=t,o.backgroundWidth=e,o.padding={left:n,top:r,right:i,bottom:a},o.updateBoxSize()})])}initialize(){let e=this;this.addHandles([u(()=>this.ui,(e,t)=>this._handleUIChange(e,t),d),e.on(`focus`,()=>this.notifyChange(`focused`)),e.on(`blur`,()=>this.notifyChange(`focused`)),e.on(`key-down`,t=>{let{shiftKey:n,altKey:r,code:i,defaultPrevented:a}=t.native,{toggle:o,resizeLarger:s,resizeSmaller:c,select:l}=T,u=this.focusRegionVisible&&n&&r&&(i===s||i===c);if(!t.repeat||u){if(!a&&n&&r&&i===o&&this.focusRegionShortcutEnabled)this._toggleFocusRegion(),t.preventDefault();else if(!a&&u){let{_focusRegionOverlayItem:e}=this;e.resizeBoxSize(i===s?50:-50),t.preventDefault(),t.native.stopPropagation(),t.stopPropagation()}else!a&&this.focusRegionVisible&&l.has(i)&&this._selectFocusRegion(t,e)}})])}destroy(){this.destroyed||(this.focusRegionVisible=!1,this._syncFocusRegionOverlayItemVisibility(!1),this.ui?.destroy(),this.container=null)}get attributionHeight(){return this._attribution?.height??0}get attributionMode(){return this._get(`attributionMode`)??`auto`}set attributionMode(e){this._set(`attributionMode`,e??`auto`)}get container(){return this._get(`container`)??null}set container(e){let t=this._get(`container`),n=r(e);if(!n&&typeof e==`string`&&s.getLogger(this).error(`#container`,`element with id '${e}' not found`),t===n)return;if(this._stopMeasuring(),this.removeHandles(`container`),t&&(t.classList.remove(`esri-view`),this._overlayRenderTaskHandle&&=(this._overlayRenderTaskHandle.remove(),null),this.overlay&&(this.overlay.destroy(),this._set(`overlay`,null)),this._attribution=c(this._attribution),this.root&&(y(this.root),this._set(`root`,null)),this.userContent&&(i(this.userContent,t),y(this.userContent),this._set(`userContent`,null))),!n){this._set(`width`,0),this._set(`height`,0),this._set(`position`,null),this._set(`suspended`,!0),this._set(`surface`,null),this._set(`container`,null);return}n.classList.add(`esri-view`);let a=document.createElement(`div`);a.className=`esri-view-user-storage`,i(n,a),n.appendChild(a),this._set(`userContent`,a);let o=document.createElement(`div`);o.className=`esri-view-root`,n.insertBefore(o,n.firstChild),this._set(`root`,o);let h=document.createElement(`div`);h.className=`esri-view-surface`,h.setAttribute(`role`,`application`),h.tabIndex=0,o.appendChild(h),this._set(`surface`,h);let _=new g;o.appendChild(_.surface),this._set(`overlay`,_),this._syncFocusRegionOverlayItemVisibility(!1),this.addHandles(u(()=>_.needsRender,e=>{this._overlayRenderTaskHandle=e&&!this._overlayRenderTaskHandle?p({render:()=>this.overlay?.render()}):l(this._overlayRenderTaskHandle)},d),`container`),this.addHandles([u(()=>({visible:this.attributionVisible,items:this.attributionItems,mode:this.attributionMode}),({visible:e,items:t,mode:n})=>{e?(this._attribution||=new m({attributionItems:this.attributionItems,mode:this.attributionMode}),this._attribution.appendBefore(o,this.ui?.container??null),this._attribution.attributionItems=t,this._attribution.mode=n):this._attribution=c(this._attribution)},f)],`container`),this.forceDOMReadyCycle(),this._set(`container`,n),this._startMeasuring()}get focused(){let e=document.activeElement===this.surface;return document.hasFocus()&&e}get focusRegion(){return this.focusRegionVisible?this._focusRegionOverlayItem.getScreenRect():null}get size(){return[this.width,this.height]}get ui(){return this._get(`ui`)}set ui(e){let t=this._get(`ui`);t!==e&&t?.destroy(),this._set(`ui`,e)}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(e,t,n){let r=this.position;return e-=r?r[0]:0,t-=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}containerToPage(e,t,n){let r=this.position;return e+=r?r[0]:0,t+=r?r[1]:0,n?(n[0]=e,n[1]=t):n=[e,t],n}_updateAria(){let{surface:e,aria:t}=this;e&&(e.ariaLabelledByElements=t?.labelledByElements??null,e.ariaDescribedByElements=t?.describedByElements??null,e.ariaLabel=t?.label??null,e.ariaDescription=t?.description??null)}_selectFocusRegion(e,t){let n=this._makeFocusRegionSelectEvent(e);t.emit(`focus-region-select`,n),e.preventDefault()}_makeFocusRegionSelectEvent(e){let t={type:`focus-region-select`,native:e.native,defaultPrevented:!1,preventDefault:()=>{t.defaultPrevented=!0},stopPropagation:()=>{e.stopPropagation()}};return t}_toggleFocusRegion(){this.focusRegionVisible=!this.focusRegionVisible}_updateFocusRegionOverlayItem(){let{_focusRegionOverlayItem:e}=this;e.backgroundHeight=this.height,e.backgroundWidth=this.width,e.padding=this.padding??w,e.updateBoxSize()}_syncFocusRegionOverlayItemVisibility(e){let{_focusRegionOverlayItem:t,overlay:n}=this,r=e;t.visible=r,n&&(n.removeItem(t),r&&(this._updateFocusRegionOverlayItem(),n.addItem(t)))}_handleUIChange(e,t){this.removeHandles(`ui`),t&&t!==e&&t.destroy(),e&&(e.view=this,this.addHandles(u(()=>this.root,t=>{if(!t)e.container=null;else{let n=document.createElement(`div`);t.insertBefore(n,this._attribution?.surface??null),e.container=n}},d),`ui`)),this._set(`ui`,e)}_stopMeasuring(){this.removeHandles(`measuring`),this._get(`resizing`)&&this._set(`resizing`,!1)}_startMeasuring(){let e=this._freqInfo;e.freq=x,e.time=S;let t=p({prepare:e=>{let n=this._measure(),r=this._freqInfo;r.time+=e.deltaTime,n&&(r.freq=x,this._get(`resizing`)||this._set(`resizing`,!0)),r.time<r.freq||(r.time=0,r.freq=this._position()||n?x:Math.min(S,r.freq*2),!n&&r.freq>=C&&(t.pause(),this._get(`resizing`)&&this._set(`resizing`,!1)))}}),n=new ResizeObserver(n=>{e.freq=x,e.time=S,t.resume()});this.container!=null&&n.observe(this.container);let r=o(()=>n.disconnect());this.addHandles([a(window,`resize`,()=>{e.freq=x,e.time=S,t.resume()}),r,t],`measuring`),this._measure(),this._position()}_measure(){let e=this.container,t=e?e.clientWidth:0,n=e?e.clientHeight:0;if(t===0||n===0)return this.suspended||this._set(`suspended`,!0),!1;let r=this.width,i=this.height;return t===r&&n===i?(this.suspended&&this._set(`suspended`,!1),!1):(this._set(`width`,t),this._set(`height`,n),this.suspended&&this._set(`suspended`,!1),this.emit(`resize`,{oldWidth:r,oldHeight:i,width:t,height:n}),!0)}_position(){let e=this.container,t=this.position,n=e&&v(e);return n&&(!t||n[0]!==t[0]||n[1]!==t[1])?(this._set(`position`,[n[0],n[1]]),!0):!1}forceDOMReadyCycle(){}};return e([t()],E.prototype,`_attribution`,void 0),e([t()],E.prototype,`aria`,void 0),e([t()],E.prototype,`attributionHeight`,null),e([t()],E.prototype,`attributionMode`,null),e([t()],E.prototype,`container`,null),e([t({readOnly:!0})],E.prototype,`focused`,null),e([t({readOnly:!0})],E.prototype,`height`,void 0),e([t()],E.prototype,`focusRegionVisible`,void 0),e([t()],E.prototype,`focusRegionShortcutEnabled`,void 0),e([t()],E.prototype,`focusRegion`,null),e([t()],E.prototype,`messagesCommon`,void 0),e([t({type:g})],E.prototype,`overlay`,void 0),e([t({readOnly:!0})],E.prototype,`position`,void 0),e([t({readOnly:!0})],E.prototype,`resizing`,void 0),e([t({readOnly:!0})],E.prototype,`root`,void 0),e([t({value:null,readOnly:!0})],E.prototype,`size`,null),e([t({readOnly:!0})],E.prototype,`surface`,void 0),e([t({readOnly:!0})],E.prototype,`suspended`,void 0),e([t({nonNullable:!0})],E.prototype,`ui`,null),e([t({readOnly:!0})],E.prototype,`userContent`,void 0),e([t({readOnly:!0})],E.prototype,`width`,void 0),e([t()],E.prototype,`widthBreakpoint`,void 0),E=e([n(`esri.views.DOMContainer`)],E)};export{E as DOMContainer};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a,ensureClass as o}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as s}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as c}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ee}from"../core/accessorSupport/trackingUtils.js";import l from"../core/Collection.js";import{byId as te}from"../core/domUtils.js";import u from"../core/Error.js";import{on as ne}from"../core/events.js";import{destroyHandle as re,makeHandle as d}from"../core/handleUtils.js";import has from"../core/has.js";import{create as ie}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ae}from"../core/libs/rbush/PooledRBush.js";import f from"../core/Logger.js";import{mapCollectionAsync as oe}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,maybeProperty as se}from"../core/maybe.js";import{throwIfDestroyed as ce,throwIfAborted as le,createAbortError as ue}from"../core/promiseUtils.js";import de from"../core/ReactiveSet.js";import{on as fe,watch as m,initial as pe,sync as h,whenOnce as g,syncAndInitial as _}from"../core/reactiveUtils.js";import{cleanupScheduling as me}from"../core/scheduling.js";import{createScreenPoint as he,createScreenPointArray as ge}from"../core/screenUtils.js";import{cleanupWhereClauseCache as _e}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as ve,getMetersPerUnitForSR as v}from"../core/units.js";import{initialize as ye}from"../core/workers/workers.js";import y from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import b from"../geometry/Point.js";import{projectBoundingRect as xe}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as x}from"../geometry/projection/projectPointToVector.js";import{project as S,canProjectWithoutEngine as Se}from"../geometry/projectionUtils.js";import C from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Ce}from"../geometry/spatialReferenceEllipsoidUtils.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{IntegratedMeshSemantics as w}from"../layers/support/IntegratedMeshSemantics.js";import{isImageryTileLayer as T,isTiledLayer as E,isVoxelLayer as D,isIntegratedMeshLayer as O,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import Fe from"../Viewpoint.js";import Ie from"../webscene/Environment.js";import{clearVNodeCache as Le}from"../widgets/support/vnodeCache.js";import{importAnalysisViewModule as Re}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ze}from"./3d/camera/intersectionUtils.js";import k from"./3d/constraints/Constraints.js";import A from"./3d/environment/Environment.js";import{EnvironmentView as Be}from"./3d/environment/EnvironmentView.js";import{GroundView3D as Ve}from"./3d/GroundView3D.js";import He from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as Ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as We}from"./3d/layers/graphics/Labeler.js";import Ge from"./3d/layers/i3s/I3SLodHandling.js";import{layerView3DImporter as j}from"./3d/layerViewModuleImportUtils.js";import{Navigation3D as Ke}from"./3d/navigation/Navigation3D.js";import{cleanupPointToPointAnimationController as qe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Je}from"./3d/state/helpers/SceneIntersectionHelper.js";import{ScreenSizePerspective as Ye}from"./3d/state/ScreenSizePerspective.js";import{cleanupNavigationUtils as Xe}from"./3d/state/utils/navigationUtils.js";import M from"./3d/state/ViewState.js";import{ViewStateManager as Ze,cleanupViewStateManager as Qe}from"./3d/state/ViewStateManager.js";import $e from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as et}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as N}from"./3d/support/debugFlags.js";import{getElevationAtPoint as tt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as nt}from"./3d/support/GroundAndIMSurface.js";import{toMap as rt,hitTest as it}from"./3d/support/hitTest.js";import{PointsOfInterest as P}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import{popupHitTest as at}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as ot,getQualityProfileSettings as F}from"./3d/support/QualityProfile.js";import I from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as st}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as ct}from"./3d/support/ResourceController.js";import lt from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as ut}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as dt}from"./3d/support/ViewSlice.js";import L from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as ft,getTiledLayerInfo as pt,checkIfTileInfoSupportedForView as mt}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as ht}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as gt}from"./3d/terrain/TileRenderer.js";import{createWebGLContext as _t}from"./3d/webgl-engine/createWebGLContext.js";import{olidEnabled as vt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as yt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{cleanupEdgeProcessing as bt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{defaultTolerance as R}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as z}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{Stage as St}from"./3d/webgl-engine/Stage.js";import{BreakpointsOwner as Ct}from"./BreakpointsOwner.js";import{DOMContainer as wt}from"./DOMContainer.js";import B from"./interactive/options/ViewOptions.js";import{PopupView as Tt}from"./PopupView.js";import Et from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as Dt}from"./support/drapedUtils.js";import{occludeesSupported as Ot}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as V,createScreenPointFromSupportedEvent as H}from"./support/screenUtils.js";import{isSpatialReferenceSupported as U}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as kt,destroyTextureCompressionWorker as At}from"./support/TextureCompressionHelper.js";import W from"./ui/3d/DefaultUI3D.js";import jt from"./ui/DefaultUI.js";import G from"./View.js";import Mt from"./ViewAnimation.js";import{stringFromIsGlobal as K,isGlobalFromString as q}from"./ViewingMode.js";var J;const Nt=Symbol(),Y=Symbol();function Pt(e){let t=o(B,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let X=class extends Ct(Tt(wt(G))){static{J=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new B({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=ct(this),this.deconflictor=new Ue({view:this}),this.attribution3D=new $e({view:this}),this.labeler=new We({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new Ke({view:this}),this.basemapTerrain=null,this.elevationProvider=new et({view:this}),this._canvas=null,this.constraints=new k,this._environment=new A,this.environmentView=new Be,this.floors=new l,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Et({importAnalysisViewModule:e=>Re(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new de,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new M({view:this}),this.slice=new dt,this.renderCoordsHelper=new st,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new W,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(re(oe(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([fe(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),m(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new He({view:this}),this.stateManager=new Ze({view:this}),this.screenSizePerspective=new Ye({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=kt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new Ve({view:this}),this.groundAndIMSurface=new nt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},pe),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},pe),this.addHandles([m(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),m(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(At(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set(`labeler`,p(this.labeler)),this._set(`deconflictor`,p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set(`stateManager`,p(this.stateManager)),this._set(`inputManager`,p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,p(this.environmentView)),this._set(`environment`,p(this.environment)),this.groundView=p(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}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 canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=a(b,e))}get clippingArea(){if(this.state.isGlobal)return null;let e=this.map,t=this._userClippingArea||se(e,`clippingArea`);return!(this._userClippingArea||se(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof y?this.spatialReference&&(t=Z(t,this.spatialReference),t==null)?(f.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this._groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(f.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.state.isGlobal&&e!=null?f.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.isGlobal)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:Z(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent,t=this.spatialReference||C.WGS84,n=Z(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get _groundAndLayersExtent(){let e=this.spatialReference||C.WGS84,t,n=n=>{let r=Z(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new y({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)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);let s=this._get(`_groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof A?e:e instanceof Ie?this.environment?.cloneWithWebsceneEnvironment(e)??A.fromWebsceneEnvironment(e):a(A,e):new A}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 layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return J._layerToLayerview}static{this._layerToLayerview=G._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}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??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=F(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new I(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||ot()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?c(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=ve(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&f.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||ft(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return N.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return N.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedGlobalMode;if(e!=null)return K(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?K(this.defaultsFromMap.viewingMode===1):U(t,!0)?`global`:`local`:`global`}set viewingMode(e){this.ready?f.getLogger(this).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 visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new lt(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return f.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return rt(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return f.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=It,t.x=e.x,t.y=e.y,t.z=tt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),x(t,Q,this.renderSpatialReference),this.state.camera.projectToScreen(Q,$),he($[0],$[1])}pixelSizeAt(e,t){if(!this.ready)return f.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;x(e,Q,n);let r=this.state.camera.computeScreenPixelSizeAt(Q);return t&&n!==t?r*v(n)/v(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return f.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return it(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return at(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new u(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!vt())throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),a=await this._completeSettings(e);return a.format=`png`,[i,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return j.importLayerView(e)}hasLayerViewModule(e){return j.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedGlobalMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:q(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedGlobalMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n==null?[...r(!0)??[],...r(!1)??[]]:r(n);return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return U(e,n)?t==null||T(t)?!0:!(E(t)&&pt(t,e,n)==null||D(t)&&n):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,isGlobal:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?C.WGS84:C.WebMercator:new C({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return T(t)&&(i||a)?!(a&&r!==!1)||mt(t.tileInfo,t.fullExtent,e,!0)===null?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:[{spatialReference:c(),isGlobal:n}]:!E(t)&&!D(t)&&(i||a)?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:E(t)&&i&&!n?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:!1}]:[{spatialReference:e,isGlobal:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedGlobalMode;return t||(n==null?e.isGeographic&&f.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):f.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${K(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return f.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return f.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Ot(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await g(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),d(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await Lt[e]();if(t&&(ce(this),le(n.signal),await t(n.signal)),this.destroyed)throw ue();return le(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new L({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new P({view:this})),this.addHandles([this.updatingHandles.add(()=>N.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&N.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?S(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Y),this.removeHandles(Nt),this._featureTiles=p(this.featureTiles),this._set(`pointsOfInterest`,p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.isGlobal=this.state.isGlobal,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(m(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&xe(e,this.groundView.spatialReference,Ft,t)&&(this.renderCoordsHelper.extent=Ft)},h),Y),this.sceneIntersectionHelper?.setTolerance(R/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(Y)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(m(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(e){let t={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,context:e,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},n=new Je(this.state.isGlobal,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,n);let r=te(this.surface);this._stage=new St({view:this,options:t,container:r}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),ne(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new u(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(R/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=p(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface();let e=_t(this.renderCanvas,{alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled});this._initStage(e),this._initGlobe(),this.sharedSymbolResources=new ut({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>g(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){q(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(fe(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?s(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(z);for(let t of this.allLayerViews)(O(t.layer)&&w.shouldIntersectAsGround(t.layer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(z);for(let t of this.allLayerViews)O(t.layer)&&w.shouldIntersectAsGround(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Le(),ee(),_e(),bt(),Qe(),ze(),Ce(),Dt(),Ne(),gt(),xt(),qe(),Xe(),ae(),me(),yt(),ht(),Ge.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),M.cleanupViewstate(),L.cleanupTerrainSurface()}};e([n({nonNullable:!0}),r(Pt)],X.prototype,`options`,void 0),e([n()],X.prototype,`_userClippingArea`,void 0),e([n()],X.prototype,`_resourceController`,void 0),e([n()],X.prototype,`stage`,null),e([n({readOnly:!0})],X.prototype,`deconflictor`,void 0),e([n({readOnly:!0})],X.prototype,`labeler`,void 0),e([n()],X.prototype,`navigation`,void 0),e([n({type:Mt,readOnly:!0})],X.prototype,`animation`,null),e([n({readOnly:!0})],X.prototype,`basemapTerrain`,void 0),e([n({readOnly:!0})],X.prototype,`overlayManager`,null),e([n({readOnly:!0})],X.prototype,`elevationProvider`,void 0),e([n()],X.prototype,`camera`,null),e([n({type:t})],X.prototype,`contentCamera`,null),e([n({readOnly:!0})],X.prototype,`canvas`,null),e([n({type:b,useTypeForAutocast:!1})],X.prototype,`center`,null),e([n({type:y})],X.prototype,`clippingArea`,null),e([n({type:k,nonNullable:!0})],X.prototype,`constraints`,void 0),e([n({type:y,readOnly:!0})],X.prototype,`renderDataExtent`,null),e([n({readOnly:!0})],X.prototype,`tileInfo`,null),e([n({type:y,readOnly:!0})],X.prototype,`dataExtent`,null),e([n({type:y,readOnly:!0})],X.prototype,`_groundAndLayersExtent`,null),e([n({type:A})],X.prototype,`environment`,null),e([r(`environment`)],X.prototype,`castEnvironment`,null),e([n({readOnly:!0})],X.prototype,`environmentView`,void 0),e([n({type:y})],X.prototype,`extent`,null),e([n({type:l})],X.prototype,`floors`,void 0),e([n()],X.prototype,`screenCenter`,null),e([n()],X.prototype,`frustum`,null),e([n({type:Number,readOnly:!0})],X.prototype,`fullOpacity`,void 0),e([n({readOnly:!0})],X.prototype,`graphicsView`,void 0),e([n()],X.prototype,`analysisViewManager`,void 0),e([n()],X.prototype,`groundView`,void 0),e([n({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([n({type:Boolean})],X.prototype,`initialExtentRequired`,null),e([n()],X.prototype,`defaultsFromMapSettings`,null),e([n()],X.prototype,`interacting`,null),e([n()],X.prototype,`stationary`,null),e([n()],X.prototype,`navigating`,null),e([n()],X.prototype,`map`,void 0),e([n()],X.prototype,`padding`,null),e([n({type:P,readOnly:!0})],X.prototype,`pointsOfInterest`,void 0),e([n()],X.prototype,`_featureTiles`,void 0),e([n()],X.prototype,`featureTiles`,null),e([n()],X.prototype,`_featureTreeDebugger`,void 0),e([n({constructOnly:!0})],X.prototype,`deactivatedWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`debugWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`renderCanvas`,void 0),e([n({constructOnly:!0})],X.prototype,`state`,void 0),e([n()],X.prototype,`screenSizePerspective`,void 0),e([n({readOnly:!0})],X.prototype,`inputManager`,void 0),e([n({readOnly:!0})],X.prototype,`stateManager`,void 0),e([n({type:[`low`,`medium`,`high`]})],X.prototype,`qualityProfile`,null),e([n({type:I,get(){let e=this._get(`qualitySettings`);if(!e){let t=F(this.qualityProfile);e=new I(t)}return e}})],X.prototype,`qualitySettings`,void 0),e([n()],X.prototype,`slice`,void 0),e([n({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,null),e([n({readOnly:!0})],X.prototype,`sceneIntersectionHelper`,void 0),e([n({type:Number,readOnly:!0})],X.prototype,`resolution`,null),e([n({type:Number})],X.prototype,`scale`,null),e([n({readOnly:!0,type:Number})],X.prototype,`terrainLevel`,null),e([n()],X.prototype,`heightModelInfo`,null),e([n({type:C})],X.prototype,`spatialReference`,void 0),e([n({type:Boolean,value:!1})],X.prototype,`alphaCompositingEnabled`,null),e([n({constructOnly:!0})],X.prototype,`preserveDrawingBufferEnabled`,void 0),e([n({type:Boolean})],X.prototype,`supersampleScreenshotsEnabled`,void 0),e([n({readOnly:!0})],X.prototype,`type`,void 0),e([n(),r(e=>e instanceof jt?e:o(W,e))],X.prototype,`ui`,void 0),e([n({type:Boolean,readOnly:!0})],X.prototype,`updating`,null),e([n()],X.prototype,`_updatingObjects`,null),e([n()],X.prototype,`_updatingObjectsWithProgress`,null),e([n()],X.prototype,`_updatingObjectsToDebug`,null),e([n({type:Number,readOnly:!0})],X.prototype,`updatingProgress`,void 0),e([n({type:[`global`,`local`]})],X.prototype,`viewingMode`,null),e([n({type:Fe})],X.prototype,`viewpoint`,null),e([n({readOnly:!0})],X.prototype,`visibleArea`,null),e([n({type:Number})],X.prototype,`zoom`,null),e([n({readOnly:!0})],X.prototype,`quality`,null),e([n({readOnly:!0})],X.prototype,`resolutionScale`,null),e([n()],X.prototype,`focusAreasView`,void 0),e([n()],X.prototype,`_defaultToMapOptions`,null),e([n()],X.prototype,`_defaultHitTestOptions`,null),X=J=e([i(`esri.views.SceneView`)],X);function Z(e,t){return e!=null&&Se(e.spatialReference,t)?S(e,t):null}const Q=ie(),$=ge(),Ft=Te(),It=Ae(0,0,0,C.WebMercator),Lt={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Rt=X;export{Rt as default};
2
+ import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as n,cast as r,subclass as i}from"../core/accessorSupport/decorators.js";import{ensureType as a,ensureClass as o}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as s}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as c}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as ee}from"../core/accessorSupport/trackingUtils.js";import l from"../core/Collection.js";import{byId as te}from"../core/domUtils.js";import u from"../core/Error.js";import{on as ne}from"../core/events.js";import{destroyHandle as re,makeHandle as d}from"../core/handleUtils.js";import has from"../core/has.js";import{create as ie}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as ae}from"../core/libs/rbush/PooledRBush.js";import f from"../core/Logger.js";import{mapCollectionAsync as oe}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,maybeProperty as se}from"../core/maybe.js";import{throwIfDestroyed as ce,throwIfAborted as le,createAbortError as ue}from"../core/promiseUtils.js";import de from"../core/ReactiveSet.js";import{on as fe,watch as m,initial as pe,sync as h,whenOnce as g,syncAndInitial as _}from"../core/reactiveUtils.js";import{cleanupScheduling as me}from"../core/scheduling.js";import{createScreenPoint as he,createScreenPointArray as ge}from"../core/screenUtils.js";import{cleanupWhereClauseCache as _e}from"../core/sql.js";import{getDefaultVerticalUnitStringForSR as ve,getMetersPerUnitForSR as v}from"../core/units.js";import{initialize as ye}from"../core/workers/workers.js";import y from"../geometry/Extent.js";import be from"../geometry/HeightModelInfo.js";import b from"../geometry/Point.js";import{projectBoundingRect as xe}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as x}from"../geometry/projection/projectPointToVector.js";import{project as S,canProjectWithoutEngine as Se}from"../geometry/projectionUtils.js";import C from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Ce}from"../geometry/spatialReferenceEllipsoidUtils.js";import{toExtent as we,create as Te}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Ee}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as De}from"../geometry/support/scaleUtils.js";import{wgs84 as Oe,webMercator as ke}from"../geometry/support/spatialReferenceUtils.js";import{makeDehydratedPoint as Ae}from"../layers/graphics/dehydratedPoint.js";import{IntegratedMeshSemantics as w}from"../layers/support/IntegratedMeshSemantics.js";import{isImageryTileLayer as T,isTiledLayer as E,isVoxelLayer as D,isIntegratedMeshLayer as O,isGaussianSplatLayer as je}from"../layers/support/layerUtils.js";import{TilemapCache as Me}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as Ne}from"../portal/portalDefault.js";import{WebSceneTag as Pe}from"../support/tagSymbols.js";import Fe from"../Viewpoint.js";import Ie from"../webscene/Environment.js";import{clearVNodeCache as Le}from"../widgets/support/vnodeCache.js";import{importAnalysisViewModule as Re}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ze}from"./3d/camera/intersectionUtils.js";import k from"./3d/constraints/Constraints.js";import A from"./3d/environment/Environment.js";import{EnvironmentView as Be}from"./3d/environment/EnvironmentView.js";import{GroundView3D as Ve}from"./3d/GroundView3D.js";import He from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as Ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as We}from"./3d/layers/graphics/Labeler.js";import Ge from"./3d/layers/i3s/I3SLodHandling.js";import{layerView3DImporter as j}from"./3d/layerViewModuleImportUtils.js";import{Navigation3D as Ke}from"./3d/navigation/Navigation3D.js";import{cleanupPointToPointAnimationController as qe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Je}from"./3d/state/helpers/SceneIntersectionHelper.js";import{ScreenSizePerspective as Ye}from"./3d/state/ScreenSizePerspective.js";import{cleanupNavigationUtils as Xe}from"./3d/state/utils/navigationUtils.js";import M from"./3d/state/ViewState.js";import{ViewStateManager as Ze,cleanupViewStateManager as Qe}from"./3d/state/ViewStateManager.js";import $e from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as et}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as N}from"./3d/support/debugFlags.js";import{getElevationAtPoint as tt}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as nt}from"./3d/support/GroundAndIMSurface.js";import{toMap as rt,hitTest as it}from"./3d/support/hitTest.js";import{PointsOfInterest as P}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import{popupHitTest as at}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as ot,getQualityProfileSettings as F}from"./3d/support/QualityProfile.js";import I from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as st}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as ct}from"./3d/support/ResourceController.js";import lt from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as ut}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as dt}from"./3d/support/ViewSlice.js";import L from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as ft,getTiledLayerInfo as pt,checkIfTileInfoSupportedForView as mt}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as ht}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as gt}from"./3d/terrain/TileRenderer.js";import{createWebGLContext as _t}from"./3d/webgl-engine/createWebGLContext.js";import{olidEnabled as vt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as yt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{cleanupEdgeProcessing as bt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import{defaultTolerance as R}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as xt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as z}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{Stage as St}from"./3d/webgl-engine/Stage.js";import{BreakpointsOwner as Ct}from"./BreakpointsOwner.js";import{DOMContainer as wt}from"./DOMContainer.js";import B from"./interactive/options/ViewOptions.js";import{PopupView as Tt}from"./PopupView.js";import Et from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as Dt}from"./support/drapedUtils.js";import{occludeesSupported as Ot}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as V,createScreenPointFromSupportedEvent as H}from"./support/screenUtils.js";import{isSpatialReferenceSupported as U}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as kt,destroyTextureCompressionWorker as At}from"./support/TextureCompressionHelper.js";import W from"./ui/3d/DefaultUI3D.js";import jt from"./ui/DefaultUI.js";import G from"./View.js";import Mt from"./ViewAnimation.js";import{stringFromIsGlobal as K,isGlobalFromString as q}from"./ViewingMode.js";var J;const Nt=Symbol(),Y=Symbol();function Pt(e){let t=o(B,e);return t!==e&&e.snapping?.enabled==null&&(t.snapping.enabled=!0),t}let X=class extends Ct(Tt(wt(G))){static{J=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this.options=new B({snapping:{enabled:!0}}),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=ct(this),this.deconflictor=new Ue({view:this}),this.attribution3D=new $e({view:this}),this.labeler=new We({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new Ke({view:this}),this.basemapTerrain=null,this.elevationProvider=new et({view:this}),this._canvas=null,this.constraints=new k,this._environment=new A,this.environmentView=new Be,this.floors=new l,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new Et({importAnalysisViewModule:e=>Re(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new de,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new M({view:this}),this.slice=new dt,this.renderCoordsHelper=new st,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type=`3d`,this.ui=new W,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,ye();let t=()=>this._updatingChanged();this.addHandles(re(oe(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([fe(()=>this.map?.allLayers,`after-changes`,t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on(`after-changes`,e=>this._updateUpdatingMonitors(e)),m(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new He({view:this}),this.stateManager=new Ze({view:this}),this.screenSizePerspective=new Ye({view:this})}initialize(){if(has(`enable-feature:esri-compress-textures`)&&has(`wasm-simd`)){let e=kt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new Ve({view:this}),this.groundAndIMSurface=new nt({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},pe),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},pe),this.addHandles([m(()=>this.spatialReference,()=>this.notifyChange(`clippingArea`),h),m(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),h)])}destroy(){this.destroyed||(At(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set(`analysisViewManager`,p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set(`labeler`,p(this.labeler)),this._set(`deconflictor`,p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set(`stateManager`,p(this.stateManager)),this._set(`inputManager`,p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles(`updatingMonitors`),this._set(`environmentView`,p(this.environmentView)),this._set(`environment`,p(this.environment)),this.groundView=p(this.groundView),this.groundAndIMSurface.destroy(),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set(`ui`,null),this._set(`renderCanvas`,null),this._set(`canvas`,null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper.spatialReference}get groundSpatialReference(){return this.groundView?.spatialReference}get analyses(){return super.analyses}set analyses(e){super.analyses=e}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}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 canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=a(b,e))}get clippingArea(){if(this.state.isGlobal)return null;let e=this.map,t=this._userClippingArea||se(e,`clippingArea`);return!(this._userClippingArea||se(e,`clippingEnabled`))||t==null?(this._clippingArea=null,null):t instanceof y?this.spatialReference&&(t=Z(t,this.spatialReference),t==null)?(f.getLogger(this).error(`#clippingArea`,`setting clippingArea with incompatible SpatialReference`),this._clippingArea):(t=t.clone(),t.intersection(this.groundAndLayersExtent)??(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(f.getLogger(this).error(`#clippingArea`,`only clippingArea geometries of type Extent are supported`),this._clippingArea)}set clippingArea(e){this.ready&&this.state.isGlobal&&e!=null?f.getLogger(this).error(`#clippingArea=`,`Clipping area is only supported in local viewingMode`):this._userClippingArea=e}get renderDataExtent(){if(this.state.isGlobal)return null;let e=this.renderSpatialReference,t=this.dataExtent;return t==null||e==null||t.spatialReference.equals(e)?t:Z(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this.groundAndLayersExtent,t=this.spatialReference||C.WGS84,n=Z(this.clippingArea,t);n!=null&&(e=e==null?n:e.intersection(n));let r=this._get(`dataExtent`);return e!=null&&e.equals(r)?r:e}get groundAndLayersExtent(){let e=this.spatialReference||C.WGS84,t,n=n=>{let r=Z(n,e);r!=null&&(t==null?t=r.clone():t.union(r))},{groundView:r}=this,i=r?.spatialReference,a=r?.fullGroundExtent;i&&a&&n(new y({xmin:a[0],ymin:a[1],zmin:0,xmax:a[2],ymax:a[3],zmax:0,spatialReference:i}));let o=e=>{e.fullExtent==null||e.type===`graphics`&&e.internal||n(e.fullExtent)};if(this.map?.allLayers.forEach(e=>o(e)),t==null)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);let s=this._get(`groundAndLayersExtent`);return t.equals(s)?s:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;let{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange(`environment`)}castEnvironment(e){return e?e instanceof A?e:e instanceof Ie?this.environment?.cloneWithWebsceneEnvironment(e)??A.fromWebsceneEnvironment(e):a(A,e):new A}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 layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return J._layerToLayerview}static{this._layerToLayerview=G._layerToLayerview.concat([[`view.map.ground.layers`,`view.groundView.layerViews`]])}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??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&Pe in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){let t=F(e);t&&this._get(`qualityProfile`)!==e&&(this.qualitySettings=new I(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set(`qualityProfile`,e))}get qualityProfile(){return this._get(`qualityProfile`)||ot()}_updateSlice(){this.stage!=null&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return this.viewingMode?!!this.stateManager?.preinit(this.spatialReference):!1}get resolution(){let{scale:e,spatialReference:t}=this;return t?c(()=>De(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){let e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;let n=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return n<=0?null:Math.max(0,Math.min(n,r||1/0))}get heightModelInfo(){let e=this.getDefaultHeightModelInfo();if(!e)return null;let t=ve(this.spatialReference);if(t&&e.heightUnit!==t)return new be({heightModel:e.heightModel,heightUnit:t,vertCRS:e.vertCRS,associatedSpatialReference:e.associatedSpatialReference});if(!e.associatedSpatialReference){let t=e.clone();return t.associatedSpatialReference=this.spatialReference,t}return e}get alphaCompositingEnabled(){return this._get(`alphaCompositingEnabled`)}set alphaCompositingEnabled(e){this._stage&&f.getLogger(this).warn(`alphaCompositingEnabled cannot be changed after the view has become ready`),this._set(`alphaCompositingEnabled`,e)}get updating(){if(this.destroying||this.destroyed)return!1;if(!this.initialized)return!0;let e=0,t=this.layerViewManager.updating,n=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(!r.isFulfilled())++n;else if(r.updating){if(t=!0,r.suspended||ft(r))return;++n,e+=r.updatingProgress}});let r=.1;for(let t of this._updatingObjects)t?.updating&&(n+=r,e+=.5*r);for(let t of this._updatingObjectsWithProgress)t?.updating&&(++n,e+=t.updatingProgress);let i=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||n>0||this.updatingHandles.updating||!this.ready||!this.stationary||i||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(n,this._numUpdating),e+=this._numUpdating-n):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=+!t,this._get(`updatingProgress`)!==e){let n=performance.now();if(e<1){let t=Math.min((n-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set(`updatingProgress`,e),this._lastUpdateTime=t&&e<1?n:0}return N.UPDATING&&console.log(`Updating:`,this._updatingObjectsToDebug.filter(e=>e!=null&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this.groundView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentView,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return N.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){let e=this._predeterminedGlobalMode;if(e!=null)return K(e);let t=this.spatialReference;return t?this.defaultsFromMap?.viewingMode!=null&&t.equals(this.defaultsFromMap.spatialReference)?K(this.defaultsFromMap.viewingMode===1):U(t,!0)?`global`:`local`:`global`}set viewingMode(e){this.ready?f.getLogger(this).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 visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new lt(this)}on(e,t,n,r){return this.viewEvents.on(e,t,n,r)||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return f.getLogger(this).error(`#toMap()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return rt(this,n,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return f.getLogger(this).error(`#toScreen()`,`Scene view cannot be used before it is ready`),null;let t=e;return e.z??(t=It,t.x=e.x,t.y=e.y,t.z=tt(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),x(t,Q,this.renderSpatialReference),this.state.camera.projectToScreen(Q,$),he($[0],$[1])}pixelSizeAt(e,t){if(!this.ready)return f.getLogger(this).error(`#pixelSizeAt()`,`Scene view cannot be used before it is ready`),null;if(!e)return 0;let n=this.renderSpatialReference;x(e,Q,n);let r=this.state.camera.computeScreenPixelSizeAt(Q);return t&&n!==t?r*v(n)/v(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return f.getLogger(this).error(`#hitTest()`,`Scene view cannot be used before it is ready`),null;let n=V(e)?H(this,e):e;return it(this,n,t,this._defaultHitTestOptions)}async popupHitTest(e){return at(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return this.navigation.zoom(!0)}async zoomOut(){if(this.canZoomOut)return this.navigation.zoom(!1)}async whenAnalysisView(e){if(e.parent==null)throw new u(`view:no-analysisview-for-analysis`,`The analysis does not exist in view.analyses`,{analysis:e});switch(e.parent.type){case`line-of-sight`:case`dimension`:case`viewshed`:return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encode(n,t,this._pixelFormat())}async _takeScreenshot(e){let t=await this._completeSettings(e);await this.whenReady();let n=(await this.stage.renderView.takeScreenshot(t))[0];return(await import(`./support/screenshotUtils.js`)).encodeData(n,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){let t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();let n=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import(`./support/screenshotUtils.js`);return[r(n[0],this._pixelFormat()),r(n[1],this._pixelFormat())]}async _completeSettings(e){let{toRenderSettings:t,screenshotSuperSampleSettings:n}=await import(`./support/screenshotUtils.js`),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,n(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!vt())throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`);let{encode:t}=await import(`./support/screenshotUtils.js`),n=await this._completeSettings(e);n.olidColor=!0,await this.whenReady();let r=await this.stage.renderView.takeScreenshot(n),i=t(r[0],n,this._pixelFormat()),a=await this._completeSettings(e);return a.format=`png`,[i,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){let e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new u(`360vr:objectAndLayerId-rendering-disabled`,`has enable-feature:objectAndLayerId-rendering must be true`)}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return j.importLayerView(e)}hasLayerViewModule(e){return j.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedGlobalMode(){let e=this._isOverridden(`viewingMode`)?this._get(`viewingMode`):this.scene?.initialViewProperties?.viewingMode;return e==null?null:q(e)}getSpatialReferenceSupport(e,t){let n=this._predeterminedGlobalMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,n):null,i=n==null?[...r(!0)??[],...r(!1)??[]]:r(n);return i?.length?{constraints:i}:null}_validateSpatialReferenceForViewingMode(e,t,n){return U(e,n)?t==null||T(t)?!0:!(E(t)&&pt(t,e,n)==null||D(t)&&n):!1}_makeSpatialReferenceConstraints(e,t,n,r){if(t==null)return[{spatialReference:e,isGlobal:n}];let{isWebMercator:i,isWGS84:a,vcsWkid:o,latestVcsWkid:s}=e,c=()=>o==null?i?C.WGS84:C.WebMercator:new C({...i?Oe:ke,vcsWkid:o,latestVcsWkid:s});return T(t)&&(i||a)?!(a&&r!==!1)||mt(t.tileInfo,t.fullExtent,e,!0)===null?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:[{spatialReference:c(),isGlobal:n}]:!E(t)&&!D(t)&&(i||a)?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:n}]:E(t)&&i&&!n?[{spatialReference:e,isGlobal:n},{spatialReference:c(),isGlobal:!1}]:[{spatialReference:e,isGlobal:n}]}_validateSpatialReference(e){let t=this.getSpatialReferenceSupport(e)!=null,n=this._predeterminedGlobalMode;return t||(n==null?e.isGeographic&&f.getLogger(this).warnOnce(`Spatial reference is geographic but not supported.`):f.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${K(n)} viewing mode.`)),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return f.getLogger(this).error(`trackGraphicState`,`GraphicState.graphic must not be null or undefined to start tracking`),null;let t=this.getViewForGraphic(e.graphic),n=null,r=!1,i=t=>{!r&&t!=null&&`processor`in t&&t.processor?.type===`graphics-3d`&&t.processor.graphicsCore&&(n=t.processor.graphicsCore.trackGraphicState(e))};return t==null?this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}maskOccludee(e){if(!e)return f.getLogger(this).error(`maskOccludee`,`GraphicState.graphic must not be null or undefined to mask an occludee`),null;let t=this.getViewForGraphic(e),n=null,r=!1,i=t=>{!r&&t!=null&&Ot(t)&&(n=t.maskOccludee(e))};return t==null?this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>i(e),()=>{}).catch(()=>{}):i(t),d(()=>{r=!0,n!=null&&(n.remove(),n=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>e.type!==`media-3d`).find(t=>t.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await g(()=>this.graphicsView),this.graphicsView):!e.layer||!this.map?null:!t||!t.waitForLayer||this.map.allLayers.includes(e.layer)?this.whenLayerView(e.layer):new Promise((t,n)=>{let r=this.map.allLayers.on(`change`,i=>{i.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,n))})})}enableFeatureTiles(){let e=Symbol();return this._featureTileTreeClients.add(e),d(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){let n=new AbortController;this._importControllers.set(e,n),this._updatingChanged();try{let r=await Lt[e]();if(t&&(ce(this),le(n.signal),await t(n.signal)),this.destroyed)throw ue();return le(n.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set(`basemapTerrain`,new L({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){let{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set(`basemapTerrain`,null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set(`pointsOfInterest`,new P({view:this})),this.addHandles([this.updatingHandles.add(()=>N.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import(`./3d/layers/support/FeatureTileTree3DDebugger.js`)).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&N.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:n,featureTiles:r})=>{if(!r)return;let i=!!e;if(!n&&!i)r.filterExtent=null;else if(!i||!t)r.filterExtent=n;else{let i=e&&t?S(we(e,t),this.spatialReference):null;r.filterExtent=n?n.intersection(i):i}},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},h)],Nt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has(`FeatureTileTree3D`))return;let e=(await this.updatingHandles.addPromise(this._importModule(`FeatureTileTree3D`)))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Y),this.removeHandles(Nt),this._featureTiles=p(this.featureTiles),this._set(`pointsOfInterest`,p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){let e=this.spatialReference,t=this.state.isGlobal,n=Ee(t,e);n!==this.renderSpatialReference&&(this.renderCoordsHelper.isGlobal=this.state.isGlobal,this.renderCoordsHelper.spatialReference=n,t||this.addHandles(m(()=>this.groundView?.groundExtent,e=>{let t=this.renderCoordsHelper.spatialReference;e!=null&&(e[0]!==0||e[1]!==0||e[2]!==0||e[3]!==0)&&xe(e,this.groundView.spatialReference,Ft,t)&&(this.renderCoordsHelper.extent=Ft)},h),Y),this.sceneIntersectionHelper?.setTolerance(R/this.renderCoordsHelper.unitInMeters))}}_exitCoordinateSystem(){this.removeHandles(Y)}_updatingChanged(){this.notifyChange(`updating`)}_updateUpdatingMonitors(e=null){(e==null||e.type!==4)&&(this.removeHandles(`updatingMonitors`),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(m(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),h),`updatingMonitors`),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,n){if(!this.overlay||!this.overlay.hasVisibleItems)return n;let r=e.getContext(`2d`,{willReadFrequently:!0});return r.putImageData(n,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,n.width,n.height)}_initStage(e){let t={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,context:e,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,n)=>this._renderScreenshotOverlay(e,t,n)}},n=new Je(this.state.isGlobal,e=>this.stage.layers.forEach(e),this);this._set(`sceneIntersectionHelper`,n);let r=te(this.surface);this._stage=new St({view:this,options:t,container:r}),this.notifyChange(`stage`),this._updateSlice(),this.addHandles([this.on(`pointer-move`,()=>this.stage?.renderer.resetAnimation()),ne(this.stage.renderView.canvas,`webglcontextlost`,e=>{this.fatalError=new u(`webgl-context-lost`,e.statusMessage||`WebGL context lost`)})],`stage`),this.sceneIntersectionHelper.setTolerance(R/this.renderCoordsHelper.unitInMeters),this._set(`canvas`,this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set(`sceneIntersectionHelper`,null),this._stage=p(this.stage),this._set(`stage`,null),this.removeHandles(`stage`),this._set(`canvas`,null)}_initSurface(){this._exitSurface();let e=_t(this.renderCanvas,{alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled});this._initStage(e),this._initGlobe(),this.sharedSymbolResources=new ut({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has(`GraphicsView3D`)||this.graphics.length===0)return;this.removeHandles(`GraphicsView3D`);let e=(await this.updatingHandles.addPromise(this._importModule(`GraphicsView3D`,e=>g(()=>this.groundView?.ready,e))))?.default;e&&this._set(`graphicsView`,new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport(`GraphicsView3D`),this.removeHandles(`GraphicsView3D`),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set(`graphicsView`,null))}_disposeFocusAreasView(){this._abortImport(`FocusAreasView`),this.removeHandles(`FocusAreasView`),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has(`FocusAreasView`)||e===0)return;this.removeHandles(`FocusAreasView`);let t=(await this.updatingHandles.addPromise(this._importModule(`FocusAreasView`)))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){q(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set(`ready`,!0),this.addHandles(fe(()=>this.graphics,`after-changes`,()=>this._ensureGraphicsView()),`GraphicsView3D`),this._ensureGraphicsView(),this.addHandles(this.updatingHandles.add(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),`FocusAreasView`);let e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?s(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentView.connectView(this),this.inputManager.connect();let n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentView.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set(`ready`,!1)}get _defaultToMapOptions(){let e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(z);for(let t of this.allLayerViews)(O(t.layer)&&w.shouldIntersectAsGround(t.layer)||je(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){let e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(z);for(let t of this.allLayerViews)O(t.layer)&&w.shouldIntersectAsGround(t.layer)&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type=`3d`}static clearStatics(){Le(),ee(),_e(),bt(),Qe(),ze(),Ce(),Dt(),Ne(),gt(),xt(),qe(),Xe(),ae(),me(),yt(),ht(),Ge.cleanupI3SLodHandling(),Me.cleanupTilemapCache(),M.cleanupViewstate(),L.cleanupTerrainSurface()}};e([n({nonNullable:!0}),r(Pt)],X.prototype,`options`,void 0),e([n()],X.prototype,`_userClippingArea`,void 0),e([n()],X.prototype,`_resourceController`,void 0),e([n()],X.prototype,`stage`,null),e([n({readOnly:!0})],X.prototype,`deconflictor`,void 0),e([n({readOnly:!0})],X.prototype,`labeler`,void 0),e([n()],X.prototype,`navigation`,void 0),e([n({type:Mt,readOnly:!0})],X.prototype,`animation`,null),e([n({readOnly:!0})],X.prototype,`basemapTerrain`,void 0),e([n({readOnly:!0})],X.prototype,`overlayManager`,null),e([n({readOnly:!0})],X.prototype,`elevationProvider`,void 0),e([n()],X.prototype,`camera`,null),e([n({type:t})],X.prototype,`contentCamera`,null),e([n({readOnly:!0})],X.prototype,`canvas`,null),e([n({type:b,useTypeForAutocast:!1})],X.prototype,`center`,null),e([n({type:y})],X.prototype,`clippingArea`,null),e([n({type:k,nonNullable:!0})],X.prototype,`constraints`,void 0),e([n({type:y,readOnly:!0})],X.prototype,`renderDataExtent`,null),e([n({readOnly:!0})],X.prototype,`tileInfo`,null),e([n({type:y,readOnly:!0})],X.prototype,`dataExtent`,null),e([n({type:y,readOnly:!0})],X.prototype,`groundAndLayersExtent`,null),e([n({type:A})],X.prototype,`environment`,null),e([r(`environment`)],X.prototype,`castEnvironment`,null),e([n({readOnly:!0})],X.prototype,`environmentView`,void 0),e([n({type:y})],X.prototype,`extent`,null),e([n({type:l})],X.prototype,`floors`,void 0),e([n()],X.prototype,`screenCenter`,null),e([n()],X.prototype,`frustum`,null),e([n({type:Number,readOnly:!0})],X.prototype,`fullOpacity`,void 0),e([n({readOnly:!0})],X.prototype,`graphicsView`,void 0),e([n()],X.prototype,`analysisViewManager`,void 0),e([n()],X.prototype,`groundView`,void 0),e([n({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([n({type:Boolean})],X.prototype,`initialExtentRequired`,null),e([n()],X.prototype,`defaultsFromMapSettings`,null),e([n()],X.prototype,`interacting`,null),e([n()],X.prototype,`stationary`,null),e([n()],X.prototype,`navigating`,null),e([n()],X.prototype,`map`,void 0),e([n()],X.prototype,`padding`,null),e([n({type:P,readOnly:!0})],X.prototype,`pointsOfInterest`,void 0),e([n()],X.prototype,`_featureTiles`,void 0),e([n()],X.prototype,`featureTiles`,null),e([n()],X.prototype,`_featureTreeDebugger`,void 0),e([n({constructOnly:!0})],X.prototype,`deactivatedWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`debugWebGLExtensions`,void 0),e([n({constructOnly:!0})],X.prototype,`renderCanvas`,void 0),e([n({constructOnly:!0})],X.prototype,`state`,void 0),e([n()],X.prototype,`screenSizePerspective`,void 0),e([n({readOnly:!0})],X.prototype,`inputManager`,void 0),e([n({readOnly:!0})],X.prototype,`stateManager`,void 0),e([n({type:[`low`,`medium`,`high`]})],X.prototype,`qualityProfile`,null),e([n({type:I,get(){let e=this._get(`qualitySettings`);if(!e){let t=F(this.qualityProfile);e=new I(t)}return e}})],X.prototype,`qualitySettings`,void 0),e([n()],X.prototype,`slice`,void 0),e([n({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,null),e([n({readOnly:!0})],X.prototype,`sceneIntersectionHelper`,void 0),e([n({type:Number,readOnly:!0})],X.prototype,`resolution`,null),e([n({type:Number})],X.prototype,`scale`,null),e([n({readOnly:!0,type:Number})],X.prototype,`terrainLevel`,null),e([n()],X.prototype,`heightModelInfo`,null),e([n({type:C})],X.prototype,`spatialReference`,void 0),e([n({type:Boolean,value:!1})],X.prototype,`alphaCompositingEnabled`,null),e([n({constructOnly:!0})],X.prototype,`preserveDrawingBufferEnabled`,void 0),e([n({type:Boolean})],X.prototype,`supersampleScreenshotsEnabled`,void 0),e([n({readOnly:!0})],X.prototype,`type`,void 0),e([n(),r(e=>e instanceof jt?e:o(W,e))],X.prototype,`ui`,void 0),e([n({type:Boolean,readOnly:!0})],X.prototype,`updating`,null),e([n()],X.prototype,`_updatingObjects`,null),e([n()],X.prototype,`_updatingObjectsWithProgress`,null),e([n()],X.prototype,`_updatingObjectsToDebug`,null),e([n({type:Number,readOnly:!0})],X.prototype,`updatingProgress`,void 0),e([n({type:[`global`,`local`]})],X.prototype,`viewingMode`,null),e([n({type:Fe})],X.prototype,`viewpoint`,null),e([n({readOnly:!0})],X.prototype,`visibleArea`,null),e([n({type:Number})],X.prototype,`zoom`,null),e([n({readOnly:!0})],X.prototype,`quality`,null),e([n({readOnly:!0})],X.prototype,`resolutionScale`,null),e([n()],X.prototype,`focusAreasView`,void 0),e([n()],X.prototype,`_defaultToMapOptions`,null),e([n()],X.prototype,`_defaultHitTestOptions`,null),X=J=e([i(`esri.views.SceneView`)],X);function Z(e,t){return e!=null&&Se(e.spatialReference,t)?S(e,t):null}const Q=ie(),$=ge(),Ft=Te(),It=Ae(0,0,0,C.WebMercator),Lt={GraphicsView3D:()=>import(`./3d/layers/GraphicsView3D.js`),FocusAreasView:()=>import(`./3d/FocusAreasView.js`),FeatureTileTree3D:()=>import(`./3d/layers/support/FeatureTileTree3D.js`)},Rt=X;export{Rt as default};
package/views/View.d.ts CHANGED
@@ -6,7 +6,7 @@ import type ViewAnimation from "./ViewAnimation.js";
6
6
  import type Collection from "../core/Collection.js";
7
7
  import type EsriError from "../core/Error.js";
8
8
  import type SpatialReference from "../geometry/SpatialReference.js";
9
- import type EsriMap from "../Map.js";
9
+ import type Map from "../Map.js";
10
10
  import type TimeExtent from "../time/TimeExtent.js";
11
11
  import type BasemapView from "./BasemapView.js";
12
12
  import type Input from "./input/Input.js";
@@ -572,7 +572,7 @@ export default abstract class View<TLayerView extends LayerView = LayerView> ext
572
572
  * [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). See the [class description](https://developers.arcgis.com/javascript/latest/references/core/views/View/)
573
573
  * for examples demonstrating the relationship between the map and the view.
574
574
  */
575
- get map(): EsriMap | null | undefined;
575
+ get map(): Map | null | undefined;
576
576
  set map(value: MapProperties | null | undefined);
577
577
  /**
578
578
  * Indicates whether the view is being navigated (for example when panning).
package/views/View.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{createTask as r,asyncHandle as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import{referenceSetter as s}from"../core/collectionUtils.js";import c from"../core/Error.js";import{EventedMixin as l}from"../core/Evented.js";import ee from"../core/Handles.js";import{makeHandle as u,handlesGroup as te}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as d}from"../core/Loadable.js";import f from"../core/Logger.js";import{indexCollection as ne}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,abortMaybe as re}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as h,whenOrAbort as g}from"../core/promiseUtils.js";import _ from"../core/ReactiveSet.js";import{watch as v,sync as y,whenOnce as b,when as x,syncAndInitial as S}from"../core/reactiveUtils.js";import{owningCollectionProperty as C}from"../core/support/OwningCollection.js";import{UpdatingHandles as ie}from"../core/support/UpdatingHandles.js";import ae from"../geometry/Extent.js";import oe from"../geometry/HeightModelInfo.js";import w from"../geometry/SpatialReference.js";import{equals as T}from"../geometry/support/spatialReferenceUtils.js";import{getLayerViewLayer as E}from"../graphic/getLayerViewLayer.js";import D from"../Map.js";import{AnalysesCollection as O}from"../support/AnalysesCollection.js";import{GraphicsCollection as k}from"../support/GraphicsCollection.js";import{system as A}from"../time/constants.js";import j from"../time/TimeExtent.js";import{isTimeZoneValid as M}from"../time/timeZoneUtils.js";import{GlyphMosaic as N}from"./2d/engine/webgl/GlyphMosaic.js";import{makeDefaultHighlightOptions as P}from"./3d/support/DefaultHighlights.js";import F from"./BasemapView.js";import I from"./input/Input.js";import{ViewEvents as L}from"./input/ViewEvents.js";import R from"./interactive/options/ViewOptions.js";import z from"./Magnifier.js";import B from"./navigation/Navigation.js";import V from"./SelectionManager.js";import{deduplicateAttributionItems as H}from"./support/attributionUtils.js";import{DefaultsFromMap as U}from"./support/DefaultsFromMap.js";import{defaultHighlightName as W}from"./support/HighlightDefaults.js";import G from"./support/HighlightOptions.js";import K from"./support/LayerViewManager.js";import{highlightsSupported as q}from"./support/layerViewUtils.js";import se from"./support/RequiredFieldsOptions.js";import{checkWebAssemblyRequirements as ce}from"./support/WebAssemblyRequirements.js";import{checkWebGLRequirements as le}from"./support/WebGLRequirements.js";import J from"./Theme.js";import{ToolViewManager as ue}from"./ToolViewManager.js";var Y;let X=class extends l(m){static{Y=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new ee,this.updatingHandles=new ie,this.allLayerViews=new o({getCollections:()=>this.layerviewCollections,getChildrenFunction:Q}),this.animationsEnabled=!0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new k,this.typeSpecificPreconditionsReady=!0,this.layerViews=new a,this.magnifier=new z,this.options=new R,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new a,this._highPriorityCursorHandles=new a,this.input=new I,this.navigation=new B,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new L(this),this.requiredFieldsOptions=new se,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this._glyphMosaic=null,this.theme=null,this.registeredComponents=new _,this.handles.add(v(()=>this.preconditionsReady,e=>{let t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,Y.views.add(this)):(this._lockedSpatialReference=null,Y.views.remove(this)),this.notifyChange(`spatialReference`),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._glyphMosaic?.dispose(),this._teardown();else if(e&&!t){try{this._startup()}catch(e){queueMicrotask(()=>{this.fatalError=new c(`view:startup-error`,`View._startup failed`,e)});return}this._glyphMosaic=new N(1024,1024,!0),this.analysisViewManager?.attach(),this.toolViewManager.attach()}},y)),this.analyses=new O}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,b(()=>this.ready)))),this.basemapView=new F({view:this}),this.layerViewManager=new K({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new ue({view:this}),this.selectionManager=new V({view:this}),this.addHandles([x(()=>this.readyState===`map-content-error`&&!this.spatialReference,()=>{f.getLogger(this).warn(`#spatialReference`,`no spatial reference could be derived from the currently added map layers`)}),v(()=>[this.defaultsFromMap,this.initialExtentRequired],([e,t])=>{e&&(e.required={...e.required,extent:t})},S),v(()=>[this.defaultsFromMap,this.ready],([e,t])=>{e&&(e.viewReady=t)},y),v(()=>[this.defaultsFromMap,this.defaultsFromMapInputSpatialReference()],([e,t])=>{e&&(e.inputSpatialReference=t)},S),v(()=>[this.defaultsFromMap,this.defaultsFromMapInputHeightModelInfo()],([e,t])=>{e&&(e.inputHeightModelInfo=t)},S)])}get _layerToLayerviewMapping(){return Y._layerToLayerview}static{this._layerToLayerview=[[`view.map.basemap.baseLayers`,`view.basemapView.baseLayerViews`],[`view.map.basemap.groundLayers`,`view.basemapView.groundLayerViews`],[`view.map.basemap.referenceLayers`,`view.basemapView.referenceLayerViews`],[`view.map.layers`,`view.layerViews`]]}destroy(){this.destroyed||(Y.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set(`navigation`,null)),this.graphics=p(this.graphics),this.analyses=p(this.analyses),this.defaultsFromMap.destroy(),this._set(`defaultsFromMap`,null),this.analysisViewManager=p(this.analysisViewManager),this.toolViewManager=p(this.toolViewManager),this.layerViewManager=p(this.layerViewManager),this.selectionManager=p(this.selectionManager),this.basemapView=p(this.basemapView),this.layerViews.destroyAll(),this.invalidate(),this.handles.destroy(),this.map=p(this.map),this.updatingHandles.destroy())}_startup(){this._set(`ready`,!0)}_teardown(){this._set(`ready`,!1)}whenReady(){return Promise.resolve(this)}toMap(){return f.getLogger(this).error(`#toMap()`,`Not implemented on this instance of View`),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get analyses(){return this._get(`analyses`)}set analyses(e){this._set(`analyses`,e)}get animation(){return this._get(`animation`)}set animation(e){this._set(`animation`,e)}get focusRegion(){return null}get attributionItems(){return this.suspended?[]:H(this._get(`attributionItems`),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new U({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get(`extent`)}set extent(e){this._set(`extent`,e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}glyphMosaic(){return this._glyphMosaic}get highlights(){return this._get(`highlights`)??P()}set highlights(e){this._set(`highlights`,s(e,this._get(`highlights`),a.ofType(G)))}get defaultHighlight(){return this.highlights.find(({name:e})=>e===W)}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){if(this.destroying||this.destroyed)return!1;let{map:e,spatialReference:t}=this;return!!(!this.fatalError&&this._isValid&&!this._readyCycleForced&&e&&(!d(e)||e.loaded)&&this.width!==0&&this.height!==0&&t&&this._validateSpatialReference(t)&&(this._lockedSpatialReference||this.defaultsFromMap?.ready)&&this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){let t=this._get(`map`);e!==t&&(e?.destroyed&&(f.getLogger(this).warn(`#map`,`The provided map is already destroyed`,{map:e}),e=null),d(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set(`map`,e))}get canZoomIn(){return!!this.ready}get canZoomOut(){return!!this.ready}get readyState(){if(this.destroyed)return this._get(`readyState`);if(!this.map)return`missing-map`;if(`container`in this&&!this.container)return`missing-container`;if(this.fatalError)return`rendering-error`;if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){let e=!(`loaded`in this.map)||this.map.loaded,t=this.map.ground.loaded,n=this.map.basemap?.loaded??!0;return e&&n&&t&&!this.map?.allLayers.length?`empty-map`:(this._readyStateWaitingTask||(this._readyStateWaitingTask=r(e=>h(has(`view-readyState-waiting-delay`),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,`ready-state-task`)),this._readyStateWaitingTask?.finished?`map-content-error`:`loading`)}return this._readyStateWaitingTask=re(this._readyStateWaitingTask),this.removeHandles(`ready-state-task`),this.ready?`ready`:`loading`}get spatialReference(){let{_userSpatialReference:e}=this;if(e&&e.vcsWkid!==null)return e;let t=e??this._lockedSpatialReference??this.getWebDocumentSpatialReference()??this.defaultsFromMap?.spatialReference??null,n=this.defaultsFromMap?.combinedHorizontalAndVerticalSpatialReference;return n?.equals(t)?n:t}set spatialReference(e){let t=!T(e,this._get(`spatialReference`));this._set(`_userSpatialReference`,e),t&&(this._set(`spatialReference`,e),this._spatialReferenceChanged(this.spatialReference))}_spatialReferenceChanged(e){}getWebDocumentSpatialReference(){return null}defaultsFromMapInputSpatialReference(){return this._userSpatialReference??this.getWebDocumentSpatialReference()??(this.ready?this._lockedSpatialReference:null)}defaultsFromMapInputHeightModelInfo(){return this.map?.heightModelInfo??null}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??A}set timeZone(e){this._userTimeZone=e,M(e)||f.getLogger(this).warn(`#timeZone`,`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??`default`}acquireCursor(e,t=`low`){let n=t===`high`?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},i=u(()=>n.remove(r));return n.add(r),this.addHandles(i),i}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new J}registerComponent(e){this.registeredComponents.add(e)}unregisterComponent(e){this.registeredComponents.delete(e)}highlight(e,t){if(this.destroyed)return u();let n=this._getHighlightLayerViews(),{map:r,layerViewManager:i}=this,a=r?.allLayers,o=Map.groupBy(Array.isArray(e)?e:[e],({layer:e,origin:t})=>e?.type===`graphics`?n.has(e)||a?.includes(e)?e:void 0:t?E(t):void 0),s=[];for(let[e,r]of o){if(e==null)continue;let o=n.get(e);if(o&&!o.destroyed&&o.layer===e&&q(o)){s.push(o.highlight(r,t));continue}let c=a?.find(t=>t===e);i&&c&&$(c)&&s.push(this._deferHighlight(c,r,t))}return s.length>0?te(s):u()}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultHeightModelInfo(){return(this.map&&`heightModelInfo`in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new c(`view:importLayerView-missing`,`importLayerView() not implemented`)}hasLayerViewModule(e){return!1}async validate(){let e=le(this.type);if(e)throw this._displayWebGLError(),f.getLogger(this).warn(`#validate()`,e.message),e;let t=await ce();if(t)throw f.getLogger(this).warn(`#validate()`,t.message),t}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return this.getSpatialReferenceSupport(e)!=null}when(e,t){return this.isResolved()&&!this.ready&&f.getLogger(this).warn(`#when()`,`Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead.`),super.when(e,t)}forceReadyCycle(){this.ready&&(x(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new a}_getHighlightLayerViews(){if(!this._highlightLayerViews){let e=ne(this.allLayerViews,e=>q(e)&&$(e.layer)?e.layer:void 0);this.addHandles(e),this._highlightLayerViews=e.index}return this._highlightLayerViews}_deferHighlight(e,t,n){return i(async r=>{let i=await g(this.whenLayerView(e),r).catch(e=>{if(!(e==null||typeof e==`object`&&`name`in e&&(e.name===`view:no-layerview-for-layer`||e.name===`cancelled:layerview-create`||e.name===`layerview:create-error`)))throw e});if(!(this.destroyed||r.aborted||!i||i.destroyed||!q(i)))return i.highlight(t,n)},{onError:e=>f.getLogger(this).error(`#highlight()`,e)})}_displayWebGLError(){let e=document.createElement(`div`);e.setAttribute(`style`,`display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;`);let t=document.createElement(`div`);t.innerHTML=`Unable to display map. WebGL2 support is required.`,t.setAttribute(`style`,`font-size: 24px; font-weight: bold;`);let n=document.createElement(`div`);n.innerHTML=`Ensure that your browser and hardware meet the minimum requirements.`,n.setAttribute(`style`,`font-size: 18px;`);let r=document.createElement(`a`);r.innerHTML=`https://esriurl.com/webgl-faq`,r.target=`_blank`,r.setAttribute(`style`,`font-size: 18px;`),r.href=`https://esriurl.com/webgl-faq`,e.appendChild(t),e.appendChild(n),e.appendChild(r);let i=this.getSurface();i&&i.appendChild(e)}};e([t()],X.prototype,`_userSpatialReference`,void 0),e([t()],X.prototype,`activeTool`,null),e([t({readOnly:!0})],X.prototype,`allLayerViews`,void 0),e([t({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([t(C(O,`analyses`))],X.prototype,`analyses`,null),e([t()],X.prototype,`animation`,null),e([t()],X.prototype,`animationsEnabled`,void 0),e([t()],X.prototype,`focusRegionVisible`,void 0),e([t()],X.prototype,`focusRegionShortcutEnabled`,void 0),e([t()],X.prototype,`focusRegion`,null),e([t({readOnly:!0})],X.prototype,`attributionItems`,null),e([t()],X.prototype,`attributionVisible`,void 0),e([t()],X.prototype,`basemapView`,void 0),e([t()],X.prototype,`center`,null),e([t()],X.prototype,`defaultsFromMapSettings`,null),e([t()],X.prototype,`defaultsFromMap`,null),e([t()],X.prototype,`dependencies`,void 0),e([t()],X.prototype,`displayFilterEnabled`,void 0),e([t({type:ae})],X.prototype,`extent`,null),e([t()],X.prototype,`fatalError`,void 0),e([t(C(k,`graphics`))],X.prototype,`graphics`,void 0),e([t({readOnly:!0,type:oe})],X.prototype,`heightModelInfo`,null),e([t({type:a.ofType(G)})],X.prototype,`highlights`,null),e([t({readOnly:!0})],X.prototype,`interacting`,null),e([t({constructOnly:!0})],X.prototype,`layerViewFilter`,void 0),e([t({readOnly:!0})],X.prototype,`navigating`,null),e([t({readOnly:!0})],X.prototype,`preconditionsReady`,null),e([t({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,void 0),e([t({type:a,readOnly:!0})],X.prototype,`layerViews`,void 0),e([t()],X.prototype,`resolution`,null),e([t({type:z})],X.prototype,`magnifier`,void 0),e([t({nonNullable:!0,type:R})],X.prototype,`options`,void 0),e([t({value:null,type:D})],X.prototype,`map`,null),e([t()],X.prototype,`padding`,void 0),e([t({readOnly:!0})],X.prototype,`ready`,void 0),e([t({readOnly:!0})],X.prototype,`canZoomIn`,null),e([t({readOnly:!0})],X.prototype,`canZoomOut`,null),e([t()],X.prototype,`_readyStateWaitingTask`,void 0),e([t({readOnly:!0})],X.prototype,`readyState`,null),e([t({type:w})],X.prototype,`spatialReference`,null),e([t()],X.prototype,`stationary`,null),e([t({type:j})],X.prototype,`timeExtent`,null),e([t({type:String,nonNullable:!0})],X.prototype,`timeZone`,null),e([t()],X.prototype,`tools`,null),e([t()],X.prototype,`toolViewManager`,void 0),e([t({readOnly:!0})],X.prototype,`type`,void 0),e([t({type:Number})],X.prototype,`scale`,void 0),e([t({readOnly:!0})],X.prototype,`updating`,void 0),e([t({readOnly:!0})],X.prototype,`initialExtentRequired`,void 0),e([t({readOnly:!0})],X.prototype,`initialExtent`,null),e([t()],X.prototype,`cursor`,null),e([t({readOnly:!0})],X.prototype,`input`,void 0),e([t({type:B,nonNullable:!0})],X.prototype,`navigation`,void 0),e([t()],X.prototype,`layerViewManager`,void 0),e([t()],X.prototype,`analysisViewManager`,void 0),e([t()],X.prototype,`selectionManager`,void 0),e([t()],X.prototype,`width`,void 0),e([t()],X.prototype,`height`,void 0),e([t({readOnly:!0})],X.prototype,`resizing`,void 0),e([t({value:null,readOnly:!0})],X.prototype,`size`,null),e([t({readOnly:!0})],X.prototype,`suspended`,void 0),e([t({readOnly:!0})],X.prototype,`viewEvents`,void 0),e([t()],X.prototype,`_isValid`,void 0),e([t()],X.prototype,`_readyCycleForced`,void 0),e([t()],X.prototype,`_lockedSpatialReference`,void 0),e([t()],X.prototype,`_userTimeZone`,void 0),e([t()],X.prototype,`_lockedTimeZone`,void 0),e([t()],X.prototype,`_userTimeExtent`,void 0),e([t()],X.prototype,`_lockedTimeExtent`,void 0),e([t({type:J})],X.prototype,`theme`,void 0),e([t({readOnly:!0,type:J})],X.prototype,`effectiveTheme`,null),e([t({readOnly:!0})],X.prototype,`registeredComponents`,void 0),X=Y=e([n(`esri.views.View`)],X);const Z=globalThis.$arcgis;Z&&!Z.views&&Object.defineProperty(Z,"views",{configurable:!1,enumerable:!0,writable:!1,value:X.views});function Q(e){return e.layerViews}function $({type:e}){return e!==`media`&&e!==`imagery-tile`&&e!==`geospatial-pdf`}export{X as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../core/accessorSupport/decorators.js";import{createTask as r,asyncHandle as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import{referenceSetter as s}from"../core/collectionUtils.js";import c from"../core/Error.js";import{EventedMixin as l}from"../core/Evented.js";import ee from"../core/Handles.js";import{makeHandle as u,handlesGroup as te}from"../core/handleUtils.js";import has from"../core/has.js";import{isLoadable as d}from"../core/Loadable.js";import f from"../core/Logger.js";import{indexCollection as ne}from"../core/mapCollectionUtils.js";import{destroyMaybe as p,abortMaybe as re}from"../core/maybe.js";import{EsriPromise as m}from"../core/Promise.js";import{after as h,whenOrAbort as g}from"../core/promiseUtils.js";import _ from"../core/ReactiveSet.js";import{watch as v,sync as y,whenOnce as b,when as x,syncAndInitial as S}from"../core/reactiveUtils.js";import{owningCollectionProperty as C}from"../core/support/OwningCollection.js";import{UpdatingHandles as ie}from"../core/support/UpdatingHandles.js";import ae from"../geometry/Extent.js";import oe from"../geometry/HeightModelInfo.js";import w from"../geometry/SpatialReference.js";import{equals as T}from"../geometry/support/spatialReferenceUtils.js";import{getLayerViewLayer as E}from"../graphic/getLayerViewLayer.js";import D from"../Map.js";import{AnalysesCollection as O}from"../support/AnalysesCollection.js";import{GraphicsCollection as k}from"../support/GraphicsCollection.js";import{system as A}from"../time/constants.js";import j from"../time/TimeExtent.js";import{isTimeZoneValid as M}from"../time/timeZoneUtils.js";import{GlyphMosaic as N}from"./2d/engine/webgl/GlyphMosaic.js";import{makeDefaultHighlightOptions as P}from"./3d/support/DefaultHighlights.js";import F from"./BasemapView.js";import I from"./input/Input.js";import{ViewEvents as L}from"./input/ViewEvents.js";import R from"./interactive/options/ViewOptions.js";import z from"./Magnifier.js";import B from"./navigation/Navigation.js";import V from"./SelectionManager.js";import{deduplicateAttributionItems as H}from"./support/attributionUtils.js";import{DefaultsFromMap as U}from"./support/DefaultsFromMap.js";import{defaultHighlightName as W}from"./support/HighlightDefaults.js";import G from"./support/HighlightOptions.js";import K from"./support/LayerViewManager.js";import{highlightsSupported as q}from"./support/layerViewUtils.js";import se from"./support/RequiredFieldsOptions.js";import{checkWebAssemblyRequirements as ce}from"./support/WebAssemblyRequirements.js";import{checkWebGLRequirements as le}from"./support/WebGLRequirements.js";import J from"./Theme.js";import{ToolViewManager as ue}from"./ToolViewManager.js";var Y;let X=class extends l(m){static{Y=this}constructor(e){super(e),this._userSpatialReference=null,this.handles=new ee,this.updatingHandles=new ie,this.allLayerViews=new o({getCollections:()=>this.layerviewCollections,getChildrenFunction:Q}),this.animationsEnabled=!0,this.focusRegionVisible=!1,this.focusRegionShortcutEnabled=!1,this.attributionVisible=!0,this.basemapView=null,this.dependencies={popup:void 0},this.displayFilterEnabled=!0,this.fatalError=null,this.graphics=new k,this.typeSpecificPreconditionsReady=!0,this.layerViews=new a,this.magnifier=new z,this.options=new R,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this._readyStateWaitingTask=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this._lowPriorityCursorHandles=new a,this._highPriorityCursorHandles=new a,this.input=new I,this.navigation=new B,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new L(this),this.requiredFieldsOptions=new se,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this._glyphMosaic=null,this.theme=null,this.registeredComponents=new _,this.handles.add(v(()=>this.preconditionsReady,e=>{let t=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,Y.views.add(this)):(this._lockedSpatialReference=null,Y.views.remove(this)),this.notifyChange(`spatialReference`),!e&&t)this.toolViewManager?.detach(),this.analysisViewManager?.detach(),this.layerViewManager?.clear(),this._glyphMosaic?.dispose(),this._teardown();else if(e&&!t){try{this._startup()}catch(e){queueMicrotask(()=>{this.fatalError=new c(`view:startup-error`,`View._startup failed`,e)});return}this._glyphMosaic=new N(1024,1024,!0),this.analysisViewManager?.attach(),this.toolViewManager.attach()}},y)),this.analyses=new O}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,b(()=>this.ready)))),this.basemapView=new F({view:this}),this.layerViewManager=new K({view:this,layerViewFilter:e=>this.layerViewFilter?.(e)??!0,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},layerviewMapping:this._layerToLayerviewMapping}),this.toolViewManager=new ue({view:this}),this.selectionManager=new V({view:this}),this.addHandles([x(()=>this.readyState===`map-content-error`&&!this.spatialReference,()=>{f.getLogger(this).warn(`#spatialReference`,`no spatial reference could be derived from the currently added map layers`)}),v(()=>[this.defaultsFromMap,this.initialExtentRequired],([e,t])=>{e&&(e.required={...e.required,extent:t})},S),v(()=>[this.defaultsFromMap,this.ready],([e,t])=>{e&&(e.viewReady=t)},y),v(()=>[this.defaultsFromMap,this.defaultsFromMapInputSpatialReference()],([e,t])=>{e&&(e.inputSpatialReference=t)},S),v(()=>[this.defaultsFromMap,this.defaultsFromMapInputHeightModelInfo()],([e,t])=>{e&&(e.inputHeightModelInfo=t)},S)])}get _layerToLayerviewMapping(){return Y._layerToLayerview}static{this._layerToLayerview=[[`view.map.basemap.baseLayers`,`view.basemapView.baseLayerViews`],[`view.map.basemap.groundLayers`,`view.basemapView.groundLayerViews`],[`view.map.basemap.referenceLayers`,`view.basemapView.referenceLayerViews`],[`view.map.layers`,`view.layerViews`]]}destroy(){this.destroyed||(Y.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set(`navigation`,null)),this.graphics=p(this.graphics),this.analyses=p(this.analyses),this.defaultsFromMap.destroy(),this._set(`defaultsFromMap`,null),this.analysisViewManager=p(this.analysisViewManager),this.toolViewManager=p(this.toolViewManager),this.layerViewManager=p(this.layerViewManager),this.selectionManager=p(this.selectionManager),this.basemapView=p(this.basemapView),this.layerViews.destroyAll(),this.invalidate(),this.handles.destroy(),this.map=p(this.map),this.updatingHandles.destroy())}_startup(){this._set(`ready`,!0)}_teardown(){this._set(`ready`,!1)}whenReady(){return Promise.resolve(this)}toMap(){return f.getLogger(this).error(`#toMap()`,`Not implemented on this instance of View`),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get analyses(){return this._get(`analyses`)}set analyses(e){this._set(`analyses`,e)}get animation(){return this._get(`animation`)}set animation(e){this._set(`animation`,e)}get focusRegion(){return null}get attributionItems(){return this.suspended?[]:H(this._get(`attributionItems`),this.getAttributionItems())}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new U({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(e,t)=>this.getSpatialReferenceSupport(e,t),...this.defaultsFromMapSettings})}get extent(){return this._get(`extent`)}set extent(e){this._set(`extent`,e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}glyphMosaic(){return this._glyphMosaic}get highlights(){return this._get(`highlights`)??P()}set highlights(e){this._set(`highlights`,s(e,this._get(`highlights`),a.ofType(G)))}get defaultHighlight(){return this.highlights.find(({name:e})=>e===W)}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){if(this.destroying||this.destroyed)return!1;let{map:e,spatialReference:t}=this;return!!(!this.fatalError&&this._isValid&&!this._readyCycleForced&&e&&(!d(e)||e.loaded)&&this.width!==0&&this.height!==0&&t&&this._validateSpatialReference(t)&&(this._lockedSpatialReference||this.defaultsFromMap?.ready)&&this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){let t=this._get(`map`);e!==t&&(e?.destroyed&&(f.getLogger(this).warn(`#map`,`The provided map is already destroyed`,{map:e}),e=null),d(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set(`map`,e))}get canZoomIn(){return!!this.ready}get canZoomOut(){return!!this.ready}get readyState(){if(this.destroyed)return this._get(`readyState`);if(!this.map)return`missing-map`;if(`container`in this&&!this.container)return`missing-container`;if(this.fatalError)return`rendering-error`;if((this.defaultsFromMap?.ready??!1)&&!this.spatialReference){let e=!(`loaded`in this.map)||this.map.loaded,t=this.map.ground.loaded,n=this.map.basemap?.loaded??!0;return e&&n&&t&&!this.map?.allLayers.length?`empty-map`:(this._readyStateWaitingTask||(this._readyStateWaitingTask=r(e=>h(has(`view-readyState-waiting-delay`),null,e)),this.addHandles(this._readyStateWaitingTask),this.addHandles(this._readyStateWaitingTask,`ready-state-task`)),this._readyStateWaitingTask?.finished?`map-content-error`:`loading`)}return this._readyStateWaitingTask=re(this._readyStateWaitingTask),this.removeHandles(`ready-state-task`),this.ready?`ready`:`loading`}get spatialReference(){let{_userSpatialReference:e}=this;if(e&&e.vcsWkid!==null)return e;let t=e??this._lockedSpatialReference??this.getWebDocumentSpatialReference()??this.defaultsFromMap?.spatialReference??null,n=this.defaultsFromMap?.combinedHorizontalAndVerticalSpatialReference;return n?.equals(t)?n:t}set spatialReference(e){let t=!T(e,this._get(`spatialReference`));this._set(`_userSpatialReference`,e),t&&(this._set(`spatialReference`,e),this._spatialReferenceChanged(this.spatialReference))}_spatialReferenceChanged(e){}getWebDocumentSpatialReference(){return null}defaultsFromMapInputSpatialReference(){return this._userSpatialReference??this.getWebDocumentSpatialReference()??(this.ready?this._lockedSpatialReference:null)}defaultsFromMapInputHeightModelInfo(){return this.map?.heightModelInfo??null}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(e){this._userTimeExtent=e}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??A}set timeZone(e){this._userTimeZone=e,M(e)||f.getLogger(this).warn(`#timeZone`,`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._highPriorityCursorHandles.at(-1)?.cursor??this._lowPriorityCursorHandles.at(-1)?.cursor??`default`}acquireCursor(e,t=`low`){let n=t===`high`?this._highPriorityCursorHandles:this._lowPriorityCursorHandles,r={cursor:e},i=u(()=>n.remove(r));return n.add(r),this.addHandles(i),i}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new J}registerComponent(e){this.registeredComponents.add(e)}unregisterComponent(e){this.registeredComponents.delete(e)}highlight(e,t){if(this.destroyed)return u();let n=this._getHighlightLayerViews(),{map:r,layerViewManager:i}=this,a=r?.allLayers,o=globalThis.Map.groupBy(Array.isArray(e)?e:[e],({layer:e,origin:t})=>e?.type===`graphics`?n.has(e)||a?.includes(e)?e:void 0:t?E(t):void 0),s=[];for(let[e,r]of o){if(e==null)continue;let o=n.get(e);if(o&&!o.destroyed&&o.layer===e&&q(o)){s.push(o.highlight(r,t));continue}let c=a?.find(t=>t===e);i&&c&&$(c)&&s.push(this._deferHighlight(c,r,t))}return s.length>0?te(s):u()}whenLayerView(e){return this.layerViewManager?.whenLayerView(e)??Promise.reject()}getAttributionItems(){return this.allLayerViews.items.flatMap(e=>e.attributionItems)}getDefaultHeightModelInfo(){return(this.map&&`heightModelInfo`in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}getSurface(){return null}importLayerView(e){throw new c(`view:importLayerView-missing`,`importLayerView() not implemented`)}hasLayerViewModule(e){return!1}async validate(){let e=le(this.type);if(e)throw this._displayWebGLError(),f.getLogger(this).warn(`#validate()`,e.message),e;let t=await ce();if(t)throw f.getLogger(this).warn(`#validate()`,t.message),t}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return this.getSpatialReferenceSupport(e)!=null}when(e,t){return this.isResolved()&&!this.ready&&f.getLogger(this).warn(`#when()`,`Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead.`),super.when(e,t)}forceReadyCycle(){this.ready&&(x(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}on(e,t){return super.on(e,t)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}static{this.views=new a}_getHighlightLayerViews(){if(!this._highlightLayerViews){let e=ne(this.allLayerViews,e=>q(e)&&$(e.layer)?e.layer:void 0);this.addHandles(e),this._highlightLayerViews=e.index}return this._highlightLayerViews}_deferHighlight(e,t,n){return i(async r=>{let i=await g(this.whenLayerView(e),r).catch(e=>{if(!(e==null||typeof e==`object`&&`name`in e&&(e.name===`view:no-layerview-for-layer`||e.name===`cancelled:layerview-create`||e.name===`layerview:create-error`)))throw e});if(!(this.destroyed||r.aborted||!i||i.destroyed||!q(i)))return i.highlight(t,n)},{onError:e=>f.getLogger(this).error(`#highlight()`,e)})}_displayWebGLError(){let e=document.createElement(`div`);e.setAttribute(`style`,`display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;`);let t=document.createElement(`div`);t.innerHTML=`Unable to display map. WebGL2 support is required.`,t.setAttribute(`style`,`font-size: 24px; font-weight: bold;`);let n=document.createElement(`div`);n.innerHTML=`Ensure that your browser and hardware meet the minimum requirements.`,n.setAttribute(`style`,`font-size: 18px;`);let r=document.createElement(`a`);r.innerHTML=`https://esriurl.com/webgl-faq`,r.target=`_blank`,r.setAttribute(`style`,`font-size: 18px;`),r.href=`https://esriurl.com/webgl-faq`,e.appendChild(t),e.appendChild(n),e.appendChild(r);let i=this.getSurface();i&&i.appendChild(e)}};e([t()],X.prototype,`_userSpatialReference`,void 0),e([t()],X.prototype,`activeTool`,null),e([t({readOnly:!0})],X.prototype,`allLayerViews`,void 0),e([t({readOnly:!0})],X.prototype,`layerviewCollections`,null),e([t(C(O,`analyses`))],X.prototype,`analyses`,null),e([t()],X.prototype,`animation`,null),e([t()],X.prototype,`animationsEnabled`,void 0),e([t()],X.prototype,`focusRegionVisible`,void 0),e([t()],X.prototype,`focusRegionShortcutEnabled`,void 0),e([t()],X.prototype,`focusRegion`,null),e([t({readOnly:!0})],X.prototype,`attributionItems`,null),e([t()],X.prototype,`attributionVisible`,void 0),e([t()],X.prototype,`basemapView`,void 0),e([t()],X.prototype,`center`,null),e([t()],X.prototype,`defaultsFromMapSettings`,null),e([t()],X.prototype,`defaultsFromMap`,null),e([t()],X.prototype,`dependencies`,void 0),e([t()],X.prototype,`displayFilterEnabled`,void 0),e([t({type:ae})],X.prototype,`extent`,null),e([t()],X.prototype,`fatalError`,void 0),e([t(C(k,`graphics`))],X.prototype,`graphics`,void 0),e([t({readOnly:!0,type:oe})],X.prototype,`heightModelInfo`,null),e([t({type:a.ofType(G)})],X.prototype,`highlights`,null),e([t({readOnly:!0})],X.prototype,`interacting`,null),e([t({constructOnly:!0})],X.prototype,`layerViewFilter`,void 0),e([t({readOnly:!0})],X.prototype,`navigating`,null),e([t({readOnly:!0})],X.prototype,`preconditionsReady`,null),e([t({readOnly:!0})],X.prototype,`typeSpecificPreconditionsReady`,void 0),e([t({type:a,readOnly:!0})],X.prototype,`layerViews`,void 0),e([t()],X.prototype,`resolution`,null),e([t({type:z})],X.prototype,`magnifier`,void 0),e([t({nonNullable:!0,type:R})],X.prototype,`options`,void 0),e([t({value:null,type:D})],X.prototype,`map`,null),e([t()],X.prototype,`padding`,void 0),e([t({readOnly:!0})],X.prototype,`ready`,void 0),e([t({readOnly:!0})],X.prototype,`canZoomIn`,null),e([t({readOnly:!0})],X.prototype,`canZoomOut`,null),e([t()],X.prototype,`_readyStateWaitingTask`,void 0),e([t({readOnly:!0})],X.prototype,`readyState`,null),e([t({type:w})],X.prototype,`spatialReference`,null),e([t()],X.prototype,`stationary`,null),e([t({type:j})],X.prototype,`timeExtent`,null),e([t({type:String,nonNullable:!0})],X.prototype,`timeZone`,null),e([t()],X.prototype,`tools`,null),e([t()],X.prototype,`toolViewManager`,void 0),e([t({readOnly:!0})],X.prototype,`type`,void 0),e([t({type:Number})],X.prototype,`scale`,void 0),e([t({readOnly:!0})],X.prototype,`updating`,void 0),e([t({readOnly:!0})],X.prototype,`initialExtentRequired`,void 0),e([t({readOnly:!0})],X.prototype,`initialExtent`,null),e([t()],X.prototype,`cursor`,null),e([t({readOnly:!0})],X.prototype,`input`,void 0),e([t({type:B,nonNullable:!0})],X.prototype,`navigation`,void 0),e([t()],X.prototype,`layerViewManager`,void 0),e([t()],X.prototype,`analysisViewManager`,void 0),e([t()],X.prototype,`selectionManager`,void 0),e([t()],X.prototype,`width`,void 0),e([t()],X.prototype,`height`,void 0),e([t({readOnly:!0})],X.prototype,`resizing`,void 0),e([t({value:null,readOnly:!0})],X.prototype,`size`,null),e([t({readOnly:!0})],X.prototype,`suspended`,void 0),e([t({readOnly:!0})],X.prototype,`viewEvents`,void 0),e([t()],X.prototype,`_isValid`,void 0),e([t()],X.prototype,`_readyCycleForced`,void 0),e([t()],X.prototype,`_lockedSpatialReference`,void 0),e([t()],X.prototype,`_userTimeZone`,void 0),e([t()],X.prototype,`_lockedTimeZone`,void 0),e([t()],X.prototype,`_userTimeExtent`,void 0),e([t()],X.prototype,`_lockedTimeExtent`,void 0),e([t({type:J})],X.prototype,`theme`,void 0),e([t({readOnly:!0,type:J})],X.prototype,`effectiveTheme`,null),e([t({readOnly:!0})],X.prototype,`registeredComponents`,void 0),X=Y=e([n(`esri.views.View`)],X);const Z=globalThis.$arcgis;Z&&!Z.views&&Object.defineProperty(Z,"views",{configurable:!1,enumerable:!0,writable:!1,value:X.views});function Q(e){return e.layerViews}function $({type:e}){return e!==`media`&&e!==`imagery-tile`&&e!==`geospatial-pdf`}export{X as default};