@geoscene/core 4.33.18 → 4.33.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/WebLinkChart.js +1 -1
  2. package/assets/geoscene/themes/base/_core.scss +1 -1
  3. package/identity/IdentityModal.js +1 -1
  4. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  5. package/package.json +2 -2
  6. package/rest/query/operations/query.js +1 -1
  7. package/support/actions/actionUtils.js +1 -1
  8. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  9. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  10. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  11. package/widgets/Attachments.js +1 -1
  12. package/widgets/BasemapGallery.js +1 -1
  13. package/widgets/BasemapLayerList.js +1 -1
  14. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  15. package/widgets/BasemapToggle.js +1 -1
  16. package/widgets/BatchAttributeForm.js +1 -1
  17. package/widgets/Bookmarks.js +1 -1
  18. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  19. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  20. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  21. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  22. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  23. package/widgets/BuildingExplorer.js +1 -1
  24. package/widgets/CatalogLayerList.js +1 -1
  25. package/widgets/Compass.js +1 -1
  26. package/widgets/CoordinateConversion.js +1 -1
  27. package/widgets/Daylight.js +1 -1
  28. package/widgets/DirectionalPad.js +1 -1
  29. package/widgets/Directions.js +1 -1
  30. package/widgets/Editor/components/FeatureList.js +1 -1
  31. package/widgets/Editor/components/FooterActions.js +1 -1
  32. package/widgets/Editor/components/Notices.js +1 -1
  33. package/widgets/Editor/components/PanelContent.js +1 -1
  34. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  35. package/widgets/Editor/components/Prompt.js +1 -1
  36. package/widgets/Editor/components/Settings.js +1 -1
  37. package/widgets/Editor/components/UploadDetails.js +1 -1
  38. package/widgets/Editor.js +1 -1
  39. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  40. package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
  41. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  42. package/widgets/ElevationProfile.js +1 -1
  43. package/widgets/Expand.js +1 -1
  44. package/widgets/Feature/FeatureExpression.js +1 -1
  45. package/widgets/Feature/FeatureMedia.js +1 -1
  46. package/widgets/Feature/FeatureRelationship.js +1 -1
  47. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  48. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  49. package/widgets/Feature.js +1 -1
  50. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  51. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  52. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  53. package/widgets/FeatureForm.js +1 -1
  54. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  55. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  56. package/widgets/FeatureTable.js +1 -1
  57. package/widgets/FeatureTemplates.js +1 -1
  58. package/widgets/Features/FeaturesDrillIn.js +1 -1
  59. package/widgets/Features.js +1 -1
  60. package/widgets/Fullscreen.js +1 -1
  61. package/widgets/Home.js +1 -1
  62. package/widgets/LayerList/LayerListItem.js +1 -1
  63. package/widgets/LayerList.js +1 -1
  64. package/widgets/Legend/styles/card/CardView.js +1 -1
  65. package/widgets/LineOfSight.js +1 -1
  66. package/widgets/Locate.js +1 -1
  67. package/widgets/NavigationToggle.js +1 -1
  68. package/widgets/OrientedImageryViewer/components/Alert.js +1 -1
  69. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  70. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  71. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  72. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  73. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  74. package/widgets/OrientedImageryViewer/components/NavigationSettings.js +1 -1
  75. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  76. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  77. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  78. package/widgets/OrientedImageryViewer.js +1 -1
  79. package/widgets/PanoramicViewer.js +1 -1
  80. package/widgets/Print.js +1 -1
  81. package/widgets/ScaleRangeSlider.js +1 -1
  82. package/widgets/Search/SearchResultRenderer.js +1 -1
  83. package/widgets/Search.js +1 -1
  84. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  85. package/widgets/ShadowCast/components/DurationConfigurator.js +1 -1
  86. package/widgets/ShadowCast/components/ThresholdConfigurator.js +1 -1
  87. package/widgets/ShadowCast.js +1 -1
  88. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  89. package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
  90. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  91. package/widgets/Sketch.js +1 -1
  92. package/widgets/Slice.js +1 -1
  93. package/widgets/TableList.js +1 -1
  94. package/widgets/TimeSlider.js +1 -1
  95. package/widgets/TimeZoneLabel.js +1 -1
  96. package/widgets/Track.js +1 -1
  97. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  98. package/widgets/UtilityNetworkAssociations.js +1 -1
  99. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  100. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  101. package/widgets/UtilityNetworkTrace.js +1 -1
  102. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  103. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  104. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  105. package/widgets/ValuePicker.js +1 -1
  106. package/widgets/VideoPlayer/components/MetadataSection.js +1 -1
  107. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  108. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  109. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  110. package/widgets/VideoPlayer.js +1 -1
  111. package/widgets/Weather/LabeledSlider.js +1 -1
  112. package/widgets/Weather.js +1 -1
  113. package/widgets/Zoom.js +1 -1
  114. package/widgets/support/ColorPicker.js +1 -1
  115. package/widgets/support/FilterBuilder.js +1 -1
  116. package/widgets/support/FilterCondition.js +1 -1
  117. package/widgets/support/GridControls.js +1 -1
  118. package/widgets/support/LabeledSwitch.js +1 -1
  119. package/widgets/support/MeasurementWidgetContent.js +1 -1
  120. package/widgets/support/SelectionList.js +1 -1
  121. package/widgets/support/SelectionToolbar.js +1 -1
  122. package/widgets/support/SketchTooltipControls.js +1 -1
  123. package/widgets/support/SnappingControls.js +1 -1
  124. package/widgets/support/TimezonePicker.js +1 -1
  125. package/widgets/support/UnitSelect.js +1 -1
  126. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  127. package/widgets/support/componentsUtils.js +1 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import i from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{setFocus as F}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as O}from"./support/decorators/vmEvent.js";import{tsx as T}from"./support/jsxFactory.js";const P=t.ofType(y),A="nested";let j=class extends(i.IdentifiableMixin(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const r=_(t),a=L(t),n=_(i),d=L(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(p.item)));this._activeItem=_(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o))if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o!==i)this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l});else{const e=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(o,e)}}}initialize(){this.addHandles([s((()=>this.openedLayers),"change",(()=>this._handleOpenedLayersChange()),r),s((()=>this.viewModel.operationalItems),"change",(()=>f(this.selectedItems)),r),l((()=>[this.filterPredicate,this._rootListEl]),(()=>v(this._rootListEl,this.filterPredicate)))])}loadDependencies(){return b({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten((e=>e.children.filter((e=>"catalog-dynamic-group"!==e.layer?.type)))).length}get _visibleItems(){return this.operationalItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleItems.flatten((e=>e.children)).filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map(((t,i)=>this._renderLayerFlowItem(t,i===e.length-1)))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return T("div",{class:this.classes(p.base,C.widget,C.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach(((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))}));const l=await Promise.all(t.map((e=>this._createFlowList(e,s))));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?T("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(){return this._visibleItems?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderNoItemsMessage(){return T("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return T("div",{class:p.itemMessage,key:"geoscene-layer-list__no-items"},T("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return T("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map((({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return T("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),T("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,F(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,F(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,F(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[T("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),T("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},i.toArray().map((e=>this._renderItem(e))),s?T("div",{class:p.filterNoResults,slot:"filter-no-results"},T("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?T("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return T(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=_(i),l=_(e),r=_(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>_(e))).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],j.prototype,"_rootListEl",void 0),e([a()],j.prototype,"_activeItem",void 0),e([a()],j.prototype,"_tooltipReferenceMap",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_focusLayerFlowItem",void 0),e([a()],j.prototype,"_layerListMap",void 0),e([a()],j.prototype,"_totalItems",null),e([a()],j.prototype,"_visibleItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"_dragEnabled",null),e([a()],j.prototype,"_filterEnabled",null),e([a()],j.prototype,"_renderedOpenLayerFlowItems",null),e([a({readOnly:!0})],j.prototype,"catalogLayerList",void 0),e([a()],j.prototype,"catalogOptions",void 0),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"filterPredicate",void 0),e([a()],j.prototype,"filterText",void 0),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"knowledgeGraphOptions",void 0),e([a()],j.prototype,"label",null),e([a()],j.prototype,"layerTablesEnabled",void 0),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"listItemCreatedFunction",null),e([a()],j.prototype,"mapImageOptions",void 0),e([a(),M("geoscene/widgets/LayerList/t9n/LayerList")],j.prototype,"messages",void 0),e([a(),M("geoscene/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minDragEnabledItems",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],j.prototype,"openedLayers",void 0),e([a({readOnly:!0})],j.prototype,"openedLayerLists",void 0),e([a()],j.prototype,"operationalItems",null),e([a()],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a({readOnly:!0})],j.prototype,"tableList",void 0),e([a()],j.prototype,"tileOptions",void 0),e([a()],j.prototype,"view",null),e([O("trigger-action"),a({type:m})],j.prototype,"viewModel",void 0),e([a()],j.prototype,"visibilityAppearance",void 0),e([a({type:h,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([n("geoscene.widgets.LayerList")],j);const D=j;export{D as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import i from"../core/Identifiable.js";import o from"../core/ReactiveMap.js";import{on as s,watch as l,initial as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{css as p}from"./LayerList/css.js";import c from"./LayerList/LayerListItem.js";import m from"./LayerList/LayerListViewModel.js";import h from"./LayerList/LayerListVisibleElements.js";import y from"./LayerList/ListItem.js";import{minDragEnabledItems as u,minFilterItems as g,getItem as _,getLayerType as L,removeDestroyedListItems as f,setFilterPredicate as v,sortLayersToIds as I,sortChildLayersToIds as w}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as C}from"./support/globalCss.js";import{calciteListFilterProps as E}from"./support/listUtils.js";import{setFocus as F}from"./support/widgetUtils.js";import{messageBundle as M}from"./support/decorators/messageBundle.js";import{vmEvent as O}from"./support/decorators/vmEvent.js";import{tsx as T}from"./support/jsxFactory.js";const P=t.ofType(y),A="nested";let j=class extends(i.IdentifiableMixin(d)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new o,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new o,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=u,this.minFilterItems=g,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=_(e);if(!l?.sortable)return!1;const r=_(t),a=L(t),n=_(i),d=L(i),p=!!a&&!!d&&a===d,c={selected:l,from:r,to:n},m=t.group,h=i.group,y=r?.layer?.type??"",u=n?.layer?.type??"",g=new Set(["map-image","catalog","knowledge-graph"]),f="sublayer";return m&&h&&"function"==typeof s?s.call(null,c):p&&!g.has(y)&&!g.has(u)&&l?.layer?.type!==f},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find((e=>e.classList?.contains(p.item)));this._activeItem=_(t)},this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t}=this,{toEl:i,fromEl:o,dragEl:s,newIndex:l}=e;if(o&&i&&!(t?.newIndex===l&&t?.dragEl===s&&t?.toEl===i&&t?.fromEl===o))if(this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value,o!==i)this._moveLayerFromChildList({toEl:i,fromEl:o,dragEl:s,newIndex:l});else{const e=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));this._sortLayers(o,e)}}}initialize(){this.addHandles([s((()=>this.openedLayers),"change",(()=>this._handleOpenedLayersChange()),r),s((()=>this.viewModel.operationalItems),"change",(()=>f(this.selectedItems)),r),l((()=>[this.filterPredicate,this._rootListEl]),(()=>v(this._rootListEl,this.filterPredicate)))])}loadDependencies(){return b({button:()=>import("@geoscene/calcite-components/dist/components/calcite-button"),flow:()=>import("@geoscene/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@geoscene/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@geoscene/calcite-components/dist/components/calcite-list"),notice:()=>import("@geoscene/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@geoscene/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _totalItems(){return this.viewModel.operationalItems.flatten((e=>e.children.filter((e=>"catalog-dynamic-group"!==e.layer?.type)))).length}get _visibleItems(){return this.operationalItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleItems.flatten((e=>e.children)).filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get _dragEnabled(){return this._totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this._totalItems>=this.minFilterItems&&this.visibleElements.filter}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map(((t,i)=>this._renderLayerFlowItem(t,i===e.length-1)))}get icon(){return"layers"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[C.hidden]:"loading"===e,[C.disabled]:"disabled"===e};return T("div",{class:this.classes(p.base,C.widget,C.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:i}=this,o=i.get(e);if(o)return o;const s="catalog"===e.type?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||i.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();const o=new AbortController,{signal:s}=o;this._openedLayersController=o,e.forEach(((i,o)=>{t.includes(o)||(i.destroy(),e.delete(o))}));const l=await Promise.all(t.map((e=>this._createFlowList(e,s))));if(s.aborted)return;i.removeAll(),i.addMany(l);const r=i.at(-1);r?"catalogLayer"in r?(this._set("catalogLayerList",r),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",r)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:i}=this;return e?T("calcite-tooltip",{key:`tooltip-${e.layer?.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer?.uid)},i.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter((e=>!e.hidden)).toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderItemTooltips(){return this._visibleItems?.toArray().map((e=>this._renderItemTooltipNodes(e)))}_renderNoItemsMessage(){return T("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return T("div",{class:p.itemMessage,key:"geoscene-layer-list__no-items"},T("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}async _createCatalogLayerList(e){const{default:t}=await import("./CatalogLayerList.js"),{headingLevel:i,catalogOptions:o,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,_onCatalogOpen:p,_onTablesOpen:c,layerTablesEnabled:m}=this;return new t({headingLevel:i,view:s,filterPlaceholder:l,listItemCreatedFunction:r,minFilterItems:a,selectionMode:n,visibilityAppearance:d,...o,catalogLayer:e,layerTablesEnabled:m,onCatalogOpen:p,onTablesOpen:c})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:i,selectionMode:o,dragEnabled:s}=this;return new t({headingLevel:i,selectionMode:o,dragEnabled:s,...this._getTableListParams(e)})}_renderLayerFlowItem(e,t){const{messages:i,openedLayers:o}=this,s=e.title||this.messages.untitledLayer;return T("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:i["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),o.pop();const t=o.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map((({title:i,panel:o},s)=>{const l=()=>this._handlePanelFlowItemBack(o);return T("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:i,heading:o.title,headingLevel:this.headingLevel,key:`flow-panel-${o.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},o.render(),T("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,F(e))}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,F(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,F(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:i,_openedPanelItems:o,_filterEnabled:s,_rootGroupUid:l,visibleElements:{closeButton:r,collapseButton:a,heading:n,flow:d},_dragEnabled:c,selectionMode:m,filterText:h,openedLayers:y,filterPlaceholder:u,messages:g}=this,_=[T("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:r,closed:!e,collapsed:t,collapsible:a,heading:n?g.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!y.length&&!o.length,onCalciteFlowItemClose:()=>this.visible=!1},i?.length?null:this._renderNoItems(),T("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":l,displayMode:A,dragEnabled:c,filterEnabled:s,filterPlaceholder:u,filterProps:E,filterText:s?h:"",group:l,key:"root-list",label:g.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:m,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},i.toArray().map((e=>this._renderItem(e))),s?T("div",{class:p.filterNoResults,slot:"filter-no-results"},T("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?d?T("calcite-flow",{key:"root-flow"},_):_:null}_renderItem(e,t,i){return T(c,{activeItem:this._activeItem,canMove:this._canMove,css:p,displayMode:A,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:o}){const s=_(i),l=_(e),r=_(t);this.viewModel.moveListItem(s,r,l,o)}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_sortLayers(e,t){if(e)if(e===this._rootListEl)I(this.view?.map?.layers,t);else{const i=_(e);if(!i)return;w(i,t)}}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>_(e))).filter(Boolean);i.removeAll(),i.addMany(o)}};e([a()],j.prototype,"_rootListEl",void 0),e([a()],j.prototype,"_activeItem",void 0),e([a()],j.prototype,"_tooltipReferenceMap",void 0),e([a()],j.prototype,"_focusRootFlowItem",void 0),e([a()],j.prototype,"_focusPanelFlowItem",void 0),e([a()],j.prototype,"_focusLayerFlowItem",void 0),e([a()],j.prototype,"_layerListMap",void 0),e([a()],j.prototype,"_totalItems",null),e([a()],j.prototype,"_visibleItems",null),e([a()],j.prototype,"_openedPanelItems",null),e([a()],j.prototype,"_dragEnabled",null),e([a()],j.prototype,"_filterEnabled",null),e([a()],j.prototype,"_renderedOpenLayerFlowItems",null),e([a({readOnly:!0})],j.prototype,"catalogLayerList",void 0),e([a()],j.prototype,"catalogOptions",void 0),e([a()],j.prototype,"collapsed",void 0),e([a()],j.prototype,"dragEnabled",void 0),e([a()],j.prototype,"filterPlaceholder",void 0),e([a()],j.prototype,"filterPredicate",void 0),e([a()],j.prototype,"filterText",void 0),e([a()],j.prototype,"headingLevel",void 0),e([a()],j.prototype,"icon",null),e([a()],j.prototype,"knowledgeGraphOptions",void 0),e([a()],j.prototype,"label",null),e([a()],j.prototype,"layerTablesEnabled",void 0),e([a()],j.prototype,"listItemCanGiveFunction",void 0),e([a()],j.prototype,"listItemCanReceiveFunction",void 0),e([a()],j.prototype,"listItemCreatedFunction",null),e([a()],j.prototype,"mapImageOptions",void 0),e([a(),M("geoscene/widgets/LayerList/t9n/LayerList")],j.prototype,"messages",void 0),e([a(),M("geoscene/t9n/common")],j.prototype,"messagesCommon",void 0),e([a()],j.prototype,"minDragEnabledItems",void 0),e([a()],j.prototype,"minFilterItems",void 0),e([a({readOnly:!0})],j.prototype,"openedLayers",void 0),e([a({readOnly:!0})],j.prototype,"openedLayerLists",void 0),e([a()],j.prototype,"operationalItems",null),e([a()],j.prototype,"selectedItems",void 0),e([a()],j.prototype,"selectionMode",void 0),e([a({readOnly:!0})],j.prototype,"tableList",void 0),e([a()],j.prototype,"tileOptions",void 0),e([a()],j.prototype,"view",null),e([O("trigger-action"),a({type:m})],j.prototype,"viewModel",void 0),e([a()],j.prototype,"visibilityAppearance",void 0),e([a({type:h,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([n("geoscene.widgets.LayerList")],j);const D=j;export{D as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import o from"./LegendElement.js";import{loadCalciteComponents as n}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as a}from"../../../support/decorators/messageBundle.js";import{tsx as l}from"../../../support/jsxFactory.js";import{substitute as c}from"../../../../intl/substitute.js";const d=768;let p=class extends r{constructor(e,s){super(e,s),this._hasIndicators=!1,this.activeLayerInfos=null,this.headingLevel=3,this.layout="stack",this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}loadDependencies(){return n({carousel:()=>import("@esri/calcite-components/dist/components/calcite-carousel"),"carousel-item":()=>import("@esri/calcite-components/dist/components/calcite-carousel-item")})}render(){this._hasIndicators="auto"===this.layout&&this.view&&this.view.container.clientWidth<=d||"stack"===this.layout;const e=this._hasIndicators?this._renderCarousel():this._renderLayers(),s={[i.stacked]:this._hasIndicators};return l("div",{class:this.classes(i.base,s)},e||l("div",{class:i.message},this.messages.noLegend))}_renderCarousel(){const e=[],s=this.activeLayerInfos;if(s)for(const t of s)this._renderSections(t,e);return e?.length?l("calcite-carousel",{class:i.carousel,label:this.messages.carousel},e.map(((s,t)=>l("calcite-carousel-item",{class:i.carouselItem,key:t,label:c(this.messagesCommon.pagination.pageText,{index:t+1,total:e.length})},s)))):null}_renderLayers(){const e=this.activeLayerInfos,s=e?.toArray()?.map((e=>this._renderLegendForLayer(e))).filter(Boolean);return s?.length?s:null}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const s=e.children.toArray().map(this._renderLegendForLayer,this);return l("section",{class:this.classes(i.service,i.groupLayer),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},e.title),s)}return this._renderLegendElementsForLayer(e)}_renderLegendElementsForLayer(e){const s=e.legendElements?.filter(Boolean);if(!s?.length)return null;const t=s.map((s=>l(o,{activeLayerInfo:e,effectList:e.effectList,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages}))),r={[i.groupLayerChild]:!!e.parent};return l("section",{class:this.classes(i.service,r),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},l("div",{class:i.serviceCaptionText},e.title)),l("div",{class:i.serviceContent},t))}_renderSections(e,s){if(!e.ready)return;if(e.children.length)for(const r of e.children)this._renderSections(r,s);const t=e.legendElements;if(t?.length)for(const r of t){const t=l(o,{activeLayerInfo:e,effectList:e.effectList,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${r.type}`,layer:e.layer,legendElement:r,messages:this.messages});t&&s.push(t)}}};e([s()],p.prototype,"activeLayerInfos",void 0),e([s()],p.prototype,"headingLevel",void 0),e([s()],p.prototype,"layout",void 0),e([s(),a("geoscene/widgets/Legend/t9n/Legend")],p.prototype,"messages",void 0),e([s(),a("geoscene/t9n/common")],p.prototype,"messagesCommon",void 0),e([s({readOnly:!0})],p.prototype,"type",void 0),e([s()],p.prototype,"view",void 0),p=e([t("geoscene.widgets.Legend.styles.card.CardView")],p);export{p as default};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../intl.js";import{property as s}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../Widget.js";import{css as i}from"./css.js";import o from"./LegendElement.js";import{loadCalciteComponents as n}from"../../../support/componentsUtils.js";import"../../../support/widgetUtils.js";import{messageBundle as a}from"../../../support/decorators/messageBundle.js";import{tsx as l}from"../../../support/jsxFactory.js";import{substitute as c}from"../../../../intl/substitute.js";const d=768;let p=class extends r{constructor(e,s){super(e,s),this._hasIndicators=!1,this.activeLayerInfos=null,this.headingLevel=3,this.layout="stack",this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}loadDependencies(){return n({carousel:()=>import("@geoscene/calcite-components/dist/components/calcite-carousel"),"carousel-item":()=>import("@geoscene/calcite-components/dist/components/calcite-carousel-item")})}render(){this._hasIndicators="auto"===this.layout&&this.view&&this.view.container.clientWidth<=d||"stack"===this.layout;const e=this._hasIndicators?this._renderCarousel():this._renderLayers(),s={[i.stacked]:this._hasIndicators};return l("div",{class:this.classes(i.base,s)},e||l("div",{class:i.message},this.messages.noLegend))}_renderCarousel(){const e=[],s=this.activeLayerInfos;if(s)for(const t of s)this._renderSections(t,e);return e?.length?l("calcite-carousel",{class:i.carousel,label:this.messages.carousel},e.map(((s,t)=>l("calcite-carousel-item",{class:i.carouselItem,key:t,label:c(this.messagesCommon.pagination.pageText,{index:t+1,total:e.length})},s)))):null}_renderLayers(){const e=this.activeLayerInfos,s=e?.toArray()?.map((e=>this._renderLegendForLayer(e))).filter(Boolean);return s?.length?s:null}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const s=e.children.toArray().map(this._renderLegendForLayer,this);return l("section",{class:this.classes(i.service,i.groupLayer),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},e.title),s)}return this._renderLegendElementsForLayer(e)}_renderLegendElementsForLayer(e){const s=e.legendElements?.filter(Boolean);if(!s?.length)return null;const t=s.map((s=>l(o,{activeLayerInfo:e,effectList:e.effectList,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${s.type}`,layer:e.layer,legendElement:s,messages:this.messages}))),r={[i.groupLayerChild]:!!e.parent};return l("section",{class:this.classes(i.service,r),key:e.layer.uid},l("div",{class:i.serviceCaptionContainer},l("div",{class:i.serviceCaptionText},e.title)),l("div",{class:i.serviceContent},t))}_renderSections(e,s){if(!e.ready)return;if(e.children.length)for(const r of e.children)this._renderSections(r,s);const t=e.legendElements;if(t?.length)for(const r of t){const t=l(o,{activeLayerInfo:e,effectList:e.effectList,hasIndicators:this._hasIndicators,headingLevel:this.headingLevel,isChild:!1,key:`${e.layer.uid}-${r.type}`,layer:e.layer,legendElement:r,messages:this.messages});t&&s.push(t)}}};e([s()],p.prototype,"activeLayerInfos",void 0),e([s()],p.prototype,"headingLevel",void 0),e([s()],p.prototype,"layout",void 0),e([s(),a("geoscene/widgets/Legend/t9n/Legend")],p.prototype,"messages",void 0),e([s(),a("geoscene/t9n/common")],p.prototype,"messagesCommon",void 0),e([s({readOnly:!0})],p.prototype,"type",void 0),e([s()],p.prototype,"view",void 0),p=e([t("geoscene.widgets.Legend.styles.card.CardView")],p);export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import"../core/has.js";import s from"../core/Logger.js";import{ignoreAbortErrors as i}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./LineOfSight/LineOfSightViewModel.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as p}from"./support/jsxFactory.js";const c="geoscene-line-of-sight",h={base:c,actions:`${c}__actions`,container:`${c}__container`,error:`${c}__error`,hint:`${c}__hint`,hintText:`${c}__hint-text`,newAnalysisButton:`${c}__new-analysis-button`},m={newAnalysisButton:`${c}__new-button`,doneButton:`${c}__done-button`};let g=class extends r{constructor(e,n){super(e,n),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this._onNewAnalysis=()=>{i(this.viewModel.start())},this._onDone=()=>{this.viewModel.stop()},this._onContinue=()=>{this.viewModel.continue()},t(s.getLogger(this),"Line Of Sight","geoscene-line-of-sight",{version:"4.33"})}loadDependencies(){return a({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get icon(){return"line-of-sight"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){return p("div",{class:this.classes(h.base,d.widget,d.panel),role:"presentation"},this._renderContainerNode())}_renderContainerNode(){if(!this.visible)return null;if(!this.viewModel.supported)return this._renderUnsupportedMessage();let e=null;const t=[this._renderNewAnalysisButton()];return"creating"===this.viewModel.state?(e=this._renderHint(),t.unshift(this._renderDoneButton())):"created"===this.viewModel.state&&this.viewModel.targets.length>0&&t.unshift(this._renderContinueButton()),p("div",{class:h.container},e,p("div",{class:h.actions},t))}_renderUnsupportedMessage(){return p("div",{class:h.error,key:"geoscene-line-of-sight__unsupported"},p("p",null,this.messages.unsupported))}_renderHint(){return p("div",{class:h.hint,key:"geoscene-line-of-sight__hint"},p("p",{class:h.hintText},this.messages.hint))}_renderNewAnalysisButton(){return this._renderButton({className:h.newAnalysisButton,id:m.newAnalysisButton,label:this.messages.newAnalysis,onClick:this._onNewAnalysis,primary:!0})}_renderDoneButton(){return this._renderButton({id:m.doneButton,label:this.messages.done,onClick:this._onDone,primary:!1})}_renderContinueButton(){return this._renderButton({id:m.newAnalysisButton,label:this.messages.continueAnalysis,onClick:this._onContinue,primary:!1})}_renderButton({className:e,id:t,label:s,onClick:i,primary:n}){const o="disabled"===this.viewModel.state;return p("calcite-button",{appearance:n?"solid":"outline-fill",class:e,"data-id":t,disabled:o,key:t,onclick:i},s)}get test(){}};e([n()],g.prototype,"active",null),e([n({nonNullable:!0})],g.prototype,"analysis",null),e([n()],g.prototype,"icon",null),e([n()],g.prototype,"label",null),e([n(),u("geoscene/widgets/LineOfSight/t9n/LineOfSight")],g.prototype,"messages",void 0),e([n()],g.prototype,"view",null),e([n({type:l})],g.prototype,"viewModel",void 0),e([n()],g.prototype,"visible",null),g=e([o("geoscene.widgets.LineOfSight")],g);const _=g;export{_ as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import"../core/has.js";import s from"../core/Logger.js";import{ignoreAbortErrors as i}from"../core/promiseUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./LineOfSight/LineOfSightViewModel.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as p}from"./support/jsxFactory.js";const c="geoscene-line-of-sight",h={base:c,actions:`${c}__actions`,container:`${c}__container`,error:`${c}__error`,hint:`${c}__hint`,hintText:`${c}__hint-text`,newAnalysisButton:`${c}__new-analysis-button`},m={newAnalysisButton:`${c}__new-button`,doneButton:`${c}__done-button`};let g=class extends r{constructor(e,n){super(e,n),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this._onNewAnalysis=()=>{i(this.viewModel.start())},this._onDone=()=>{this.viewModel.stop()},this._onContinue=()=>{this.viewModel.continue()},t(s.getLogger(this),"Line Of Sight","geoscene-line-of-sight",{version:"4.33"})}loadDependencies(){return a({button:()=>import("@geoscene/calcite-components/dist/components/calcite-button")})}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get icon(){return"line-of-sight"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){return p("div",{class:this.classes(h.base,d.widget,d.panel),role:"presentation"},this._renderContainerNode())}_renderContainerNode(){if(!this.visible)return null;if(!this.viewModel.supported)return this._renderUnsupportedMessage();let e=null;const t=[this._renderNewAnalysisButton()];return"creating"===this.viewModel.state?(e=this._renderHint(),t.unshift(this._renderDoneButton())):"created"===this.viewModel.state&&this.viewModel.targets.length>0&&t.unshift(this._renderContinueButton()),p("div",{class:h.container},e,p("div",{class:h.actions},t))}_renderUnsupportedMessage(){return p("div",{class:h.error,key:"geoscene-line-of-sight__unsupported"},p("p",null,this.messages.unsupported))}_renderHint(){return p("div",{class:h.hint,key:"geoscene-line-of-sight__hint"},p("p",{class:h.hintText},this.messages.hint))}_renderNewAnalysisButton(){return this._renderButton({className:h.newAnalysisButton,id:m.newAnalysisButton,label:this.messages.newAnalysis,onClick:this._onNewAnalysis,primary:!0})}_renderDoneButton(){return this._renderButton({id:m.doneButton,label:this.messages.done,onClick:this._onDone,primary:!1})}_renderContinueButton(){return this._renderButton({id:m.newAnalysisButton,label:this.messages.continueAnalysis,onClick:this._onContinue,primary:!1})}_renderButton({className:e,id:t,label:s,onClick:i,primary:n}){const o="disabled"===this.viewModel.state;return p("calcite-button",{appearance:n?"solid":"outline-fill",class:e,"data-id":t,disabled:o,key:t,onclick:i},s)}get test(){}};e([n()],g.prototype,"active",null),e([n({nonNullable:!0})],g.prototype,"analysis",null),e([n()],g.prototype,"icon",null),e([n()],g.prototype,"label",null),e([n(),u("geoscene/widgets/LineOfSight/t9n/LineOfSight")],g.prototype,"messages",void 0),e([n()],g.prototype,"view",null),e([n({type:l})],g.prototype,"viewModel",void 0),e([n()],g.prototype,"visible",null),g=e([o("geoscene.widgets.LineOfSight")],g);const _=g;export{_ as default};
package/widgets/Locate.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as o}from"../core/deprecate.js";import t from"../core/Logger.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Locate/LocateViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as a}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{vmEvent as p}from"./support/decorators/vmEvent.js";import{tsx as d}from"./support/jsxFactory.js";const m={base:"geoscene-locate"};let g=class extends r{constructor(e,i){super(e,i),this.messages=null,this.messagesCommon=null,this.viewModel=new l,this._locate=()=>{const{viewModel:e}=this;"locating"===e.state?e.cancelLocate():e.locate().catch((()=>{}))},o(t.getLogger(this),"Locate","geoscene-locate",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(e){this.viewModel.geolocationOptions=e}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(e){this.viewModel.goToLocationEnabled=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"gps-off"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(e){this.viewModel.popupEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}cancelLocate(){this.viewModel.cancelLocate()}locate(){return this.viewModel.locate()}render(){const{viewModel:e,icon:o}=this,{state:t}=e,i="locating"===t,s=i?this.messagesCommon.cancel:this.messages.title,r="feature-unsupported"===t,l=this._localizeError(this.viewModel?.error);return d("div",{class:this.classes(m.base,a.widget)},!r&&d("calcite-button",{class:a.widgetButton,disabled:"disabled"===t,iconStart:i?void 0:o,kind:"neutral",label:s,onclick:this._locate,title:s},i?d("calcite-loader",{inline:!0,label:""}):null),l?d("calcite-tooltip",{open:!0,overlayPositioning:"fixed",placement:this._getPlacement(),referenceElement:this.container},l):null)}_getPlacement(){const{container:e,view:o}=this,t=e&&o?o.ui.getPosition(e):null;if(!t||"manual"===t)return"auto";const[i,s]=t.split("-");return`${"right"===s?"left":"right"}-${"bottom"===i?"end":"start"}`}_localizeError(e){return e instanceof GeolocationPositionError?e.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:e.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable:e instanceof Error?e.message:void 0}};e([i()],g.prototype,"geolocationOptions",null),e([i()],g.prototype,"goToLocationEnabled",null),e([i()],g.prototype,"goToOverride",null),e([i()],g.prototype,"graphic",null),e([i()],g.prototype,"icon",null),e([i()],g.prototype,"label",null),e([i(),c("geoscene/widgets/Locate/t9n/Locate")],g.prototype,"messages",void 0),e([i(),c("geoscene/t9n/common")],g.prototype,"messagesCommon",void 0),e([i()],g.prototype,"popupEnabled",null),e([i()],g.prototype,"scale",null),e([i()],g.prototype,"view",null),e([i({type:l}),p(["locate","locate-error"])],g.prototype,"viewModel",void 0),g=e([s("geoscene.widgets.Locate")],g);const u=g;export{u as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as o}from"../core/deprecate.js";import t from"../core/Logger.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./Locate/LocateViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as a}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{vmEvent as p}from"./support/decorators/vmEvent.js";import{tsx as d}from"./support/jsxFactory.js";const m={base:"geoscene-locate"};let g=class extends r{constructor(e,i){super(e,i),this.messages=null,this.messagesCommon=null,this.viewModel=new l,this._locate=()=>{const{viewModel:e}=this;"locating"===e.state?e.cancelLocate():e.locate().catch((()=>{}))},o(t.getLogger(this),"Locate","geoscene-locate",{version:"4.32"})}loadDependencies(){return n({button:()=>import("@geoscene/calcite-components/dist/components/calcite-button"),loader:()=>import("@geoscene/calcite-components/dist/components/calcite-loader"),tooltip:()=>import("@geoscene/calcite-components/dist/components/calcite-tooltip")})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(e){this.viewModel.geolocationOptions=e}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(e){this.viewModel.goToLocationEnabled=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get icon(){return"gps-off"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(e){this.viewModel.popupEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}cancelLocate(){this.viewModel.cancelLocate()}locate(){return this.viewModel.locate()}render(){const{viewModel:e,icon:o}=this,{state:t}=e,i="locating"===t,s=i?this.messagesCommon.cancel:this.messages.title,r="feature-unsupported"===t,l=this._localizeError(this.viewModel?.error);return d("div",{class:this.classes(m.base,a.widget)},!r&&d("calcite-button",{class:a.widgetButton,disabled:"disabled"===t,iconStart:i?void 0:o,kind:"neutral",label:s,onclick:this._locate,title:s},i?d("calcite-loader",{inline:!0,label:""}):null),l?d("calcite-tooltip",{open:!0,overlayPositioning:"fixed",placement:this._getPlacement(),referenceElement:this.container},l):null)}_getPlacement(){const{container:e,view:o}=this,t=e&&o?o.ui.getPosition(e):null;if(!t||"manual"===t)return"auto";const[i,s]=t.split("-");return`${"right"===s?"left":"right"}-${"bottom"===i?"end":"start"}`}_localizeError(e){return e instanceof GeolocationPositionError?e.code===GeolocationPositionError.PERMISSION_DENIED?this.messages?.permissionError:e.code===GeolocationPositionError.TIMEOUT?this.messages?.timeoutError:this.messages?.positionUnavailable:e instanceof Error?e.message:void 0}};e([i()],g.prototype,"geolocationOptions",null),e([i()],g.prototype,"goToLocationEnabled",null),e([i()],g.prototype,"goToOverride",null),e([i()],g.prototype,"graphic",null),e([i()],g.prototype,"icon",null),e([i()],g.prototype,"label",null),e([i(),c("geoscene/widgets/Locate/t9n/Locate")],g.prototype,"messages",void 0),e([i(),c("geoscene/t9n/common")],g.prototype,"messagesCommon",void 0),e([i()],g.prototype,"popupEnabled",null),e([i()],g.prototype,"scale",null),e([i()],g.prototype,"view",null),e([i({type:l}),p(["locate","locate-error"])],g.prototype,"viewModel",void 0),g=e([s("geoscene.widgets.Locate")],g);const u=g;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../chunks/tslib.es6.js";import{deprecateWidget as e}from"../core/deprecate.js";import o from"../core/Logger.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import{css as a}from"./NavigationToggle/css.js";import l from"./NavigationToggle/NavigationToggleViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{setFocus as p}from"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as d}from"./support/jsxFactory.js";let u=class extends r{constructor(t,i){super(t,i),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const t="pan"===this.viewModel?.navigationMode?this._rotateButton:this._panButton;p(t),this.toggle()},t?.isDefaultUI||e(o.getLogger(this),"Navigation Toggle","geoscene-navigation-toggle",{version:"4.32"})}normalizeCtorArgs(t={}){const{isDefaultUI:e,...o}=t;return o}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button")})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){"horizontal"!==t&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t="disabled"===this.viewModel?.state,e="pan"===this.viewModel?.navigationMode,o=this.messages.toggle;return d("div",{class:this.classes(a.base,g.widget,{[a.isLayoutHorizontal]:"horizontal"===this.layout})},d("calcite-button",{afterCreate:t=>{this._panButton=t},appearance:e?"outline-fill":"solid",class:g.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?void 0:-1,title:o}),d("calcite-button",{afterCreate:t=>{this._rotateButton=t},appearance:e?"solid":"outline-fill",class:g.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?-1:void 0,title:o}))}};t([i()],u.prototype,"icon",null),t([i()],u.prototype,"label",null),t([i({value:"vertical"})],u.prototype,"layout",null),t([i(),c("geoscene/widgets/NavigationToggle/t9n/NavigationToggle")],u.prototype,"messages",void 0),t([i()],u.prototype,"view",null),t([i({type:l})],u.prototype,"viewModel",void 0),u=t([s("geoscene.widgets.NavigationToggle")],u);const m=u;export{m as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import{deprecateWidget as e}from"../core/deprecate.js";import o from"../core/Logger.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import{css as a}from"./NavigationToggle/css.js";import l from"./NavigationToggle/NavigationToggleViewModel.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{setFocus as p}from"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as d}from"./support/jsxFactory.js";let u=class extends r{constructor(t,i){super(t,i),this.messages=null,this.viewModel=new l({isDefaultViewModel:!0}),this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const t="pan"===this.viewModel?.navigationMode?this._rotateButton:this._panButton;p(t),this.toggle()},t?.isDefaultUI||e(o.getLogger(this),"Navigation Toggle","geoscene-navigation-toggle",{version:"4.32"})}normalizeCtorArgs(t={}){const{isDefaultUI:e,...o}=t;return o}loadDependencies(){return n({button:()=>import("@geoscene/calcite-components/dist/components/calcite-button")})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){"horizontal"!==t&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t="disabled"===this.viewModel?.state,e="pan"===this.viewModel?.navigationMode,o=this.messages.toggle;return d("div",{class:this.classes(a.base,g.widget,{[a.isLayoutHorizontal]:"horizontal"===this.layout})},d("calcite-button",{afterCreate:t=>{this._panButton=t},appearance:e?"outline-fill":"solid",class:g.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?void 0:-1,title:o}),d("calcite-button",{afterCreate:t=>{this._rotateButton=t},appearance:e?"solid":"outline-fill",class:g.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:o,onclick:this._toggle,tabIndex:e?-1:void 0,title:o}))}};t([i()],u.prototype,"icon",null),t([i()],u.prototype,"label",null),t([i({value:"vertical"})],u.prototype,"layout",null),t([i(),c("geoscene/widgets/NavigationToggle/t9n/NavigationToggle")],u.prototype,"messages",void 0),t([i()],u.prototype,"view",null),t([i({type:l})],u.prototype,"viewModel",void 0),u=t([s("geoscene.widgets.NavigationToggle")],u);const m=u;export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as o}from"../../support/jsxFactory.js";const e=()=>t({alert:()=>import("@esri/calcite-components/dist/components/calcite-alert")});function i({autoCloseDuration:t,bind:e,icon:i,kind:s,message:l,onClose:n,open:r,title:a,tooltip:p}){return o("calcite-alert",{autoClose:!!t,autoCloseDuration:t??"medium",bind:e,icon:i,kind:s,label:a,open:r,slot:"alerts",onCalciteAlertClose:n},o("div",{slot:"title",title:p},a),l?o("div",{slot:"message"},l):null)}export{i as Alert,e as loadAlertComponents};
5
+ import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as o}from"../../support/jsxFactory.js";const e=()=>t({alert:()=>import("@geoscene/calcite-components/dist/components/calcite-alert")});function i({autoCloseDuration:t,bind:e,icon:i,kind:s,message:l,onClose:n,open:r,title:a,tooltip:p}){return o("calcite-alert",{autoClose:!!t,autoCloseDuration:t??"medium",bind:e,icon:i,kind:s,label:a,open:r,slot:"alerts",onCalciteAlertClose:n},o("div",{slot:"title",title:p},a),l?o("div",{slot:"message"},l):null)}export{i as Alert,e as loadAlertComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{substitute as o}from"../../../intl/substitute.js";import a from"../../Widget.js";import{css as n}from"../css.js";import{copyToClipboard as l}from"../imageMeasurementUtils.js";import{loadCalciteComponents as r}from"../../support/componentsUtils.js";import{tsx as i}from"../../support/jsxFactory.js";import{messageBundle as s}from"../../support/decorators/messageBundle.js";let m=class extends a{constructor(e){super(e),this.messages=null,this.messagesCommon=null,this.accuracy=null,this._selectedSystem="Basemap",this._handleSystemSelection=e=>{this._selectedSystem=e.target.value}}loadDependencies(){return r({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"),select:()=>import("@esri/calcite-components/dist/components/calcite-select"),option:()=>import("@esri/calcite-components/dist/components/calcite-option"),table:()=>import("@esri/calcite-components/dist/components/calcite-table"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell")})}get _renderLocationBlock(){const{groundCoordinates:e,_selectedSystem:t}=this;return e&&"XY"===t?i("calcite-block",{heading:this.getLocation(),headingLevel:6}):null}get _renderLocationTable(){const{groundCoordinates:e,messages:t,_selectedSystem:c,accuracy:o}=this,a={groundX:e.x.toFixed(3),accuracyX:null!=o?.x?o.x.toFixed(3):"",groundY:e.y.toFixed(3),accuracyY:null!=o?.y?o.y.toFixed(3):"",groundZ:e.z?e.z.toFixed(3):"",accuracyZ:null!=o?.z?o.z.toFixed(3):""};return e&&"Basemap"===c?i("calcite-table",{bordered:!0,caption:t.measurementTable,class:n.measurementsTable,scale:"s"},i("calcite-table-row",{slot:"table-header"},i("calcite-table-header",{alignment:"center",heading:t.type}),i("calcite-table-header",{alignment:"center",heading:t.value}),i("calcite-table-header",{alignment:"center",heading:t.accuracy})),i("calcite-table-row",null,i("calcite-table-cell",{alignment:"center"},t.x),i("calcite-table-cell",{alignment:"center"},a.groundX),i("calcite-table-cell",{alignment:"center"},a.accuracyX)),i("calcite-table-row",null,i("calcite-table-cell",{alignment:"center"},t.y),i("calcite-table-cell",{alignment:"center"},a.groundY),i("calcite-table-cell",{alignment:"center"},a.accuracyY)),i("calcite-table-row",null,i("calcite-table-cell",{alignment:"center"},t.z),i("calcite-table-cell",{alignment:"center"},a.groundZ),i("calcite-table-cell",{alignment:"center"},a.accuracyZ))):null}get _renderSystemSelect(){const{messages:e,messagesCommon:t}=this;return i("div",{class:n.measurementsBar},i("calcite-select",{bind:this,label:e.selectUnitSystem,scale:"m",width:"full",onCalciteSelectChange:this._handleSystemSelection},i("calcite-option",{value:"Basemap"},e.basemap),i("calcite-option",{value:"XY"},e.xy)),i("calcite-action",{icon:"copy-to-clipboard",onclick:()=>this.copyLocation(),scale:"s",slot:"control",text:"Copy",title:t.copy}))}copyLocation(){const{groundCoordinates:e}=this;if(!e)return;const t=this.getLocation();t&&l(t)}getLocation(){const{_selectedSystem:e,groundCoordinates:t,accuracy:c}=this;return"Basemap"===e?this.getBasemapLocation(t,c):this.getXYLocation(t)}getXYLocation(e){if(null==e?.longitude||null==e?.latitude)return"";const t={groundX:e.longitude.toFixed(3),groundY:e.latitude.toFixed(3)};return o("{groundX}° , {groundY}°",t)}getBasemapLocation(e,t){if(null==e?.x||null==e?.y)return"";const c={groundX:e.x.toFixed(3),accuracyX:t?.x?t.x.toFixed(3):0,groundY:e.y.toFixed(3),accuracyY:t?.y?t.y.toFixed(3):0,groundZ:e.z?e.z.toFixed(3):0,accuracyZ:t?.z?t.z.toFixed(3):0};return o("{groundX} ± {accuracyX}, {groundY} ± {accuracyY}, {groundZ} ± {accuracyZ}",c)}render(){return i("calcite-panel",{class:n.measurementResults,key:"ground-location-container"},this._renderSystemSelect,this._renderLocationBlock,this._renderLocationTable)}};e([t()],m.prototype,"messages",void 0),e([t(),s("geoscene/t9n/common")],m.prototype,"messagesCommon",void 0),e([t()],m.prototype,"groundCoordinates",void 0),e([t()],m.prototype,"accuracy",void 0),e([t()],m.prototype,"_selectedSystem",void 0),e([t()],m.prototype,"_renderLocationBlock",null),e([t()],m.prototype,"_renderLocationTable",null),e([t()],m.prototype,"_renderSystemSelect",null),m=e([c("geoscene.widgets.OrientedImageryViewer.components.ImageLocationWidget")],m);const d=m;export{d as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{substitute as o}from"../../../intl/substitute.js";import a from"../../Widget.js";import{css as n}from"../css.js";import{copyToClipboard as l}from"../imageMeasurementUtils.js";import{loadCalciteComponents as r}from"../../support/componentsUtils.js";import{tsx as i}from"../../support/jsxFactory.js";import{messageBundle as s}from"../../support/decorators/messageBundle.js";let m=class extends a{constructor(e){super(e),this.messages=null,this.messagesCommon=null,this.accuracy=null,this._selectedSystem="Basemap",this._handleSystemSelection=e=>{this._selectedSystem=e.target.value}}loadDependencies(){return r({action:()=>import("@geoscene/calcite-components/dist/components/calcite-action"),block:()=>import("@geoscene/calcite-components/dist/components/calcite-block"),panel:()=>import("@geoscene/calcite-components/dist/components/calcite-panel"),select:()=>import("@geoscene/calcite-components/dist/components/calcite-select"),option:()=>import("@geoscene/calcite-components/dist/components/calcite-option"),table:()=>import("@geoscene/calcite-components/dist/components/calcite-table"),"table-row":()=>import("@geoscene/calcite-components/dist/components/calcite-table-row"),"table-header":()=>import("@geoscene/calcite-components/dist/components/calcite-table-header"),"table-cell":()=>import("@geoscene/calcite-components/dist/components/calcite-table-cell")})}get _renderLocationBlock(){const{groundCoordinates:e,_selectedSystem:t}=this;return e&&"XY"===t?i("calcite-block",{heading:this.getLocation(),headingLevel:6}):null}get _renderLocationTable(){const{groundCoordinates:e,messages:t,_selectedSystem:c,accuracy:o}=this,a={groundX:e.x.toFixed(3),accuracyX:null!=o?.x?o.x.toFixed(3):"",groundY:e.y.toFixed(3),accuracyY:null!=o?.y?o.y.toFixed(3):"",groundZ:e.z?e.z.toFixed(3):"",accuracyZ:null!=o?.z?o.z.toFixed(3):""};return e&&"Basemap"===c?i("calcite-table",{bordered:!0,caption:t.measurementTable,class:n.measurementsTable,scale:"s"},i("calcite-table-row",{slot:"table-header"},i("calcite-table-header",{alignment:"center",heading:t.type}),i("calcite-table-header",{alignment:"center",heading:t.value}),i("calcite-table-header",{alignment:"center",heading:t.accuracy})),i("calcite-table-row",null,i("calcite-table-cell",{alignment:"center"},t.x),i("calcite-table-cell",{alignment:"center"},a.groundX),i("calcite-table-cell",{alignment:"center"},a.accuracyX)),i("calcite-table-row",null,i("calcite-table-cell",{alignment:"center"},t.y),i("calcite-table-cell",{alignment:"center"},a.groundY),i("calcite-table-cell",{alignment:"center"},a.accuracyY)),i("calcite-table-row",null,i("calcite-table-cell",{alignment:"center"},t.z),i("calcite-table-cell",{alignment:"center"},a.groundZ),i("calcite-table-cell",{alignment:"center"},a.accuracyZ))):null}get _renderSystemSelect(){const{messages:e,messagesCommon:t}=this;return i("div",{class:n.measurementsBar},i("calcite-select",{bind:this,label:e.selectUnitSystem,scale:"m",width:"full",onCalciteSelectChange:this._handleSystemSelection},i("calcite-option",{value:"Basemap"},e.basemap),i("calcite-option",{value:"XY"},e.xy)),i("calcite-action",{icon:"copy-to-clipboard",onclick:()=>this.copyLocation(),scale:"s",slot:"control",text:"Copy",title:t.copy}))}copyLocation(){const{groundCoordinates:e}=this;if(!e)return;const t=this.getLocation();t&&l(t)}getLocation(){const{_selectedSystem:e,groundCoordinates:t,accuracy:c}=this;return"Basemap"===e?this.getBasemapLocation(t,c):this.getXYLocation(t)}getXYLocation(e){if(null==e?.longitude||null==e?.latitude)return"";const t={groundX:e.longitude.toFixed(3),groundY:e.latitude.toFixed(3)};return o("{groundX}° , {groundY}°",t)}getBasemapLocation(e,t){if(null==e?.x||null==e?.y)return"";const c={groundX:e.x.toFixed(3),accuracyX:t?.x?t.x.toFixed(3):0,groundY:e.y.toFixed(3),accuracyY:t?.y?t.y.toFixed(3):0,groundZ:e.z?e.z.toFixed(3):0,accuracyZ:t?.z?t.z.toFixed(3):0};return o("{groundX} ± {accuracyX}, {groundY} ± {accuracyY}, {groundZ} ± {accuracyZ}",c)}render(){return i("calcite-panel",{class:n.measurementResults,key:"ground-location-container"},this._renderSystemSelect,this._renderLocationBlock,this._renderLocationTable)}};e([t()],m.prototype,"messages",void 0),e([t(),s("geoscene/t9n/common")],m.prototype,"messagesCommon",void 0),e([t()],m.prototype,"groundCoordinates",void 0),e([t()],m.prototype,"accuracy",void 0),e([t()],m.prototype,"_selectedSystem",void 0),e([t()],m.prototype,"_renderLocationBlock",null),e([t()],m.prototype,"_renderLocationTable",null),e([t()],m.prototype,"_renderSystemSelect",null),m=e([c("geoscene.widgets.OrientedImageryViewer.components.ImageLocationWidget")],m);const d=m;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{measurementLengthUnits as t,measurementAreaUnits as a}from"../../../core/unitUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../Widget.js";import{css as c}from"../css.js";import{TriangulatedImageMeasurementMixin as i}from"../mixins/TriangulatedImageMeasurementMixin.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import{tsx as o}from"../../support/jsxFactory.js";import{UnitSelect as u}from"../../support/UnitSelect.js";import{messageBundle as m}from"../../support/decorators/messageBundle.js";let g=class extends(i(s)){constructor(e){super(e),this.messagesCommon=null}loadDependencies(){return l({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),table:()=>import("@esri/calcite-components/dist/components/calcite-table"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell")})}get _measurementResult(){const{measurementType:e,oiViewModel:t}=this,{areaMeasurementResult:a,heightMeasurementResult:r,distanceMeasurementResult:n}=t;switch(e){case"area":return a;case"height":return r;case"distance":return n}}get _measurementAccuracy(){const{measurementType:e,oiViewModel:t}=this,{areaMeasurementAccuracy:a,heightMeasurementAccuracy:r,distanceAccuracyArray:n}=t;switch(e){case"area":return a;case"height":return r;case"distance":return n}}get _measurementUnit(){const{measurementType:e,pixelAreaMeasurementUnit:t,pixelMeasurementUnit:a}=this;return"area"===e?t:a}get _measurementUnitOptions(){const{measurementType:e}=this;return"area"===e?a:t}_convertedMeasurement(){const{measurementType:e}=this;switch(e){case"area":return this.getConvertedAreaString("measurement");case"height":return this.getConvertedHeightString("measurement");case"distance":return this.getConvertedDistanceString("measurement")}}_measurementUnitChangeHandler(e){const{measurementType:t}=this;if("area"===t)this.pixelAreaMeasurementUnit=e;else this.pixelMeasurementUnit=e}_renderUnitSelect(){const{_measurementUnit:e,_measurementResult:t,_measurementUnitOptions:a,oiViewModel:r,messagesCommon:n}=this,{triangularMeasurementActive:s}=r;return t?o("div",{class:c.measurementsBar},o(u,{options:a,selectLabel:"",value:e,onChange:e=>this._measurementUnitChangeHandler(e)}),t?o("calcite-action",{bind:this,icon:"copy-to-clipboard",label:"copy",onclick:()=>this.copyActiveMeasurementResults(this.measurementType,s),scale:"s",text:"",title:n.copy}):null):null}_renderMeasurementResults(){const{_measurementResult:e,_measurementAccuracy:t,messages:a,measurementType:r}=this,{measurementTable:n,value:s,accuracy:i}=a;return e?o("calcite-table",{bordered:!0,caption:n,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:s}),o("calcite-table-header",{alignment:"center",heading:i})),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},this._convertedMeasurement()),o("calcite-table-cell",{alignment:"center"},"distance"===r&&Array.isArray(t)&&t?.length||"area"===r&&t||"height"===r&&t?this.getAccuracy(this.measurementType):o("calcite-icon",{icon:"hourglass-active",scale:"s"})))):null}_renderActiveMeasurementResults(){const{oiViewModel:e}=this,{triangularMeasurementActive:t,measureType:a}=e;if(t)switch(a){case"area":return this._renderTriangularAreaMeasurementResults();case"distance":return this._renderTriangularDistanceMeasurementResults()}return this._renderMeasurementResults()}_renderNewMeasurementButton(){const{messages:e,measurementType:t}=this;return o("calcite-button",{class:c.measurementsButton,onclick:()=>this.oiViewModel.initializeMeasurement(t)},e.newMeasurement)}_renderStartMeasurementMessage(){const{oiViewModel:{displayNewMeasurementButton:e},messages:t,_measurementResult:a}=this;return!e&&!a&&o("div",{class:c.measurementDisplay,key:`start-measurement-${this.measurementType}`},t.startMeasurement)}_renderTriangularAreaMeasurementResults(){const{messages:e,oiViewModel:t}=this,{measurementTable:a,value:r,accuracy:n}=e,{triangulatedAreaMeasurement:s}=t;return s?o("calcite-table",{bordered:!0,caption:a,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:r}),o("calcite-table-header",{alignment:"center",heading:n})),o("calcite-table-row",null,this._renderTriangularAreaCell("measurement"),this._renderTriangularAreaCell("accuracy"))):null}_renderTriangularDistanceAccuracyCell(){const{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return o("calcite-table-cell",{alignment:"center"},t?.distanceAccuracy?this.getConvertedTriangularDistanceMeasurementString(t.distanceAccuracy):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularAreaCell(e){const{oiViewModel:t}=this,{triangulatedAreaMeasurement:a}=t;return o("calcite-table-cell",{alignment:"center"},a?this.getConvertedTriangularAreaString(e):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularDistanceAngleAccuracyCell(){const{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return o("calcite-table-cell",{alignment:"center"},t?.angleAccuracy?this.getConvertedTriangularDistanceAngularResultsString(t.angleAccuracy):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularDistanceMeasurementResults(){const{oiViewModel:e,messages:t}=this,{distance:a,horizontal:r,vertical:n,slope:s,aspect:i,measurementTable:l,value:u,accuracy:m}=t,{triangulatedDistanceMeasurement:g,triangularMeasurementActive:d,measureType:p}=e;return d&&"distance"===p&&g?o("calcite-table",{bordered:!0,caption:l,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:"Type"}),o("calcite-table-header",{alignment:"center",heading:u}),o("calcite-table-header",{alignment:"center",heading:m})),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},a),o("calcite-table-cell",{alignment:"center"},g?.distance?this.getConvertedTriangularDistanceMeasurementString(g.distance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},r),o("calcite-table-cell",{alignment:"center"},g?.horizontalDistance?this.getConvertedTriangularDistanceMeasurementString(g.horizontalDistance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},n),o("calcite-table-cell",{alignment:"center"},g?.verticalDistance?this.getConvertedTriangularDistanceMeasurementString(g.verticalDistance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},s),o("calcite-table-cell",{alignment:"center"},g?.slope?this.getConvertedTriangularDistanceAngularResultsString(g.slope):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAngleAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},i),o("calcite-table-cell",{alignment:"center"},g?.aspect?this.getConvertedTriangularDistanceAngularResultsString(g.aspect):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAngleAccuracyCell())):null}render(){return o("calcite-panel",{class:c.measurementResults,key:`measurement-result-container-${this.measurementType}`},this._renderStartMeasurementMessage(),this._renderNewMeasurementButton(),this._renderUnitSelect(),this._renderActiveMeasurementResults())}};e([r(),m("geoscene/t9n/common")],g.prototype,"messagesCommon",void 0),e([r()],g.prototype,"_measurementResult",null),e([r()],g.prototype,"_measurementAccuracy",null),e([r()],g.prototype,"_measurementUnit",null),e([r()],g.prototype,"_measurementUnitOptions",null),g=e([n("geoscene.widgets.OrientedImageryViewer.components.ImageMeasurementWidget")],g);const d=g;export{d as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{measurementLengthUnits as t,measurementAreaUnits as a}from"../../../core/unitUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../../Widget.js";import{css as c}from"../css.js";import{TriangulatedImageMeasurementMixin as i}from"../mixins/TriangulatedImageMeasurementMixin.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import{tsx as o}from"../../support/jsxFactory.js";import{UnitSelect as u}from"../../support/UnitSelect.js";import{messageBundle as m}from"../../support/decorators/messageBundle.js";let g=class extends(i(s)){constructor(e){super(e),this.messagesCommon=null}loadDependencies(){return l({action:()=>import("@geoscene/calcite-components/dist/components/calcite-action"),panel:()=>import("@geoscene/calcite-components/dist/components/calcite-panel"),button:()=>import("@geoscene/calcite-components/dist/components/calcite-button"),table:()=>import("@geoscene/calcite-components/dist/components/calcite-table"),icon:()=>import("@geoscene/calcite-components/dist/components/calcite-icon"),"table-row":()=>import("@geoscene/calcite-components/dist/components/calcite-table-row"),"table-header":()=>import("@geoscene/calcite-components/dist/components/calcite-table-header"),"table-cell":()=>import("@geoscene/calcite-components/dist/components/calcite-table-cell")})}get _measurementResult(){const{measurementType:e,oiViewModel:t}=this,{areaMeasurementResult:a,heightMeasurementResult:r,distanceMeasurementResult:n}=t;switch(e){case"area":return a;case"height":return r;case"distance":return n}}get _measurementAccuracy(){const{measurementType:e,oiViewModel:t}=this,{areaMeasurementAccuracy:a,heightMeasurementAccuracy:r,distanceAccuracyArray:n}=t;switch(e){case"area":return a;case"height":return r;case"distance":return n}}get _measurementUnit(){const{measurementType:e,pixelAreaMeasurementUnit:t,pixelMeasurementUnit:a}=this;return"area"===e?t:a}get _measurementUnitOptions(){const{measurementType:e}=this;return"area"===e?a:t}_convertedMeasurement(){const{measurementType:e}=this;switch(e){case"area":return this.getConvertedAreaString("measurement");case"height":return this.getConvertedHeightString("measurement");case"distance":return this.getConvertedDistanceString("measurement")}}_measurementUnitChangeHandler(e){const{measurementType:t}=this;if("area"===t)this.pixelAreaMeasurementUnit=e;else this.pixelMeasurementUnit=e}_renderUnitSelect(){const{_measurementUnit:e,_measurementResult:t,_measurementUnitOptions:a,oiViewModel:r,messagesCommon:n}=this,{triangularMeasurementActive:s}=r;return t?o("div",{class:c.measurementsBar},o(u,{options:a,selectLabel:"",value:e,onChange:e=>this._measurementUnitChangeHandler(e)}),t?o("calcite-action",{bind:this,icon:"copy-to-clipboard",label:"copy",onclick:()=>this.copyActiveMeasurementResults(this.measurementType,s),scale:"s",text:"",title:n.copy}):null):null}_renderMeasurementResults(){const{_measurementResult:e,_measurementAccuracy:t,messages:a,measurementType:r}=this,{measurementTable:n,value:s,accuracy:i}=a;return e?o("calcite-table",{bordered:!0,caption:n,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:s}),o("calcite-table-header",{alignment:"center",heading:i})),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},this._convertedMeasurement()),o("calcite-table-cell",{alignment:"center"},"distance"===r&&Array.isArray(t)&&t?.length||"area"===r&&t||"height"===r&&t?this.getAccuracy(this.measurementType):o("calcite-icon",{icon:"hourglass-active",scale:"s"})))):null}_renderActiveMeasurementResults(){const{oiViewModel:e}=this,{triangularMeasurementActive:t,measureType:a}=e;if(t)switch(a){case"area":return this._renderTriangularAreaMeasurementResults();case"distance":return this._renderTriangularDistanceMeasurementResults()}return this._renderMeasurementResults()}_renderNewMeasurementButton(){const{messages:e,measurementType:t}=this;return o("calcite-button",{class:c.measurementsButton,onclick:()=>this.oiViewModel.initializeMeasurement(t)},e.newMeasurement)}_renderStartMeasurementMessage(){const{oiViewModel:{displayNewMeasurementButton:e},messages:t,_measurementResult:a}=this;return!e&&!a&&o("div",{class:c.measurementDisplay,key:`start-measurement-${this.measurementType}`},t.startMeasurement)}_renderTriangularAreaMeasurementResults(){const{messages:e,oiViewModel:t}=this,{measurementTable:a,value:r,accuracy:n}=e,{triangulatedAreaMeasurement:s}=t;return s?o("calcite-table",{bordered:!0,caption:a,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:r}),o("calcite-table-header",{alignment:"center",heading:n})),o("calcite-table-row",null,this._renderTriangularAreaCell("measurement"),this._renderTriangularAreaCell("accuracy"))):null}_renderTriangularDistanceAccuracyCell(){const{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return o("calcite-table-cell",{alignment:"center"},t?.distanceAccuracy?this.getConvertedTriangularDistanceMeasurementString(t.distanceAccuracy):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularAreaCell(e){const{oiViewModel:t}=this,{triangulatedAreaMeasurement:a}=t;return o("calcite-table-cell",{alignment:"center"},a?this.getConvertedTriangularAreaString(e):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularDistanceAngleAccuracyCell(){const{oiViewModel:e}=this,{triangulatedDistanceAccuracy:t}=e;return o("calcite-table-cell",{alignment:"center"},t?.angleAccuracy?this.getConvertedTriangularDistanceAngularResultsString(t.angleAccuracy):o("calcite-icon",{icon:"hourglass-active",scale:"s"}))}_renderTriangularDistanceMeasurementResults(){const{oiViewModel:e,messages:t}=this,{distance:a,horizontal:r,vertical:n,slope:s,aspect:i,measurementTable:l,value:u,accuracy:m}=t,{triangulatedDistanceMeasurement:g,triangularMeasurementActive:d,measureType:p}=e;return d&&"distance"===p&&g?o("calcite-table",{bordered:!0,caption:l,class:c.measurementsTable,scale:"s"},o("calcite-table-row",{slot:"table-header"},o("calcite-table-header",{alignment:"center",heading:"Type"}),o("calcite-table-header",{alignment:"center",heading:u}),o("calcite-table-header",{alignment:"center",heading:m})),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},a),o("calcite-table-cell",{alignment:"center"},g?.distance?this.getConvertedTriangularDistanceMeasurementString(g.distance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},r),o("calcite-table-cell",{alignment:"center"},g?.horizontalDistance?this.getConvertedTriangularDistanceMeasurementString(g.horizontalDistance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},n),o("calcite-table-cell",{alignment:"center"},g?.verticalDistance?this.getConvertedTriangularDistanceMeasurementString(g.verticalDistance):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},s),o("calcite-table-cell",{alignment:"center"},g?.slope?this.getConvertedTriangularDistanceAngularResultsString(g.slope):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAngleAccuracyCell()),o("calcite-table-row",null,o("calcite-table-cell",{alignment:"center"},i),o("calcite-table-cell",{alignment:"center"},g?.aspect?this.getConvertedTriangularDistanceAngularResultsString(g.aspect):o("calcite-icon",{icon:"hourglass-active",scale:"s"})),this._renderTriangularDistanceAngleAccuracyCell())):null}render(){return o("calcite-panel",{class:c.measurementResults,key:`measurement-result-container-${this.measurementType}`},this._renderStartMeasurementMessage(),this._renderNewMeasurementButton(),this._renderUnitSelect(),this._renderActiveMeasurementResults())}};e([r(),m("geoscene/t9n/common")],g.prototype,"messagesCommon",void 0),e([r()],g.prototype,"_measurementResult",null),e([r()],g.prototype,"_measurementAccuracy",null),e([r()],g.prototype,"_measurementUnit",null),e([r()],g.prototype,"_measurementUnitOptions",null),g=e([n("geoscene.widgets.OrientedImageryViewer.components.ImageMeasurementWidget")],g);const d=g;export{d as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Collection.js";import s from"../../../core/Identifiable.js";import{watch as a,syncAndInitial as i,on as o}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isEditableLayer as n}from"../../../layers/support/editableLayers.js";import c from"../../../support/actions/ActionToggle.js";import d from"../../Widget.js";import{css as h}from"../css.js";import{isValidDataCaptureLayer as p}from"../dataCaptureUtils.js";import m from"./OverlayLayersList.js";import{loadCalciteComponents as y}from"../../support/componentsUtils.js";import{globalCss as u}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{tsx as g}from"../../support/jsxFactory.js";let L=class extends(s.IdentifiableMixin(d)){constructor(e){super(e),this._previousAction=null,this.closed=!1,this.dataCaptureEnabled=!1,this.dataCaptureLayer=null,this.imageGeometryField=null,this.imageReferenceField=null,this.layerList=new m({selectionMode:"multiple"}),this.messages=null,this.overlayedLayers=new t,this.showCameraLocations=!1,this.showMapFeatures=!1,this._createSelectedItemsHandle=()=>{this.removeHandles("selected-items"),this.addHandles(this._trackLayerSelectionChanges(),"selected-items")},this._createDataCaptureLayerHandle=()=>a((()=>({dataCaptureLayer:this.dataCaptureLayer,operationalItems:this.layerList.operationalItems})),(({dataCaptureLayer:e,operationalItems:t},s)=>{if(!e&&s?.dataCaptureLayer){const e=t.find((e=>e.layer===s.dataCaptureLayer));e&&e.actionsSections?.items.forEach((e=>{e.items.forEach((e=>{"create-features"===e.id&&(e.value=!1)}))}))}}),i),this._handleSelectedItemsChange=({added:e,removed:t})=>{e.forEach((e=>{this.overlayedLayers.includes(e.layer)||this.onLayerSelected?.(e)})),t.forEach((e=>{this.overlayedLayers.includes(e.layer)&&this.onLayerDeselected?.(e)})),this.overlayedLayers.removeAll(),this.overlayedLayers.addMany(this.layerList.selectedItems.items.map((e=>e.layer)))},this._layerListTriggerActionHandle=()=>o((()=>this.layerList),"trigger-action",(e=>{const{action:t,item:{layer:s}}=e;if(this._resetPreviousAction(t),"create-features"===t.id)this._toggleDataCaptureLayer(t,s)})),this._resetPreviousAction=e=>{"toggle"===this._previousAction?.type&&this._previousAction!==e&&(this._previousAction.value=!1,this._previousAction=null)},this._toggleDataCaptureLayer=(e,t)=>{this._previousAction=e;const s=e.value;this.dataCaptureLayer=s?t:null,this.onDataCaptureLayerChanged?.(this.dataCaptureLayer)},this._trackLayerSelectionChanges=()=>o((()=>this.layerList.selectedItems),"change",this._handleSelectedItemsChange),this._watchLayerListForListItemCreatedFunction=()=>a((()=>({layerList:this.layerList,listItemCreatedFunction:this._listItemCreatedFunction})),(()=>{this.layerList.listItemCreatedFunction=this._listItemCreatedFunction}),i),this._watchSelectedItems=()=>a((()=>this.layerList.selectedItems),this._createSelectedItemsHandle,i)}initialize(){this.addHandles([this._watchSelectedItems(),this._layerListTriggerActionHandle(),this._watchLayerListForListItemCreatedFunction(),this._createDataCaptureLayerHandle()])}loadDependencies(){return y({list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}get _listItemCreatedFunction(){const{dataCaptureEnabled:e,imageGeometryField:t,imageReferenceField:s}=this;return e&&t&&s?async e=>{const{item:a}=e,i=a.layer,{dataCaptureLayer:o,overlayedLayers:r,messages:{createFeaturesFromImage:l},layerList:c}=this,d=r.includes(i),{selectedItems:h}=c;if(C(d,h,a),await(i?.load()),!i||!p(i,t,s)||!n(i))return;const m=o===i,y=_(l,a,h,m);m&&(this._previousAction=y)}:null}get view(){return this.layerList?.view}set view(e){this.layerList.view=e}_renderCameraLocationsSwitch(e){return g("calcite-list-item",{bind:this,label:this.messages.overlayCameraLocations,onclick:this._toggleShowCameraLocations},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowCameraLocations,scale:"s",slot:"actions-end"}))}_renderOverlayMapFeatures(e){return g("calcite-list-item",{bind:this,label:this.messages?.overlayMapFeatures,onclick:this._toggleShowMapFeatures},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowMapFeatures,scale:"s",slot:"actions-end"}))}_renderList(e){return e?g("div",{class:h.imageOverlaysLayerList},this.layerList.render()):null}_renderPanel(){const{closed:e,messages:t,showCameraLocations:s,showMapFeatures:a}=this;return g("calcite-panel",{bind:this,closable:!0,closed:e,heading:t.imageOverlays,onCalcitePanelClose:this.onImageOverlaysClosed},g("calcite-list",{label:t.imageOverlays},this._renderCameraLocationsSwitch(s),this._renderOverlayMapFeatures(a)),this._renderList(a))}_toggleShowCameraLocations(e){e.stopPropagation(),this.showCameraLocations=!this.showCameraLocations,this.onShowCameraLocationsChanged?.(this.showCameraLocations)}_toggleShowMapFeatures(e){e.stopPropagation(),this.showMapFeatures=!this.showMapFeatures,this.onShowMapFeaturesChanged?.(this.showMapFeatures)}render(){const e=this.layerList.operationalItems.items.length,t=this.showMapFeatures&&0===e,s=this.showMapFeatures&&e>0,a={[u.widget]:!0,[h.imageOverlaysNoResult]:t,[h.imageOverlaysIncreasedHeight]:s,[h.imageOverlays]:!t&&!s};return g("div",{class:this.classes(a)},this._renderPanel())}};e([r()],L.prototype,"_previousAction",void 0),e([r()],L.prototype,"_listItemCreatedFunction",null),e([r()],L.prototype,"closed",void 0),e([r()],L.prototype,"dataCaptureEnabled",void 0),e([r()],L.prototype,"dataCaptureLayer",void 0),e([r()],L.prototype,"imageGeometryField",void 0),e([r()],L.prototype,"imageReferenceField",void 0),e([r()],L.prototype,"layerList",void 0),e([r()],L.prototype,"messages",void 0),e([r()],L.prototype,"onDataCaptureLayerChanged",void 0),e([r()],L.prototype,"onImageOverlaysClosed",void 0),e([r()],L.prototype,"onLayerDeselected",void 0),e([r()],L.prototype,"onLayerSelected",void 0),e([r()],L.prototype,"onShowCameraLocationsChanged",void 0),e([r()],L.prototype,"onShowMapFeaturesChanged",void 0),e([r()],L.prototype,"overlayedLayers",void 0),e([r()],L.prototype,"showCameraLocations",void 0),e([r()],L.prototype,"showMapFeatures",void 0),e([r()],L.prototype,"view",null),L=e([l("geoscene.widgets.OrientedImageryViewer.components.ImageOverlays")],L);const v=L;function C(e,t,s){e&&t.items.push(s)}function w(e,s){const a=new t;a.add(e),s.actionsSections=new t([a])}function _(e,t,s,o=!1){const r=new c({icon:"pencil",id:"create-features",title:e,value:o});return t.addHandles(a((()=>s.includes(t)),(e=>{r.visible=e}),i)),w(r,t),r}export{v as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Collection.js";import s from"../../../core/Identifiable.js";import{watch as a,syncAndInitial as i,on as o}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{isEditableLayer as n}from"../../../layers/support/editableLayers.js";import c from"../../../support/actions/ActionToggle.js";import d from"../../Widget.js";import{css as h}from"../css.js";import{isValidDataCaptureLayer as p}from"../dataCaptureUtils.js";import m from"./OverlayLayersList.js";import{loadCalciteComponents as y}from"../../support/componentsUtils.js";import{globalCss as u}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{tsx as g}from"../../support/jsxFactory.js";let L=class extends(s.IdentifiableMixin(d)){constructor(e){super(e),this._previousAction=null,this.closed=!1,this.dataCaptureEnabled=!1,this.dataCaptureLayer=null,this.imageGeometryField=null,this.imageReferenceField=null,this.layerList=new m({selectionMode:"multiple"}),this.messages=null,this.overlayedLayers=new t,this.showCameraLocations=!1,this.showMapFeatures=!1,this._createSelectedItemsHandle=()=>{this.removeHandles("selected-items"),this.addHandles(this._trackLayerSelectionChanges(),"selected-items")},this._createDataCaptureLayerHandle=()=>a((()=>({dataCaptureLayer:this.dataCaptureLayer,operationalItems:this.layerList.operationalItems})),(({dataCaptureLayer:e,operationalItems:t},s)=>{if(!e&&s?.dataCaptureLayer){const e=t.find((e=>e.layer===s.dataCaptureLayer));e&&e.actionsSections?.items.forEach((e=>{e.items.forEach((e=>{"create-features"===e.id&&(e.value=!1)}))}))}}),i),this._handleSelectedItemsChange=({added:e,removed:t})=>{e.forEach((e=>{this.overlayedLayers.includes(e.layer)||this.onLayerSelected?.(e)})),t.forEach((e=>{this.overlayedLayers.includes(e.layer)&&this.onLayerDeselected?.(e)})),this.overlayedLayers.removeAll(),this.overlayedLayers.addMany(this.layerList.selectedItems.items.map((e=>e.layer)))},this._layerListTriggerActionHandle=()=>o((()=>this.layerList),"trigger-action",(e=>{const{action:t,item:{layer:s}}=e;if(this._resetPreviousAction(t),"create-features"===t.id)this._toggleDataCaptureLayer(t,s)})),this._resetPreviousAction=e=>{"toggle"===this._previousAction?.type&&this._previousAction!==e&&(this._previousAction.value=!1,this._previousAction=null)},this._toggleDataCaptureLayer=(e,t)=>{this._previousAction=e;const s=e.value;this.dataCaptureLayer=s?t:null,this.onDataCaptureLayerChanged?.(this.dataCaptureLayer)},this._trackLayerSelectionChanges=()=>o((()=>this.layerList.selectedItems),"change",this._handleSelectedItemsChange),this._watchLayerListForListItemCreatedFunction=()=>a((()=>({layerList:this.layerList,listItemCreatedFunction:this._listItemCreatedFunction})),(()=>{this.layerList.listItemCreatedFunction=this._listItemCreatedFunction}),i),this._watchSelectedItems=()=>a((()=>this.layerList.selectedItems),this._createSelectedItemsHandle,i)}initialize(){this.addHandles([this._watchSelectedItems(),this._layerListTriggerActionHandle(),this._watchLayerListForListItemCreatedFunction(),this._createDataCaptureLayerHandle()])}loadDependencies(){return y({list:()=>import("@geoscene/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@geoscene/calcite-components/dist/components/calcite-list-item"),panel:()=>import("@geoscene/calcite-components/dist/components/calcite-panel"),switch:()=>import("@geoscene/calcite-components/dist/components/calcite-switch")})}get _listItemCreatedFunction(){const{dataCaptureEnabled:e,imageGeometryField:t,imageReferenceField:s}=this;return e&&t&&s?async e=>{const{item:a}=e,i=a.layer,{dataCaptureLayer:o,overlayedLayers:r,messages:{createFeaturesFromImage:l},layerList:c}=this,d=r.includes(i),{selectedItems:h}=c;if(C(d,h,a),await(i?.load()),!i||!p(i,t,s)||!n(i))return;const m=o===i,y=_(l,a,h,m);m&&(this._previousAction=y)}:null}get view(){return this.layerList?.view}set view(e){this.layerList.view=e}_renderCameraLocationsSwitch(e){return g("calcite-list-item",{bind:this,label:this.messages.overlayCameraLocations,onclick:this._toggleShowCameraLocations},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowCameraLocations,scale:"s",slot:"actions-end"}))}_renderOverlayMapFeatures(e){return g("calcite-list-item",{bind:this,label:this.messages?.overlayMapFeatures,onclick:this._toggleShowMapFeatures},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowMapFeatures,scale:"s",slot:"actions-end"}))}_renderList(e){return e?g("div",{class:h.imageOverlaysLayerList},this.layerList.render()):null}_renderPanel(){const{closed:e,messages:t,showCameraLocations:s,showMapFeatures:a}=this;return g("calcite-panel",{bind:this,closable:!0,closed:e,heading:t.imageOverlays,onCalcitePanelClose:this.onImageOverlaysClosed},g("calcite-list",{label:t.imageOverlays},this._renderCameraLocationsSwitch(s),this._renderOverlayMapFeatures(a)),this._renderList(a))}_toggleShowCameraLocations(e){e.stopPropagation(),this.showCameraLocations=!this.showCameraLocations,this.onShowCameraLocationsChanged?.(this.showCameraLocations)}_toggleShowMapFeatures(e){e.stopPropagation(),this.showMapFeatures=!this.showMapFeatures,this.onShowMapFeaturesChanged?.(this.showMapFeatures)}render(){const e=this.layerList.operationalItems.items.length,t=this.showMapFeatures&&0===e,s=this.showMapFeatures&&e>0,a={[u.widget]:!0,[h.imageOverlaysNoResult]:t,[h.imageOverlaysIncreasedHeight]:s,[h.imageOverlays]:!t&&!s};return g("div",{class:this.classes(a)},this._renderPanel())}};e([r()],L.prototype,"_previousAction",void 0),e([r()],L.prototype,"_listItemCreatedFunction",null),e([r()],L.prototype,"closed",void 0),e([r()],L.prototype,"dataCaptureEnabled",void 0),e([r()],L.prototype,"dataCaptureLayer",void 0),e([r()],L.prototype,"imageGeometryField",void 0),e([r()],L.prototype,"imageReferenceField",void 0),e([r()],L.prototype,"layerList",void 0),e([r()],L.prototype,"messages",void 0),e([r()],L.prototype,"onDataCaptureLayerChanged",void 0),e([r()],L.prototype,"onImageOverlaysClosed",void 0),e([r()],L.prototype,"onLayerDeselected",void 0),e([r()],L.prototype,"onLayerSelected",void 0),e([r()],L.prototype,"onShowCameraLocationsChanged",void 0),e([r()],L.prototype,"onShowMapFeaturesChanged",void 0),e([r()],L.prototype,"overlayedLayers",void 0),e([r()],L.prototype,"showCameraLocations",void 0),e([r()],L.prototype,"showMapFeatures",void 0),e([r()],L.prototype,"view",null),L=e([l("geoscene.widgets.OrientedImageryViewer.components.ImageOverlays")],L);const v=L;function C(e,t,s){e&&t.items.push(s)}function w(e,s){const a=new t;a.add(e),s.actionsSections=new t([a])}function _(e,t,s,o=!1){const r=new c({icon:"pencil",id:"create-features",title:e,value:o});return t.addHandles(a((()=>s.includes(t)),(e=>{r.visible=e}),i)),w(r,t),r}export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../views/MapView.js";import r from"../../Widget.js";import a from"./ImageViewerViewModel.js";import n from"./NavigationUI.js";import{loadSequentialNavigationUIComponents as s,SequentialNavigationUI as l}from"./SequentialNavigationUI.js";import{loadCalciteComponents as d}from"../../support/componentsUtils.js";import{globalCss as p}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{vmEvent as g}from"../../support/decorators/vmEvent.js";import{tsx as c}from"../../support/jsxFactory.js";const h="geoscene-image-viewer";let u=class extends r{constructor(){super(...arguments),this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=async e=>this.viewModel.loadImage(e),this.navigate=async(e,t)=>await this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([d({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")}),s()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get brightness(){return this.viewModel.brightness}set brightness(e){this.viewModel.brightness=e}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get contrast(){return this.viewModel.contrast}set contrast(e){this.viewModel.contrast=e}get currentNode(){return this.navigationViewModel?.currentNode}get customParameters(){return this.viewModel.customParameters}set customParameters(e){this.viewModel.customParameters=e}get error(){return this.viewModel.error}get imageSize(){const e=this.viewModel.image?.serviceRasterInfo;return e?[e.width,e.height]:[0,0]}get imagePointsInView(){return this.viewModel.imagePointsInView}get imageRenderer(){return this.viewModel.imageRenderer}get imageRotation(){return this.viewModel.imageRotation}set imageRotation(e){this.viewModel.imageRotation=e}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get sharpness(){return this.viewModel.sharpness}set sharpness(e){this.viewModel.sharpness=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get _navigationUI(){return c(n,{cameraHeadingThreshold:this.navigationViewModel?.cameraHeadingThreshold,cameraPitchThreshold:this.navigationViewModel?.cameraPitchThreshold,currentNode:this.currentNode,navigate:this.navigate,nodes:this.navigationNodes,preserveAngle:this.navigationViewModel?.preserveAngle??"none"})}get _sequentialNavigationUI(){return c(l,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return c("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(p.widget,h),loading:this.viewModel.updating},this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([t({type:Boolean})],u.prototype,"autoLoad",null),e([t({type:Number}),t()],u.prototype,"brightness",null),e([t()],u.prototype,"clickAction",null),e([t({type:Number})],u.prototype,"contrast",null),e([t()],u.prototype,"currentNode",null),e([t({type:Object})],u.prototype,"customParameters",null),e([t({readOnly:!0})],u.prototype,"error",null),e([t()],u.prototype,"imageSize",null),e([t({readOnly:!0})],u.prototype,"imagePointsInView",null),e([t({readOnly:!0,type:o})],u.prototype,"imageRenderer",null),e([t()],u.prototype,"imageRotation",null),e([t()],u.prototype,"imageSource",null),e([t({type:Boolean})],u.prototype,"navigationEnabled",void 0),e([t()],u.prototype,"navigationNodes",null),e([t()],u.prototype,"navigationMode",null),e([t()],u.prototype,"navigationViewModel",null),e([t({type:Number})],u.prototype,"sharpness",null),e([t({readOnly:!0})],u.prototype,"state",null),e([t()],u.prototype,"ui",null),e([t()],u.prototype,"uiStrings",void 0),e([g(["click","hittest-response","pixel-location"]),t({type:a})],u.prototype,"viewModel",void 0),e([t()],u.prototype,"_navigationUI",null),e([t()],u.prototype,"_sequentialNavigationUI",null),u=e([i("geoscene.widgets.OrientedImageryViewer.components.ImageViewer")],u);const m=u;export{m as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../../views/MapView.js";import r from"../../Widget.js";import a from"./ImageViewerViewModel.js";import n from"./NavigationUI.js";import{loadSequentialNavigationUIComponents as s,SequentialNavigationUI as l}from"./SequentialNavigationUI.js";import{loadCalciteComponents as d}from"../../support/componentsUtils.js";import{globalCss as p}from"../../support/globalCss.js";import"../../support/widgetUtils.js";import{vmEvent as g}from"../../support/decorators/vmEvent.js";import{tsx as c}from"../../support/jsxFactory.js";const h="geoscene-image-viewer";let u=class extends r{constructor(){super(...arguments),this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=async e=>this.viewModel.loadImage(e),this.navigate=async(e,t)=>await this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([d({panel:()=>import("@geoscene/calcite-components/dist/components/calcite-panel")}),s()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get brightness(){return this.viewModel.brightness}set brightness(e){this.viewModel.brightness=e}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get contrast(){return this.viewModel.contrast}set contrast(e){this.viewModel.contrast=e}get currentNode(){return this.navigationViewModel?.currentNode}get customParameters(){return this.viewModel.customParameters}set customParameters(e){this.viewModel.customParameters=e}get error(){return this.viewModel.error}get imageSize(){const e=this.viewModel.image?.serviceRasterInfo;return e?[e.width,e.height]:[0,0]}get imagePointsInView(){return this.viewModel.imagePointsInView}get imageRenderer(){return this.viewModel.imageRenderer}get imageRotation(){return this.viewModel.imageRotation}set imageRotation(e){this.viewModel.imageRotation=e}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get sharpness(){return this.viewModel.sharpness}set sharpness(e){this.viewModel.sharpness=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get _navigationUI(){return c(n,{cameraHeadingThreshold:this.navigationViewModel?.cameraHeadingThreshold,cameraPitchThreshold:this.navigationViewModel?.cameraPitchThreshold,currentNode:this.currentNode,navigate:this.navigate,nodes:this.navigationNodes,preserveAngle:this.navigationViewModel?.preserveAngle??"none"})}get _sequentialNavigationUI(){return c(l,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return c("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(p.widget,h),loading:this.viewModel.updating},this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([t({type:Boolean})],u.prototype,"autoLoad",null),e([t({type:Number}),t()],u.prototype,"brightness",null),e([t()],u.prototype,"clickAction",null),e([t({type:Number})],u.prototype,"contrast",null),e([t()],u.prototype,"currentNode",null),e([t({type:Object})],u.prototype,"customParameters",null),e([t({readOnly:!0})],u.prototype,"error",null),e([t()],u.prototype,"imageSize",null),e([t({readOnly:!0})],u.prototype,"imagePointsInView",null),e([t({readOnly:!0,type:o})],u.prototype,"imageRenderer",null),e([t()],u.prototype,"imageRotation",null),e([t()],u.prototype,"imageSource",null),e([t({type:Boolean})],u.prototype,"navigationEnabled",void 0),e([t()],u.prototype,"navigationNodes",null),e([t()],u.prototype,"navigationMode",null),e([t()],u.prototype,"navigationViewModel",null),e([t({type:Number})],u.prototype,"sharpness",null),e([t({readOnly:!0})],u.prototype,"state",null),e([t()],u.prototype,"ui",null),e([t()],u.prototype,"uiStrings",void 0),e([g(["click","hittest-response","pixel-location"]),t({type:a})],u.prototype,"viewModel",void 0),e([t()],u.prototype,"_navigationUI",null),e([t()],u.prototype,"_sequentialNavigationUI",null),u=e([i("geoscene.widgets.OrientedImageryViewer.components.ImageViewer")],u);const m=u;export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/Collection.js";import i from"./NavigationAction.js";import{loadCalciteComponents as e}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as c}from"../../support/jsxFactory.js";function o(){return e({"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action")})}const n=t.ofType(i);function a(t){const{activeAction:i,actions:e}=t,o=e.length;return 0===o?c("div",{"data-testid":"no-actions",hidden:!0}):o>1?c("calcite-action-menu",{"data-testid":"action-menu",label:t.label,scale:t.scale},c("calcite-action",{active:!!i,"data-testid":"action-menu-trigger",icon:i?.icon??t.icon,slot:"trigger",text:i?.text??t.label,title:i?.title??t.title}),e.items.map((t=>c("calcite-action",{active:t.active,"data-testid":t.uid,disabled:t.disabled,icon:t.icon,key:t.uid,onclick:t.onclick,text:t.text,textEnabled:!0,title:t.title})))):c("calcite-action",{active:e.items[0].active,"data-testid":"action",disabled:e.items[0].disabled,icon:e.items[0].icon,onclick:e.items[0].onclick,text:e.items[0].text,title:e.items[0].title})}export{a as NavigationActions,n as NavigationActionsCollection,o as loadNavigationActionsComponents};
5
+ import t from"../../../core/Collection.js";import i from"./NavigationAction.js";import{loadCalciteComponents as e}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as c}from"../../support/jsxFactory.js";function o(){return e({"action-menu":()=>import("@geoscene/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@geoscene/calcite-components/dist/components/calcite-action")})}const n=t.ofType(i);function a(t){const{activeAction:i,actions:e}=t,o=e.length;return 0===o?c("div",{"data-testid":"no-actions",hidden:!0}):o>1?c("calcite-action-menu",{"data-testid":"action-menu",label:t.label,scale:t.scale},c("calcite-action",{active:!!i,"data-testid":"action-menu-trigger",icon:i?.icon??t.icon,slot:"trigger",text:i?.text??t.label,title:i?.title??t.title}),e.items.map((t=>c("calcite-action",{active:t.active,"data-testid":t.uid,disabled:t.disabled,icon:t.icon,key:t.uid,onclick:t.onclick,text:t.text,textEnabled:!0,title:t.title})))):c("calcite-action",{active:e.items[0].active,"data-testid":"action",disabled:e.items[0].disabled,icon:e.items[0].icon,onclick:e.items[0].onclick,text:e.items[0].text,title:e.items[0].title})}export{a as NavigationActions,n as NavigationActionsCollection,o as loadNavigationActionsComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{clamp as t}from"../../../core/mathUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import r from"../../Widget.js";import{css as o}from"../css.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/jsxFactory.js";const c=5;let h=class extends r{constructor(e){super(e),this.cameraHeadingThreshold=c,this.cameraPitchThreshold=c,this.uiStrings=null,this.preserveHeading=!1,this.preservePitch=!1,this._handleHeadingThresholdChange=e=>{this.cameraHeadingThreshold=+e.target.value,this.onInputChange?.("cameraHeading",this.cameraHeadingThreshold)},this._handleHeadingToggle=()=>{const{preserveHeading:e,preservePitch:t}=this;this.preserveHeading=!e,this.onToggle?.(this.preserveHeading?t?"both":"heading":t?"pitch":"none")},this._handlePitchThresholdChange=e=>{this.cameraPitchThreshold=+e.target.value,this.onInputChange?.("cameraPitch",this.cameraPitchThreshold)},this._handlePitchToggle=()=>{const{preserveHeading:e,preservePitch:t}=this;this.preservePitch=!t,this.onToggle?.(this.preservePitch?e?"both":"pitch":e?"heading":"none")}}loadDependencies(){return a({label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}static{this.vnodeSelector="calcite-panel"}render(){return n("calcite-panel",{heading:this.uiStrings.configureNavigation,scale:"s"},n("calcite-list",{class:o.navigationSettingsUI,label:this.uiStrings.configureNavigation,scale:"s",selectionMode:"multiple"},n("calcite-list-item",{description:this.uiStrings.preserveHeadingDescription,label:this.uiStrings.preserveHeading,selected:this.preserveHeading,value:this.uiStrings.preserveHeading,onCalciteListItemSelect:this._handleHeadingToggle},n("calcite-label",{layout:"inline",scale:"s",slot:"content-bottom"},this.uiStrings.thresholdLabel,n("calcite-input",{max:30,min:0,scale:"s",type:"number",value:`${this.cameraHeadingThreshold}`,onCalciteInputChange:this._handleHeadingThresholdChange}))),n("calcite-list-item",{description:this.uiStrings.preservePitchDescription,label:this.uiStrings.preservePitch,selected:this.preservePitch,value:this.uiStrings.preservePitch,onCalciteListItemSelect:this._handlePitchToggle},n("calcite-label",{layout:"inline",scale:"s",slot:"content-bottom"},this.uiStrings.thresholdLabel,n("calcite-input",{max:30,min:0,scale:"s",type:"number",value:`${this.cameraPitchThreshold}`,onCalciteInputChange:this._handlePitchThresholdChange})))))}};e([i({cast:e=>t(e,0,30)})],h.prototype,"cameraHeadingThreshold",void 0),e([i()],h.prototype,"onInputChange",void 0),e([i()],h.prototype,"onToggle",void 0),e([i({cast:e=>t(e,0,30)})],h.prototype,"cameraPitchThreshold",void 0),e([i()],h.prototype,"uiStrings",void 0),e([i()],h.prototype,"preserveHeading",void 0),e([i()],h.prototype,"preservePitch",void 0),h=e([s("geoscene.widgets.OrientedImageryViewer.components.NavigationSettings")],h);const l=h;export{l as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{clamp as t}from"../../../core/mathUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import r from"../../Widget.js";import{css as o}from"../css.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/jsxFactory.js";const c=5;let h=class extends r{constructor(e){super(e),this.cameraHeadingThreshold=c,this.cameraPitchThreshold=c,this.uiStrings=null,this.preserveHeading=!1,this.preservePitch=!1,this._handleHeadingThresholdChange=e=>{this.cameraHeadingThreshold=+e.target.value,this.onInputChange?.("cameraHeading",this.cameraHeadingThreshold)},this._handleHeadingToggle=()=>{const{preserveHeading:e,preservePitch:t}=this;this.preserveHeading=!e,this.onToggle?.(this.preserveHeading?t?"both":"heading":t?"pitch":"none")},this._handlePitchThresholdChange=e=>{this.cameraPitchThreshold=+e.target.value,this.onInputChange?.("cameraPitch",this.cameraPitchThreshold)},this._handlePitchToggle=()=>{const{preserveHeading:e,preservePitch:t}=this;this.preservePitch=!t,this.onToggle?.(this.preservePitch?e?"both":"pitch":e?"heading":"none")}}loadDependencies(){return a({label:()=>import("@geoscene/calcite-components/dist/components/calcite-label"),list:()=>import("@geoscene/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@geoscene/calcite-components/dist/components/calcite-list-item"),input:()=>import("@geoscene/calcite-components/dist/components/calcite-input"),panel:()=>import("@geoscene/calcite-components/dist/components/calcite-panel")})}static{this.vnodeSelector="calcite-panel"}render(){return n("calcite-panel",{heading:this.uiStrings.configureNavigation,scale:"s"},n("calcite-list",{class:o.navigationSettingsUI,label:this.uiStrings.configureNavigation,scale:"s",selectionMode:"multiple"},n("calcite-list-item",{description:this.uiStrings.preserveHeadingDescription,label:this.uiStrings.preserveHeading,selected:this.preserveHeading,value:this.uiStrings.preserveHeading,onCalciteListItemSelect:this._handleHeadingToggle},n("calcite-label",{layout:"inline",scale:"s",slot:"content-bottom"},this.uiStrings.thresholdLabel,n("calcite-input",{max:30,min:0,scale:"s",type:"number",value:`${this.cameraHeadingThreshold}`,onCalciteInputChange:this._handleHeadingThresholdChange}))),n("calcite-list-item",{description:this.uiStrings.preservePitchDescription,label:this.uiStrings.preservePitch,selected:this.preservePitch,value:this.uiStrings.preservePitch,onCalciteListItemSelect:this._handlePitchToggle},n("calcite-label",{layout:"inline",scale:"s",slot:"content-bottom"},this.uiStrings.thresholdLabel,n("calcite-input",{max:30,min:0,scale:"s",type:"number",value:`${this.cameraPitchThreshold}`,onCalciteInputChange:this._handlePitchThresholdChange})))))}};e([i({cast:e=>t(e,0,30)})],h.prototype,"cameraHeadingThreshold",void 0),e([i()],h.prototype,"onInputChange",void 0),e([i()],h.prototype,"onToggle",void 0),e([i({cast:e=>t(e,0,30)})],h.prototype,"cameraPitchThreshold",void 0),e([i()],h.prototype,"uiStrings",void 0),e([i()],h.prototype,"preserveHeading",void 0),e([i()],h.prototype,"preservePitch",void 0),h=e([s("geoscene.widgets.OrientedImageryViewer.components.NavigationSettings")],h);const l=h;export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{createTask as i}from"../../../core/asyncUtils.js";import{throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as e}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../Widget.js";import{css as c}from"../css.js";import a from"./NavigationUIPanoramicViewModel.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as d}from"../../support/jsxFactory.js";let p=class extends n{constructor(t){super(t),this.navigate=null,this.viewModel=new a,this._clickTask=null,this._handleClick=t=>{this._clickTask?.abort(),this._clickTask=i((async i=>{const r=t.target;if(!this.navigate||!this.currentNode)return;await e((()=>"compiled"===this.viewModel.state),{signal:i});const s=r.getAttribute("data-direction");o(i),await this.navigate(this.currentNode,{direction:s,signal:i})}))}}loadDependencies(){return l({icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}set currentNode(t){this.viewModel.currentNode=t}get currentNode(){return this.viewModel.currentNode}get nodes(){return this.viewModel.nodes}set nodes(t){this.viewModel.nodes=t}render(){const{currentNode:t}=this;if(!t)return null;const{currentHeading:i}=t,o={"--rotate-transform":` rotate(${-i}deg)`},e=t=>{const o=(t-(i??0)+360)%360;return o<45||o>=315?"towards":o>=135&&o<225?"backwards":o>=45&&o<135?"right":"left"},r=e(0),s=e(90),n=e(180),a=e(270);return d("div",{class:c.navigationUI},d("div",{class:c.navigationDirectionPad,styles:o},t[r]?d("calcite-icon",{class:this.classes(c.navigationDirection,c.navigationTop),"data-direction":r,icon:"chevron-up",key:"chevron-up",onclick:this._handleClick}):null,t[s]?d("calcite-icon",{class:this.classes(c.navigationDirection,c.navigationRight),"data-direction":s,icon:"chevron-right",key:"chevron-right",onclick:this._handleClick}):null,t[n]?d("calcite-icon",{class:this.classes(c.navigationDirection,c.navigationBottom),"data-direction":n,icon:"chevron-down",key:"chevron-down",onclick:this._handleClick}):null,t[a]?d("calcite-icon",{class:this.classes(c.navigationDirection,c.navigationLeft),"data-direction":a,icon:"chevron-left",key:"chevron-left",onclick:this._handleClick}):null))}};t([r()],p.prototype,"currentNode",null),t([r()],p.prototype,"navigate",void 0),t([r({nonNullable:!0})],p.prototype,"nodes",null),t([r()],p.prototype,"viewModel",void 0),t([r()],p.prototype,"_clickTask",void 0),p=t([s("geoscene.widgets.OrientedImageryViewer.components.NavigationUI360")],p);const h=p;export{h as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{createTask as i}from"../../../core/asyncUtils.js";import{throwIfAborted as o}from"../../../core/promiseUtils.js";import{whenOnce as e}from"../../../core/reactiveUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../../Widget.js";import{css as c}from"../css.js";import a from"./NavigationUIPanoramicViewModel.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as d}from"../../support/jsxFactory.js";let p=class extends n{constructor(t){super(t),this.navigate=null,this.viewModel=new a,this._clickTask=null,this._handleClick=t=>{this._clickTask?.abort(),this._clickTask=i((async i=>{const r=t.target;if(!this.navigate||!this.currentNode)return;await e((()=>"compiled"===this.viewModel.state),{signal:i});const s=r.getAttribute("data-direction");o(i),await this.navigate(this.currentNode,{direction:s,signal:i})}))}}loadDependencies(){return l({icon:()=>import("@geoscene/calcite-components/dist/components/calcite-icon")})}set currentNode(t){this.viewModel.currentNode=t}get currentNode(){return this.viewModel.currentNode}get nodes(){return this.viewModel.nodes}set nodes(t){this.viewModel.nodes=t}render(){const{currentNode:t}=this;if(!t)return null;const{currentHeading:i}=t,o={"--rotate-transform":` rotate(${-i}deg)`},e=t=>{const o=(t-(i??0)+360)%360;return o<45||o>=315?"towards":o>=135&&o<225?"backwards":o>=45&&o<135?"right":"left"},r=e(0),s=e(90),n=e(180),a=e(270);return d("div",{class:c.navigationUI},d("div",{class:c.navigationDirectionPad,styles:o},t[r]?d("calcite-icon",{class:this.classes(c.navigationDirection,c.navigationTop),"data-direction":r,icon:"chevron-up",key:"chevron-up",onclick:this._handleClick}):null,t[s]?d("calcite-icon",{class:this.classes(c.navigationDirection,c.navigationRight),"data-direction":s,icon:"chevron-right",key:"chevron-right",onclick:this._handleClick}):null,t[n]?d("calcite-icon",{class:this.classes(c.navigationDirection,c.navigationBottom),"data-direction":n,icon:"chevron-down",key:"chevron-down",onclick:this._handleClick}):null,t[a]?d("calcite-icon",{class:this.classes(c.navigationDirection,c.navigationLeft),"data-direction":a,icon:"chevron-left",key:"chevron-left",onclick:this._handleClick}):null))}};t([r()],p.prototype,"currentNode",null),t([r()],p.prototype,"navigate",void 0),t([r({nonNullable:!0})],p.prototype,"nodes",null),t([r()],p.prototype,"viewModel",void 0),t([r()],p.prototype,"_clickTask",void 0),p=t([s("geoscene.widgets.OrientedImageryViewer.components.NavigationUI360")],p);const h=p;export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as o}from"../../support/jsxFactory.js";function i(){return t({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad")})}function n(t){const{expandDisabled:i,layout:n,overlayPositioning:e,actions:c}=t;return o("calcite-action-pad",{expandDisabled:i,layout:n,overlayPositioning:e,slot:"fab"},c.map((t=>o("calcite-action",{icon:t.icon,key:t.title,onclick:t.onclick,scale:t.scale,text:t.text,title:t.title}))))}function e(t){const{uiStrings:i,layout:e,onAction:c}=t;return o(n,{actions:[{icon:"chevron-left",scale:"s",text:i.previous,title:i.previous,onclick:()=>{c({step:-1})}},{icon:"chevron-right",scale:"s",text:i.next,title:i.next,onclick:()=>{c({step:1})}}],expandDisabled:!0,layout:e,overlayPositioning:"fixed"})}export{n as FloatingActionPad,e as SequentialNavigationUI,i as loadSequentialNavigationUIComponents};
5
+ import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import"../../support/widgetUtils.js";import{tsx as o}from"../../support/jsxFactory.js";function i(){return t({action:()=>import("@geoscene/calcite-components/dist/components/calcite-action"),"action-pad":()=>import("@geoscene/calcite-components/dist/components/calcite-action-pad")})}function n(t){const{expandDisabled:i,layout:n,overlayPositioning:e,actions:c}=t;return o("calcite-action-pad",{expandDisabled:i,layout:n,overlayPositioning:e,slot:"fab"},c.map((t=>o("calcite-action",{icon:t.icon,key:t.title,onclick:t.onclick,scale:t.scale,text:t.text,title:t.title}))))}function e(t){const{uiStrings:i,layout:e,onAction:c}=t;return o(n,{actions:[{icon:"chevron-left",scale:"s",text:i.previous,title:i.previous,onclick:()=>{c({step:-1})}},{icon:"chevron-right",scale:"s",text:i.next,title:i.next,onclick:()=>{c({step:1})}}],expandDisabled:!0,layout:e,overlayPositioning:"fixed"})}export{n as FloatingActionPad,e as SequentialNavigationUI,i as loadSequentialNavigationUIComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
4
4
  */
5
- import{_ as o}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{get as s}from"../../../core/accessorSupport/get.js";import n from"../../Widget.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{tsx as c}from"../../support/jsxFactory.js";const r={point:()=>[p("pin","point","draw.point"),p("line","polyline","draw.polyline"),p("polygon","polygon","draw.polygon")],polyline:()=>[p("line","polyline","draw.polyline")],polygon:()=>[p("polygon","polygon","draw.polygon")]};let a=class extends n{constructor(o){super(o),this.messages=null,this.type=null}loadDependencies(){return i({"action-pad":()=>import("@esri/calcite-components/dist/components/calcite-action-pad"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action")})}static{this.vnodeSelector="calcite-action-pad"}render(){const{messages:o,type:t}=this,e=l(t);return c("calcite-action-pad",{expandDisabled:!0,layout:"horizontal",position:"start"},e.map((({icon:t,messageKey:e,action:n})=>{const i=s(o,e);return c("calcite-action-group",null,c("calcite-action",{alignment:"center",bind:this,"data-action":n,icon:t,onclick:this.onAction,text:i,title:i}))})))}};function p(o,t,e){return{icon:o,messageKey:e,action:`draw-${t}`}}function l(o){return[{icon:"cursor",messageKey:"selectFeature",action:"select-feature"},...r[o]?.()??[],{icon:"save",messageKey:"save",action:"save"},{icon:"trash",messageKey:"delete",action:"delete-feature"}]}o([t()],a.prototype,"messages",void 0),o([t()],a.prototype,"onAction",void 0),o([t()],a.prototype,"type",void 0),a=o([e("geoscene.widgets.OrientedImageryViewer.components.SketchTools")],a);const m=a;export{m as default};
5
+ import{_ as o}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{get as s}from"../../../core/accessorSupport/get.js";import n from"../../Widget.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{tsx as c}from"../../support/jsxFactory.js";const r={point:()=>[p("pin","point","draw.point"),p("line","polyline","draw.polyline"),p("polygon","polygon","draw.polygon")],polyline:()=>[p("line","polyline","draw.polyline")],polygon:()=>[p("polygon","polygon","draw.polygon")]};let a=class extends n{constructor(o){super(o),this.messages=null,this.type=null}loadDependencies(){return i({"action-pad":()=>import("@geoscene/calcite-components/dist/components/calcite-action-pad"),"action-group":()=>import("@geoscene/calcite-components/dist/components/calcite-action-group"),action:()=>import("@geoscene/calcite-components/dist/components/calcite-action")})}static{this.vnodeSelector="calcite-action-pad"}render(){const{messages:o,type:t}=this,e=l(t);return c("calcite-action-pad",{expandDisabled:!0,layout:"horizontal",position:"start"},e.map((({icon:t,messageKey:e,action:n})=>{const i=s(o,e);return c("calcite-action-group",null,c("calcite-action",{alignment:"center",bind:this,"data-action":n,icon:t,onclick:this.onAction,text:i,title:i}))})))}};function p(o,t,e){return{icon:o,messageKey:e,action:`draw-${t}`}}function l(o){return[{icon:"cursor",messageKey:"selectFeature",action:"select-feature"},...r[o]?.()??[],{icon:"save",messageKey:"save",action:"save"},{icon:"trash",messageKey:"delete",action:"delete-feature"}]}o([t()],a.prototype,"messages",void 0),o([t()],a.prototype,"onAction",void 0),o([t()],a.prototype,"type",void 0),a=o([e("geoscene.widgets.OrientedImageryViewer.components.SketchTools")],a);const m=a;export{m as default};