@arcgis/core 5.2.0-next.119 → 5.2.0-next.120
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.
- package/arcade/ArcadeDate.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/090c9c2dbf92f2cac0b8.js +1 -0
- package/assets/esri/core/workers/chunks/2cf571d968118b6bdde0.js +1 -0
- package/assets/esri/core/workers/chunks/{be4de7111bc21bc69de1.js → 2e999b05ce179dd9fa08.js} +1 -1
- package/assets/esri/core/workers/chunks/39985c51465b79ff0910.js +1 -0
- package/assets/esri/core/workers/chunks/4165eb86471ea3bbf364.js +1 -0
- package/assets/esri/core/workers/chunks/{731ec5de16753e10b963.js → 46388b86d1b10e6121bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{bdcca906fdfb8e179abb.js → 4efe5827a5c61db3b19d.js} +2 -2
- package/assets/esri/core/workers/chunks/50ae209237f104735a30.js +1 -0
- package/assets/esri/core/workers/chunks/519ed8e6edd0f0014686.js +1 -0
- package/assets/esri/core/workers/chunks/{3c3e5e952fd6740bb234.js → 54f9062526c2002b7fd7.js} +1 -1
- package/assets/esri/core/workers/chunks/56b7ac280bf0be938c14.js +1 -0
- package/assets/esri/core/workers/chunks/61bcbafd676804ce3e1d.js +1 -0
- package/assets/esri/core/workers/chunks/66ef6c034455abd61f39.js +1 -0
- package/assets/esri/core/workers/chunks/75410a4de76e67ed5da4.js +1 -0
- package/assets/esri/core/workers/chunks/85780f4fa4b5509f864e.js +1 -0
- package/assets/esri/core/workers/chunks/87aaed3dfa903bdf853c.js +1 -0
- package/assets/esri/core/workers/chunks/892dc038d569cffd26dc.js +1 -0
- package/assets/esri/core/workers/chunks/8ce14dd209462f88b163.js +1 -0
- package/assets/esri/core/workers/chunks/ab3d19c77e81fe3a099d.js +1 -0
- package/assets/esri/core/workers/chunks/bdf0b4653ee455e72f04.js +1 -0
- package/assets/esri/core/workers/chunks/c118b88a7c4359e68d9b.js +1 -0
- package/assets/esri/core/workers/chunks/cbeba973ef5593ffbba3.js +1 -0
- package/assets/esri/core/workers/chunks/ceda1e08c9ff26248db0.js +1 -0
- package/assets/esri/core/workers/chunks/{06e7411c5bed0a414031.js → d6130cd8a20d24dd9d3c.js} +1 -1
- package/assets/esri/core/workers/chunks/{49c6dc487714f9cd55c7.js → ddb5d29a8998d0a76fd4.js} +1 -1
- package/assets/esri/core/workers/chunks/e9f8325a4cf89ae816cc.js +1 -0
- package/assets/esri/core/workers/chunks/f2fca9a3a40170996ea2.js +1 -0
- package/assets/esri/core/workers/chunks/f5d06cd6d30a5f742f73.js +1 -0
- package/assets/esri/core/workers/chunks/f75e57d3e02f9828b049.js +1 -0
- package/chunks/ColorMaterial.glsl.js +8 -8
- package/chunks/GaussianSplat.glsl.js +13 -8
- package/chunks/GaussianSplatShadow.glsl.js +33 -4
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/kernel.js +1 -1
- package/layers/support/NumericRange.d.ts +41 -0
- package/layers/support/fieldUtils.d.ts +9 -0
- package/linkChart/LinkChartProperties.js +1 -1
- package/package.json +4 -4
- package/support/revision.js +1 -1
- package/time/ianaZone.js +2 -0
- package/time/timeZoneUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/types.d.ts +1 -0
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementVisualization.js +1 -1
- package/views/3d/focusAreaUtils.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/extrudePolygon.js +2 -0
- package/views/3d/navigation/Navigation3D.js +1 -1
- package/views/3d/state/utils/groundNavigationUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatDepthRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatPrepassDepthRenderer.js +2 -0
- package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatPass.glsl.js +38 -27
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
- package/views/SceneView.d.ts +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/plugins/PolygonPlugin.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +43 -2
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.d.ts +11 -0
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/types.d.ts +8 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/2c21f4744e19b925a6ae.js +0 -1
- package/assets/esri/core/workers/chunks/2c9783e3b44986e86797.js +0 -1
- package/assets/esri/core/workers/chunks/45858d1c6487f4a98e40.js +0 -1
- package/assets/esri/core/workers/chunks/497c5a9c95e9a89ac217.js +0 -1
- package/assets/esri/core/workers/chunks/515fe302743c0b46f7e0.js +0 -1
- package/assets/esri/core/workers/chunks/54f3bc940cea15fce2c7.js +0 -1
- package/assets/esri/core/workers/chunks/5f79ba5639067f734791.js +0 -1
- package/assets/esri/core/workers/chunks/61ea3493b477ddc442e6.js +0 -1
- package/assets/esri/core/workers/chunks/6b9d29ca568590358478.js +0 -1
- package/assets/esri/core/workers/chunks/7243d5721bb6a7329055.js +0 -1
- package/assets/esri/core/workers/chunks/7adff63fd66fab505ae6.js +0 -1
- package/assets/esri/core/workers/chunks/84b89c523d3e16a5ee46.js +0 -1
- package/assets/esri/core/workers/chunks/85c876ee9e63d5732937.js +0 -1
- package/assets/esri/core/workers/chunks/8cc95d827f460909d442.js +0 -1
- package/assets/esri/core/workers/chunks/97fea852f8e93e1286e4.js +0 -1
- package/assets/esri/core/workers/chunks/a5466c864c3ead9aac5a.js +0 -1
- package/assets/esri/core/workers/chunks/a774006be107e449bc29.js +0 -1
- package/assets/esri/core/workers/chunks/bb56ab53c5a10c9518a6.js +0 -1
- package/assets/esri/core/workers/chunks/d5defba320f2e49a377f.js +0 -1
- package/assets/esri/core/workers/chunks/e5f0c47957a4e9663720.js +0 -1
- package/assets/esri/core/workers/chunks/ebe7ba2557b50e18e547.js +0 -1
- package/assets/esri/core/workers/chunks/edd36e98355f1655e5c8.js +0 -1
- package/assets/esri/core/workers/chunks/f66e597e524b26e61cd3.js +0 -1
- package/views/3d/layers/graphics/extrudeUtils.js +0 -2
- /package/assets/esri/core/workers/chunks/{bdcca906fdfb8e179abb.js.LICENSE.txt → 4efe5827a5c61db3b19d.js.LICENSE.txt} +0 -0
package/views/SceneView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{destroyHandle as o,makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import p from"../core/Logger.js";import{mapCollectionAsync as h}from"../core/mapCollectionUtils.js";import{destroyMaybe as d,maybeProperty as u}from"../core/maybe.js";import{ignoreAbortErrors as c,throwIfDestroyed as g,throwIfAborted as m,createAbortError as y}from"../core/promiseUtils.js";import f from"../core/ReactiveSet.js";import{on as w,watch as v,initial as _,sync as b,whenOnce as M,syncAndInitial as S}from"../core/reactiveUtils.js";import{setFrameDuration as V,cleanupScheduling as j}from"../core/scheduling.js";import{createScreenPoint as C,createScreenPointArray as T}from"../core/screenUtils.js";import{cleanupWhereClauseCache as R}from"../core/sql.js";import{getMetersPerUnitForSR as x}from"../core/units.js";import{property as A,cast as O,subclass as E}from"../core/accessorSupport/decorators.js";import{ensureType as L,ensureClass as I}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as H}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as P}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as D}from"../core/accessorSupport/trackingUtils.js";import{create as F}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as U}from"../core/libs/rbush/PooledRBush.js";import{initialize as G}from"../core/workers/workers.js";import W from"../geometry/Extent.js";import z from"../geometry/HeightModelInfo.js";import q from"../geometry/Point.js";import{project as k,canProjectWithoutEngine as B}from"../geometry/projectionUtils.js";import N from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as Z}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Q}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as Y}from"../geometry/projection/projectPointToVector.js";import{toExtent as $,create as J}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as K}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as X}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as ee}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as te,isTiledLayer as ie,isVoxelLayer as re,isIntegratedMeshLayer as se,isGaussianSplatLayer as ne}from"../layers/support/layerUtils.js";import{TilemapCache as ae}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as oe}from"../portal/portalDefault.js";import{WebSceneTag as le}from"../support/tagSymbols.js";import{BreakpointsOwner as pe}from"./BreakpointsOwner.js";import{DOMContainer as he}from"./DOMContainer.js";import{PopupView as de}from"./PopupView.js";import ue from"./View.js";import ce from"./ViewAnimation.js";import{stringFromViewingMode as ge,viewingModeFromString as me}from"./ViewingMode.js";import{GroundView3D as ye}from"./3d/GroundView3D.js";import{layerView3DImporter as fe}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as we}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ve}from"./3d/camera/intersectionUtils.js";import _e from"./3d/constraints/Constraints.js";import be from"./3d/environment/Environment.js";import{EnvironmentManager as Me}from"./3d/environment/EnvironmentManager.js";import Se from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as Ve}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as je}from"./3d/layers/graphics/Labeler.js";import Ce from"./3d/layers/i3s/I3SLodHandling.js";import{Navigation3D as Te}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as Re}from"./3d/state/ScreenSizePerspective.js";import xe from"./3d/state/ViewState.js";import{ViewStateManager as Ae,cleanupViewStateManager as Oe}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Ee}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Le}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ie}from"./3d/state/utils/navigationUtils.js";import He from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Pe}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as De}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Fe}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as Ue}from"./3d/support/GroundAndIMSurface.js";import{toMap as Ge,hitTest as We}from"./3d/support/hitTest.js";import{popupHitTest as ze}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as qe,getQualityProfileSettings as ke}from"./3d/support/QualityProfile.js";import Be from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ne}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ze}from"./3d/support/ResourceController.js";import Qe from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Ye}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as $e}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Je}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ke from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Xe,getTiledLayerInfo as et,checkIfTileInfoSupportedForView as tt}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as it}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as rt}from"./3d/terrain/TileRenderer.js";import{Stage as st}from"./3d/webgl-engine/Stage.js";import{olidEnabled as nt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as at}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as ot}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as lt}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as pt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as ht}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import dt from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as ut}from"./support/drapedUtils.js";import{occludeesSupported as ct}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as gt,createScreenPointFromSupportedEvent as mt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as yt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as ft,destroyTextureCompressionWorker as wt}from"./support/TextureCompressionHelper.js";import vt from"./ui/DefaultUI.js";import _t from"./ui/3d/DefaultUI3D.js";import bt from"../webscene/Environment.js";import{clearVNodeCache as Mt}from"../widgets/support/vnodeCache.js";var St;const Vt=Symbol(),jt=Symbol();let Ct=class extends(pe(de(he(ue)))){static{St=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Ze(this),this.deconflictor=new Ve({view:this}),this.attribution3D=new He({view:this}),this.labeler=new je({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new Te({view:this}),this.basemapTerrain=null,this.elevationProvider=new Pe({view:this}),this._canvas=null,this.constraints=new _e,this._environment=new be,this.environmentManager=new Me,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new dt({importAnalysisViewModule:e=>we(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new f,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new xe({view:this}),this.slice=new $e,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new _t,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,G();const t=()=>this._updatingChanged();this.addHandles(o(h(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([w(()=>this.map?.allLayers,"after-changes",t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),v(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Se({view:this}),this.stateManager=new Ae({view:this}),this.screenSizePerspective=new Re({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=ft(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ye({view:this}),this.groundAndIMSurface=new Ue({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},_),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>V(e>0?1e3/Math.ceil(e):0),_),this.addHandles([v(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),b),v(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),b)])}destroy(){this.destroyed||(wt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set("analysisViewManager",d(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=d(this.sharedSymbolResources),this._set("labeler",d(this.labeler)),this._set("deconflictor",d(this.deconflictor)),this._resourceController=d(this._resourceController),this._set("stateManager",d(this.stateManager)),this._set("inputManager",d(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",d(this.environmentManager)),this._set("environment",d(this.environment)),this.groundView=d(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=L(q,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||u(e,"clippingArea");return!this._userClippingArea&&!u(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof W?this.spatialReference&&(t=Tt(t,this.spatialReference),null==t)?(p.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==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):(p.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?p.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Tt(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||N.WGS84,i=Tt(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||N.WGS84;let t;const i=i=>{const r=Tt(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new W({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof be?e:e instanceof bt?this.environment?.cloneWithWebsceneEnvironment(e)??be.fromWebsceneEnvironment(e):L(be,e):new be}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 St._layerToLayerview}static{this._layerToLayerview=ue._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&&le 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){const t=ke(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new Be(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||qe()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){const{scale:e,spatialReference:t}=this;return t?P(()=>X(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?z.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&p.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,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Xe(r))return;++i,e+=r.updatingProgress}}else++i});const r=.1;for(const n of this._updatingObjects)n?.updating&&(i+=r,e+=.5*r);for(const n of this._updatingObjectsWithProgress)n?.updating&&(++i,e+=n.updatingProgress);const s=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||s||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return De.UPDATING&&console.log("Updating:",this._updatingObjectsToDebug.filter(e=>null!=e&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return De.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return ge(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?ge(this.defaultsFromMap.viewingMode):yt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?p.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 Qe(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return p.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=gt(e)?mt(this,e):e;return Ge(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return p.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=Ot,t.x=e.x,t.y=e.y,t.z=Fe(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),Y(t,Rt,this.renderSpatialReference),this.state.camera.projectToScreen(Rt,xt),C(xt[0],xt[1])}pixelSizeAt(e,t){if(!this.ready)return p.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;Y(e,Rt,i);const r=this.state.camera.computeScreenPixelSizeAt(Rt);return t&&i!==t?r*x(i)/x(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return p.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=gt(e)?mt(this,e):e;return We(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return ze(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async zoomIn(){if(this.canZoomIn)return c(this.goTo({zoomFactor:2}))}async zoomOut(){if(this.canZoomOut)return c(this.goTo({zoomFactor:.5}))}async whenAnalysisView(e){if(null==e.parent)throw new n("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){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await(import("./support/screenshotUtils.js"))).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await(import("./support/screenshotUtils.js"))).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await(import("./support/screenshotUtils.js"));return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await(import("./support/screenshotUtils.js")),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!nt())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await(import("./support/screenshotUtils.js")),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("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 fe.importLayerView(e)}hasLayerViewModule(e){return fe.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?me(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,i):null,s=i?r(i):[...r(1)??[],...r(2)??[]];return s?.length?{constraints:s}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!yt(e,i)&&(null==t||(!!te(t)||(!ie(t)||null!=et(t,e,i))&&(!re(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i,r){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:s,isWGS84:n}=e;if(te(t)&&(s||n)){return!n||2===r||null===tt(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:N.WebMercator,viewingMode:i}]:[{spatialReference:s?N.WGS84:N.WebMercator,viewingMode:i}]}return ie(t)||re(t)||!s&&!n?ie(t)&&s&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:N.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:s?N.WGS84:N.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?p.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${ge(i)} viewing mode.`):e.isGeographic&&p.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return p.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return p.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ct(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await M(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),l(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Et[e]();if(t&&(g(this),m(i.signal),await t(i.signal)),this.destroyed)throw y();return m(i.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 Ke({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{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 Je({view:this})),this.addHandles([this.updatingHandles.add(()=>De.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&De.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=d(this._featureTreeDebugger))},S),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?k($(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},S),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=d(this._featureTiles)},b)],Vt),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const 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(jt),this.removeHandles(Vt),this._featureTiles=d(this.featureTiles),this._set("pointsOfInterest",d(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=K(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ne.create(this.state.viewingMode,i)),t||this.addHandles(v(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!Q(e,this.groundView.spatialReference,At,t)||(this.renderCoordsHelper.extent=At)},b),jt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(ot/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(jt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(v(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),b),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Le(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new st({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage||"WebGL context lost")})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(ot/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=d(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Ye({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")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>M(()=>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=d(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===me(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(w(()=>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");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?H(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(pt);for(const t of this.allLayerViews)(se(t.layer)&&(!has("enable-feature:im-as-ground")||t.layer.isUsedAsGroundLayer)||ne(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(pt);for(const t of this.allLayerViews)(has("enable-feature:im-as-ground")?se(t.layer)&&t.layer.isUsedAsGroundLayer:se(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){Mt(),D(),R(),ht(),Oe(),ve(),Z(),ut(),oe(),rt(),lt(),Ee(),Ie(),U(),j(),at(),it(),Ce.cleanupI3SLodHandling(),ae.cleanupTilemapCache(),xe.cleanupViewstate(),Ke.cleanupTerrainSurface()}};function Tt(e,t){return null!=e&&B(e.spatialReference,t)?k(e,t):null}e([A()],Ct.prototype,"_userClippingArea",void 0),e([A()],Ct.prototype,"_resourceController",void 0),e([A()],Ct.prototype,"stage",null),e([A({readOnly:!0})],Ct.prototype,"deconflictor",void 0),e([A({readOnly:!0})],Ct.prototype,"labeler",void 0),e([A()],Ct.prototype,"navigation",void 0),e([A({type:ce,readOnly:!0})],Ct.prototype,"animation",null),e([A({readOnly:!0})],Ct.prototype,"basemapTerrain",void 0),e([A({readOnly:!0})],Ct.prototype,"overlayManager",null),e([A({readOnly:!0})],Ct.prototype,"elevationProvider",void 0),e([A()],Ct.prototype,"camera",null),e([A({type:t})],Ct.prototype,"contentCamera",null),e([A({readOnly:!0})],Ct.prototype,"canvas",null),e([A({type:q,useTypeForAutocast:!1})],Ct.prototype,"center",null),e([A({type:W})],Ct.prototype,"clippingArea",null),e([A({type:_e,nonNullable:!0})],Ct.prototype,"constraints",void 0),e([A({type:W,readOnly:!0})],Ct.prototype,"renderDataExtent",null),e([A({readOnly:!0})],Ct.prototype,"tileInfo",null),e([A({type:W,readOnly:!0})],Ct.prototype,"dataExtent",null),e([A({type:W,readOnly:!0})],Ct.prototype,"_groundAndLayersExtent",null),e([A({type:be})],Ct.prototype,"environment",null),e([O("environment")],Ct.prototype,"castEnvironment",null),e([A({readOnly:!0})],Ct.prototype,"environmentManager",void 0),e([A({type:W})],Ct.prototype,"extent",null),e([A({type:r})],Ct.prototype,"floors",void 0),e([A()],Ct.prototype,"screenCenter",null),e([A()],Ct.prototype,"frustum",null),e([A({type:Number,readOnly:!0})],Ct.prototype,"fullOpacity",void 0),e([A({readOnly:!0})],Ct.prototype,"graphicsView",void 0),e([A()],Ct.prototype,"analysisViewManager",void 0),e([A()],Ct.prototype,"groundView",void 0),e([A({readOnly:!0})],Ct.prototype,"layerviewCollections",null),e([A({type:Boolean})],Ct.prototype,"initialExtentRequired",null),e([A()],Ct.prototype,"defaultsFromMapSettings",null),e([A()],Ct.prototype,"interacting",null),e([A()],Ct.prototype,"stationary",null),e([A()],Ct.prototype,"navigating",null),e([A()],Ct.prototype,"map",void 0),e([A()],Ct.prototype,"padding",null),e([A({type:Je,readOnly:!0})],Ct.prototype,"pointsOfInterest",void 0),e([A()],Ct.prototype,"_featureTiles",void 0),e([A()],Ct.prototype,"featureTiles",null),e([A()],Ct.prototype,"_featureTreeDebugger",void 0),e([A({constructOnly:!0})],Ct.prototype,"deactivatedWebGLExtensions",void 0),e([A({constructOnly:!0})],Ct.prototype,"debugWebGLExtensions",void 0),e([A({constructOnly:!0})],Ct.prototype,"renderCanvas",void 0),e([A({constructOnly:!0})],Ct.prototype,"state",void 0),e([A()],Ct.prototype,"screenSizePerspective",void 0),e([A({readOnly:!0})],Ct.prototype,"inputManager",void 0),e([A({readOnly:!0})],Ct.prototype,"stateManager",void 0),e([A({type:["low","medium","high"]})],Ct.prototype,"qualityProfile",null),e([A({type:Be,get(){let e=this._get("qualitySettings");if(!e){const t=ke(this.qualityProfile);e=new Be(t)}return e}})],Ct.prototype,"qualitySettings",void 0),e([A()],Ct.prototype,"slice",void 0),e([A({readOnly:!0})],Ct.prototype,"typeSpecificPreconditionsReady",null),e([A({readOnly:!0})],Ct.prototype,"renderCoordsHelper",void 0),e([A({readOnly:!0})],Ct.prototype,"sceneIntersectionHelper",void 0),e([A({type:Number,readOnly:!0})],Ct.prototype,"resolution",null),e([A({type:Number})],Ct.prototype,"scale",null),e([A({readOnly:!0,type:Number})],Ct.prototype,"terrainLevel",null),e([A()],Ct.prototype,"heightModelInfo",null),e([A({type:N})],Ct.prototype,"spatialReference",void 0),e([A({type:Boolean,value:!1})],Ct.prototype,"alphaCompositingEnabled",null),e([A({constructOnly:!0})],Ct.prototype,"preserveDrawingBufferEnabled",void 0),e([A({type:Boolean})],Ct.prototype,"supersampleScreenshotsEnabled",void 0),e([A({readOnly:!0})],Ct.prototype,"type",void 0),e([A(),O(e=>e instanceof vt?e:I(_t,e))],Ct.prototype,"ui",void 0),e([A({type:Boolean,readOnly:!0})],Ct.prototype,"updating",null),e([A()],Ct.prototype,"_updatingObjects",null),e([A()],Ct.prototype,"_updatingObjectsWithProgress",null),e([A()],Ct.prototype,"_updatingObjectsToDebug",null),e([A({type:Number,readOnly:!0})],Ct.prototype,"updatingProgress",void 0),e([A({type:["global","local"]})],Ct.prototype,"viewingMode",null),e([A({type:i})],Ct.prototype,"viewpoint",null),e([A({readOnly:!0})],Ct.prototype,"visibleArea",null),e([A({type:Number})],Ct.prototype,"zoom",null),e([A({readOnly:!0})],Ct.prototype,"quality",null),e([A({readOnly:!0})],Ct.prototype,"resolutionScale",null),e([A()],Ct.prototype,"focusAreasView",void 0),e([A()],Ct.prototype,"_defaultToMapOptions",null),e([A()],Ct.prototype,"_defaultHitTestOptions",null),Ct=St=e([E("esri.views.SceneView")],Ct);const Rt=F(),xt=T(),At=J(),Ot=ee(0,0,0,N.WebMercator),Et={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Lt=Ct;export{Lt as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{destroyHandle as o,makeHandle as l}from"../core/handleUtils.js";import has from"../core/has.js";import p from"../core/Logger.js";import{mapCollectionAsync as h}from"../core/mapCollectionUtils.js";import{destroyMaybe as d,maybeProperty as u}from"../core/maybe.js";import{throwIfDestroyed as c,throwIfAborted as g,createAbortError as m}from"../core/promiseUtils.js";import y from"../core/ReactiveSet.js";import{on as f,watch as w,initial as v,sync as _,whenOnce as b,syncAndInitial as M}from"../core/reactiveUtils.js";import{setFrameDuration as S,cleanupScheduling as V}from"../core/scheduling.js";import{createScreenPoint as j,createScreenPointArray as C}from"../core/screenUtils.js";import{cleanupWhereClauseCache as T}from"../core/sql.js";import{getMetersPerUnitForSR as R}from"../core/units.js";import{property as x,cast as A,subclass as O}from"../core/accessorSupport/decorators.js";import{ensureType as E,ensureClass as L}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as I}from"../core/accessorSupport/overrideDefaultsFrom.js";import{runUntracked as H}from"../core/accessorSupport/tracking.js";import{drainNotificationQueue as P}from"../core/accessorSupport/trackingUtils.js";import{create as D}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as F}from"../core/libs/rbush/PooledRBush.js";import{initialize as U}from"../core/workers/workers.js";import G from"../geometry/Extent.js";import W from"../geometry/HeightModelInfo.js";import z from"../geometry/Point.js";import{project as q,canProjectWithoutEngine as k}from"../geometry/projectionUtils.js";import B from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as N}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as Z}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as Q}from"../geometry/projection/projectPointToVector.js";import{toExtent as Y,create as $}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as J}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as K}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as X}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as ee,isTiledLayer as te,isVoxelLayer as ie,isIntegratedMeshLayer as re,isGaussianSplatLayer as se}from"../layers/support/layerUtils.js";import{TilemapCache as ne}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as ae}from"../portal/portalDefault.js";import{WebSceneTag as oe}from"../support/tagSymbols.js";import{BreakpointsOwner as le}from"./BreakpointsOwner.js";import{DOMContainer as pe}from"./DOMContainer.js";import{PopupView as he}from"./PopupView.js";import de from"./View.js";import ue from"./ViewAnimation.js";import{stringFromViewingMode as ce,viewingModeFromString as ge}from"./ViewingMode.js";import{GroundView3D as me}from"./3d/GroundView3D.js";import{layerView3DImporter as ye}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as fe}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as we}from"./3d/camera/intersectionUtils.js";import ve from"./3d/constraints/Constraints.js";import _e from"./3d/environment/Environment.js";import{EnvironmentManager as be}from"./3d/environment/EnvironmentManager.js";import Me from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as Se}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Ve}from"./3d/layers/graphics/Labeler.js";import je from"./3d/layers/i3s/I3SLodHandling.js";import{Navigation3D as Ce}from"./3d/navigation/Navigation3D.js";import{ScreenSizePerspective as Te}from"./3d/state/ScreenSizePerspective.js";import Re from"./3d/state/ViewState.js";import{ViewStateManager as xe,cleanupViewStateManager as Ae}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as Oe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Ee}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Le}from"./3d/state/utils/navigationUtils.js";import Ie from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as He}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as Pe}from"./3d/support/debugFlags.js";import{getElevationAtPoint as De}from"./3d/support/ElevationProvider.js";import{GroundAndIMSurface as Fe}from"./3d/support/GroundAndIMSurface.js";import{toMap as Ue,hitTest as Ge}from"./3d/support/hitTest.js";import{popupHitTest as We}from"./3d/support/popupHitTest.js";import{getDefaultQualityProfileName as ze,getQualityProfileSettings as qe}from"./3d/support/QualityProfile.js";import ke from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Be}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Ne}from"./3d/support/ResourceController.js";import Ze from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Qe}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ye}from"./3d/support/ViewSlice.js";import{PointsOfInterest as $e}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Je from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ke,getTiledLayerInfo as Xe,checkIfTileInfoSupportedForView as et}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as tt}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as it}from"./3d/terrain/TileRenderer.js";import{Stage as rt}from"./3d/webgl-engine/Stage.js";import{olidEnabled as st}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as nt}from"./3d/webgl-engine/effects/geometry/RenderOccluded.js";import{defaultTolerance as at}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as ot}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as lt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as pt}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import ht from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as dt}from"./support/drapedUtils.js";import{occludeesSupported as ut}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ct,createScreenPointFromSupportedEvent as gt}from"./support/screenUtils.js";import{isSpatialReferenceSupported as mt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as yt,destroyTextureCompressionWorker as ft}from"./support/TextureCompressionHelper.js";import wt from"./ui/DefaultUI.js";import vt from"./ui/3d/DefaultUI3D.js";import _t from"../webscene/Environment.js";import{clearVNodeCache as bt}from"../widgets/support/vnodeCache.js";var Mt;const St=Symbol(),Vt=Symbol();let jt=class extends(le(he(pe(de)))){static{Mt=this}get timeZone(){return super.timeZone}set timeZone(e){super.timeZone=e}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=Ne(this),this.deconflictor=new Se({view:this}),this.attribution3D=new Ie({view:this}),this.labeler=new Ve({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.navigation=new Ce({view:this}),this.basemapTerrain=null,this.elevationProvider=new He({view:this}),this._canvas=null,this.constraints=new ve,this._environment=new _e,this.environmentManager=new be,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ht({importAnalysisViewModule:e=>fe(e),view:this}),this.groundView=null,this.groundAndIMSurface=null,this.map=null,this._featureTileTreeClients=new y,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new Re({view:this}),this.slice=new Ye,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new vt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,U();const t=()=>this._updatingChanged();this.addHandles(o(h(()=>this.map?.allLayers,async e=>{try{await e.when()}catch{}finally{t()}}))),this.addHandles([f(()=>this.map?.allLayers,"after-changes",t,{onListenerAdd:t,onListenerRemove:t,sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),w(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new Me({view:this}),this.stateManager=new xe({view:this}),this.screenSizePerspective=new Te({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=yt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new me({view:this}),this.groundAndIMSurface=new Fe({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},v),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},v),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>S(e>0?1e3/Math.ceil(e):0),v),this.addHandles([w(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),_),w(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),_)])}destroy(){this.destroyed||(ft(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.layerViewManager.clear(),this._set("analysisViewManager",d(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=d(this.sharedSymbolResources),this._set("labeler",d(this.labeler)),this._set("deconflictor",d(this.deconflictor)),this._resourceController=d(this._resourceController),this._set("stateManager",d(this.stateManager)),this._set("inputManager",d(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",d(this.environmentManager)),this._set("environment",d(this.environment)),this.groundView=d(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=E(z,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||u(e,"clippingArea");return!this._userClippingArea&&!u(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof G?this.spatialReference&&(t=Ct(t,this.spatialReference),null==t)?(p.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==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):(p.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?p.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Ct(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||B.WGS84,i=Ct(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||B.WGS84;let t;const i=i=>{const r=Ct(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new G({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof _e?e:e instanceof _t?this.environment?.cloneWithWebsceneEnvironment(e)??_e.fromWebsceneEnvironment(e):E(_e,e):new _e}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 Mt._layerToLayerview}static{this._layerToLayerview=de._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&&oe 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){const t=qe(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new ke(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||ze()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){const{scale:e,spatialReference:t}=this;return t?H(()=>K(e,t)):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?W.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&p.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,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ke(r))return;++i,e+=r.updatingProgress}}else++i});const r=.1;for(const n of this._updatingObjects)n?.updating&&(i+=r,e+=.5*r);for(const n of this._updatingObjectsWithProgress)n?.updating&&(++i,e+=n.updatingProgress);const s=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||s||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return Pe.UPDATING&&console.log("Updating:",this._updatingObjectsToDebug.filter(e=>null!=e&&e.updating).map(({declaredClass:e})=>e)),t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager,this.focusAreasView]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get _updatingObjectsToDebug(){return Pe.UPDATING?this._updatingObjects.concat(this._updatingObjectsWithProgress).concat(this.allLayerViews.toArray()):[]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return ce(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?ce(this.defaultsFromMap.viewingMode):mt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?p.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 Ze(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return p.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ct(e)?gt(this,e):e;return Ue(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return p.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=At,t.x=e.x,t.y=e.y,t.z=De(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),Q(t,Tt,this.renderSpatialReference),this.state.camera.projectToScreen(Tt,Rt),j(Rt[0],Rt[1])}pixelSizeAt(e,t){if(!this.ready)return p.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;Q(e,Tt,i);const r=this.state.camera.computeScreenPixelSizeAt(Tt);return t&&i!==t?r*R(i)/R(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return p.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ct(e)?gt(this,e):e;return Ge(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return We(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(null==e.parent)throw new n("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){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await(import("./support/screenshotUtils.js"))).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await(import("./support/screenshotUtils.js"))).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await(import("./support/screenshotUtils.js"));return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await(import("./support/screenshotUtils.js")),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!st())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await(import("./support/screenshotUtils.js")),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("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 ye.importLayerView(e)}hasLayerViewModule(e){return ye.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getWebDocumentSpatialReference(){return this.scene?.initialViewProperties?.spatialReference}getDefaultTimeZone(){return this.scene?.initialViewProperties?.timeZone??null}getSurface(){return this.surface}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ge(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode,r=r=>this._validateSpatialReferenceForViewingMode(e,t,r)?this._makeSpatialReferenceConstraints(e,t,r,i):null,s=i?r(i):[...r(1)??[],...r(2)??[]];return s?.length?{constraints:s}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!mt(e,i)&&(null==t||(!!ee(t)||(!te(t)||null!=Xe(t,e,i))&&(!ie(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i,r){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:s,isWGS84:n}=e;if(ee(t)&&(s||n)){return!n||2===r||null===et(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:B.WebMercator,viewingMode:i}]:[{spatialReference:s?B.WGS84:B.WebMercator,viewingMode:i}]}return te(t)||ie(t)||!s&&!n?te(t)&&s&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:B.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:s?B.WGS84:B.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?p.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${ce(i)} viewing mode.`):e.isGeographic&&p.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return p.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return p.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&ut(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),l(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await b(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),l(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await Ot[e]();if(t&&(c(this),g(i.signal),await t(i.signal)),this.destroyed)throw m();return g(i.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 Je({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{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 $e({view:this})),this.addHandles([this.updatingHandles.add(()=>Pe.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&Pe.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=d(this._featureTreeDebugger))},M),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?q(Y(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},M),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.consumePromise(this._ensureFeatureTileTree()):this._featureTiles=d(this._featureTiles)},_)],St),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const 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(Vt),this.removeHandles(St),this._featureTiles=d(this.featureTiles),this._set("pointsOfInterest",d(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=J(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Be.create(this.state.viewingMode,i)),t||this.addHandles(w(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!Z(e,this.groundView.spatialReference,xt,t)||(this.renderCoordsHelper.extent=xt)},_),Vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(at/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(Vt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(w(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),_),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Ee(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new rt({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage||"WebGL context lost")})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(at/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=d(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Qe({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")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>b(()=>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=d(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ge(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(f(()=>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");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?I(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(lt);for(const t of this.allLayerViews)(re(t.layer)&&(!has("enable-feature:im-as-ground")||t.layer.isUsedAsGroundLayer)||se(t.layer))&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(lt);for(const t of this.allLayerViews)(has("enable-feature:im-as-ground")?re(t.layer)&&t.layer.isUsedAsGroundLayer:re(t.layer))&&t.fullOpacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){bt(),P(),T(),pt(),Ae(),we(),N(),dt(),ae(),it(),ot(),Oe(),Le(),F(),V(),nt(),tt(),je.cleanupI3SLodHandling(),ne.cleanupTilemapCache(),Re.cleanupViewstate(),Je.cleanupTerrainSurface()}};function Ct(e,t){return null!=e&&k(e.spatialReference,t)?q(e,t):null}e([x()],jt.prototype,"_userClippingArea",void 0),e([x()],jt.prototype,"_resourceController",void 0),e([x()],jt.prototype,"stage",null),e([x({readOnly:!0})],jt.prototype,"deconflictor",void 0),e([x({readOnly:!0})],jt.prototype,"labeler",void 0),e([x()],jt.prototype,"navigation",void 0),e([x({type:ue,readOnly:!0})],jt.prototype,"animation",null),e([x({readOnly:!0})],jt.prototype,"basemapTerrain",void 0),e([x({readOnly:!0})],jt.prototype,"overlayManager",null),e([x({readOnly:!0})],jt.prototype,"elevationProvider",void 0),e([x()],jt.prototype,"camera",null),e([x({type:t})],jt.prototype,"contentCamera",null),e([x({readOnly:!0})],jt.prototype,"canvas",null),e([x({type:z,useTypeForAutocast:!1})],jt.prototype,"center",null),e([x({type:G})],jt.prototype,"clippingArea",null),e([x({type:ve,nonNullable:!0})],jt.prototype,"constraints",void 0),e([x({type:G,readOnly:!0})],jt.prototype,"renderDataExtent",null),e([x({readOnly:!0})],jt.prototype,"tileInfo",null),e([x({type:G,readOnly:!0})],jt.prototype,"dataExtent",null),e([x({type:G,readOnly:!0})],jt.prototype,"_groundAndLayersExtent",null),e([x({type:_e})],jt.prototype,"environment",null),e([A("environment")],jt.prototype,"castEnvironment",null),e([x({readOnly:!0})],jt.prototype,"environmentManager",void 0),e([x({type:G})],jt.prototype,"extent",null),e([x({type:r})],jt.prototype,"floors",void 0),e([x()],jt.prototype,"screenCenter",null),e([x()],jt.prototype,"frustum",null),e([x({type:Number,readOnly:!0})],jt.prototype,"fullOpacity",void 0),e([x({readOnly:!0})],jt.prototype,"graphicsView",void 0),e([x()],jt.prototype,"analysisViewManager",void 0),e([x()],jt.prototype,"groundView",void 0),e([x({readOnly:!0})],jt.prototype,"layerviewCollections",null),e([x({type:Boolean})],jt.prototype,"initialExtentRequired",null),e([x()],jt.prototype,"defaultsFromMapSettings",null),e([x()],jt.prototype,"interacting",null),e([x()],jt.prototype,"stationary",null),e([x()],jt.prototype,"navigating",null),e([x()],jt.prototype,"map",void 0),e([x()],jt.prototype,"padding",null),e([x({type:$e,readOnly:!0})],jt.prototype,"pointsOfInterest",void 0),e([x()],jt.prototype,"_featureTiles",void 0),e([x()],jt.prototype,"featureTiles",null),e([x()],jt.prototype,"_featureTreeDebugger",void 0),e([x({constructOnly:!0})],jt.prototype,"deactivatedWebGLExtensions",void 0),e([x({constructOnly:!0})],jt.prototype,"debugWebGLExtensions",void 0),e([x({constructOnly:!0})],jt.prototype,"renderCanvas",void 0),e([x({constructOnly:!0})],jt.prototype,"state",void 0),e([x()],jt.prototype,"screenSizePerspective",void 0),e([x({readOnly:!0})],jt.prototype,"inputManager",void 0),e([x({readOnly:!0})],jt.prototype,"stateManager",void 0),e([x({type:["low","medium","high"]})],jt.prototype,"qualityProfile",null),e([x({type:ke,get(){let e=this._get("qualitySettings");if(!e){const t=qe(this.qualityProfile);e=new ke(t)}return e}})],jt.prototype,"qualitySettings",void 0),e([x()],jt.prototype,"slice",void 0),e([x({readOnly:!0})],jt.prototype,"typeSpecificPreconditionsReady",null),e([x({readOnly:!0})],jt.prototype,"renderCoordsHelper",void 0),e([x({readOnly:!0})],jt.prototype,"sceneIntersectionHelper",void 0),e([x({type:Number,readOnly:!0})],jt.prototype,"resolution",null),e([x({type:Number})],jt.prototype,"scale",null),e([x({readOnly:!0,type:Number})],jt.prototype,"terrainLevel",null),e([x()],jt.prototype,"heightModelInfo",null),e([x({type:B})],jt.prototype,"spatialReference",void 0),e([x({type:Boolean,value:!1})],jt.prototype,"alphaCompositingEnabled",null),e([x({constructOnly:!0})],jt.prototype,"preserveDrawingBufferEnabled",void 0),e([x({type:Boolean})],jt.prototype,"supersampleScreenshotsEnabled",void 0),e([x({readOnly:!0})],jt.prototype,"type",void 0),e([x(),A(e=>e instanceof wt?e:L(vt,e))],jt.prototype,"ui",void 0),e([x({type:Boolean,readOnly:!0})],jt.prototype,"updating",null),e([x()],jt.prototype,"_updatingObjects",null),e([x()],jt.prototype,"_updatingObjectsWithProgress",null),e([x()],jt.prototype,"_updatingObjectsToDebug",null),e([x({type:Number,readOnly:!0})],jt.prototype,"updatingProgress",void 0),e([x({type:["global","local"]})],jt.prototype,"viewingMode",null),e([x({type:i})],jt.prototype,"viewpoint",null),e([x({readOnly:!0})],jt.prototype,"visibleArea",null),e([x({type:Number})],jt.prototype,"zoom",null),e([x({readOnly:!0})],jt.prototype,"quality",null),e([x({readOnly:!0})],jt.prototype,"resolutionScale",null),e([x()],jt.prototype,"focusAreasView",void 0),e([x()],jt.prototype,"_defaultToMapOptions",null),e([x()],jt.prototype,"_defaultHitTestOptions",null),jt=Mt=e([O("esri.views.SceneView")],jt);const Tt=D(),Rt=C(),xt=$(),At=X(0,0,0,B.WebMercator),Ot={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Et=jt;export{Et as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{watch as e,initial as o}from"../../../core/reactiveUtils.js";import{property as n,subclass as i}from"../../../core/accessorSupport/decorators.js";import s from"../../../geometry/Polyline.js";import{isPolygon as r}from"../../../geometry/support/typeUtils.js";import{getPaths as l}from"../../../geometry/support/curves/curveUtils.js";import{PolylinePlugin as a}from"./PolylinePlugin.js";import{knownFieldDisplayOrders as p}from"../support/types.js";import"../../../core/sql/UnknownTimeZone.js";import"../../../time/constants.js";import"luxon";import"../../../intl/date.js";import"../../../rest/support/Query.js";import"../../input/InputManager.js";import"../../interactive/keybindings.js";import"../../../core/units.js";import"../../../symbols/support/unitConversionUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Logger.js";import{screenDistance as d}from"../../../core/screenUtils.js";const u=5,c=Symbol("polygon-snap-to-close-constraint"),m=Symbol("polygon-area-measurement"),g=Symbol("polygon-area-field");let y=class extends a{constructor(){super(...arguments),this._autoCloseLineVisualId=Symbol("polygon-auto-close-on-commit"),this._defaultClosingLineVisualId=Symbol("polygon-default-close-on-cancel"),this.clickToCloseEnabled=!0}get _totalPreviewGeometry(){const{_session:t}=this;if(!t)return null;const e=t.lastPointAddedBySession?.partIndex,o=this._downstreamEditSession?.lastPointAddedBySession?.partIndex,n=e??o;if(!t||null==n)return null;const i=t?.getInformationAboutPoint(0,n),s=t?.getInformationAboutPoint(-1,n);return t?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"polygon",firstIncludedPoint:i,lastIncludedPoint:s})}get helpMessageKey(){const t=this._session?.lastPointAddedBySession;return t?null!=t.pointIndex&&t.pointIndex>0?"polygonTwoVertices":"polygonOneVertex":"polygonZeroVertices"}get test(){const{_autoCloseLineVisualId:t,_defaultClosingLineVisualId:e}=this;return{_autoCloseLineVisualId:t,_defaultClosingLineVisualId:e}}start(t){super.start(t),t.createConstraint(c,(t,e)=>this._snapToClosingVertex(t,e)),t.addOrUpdateVisual(this._autoCloseLineVisualId,{role:"outline",state:"active"}),t.addOrUpdateVisual(this._defaultClosingLineVisualId,{role:"outline",state:"idle"}),this.addHandles([e(()=>this._downstreamEditSession?.lastPointAddedBySession,t=>{if(!t||null==t.pointIndex)return this._context?.addOrUpdateVisual(this._autoCloseLineVisualId,{geometry:null}),void this._context?.addOrUpdateVisual(this._defaultClosingLineVisualId,{geometry:null});const e=this._session?.getInformationAboutPoint(t.pointIndex-1,t.partIndex),o=this._session?.getInformationAboutPoint(0,t.partIndex);if(t.point&&o?.point){const e=[t.point.x,t.point.y],n=[o.point.x,o.point.y],i=new s({spatialReference:t.point.spatialReference,paths:[[e,n]]});this._context?.addOrUpdateVisual(this._autoCloseLineVisualId,{geometry:i})}else this._context?.addOrUpdateVisual(this._autoCloseLineVisualId,{geometry:null});if(e?.point&&o?.point){const t=[e.point.x,e.point.y],n=[o.point.x,o.point.y],i=new s({spatialReference:o.point.spatialReference,paths:[[t,n]]});this._context?.addOrUpdateVisual(this._defaultClosingLineVisualId,{geometry:i})}else this._context?.addOrUpdateVisual(this._defaultClosingLineVisualId,{geometry:null})},o)],this._ownHandlesKey)}detachPlugin(t,e){const{_session:o}=this,n=o?.lastPointAddedBySession;if(!n||null==n.pointIndex)return;"complete"===e&&this._context?.setGlobalState("drawAtFixedElevation",!0);const i=o.getInformationAboutPoint(0,n.partIndex),s=o.getInformationAboutPoint(n.pointIndex-1,n.partIndex),r="2d"!==this._context?.getViewInformation()?.type;if("complete"===e&&this.clickToCloseEnabled&&(n.pointIndex>2||2===n.pointIndex&&n.curveInfo)&&(f(i?.point,n.point,r)||f(s?.point,n.point,r))){!n.curveInfo&&o?.eraseLastOperation(),this._context?.requestComplete()}else"complete"===e&&this._context?.requestBeginDownstreamPlugin(t.configuration,{cancelExisting:!1})}afterUndoRedo(){const t=this._session?.lastPointAddedBySession;this._context?.setGlobalState("drawAtFixedElevation",!!t||void 0)}_getCommittedGeometry(){return this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"polygon"})}_setupGeometrySpecificTooltip(){this._context&&(this._areaField??=this._context.createMeasuredField({id:g,preset:"area",getMeasurementInput:()=>this._totalPreviewGeometry,measure:async(t,e)=>{if(!t||!r(t))return null;const o=l(t)?.at(-1);if(!o||o.length<2||!t.curveRings&&o.length<3)return null;const n=e.inputUnitInfos.area.unit;return this._context?.measureArea(t,m,"tooltip",n)},fieldProperties:{readOnly:!0,displayOrder:p.ShapeMeasurements}}))}_snapToClosingVertex(t,e){const{_session:o}=this;if("primary"!==e.handle.role||!o)return t;if(e.handle.dragging&&"capture-when-engaged"===e.handle.captureMode)return t;if(!o?.sessionIsOperatingOnSameGeometry(e.editSession))return t;const n=e.editSession?.lastPointAddedBySession;if(!n||null==n.pointIndex||n.pointIndex<2)return t;const i=o.getInformationAboutPoint(0,n.partIndex);if(!t||!i?.point)return t;const s=e.toScreen(t);if(!s)return t;const r=e.toScreen(i.point);if(!r)return t;if(d(s,r)<=u)return i.point;const l=o.getInformationAboutPoint(n.pointIndex-1,n.partIndex);if(!l?.point)return t;const a=e.toScreen(l.point);return a&&d(s,a)<=u?l.point:t}};function f(t,e,o){return t===e||null!=t&&null!=e&&t.x===e.x&&t.y===e.y&&(!o||t.z===e.z)}t([n()],y.prototype,"_areaField",void 0),t([n()],y.prototype,"_totalPreviewGeometry",null),t([n()],y.prototype,"clickToCloseEnabled",void 0),t([n()],y.prototype,"helpMessageKey",null),y=t([i("esri.views.draw.plugins.PolygonPlugin")],y);export{y as PolygonPlugin};
|
|
2
|
+
import{__decorate as t}from"tslib";import{watch as e,initial as o}from"../../../core/reactiveUtils.js";import{property as n,subclass as i}from"../../../core/accessorSupport/decorators.js";import s from"../../../geometry/Polyline.js";import{isPolygon as r}from"../../../geometry/support/typeUtils.js";import{getPaths as l}from"../../../geometry/support/curves/curveUtils.js";import{PolylinePlugin as a}from"./PolylinePlugin.js";import{knownFieldDisplayOrders as p}from"../support/types.js";import"../../../core/sql/UnknownTimeZone.js";import"../../../time/constants.js";import"../../../core/has.js";import"luxon";import"../../../intl/date.js";import"../../../rest/support/Query.js";import"../../input/InputManager.js";import"../../interactive/keybindings.js";import"../../../core/units.js";import"../../../symbols/support/unitConversionUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Logger.js";import{screenDistance as d}from"../../../core/screenUtils.js";const u=5,c=Symbol("polygon-snap-to-close-constraint"),m=Symbol("polygon-area-measurement"),g=Symbol("polygon-area-field");let y=class extends a{constructor(){super(...arguments),this._autoCloseLineVisualId=Symbol("polygon-auto-close-on-commit"),this._defaultClosingLineVisualId=Symbol("polygon-default-close-on-cancel"),this.clickToCloseEnabled=!0}get _totalPreviewGeometry(){const{_session:t}=this;if(!t)return null;const e=t.lastPointAddedBySession?.partIndex,o=this._downstreamEditSession?.lastPointAddedBySession?.partIndex,n=e??o;if(!t||null==n)return null;const i=t?.getInformationAboutPoint(0,n),s=t?.getInformationAboutPoint(-1,n);return t?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"polygon",firstIncludedPoint:i,lastIncludedPoint:s})}get helpMessageKey(){const t=this._session?.lastPointAddedBySession;return t?null!=t.pointIndex&&t.pointIndex>0?"polygonTwoVertices":"polygonOneVertex":"polygonZeroVertices"}get test(){const{_autoCloseLineVisualId:t,_defaultClosingLineVisualId:e}=this;return{_autoCloseLineVisualId:t,_defaultClosingLineVisualId:e}}start(t){super.start(t),t.createConstraint(c,(t,e)=>this._snapToClosingVertex(t,e)),t.addOrUpdateVisual(this._autoCloseLineVisualId,{role:"outline",state:"active"}),t.addOrUpdateVisual(this._defaultClosingLineVisualId,{role:"outline",state:"idle"}),this.addHandles([e(()=>this._downstreamEditSession?.lastPointAddedBySession,t=>{if(!t||null==t.pointIndex)return this._context?.addOrUpdateVisual(this._autoCloseLineVisualId,{geometry:null}),void this._context?.addOrUpdateVisual(this._defaultClosingLineVisualId,{geometry:null});const e=this._session?.getInformationAboutPoint(t.pointIndex-1,t.partIndex),o=this._session?.getInformationAboutPoint(0,t.partIndex);if(t.point&&o?.point){const e=[t.point.x,t.point.y],n=[o.point.x,o.point.y],i=new s({spatialReference:t.point.spatialReference,paths:[[e,n]]});this._context?.addOrUpdateVisual(this._autoCloseLineVisualId,{geometry:i})}else this._context?.addOrUpdateVisual(this._autoCloseLineVisualId,{geometry:null});if(e?.point&&o?.point){const t=[e.point.x,e.point.y],n=[o.point.x,o.point.y],i=new s({spatialReference:o.point.spatialReference,paths:[[t,n]]});this._context?.addOrUpdateVisual(this._defaultClosingLineVisualId,{geometry:i})}else this._context?.addOrUpdateVisual(this._defaultClosingLineVisualId,{geometry:null})},o)],this._ownHandlesKey)}detachPlugin(t,e){const{_session:o}=this,n=o?.lastPointAddedBySession;if(!n||null==n.pointIndex)return;"complete"===e&&this._context?.setGlobalState("drawAtFixedElevation",!0);const i=o.getInformationAboutPoint(0,n.partIndex),s=o.getInformationAboutPoint(n.pointIndex-1,n.partIndex),r="2d"!==this._context?.getViewInformation()?.type;if("complete"===e&&this.clickToCloseEnabled&&(n.pointIndex>2||2===n.pointIndex&&n.curveInfo)&&(f(i?.point,n.point,r)||f(s?.point,n.point,r))){!n.curveInfo&&o?.eraseLastOperation(),this._context?.requestComplete()}else"complete"===e&&this._context?.requestBeginDownstreamPlugin(t.configuration,{cancelExisting:!1})}afterUndoRedo(){const t=this._session?.lastPointAddedBySession;this._context?.setGlobalState("drawAtFixedElevation",!!t||void 0)}_getCommittedGeometry(){return this._session?.generatePreviewGeometry({includeAutomaticConnection:!1,geometryType:"polygon"})}_setupGeometrySpecificTooltip(){this._context&&(this._areaField??=this._context.createMeasuredField({id:g,preset:"area",getMeasurementInput:()=>this._totalPreviewGeometry,measure:async(t,e)=>{if(!t||!r(t))return null;const o=l(t)?.at(-1);if(!o||o.length<2||!t.curveRings&&o.length<3)return null;const n=e.inputUnitInfos.area.unit;return this._context?.measureArea(t,m,"tooltip",n)},fieldProperties:{readOnly:!0,displayOrder:p.ShapeMeasurements}}))}_snapToClosingVertex(t,e){const{_session:o}=this;if("primary"!==e.handle.role||!o)return t;if(e.handle.dragging&&"capture-when-engaged"===e.handle.captureMode)return t;if(!o?.sessionIsOperatingOnSameGeometry(e.editSession))return t;const n=e.editSession?.lastPointAddedBySession;if(!n||null==n.pointIndex||n.pointIndex<2)return t;const i=o.getInformationAboutPoint(0,n.partIndex);if(!t||!i?.point)return t;const s=e.toScreen(t);if(!s)return t;const r=e.toScreen(i.point);if(!r)return t;if(d(s,r)<=u)return i.point;const l=o.getInformationAboutPoint(n.pointIndex-1,n.partIndex);if(!l?.point)return t;const a=e.toScreen(l.point);return a&&d(s,a)<=u?l.point:t}};function f(t,e,o){return t===e||null!=t&&null!=e&&t.x===e.x&&t.y===e.y&&(!o||t.z===e.z)}t([n()],y.prototype,"_areaField",void 0),t([n()],y.prototype,"_totalPreviewGeometry",null),t([n()],y.prototype,"clickToCloseEnabled",void 0),t([n()],y.prototype,"helpMessageKey",null),y=t([i("esri.views.draw.plugins.PolygonPlugin")],y);export{y as PolygonPlugin};
|
package/webmap/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../core/Version.js";function r(e){return null!=e&&"object"==typeof e&&"declaredClass"in e&&"esri.WebMap"===e.declaredClass}const o=new e(2,
|
|
2
|
+
import e from"../core/Version.js";function r(e){return null!=e&&"object"==typeof e&&"declaredClass"in e&&"esri.WebMap"===e.declaredClass}const o=new e(2,38,"webmap");export{o as currentVersion,r as isWebMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{substitute as e}from"../../intl.js";import{equalsShallow as t}from"../../core/lang.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{isLayerWithHistoricMoment as n}from"../../layers/mixins/EditBusLayer.js";import{DomainValidationError as r}from"../../layers/support/domainUtils.js";import{NumericRangeValidationError as o,TypeValidationError as s}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as a,getSubtypesFromLayer as u}from"../../layers/support/layerUtils.js";import l from"../../rest/support/AttachmentQuery.js";import{unknown as c,utc as
|
|
2
|
+
import{substitute as e}from"../../intl.js";import{equalsShallow as t}from"../../core/lang.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{isLayerWithHistoricMoment as n}from"../../layers/mixins/EditBusLayer.js";import{DomainValidationError as r}from"../../layers/support/domainUtils.js";import{NumericRangeValidationError as o,TypeValidationError as s}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as a,getSubtypesFromLayer as u}from"../../layers/support/layerUtils.js";import l from"../../rest/support/AttachmentQuery.js";import{unknown as c,utc as p}from"../../time/constants.js";import{ReactiveGraphic as d}from"./ReactiveGraphic.js";import{MultiFeatureError as f,isMultipleChoiceFieldInput as m,FormValidationWarning as y,isGroupInput as O}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as h}from"../support/dateUtils.js";import{isEmptyValue as b,InputValidationError as E,getRangeErrorMessage as T,shouldUseScientificNotation as _,scientificNumberFormatOptions as I,numberFormatOptions as N,ContingentValuesValidationError as j}from"../support/forms/formUtils.js";const v=(e,t)=>null!=e&&e.input?.type===t;function C(e){return new d({source:e})}function A(t,i,n,a){const{dataType:u,minLength:l}=t;if(!n||!i)return null;const{validationErrors:c}=n;if(i===f.DIFFERENT_ERRORS)return c.invalidBatchFormType;if(i===E.CANNOT_BE_EMPTY)return c.cannotBeNull;if(i===r.VALUE_OUT_OF_RANGE||i===o.OUT_OF_RANGE){const{field:i,range:n}=t,r={type:"date",intlOptions:{timeZone:"date"===i.type&&a?a:void 0,...h(i)}},o=T(n,c);return e(o,n,{format:{max:"date"===u?r:null!=n.max&&_(n.max)?I:N,min:"date"===u?r:null!=n.min&&_(n.min)?I:N}})}if(i===r.INVALID_CODED_VALUE)return c.invalidCodedValue;if(i===s.INVALID_TYPE)return c.invalidType;if(i===E.TOO_SHORT)return e(c.tooShort,{min:l});if(m(t)){if(i===E.TOO_FEW_SELECTED_CHOICES)return e(c.tooFewSelectedChoices,{min:t.input.minimumChoices});if(i===E.TOO_MANY_SELECTED_CHOICES)return e(c.tooManySelectedChoices,{max:t.input.maximumChoices})}return i===E.TOO_LONG?null:i===j.CONTINGENCY_VIOLATION_WARNING||i===j.CONTINGENCY_VIOLATION_ERROR?c.valuesIncompatible:i===y.OUT_OF_SUBTYPE_DOMAIN?n.subtypes.fieldOutOfSubtypeDomainWarning:null}function V(e,t,i){const n=i?.validationErrors;if(!n)return null;let r=null;for(const o of e.invalidHiddenInputs)switch(o.effectiveVisibilityCode){case"hidden:visibility-expression:all-features":case"hidden:group-visibility-expression:all-features":case"hidden:field-definition":return"single"===t?n.nonVisibleError_changeValues:n.nonVisibleError_checkIndividualFeatures;case"hidden:no-domain-in-common":case"hidden:visibility-expression:some-features":case"hidden:group-visibility-expression:some-features":case"hidden:not-in-all-layers":r=n.nonVisibleError_checkIndividualFeatures;break;case"visible":continue;default:o.effectiveVisibilityCode}return r}function g(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"geojson"===e.type||"knowledge-graph-sublayer"===e.type||"oriented-imagery"===e.type||"scene"===e.type||"subtype-sublayer"===e.type)}function U(e){return!!g(e)||!!(null!=e&&"object"==typeof e&&"type"in e&&e.type&&"id"in e&&e.id&&"fields"in e&&e.fields&&"fieldsIndex"in e&&e.fieldsIndex&&"objectIdField"in e&&e.objectIdField&&"capabilities"in e&&"getField"in e&&e.getField)}function x(e){return U(e)&&"queryAttachments"in e}function F(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"subtype-sublayer"===e.type)}function w(e){if(!x(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!!t?.data?.supportsAttachment}async function R(e,t,r,o){const s=new Set;let u=!1;for(const i of r){if("attachment"===i.input?.type&&("any"===i.input.attachmentAssociationType||"exactOrNone"===i.input.attachmentAssociationType)){u=!0;break}if(b(i.attachmentKeyword)){u=!0;break}s.add(i.attachmentKeyword)}const c=s.size&&!u?Array.from(s):void 0,p=new l({objectIds:[t],returnMetadata:!0,keywords:c}),d=a(e)?e.parent:e;n(d)&&d.historicMoment&&(p.historicMoment=d.historicMoment);const f=await e.queryAttachments(p,{signal:o});return i(o),f[t]??[]}function S(e,i,n){const r=u(e),o=r?.find(e=>e.code===n);if(!o)return!1;const s=r?.find(e=>e.code===i);return!t(o.defaultValues,s?.defaultValues)&&Object.values(o.defaultValues).some(e=>null!=e)}function L(e){return e.reduce((e,t)=>O(t)?[...e,...t.inputs]:[...e,t],[])}function k(e){return a(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?c:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}function D(e,t){return e||t?t===c?p:e&&e!==c?e:t??"system":"system"}export{C as createReactiveGraphic,L as flattenInputs,D as getEffectiveTimeZone,V as getHiddenFieldsValidationErrorMessage,k as getLayerTimeZone,A as getMessageString,F as isAssociationsLayerUnion,U as isAttributeFormSupportedLayer,g as isAttributeFormSupportedLayerUnion,x as isAttributeFormSupportedLayerWithAttachments,v as isElementTemplateWithInputType,w as layerSupportsAttachments,R as queryAttachmentsForElements,S as subtypeChangeShouldPrompt};
|
|
@@ -4,13 +4,15 @@ import type EditableInput from "./EditableInput.js";
|
|
|
4
4
|
import type GroupInput from "./GroupInput.js";
|
|
5
5
|
import type { Input } from "../../../form/elements/inputs.js";
|
|
6
6
|
import type { FieldValue } from "../../../layers/support/fieldUtils.js";
|
|
7
|
+
import type { NumericRange } from "../../../layers/support/NumericRange.js";
|
|
7
8
|
import type { DomainUnion as Domain } from "../../../layers/support/types.js";
|
|
8
9
|
import type { EditableInputProperties } from "./EditableInput.js";
|
|
10
|
+
import type { FieldInputMessage } from "./types.js";
|
|
9
11
|
import type { InputController } from "./support/controllerUtils.js";
|
|
10
12
|
import type { MultipleChoiceOtherChoiceRenderState } from "./support/MultipleChoiceController.js";
|
|
11
13
|
import type { FieldInputDataTypes } from "../../support/forms/types.js";
|
|
12
14
|
|
|
13
|
-
export interface FieldInputProperties extends EditableInputProperties, Partial<Pick<FieldInput, "inputController">> {}
|
|
15
|
+
export interface FieldInputProperties extends EditableInputProperties, Partial<Pick<FieldInput, "inputController" | "userHasChangedValue">> {}
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* This is a read-only support class that represents a [field element](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) in a [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/).
|
|
@@ -80,6 +82,23 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
80
82
|
checked: boolean;
|
|
81
83
|
indeterminate: boolean;
|
|
82
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* The value to show as the placeholder text for an input accepting text
|
|
87
|
+
* entry. Corresponds to the [hint](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/#hint)
|
|
88
|
+
* property of the corresponding
|
|
89
|
+
* [field element](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/).
|
|
90
|
+
*
|
|
91
|
+
* @since 5.2
|
|
92
|
+
*/
|
|
93
|
+
get placeholder(): string | null;
|
|
94
|
+
/**
|
|
95
|
+
* Applicable to number and date inputs. This property limits the maximum and minimum range. In addition, date field ranges are expressed as unix timestamps.
|
|
96
|
+
* It reflects the range set via the form's template for dates, although if there is a field domain on it, the field domain takes priority, ie.
|
|
97
|
+
* it will take the largest min and smallest max between field domain range and form template min/max.
|
|
98
|
+
*
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
get range(): NumericRange;
|
|
83
102
|
/** Indicates whether the field is required. This property will be true if it is required for any associated layers of the input. */
|
|
84
103
|
get required(): boolean;
|
|
85
104
|
/**
|
|
@@ -110,9 +129,31 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
110
129
|
*
|
|
111
130
|
* @default false
|
|
112
131
|
*/
|
|
113
|
-
|
|
132
|
+
accessor userHasChangedValue: boolean;
|
|
114
133
|
/** Indicates whether the field has any validation errors. Evaluates to `true` only if the value of this field is valid for all features. */
|
|
115
134
|
get valid(): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* A validation message to be displayed for this field. It may be either a
|
|
137
|
+
* warning or an error.
|
|
138
|
+
*
|
|
139
|
+
* Use this in conjunction with the [@link
|
|
140
|
+
* widgets/BatchAttributeForm/inputs/FieldInput#status] property. If `status`
|
|
141
|
+
* is `"invalid"`, then this message should be presented as an error. If
|
|
142
|
+
* `status` is `"idle"`, then this message should be presented as a warning.
|
|
143
|
+
*
|
|
144
|
+
* This property will be `null` until the user has interacted with the input.
|
|
145
|
+
*
|
|
146
|
+
* @see [@link widgets/BatchAttributeForm/inputs/FieldInput#touched]
|
|
147
|
+
* @see [@link widgets/BatchAttributeForm/inputs/FieldInput#userInvalid]
|
|
148
|
+
* @internal
|
|
149
|
+
*/
|
|
150
|
+
get validationMessage(): FieldInputMessage | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* The field input's value.
|
|
153
|
+
*
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
get value(): FieldValue;
|
|
116
157
|
/**
|
|
117
158
|
* Returns the explicit inline other-choice checked state, if one has been stored.
|
|
118
159
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{property as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import{isDynamicChoiceInput as l,isMultipleChoiceInput as o}from"../../../form/elements/inputs/inputUtils.js";import a from"../../../layers/support/CodedValue.js";import s from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as u,validateDomainValue as p,dateTimeFieldValuesToNumericRange as d,isDomainValidForField as m}from"../../../layers/support/domainUtils.js";import{getFieldRange as h,isDateOnlyField as c,isTimeOnlyField as f,isTimestampOffsetField as y}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as g}from"../../../layers/support/layerUtils.js";import v from"../../../layers/support/RangeDomain.js";import{isNumber as x}from"../../../support/guards.js";import b from"./EditableInput.js";import{isMultipleChoiceController as C}from"./support/controllerUtils.js";import V from"./support/DynamicChoiceController.js";import{getFieldInputDataType as F,visibilityCodeToBoolean as E,isFieldInputWithShowNoValueOptionInput as _,isWarning as M,isContingentValuesError as w,differentValuesString as D}from"./support/inputUtils.js";import O from"./support/MultipleChoiceController.js";import{otherChoiceCheckedPlaceholderValue as S}from"./support/multipleChoiceInputUtils.js";import{timeResolutionToStepMap as k}from"../../support/dateUtils.js";import{valuesAreEquivalent as T,getMaxLength as R,getMinLength as N,dateIsValid as L,validateFormValue as j}from"../../support/forms/formUtils.js";let A=class extends b{constructor(e){super(e),this.getExternalErrorForFeature=null,this.getFieldValueOptionsForFeature=null,this.group=null,this.inputController=null,this.touched=!1,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}destroy(){this.inputController=i(this.inputController)}initialize(){this.input&&(l(this.input)&&(this.inputController=new V({fieldInput:this})),o(this.input)&&(this.inputController=new O({fieldInput:this})))}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){return F(this.field)}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const{label:e}=this.template,t=this._computeStringLiteralText(e);if(t)return t;const{field:i,layers:r}=this;if(1===r.length){const e=r[0];if(g(e)){const t=e.getFieldAlias(i.name);if(null!=t&&""!==t)return t}}return i.alias||i.name}get effectiveVisible(){return E(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>T(i.getAttribute(e),t))}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!_(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return _(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get inputType(){return this.input?.type}get maxLength(){return R({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return N({dataType:this.dataType,field:this.field,input:this.input})}get multipleChoiceOtherChoiceCheckboxState(){return q(this.inputController)?.otherChoiceCheckboxState??{checked:!1,indeterminate:!1}}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=u(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?h(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get status(){const{validationMessage:e}=this;return e?M(e)?"idle":"invalid":this.valid?"valid":"idle"}get timeResolution(){const e=this.input;if(e&&("timestampoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?k.get(this.timeResolution):void 0}get userInvalid(){return!!this.errors.some(({error:e})=>w(e))||!this.valid&&this.touched}get valid(){return 0===this.errors.length||!this.editable}get validationMessage(){return this.valueIsOutOfDomain&&this.touched?"batch-attribute-form-validation::out-of-subtype-domain":this.userInvalid?this.compositeError:null}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:D}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==p(i,t,e)}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}getExplicitMultipleChoiceOtherChoiceCheckedState(){return q(this.inputController)?.getExplicitOtherChoiceCheckedState()}getMultipleChoiceOtherChoiceRenderState(e){const t=q(this.inputController)?.otherChoiceRenderState;return t?{...t,label:t.label??e}:{fieldName:void 0,hint:"",label:e,shouldShow:!1,checkboxState:{checked:!1,indeterminate:!1},value:null,normalizedValue:null,maxLength:void 0,status:"idle"}}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return q(this.inputController)?.hasExplicitOtherChoiceCheckedState()??!1}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){q(this.inputController)?.initializeExplicitOtherChoiceCheckedState()}setExplicitMultipleChoiceOtherChoiceCheckedState(e){q(this.inputController)?.setExplicitOtherChoiceCheckedState(e)}get codedValueOptions(){const{getFieldValueOptionsForFeature:e}=this;if(1===this.features.length&&e){const t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer})}const t=this.codedValueDomainOptions,{value:i}=this,r=null==i||i===D||t.some(e=>e.value===i)?[]:[{name:`${i}`,value:i}];return{recommended:t,other:[],unsupported:r,containsEmptyOption:!1}}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const r of this.features){if(null==i.getExpressionExecutorsForLayer(r.layer)?.requiredExpression)continue;t=!1;const n=this._lookupEvaluatedExpression(r,"requiredExpression");"success"===n?.status?e=e||!0===n.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=d(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:r}=e;i={max:null!=t&&L(t)?t.getTime():null,min:null!=r&&L(r)?r.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:r}=this;if("date"!==this.dataType)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;const n=u(i,r);if(!n)return e;const{max:l,min:o,rawMax:a,rawMin:s}=e,{type:p}=t.field;if("date"===p){const{max:e,min:t}=n;return{max:x(l)&&(null===e||null!=e&&l<=e)?l:e??null,min:x(o)&&(null===t||null!=t&&o>=t)?o:t??null}}if("date-only"===p||"time-only"===p||"timestamp-offset"===p){const{max:e,min:t,rawMax:i,rawMin:r}=n,u=x(l)&&a&&(null==e||l<e),p=x(o)&&s&&(null==t||o>t);return{max:u?l:e,min:p?o:t,rawMax:u?a:i,rawMin:p?s:r}}return{}}touch(){this.touched=!0}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:r,range:n}=this,l=[],o=C(this.inputController)?this.inputController:void 0,a=o?.input;for(const s of this.features){const{layer:u}=s,p=u.getField(t)??this.field,d=u.getFieldDomain(t,{feature:s.plainGraphic}),m=this.calculateDomain([d]),h=m&&"coded-value"!==m.type?m:null,c=this._requiredForFeature(s),f=s.getAttribute(t);let y=j(f,{dataType:e,domain:h,field:p,maxLength:i,minLength:r,multipleChoice:a,range:n,required:c})??this.getExternalErrorForFeature?.(s,t);if(!y&&a&&o){const{otherChoice:e}=a,t=o.otherChoiceFieldName,i=o.shouldShowOtherChoice,r=o.otherChoiceEffectiveCheckboxState;if(i&&e&&t&&r.checked){const e=u.getField(t),i=s.getAttribute(t),r=i===S?null:i;if(e){const t=F(e);y=j(r,{dataType:t,domain:e.domain,field:e,maxLength:R({dataType:t,field:e,input:null}),minLength:N({dataType:t,field:e,input:null}),multipleChoice:null,range:{max:void 0,min:void 0},required:!0})}}}y&&l.push({error:y,feature:s.source})}return l}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editableExpression");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibilityExpression");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"requiredExpression");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&m(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let r=null;switch(t?.type){case"range":r=this._intersectRangeDomains(e);break;case"coded-value":r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const l of e)for(const[e,i]of t){l.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let r=t;if(i){r=new Map;for(const[e,n]of i)t.has(e)&&r.set(e,n)}const n=Array.from(r.entries()).map(([e,t])=>new a({code:e,name:t}));return n.length?new s({codedValues:n}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let r=1;r<e.length;r++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[r])}if(t&&!m(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof v){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:r}=this;return c(r)||f(r)||y(r)?d(r,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new v,r=this._getMinMaxFromRangeDomain(e),n=this._getMinMaxFromRangeDomain(t),{field:l}=this,o=this._getValidRangeValue(r.min,-1/0),a=this._getValidRangeValue(r.max,1/0),s=this._getValidRangeValue(n.min,-1/0),u=this._getValidRangeValue(n.max,1/0);return i.minValue=Math.max(o,s),i.maxValue=Math.min(a,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((c(l)||f(l)||y(l))&&(i.minValue=Number(r.min)>Number(n.min)?r.rawMin:n.rawMin,i.maxValue=Number(r.max)<Number(n.max)?r.rawMax:n.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return x(e)?e:t}};e([r()],A.prototype,"dataType",null),e([r()],A.prototype,"domain",null),e([r()],A.prototype,"distinctValues",null),e([r()],A.prototype,"editable",null),e([r()],A.prototype,"label",null),e([r()],A.prototype,"effectiveVisible",null),e([r()],A.prototype,"effectiveVisibilityCode",null),e([r()],A.prototype,"errors",null),e([r()],A.prototype,"featuresHaveSameValue",null),e([r()],A.prototype,"field",null),e([r()],A.prototype,"fieldName",null),e([r()],A.prototype,"getExternalErrorForFeature",void 0),e([r()],A.prototype,"getFieldValueOptionsForFeature",void 0),e([r()],A.prototype,"group",void 0),e([r()],A.prototype,"input",null),e([r()],A.prototype,"inputController",void 0),e([r()],A.prototype,"invalidFeatures",null),e([r()],A.prototype,"isSubtypeField",null),e([r()],A.prototype,"showNoValueOptionEnabled",null),e([r()],A.prototype,"showNoValueLabel",null),e([r()],A.prototype,"includeTime",null),e([r()],A.prototype,"includeTimeOffset",null),e([r({readOnly:!0})],A.prototype,"inputType",null),e([r()],A.prototype,"maxLength",null),e([r()],A.prototype,"minLength",null),e([r()],A.prototype,"multipleChoiceOtherChoiceCheckboxState",null),e([r()],A.prototype,"range",null),e([r()],A.prototype,"required",null),e([r()],A.prototype,"status",null),e([r()],A.prototype,"timeResolution",null),e([r()],A.prototype,"timeStep",null),e([r()],A.prototype,"touched",void 0),e([r({readOnly:!0})],A.prototype,"type",void 0),e([r()],A.prototype,"userHasChangedValue",void 0),e([r()],A.prototype,"userInvalid",null),e([r()],A.prototype,"valid",null),e([r()],A.prototype,"validationMessage",null),e([r()],A.prototype,"value",null),e([r()],A.prototype,"valueIsOutOfDomain",null),e([r()],A.prototype,"visibilityCode",null),e([r()],A.prototype,"codedValueDomainOptions",null),e([r()],A.prototype,"codedValueOptions",null),e([r()],A.prototype,"_evaluatedRequiredExpression",null),e([r()],A.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([r()],A.prototype,"_allDomains",null),e([r()],A.prototype,"_fieldShouldHaveDomain",null),e([r()],A.prototype,"_dateFormRange",null),e([r()],A.prototype,"_dateRange",null),A=e([n("esri.widgets.BatchAttributeForm.inputs.FieldInput")],A);const I=A;function q(e){return C(e)?e:null}export{I as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{property as r,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isDynamicChoiceInput as n,isMultipleChoiceInput as o}from"../../../form/elements/inputs/inputUtils.js";import s from"../../../layers/support/CodedValue.js";import a from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as u,validateDomainValue as p,dateTimeFieldValuesToNumericRange as d,isDomainValidForField as h}from"../../../layers/support/domainUtils.js";import{getFieldRange as m,isDateOnlyField as c,isTimeOnlyField as f,isTimestampOffsetField as y}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as g}from"../../../layers/support/layerUtils.js";import x from"../../../layers/support/RangeDomain.js";import{isNumber as v}from"../../../support/guards.js";import b from"./EditableInput.js";import{isMultipleChoiceController as C}from"./support/controllerUtils.js";import V from"./support/DynamicChoiceController.js";import{MultiFeatureError as E,getFieldInputDataType as F,visibilityCodeToBoolean as _,isFieldInputWithShowNoValueOptionInput as M,isWarning as O,isContingentValuesError as D,FormValidationWarning as w,differentValuesString as S}from"./support/inputUtils.js";import R from"./support/MultipleChoiceController.js";import{otherChoiceCheckedPlaceholderValue as T}from"./support/multipleChoiceInputUtils.js";import{timeResolutionToStepMap as k}from"../../support/dateUtils.js";import{valuesAreEquivalent as N,getMaxLength as L,getMinLength as j,dateIsValid as I,validateFormValue as A}from"../../support/forms/formUtils.js";let q=class extends b{constructor(e){super(e),this.getExternalErrorForFeature=null,this.getFieldValueOptionsForFeature=null,this.group=null,this.inputController=null,this.touched=!1,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}destroy(){this.inputController=i(this.inputController)}initialize(){this.input&&(n(this.input)&&(this.inputController=new V({fieldInput:this})),o(this.input)&&(this.inputController=new R({fieldInput:this})))}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return E.DIFFERENT_ERRORS;const t=e[0];for(const i of e)if(i.error!==t.error)return E.DIFFERENT_ERRORS;return t.error}get dataType(){return F(this.field)}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const{label:e}=this.template,t=this._computeStringLiteralText(e);if(t)return t;const{field:i,layers:r}=this;if(1===r.length){const e=r[0];if(g(e)){const t=e.getFieldAlias(i.name);if(null!=t&&""!==t)return t}}return i.alias||i.name}get effectiveVisible(){return _(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>N(i.getAttribute(e),t))}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!M(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return M(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get inputType(){return this.input?.type}get maxLength(){return L({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return j({dataType:this.dataType,field:this.field,input:this.input})}get multipleChoiceOtherChoiceCheckboxState(){return H(this.inputController)?.otherChoiceCheckboxState??{checked:!1,indeterminate:!1}}get placeholder(){return this.template.hint}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=u(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?m(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get status(){const{validationMessage:e}=this;return e?O(e)?"idle":"invalid":this.valid?"valid":"idle"}get timeResolution(){const e=this.input;if(e&&("timestampoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?k.get(this.timeResolution):void 0}get userInvalid(){return!!this.errors.some(({error:e})=>D(e))||!this.valid&&this.touched}get valid(){return 0===this.errors.length||!this.editable}get validationMessage(){return this.valueIsOutOfDomain&&this.touched?w.OUT_OF_SUBTYPE_DOMAIN:this.userInvalid?this.compositeError??void 0:void 0}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:S}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==p(i,t,e)}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}getExplicitMultipleChoiceOtherChoiceCheckedState(){return H(this.inputController)?.getExplicitOtherChoiceCheckedState()}getMultipleChoiceOtherChoiceRenderState(e){const t=H(this.inputController)?.otherChoiceRenderState;return t?{...t,label:t.label??e}:{fieldName:void 0,hint:"",label:e,shouldShow:!1,checkboxState:{checked:!1,indeterminate:!1},value:null,normalizedValue:null,maxLength:void 0,status:"idle"}}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return H(this.inputController)?.hasExplicitOtherChoiceCheckedState()??!1}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){H(this.inputController)?.initializeExplicitOtherChoiceCheckedState()}setExplicitMultipleChoiceOtherChoiceCheckedState(e){H(this.inputController)?.setExplicitOtherChoiceCheckedState(e)}get codedValueOptions(){const{getFieldValueOptionsForFeature:e}=this;if(1===this.features.length&&e){const t=this.features.at(0);return e({domain:this.domain??void 0,feature:t,fieldName:this.fieldName,layer:t.layer})}const t=this.codedValueDomainOptions,{value:i}=this,r=null==i||i===S||t.some(e=>e.value===i)?[]:[{name:`${i}`,value:i}];return{recommended:t,other:[],unsupported:r,containsEmptyOption:!1}}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const r of this.features){if(null==i.getExpressionExecutorsForLayer(r.layer)?.requiredExpression)continue;t=!1;const l=this._lookupEvaluatedExpression(r,"requiredExpression");"success"===l?.status?e=e||!0===l.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=d(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:r}=e;i={max:null!=t&&I(t)?t.getTime():null,min:null!=r&&I(r)?r.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:r}=this;if("date"!==this.dataType)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;const l=u(i,r);if(!l)return e;const{max:n,min:o,rawMax:s,rawMin:a}=e,{type:p}=t.field;if("date"===p){const{max:e,min:t}=l;return{max:v(n)&&(null===e||null!=e&&n<=e)?n:e??null,min:v(o)&&(null===t||null!=t&&o>=t)?o:t??null}}if("date-only"===p||"time-only"===p||"timestamp-offset"===p){const{max:e,min:t,rawMax:i,rawMin:r}=l,u=v(n)&&s&&(null==e||n<e),p=v(o)&&a&&(null==t||o>t);return{max:u?n:e,min:p?o:t,rawMax:u?s:i,rawMin:p?a:r}}return{}}touch(){this.touched=!0}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:r,range:l}=this,n=[],o=C(this.inputController)?this.inputController:void 0,s=o?.input;for(const a of this.features){const{layer:u}=a,p=u.getField(t)??this.field,d=u.getFieldDomain(t,{feature:a.plainGraphic}),h=this.calculateDomain([d]),m=h&&"coded-value"!==h.type?h:null,c=this._requiredForFeature(a),f=a.getAttribute(t);let y=A(f,{dataType:e,domain:m,field:p,maxLength:i,minLength:r,multipleChoice:s,range:l,required:c})??this.getExternalErrorForFeature?.(a,t);if(!y&&s&&o){const{otherChoice:e}=s,t=o.otherChoiceFieldName,i=o.shouldShowOtherChoice,r=o.otherChoiceEffectiveCheckboxState;if(i&&e&&t&&r.checked){const e=u.getField(t),i=a.getAttribute(t),r=i===T?null:i;if(e){const t=F(e);y=A(r,{dataType:t,domain:e.domain,field:e,maxLength:L({dataType:t,field:e,input:null}),minLength:j({dataType:t,field:e,input:null}),multipleChoice:null,range:{max:void 0,min:void 0},required:!0})}}}y&&n.push({error:y,feature:a.source})}return n}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editableExpression");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibilityExpression");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"requiredExpression");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&h(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let r=null;switch(t?.type){case"range":r=this._intersectRangeDomains(e);break;case"coded-value":r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const n of e)for(const[e,i]of t){n.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let r=t;if(i){r=new Map;for(const[e,l]of i)t.has(e)&&r.set(e,l)}const l=Array.from(r.entries()).map(([e,t])=>new s({code:e,name:t}));return l.length?new a({codedValues:l}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let r=1;r<e.length;r++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[r])}if(t&&!h(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof x){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:r}=this;return c(r)||f(r)||y(r)?d(r,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new x,r=this._getMinMaxFromRangeDomain(e),l=this._getMinMaxFromRangeDomain(t),{field:n}=this,o=this._getValidRangeValue(r.min,-1/0),s=this._getValidRangeValue(r.max,1/0),a=this._getValidRangeValue(l.min,-1/0),u=this._getValidRangeValue(l.max,1/0);return i.minValue=Math.max(o,a),i.maxValue=Math.min(s,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((c(n)||f(n)||y(n))&&(i.minValue=Number(r.min)>Number(l.min)?r.rawMin:l.rawMin,i.maxValue=Number(r.max)<Number(l.max)?r.rawMax:l.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return v(e)?e:t}};e([r()],q.prototype,"dataType",null),e([r()],q.prototype,"domain",null),e([r()],q.prototype,"distinctValues",null),e([r()],q.prototype,"editable",null),e([r()],q.prototype,"label",null),e([r()],q.prototype,"effectiveVisible",null),e([r()],q.prototype,"effectiveVisibilityCode",null),e([r()],q.prototype,"errors",null),e([r()],q.prototype,"featuresHaveSameValue",null),e([r()],q.prototype,"field",null),e([r()],q.prototype,"fieldName",null),e([r()],q.prototype,"getExternalErrorForFeature",void 0),e([r()],q.prototype,"getFieldValueOptionsForFeature",void 0),e([r()],q.prototype,"group",void 0),e([r()],q.prototype,"input",null),e([r()],q.prototype,"inputController",void 0),e([r()],q.prototype,"invalidFeatures",null),e([r()],q.prototype,"isSubtypeField",null),e([r()],q.prototype,"showNoValueOptionEnabled",null),e([r()],q.prototype,"showNoValueLabel",null),e([r()],q.prototype,"includeTime",null),e([r()],q.prototype,"includeTimeOffset",null),e([r({readOnly:!0})],q.prototype,"inputType",null),e([r()],q.prototype,"maxLength",null),e([r()],q.prototype,"minLength",null),e([r()],q.prototype,"multipleChoiceOtherChoiceCheckboxState",null),e([r()],q.prototype,"placeholder",null),e([r()],q.prototype,"range",null),e([r()],q.prototype,"required",null),e([r()],q.prototype,"status",null),e([r()],q.prototype,"timeResolution",null),e([r()],q.prototype,"timeStep",null),e([r()],q.prototype,"touched",void 0),e([r({readOnly:!0})],q.prototype,"type",void 0),e([r()],q.prototype,"userHasChangedValue",void 0),e([r()],q.prototype,"userInvalid",null),e([r()],q.prototype,"valid",null),e([r()],q.prototype,"validationMessage",null),e([r()],q.prototype,"value",null),e([r()],q.prototype,"valueIsOutOfDomain",null),e([r()],q.prototype,"visibilityCode",null),e([r()],q.prototype,"codedValueDomainOptions",null),e([r()],q.prototype,"codedValueOptions",null),e([r()],q.prototype,"_evaluatedRequiredExpression",null),e([r()],q.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([r()],q.prototype,"_allDomains",null),e([r()],q.prototype,"_fieldShouldHaveDomain",null),e([r()],q.prototype,"_dateFormRange",null),e([r()],q.prototype,"_dateRange",null),q=e([l("esri.widgets.BatchAttributeForm.inputs.FieldInput")],q);const U=q;function H(e){return C(e)?e:null}export{U as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returned by the `value` getter of a `FieldInput` whose features have
|
|
3
|
+
* different values for the field
|
|
4
|
+
*/
|
|
5
|
+
export const differentValuesString: "esri_BatchAttributeForm_different_values";
|
|
6
|
+
|
|
7
|
+
/** @internal */
|
|
8
|
+
export type MultiFeatureError = "batch-attribute-form-validation::features-have-different-errors";
|
|
9
|
+
|
|
10
|
+
/** @internal */
|
|
11
|
+
export type FormValidationWarning = "batch-attribute-form-validation::out-of-subtype-domain";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isNumericField as t,isStringField as n,isTimeOnlyField as r}from"../../../../layers/support/fieldUtils.js";import{isAnyDateField as e}from"../../../../smartMapping/support/utils.js";import{ContingentValuesValidationError as
|
|
2
|
+
import{isNumericField as t,isStringField as n,isTimeOnlyField as r}from"../../../../layers/support/fieldUtils.js";import{isAnyDateField as e}from"../../../../smartMapping/support/utils.js";import{ContingentValuesValidationError as o}from"../../../support/forms/formUtils.js";const u="esri_BatchAttributeForm_different_values",i={DIFFERENT_ERRORS:"batch-attribute-form-validation::features-have-different-errors"},s={OUT_OF_SUBTYPE_DOMAIN:"batch-attribute-form-validation::out-of-subtype-domain"};function f(t){return"visible"===t}function c(t){return t===s.OUT_OF_SUBTYPE_DOMAIN}function p(t){return"field"===t.type}function a(t){return p(t)&&"multiple-choice"===t.input?.type}function l(t){return"group"===t.type}function m(t){return"relationship"===t.type}function d(t){return"text"===t.type}function N(t){return"attachment"===t.type}function O(t){return p(t)||N(t)||m(t)||I(t)}function _(t){return p(t)||N(t)||m(t)||I(t)||d(t)}function y(t){return _(t)&&null!=t.group}function I(t){return"utilityNetworkAssociations"===t.type}function b(t){const n=`${t.elementId}:${t.executorPurpose}`;return null!=t.textExpressionIndex?`${n}:${t.textExpressionIndex}`:n}const x=t=>null!=t&&(E(t,"combo-box")||E(t,"dynamic-choice")||E(t,"radio-buttons"));function E(t,n){return t?.type===n}function h(t,n,r=[]){for(const e of t)n(e)?r.push(e):l(e)&&h(e.inputs,n,r);return r}function T(t,n){return t.layers[0]?.getField(n)?.name??n}function R(o){return t(o)?"number":n(o)?"text":e(o)||r(o)?"date":"unsupported"}function A(t){return t===o.CONTINGENCY_VIOLATION_ERROR||t===o.CONTINGENCY_VIOLATION_WARNING}export{s as FormValidationWarning,i as MultiFeatureError,h as deepFilterInputs,u as differentValuesString,R as getFieldInputDataType,T as getNormalizedFieldName,N as isAttachmentElementInput,A as isContingentValuesError,O as isEditableInput,p as isFieldInput,x as isFieldInputWithShowNoValueOptionInput,l as isGroupInput,_ as isGroupableInput,y as isGroupedInput,E as isInputWithInputType,a as isMultipleChoiceFieldInput,m as isRelationshipElementInput,d as isTextElementInput,I as isUtilityNetworkAssociationsElementInput,c as isWarning,b as makeUseId,f as visibilityCodeToBoolean};
|
|
@@ -4,6 +4,8 @@ import type GroupInput from "./GroupInput.js";
|
|
|
4
4
|
import type RelationshipElementInput from "./RelationshipElementInput.js";
|
|
5
5
|
import type TextElementInput from "./TextElementInput.js";
|
|
6
6
|
import type UtilityNetworkAssociationsElementInput from "./UtilityNetworkAssociationsElementInput.js";
|
|
7
|
+
import type { FormValidationWarning, MultiFeatureError } from "./support/inputUtils.js";
|
|
8
|
+
import type { FormValidationError } from "../../support/forms/types.js";
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Input types that can be nested within a [group input](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/inputs/GroupInput/). This includes
|
|
@@ -24,6 +26,12 @@ export type GroupableInput = FieldInput | RelationshipElementInput | AttachmentE
|
|
|
24
26
|
*/
|
|
25
27
|
export type FormInput = GroupInput | FieldInput | RelationshipElementInput | AttachmentElementInput | TextElementInput | UtilityNetworkAssociationsElementInput;
|
|
26
28
|
|
|
29
|
+
/** @internal */
|
|
30
|
+
export type FieldInputError = FormValidationError | MultiFeatureError;
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type FieldInputMessage = FieldInputError | FormValidationWarning;
|
|
34
|
+
|
|
27
35
|
/**
|
|
28
36
|
* Information about edits made to existing attachments.
|
|
29
37
|
*
|