@arcgis/core 5.1.0-next.101 → 5.1.0-next.102
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/arcgisGlobal.d.ts +1449 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{99f726f05cf80b0330ed.js → 119b84f5349f90d1dd28.js} +1 -1
- package/assets/esri/core/workers/chunks/15167eeb6d7dbe7e392d.js +1 -0
- package/assets/esri/core/workers/chunks/{156efa014b6edd9ccce9.js → 1ba37706e5d5eaabcb8e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7bb17d0ab1cc2b89c035.js → 1faa8a42d5a437fc40a3.js} +1 -1
- package/assets/esri/core/workers/chunks/{38b1d2ffcc318ac0119d.js → 48fcc10768d93e95a04e.js} +1 -1
- package/assets/esri/core/workers/chunks/{53bf9b0c2b8da12820ea.js → 55ccb8ed7325efb62091.js} +2 -2
- package/assets/esri/core/workers/chunks/{17de1c251242b692cf45.js → 5663df3cd1dfd4b43c73.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b07f3253403fe25ce5b.js → 5bc299f7f89a07a6e6a6.js} +1 -1
- package/assets/esri/core/workers/chunks/{00a25dd4b057cc9f2a7e.js → 6f96ce41c47cae82e687.js} +1 -1
- package/assets/esri/core/workers/chunks/{657268b3fde6da2dd735.js → 86bff154d46f8a562887.js} +1 -1
- package/assets/esri/core/workers/chunks/{22fa4aa2b76573bafe21.js → 9e7c84a3a2abec4d49df.js} +1 -1
- package/assets/esri/core/workers/chunks/{40ffb1aa17cbfae17b23.js → bb5512ecb5300d45d46b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8c4fb66c733ab2f66d3.js → bb81da98546c4d923e0d.js} +1 -1
- package/assets/esri/core/workers/chunks/{a58662698c69190a12d8.js → de25311b6d13bf1c6089.js} +2 -2
- package/assets/esri/core/workers/chunks/{bafe489e54f34d1841e6.js → e86c073f0b6d395c7a38.js} +1 -1
- package/assets/esri/core/workers/chunks/f5bd0a4f82df5e942b70.js +1 -0
- package/assets/esri/core/workers/chunks/{48a0e7a32ebd44045c8f.js → fa38dc5010f8630a80fe.js} +1 -1
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +125 -0
- package/assets/esri/themes/base/widgets/_Directions.scss +5 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/VideoPlayer/t9n/VideoPlayer.json +1 -1
- package/config.js +1 -1
- package/form/elements/inputs/MultipleChoiceInput.d.ts +5 -5
- package/form/elements/inputs/MultipleChoiceInput.js +1 -1
- package/interfaces.d.ts +3 -0
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +29 -39
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/OrientedImageryLayer.d.ts +233 -0
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/VideoLayer.d.ts +35 -9
- package/layers/VideoLayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +147 -0
- package/layers/support/FeatureReductionBinning.d.ts +87 -9
- package/layers/support/FeatureReductionCluster.d.ts +87 -9
- package/layers/support/FieldConfiguration.d.ts +1 -1
- package/layers/support/SubtypeSublayer.d.ts +147 -0
- package/layers/support/TelemetryData.d.ts +5 -0
- package/layers/support/TelemetryData.js +1 -1
- package/layers/support/TelemetryDisplay.d.ts +10 -2
- package/layers/support/TelemetryDisplay.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/video/types.d.ts +8 -1
- package/layers/video/videoUtils.js +1 -1
- package/package.json +2 -2
- package/portal/jsonTypes.d.ts +7 -0
- package/rest/print.js +1 -1
- package/rest/support/PrintParameters.d.ts +8 -1
- package/rest/support/PrintParameters.js +1 -1
- package/support/revision.js +1 -1
- package/third-party-notices.txt +4 -0
- package/views/2d/engine/webgl/shaderGraph/graph/GlslGraphWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/surface.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
- package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
- package/views/Viewport2DBaseMixin.js +1 -1
- package/widgets/Attachments/support/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +8 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +2 -0
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +7 -0
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.d.ts +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/types.js +1 -1
- package/widgets/OrientedImageryViewer/videoViewerUtils.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +9 -0
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/assets/esri/core/workers/chunks/43cc82373be791b7cb4c.js +0 -1
- package/assets/esri/core/workers/chunks/c9461568e1002ebac534.js +0 -1
- /package/assets/esri/core/workers/chunks/{53bf9b0c2b8da12820ea.js.LICENSE.txt → 55ccb8ed7325efb62091.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{a58662698c69190a12d8.js.LICENSE.txt → de25311b6d13bf1c6089.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{prefersRTL as t,substitute as i}from"../intl.js";import{prefersReducedMotion as a}from"../core/a11yUtils.js";import{createTask as s}from"../core/asyncUtils.js";import o from"../core/Collection.js";import{deprecateWidget as n,deprecatedProperty as r}from"../core/deprecate.js";import l from"../core/Logger.js";import{isAbortError as d}from"../core/promiseUtils.js";import{watch as c,initial as g,syncAndInitial as h,on as m,sync as u}from"../core/reactiveUtils.js";import{throttle as p}from"../core/throttle.js";import{property as v,subclass as y}from"../core/accessorSupport/decorators.js";import{or as _}from"../layers/orientedImagery/transformations/utils.js";import w from"./Expand.js";import T from"./PanoramicVideoViewer.js";import b from"./PanoramicViewer.js";import M from"./Widget.js";import{getAllArcPath as C}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as I,defaultImageGeometryField as f,defaultOIObjectIDField as S,segmentArcs as A,featureCircleRadius as k,navigationToolDimensionLength as L,sectorsRadii as V}from"./OrientedImageryViewer/constants.js";import{css as E,navigation as O,navigationToolRotationFrom as F,navigationToolRotationTo as x,root as P}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as G,loadImageForAttachment as N,getThumbnailPixelBlock as D,renderImageWithRotation as H}from"./OrientedImageryViewer/galleryUtils.js";import j from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import $ from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as B,Alert as q}from"./OrientedImageryViewer/components/Alert.js";import W from"./OrientedImageryViewer/components/ImageLocationWidget.js";import U from"./OrientedImageryViewer/components/ImageViewer.js";import R from"./OrientedImageryViewer/components/NavigationUI.js";import Z from"./OrientedImageryViewer/components/NavigationUI360.js";import{SequentialNavigationUI as z}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import{loadVideoEnhancementComponents as J,renderEnhancementSlider as K,VideoEnhancementTools as Q}from"./OrientedImageryViewer/components/VideoEnhancementTools.js";import{NoImageLoadedError as X}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as Y}from"./support/componentsUtils.js";import{globalCss as ee}from"./support/globalCss.js";import{vmEvent as te,messageBundle as ie,tsx as ae}from"./support/widget.js";const se={overlayed:"overlayed"};let oe=class extends M{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new j,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.selectedGroup=null,this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new $,this._superimposeZOffset=0,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._navigationTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.triangularMeasurementActive=!1,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1,this.triangularMeasurementActive=!1},this._createNavigationTask=async e=>(this._navigationTask?.abort(),this._navigationTask=s(async t=>await this.navigate({...e,signal:t})),this._navigationTask.promise),this._navigateNext=async()=>await this._createNavigationTask({step:1}),this._navigatePrevious=async()=>await this._createNavigationTask({step:-1}),this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new o,this._previousAction=null,this._closeImageSequenceAlert=()=>{this._set("noImageInSequenceError",!1)},this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(c(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible,this.showMapFeatures)}),`${se.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,n="select-feature"===s,r=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&_(n,o&&r)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=e=>{e.stopPropagation(),this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map(e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:s}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===s||"both"===s,i="pitch"===s||"both"===s,{messages:a,messagesCommon:o}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:o.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new w({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=p(this.viewModel.toggleImageAttributes.bind(this.viewModel)),this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new X;t=await this.viewModel.navigate(i,e)}catch(i){d(i)||l.getLogger(this).error("Error occurred while navigating",i),["NoImageInSequenceError","NoSequenceFoundError"].includes(i.name)&&this._set("noImageInSequenceError",!0)}return t},this.reset=()=>{this._closeAllImageTools(),this.viewModel.reset()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this._handleVideoBrightnessChange=this._handleVideoBrightnessChange.bind(this),this._handleVideoContrastChange=this._handleVideoContrastChange.bind(this),this._handleBrightnessChange=this._handleBrightnessChange.bind(this),this._handleContrastChange=this._handleContrastChange.bind(this),this._handleSharpnessChange=this._handleSharpnessChange.bind(this),this._handleSuperimposeZOffsetChange=this._handleSuperimposeZOffsetChange.bind(this),this._toggleSuperimposeCameraLock=this._toggleSuperimposeCameraLock.bind(this),this._resetSuperimposeOffset=this._resetSuperimposeOffset.bind(this),this._resetVideoTools=this._resetVideoTools.bind(this),this._toggleEnhancementToolState=this._toggleEnhancementToolState.bind(this),this.announceDeprecation=()=>{n(l.getLogger(this),"Oriented Imagery Viewer","arcgis-oriented-imagery-viewer",{version:"5.0"})}}initialize(){this.addHandles([c(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},g),c(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),c(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),c(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),c(()=>this.superimposeViewEnabled,e=>{e?(this._closeAllImageTools(),this.selectedGroup=null,this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1):this._resetSuperimposeOffset()}),c(()=>({features:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showCameraLocations:this.showCameraLocations}),({overlaysEnabled:e,showCameraLocations:t})=>{e&&this.viewModel.overlayCameraLocations(t)},h),c(()=>({feature:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showMapFeatures:this.showMapFeatures}),async(e,t)=>{e.showMapFeatures!==t?.showMapFeatures&&await this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures);const i=e.feature&&e.feature!==t?.feature,a=e.overlaysEnabled&&!t?.overlaysEnabled;(i||a)&&(i&&this.viewModel.removeAllOverlayMapFeatures(),e.overlaysEnabled&&(this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),this.dataCaptureLayer&&(await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null))))},g),m(()=>this.viewModel,"popup-open",async e=>{await(this.view?.openPopup(e))},u),m(()=>this.viewModel,"popup-close",()=>{this.view?.closePopup()},u),this._toggleImageAttributes])}loadDependencies(){return Promise.all([J(),Y({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),B()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){return!!this.layer?.effectiveSequenceOrderField?.length}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get depthImageNotSupported(){return this.viewModel.depthImageNotSupported}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get enhancementToolActive(){return"video"===this.viewModel.mode?this.videoEnhancementToolActive:this.imageEnhancementToolActive}set enhancementToolActive(e){"video"===this.viewModel.mode?this.videoEnhancementToolActive=e:this.imageEnhancementToolActive=e}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.mapImageConversionToolState=e}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return("image-loaded"===t||this.videoLoaded)&&e}get preloadMedia(){return this.viewModel.preloadMedia}set preloadMedia(e){this.viewModel.preloadMedia=e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}get videoLoaded(){const{mode:e,videoElement:t,panoramicVideoLoaded:i}=this.viewModel;return("video"===e&&!0===t?.loaded||i)??!1}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}get shouldShowSelectedImage(){return this.viewModel.shouldShowSelectedImage}set shouldShowSelectedImage(e){this.viewModel.shouldShowSelectedImage=e}get superimposeViewEnabled(){return this.viewModel.superimposeViewEnabled}set superimposeViewEnabled(e){this.viewModel.superimposeViewEnabled=e}get defaultSuperimposeCameraLockEnabled(){return this.viewModel.defaultSuperimposeCameraLockEnabled}set defaultSuperimposeCameraLockEnabled(e){this.viewModel.defaultSuperimposeCameraLockEnabled=e}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}get verticalFilterEnabled(){return this.viewModel.verticalFilterEnabled}set verticalFilterEnabled(e){this.viewModel.verticalFilterEnabled=e}_renderActionBar(){const{selectedGroup:e,superimposeViewEnabled:i}=this;if(i)return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},ae("calcite-action-group",null,this._superimposeViewToggle()));const a=t();return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},!e&&ae("calcite-action-group",null,this._searchGroupToggle(),this._overlaysGroupToggle(),this._navigationGroupToggle(),this._measurementsGroupToggle(),this._utilitiesGroupToggle()),this._renderGroupBackAction(a),"overlays"===e&&ae("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle(),this._mapImageConversionToggle(),this._imageOverlaysToggle()),"navigation"===e&&ae("calcite-action-group",null,this._directionToolsToggle(),this._navigationToolToggle(),this._imageGalleryToggle()),"measurements"===e&&ae("calcite-action-group",null,this._measurementToolToggle()),"utilities"===e&&ae("calcite-action-group",null,this._imageEnhancementsToggle(),this._videoEnhancementsToggle(),this._superimposeViewToggle(),this._openPopupAction()),"search"===e&&ae("calcite-action-group",null,this._exploreImagesToggle(),this._exploreImages3DToggle(),this._showSelectedImageToggle()))}_renderGroupBackAction(e){return this.selectedGroup?ae("calcite-action",{bind:this,icon:e?"arrow-right":"arrow-left",key:"back-arrow",onclick:()=>this._toggleGroupSelection(null),text:this.messages.previous,title:this.messages.previous}):null}get _activeMeasurementHeading(){const{measureType:e,messages:t,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:s,groundDistance:o,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return s;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:s}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const o=this._imageMeasurementToolsLoaderTask?.value;return o?ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${s}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},ae(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return ae("calcite-panel",{bind:this,class:t?E.viewerContainerMeasurement:E.viewerContainer,heading:this.visibleElements.header?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,ae("calcite-shell",null,ae("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._panoramicVideoViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._superimposeTools,this._renderSketch(),this._navigationUI),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null,this.depthImageNotSupported?this._renderWarning(this.messages.depthImageNotSupportedTitle,this.messages.depthImageNotSupportedDescription):null,this.noImageInSequenceError?this._renderWarning(this.messages.sequentialNavigationWarning,this.messages.sequentialNavigationWarning,this._closeImageSequenceAlert):null))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?ae("calcite-action",{active:e,bind:this,class:E.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}_exploreImagesToggle(){const{exploreImages:e}=this.messages;return this.visibleElements.exploreImages?ae("calcite-action",{active:!this.disabled,bind:this,icon:"oriented-imagery-widget",onclick:this._toggleExploreImages,text:e,title:e}):null}get _imageEnhancementTools(){const{enhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?ae("calcite-panel",{bind:this,class:E.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleEnhancementToolState},ae("div",{class:E.imageEnhancementTools},K({title:this.messages.brightness,value:t,max:10,min:-10,ticks:5,handleChange:this._handleBrightnessChange}),K({title:this.messages.contrast,value:i,max:10,min:-10,ticks:5,handleChange:this._handleContrastChange}),K({title:this.messages.sharpness,value:a,max:1,min:0,ticks:.5,step:.1,handleChange:this._handleSharpnessChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}get _videoEnhancementTools(){const{enhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?ae(Q,{brightness:t.videoBrightness,constrast:t.videoContrast,handleBrightnessChange:this._handleVideoBrightnessChange,handleContrastChange:this._handleVideoContrastChange,resetTools:this._resetVideoTools,uiStrings:{videoEnhancement:a,brightness:s,contrast:o,reset:n},videoEnhancementToolActive:e,onClose:this._toggleEnhancementToolState}):null}get _superimposeTools(){const{superimposeViewEnabled:e,view:t,viewModel:{state:i,mode:a},messages:{superimposeSettings:s,sphereRadiusOffset:o,superimposeZOffset:n}}=this;return e&&"3d"===t?.type&&"image-loaded"===i?ae("calcite-panel",{bind:this,class:this.classes(E.imageEnhancementWrapper,E.superimposeTools),heading:s,key:"superimpose-settings"},ae("div",{class:E.imageEnhancementTools},K({title:"panoramic"===a?o:n,value:this._superimposeZOffset,max:50,min:-50,ticks:10,step:.5,handleChange:this._handleSuperimposeZOffsetChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetSuperimposeOffset,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{enhancementTool:i}=this.visibleElements;return i&&"video"!==t?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}_exploreImages3DToggle(){const{exploreImages3D:e}=this.messages,t="3d"!==this.view?.type||!this.layer?.verticalSearchRange;return this.visibleElements.exploreImages3D?ae("calcite-action",{active:this.verticalFilterEnabled,bind:this,disabled:t,icon:"i3DSearch",onclick:this._toggleVerticalSearchFilter,text:e,title:e}):null}_showSelectedImageToggle(){const{displayImages:e}=this.messages,t=this.viewModel.mode.includes("video");return this.visibleElements.showSelectedImage?ae("calcite-action",{active:this.shouldShowSelectedImage,bind:this,disabled:t,icon:"show-oriented-imagery",onclick:this._toggleShowSelectedImage,text:e,title:e}):null}_superimposeViewToggle(){const{superimposeImage:e}=this.messages,t=!this.superimposeViewEnabled&&("3d"!==this.view?.type||this.viewModel.mode.includes("video"));return this.visibleElements.superimpose?ae("calcite-action",{active:this.superimposeViewEnabled,bind:this,disabled:t,icon:"superimpose",onclick:this._toggleSuperimposeView,text:e,title:e}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages,{enhancementTool:i}=this.visibleElements;return i&&"video"===e?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:t,title:t}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return ae("calcite-panel",{bind:this,class:E.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},ae("div",{class:E.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?ae("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery,title:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:i,dataCaptureEnabled:a,dataCaptureLayer:o,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:f,h=c.imageReferenceField?.length?c.imageReferenceField:S;t||(this._imageOverlaysLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?ae(m,{closed:!n,dataCaptureEnabled:a,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:i,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onFilterCapturedFeatures:this.viewModel.filterCapturedFeatures,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _navigationUI(){const{navigationMode:e,viewModel:t}=this,{mode:i,state:a}=t;if(e&&("default"===i||"panoramic"===i)&&"image-loaded"===a)return"directional"===e?"default"===i?ae(R,{cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes,preserveAngle:this.viewModel.preserveAngle}):ae(Z,{currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes}):ae(z,{layout:"horizontal",uiStrings:{end:this.messages.end,next:this.messages.next,previous:this.messages.previous,start:this.messages.start},onNext:this._navigateNext,onPrev:this._navigatePrevious})}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesCommon,...this.messagesSketch}}_imageOverlaysPanel(){const{imageOverlaysOpened:e}=this,t=this.classes({[E.imageOverlaysContainer]:!0,[ee.hidden]:!e||!this._imageOverlaysEnabled});return ae("div",{class:t,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{imageOverlaysOpened:e,invalidCameraHeading:t,visibleElements:{imageOverlays:i}}=this;return i?ae("calcite-action",{active:e,bind:this,disabled:!this._imageOverlaysEnabled||t,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageOverlaysEnabled(){return this.viewModel.overlayGraphicsEnabled}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading");return ae(U,{afterCreate:t,clickAction:a,visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,storePanoramicMeasurementViewer:s,mode:o,state:n,clickAction:r}=this.viewModel,l=null!=i||"none"===o||"video"===o,d=this.classes({[E.viewer]:!l,[E.viewerHidden]:l});return t?ae("calcite-panel",{class:E.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:n.includes("loading")},ae("calcite-panel",{bind:this,class:d},"default"===o?ae(U,{afterCreate:a,clickAction:r,uiStrings:e}):ae(b,{afterCreate:s,clickAction:r,uiStrings:e}))):null}_utilitiesGroupToggle(){const{utilityTools:e}=this.messages;return this.visibleElements.utilityTools?ae("calcite-action",{bind:this,icon:"tools",key:"utilities-group-toggle",onclick:()=>this._toggleGroupSelection("utilities"),text:e,title:e}):null}_searchGroupToggle(){const{searchTools:e}=this.messages;return this.visibleElements.searchTools?ae("calcite-action",{bind:this,icon:"search",key:"search-group-toggle",onclick:()=>this._toggleGroupSelection("search"),text:e,title:e}):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:s}=this.messagesCommon,{mute:o,unmute:n}=this.messages,r="video"!==e,l=this.classes({[E.viewer]:!r,[E.viewerHidden]:r}),d="esri-image-viewer",c=`${d}__slider-container`;return ae("calcite-panel",{bind:this,class:l},ae("calcite-panel",{afterCreate:t,class:this.classes(ee.widget,d)}),ae("calcite-block",{class:c,expanded:!0},ae("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._handleVideoSeek})),ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:s})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>i?.toggleAudio(),text:"Audio",title:i?.videoMuted?o:n}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:s,triangularMeasurementActive:o,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!s)return;let l=t;if(o){if(!a)return;l=a}return ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:o?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},ae(W,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t,disabled:i},invalidCameraHeading:a,visibleElements:{mapImageConversionTool:s}}=this;return s?ae("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t||a||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolToggle(){const{measureType:e,viewModel:t,accuracyParametersMissing:i,messages:a,triangularMeasurementActive:s}=this,{state:o}=t,{groundDistance:n,groundArea:r,heightAboveGround:l,groundLocation:d,triangulatedDistanceHeading:c,triangulatedAreaHeading:g,triangulatedLocationHeading:h}=a,m="image-loaded"!==o||i;return ae("calcite-action-group",{key:"measurement-tools",scale:"m"},ae("calcite-action",{active:"distance"===e&&!s,bind:this,disabled:m,icon:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),text:n,title:n}),ae("calcite-action",{active:"area"===e&&!s,bind:this,disabled:m,icon:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),text:r,title:r}),ae("calcite-action",{active:"height"===e,bind:this,disabled:m,icon:"measure-building-height-top-base",key:"height-measurement",onclick:e=>this._toggleMeasurementSketch(e,"height"),text:l,title:l}),ae("calcite-action",{active:!!this.imageLocationToolActive&&!s,bind:this,disabled:m,icon:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,text:d,title:d}),ae("calcite-action",{active:!!s&&this.imageLocationToolActive,bind:this,disabled:m,icon:"dual-image-location",key:"triangular-location",onclick:this._toggleTriangularLocation,text:h,title:h}),ae("calcite-action",{active:!!s&&"distance"===this.measureType,bind:this,disabled:m,icon:"dual-image-distance",key:"triangular-distance",onclick:this._toggleTriangularDistanceMeasurements,text:c,title:c}),ae("calcite-action",{active:!!s&&"area"===this.measureType,bind:this,disabled:m,icon:"dual-image-area",key:"triangular-area",onclick:this._toggleTriangularAreaMeasurements,text:g,title:g}))}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:a}}=this;if(!t||"video"===a)return null;const{data:s,key:o,map:n}=t,r=`${n?i(e[o],n):e[o]}`;return ae("span",{class:E.messageBox},s?`${r} ${s}`:r)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_measurementsGroupToggle(){const{measurementTools:e}=this.messages,{state:t,accuracyParametersMissing:i}=this.viewModel,a="image-loaded"!==t||i;return this.visibleElements.measurementTools?ae("calcite-action",{bind:this,disabled:a,icon:"measure-line",key:"measurements-group-toggle",onclick:()=>this._toggleGroupSelection("measurements"),text:e,title:e}):null}_navigationGroupToggle(){const{imageNavigation:e}=this.messages;return this.visibleElements.imageNavigationTools?ae("calcite-action",{bind:this,icon:"absolute-direction",key:"navigation-group-toggle",onclick:()=>this._toggleGroupSelection("navigation"),text:e,title:e}):null}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t},videoLoaded:i}=this;return t?ae("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e&&!i||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolsToggle(){const{messages:e,viewModel:t,visibleElements:i}=this,{directionalNavigation:a,sequentialNavigation:s}=i,{state:o}=t,{directionalNavigation:n,directionalNavigationDescription:r,sequentialNavigation:l,sequentialNavigationDescription:d}=e;return ae("calcite-action-group",{key:"navigation-tools",scale:"m"},a?ae("calcite-action",{active:"directional"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading,icon:"directional-navigation",onclick:()=>{this._toggleImageNavigation("directional")},text:r,title:n}):null,s?ae("calcite-action",{active:"sequential"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"sequential-navigation",onclick:()=>{this._toggleImageNavigation("sequential")},text:d,title:l}):null)}_overlaysGroupToggle(){const{overlays:e}=this.messages;return this.visibleElements.overlays?ae("calcite-action",{bind:this,icon:"oriented-imagery-overlays",key:"overlays-group-toggle",onclick:()=>this._toggleGroupSelection("overlays"),text:e,title:e}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?ae("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicVideoViewer(){const{displayMessage:e,loadPanoramicVideoViewer:t,mode:i,clickAction:a,state:s,currentBestFeature:o}=this.viewModel,n=o?.attributes.imagePath,r=null!=e||"panoramic-video"!==i||s.includes("loading")||!n;return ae(T,{afterCreate:t,clickAction:a,oiViewModel:this.viewModel,videoSource:n,visible:!r})}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"panoramic"!==i||s.includes("loading");return ae(b,{afterCreate:t,clickAction:a,visible:!o})}get noImageInSequenceError(){return this._get("noImageInSequenceError")??!1}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_handleSuperimposeZOffsetChange(e){const t=e.currentTarget.value??0,i=t-this._superimposeZOffset;this._superimposeZOffset=t,this.viewModel.updateSuperimposeZOffset(i)}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),o=a.getAttribute("data-rotation"),n=a.getAttribute("data-objectid"),r=o?parseFloat(o)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!n)return;let h;try{h=G(s)?await N(c,n,{signal:g}):await D(s,{signal:g})}catch(i){d(i)||l.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;H(h,a,r)}})}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=s(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t,i){const{viewModel:{state:a}}=this;return"image-loaded"===a?ae(q,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t,topLayerDisabled:this.topLayerDisabled,onClose:i}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:i,state:s}}=this;if(!this.container||!i)return null;let o,n,r,l,d;if(t){const{x:e,y:i,direction:a}=t,[s,c,g,h]=A[a];o=`M ${e} ${i} L ${s} ${c} A ${V[2]} ${V[2]} 0 0 1 ${g} ${h} Z`,n=e,l=i,r=A[a][4],d=A[a][5]}const c=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},h=e=>{e.removeEventListener("click",g)},m=i.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>ae("circle",{afterRemoved:h,class:this.classes(E.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${E.feature}-${i}`,onclick:g,r:k}))),p=e=>{e.removeEventListener("click",c)},v=this.classes({[E.navigationWrapper]:!0,[E.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&("image-loaded"===s||this.videoLoaded)?ae("div",{bind:this,class:v,key:this.messages.navigationTool},ae("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:a()?O:E.rotateWithAnimation,focusable:"false",height:L,role:"img",width:L,xmlns:"http://www.w3.org/2000/svg"},ae("defs",null,ae("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},ae("stop",{class:E.navigationPathOffset0,offset:0}),ae("stop",{class:E.navigationPathOffset1,offset:1}))),ae("g",null,ae("circle",{class:this.classes(E.sector,E.outerSector),cx:V[3],cy:V[3],onclick:this._scaleNavigationTool,r:V[3]}),ae("circle",{class:E.sector,cx:V[3],cy:V[3],r:V[2]}),ae("circle",{class:E.sector,cx:V[3],cy:V[3],r:V[1]}),ae("circle",{class:E.sector,cx:V[3],cy:V[3],r:V[0]}),ae("path",{class:E.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${E.pointer}-west`}),ae("path",{class:this.classes(E.pointer,E.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${E.pointer}-north`}),ae("path",{class:E.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${E.pointer}-east`}),ae("path",{class:E.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${E.pointer}-south`}),ae("path",{class:this.classes(E.sector,E.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:E.sectorSeparator}),C([V[2],V[1],V[0]],V[3],V[3]).map((t,i)=>ae("path",{afterRemoved:p,class:this.classes(E.sector,e?.[i]?.length?E.sectorEnabled:E.sectorDisabled),d:t,"data-sector":`${i}`,key:`${E.sector}-${i}`,onclick:c})),ae("path",{class:this.classes(E.sector,E.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:E.sectorCross}),u,i.attributes.cameraPitch>=5&&o?ae("path",{class:E.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:E.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return ae("div",{class:E.sketchTools},ae(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?ae("div",{class:E.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},s)=>ae("div",{class:`${E.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${E.carouselItemWrapper}-${s}`},ae("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:E.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleShowSelectedImage(){this.shouldShowSelectedImage=!this.shouldShowSelectedImage,this._toggleDisabledViewer(this.shouldShowSelectedImage)}_resetSuperimposeOffset(){const e=-this._superimposeZOffset;this._superimposeZOffset=0,this.viewModel.updateSuperimposeZOffset(e)}_toggleSuperimposeCameraLock(){this.viewModel.updateDefaultSuperimposeCameraLock(!this.defaultSuperimposeCameraLockEnabled)}_toggleSuperimposeView(){this.superimposeViewEnabled=!this.superimposeViewEnabled}_toggleVerticalSearchFilter(){this.verticalFilterEnabled=!this.verticalFilterEnabled,this._toggleDisabledViewer(this.verticalFilterEnabled)}_toggleDisabledViewer(e){e&&(this.disabled=!1)}_toggleEnhancementToolState(e){e.stopPropagation();const t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleExploreImages(){this.disabled=!this.disabled,this.disabled&&(this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1)}_toggleGroupSelection(e){this.selectedGroup=e}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements("area")}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements("distance")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=!!a||!a)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(F,`${t}deg`),e.style.setProperty(x,`${t+a}deg`)}async loadBestImage(e,t){return this.viewModel.loadBestImage(e,t)}loadImageFromSource(e,t,i){return"default"===e?this.viewModel.loadMediaSource(t,i):this.viewModel.loadPanoramicMediaSource(t,i)}async overlayMapFeatures(e,t){return this.removeHandles(`${se.overlayed}-${e.id}`),this.addHandles(c(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${se.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${se.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return ae("div",{class:this.classes(ee.widget,P)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([v({readOnly:!0})],oe.prototype,"accuracyParametersMissing",null),e([v()],oe.prototype,"activeLayer",null),e([v()],oe.prototype,"activeVideoIcon",null),e([v()],oe.prototype,"activeAudioIcon",null),e([v()],oe.prototype,"cameraHeadingThreshold",null),e([v()],oe.prototype,"cameraPitchThreshold",null),e([v()],oe.prototype,"canNavigateSequentially",null),e([v()],oe.prototype,"currentBestFeature",null),e([v()],oe.prototype,"currentCoverageVisible",null),e([v()],oe.prototype,"dataCaptureEnabled",void 0),e([v()],oe.prototype,"dataCaptureLayer",null),e([v()],oe.prototype,"depthImageNotSupported",null),e([v()],oe.prototype,"disabled",null),e([v()],oe.prototype,"enhancementToolActive",null),e([v()],oe.prototype,"features",null),e([v()],oe.prototype,"imagePointsInView",null),e([v()],oe.prototype,"galleryOpened",void 0),e([v()],oe.prototype,"icon",null),e([v()],oe.prototype,"imageEnhancementToolActive",void 0),e([v()],oe.prototype,"videoEnhancementToolActive",void 0),e([v({readOnly:!0})],oe.prototype,"imageGalleryEnabled",null),e([v()],oe.prototype,"imageLocationToolActive",null),e([v()],oe.prototype,"imageOverlaysOpened",void 0),e([v({readOnly:!0})],oe.prototype,"invalidCameraHeading",null),e([v()],oe.prototype,"isAdditionalCoverageVisible",null),e([v()],oe.prototype,"isAdditionalPointSourcesVisible",null),e([v()],oe.prototype,"mapImageConversionToolState",null),e([v()],oe.prototype,"measureType",null),e([v()],oe.prototype,"layer",null),e([v()],oe.prototype,"navigationToolActive",void 0),e([v()],oe.prototype,"navigationMode",null),e([te(I()),v({type:j})],oe.prototype,"viewModel",void 0),e([v(),ie("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],oe.prototype,"messages",void 0),e([v(),ie("esri/core/t9n/Units")],oe.prototype,"measurementUnitMessages",void 0),e([v(),ie("esri/t9n/common")],oe.prototype,"messagesCommon",void 0),e([v(),ie("esri/widgets/Sketch/t9n/Sketch")],oe.prototype,"messagesSketch",void 0),e([v()],oe.prototype,"pixelMeasurementUnit",void 0),e([v()],oe.prototype,"pixelAreaMeasurementUnit",void 0),e([v({readOnly:!0})],oe.prototype,"popupEnabled",null),e([v()],oe.prototype,"preloadMedia",null),e([v()],oe.prototype,"referencePoint",null),e([v()],oe.prototype,"selectedGroup",void 0),e([v()],oe.prototype,"showCameraLocations",void 0),e([v()],oe.prototype,"showMapFeatures",void 0),e([te(["create","delete","redo","undo","update"]),v({readOnly:!0})],oe.prototype,"sketchViewModel",null),e([v()],oe.prototype,"triangularMeasurementActive",null),e([v()],oe.prototype,"videoLoaded",null),e([v()],oe.prototype,"view",null),e([v({type:$,nonNullable:!0})],oe.prototype,"visibleElements",void 0),e([v()],oe.prototype,"determineWorkflowForFeature",null),e([v()],oe.prototype,"shouldShowSelectedImage",null),e([v()],oe.prototype,"superimposeViewEnabled",null),e([v()],oe.prototype,"defaultSuperimposeCameraLockEnabled",null),e([v()],oe.prototype,"updateFootprint",null),e([v()],oe.prototype,"verticalFilterEnabled",null),e([v()],oe.prototype,"_superimposeZOffset",void 0),e([v()],oe.prototype,"_activeMeasurementHeading",null),e([v()],oe.prototype,"_imageOverlaysLoaderTask",void 0),e([v()],oe.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([v()],oe.prototype,"_navigationSettingsLoaderTask",void 0),e([v()],oe.prototype,"_navigationTask",void 0),e([v()],oe.prototype,"_measurementToggle",null),e([v()],oe.prototype,"_renderRoot",null),e([v()],oe.prototype,"_imageEnhancementTools",null),e([v()],oe.prototype,"_videoEnhancementTools",null),e([v()],oe.prototype,"_superimposeTools",null),e([v()],oe.prototype,"_imageGalleryPanel",null),e([v()],oe.prototype,"_imageGalleryContext",null),e([v()],oe.prototype,"_imageOverlaysComponent",null),e([v()],oe.prototype,"_navigationUI",null),e([v()],oe.prototype,"_imageOverlayMessages",null),e([v()],oe.prototype,"_imageSketchToolsMessages",null),e([v()],oe.prototype,"_imageOverlaysEnabled",null),e([v()],oe.prototype,"_imageViewer",null),e([v()],oe.prototype,"_imageViewerTriangular",null),e([v()],oe.prototype,"_videoViewer",null),e([v()],oe.prototype,"_locationToggle",null),e([v()],oe.prototype,"_messageBox",null),e([v()],oe.prototype,"_navigationToolExpanded",void 0),e([v()],oe.prototype,"_navigationTool",void 0),e([v()],oe.prototype,"_panoramicVideoViewer",null),e([v()],oe.prototype,"_panoramicViewer",null),e([v({readOnly:!0})],oe.prototype,"noImageInSequenceError",null),e([v()],oe.prototype,"_renderNavigation",null),e([v()],oe.prototype,"_renderThumbnails",null),e([v()],oe.prototype,"_sketchLoaderTask",void 0),oe=e([y("esri.widgets.OrientedImageryViewer")],oe);const ne=oe;export{ne as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{prefersRTL as t,substitute as i}from"../intl.js";import{prefersReducedMotion as a}from"../core/a11yUtils.js";import{createTask as s}from"../core/asyncUtils.js";import o from"../core/Collection.js";import{deprecateWidget as n,deprecatedProperty as r}from"../core/deprecate.js";import l from"../core/Logger.js";import{isAbortError as d}from"../core/promiseUtils.js";import{watch as c,initial as g,syncAndInitial as h,on as m,sync as u}from"../core/reactiveUtils.js";import{throttle as p}from"../core/throttle.js";import{property as v,subclass as y}from"../core/accessorSupport/decorators.js";import{or as _}from"../layers/orientedImagery/transformations/utils.js";import w from"./Expand.js";import T from"./PanoramicVideoViewer.js";import b from"./PanoramicViewer.js";import M from"./Widget.js";import{getAllArcPath as C}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as I,defaultImageGeometryField as f,defaultOIObjectIDField as S,segmentArcs as A,featureCircleRadius as k,navigationToolDimensionLength as L,sectorsRadii as V}from"./OrientedImageryViewer/constants.js";import{css as E,navigation as O,navigationToolRotationFrom as F,navigationToolRotationTo as x,root as P}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as G,loadImageForAttachment as N,getThumbnailPixelBlock as D,renderImageWithRotation as H}from"./OrientedImageryViewer/galleryUtils.js";import j from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import $ from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as B,Alert as q}from"./OrientedImageryViewer/components/Alert.js";import W from"./OrientedImageryViewer/components/ImageLocationWidget.js";import U from"./OrientedImageryViewer/components/ImageViewer.js";import R from"./OrientedImageryViewer/components/NavigationUI.js";import Z from"./OrientedImageryViewer/components/NavigationUI360.js";import{SequentialNavigationUI as z}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import{loadVideoEnhancementComponents as J,renderEnhancementSlider as K,VideoEnhancementTools as Q}from"./OrientedImageryViewer/components/VideoEnhancementTools.js";import{NoImageLoadedError as X}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as Y}from"./support/componentsUtils.js";import{globalCss as ee}from"./support/globalCss.js";import{vmEvent as te,messageBundle as ie,tsx as ae}from"./support/widget.js";const se={overlayed:"overlayed"};let oe=class extends M{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new j,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.selectedGroup=null,this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new $,this._superimposeZOffset=0,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._navigationTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.triangularMeasurementActive=!1,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1,this.triangularMeasurementActive=!1},this._createNavigationTask=async e=>(this._navigationTask?.abort(),this._navigationTask=s(async t=>await this.navigate({...e,signal:t})),this._navigationTask.promise),this._navigateNext=async()=>await this._createNavigationTask({step:1}),this._navigatePrevious=async()=>await this._createNavigationTask({step:-1}),this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new o,this._previousAction=null,this._closeImageSequenceAlert=()=>{this._set("noImageInSequenceError",!1)},this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(c(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible,this.showMapFeatures)}),`${se.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,n="select-feature"===s,r=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&_(n,o&&r)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=e=>{e.stopPropagation(),this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map(e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:s}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===s||"both"===s,i="pitch"===s||"both"===s,{messages:a,messagesCommon:o}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:o.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new w({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=p(this.viewModel.toggleImageAttributes.bind(this.viewModel)),this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new X;t=await this.viewModel.navigate(i,e)}catch(i){d(i)||l.getLogger(this).error("Error occurred while navigating",i),["NoImageInSequenceError","NoSequenceFoundError"].includes(i.name)&&this._set("noImageInSequenceError",!0)}return t},this.reset=()=>{this._closeAllImageTools(),this.viewModel.reset()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this._handleVideoBrightnessChange=this._handleVideoBrightnessChange.bind(this),this._handleVideoContrastChange=this._handleVideoContrastChange.bind(this),this._handleBrightnessChange=this._handleBrightnessChange.bind(this),this._handleContrastChange=this._handleContrastChange.bind(this),this._handleSharpnessChange=this._handleSharpnessChange.bind(this),this._handleSuperimposeZOffsetChange=this._handleSuperimposeZOffsetChange.bind(this),this._toggleSuperimposeCameraLock=this._toggleSuperimposeCameraLock.bind(this),this._resetSuperimposeOffset=this._resetSuperimposeOffset.bind(this),this._resetVideoTools=this._resetVideoTools.bind(this),this._toggleEnhancementToolState=this._toggleEnhancementToolState.bind(this),this.announceDeprecation=()=>{n(l.getLogger(this),"Oriented Imagery Viewer","arcgis-oriented-imagery-viewer",{version:"5.0"})}}initialize(){this.addHandles([c(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},g),c(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),c(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),c(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),c(()=>this.superimposeViewEnabled,e=>{e?(this._closeAllImageTools(),this.selectedGroup=null,this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1):this._resetSuperimposeOffset()}),c(()=>({features:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showCameraLocations:this.showCameraLocations}),({overlaysEnabled:e,showCameraLocations:t})=>{e&&this.viewModel.overlayCameraLocations(t)},h),c(()=>({feature:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showMapFeatures:this.showMapFeatures}),async(e,t)=>{e.showMapFeatures!==t?.showMapFeatures&&await this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures);const i=e.feature&&e.feature!==t?.feature,a=e.overlaysEnabled&&!t?.overlaysEnabled;(i||a)&&(i&&this.viewModel.removeAllOverlayMapFeatures(),e.overlaysEnabled&&(this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),this.dataCaptureLayer&&(await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null))))},g),m(()=>this.viewModel,"popup-open",async e=>{await(this.view?.openPopup(e))},u),m(()=>this.viewModel,"popup-close",()=>{this.view?.closePopup()},u),this._toggleImageAttributes])}loadDependencies(){return Promise.all([J(),Y({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),B()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){return!!this.layer?.effectiveSequenceOrderField?.length}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get depthImageNotSupported(){return this.viewModel.depthImageNotSupported}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get enhancementToolActive(){return"video"===this.viewModel.mode?this.videoEnhancementToolActive:this.imageEnhancementToolActive}set enhancementToolActive(e){"video"===this.viewModel.mode?this.videoEnhancementToolActive=e:this.imageEnhancementToolActive=e}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.setMapImageConversionToolState(e)}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return("image-loaded"===t||this.videoLoaded)&&e}get preloadMedia(){return this.viewModel.preloadMedia}set preloadMedia(e){this.viewModel.preloadMedia=e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}get videoLoaded(){const{mode:e,videoElement:t,panoramicVideoLoaded:i}=this.viewModel;return("video"===e&&!0===t?.loaded||i)??!1}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}get shouldShowSelectedImage(){return this.viewModel.shouldShowSelectedImage}set shouldShowSelectedImage(e){this.viewModel.shouldShowSelectedImage=e}get superimposeViewEnabled(){return this.viewModel.superimposeViewEnabled}set superimposeViewEnabled(e){this.viewModel.superimposeViewEnabled=e}get defaultSuperimposeCameraLockEnabled(){return this.viewModel.defaultSuperimposeCameraLockEnabled}set defaultSuperimposeCameraLockEnabled(e){this.viewModel.defaultSuperimposeCameraLockEnabled=e}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}get verticalFilterEnabled(){return this.viewModel.verticalFilterEnabled}set verticalFilterEnabled(e){this.viewModel.verticalFilterEnabled=e}_renderActionBar(){const{selectedGroup:e,superimposeViewEnabled:i}=this;if(i)return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},ae("calcite-action-group",null,this._superimposeViewToggle()));const a=t();return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},!e&&ae("calcite-action-group",null,this._searchGroupToggle(),this._overlaysGroupToggle(),this._navigationGroupToggle(),this._measurementsGroupToggle(),this._utilitiesGroupToggle()),this._renderGroupBackAction(a),"overlays"===e&&ae("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle(),this._mapImageConversionToggle(),this._imageOverlaysToggle()),"navigation"===e&&ae("calcite-action-group",null,this._directionToolsToggle(),this._navigationToolToggle(),this._imageGalleryToggle()),"measurements"===e&&ae("calcite-action-group",null,this._measurementToolToggle()),"utilities"===e&&ae("calcite-action-group",null,this._imageEnhancementsToggle(),this._videoEnhancementsToggle(),this._superimposeViewToggle(),this._openPopupAction()),"search"===e&&ae("calcite-action-group",null,this._exploreImagesToggle(),this._exploreImages3DToggle(),this._showSelectedImageToggle()))}_renderGroupBackAction(e){return this.selectedGroup?ae("calcite-action",{bind:this,icon:e?"arrow-right":"arrow-left",key:"back-arrow",onclick:()=>this._toggleGroupSelection(null),text:this.messages.previous,title:this.messages.previous}):null}get _activeMeasurementHeading(){const{measureType:e,messages:t,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:s,groundDistance:o,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return s;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:s}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const o=this._imageMeasurementToolsLoaderTask?.value;return o?ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${s}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},ae(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return ae("calcite-panel",{bind:this,class:t?E.viewerContainerMeasurement:E.viewerContainer,heading:this.visibleElements.header?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,ae("calcite-shell",null,ae("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._panoramicVideoViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._superimposeTools,this._renderSketch(),this._navigationUI),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null,this.depthImageNotSupported?this._renderWarning(this.messages.depthImageNotSupportedTitle,this.messages.depthImageNotSupportedDescription):null,this.noImageInSequenceError?this._renderWarning(this.messages.sequentialNavigationWarning,this.messages.sequentialNavigationWarning,this._closeImageSequenceAlert):null))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?ae("calcite-action",{active:e,bind:this,class:E.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}_exploreImagesToggle(){const{exploreImages:e}=this.messages;return this.visibleElements.exploreImages?ae("calcite-action",{active:!this.disabled,bind:this,icon:"oriented-imagery-widget",onclick:this._toggleExploreImages,text:e,title:e}):null}get _imageEnhancementTools(){const{enhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?ae("calcite-panel",{bind:this,class:E.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleEnhancementToolState},ae("div",{class:E.imageEnhancementTools},K({title:this.messages.brightness,value:t,max:10,min:-10,ticks:5,handleChange:this._handleBrightnessChange}),K({title:this.messages.contrast,value:i,max:10,min:-10,ticks:5,handleChange:this._handleContrastChange}),K({title:this.messages.sharpness,value:a,max:1,min:0,ticks:.5,step:.1,handleChange:this._handleSharpnessChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}get _videoEnhancementTools(){const{enhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?ae(Q,{brightness:t.videoBrightness,constrast:t.videoContrast,handleBrightnessChange:this._handleVideoBrightnessChange,handleContrastChange:this._handleVideoContrastChange,resetTools:this._resetVideoTools,uiStrings:{videoEnhancement:a,brightness:s,contrast:o,reset:n},videoEnhancementToolActive:e,onClose:this._toggleEnhancementToolState}):null}get _superimposeTools(){const{superimposeViewEnabled:e,view:t,viewModel:{state:i,mode:a},messages:{superimposeSettings:s,sphereRadiusOffset:o,superimposeZOffset:n}}=this;return e&&"3d"===t?.type&&"image-loaded"===i?ae("calcite-panel",{bind:this,class:this.classes(E.imageEnhancementWrapper,E.superimposeTools),heading:s,key:"superimpose-settings"},ae("div",{class:E.imageEnhancementTools},K({title:"panoramic"===a?o:n,value:this._superimposeZOffset,max:50,min:-50,ticks:10,step:.5,handleChange:this._handleSuperimposeZOffsetChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetSuperimposeOffset,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{enhancementTool:i}=this.visibleElements;return i&&"video"!==t?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}_exploreImages3DToggle(){const{exploreImages3D:e}=this.messages,t="3d"!==this.view?.type||!this.layer?.verticalSearchRange;return this.visibleElements.exploreImages3D?ae("calcite-action",{active:this.verticalFilterEnabled,bind:this,disabled:t,icon:"i3DSearch",onclick:this._toggleVerticalSearchFilter,text:e,title:e}):null}_showSelectedImageToggle(){const{displayImages:e}=this.messages,t=this.viewModel.mode.includes("video");return this.visibleElements.showSelectedImage?ae("calcite-action",{active:this.shouldShowSelectedImage,bind:this,disabled:t,icon:"show-oriented-imagery",onclick:this._toggleShowSelectedImage,text:e,title:e}):null}_superimposeViewToggle(){const{superimposeImage:e}=this.messages,t=!this.superimposeViewEnabled&&("3d"!==this.view?.type||this.viewModel.mode.includes("video"));return this.visibleElements.superimpose?ae("calcite-action",{active:this.superimposeViewEnabled,bind:this,disabled:t,icon:"superimpose",onclick:this._toggleSuperimposeView,text:e,title:e}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages,{enhancementTool:i}=this.visibleElements;return i&&"video"===e?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:t,title:t}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return ae("calcite-panel",{bind:this,class:E.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},ae("div",{class:E.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?ae("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery,title:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:i,dataCaptureEnabled:a,dataCaptureLayer:o,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:f,h=c.imageReferenceField?.length?c.imageReferenceField:S;t||(this._imageOverlaysLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?ae(m,{closed:!n,dataCaptureEnabled:a,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:i,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onFilterCapturedFeatures:this.viewModel.filterCapturedFeatures,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _navigationUI(){const{navigationMode:e,viewModel:t}=this,{mode:i,state:a}=t;if(e&&("default"===i||"panoramic"===i)&&"image-loaded"===a)return"directional"===e?"default"===i?ae(R,{cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes,preserveAngle:this.viewModel.preserveAngle}):ae(Z,{currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes}):ae(z,{layout:"horizontal",uiStrings:{end:this.messages.end,next:this.messages.next,previous:this.messages.previous,start:this.messages.start},onNext:this._navigateNext,onPrev:this._navigatePrevious})}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesCommon,...this.messagesSketch}}_imageOverlaysPanel(){const{imageOverlaysOpened:e}=this,t=this.classes({[E.imageOverlaysContainer]:!0,[ee.hidden]:!e||!this._imageOverlaysEnabled});return ae("div",{class:t,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{imageOverlaysOpened:e,invalidCameraHeading:t,visibleElements:{imageOverlays:i}}=this;return i?ae("calcite-action",{active:e,bind:this,disabled:!this._imageOverlaysEnabled||t,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageOverlaysEnabled(){return this.viewModel.overlayGraphicsEnabled}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading");return ae(U,{afterCreate:t,clickAction:a,visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,storePanoramicMeasurementViewer:s,mode:o,state:n,clickAction:r}=this.viewModel,l=null!=i||"none"===o||"video"===o,d=this.classes({[E.viewer]:!l,[E.viewerHidden]:l});return t?ae("calcite-panel",{class:E.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:n.includes("loading")},ae("calcite-panel",{bind:this,class:d},"default"===o?ae(U,{afterCreate:a,clickAction:r,uiStrings:e}):ae(b,{afterCreate:s,clickAction:r,uiStrings:e}))):null}_utilitiesGroupToggle(){const{utilityTools:e}=this.messages;return this.visibleElements.utilityTools?ae("calcite-action",{bind:this,icon:"tools",key:"utilities-group-toggle",onclick:()=>this._toggleGroupSelection("utilities"),text:e,title:e}):null}_searchGroupToggle(){const{searchTools:e}=this.messages;return this.visibleElements.searchTools?ae("calcite-action",{bind:this,icon:"search",key:"search-group-toggle",onclick:()=>this._toggleGroupSelection("search"),text:e,title:e}):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:s}=this.messagesCommon,{mute:o,unmute:n}=this.messages,r="video"!==e,l=this.classes({[E.viewer]:!r,[E.viewerHidden]:r}),d="esri-image-viewer",c=`${d}__slider-container`;return ae("calcite-panel",{bind:this,class:l},ae("calcite-panel",{afterCreate:t,class:this.classes(ee.widget,d)}),ae("calcite-block",{class:c,expanded:!0},ae("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._handleVideoSeek})),ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:s})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>i?.toggleAudio(),text:"Audio",title:i?.videoMuted?o:n}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:s,triangularMeasurementActive:o,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!s)return;let l=t;if(o){if(!a)return;l=a}return ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:o?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},ae(W,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t,disabled:i},videoLoaded:a,invalidCameraHeading:s,visibleElements:{mapImageConversionTool:o}}=this,n=!("video"!==this.viewModel.mode||!a||!this.viewModel.videoViewModel?.videoPaused),r="panoramic-video"===this.viewModel.mode&&this.viewModel.panoramicVideoLoaded&&this.viewModel.panoramicVideoPaused;return o?ae("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t&&!n&&!r||s||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolToggle(){const{measureType:e,viewModel:t,accuracyParametersMissing:i,messages:a,triangularMeasurementActive:s}=this,{state:o}=t,{groundDistance:n,groundArea:r,heightAboveGround:l,groundLocation:d,triangulatedDistanceHeading:c,triangulatedAreaHeading:g,triangulatedLocationHeading:h}=a,m="image-loaded"!==o||i;return ae("calcite-action-group",{key:"measurement-tools",scale:"m"},ae("calcite-action",{active:"distance"===e&&!s,bind:this,disabled:m,icon:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),text:n,title:n}),ae("calcite-action",{active:"area"===e&&!s,bind:this,disabled:m,icon:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),text:r,title:r}),ae("calcite-action",{active:"height"===e,bind:this,disabled:m,icon:"measure-building-height-top-base",key:"height-measurement",onclick:e=>this._toggleMeasurementSketch(e,"height"),text:l,title:l}),ae("calcite-action",{active:!!this.imageLocationToolActive&&!s,bind:this,disabled:m,icon:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,text:d,title:d}),ae("calcite-action",{active:!!s&&this.imageLocationToolActive,bind:this,disabled:m,icon:"dual-image-location",key:"triangular-location",onclick:this._toggleTriangularLocation,text:h,title:h}),ae("calcite-action",{active:!!s&&"distance"===this.measureType,bind:this,disabled:m,icon:"dual-image-distance",key:"triangular-distance",onclick:this._toggleTriangularDistanceMeasurements,text:c,title:c}),ae("calcite-action",{active:!!s&&"area"===this.measureType,bind:this,disabled:m,icon:"dual-image-area",key:"triangular-area",onclick:this._toggleTriangularAreaMeasurements,text:g,title:g}))}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:a}}=this;if(!t||"video"===a)return null;const{data:s,key:o,map:n}=t,r=`${n?i(e[o],n):e[o]}`;return ae("span",{class:E.messageBox},s?`${r} ${s}`:r)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_measurementsGroupToggle(){const{measurementTools:e}=this.messages,{state:t,accuracyParametersMissing:i}=this.viewModel,a="image-loaded"!==t||i;return this.visibleElements.measurementTools?ae("calcite-action",{bind:this,disabled:a,icon:"measure-line",key:"measurements-group-toggle",onclick:()=>this._toggleGroupSelection("measurements"),text:e,title:e}):null}_navigationGroupToggle(){const{imageNavigation:e}=this.messages;return this.visibleElements.imageNavigationTools?ae("calcite-action",{bind:this,icon:"absolute-direction",key:"navigation-group-toggle",onclick:()=>this._toggleGroupSelection("navigation"),text:e,title:e}):null}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t},videoLoaded:i}=this;return t?ae("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e&&!i||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolsToggle(){const{messages:e,viewModel:t,visibleElements:i}=this,{directionalNavigation:a,sequentialNavigation:s}=i,{state:o}=t,{directionalNavigation:n,directionalNavigationDescription:r,sequentialNavigation:l,sequentialNavigationDescription:d}=e;return ae("calcite-action-group",{key:"navigation-tools",scale:"m"},a?ae("calcite-action",{active:"directional"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading,icon:"directional-navigation",onclick:()=>{this._toggleImageNavigation("directional")},text:r,title:n}):null,s?ae("calcite-action",{active:"sequential"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"sequential-navigation",onclick:()=>{this._toggleImageNavigation("sequential")},text:d,title:l}):null)}_overlaysGroupToggle(){const{overlays:e}=this.messages;return this.visibleElements.overlays?ae("calcite-action",{bind:this,icon:"oriented-imagery-overlays",key:"overlays-group-toggle",onclick:()=>this._toggleGroupSelection("overlays"),text:e,title:e}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?ae("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicVideoViewer(){const{displayMessage:e,loadPanoramicVideoViewer:t,mode:i,clickAction:a,state:s,currentBestFeature:o}=this.viewModel,n=o?.attributes.imagePath,r=null!=e||"panoramic-video"!==i||s.includes("loading")||!n;return ae(T,{afterCreate:t,clickAction:a,oiViewModel:this.viewModel,videoSource:n,visible:!r})}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"panoramic"!==i||s.includes("loading");return ae(b,{afterCreate:t,clickAction:a,visible:!o})}get noImageInSequenceError(){return this._get("noImageInSequenceError")??!1}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_handleSuperimposeZOffsetChange(e){const t=e.currentTarget.value??0,i=t-this._superimposeZOffset;this._superimposeZOffset=t,this.viewModel.updateSuperimposeZOffset(i)}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),o=a.getAttribute("data-rotation"),n=a.getAttribute("data-objectid"),r=o?parseFloat(o)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!n)return;let h;try{h=G(s)?await N(c,n,{signal:g}):await D(s,{signal:g})}catch(i){d(i)||l.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;H(h,a,r)}})}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=s(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t,i){const{viewModel:{state:a}}=this;return"image-loaded"===a?ae(q,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t,topLayerDisabled:this.topLayerDisabled,onClose:i}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:i,state:s}}=this;if(!this.container||!i)return null;let o,n,r,l,d;if(t){const{x:e,y:i,direction:a}=t,[s,c,g,h]=A[a];o=`M ${e} ${i} L ${s} ${c} A ${V[2]} ${V[2]} 0 0 1 ${g} ${h} Z`,n=e,l=i,r=A[a][4],d=A[a][5]}const c=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},h=e=>{e.removeEventListener("click",g)},m=i.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>ae("circle",{afterRemoved:h,class:this.classes(E.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${E.feature}-${i}`,onclick:g,r:k}))),p=e=>{e.removeEventListener("click",c)},v=this.classes({[E.navigationWrapper]:!0,[E.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&("image-loaded"===s||this.videoLoaded)?ae("div",{bind:this,class:v,key:this.messages.navigationTool},ae("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:a()?O:E.rotateWithAnimation,focusable:"false",height:L,role:"img",width:L,xmlns:"http://www.w3.org/2000/svg"},ae("defs",null,ae("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},ae("stop",{class:E.navigationPathOffset0,offset:0}),ae("stop",{class:E.navigationPathOffset1,offset:1}))),ae("g",null,ae("circle",{class:this.classes(E.sector,E.outerSector),cx:V[3],cy:V[3],onclick:this._scaleNavigationTool,r:V[3]}),ae("circle",{class:E.sector,cx:V[3],cy:V[3],r:V[2]}),ae("circle",{class:E.sector,cx:V[3],cy:V[3],r:V[1]}),ae("circle",{class:E.sector,cx:V[3],cy:V[3],r:V[0]}),ae("path",{class:E.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${E.pointer}-west`}),ae("path",{class:this.classes(E.pointer,E.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${E.pointer}-north`}),ae("path",{class:E.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${E.pointer}-east`}),ae("path",{class:E.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${E.pointer}-south`}),ae("path",{class:this.classes(E.sector,E.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:E.sectorSeparator}),C([V[2],V[1],V[0]],V[3],V[3]).map((t,i)=>ae("path",{afterRemoved:p,class:this.classes(E.sector,e?.[i]?.length?E.sectorEnabled:E.sectorDisabled),d:t,"data-sector":`${i}`,key:`${E.sector}-${i}`,onclick:c})),ae("path",{class:this.classes(E.sector,E.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:E.sectorCross}),u,i.attributes.cameraPitch>=5&&o?ae("path",{class:E.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:E.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return ae("div",{class:E.sketchTools},ae(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?ae("div",{class:E.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},s)=>ae("div",{class:`${E.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${E.carouselItemWrapper}-${s}`},ae("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:E.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleShowSelectedImage(){this.shouldShowSelectedImage=!this.shouldShowSelectedImage,this._toggleDisabledViewer(this.shouldShowSelectedImage)}_resetSuperimposeOffset(){const e=-this._superimposeZOffset;this._superimposeZOffset=0,this.viewModel.updateSuperimposeZOffset(e)}_toggleSuperimposeCameraLock(){this.viewModel.updateDefaultSuperimposeCameraLock(!this.defaultSuperimposeCameraLockEnabled)}_toggleSuperimposeView(){this.superimposeViewEnabled=!this.superimposeViewEnabled}_toggleVerticalSearchFilter(){this.verticalFilterEnabled=!this.verticalFilterEnabled,this._toggleDisabledViewer(this.verticalFilterEnabled)}_toggleDisabledViewer(e){e&&(this.disabled=!1)}_toggleEnhancementToolState(e){e.stopPropagation();const t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleExploreImages(){this.disabled=!this.disabled,this.disabled&&(this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1)}_toggleGroupSelection(e){this.selectedGroup=e}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements("area")}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements("distance")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=!!a||!a)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(F,`${t}deg`),e.style.setProperty(x,`${t+a}deg`)}async loadBestImage(e,t){return this.viewModel.loadBestImage(e,t)}loadImageFromSource(e,t,i){return"default"===e?this.viewModel.loadMediaSource(t,i):this.viewModel.loadPanoramicMediaSource(t,i)}async overlayMapFeatures(e,t){return this.removeHandles(`${se.overlayed}-${e.id}`),this.addHandles(c(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${se.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${se.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return ae("div",{class:this.classes(ee.widget,P)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([v({readOnly:!0})],oe.prototype,"accuracyParametersMissing",null),e([v()],oe.prototype,"activeLayer",null),e([v()],oe.prototype,"activeVideoIcon",null),e([v()],oe.prototype,"activeAudioIcon",null),e([v()],oe.prototype,"cameraHeadingThreshold",null),e([v()],oe.prototype,"cameraPitchThreshold",null),e([v()],oe.prototype,"canNavigateSequentially",null),e([v()],oe.prototype,"currentBestFeature",null),e([v()],oe.prototype,"currentCoverageVisible",null),e([v()],oe.prototype,"dataCaptureEnabled",void 0),e([v()],oe.prototype,"dataCaptureLayer",null),e([v()],oe.prototype,"depthImageNotSupported",null),e([v()],oe.prototype,"disabled",null),e([v()],oe.prototype,"enhancementToolActive",null),e([v()],oe.prototype,"features",null),e([v()],oe.prototype,"imagePointsInView",null),e([v()],oe.prototype,"galleryOpened",void 0),e([v()],oe.prototype,"icon",null),e([v()],oe.prototype,"imageEnhancementToolActive",void 0),e([v()],oe.prototype,"videoEnhancementToolActive",void 0),e([v({readOnly:!0})],oe.prototype,"imageGalleryEnabled",null),e([v()],oe.prototype,"imageLocationToolActive",null),e([v()],oe.prototype,"imageOverlaysOpened",void 0),e([v({readOnly:!0})],oe.prototype,"invalidCameraHeading",null),e([v()],oe.prototype,"isAdditionalCoverageVisible",null),e([v()],oe.prototype,"isAdditionalPointSourcesVisible",null),e([v()],oe.prototype,"mapImageConversionToolState",null),e([v()],oe.prototype,"measureType",null),e([v()],oe.prototype,"layer",null),e([v()],oe.prototype,"navigationToolActive",void 0),e([v()],oe.prototype,"navigationMode",null),e([te(I()),v({type:j})],oe.prototype,"viewModel",void 0),e([v(),ie("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],oe.prototype,"messages",void 0),e([v(),ie("esri/core/t9n/Units")],oe.prototype,"measurementUnitMessages",void 0),e([v(),ie("esri/t9n/common")],oe.prototype,"messagesCommon",void 0),e([v(),ie("esri/widgets/Sketch/t9n/Sketch")],oe.prototype,"messagesSketch",void 0),e([v()],oe.prototype,"pixelMeasurementUnit",void 0),e([v()],oe.prototype,"pixelAreaMeasurementUnit",void 0),e([v({readOnly:!0})],oe.prototype,"popupEnabled",null),e([v()],oe.prototype,"preloadMedia",null),e([v()],oe.prototype,"referencePoint",null),e([v()],oe.prototype,"selectedGroup",void 0),e([v()],oe.prototype,"showCameraLocations",void 0),e([v()],oe.prototype,"showMapFeatures",void 0),e([te(["create","delete","redo","undo","update"]),v({readOnly:!0})],oe.prototype,"sketchViewModel",null),e([v()],oe.prototype,"triangularMeasurementActive",null),e([v()],oe.prototype,"videoLoaded",null),e([v()],oe.prototype,"view",null),e([v({type:$,nonNullable:!0})],oe.prototype,"visibleElements",void 0),e([v()],oe.prototype,"determineWorkflowForFeature",null),e([v()],oe.prototype,"shouldShowSelectedImage",null),e([v()],oe.prototype,"superimposeViewEnabled",null),e([v()],oe.prototype,"defaultSuperimposeCameraLockEnabled",null),e([v()],oe.prototype,"updateFootprint",null),e([v()],oe.prototype,"verticalFilterEnabled",null),e([v()],oe.prototype,"_superimposeZOffset",void 0),e([v()],oe.prototype,"_activeMeasurementHeading",null),e([v()],oe.prototype,"_imageOverlaysLoaderTask",void 0),e([v()],oe.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([v()],oe.prototype,"_navigationSettingsLoaderTask",void 0),e([v()],oe.prototype,"_navigationTask",void 0),e([v()],oe.prototype,"_measurementToggle",null),e([v()],oe.prototype,"_renderRoot",null),e([v()],oe.prototype,"_imageEnhancementTools",null),e([v()],oe.prototype,"_videoEnhancementTools",null),e([v()],oe.prototype,"_superimposeTools",null),e([v()],oe.prototype,"_imageGalleryPanel",null),e([v()],oe.prototype,"_imageGalleryContext",null),e([v()],oe.prototype,"_imageOverlaysComponent",null),e([v()],oe.prototype,"_navigationUI",null),e([v()],oe.prototype,"_imageOverlayMessages",null),e([v()],oe.prototype,"_imageSketchToolsMessages",null),e([v()],oe.prototype,"_imageOverlaysEnabled",null),e([v()],oe.prototype,"_imageViewer",null),e([v()],oe.prototype,"_imageViewerTriangular",null),e([v()],oe.prototype,"_videoViewer",null),e([v()],oe.prototype,"_locationToggle",null),e([v()],oe.prototype,"_messageBox",null),e([v()],oe.prototype,"_navigationToolExpanded",void 0),e([v()],oe.prototype,"_navigationTool",void 0),e([v()],oe.prototype,"_panoramicVideoViewer",null),e([v()],oe.prototype,"_panoramicViewer",null),e([v({readOnly:!0})],oe.prototype,"noImageInSequenceError",null),e([v()],oe.prototype,"_renderNavigation",null),e([v()],oe.prototype,"_renderThumbnails",null),e([v()],oe.prototype,"_sketchLoaderTask",void 0),oe=e([y("esri.widgets.OrientedImageryViewer")],oe);const ne=oe;export{ne as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Camera.js";import i from"../../Ground.js";import o from"../../Map.js";import a from"../../core/Collection.js";import r from"../../core/Error.js";import{EventedAccessor as s}from"../../core/Evented.js";import{addEventListener as n}from"../../core/events.js";import{JSONMap as d}from"../../core/jsonMap.js";import h from"../../core/Logger.js";import{rad2deg as l,deg2rad as m}from"../../core/mathUtils.js";import{destroyMaybe as c}from"../../core/maybe.js";import{waitTick as p}from"../../core/promiseUtils.js";import{watch as u,syncAndInitial as g,when as v,whenOnce as y}from"../../core/reactiveUtils.js";import{property as _,subclass as f}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as w}from"../../core/support/UpdatingHandles.js";import V from"../../geometry/SpatialReference.js";import M from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as H}from"../../layers/orientedImagery/transformations/utils.js";import R from"../../views/SceneView.js";import{fixedImageSize as z}from"../OrientedImageryViewer/constants.js";import{createPanoramicMedia as b,extractHorizonAnglesFromMedia as P,logAndThrow as F,getMissingPropertyErrorName as S,getMissingPropertyErrorMessage as C}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as j,maxPanoramicViewerHFOV as O,minPanoramicViewerHFOV as x,humanBinocularHFOV as A}from"./constants.js";import I from"./PanoramicZoomConditions.js";import k from"./PanoramicZoomViewModel.js";import{findDiagonalFOV as G,meshToGraphic as L,createImageSphere as T}from"./utils.js";import{enumeration as D}from"../../core/accessorSupport/decorators/enumeration.js";const E={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action",videoHandles:"video-handles"};let W=class extends s{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new M({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new o({ground:new i({opacity:0,navigationConstraint:null}),layers:new a([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.closestFeature=null,this.currentTime=0,this.imageSize=null,this.media=null,this.oiViewModel=null,this.videoSource=null,this.videoDuration=void 0,this.videoLoaded=!1,this.videoPaused=null,this.videoMuted=null,this.pitch=90,this.state="ready",this.updatingHandles=new w,this.video=null,this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(E.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",e=>{const t=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],i=e.key;t.includes(i)&&e.stopPropagation()})],E.navigation)},this._addHFOVHandles=()=>{this.removeHandles(E.fovConstraint),this.addHandles(u(()=>[this.maxHFOV,this.minHFOV],()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new I({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))},g),E.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new k({view:this.imageRenderer,panoramicZoomConditions:new I({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this._zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._createMedia=(e,t)=>{this.media=b({type:"video",url:e,matrix:t.attributes.matrix,cameraHeading:t.attributes.cameraHeading})},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:t,x:i,y:o}=e;switch(t){case"start":this._startPosition=this._targetPosition={x:i,y:o};break;case"update":this._targetPosition={x:i,y:o},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer(async()=>{const t=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});t.results=t.results.filter(e=>"graphic"===e.type&&e.graphic!==this._imageGraphic),this.emit("hittest-response",t)});break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const t=H(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...t,spatialReference:V.WebMercator});break}}},this._handleWheel=e=>{const t=e.deltaX??e.native.deltaX;e.stopPropagation(),t>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadVideo(this._loadController)},this._updateMedia=(e,t,i)=>{i.url=e,i.matrix=t.attributes.matrix,i.cameraHeading=t.attributes.cameraHeading},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,t)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,t),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>!this._graphics.graphics.includes(e));return this._graphics.graphics.addMany(t),!0},this.clearOverlayGraphics=()=>{const e=Array.from(this.oiViewModel.overlayedMapFeatures.values()).flatMap(e=>e.toArray()),t=[...this.oiViewModel.overlayedCameraLocations.toArray(),...e];t.length&&this.removeManyGraphics(t)},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.enableAudio=()=>{const{video:e}=this;e&&(e.muted=!1,this.videoMuted=!1)},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>this._graphics.graphics.includes(e));return this._graphics.removeMany(t),!0},this.togglePanoramicAudio=()=>{if(this.video){const e=this.video.muted;this.video.muted=!e,this.videoMuted=!e}},this._imageRenderer=new R({map:this._map,viewingMode:"local",camera:{position:j},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:V.WebMercator,attributionVisible:!1,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([u(()=>this.videoSource,()=>{this.videoSource&&this.autoLoad&&this._loadWithController()},g),u(()=>this.fov,()=>{this._reloadCamera()},g),u(()=>this.yaw,e=>{this.camera&&(this.camera.heading=e,this._reloadCamera())},g),u(()=>this.pitch,e=>{this.camera&&(this.camera.tilt=e,this._reloadCamera())},g),v(()=>this.imageRenderer.ready,()=>{this._addNavigationHandles(),this._addZoomHandles()},g),u(()=>this.clickAction,e=>{this.removeHandles(E.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))},g),u(()=>this.video,e=>{if(e instanceof HTMLVideoElement){this._startVideo();const t=async()=>{this.currentTime=Number(e.currentTime.toFixed(2)),e.currentTime&&await this._updateVidFootprint(e.currentTime)};this.removeHandles(E.videoHandles);const i=n(e,"timeupdate",t),o=n(e,"play",()=>this._updateVideoIcon(e.paused)),a=n(e,"pause",()=>this._pauseVideoHandler(e));this.addHandles([i,o,a],E.videoHandles)}},g),u(()=>[this.videoSource,this.oiViewModel?.currentBestFeature,this.closestFeature],()=>{if(!this.videoSource||!this.oiViewModel.currentBestFeature)return;const e=this.closestFeature??this.oiViewModel.currentBestFeature;this.media?this._updateMedia(this.videoSource,e,this.media):this._createMedia(this.videoSource,e)},g)],E.default)}get camera(){return this.imageRenderer.destroying||this.imageRenderer.destroyed?null:this.imageRenderer.camera}set camera(e){!e||this.imageRenderer.destroying||this.imageRenderer.destroyed||(this.imageRenderer.camera=e.clone())}get fov(){return this.camera?.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get horizonAngles(){return P(this.media)}get hfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*l(Math.atan(Math.tan(m(e/2))*Math.sin(a)))}get imageRenderer(){return this._imageRenderer}get maxHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?G(O,e/t):O}get minHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?G(x,e/t):x}get updating(){return this.updatingHandles.updating}get vfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*l(Math.atan(Math.tan(m(e/2))*Math.cos(a)))}async _loadVideoInternal(e,t){return this.state="image-loading",this.video=document.createElement("video"),this.video.src=e,this.video.addEventListener("loadedmetadata",()=>{this._setVideoDuration(),this.videoLoaded=!0}),this._updateImageSphere(this.video,t)}_pauseVideoHandler(e){this._updateVideoIcon(e.paused)}_setVideoDuration(){const{video:e}=this;e?.duration&&(this.videoDuration=e.duration)}_startVideo(){try{this.enableAudio();const e=this.oiViewModel.currentBestFeature;e&&this.playPanoramicVideoFromSelectedLocation(e)}catch(e){h.getLogger(this).error("oriented-imagery-viewer:video-load",e)}}_reloadCamera(){this.camera=this.camera?.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=c(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition||!this.camera)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const t=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,t)),this._startPosition=this._targetPosition}async _updateImageSphere(e,t){await p(t);const[i,o,a]=this.horizonAngles??[0,0,0];return this._imageGraphic=L(T({data:e,horizonPitch:i,horizonRoll:o,horizonYaw:a})),this._graphics.add(this._imageGraphic),this.state="image-loaded",y(()=>this.imageRenderer.ready,t).then(()=>{const{size:[e,t]}=this.imageRenderer;this.fov=G(A,e/t)}),this.imageSize=z,this._imageGraphic.geometry}async _updateVidFootprint(e){const t=this.oiViewModel?.featureCache.find(t=>t.attributes.offsetFromStart===Math.floor(e)),{yaw:i,pitch:o,vfov:a,hfov:r}=this,s=!(t?.attributes.offsetFromStart&&a&&r&&i&&o),n=t?.attributes.objectId===this.closestFeature?.attributes.objectId;s||n||(this.closestFeature=t)}_updateVideoIcon(e){this.videoPaused=e,e||this.clearOverlayGraphics()}async loadVideo(e){return this._removeImageSphere(),this.videoSource?this._loadVideoInternal(this.videoSource,e):F(this.declaredClass,new r(S("panoramic-viewer"),C("PanoramicViewerViewModel","videoSource")))}playPanoramicVideoHandler(){const{video:e}=this;e&&(e.paused?e.play().catch(e=>{h.getLogger(this).error("error playing video",e)}):e.pause())}playPanoramicVideoFromSelectedLocation(e){const t=e.attributes.offsetFromStart;if(t){const e=this.video;e&&(e.currentTime=t,e.play().catch(e=>{h.getLogger(this).error("error playing video",e)}))}}rewindPanoramicVideoHandler(){const{video:e}=this;e&&(e.currentTime=0,e.play().catch(e=>{h.getLogger(this).error("error playing video",e)}))}};e([_()],W.prototype,"_graphics",void 0),e([_()],W.prototype,"_imageGraphic",void 0),e([_()],W.prototype,"_imageRenderer",void 0),e([_()],W.prototype,"_loadController",void 0),e([_()],W.prototype,"_map",void 0),e([_()],W.prototype,"_zoomViewModel",void 0),e([_({type:Boolean})],W.prototype,"autoLoad",void 0),e([_({type:t})],W.prototype,"camera",null),e([D(new d({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],W.prototype,"clickAction",void 0),e([_()],W.prototype,"closestFeature",void 0),e([_()],W.prototype,"currentTime",void 0),e([_({type:Number})],W.prototype,"fov",null),e([_()],W.prototype,"horizonAngles",null),e([_({readOnly:!0})],W.prototype,"hfov",null),e([_({readOnly:!0})],W.prototype,"imageRenderer",null),e([_()],W.prototype,"imageSize",void 0),e([_()],W.prototype,"media",void 0),e([_()],W.prototype,"oiViewModel",void 0),e([_()],W.prototype,"videoSource",void 0),e([_()],W.prototype,"videoDuration",void 0),e([_()],W.prototype,"videoLoaded",void 0),e([_()],W.prototype,"videoPaused",void 0),e([_()],W.prototype,"videoMuted",void 0),e([_({readOnly:!0})],W.prototype,"maxHFOV",null),e([_({readOnly:!0})],W.prototype,"minHFOV",null),e([_({type:Number})],W.prototype,"pitch",void 0),e([_()],W.prototype,"state",void 0),e([_()],W.prototype,"updatingHandles",void 0),e([_()],W.prototype,"updating",null),e([_({readOnly:!0})],W.prototype,"vfov",null),e([_()],W.prototype,"video",void 0),e([_({type:Number})],W.prototype,"yaw",void 0),W=e([f("esri.widgets.PanoramicViewer.PanoramicVideoViewerViewModel")],W);const N=W;export{N as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Camera.js";import i from"../../Ground.js";import o from"../../Map.js";import a from"../../core/Collection.js";import r from"../../core/Error.js";import{EventedAccessor as s}from"../../core/Evented.js";import{addEventListener as n}from"../../core/events.js";import{JSONMap as d}from"../../core/jsonMap.js";import h from"../../core/Logger.js";import{rad2deg as l,deg2rad as m}from"../../core/mathUtils.js";import{destroyMaybe as c}from"../../core/maybe.js";import{waitTick as p}from"../../core/promiseUtils.js";import{watch as u,syncAndInitial as g,when as v,whenOnce as y}from"../../core/reactiveUtils.js";import{property as _,subclass as f}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as w}from"../../core/support/UpdatingHandles.js";import V from"../../geometry/SpatialReference.js";import M from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as H}from"../../layers/orientedImagery/transformations/utils.js";import R from"../../views/SceneView.js";import{fixedImageSize as z}from"../OrientedImageryViewer/constants.js";import{createPanoramicMedia as b,extractHorizonAnglesFromMedia as P,logAndThrow as F,getMissingPropertyErrorName as S,getMissingPropertyErrorMessage as C}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as j,maxPanoramicViewerHFOV as O,minPanoramicViewerHFOV as x,humanBinocularHFOV as I}from"./constants.js";import A from"./PanoramicZoomConditions.js";import k from"./PanoramicZoomViewModel.js";import{findDiagonalFOV as G,meshToGraphic as L,createImageSphere as T}from"./utils.js";import{enumeration as D}from"../../core/accessorSupport/decorators/enumeration.js";const E={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action",videoHandles:"video-handles"};let W=class extends s{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new M({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new o({ground:new i({opacity:0,navigationConstraint:null}),layers:new a([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.closestFeature=null,this.currentTime=0,this.imageSize=null,this.media=null,this.oiViewModel=null,this.videoSource=null,this.videoDuration=void 0,this.videoLoaded=!1,this.videoPaused=null,this.videoMuted=null,this.pitch=90,this.state="ready",this.updatingHandles=new w,this.video=null,this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(E.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",e=>{const t=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],i=e.key;t.includes(i)&&e.stopPropagation()})],E.navigation)},this._addHFOVHandles=()=>{this.removeHandles(E.fovConstraint),this.addHandles(u(()=>[this.maxHFOV,this.minHFOV],()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new A({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))},g),E.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new k({view:this.imageRenderer,panoramicZoomConditions:new A({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this._zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._createMedia=(e,t)=>{this.media=b({type:"video",url:e,matrix:t.attributes.matrix,cameraHeading:t.attributes.cameraHeading})},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:t,x:i,y:o}=e;switch(t){case"start":this._startPosition=this._targetPosition={x:i,y:o};break;case"update":this._targetPosition={x:i,y:o},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer(async()=>{const t=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});t.results=t.results.filter(e=>"graphic"===e.type&&e.graphic!==this._imageGraphic),this.emit("hittest-response",t)});break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const t=this.horizonAngles,i=H(e.mapPoint,this.imageSize[0],this.imageSize[1],t);this.emit("pixel-location",{...i,spatialReference:V.WebMercator});break}}},this._handleWheel=e=>{const t=e.deltaX??e.native.deltaX;e.stopPropagation(),t>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadVideo(this._loadController)},this._updateMedia=(e,t,i)=>{i.url=e,i.matrix=t.attributes.matrix,i.cameraHeading=t.attributes.cameraHeading},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,t)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,t),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>!this._graphics.graphics.includes(e));return this._graphics.graphics.addMany(t),!0},this.clearOverlayGraphics=()=>{const e=Array.from(this.oiViewModel.overlayedMapFeatures.values()).flatMap(e=>e.toArray()),t=[...this.oiViewModel.overlayedCameraLocations.toArray(),...e];t.length&&this.removeManyGraphics(t)},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.enableAudio=()=>{const{video:e}=this;e&&(e.muted=!1,this.videoMuted=!1)},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>this._graphics.graphics.includes(e));return this._graphics.removeMany(t),!0},this.togglePanoramicAudio=()=>{if(this.video){const e=this.video.muted;this.video.muted=!e,this.videoMuted=!e}},this._imageRenderer=new R({map:this._map,viewingMode:"local",camera:{position:j},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:V.WebMercator,attributionVisible:!1,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([u(()=>this.videoSource,()=>{this.videoSource&&this.autoLoad&&this._loadWithController()},g),u(()=>this.fov,()=>{this._reloadCamera()},g),u(()=>this.yaw,e=>{this.camera&&(this.camera.heading=e,this._reloadCamera())},g),u(()=>this.pitch,e=>{this.camera&&(this.camera.tilt=e,this._reloadCamera())},g),v(()=>this.imageRenderer.ready,()=>{this._addNavigationHandles(),this._addZoomHandles()},g),u(()=>this.clickAction,e=>{this.removeHandles(E.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))},g),u(()=>this.video,e=>{if(e instanceof HTMLVideoElement){this._startVideo();const t=async()=>{this.currentTime=Number(e.currentTime.toFixed(2)),e.currentTime&&await this._updateVidFootprint(e.currentTime)};this.removeHandles(E.videoHandles);const i=n(e,"timeupdate",t),o=n(e,"play",()=>this._updateVideoIcon(e.paused)),a=n(e,"pause",()=>this._pauseVideoHandler(e));this.addHandles([i,o,a],E.videoHandles)}},g),u(()=>[this.videoSource,this.oiViewModel?.currentBestFeature,this.closestFeature],()=>{if(!this.videoSource||!this.oiViewModel.currentBestFeature)return;const e=this.closestFeature??this.oiViewModel.currentBestFeature;this.media?this._updateMedia(this.videoSource,e,this.media):this._createMedia(this.videoSource,e)},g)],E.default)}get camera(){return this.imageRenderer.destroying||this.imageRenderer.destroyed?null:this.imageRenderer.camera}set camera(e){!e||this.imageRenderer.destroying||this.imageRenderer.destroyed||(this.imageRenderer.camera=e.clone())}get fov(){return this.camera?.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get horizonAngles(){return P(this.media)}get hfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*l(Math.atan(Math.tan(m(e/2))*Math.sin(a)))}get imageRenderer(){return this._imageRenderer}get maxHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?G(O,e/t):O}get minHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?G(x,e/t):x}get updating(){return this.updatingHandles.updating}get vfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,o=t/i,a=Math.atan(o);return 2*l(Math.atan(Math.tan(m(e/2))*Math.cos(a)))}async _loadVideoInternal(e,t){return this.state="image-loading",this.video=document.createElement("video"),this.video.src=e,this.video.addEventListener("loadedmetadata",()=>{this._setVideoDuration(),this.videoLoaded=!0}),this._updateImageSphere(this.video,t)}_pauseVideoHandler(e){this._updateVideoIcon(e.paused)}_setVideoDuration(){const{video:e}=this;e?.duration&&(this.videoDuration=e.duration)}_startVideo(){try{this.enableAudio();const e=this.oiViewModel.currentBestFeature;e&&this.playPanoramicVideoFromSelectedLocation(e)}catch(e){h.getLogger(this).error("oriented-imagery-viewer:video-load",e)}}_reloadCamera(){this.camera=this.camera?.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=c(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition||!this.camera)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const t=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,t)),this._startPosition=this._targetPosition}async _updateImageSphere(e,t){await p(t);const[i,o,a]=this.horizonAngles??[0,0,0];return this._imageGraphic=L(T({data:e,horizonPitch:i,horizonRoll:o,horizonYaw:a})),this._graphics.add(this._imageGraphic),this.state="image-loaded",y(()=>this.imageRenderer.ready,t).then(()=>{const{size:[e,t]}=this.imageRenderer;this.fov=G(I,e/t)}),this.imageSize=z,this._imageGraphic.geometry}async _updateVidFootprint(e){const t=this.oiViewModel?.featureCache.find(t=>t.attributes.offsetFromStart===Math.floor(e)),{yaw:i,pitch:o,vfov:a,hfov:r}=this,s=!(t?.attributes.offsetFromStart&&a&&r&&i&&o),n=t?.attributes.objectId===this.closestFeature?.attributes.objectId;s||n||(this.closestFeature=t)}_updateVideoIcon(e){this.videoPaused=e,e||(this.clearOverlayGraphics(),this.oiViewModel.mapImageConversionToolState&&this.oiViewModel.setMapImageConversionToolState(!1))}async loadVideo(e){return this._removeImageSphere(),this.videoSource?this._loadVideoInternal(this.videoSource,e):F(this.declaredClass,new r(S("panoramic-viewer"),C("PanoramicViewerViewModel","videoSource")))}playPanoramicVideoHandler(){const{video:e}=this;e&&(e.paused?e.play().catch(e=>{h.getLogger(this).error("error playing video",e)}):e.pause())}playPanoramicVideoFromSelectedLocation(e){const t=e.attributes.offsetFromStart;if(t){const e=this.video;e&&(e.currentTime=t,e.play().catch(e=>{h.getLogger(this).error("error playing video",e)}))}}rewindPanoramicVideoHandler(){const{video:e}=this;e&&(e.currentTime=0,e.play().catch(e=>{h.getLogger(this).error("error playing video",e)}))}};e([_()],W.prototype,"_graphics",void 0),e([_()],W.prototype,"_imageGraphic",void 0),e([_()],W.prototype,"_imageRenderer",void 0),e([_()],W.prototype,"_loadController",void 0),e([_()],W.prototype,"_map",void 0),e([_()],W.prototype,"_zoomViewModel",void 0),e([_({type:Boolean})],W.prototype,"autoLoad",void 0),e([_({type:t})],W.prototype,"camera",null),e([D(new d({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],W.prototype,"clickAction",void 0),e([_()],W.prototype,"closestFeature",void 0),e([_()],W.prototype,"currentTime",void 0),e([_({type:Number})],W.prototype,"fov",null),e([_()],W.prototype,"horizonAngles",null),e([_({readOnly:!0})],W.prototype,"hfov",null),e([_({readOnly:!0})],W.prototype,"imageRenderer",null),e([_()],W.prototype,"imageSize",void 0),e([_()],W.prototype,"media",void 0),e([_()],W.prototype,"oiViewModel",void 0),e([_()],W.prototype,"videoSource",void 0),e([_()],W.prototype,"videoDuration",void 0),e([_()],W.prototype,"videoLoaded",void 0),e([_()],W.prototype,"videoPaused",void 0),e([_()],W.prototype,"videoMuted",void 0),e([_({readOnly:!0})],W.prototype,"maxHFOV",null),e([_({readOnly:!0})],W.prototype,"minHFOV",null),e([_({type:Number})],W.prototype,"pitch",void 0),e([_()],W.prototype,"state",void 0),e([_()],W.prototype,"updatingHandles",void 0),e([_()],W.prototype,"updating",null),e([_({readOnly:!0})],W.prototype,"vfov",null),e([_()],W.prototype,"video",void 0),e([_({type:Number})],W.prototype,"yaw",void 0),W=e([f("esri.widgets.PanoramicViewer.PanoramicVideoViewerViewModel")],W);const N=W;export{N as default};
|
|
@@ -186,6 +186,15 @@ export default class VideoPlayerViewModel extends Accessor {
|
|
|
186
186
|
* videoPlayerViewModel.toggleSensorDisplay();
|
|
187
187
|
*/
|
|
188
188
|
toggleSensorDisplay(): void;
|
|
189
|
+
/**
|
|
190
|
+
* Toggles the sensor path display.
|
|
191
|
+
*
|
|
192
|
+
* @since 5.1
|
|
193
|
+
* @example
|
|
194
|
+
* // Toggle the sensor path display.
|
|
195
|
+
* videoPlayerViewModel.toggleSensorPathDisplay();
|
|
196
|
+
*/
|
|
197
|
+
toggleSensorPathDisplay(): void;
|
|
189
198
|
/**
|
|
190
199
|
* Toggles the sensor sight line display.
|
|
191
200
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{watch as r,initial as l}from"../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{videoMetadataEntryId as s}from"../../layers/video/videoUtils.js";function o(e,t){const r={};for(const l of t){const t=e.get(l);t&&(r[t.name]=t.value)}return r}let y=class extends t{constructor(e){super(e),this.followingMode="follow-both",this.layer=null,this.seekLength=10,this.view=null}initialize(){this.addHandles([r(()=>this.layer,(e,t)=>{t&&t.pause(),e&&e.load().then(()=>this._followTelemetry()).catch(()=>{})},l),r(()=>[this.followingMode],()=>this._followTelemetry(),l)])}get buffered(){return this.layer?.buffered||0}get currentTime(){return this.layer?.currentTime||0}get duration(){return this.layer?.duration||0}get ended(){return this.layer?.ended??!0}get metadata(){const e=this.layer?.metadata;return e?{missionInfo:o(e,[s.MissionId,s.PrecisionTimeStamp]),platformInfo:o(e,[s.PlatformTailNumber,s.PlatformTrueAirspeed,s.PlatformCallSign,s.PlatformDesignation,s.PlatformGroundRange]),frameInfo:o(e,[s.FrameCenterElevation,s.FrameCenterLatitude,s.FrameCenterLongitude])}:null}get playing(){return this.layer?.playing??!1}get state(){return this.layer?.loadError?"error":this.layer?.state??"not-ready"}play(){this.layer?.play()}pause(){this.layer?.pause()}seekBackward(){if(this.layer){const e=this.layer.currentTime-this.seekLength;e<=0?this.layer.reset():this.layer.setCurrentTime(e)}}seekForward(){if(this.layer){const e=this.layer.currentTime+this.seekLength;e>=this.layer.duration?this.layer.reset():this.layer.setCurrentTime(e)}}seekToBeginning(){this.layer?.setCurrentTime(0)}seekToEnding(){this.layer?.setCurrentTime(this.layer.duration)}seekTo(e){this.layer?.setCurrentTime(e)}toggleSensorDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorLocation=!this.layer.telemetryDisplay.sensorLocation)}toggleSensorSightLineDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.lineOfSight=!this.layer.telemetryDisplay.lineOfSight)}toggleFrameDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frame=!this.layer.telemetryDisplay.frame)}toggleSensorTrailDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorTrail=!this.layer.telemetryDisplay.sensorTrail)}toggleFrameCenterDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frameCenter=!this.layer.telemetryDisplay.frameCenter)}toggleFrameOutlineDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frameOutline=!this.layer.telemetryDisplay.frameOutline)}changePlaybackSpeed(e){this.layer&&(this.layer.playbackRate=e)}changeGraphicsColor(e){e&&this.layer.updateTelemetryColor(e)}_followTelemetry(){this.removeHandles("follow"),this.view&&this.layer&&this.addHandles(r(()=>this.layer?.telemetry,()=>{const e=[],t="follow-sensor"===this.followingMode||"follow-both"===this.followingMode,r="follow-frame"===this.followingMode||"follow-both"===this.followingMode;t&&this.layer?.telemetry.sensorLocation&&e.push(this.layer.telemetry.sensorLocation),r&&this.layer?.telemetry.frameCenter&&e.push(this.layer.telemetry.frameCenter),e.length?this.view?.goTo(e).catch(()=>{}):this.layer?.initialExtent&&"none"!==this.followingMode&&this.view?.goTo(this.layer.initialExtent).catch(()=>{})},l),"follow")}};e([i({readOnly:!0})],y.prototype,"buffered",null),e([i({readOnly:!0})],y.prototype,"currentTime",null),e([i({readOnly:!0})],y.prototype,"duration",null),e([i({readOnly:!0})],y.prototype,"ended",null),e([i()],y.prototype,"followingMode",void 0),e([i()],y.prototype,"layer",void 0),e([i({readOnly:!0})],y.prototype,"metadata",null),e([i({readOnly:!0})],y.prototype,"playing",null),e([i()],y.prototype,"seekLength",void 0),e([i({readOnly:!0})],y.prototype,"state",null),e([i()],y.prototype,"view",void 0),y=e([a("esri.widgets.VideoPlayer.VideoPlayerViewModel")],y);const n=y;export{n as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{watch as r,initial as l}from"../../core/reactiveUtils.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{videoMetadataEntryId as s}from"../../layers/video/videoUtils.js";function o(e,t){const r={};for(const l of t){const t=e.get(l);t&&(r[t.name]=t.value)}return r}let y=class extends t{constructor(e){super(e),this.followingMode="follow-both",this.layer=null,this.seekLength=10,this.view=null}initialize(){this.addHandles([r(()=>this.layer,(e,t)=>{t&&t.pause(),e&&e.load().then(()=>this._followTelemetry()).catch(()=>{})},l),r(()=>[this.followingMode],()=>this._followTelemetry(),l)])}get buffered(){return this.layer?.buffered||0}get currentTime(){return this.layer?.currentTime||0}get duration(){return this.layer?.duration||0}get ended(){return this.layer?.ended??!0}get metadata(){const e=this.layer?.metadata;return e?{missionInfo:o(e,[s.MissionId,s.PrecisionTimeStamp]),platformInfo:o(e,[s.PlatformTailNumber,s.PlatformTrueAirspeed,s.PlatformCallSign,s.PlatformDesignation,s.PlatformGroundRange]),frameInfo:o(e,[s.FrameCenterElevation,s.FrameCenterLatitude,s.FrameCenterLongitude])}:null}get playing(){return this.layer?.playing??!1}get state(){return this.layer?.loadError?"error":this.layer?.state??"not-ready"}play(){this.layer?.play()}pause(){this.layer?.pause()}seekBackward(){if(this.layer){const e=this.layer.currentTime-this.seekLength;e<=0?this.layer.reset():this.layer.setCurrentTime(e)}}seekForward(){if(this.layer){const e=this.layer.currentTime+this.seekLength;e>=this.layer.duration?this.layer.reset():this.layer.setCurrentTime(e)}}seekToBeginning(){this.layer?.setCurrentTime(0)}seekToEnding(){this.layer?.setCurrentTime(this.layer.duration)}seekTo(e){this.layer?.setCurrentTime(e)}toggleSensorDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorLocation=!this.layer.telemetryDisplay.sensorLocation)}toggleSensorPathDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorPath=!this.layer.telemetryDisplay.sensorPath)}toggleSensorSightLineDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.lineOfSight=!this.layer.telemetryDisplay.lineOfSight)}toggleFrameDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frame=!this.layer.telemetryDisplay.frame)}toggleSensorTrailDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.sensorTrail=!this.layer.telemetryDisplay.sensorTrail)}toggleFrameCenterDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frameCenter=!this.layer.telemetryDisplay.frameCenter)}toggleFrameOutlineDisplay(){this.layer?.telemetryDisplay&&(this.layer.telemetryDisplay.frameOutline=!this.layer.telemetryDisplay.frameOutline)}changePlaybackSpeed(e){this.layer&&(this.layer.playbackRate=e)}changeGraphicsColor(e){e&&this.layer.updateTelemetryColor(e)}_followTelemetry(){this.removeHandles("follow"),this.view&&this.layer&&this.addHandles(r(()=>this.layer?.telemetry,()=>{const e=[],t="follow-sensor"===this.followingMode||"follow-both"===this.followingMode,r="follow-frame"===this.followingMode||"follow-both"===this.followingMode;t&&this.layer?.telemetry.sensorLocation&&e.push(this.layer.telemetry.sensorLocation),r&&this.layer?.telemetry.frameCenter&&e.push(this.layer.telemetry.frameCenter),e.length?this.view?.goTo(e).catch(()=>{}):this.layer?.initialExtent&&"none"!==this.followingMode&&this.view?.goTo(this.layer.initialExtent).catch(()=>{})},l),"follow")}};e([i({readOnly:!0})],y.prototype,"buffered",null),e([i({readOnly:!0})],y.prototype,"currentTime",null),e([i({readOnly:!0})],y.prototype,"duration",null),e([i({readOnly:!0})],y.prototype,"ended",null),e([i()],y.prototype,"followingMode",void 0),e([i()],y.prototype,"layer",void 0),e([i({readOnly:!0})],y.prototype,"metadata",null),e([i({readOnly:!0})],y.prototype,"playing",null),e([i()],y.prototype,"seekLength",void 0),e([i({readOnly:!0})],y.prototype,"state",null),e([i()],y.prototype,"view",void 0),y=e([a("esri.widgets.VideoPlayer.VideoPlayerViewModel")],y);const n=y;export{n as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{loadCalciteComponents as e}from"../../support/componentsUtils.js";import{tsx as l}from"../../support/widget.js";import{css as t}from"../css.js";import{loadSettingsButtonComponents as o,SettingsButton as i}from"./SettingsButton.js";const c=()=>Promise.all([e({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")}),o()]);function a(e){return"none"===e.followingMode?"circle-disallowed":"follow-sensor"===e.followingMode?"zoom-to-object":"follow-frame"===e.followingMode?"follow":"video"}function s({viewModel:e,messages:o,settings:c,toggleMetadata:s,topLayerDisabled:n}){const{state:r}=e,m="not-ready"===r||"waiting"===r,p=l("div",null,l("calcite-popover",{autoClose:!0,label:o.layers,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:"layers-action",scale:"s",topLayerDisabled:n},l("calcite-panel",{heading:o.layers},l("calcite-list",{label:o.layers,selectionMode:"multiple"},l("calcite-list-item",{label:o.sensor,onclick:()=>{e.toggleSensorDisplay()},selected:!!e.layer?.telemetryDisplay?.sensorLocation}),l("calcite-list-item",{label:o.
|
|
2
|
+
import{loadCalciteComponents as e}from"../../support/componentsUtils.js";import{tsx as l}from"../../support/widget.js";import{css as t}from"../css.js";import{loadSettingsButtonComponents as o,SettingsButton as i}from"./SettingsButton.js";const c=()=>Promise.all([e({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")}),o()]);function a(e){return"none"===e.followingMode?"circle-disallowed":"follow-sensor"===e.followingMode?"zoom-to-object":"follow-frame"===e.followingMode?"follow":"video"}function s({viewModel:e,messages:o,settings:c,toggleMetadata:s,topLayerDisabled:n}){const{state:r}=e,m="not-ready"===r||"waiting"===r,p=l("div",null,l("calcite-popover",{autoClose:!0,label:o.layers,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:"layers-action",scale:"s",topLayerDisabled:n},l("calcite-panel",{heading:o.layers},l("calcite-list",{label:o.layers,selectionMode:"multiple"},l("calcite-list-item",{label:o.sensor,onclick:()=>{e.toggleSensorDisplay()},selected:!!e.layer?.telemetryDisplay?.sensorLocation}),l("calcite-list-item",{label:o.sensorPath,onclick:()=>{e.toggleSensorPathDisplay()},selected:!!e.layer?.telemetryDisplay?.sensorPath}),l("calcite-list-item",{label:o.sensorTrail,onclick:()=>{e.toggleSensorTrailDisplay()},selected:!!e.layer?.telemetryDisplay?.sensorTrail}),l("calcite-list-item",{label:o.sightLine,onclick:()=>{e.toggleSensorSightLineDisplay()},selected:!!e.layer?.telemetryDisplay?.lineOfSight}),l("calcite-list-item",{label:o.frameCenter,onclick:()=>{e.toggleFrameCenterDisplay()},selected:!!e.layer?.telemetryDisplay?.frameCenter}),l("calcite-list-item",{label:o.frameOutline,onclick:()=>{e.toggleFrameOutlineDisplay()},selected:!!e.layer?.telemetryDisplay?.frameOutline}),l("calcite-list-item",{label:o.frame,onclick:()=>{e.toggleFrameDisplay()},selected:!!e.layer?.telemetryDisplay?.frame})))),l("calcite-action",{alignment:"center",bind:e,disabled:m,icon:"layers",id:"layers-action",key:"layers",scale:"s",slot:"trigger",text:o.layers})),d=l("div",null,l("calcite-popover",{autoClose:!0,label:o.follow,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:"follow-action",scale:"s",topLayerDisabled:n},l("calcite-panel",{heading:o.follow},l("calcite-list",{label:o.follow,selectionMode:"single-persist"},l("calcite-list-item",{label:o.none,onclick:()=>{e.followingMode="none"}},l("calcite-icon",{icon:"circle-disallowed",scale:"s",slot:"content-start"})),l("calcite-list-item",{label:o.sensor,onclick:()=>{e.followingMode="follow-sensor"}},l("calcite-icon",{icon:"zoom-to-object",scale:"s",slot:"content-start"})),l("calcite-list-item",{label:o.frame,onclick:()=>{e.followingMode="follow-frame"}},l("calcite-icon",{icon:"follow",scale:"s",slot:"content-start"})),l("calcite-list-item",{label:o.video,onclick:()=>{e.followingMode="follow-both"},selected:!0},l("calcite-icon",{icon:"video",scale:"s",slot:"content-start"}))))),l("calcite-action",{alignment:"center",bind:e,disabled:m,icon:a(e),id:"follow-action",key:"follow",scale:"s",slot:"trigger",text:o.follow})),y=l(i,{messages:o,settings:c,topLayerDisabled:n,viewModel:e}),g=l("calcite-action",{alignment:"center",bind:e,disabled:m,icon:"feature-details",key:"metadata",onclick:s,scale:"s",text:o.metadata});return l("calcite-action-bar",{class:t.playerControls,expandDisabled:!0,layout:"horizontal",scale:"s"},[p,d,y,g])}export{s as PlayerControlsGroup,c as loadPlayerControlsGroupComponents};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{isTextInput as t}from"../../../form/support/formUtils.js";import{validateDomainValue as e}from"../../../layers/support/domainUtils.js";import{validateFieldValue as n}from"../../../layers/support/fieldUtils.js";import{dateTimeIsInRange as r}from"../dateUtils.js";const i=(t,e)=>{if(!t)return!0;const{operations:n}=t;switch(e){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};function o(t,i){const{dataType:o,domain:u,field:l,maxLength:a,minLength:s,multipleChoice:c,range:
|
|
2
|
+
import{isTextInput as t}from"../../../form/support/formUtils.js";import{validateDomainValue as e}from"../../../layers/support/domainUtils.js";import{validateFieldValue as n}from"../../../layers/support/fieldUtils.js";import{dateTimeIsInRange as r}from"../dateUtils.js";const i=(t,e)=>{if(!t)return!0;const{operations:n}=t;switch(e){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};function o(t,i){const{dataType:o,domain:u,field:l,maxLength:a,minLength:s,multipleChoice:c,range:m,required:f}=i;if(null==t)return f?"input-validation-error::cannot-be-empty":null;if("text"===o&&"string"==typeof t){if(s>-1&&t.length<s)return"length-validation-error::too-short";if(a>-1&&t.length>a)return"length-validation-error::too-long";if(c){const e=g(t,c.choiceDelimiter);if(null!=c.maximumChoices&&e>c.maximumChoices)return"multiple-choice-validation-error::too-many-selected-choices";if(null!=c.minimumChoices&&e<c.minimumChoices)return"multiple-choice-validation-error::too-few-selected-choices"}}return"date"!==o||r({type:l.type,range:m,value:t})?u?e(l,t,u):n(l,t):"numeric-range-validation-error::out-of-range"}function u(t,e){return!(!l(t)||!l(e))||t===e}function l(t){return null==t||""===t}function a({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;const o=c(n.length);if(!r||!t(r))return o;const u=c(r.maxLength);return u===i?o:o===i?u:Math.min(o,u)}function s({dataType:e,field:n,input:r}){const i=-1;if("date"===e)return i;if(!r||!t(r))return i;const o=c(r.minLength);if(o<0)return i;const u=c(n.length);return u>i&&u<o?i:o}function c(t){return"number"==typeof t&&t>-1?t:-1}const m={type:"number"},f={type:"number",intlOptions:{notation:"scientific"}};function p(t){return t>=1e7||t<=-1e7}function d(t,e){return null!=t.max&&null!=t.min?e.outsideRange:null!=t.max?e.outsideRangeMax:e.outsideRangeMin}const h=t=>t&&!Number.isNaN(t.valueOf());function g(t,e){return""===t?0:t.split(e).map(t=>t.trim()).filter(t=>""!==t).length}export{i as capabilitiesAllowEditType,h as dateIsValid,c as ensureMinOrMaxLength,a as getMaxLength,s as getMinLength,d as getRangeErrorMessage,l as isEmptyValue,m as numberFormatOptions,f as scientificNumberFormatOptions,p as shouldUseScientificNotation,o as validateFormValue,u as valuesAreEquivalent};
|