@arcgis/core 4.32.0-next.20250212 → 4.32.0-next.20250214

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 (196) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/04f9fb33fb2e33712290.js +1 -0
  3. package/assets/esri/core/workers/chunks/10ca2107c99fab6bcc3b.js +1 -0
  4. package/assets/esri/core/workers/chunks/17fe69462cba5eb895b8.js +1 -0
  5. package/assets/esri/core/workers/chunks/{12d6baeffd55a98a7c75.js → 1bf646c9fc352f98d1ca.js} +1 -1
  6. package/assets/esri/core/workers/chunks/1c357cdb067e28aff3f0.js +1 -0
  7. package/assets/esri/core/workers/chunks/2ebf66e21d155a27b23e.js +1 -0
  8. package/assets/esri/core/workers/chunks/{f429d95eb986f3d215f3.js → 391c200274bbeb92404c.js} +1 -1
  9. package/assets/esri/core/workers/chunks/3eacb4d1275f2d87825f.js +1 -0
  10. package/assets/esri/core/workers/chunks/{c0af54cc5938176ce764.js → 3fe7be535affae31de7e.js} +1 -1
  11. package/assets/esri/core/workers/chunks/401b731c0601f4d84ead.js +1 -0
  12. package/assets/esri/core/workers/chunks/4565cfc85f60960e3ea1.js +1 -0
  13. package/assets/esri/core/workers/chunks/{d0656e9d30eb3a66a8db.js → 4be39bc2d2edd94bdb75.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{62a1d60ad4bf6469c4dd.js → 584216b52413cf85fecc.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{8191dd3d7451b2e7b95e.js → 637e996209e0d241fbf7.js} +1 -1
  16. package/assets/esri/core/workers/chunks/68c187dbf7dea7064ed8.js +1 -0
  17. package/assets/esri/core/workers/chunks/{77bfd4f819096cb754ae.js → 6e92569a4a82592b95dc.js} +1 -1
  18. package/assets/esri/core/workers/chunks/6f007703662e714b2f0a.js +1 -0
  19. package/assets/esri/core/workers/chunks/71a64fbea3512d9a1547.js +1 -0
  20. package/assets/esri/core/workers/chunks/744bdf2bb0cc38e6a7b1.js +1 -0
  21. package/assets/esri/core/workers/chunks/802a390c67f4cdf3d8d9.js +1 -0
  22. package/assets/esri/core/workers/chunks/{6c30a25adf22d73d4977.js → 86f3a004addc087ad6c6.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{00780271be2fd6e298c1.js → 8bfd97fc2569a6b55776.js} +1 -1
  24. package/assets/esri/core/workers/chunks/8d1845a773f66aeb3457.js +1 -0
  25. package/assets/esri/core/workers/chunks/9306bfe7ab58e71b75ea.js +1 -0
  26. package/assets/esri/core/workers/chunks/95047f145ebda65c3d8e.js +1 -0
  27. package/assets/esri/core/workers/chunks/a01213d446be33d203e3.js +1 -0
  28. package/assets/esri/core/workers/chunks/a490a988896b0b02f96b.js +1 -0
  29. package/assets/esri/core/workers/chunks/a60db83cabdf689b923b.js +1 -0
  30. package/assets/esri/core/workers/chunks/{b9d9a1dc3c5d799e2685.js → bd3487b587851b20ff2a.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{94490937dca566fe2640.js → bd5e0a11d2a688a65d23.js} +1 -1
  32. package/assets/esri/core/workers/chunks/c139e737f602c424de13.js +1 -0
  33. package/assets/esri/core/workers/chunks/c3806be4a760735e6082.js +1 -0
  34. package/assets/esri/core/workers/chunks/c9aed9a43d9935e7c768.js +314 -0
  35. package/assets/esri/core/workers/chunks/{8d8f5f08d730270e1165.js → cb9a27176bd5de2c34ca.js} +1 -1
  36. package/assets/esri/core/workers/chunks/ceb648604a4b6d316f4b.js +1 -0
  37. package/assets/esri/core/workers/chunks/{da1157e288dbc6ba842a.js → d3d0c7624eb139994213.js} +1 -1
  38. package/assets/esri/core/workers/chunks/d58f4aa44ade81b0bb3a.js +1 -0
  39. package/assets/esri/core/workers/chunks/{f198f4ba7d3d52882d98.js → de8044dfab4ad253b126.js} +1 -1
  40. package/assets/esri/core/workers/chunks/f33da631352920d49639.js +1 -0
  41. package/assets/esri/core/workers/chunks/fca056536e46aeb98e98.js +1 -0
  42. package/assets/esri/themes/base/widgets/_Directions.scss +30 -9
  43. package/assets/esri/themes/dark/main.css +1 -1
  44. package/assets/esri/themes/light/main.css +1 -1
  45. package/assets/esri/themes/light/view.css +1 -1
  46. package/chunks/ComponentShader.glsl.js +6 -6
  47. package/copyright.txt +26 -19
  48. package/core/colorUtils.js +1 -1
  49. package/core/deprecate.js +1 -1
  50. package/interfaces.d.ts +999 -197
  51. package/intl/locale.js +1 -1
  52. package/layers/FeatureLayer.js +1 -1
  53. package/layers/GeoJSONLayer.js +1 -1
  54. package/layers/OGCFeatureLayer.js +1 -1
  55. package/layers/RouteLayer.js +1 -1
  56. package/layers/SubtypeGroupLayer.js +1 -1
  57. package/layers/WFSLayer.js +1 -1
  58. package/layers/graphics/data/queryUtils.js +1 -1
  59. package/layers/knowledgeGraph/supportUtils.d.ts +0 -2
  60. package/layers/mixins/TrackableLayer.d.ts +4 -0
  61. package/layers/support/SubtypeSublayer.js +1 -1
  62. package/layers/support/TitleCreator.js +5 -0
  63. package/layers/support/TrackInfo.d.ts +4 -0
  64. package/layers/support/TrackInfo.js +1 -1
  65. package/layers/support/TrackPartInfo.d.ts +4 -0
  66. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  67. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  68. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  69. package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
  70. package/layers/support/rasterFunctions/creators/createLocalFunctions.js +1 -1
  71. package/layers/support/rasterFunctions/creators/createStatisticsFunctions.js +1 -1
  72. package/networks/UtilityNetwork.js +1 -1
  73. package/networks/support/networkFieldUtils.js +5 -0
  74. package/package.json +1 -1
  75. package/rest/query/executeForIds.js +1 -1
  76. package/rest/support/BinParametersBase.js +1 -1
  77. package/rest/support/NormalizationBinParametersMixin.d.ts +4 -0
  78. package/support/revision.js +1 -1
  79. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  80. package/symbols/cim/rasterizingUtils.js +1 -1
  81. package/symbols/support/previewCIMSymbol.js +1 -1
  82. package/symbols/support/previewSymbol2D.js +1 -1
  83. package/symbols/support/symbolUtils.js +1 -1
  84. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  85. package/views/2d/layers/LayerView2D.js +1 -1
  86. package/views/2d/layers/RouteLayerView2D.js +1 -1
  87. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  88. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  89. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  90. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  91. package/views/2d/layers/features/sources/FeatureCache.js +5 -0
  92. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  93. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  94. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  95. package/views/2d/layers/features/sources/strategies/ATileLoadStrategy.js +1 -1
  96. package/views/2d/layers/features/sources/strategies/PagedTileLoadStrategy.js +1 -1
  97. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  98. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  99. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  100. package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
  101. package/views/3d/interactive/editingTools/transform/ScaleRotateMeshAdapter.js +1 -1
  102. package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
  103. package/views/3d/layers/I3SMeshView3D.js +1 -1
  104. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  105. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  106. package/views/3d/layers/i3s/BuildingFilterUtil.js +1 -1
  107. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  108. package/views/3d/layers/i3s/SymbologyInfo.js +5 -0
  109. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  110. package/views/3d/state/utils/navigationUtils.js +1 -1
  111. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  112. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  113. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  114. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +14 -14
  115. package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
  116. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  117. package/views/3d/webgl-engine/core/renderPasses/RenderPassIdentifier.js +5 -0
  118. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  119. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
  120. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  121. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  122. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  123. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  124. package/views/View.js +1 -1
  125. package/views/draw/DrawAction.js +1 -1
  126. package/views/layers/FeatureLayerView.js +1 -1
  127. package/views/support/RequiredFieldsOptions.js +5 -0
  128. package/views/webgl/Texture.js +1 -1
  129. package/widgets/BasemapGallery.js +1 -1
  130. package/widgets/BasemapToggle.js +1 -1
  131. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  132. package/widgets/BatchAttributeForm.js +1 -1
  133. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  134. package/widgets/Compass/CompassViewModel.js +1 -1
  135. package/widgets/DirectionalPad.js +1 -1
  136. package/widgets/Directions/DirectionsViewModel.js +1 -1
  137. package/widgets/Directions.js +1 -1
  138. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  139. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  140. package/widgets/Editor/EditorViewModel.js +1 -1
  141. package/widgets/Editor.js +1 -1
  142. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  143. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  144. package/widgets/FeatureTemplates/featureTemplatesUtils.js +1 -1
  145. package/widgets/Fullscreen.js +1 -1
  146. package/widgets/Home.js +1 -1
  147. package/widgets/LayerList/LayerListItem.js +1 -1
  148. package/widgets/LayerList/ListItem.js +1 -1
  149. package/widgets/LayerList/support/layerListUtils.js +1 -1
  150. package/widgets/Legend/LegendViewModel.js +1 -1
  151. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  152. package/widgets/Legend.js +1 -1
  153. package/widgets/Locate.js +1 -1
  154. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  155. package/widgets/OrientedImageryViewer/adapters/sketch/DigitizationAdapter.js +1 -1
  156. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  157. package/widgets/OrientedImageryViewer/constants.js +1 -1
  158. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  159. package/widgets/OrientedImageryViewer/symbols.js +1 -1
  160. package/widgets/OrientedImageryViewer.js +1 -1
  161. package/widgets/Print.js +1 -1
  162. package/widgets/ScaleBar.js +1 -1
  163. package/widgets/Swipe.js +1 -1
  164. package/widgets/TableList/ListItem.js +1 -1
  165. package/widgets/TableList.js +1 -1
  166. package/widgets/Track.js +1 -1
  167. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  168. package/widgets/UtilityNetworkTrace.js +1 -1
  169. package/widgets/support/GoTo.js +1 -1
  170. package/widgets/support/goToUtils.js +5 -0
  171. package/assets/esri/core/workers/chunks/00e0c53d89e074399f04.js +0 -1
  172. package/assets/esri/core/workers/chunks/01c3507d78398baaf61b.js +0 -1
  173. package/assets/esri/core/workers/chunks/177d4c2c10ef7369006f.js +0 -1
  174. package/assets/esri/core/workers/chunks/26a2bd432e7a1b3870c3.js +0 -1
  175. package/assets/esri/core/workers/chunks/28dd172faa85080511c5.js +0 -1
  176. package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +0 -1
  177. package/assets/esri/core/workers/chunks/4b56c0c109e10d7409b8.js +0 -1
  178. package/assets/esri/core/workers/chunks/594d923400fd74881833.js +0 -1
  179. package/assets/esri/core/workers/chunks/61795bde00f2e16d04f1.js +0 -1
  180. package/assets/esri/core/workers/chunks/7058001bf66f9f3d5d45.js +0 -1
  181. package/assets/esri/core/workers/chunks/746c964cf07e4306f21f.js +0 -1
  182. package/assets/esri/core/workers/chunks/7bf08823f861628144a1.js +0 -1
  183. package/assets/esri/core/workers/chunks/8c32cee395da0a7b9a8e.js +0 -1
  184. package/assets/esri/core/workers/chunks/91384398f01485631f70.js +0 -1
  185. package/assets/esri/core/workers/chunks/946a9890f3621d1dfbc5.js +0 -1
  186. package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +0 -1
  187. package/assets/esri/core/workers/chunks/af917f69d9c6e9937263.js +0 -1
  188. package/assets/esri/core/workers/chunks/cc75bbfd779f409943a3.js +0 -1
  189. package/assets/esri/core/workers/chunks/d339dee99c4820b63f39.js +0 -1
  190. package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +0 -1
  191. package/assets/esri/core/workers/chunks/d44d210e94406509e980.js +0 -314
  192. package/assets/esri/core/workers/chunks/de638753a30c9aa41bad.js +0 -1
  193. package/assets/esri/core/workers/chunks/e5e3b6d00d27b5bb354f.js +0 -1
  194. package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +0 -1
  195. package/assets/esri/core/workers/chunks/f29715459ecd46180829.js +0 -1
  196. package/layers/knowledgeGraph/cypherUtils.d.ts +0 -3
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{prefersReducedMotion as t}from"../core/a11yUtils.js";import{createTask as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import{deprecatedProperty as o}from"../core/deprecate.js";import s from"../core/Logger.js";import{isAbortError as n}from"../core/promiseUtils.js";import r from"../core/ReactiveMap.js";import{watch as l,initial as c,syncAndInitial as d,whenOnce as g}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import p from"./Widget.js";import{getAllArcPath as u}from"./OrientedImageryViewer/arcUtils.js";import{segmentArcs as v,sectorsRadii as y,featureCircleRadius as _,navigationToolDimensionLength as w}from"./OrientedImageryViewer/constants.js";import{css as b,navigation as M,navigationToolRotationFrom as T,navigationToolRotationTo as C,root as f}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as A,loadImageForAttachment as I,getThumbnailPixelBlock as O,renderImageWithRotation as L}from"./OrientedImageryViewer/galleryUtils.js";import k from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import E from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import S from"./OrientedImageryViewer/components/ImageLocationWidget.js";import F from"./OrientedImageryViewer/components/ImageOverlays.js";import{loadCalciteComponents as V}from"./support/componentsUtils.js";import{globalCss as P}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as x}from"./support/decorators/messageBundle.js";import{vmEvent as j}from"./support/decorators/vmEvent.js";import{tsx as z}from"./support/jsxFactory.js";import{substitute as G}from"../intl/substitute.js";const $={overlayMapFeatures:"overlay-map-features",overlayed:"overlayed",overlaysActionHandles:"overlays-action-handles"};let B=class extends p{constructor(e,t){super(e,t),this.digitizationEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new k,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new E,this._actionItems=new r,this._imageMeasurementToolsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._warningTitleElement=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new a,this._handleDigitizationLayerChange=e=>{this.digitizationLayer&&this.stopDigitization(this.digitizationLayer.id),this.digitizationLayer=this.digitizationLayer===e?null:e,this.digitizationLayer&&this.startDigitization(this.digitizationLayer)},this._handleOverlayLayerDeselect=e=>{const t=e.layer;this.viewModel.removeOverlayedGraphicsOnImage(`${t.id}`),this.removeHandles(`${$.overlayed}-${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(l((()=>t.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)})),`${$.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{const e=i.replace("draw-","");this.viewModel.digitizeCreate(e);break}case"save":this.viewModel.saveDrawing();break;case"select-feature":t.active=!t.active,this.viewModel.toggleSelection(t.active);break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=()=>{this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeActionElement=e=>{this._actionItems.delete(e.text)},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this)}initialize(){this.addHandles([l((()=>[this.viewModel?.bestFeatureAngle,this._navigationTool]),(([e,t])=>{t&&this._updateNavigationTool(t)}),c),l((()=>this.currentCoverageVisible),(e=>this._onCurrentCoverageVisibilityChange(e))),l((()=>this.isAdditionalCoverageVisible),(e=>this._onAdditionalCoverageVisibilityChange(e))),l((()=>this.isAdditionalPointSourcesVisible),(e=>this._onAdditionalCameraLocationsVisibility(e))),l((()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state})),(({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)}),d),l((()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state})),((e,t)=>{e.showMapFeatures!==t?.showMapFeatures&&this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature&&g((()=>"image-loaded"===this.viewModel.state)).then((()=>{this.viewModel.removeAllOverlayMapFeatures(),this._overlayedLayers?.forEach((t=>{this.viewModel.overlayMapFeatures(t,e.showMapFeatures)}))}))}),c)])}loadDependencies(){return V({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect()}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return o(s.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){o(s.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get digitizationLayer(){return this.viewModel.digitizationLayer}set digitizationLayer(e){this.viewModel.digitizationLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.mapImageConversionToolState=e}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return"image-loaded"===t&&e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return z("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},z("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),z("calcite-action-group",null,this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle()),z("calcite-action-group",null,this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()),z("calcite-action-group",null,this._measurementToolsToggle()),this._actionTooltips())}_actionTooltips(){return[...this._actionItems].map((([e,t])=>z("calcite-tooltip",{closeOnClick:!0,key:e,placement:"bottom",referenceElement:t},z("span",null,e))))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t}=this;if(t)return"pin-tear";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}get _activeMeasurementHeading(){const{measureType:e,messages:t}=this,{groundArea:i,heightAboveGround:a,groundDistance:o}=t;switch(e){case"area":return i;case"height":return a;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?z("calcite-action",{active:e,...this._commonActionProperties,class:b.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?z("calcite-action",{active:e,...this._commonActionProperties,class:b.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t},id:i}=this;if("image-loaded"!==e||!t)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const a=this._imageMeasurementToolsLoaderTask?.value;return a?z("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${i}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},z(a,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _commonActionProperties(){return{afterCreate:this._storeActionElement,afterRemoved:this._removeActionElement,afterUpdate:this._storeActionElement,bind:this}}_renderRoot(){const{viewModel:{state:e}}=this;return z("calcite-panel",null,z("calcite-shell",null,z("calcite-panel",{bind:this,class:b.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:"image-loading"===e},this.visibleElements.menu?this._renderActionBar():null,this._imageViewer,this._panoramicViewer,this._messageBox,this.invalidCameraHeading?[this._renderWarning(this.messages.invalidCameraHeadingWarningTitle),this._renderWarningTooltip(this.messages.invalidCameraHeadingWarningDescription)]:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel],this._imageEnhancementTools,this._renderSketch()),this._measurementToggle,this._locationToggle))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?z("calcite-action",{active:e,...this._commonActionProperties,class:b.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{imageEnhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:o}}=this;return e&&"image-loaded"===o?z("calcite-panel",{bind:this,class:b.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},z("div",{class:b.imageEnhancementTools},z("div",{class:b.imageEnhancementToolContainer},z("calcite-label",null,this.messages.brightness,z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),z("div",{class:b.imageEnhancementToolContainer},z("calcite-label",null,this.messages.contrast,z("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),z("div",{class:b.imageEnhancementToolContainer},z("calcite-label",null,this.messages.sharpness,z("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),z("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i?z("calcite-action",{active:this.imageEnhancementToolActive,...this._commonActionProperties,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleImageEnhancementToolState,text:this.messages.imageEnhancement}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return z("calcite-panel",{bind:this,class:b.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},z("div",{class:b.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?z("calcite-action",{active:this.galleryOpened,...this._commonActionProperties,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery}):null}get _imageOverlaysComponent(){return z(F,{closed:!this.imageOverlaysOpened,digitizationEnabled:this.digitizationEnabled,digitizationLayer:this.digitizationLayer,messages:this._imageOverlayMessages,overlayedLayers:this._overlayedLayers,showCameraLocations:this.showCameraLocations,showMapFeatures:this.showMapFeatures,view:this.view,onDigitizationLayerChanged:this._handleDigitizationLayerChange,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged})}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}get _imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this;if(e&&"image-loaded"===t)return z("div",{class:b.imageOverlaysContainer,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?z("calcite-action",{active:t,...this._commonActionProperties,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i}=this.viewModel,a=null!=e||"default"!==i,o=this.classes({[b.viewer]:!a,[b.viewerHidden]:a});return z("calcite-panel",{afterCreate:t,bind:this,class:o},this._renderSketch())}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t},imageLocationToolActive:i,messages:{groundLocation:a}}=this;if("image-loaded"===e&&t&&i)return z("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:a,id:a,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},z(S,{groundCoordinates:t,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?z("calcite-action",{active:e,...this._commonActionProperties,disabled:"image-loaded"!==t||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:o,visibleElements:{measurementTools:s}}=this,{state:n,mode:r}=i,{measurementTools:l,groundDistance:c,groundArea:d,heightAboveGround:g,groundLocation:m}=o;return s?z("calcite-dropdown",{disabled:a,key:"measurement-tools",width:"m"},z("calcite-action",{...this._commonActionProperties,icon:e,slot:"trigger",text:l}),z("calcite-dropdown-group",null,z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==n,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t},c),z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==n,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t},d),z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==n||"panoramic"===r,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},g),z("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==n,iconStart:"pin-tear",key:"surface-location",onclick:e=>this._toggleLocationTool(e),selected:this.imageLocationToolActive},m))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t}}=this;if(!t)return null;const{data:i,key:a,map:o}=t,s=`${o?G(e[a],o):e[a]}`;return z("span",{class:b.messageBox},i?`${s} ${i}`:s)}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?z("calcite-action",{active:this.navigationToolActive,...this._commonActionProperties,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?z("calcite-action",{...this._commonActionProperties,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups}):null}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i}=this.viewModel,a=null!=e||"panoramic"!==i,o=this.classes({[b.viewer]:!a,[b.viewerHidden]:a});return z("calcite-panel",{afterCreate:t,bind:this,class:o})}_closeAllImageTools(){this.imageEnhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach((async e=>{if(e.isIntersecting){const a=e.target,o=a.getAttribute("data-src"),r=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),c=r?parseFloat(r)%360:0,{layer:d,_galleryController:{signal:g}}=this;if(!o||!d||!l)return;let m;try{m=A(o)?await I(d,l,{signal:g}):await O(o,{signal:g})}catch(i){n(i)||s.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!m)return;L(m,a,c)}}))}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=i((async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e}))}_loadSketchResources(){this._sketchLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default))}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e){const{invalidCameraHeading:t,viewModel:{state:i}}=this;return t&&"image-loaded"===i?[z("calcite-notice",{class:b.alert,closable:!0,icon:"exclamation-mark-triangle-f",iconFlipRtl:!0,kind:"warning",open:!0,scale:"s"},z("div",{afterCreate:e=>this._storeWarningTitleElement(e),slot:"title"},e))]:null}_renderWarningTooltip(e){const{_warningTitleElement:t}=this;if(e?.length&&t)return z("calcite-tooltip",{closeOnClick:!0,referenceElement:t},e)}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:o}}=this;if(!this.container||!a)return null;let s,n,r,l,c;if(i){const{x:e,y:t,direction:a}=i,[o,d,g,m]=v[a];s=`M ${e} ${t} L ${o} ${d} A ${y[2]} ${y[2]} 0 0 1 ${g} ${m} Z`,n=e,l=t,r=v[a][4],c=v[a][5]}const d=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},m=e=>{e.removeEventListener("click",g)},h=a.attributes.objectId,p=e?.map((e=>e?.items)).filter(Boolean).flatMap((e=>e?.map((({x:e,y:t,objectID:i,featureIndexInSector:a,sector:o})=>z("circle",{afterRemoved:m,class:this.classes(b.feature,{selected:h===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":o,key:`${b.feature}-${i}`,onclick:g,r:_}))))),T=e=>{e.removeEventListener("click",d)},C=this.classes({[b.navigationWrapper]:!0,[b.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===o?z("div",{bind:this,class:C,key:this.messages.navigationTool},z("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?M:b.rotateWithAnimation,focusable:"false",height:w,role:"img",width:w,xmlns:"http://www.w3.org/2000/svg"},z("defs",null,z("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:c},z("stop",{class:b.navigationPathOffset0,offset:0}),z("stop",{class:b.navigationPathOffset1,offset:1}))),z("g",null,z("circle",{class:this.classes(b.sector,b.outerSector),cx:y[3],cy:y[3],onclick:this._scaleNavigationTool,r:y[3]}),z("circle",{class:b.sector,cx:y[3],cy:y[3],r:y[2]}),z("circle",{class:b.sector,cx:y[3],cy:y[3],r:y[1]}),z("circle",{class:b.sector,cx:y[3],cy:y[3],r:y[0]}),z("path",{class:b.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${b.pointer}-west`}),z("path",{class:this.classes(b.pointer,b.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${b.pointer}-north`}),z("path",{class:b.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${b.pointer}-east`}),z("path",{class:b.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${b.pointer}-south`}),z("path",{class:this.classes(b.sector,b.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:b.sectorSeparator}),u([y[2],y[1],y[0]],y[3],y[3]).map(((t,i)=>z("path",{afterRemoved:T,class:this.classes(b.sector,e?.[i]?.length?b.sectorEnabled:b.sectorDisabled),d:t,"data-sector":`${i}`,key:`${b.sector}-${i}`,onclick:d}))),z("path",{class:this.classes(b.sector,b.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:b.sectorCross}),p,a.attributes.cameraPitch>=5&&s?z("path",{class:b.selectedFeaturePath,d:s,fill:`url(#${this.id}-coverage-fill)`,key:b.selectedFeaturePath}):null))):null}_renderSketch(){const{digitizationLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",o=this._sketchLoaderTask.value;return z("div",{class:b.sketchTools},z(o,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?z("div",{class:b.carouselContent},t?.items.map((({url:t,objectId:i,rotation:a},o)=>z("div",{class:`${b.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${b.carouselItemWrapper}-${o}`},z("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:b.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight}))))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_storeActionElement(e){this._actionItems.set(e.text,e)}_storeNavigationToolReference(e){this._navigationTool=e}_storeWarningTitleElement(e){this._warningTitleElement=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleImageEnhancementToolState(e){e.stopPropagation(),this.imageEnhancementToolActive=!this.imageEnhancementToolActive,this.imageEnhancementToolActive&&(this.galleryOpened&&(this.galleryOpened=!1),this.navigationToolActive&&(this.navigationToolActive=!1),this.imageOverlaysOpened&&(this.imageOverlaysOpened=!1))}_toggleImageOverlays(e){e.stopPropagation(),this.imageOverlaysOpened=!this.imageOverlaysOpened,this.imageOverlaysOpened&&(this.galleryOpened&&(this.galleryOpened=!1),this.navigationToolActive&&(this.navigationToolActive=!1),this.imageEnhancementToolActive&&(this.imageEnhancementToolActive=!1))}_toggleImageGallery(e){e.stopPropagation(),this.galleryOpened=!!this.imageGalleryEnabled&&!this.galleryOpened,this.galleryOpened&&(this.imageEnhancementToolActive&&(this.imageEnhancementToolActive=!1),this.navigationToolActive&&(this.navigationToolActive=!1),this.imageOverlaysOpened&&(this.imageOverlaysOpened=!1))}_toggleLocationTool(e){const t=this.imageLocationToolActive;this._closeAllImageTools(),this.imageLocationToolActive=!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType;this._closeAllImageTools(),this.measureType=i===t?null:t,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){this.navigationToolActive=!this.navigationToolActive,this.navigationToolActive&&(this.galleryOpened&&(this.galleryOpened=!1),this.imageEnhancementToolActive&&(this.imageEnhancementToolActive=!1),this.imageOverlaysOpened&&(this.imageOverlaysOpened=!1))}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(T,`${t}deg`),e.style.setProperty(C,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return z("div",{class:this.classes(P.widget,f)},this._renderRoot())}startDigitization(e){this.viewModel.startDigitization(e)}stopDigitization(e){this.viewModel.stopDigitization(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([m({readOnly:!0})],B.prototype,"accuracyParametersMissing",null),e([m()],B.prototype,"activeLayer",null),e([m()],B.prototype,"currentBestFeature",null),e([m()],B.prototype,"currentCoverageVisible",null),e([m()],B.prototype,"digitizationEnabled",void 0),e([m()],B.prototype,"digitizationLayer",null),e([m()],B.prototype,"disabled",null),e([m()],B.prototype,"features",null),e([m()],B.prototype,"imagePointsInView",null),e([m()],B.prototype,"galleryOpened",void 0),e([m()],B.prototype,"icon",null),e([m()],B.prototype,"imageEnhancementToolActive",void 0),e([m({readOnly:!0})],B.prototype,"imageGalleryEnabled",null),e([m()],B.prototype,"imageLocationToolActive",null),e([m()],B.prototype,"imageOverlaysOpened",void 0),e([m({readOnly:!0})],B.prototype,"invalidCameraHeading",null),e([m()],B.prototype,"isAdditionalCoverageVisible",null),e([m()],B.prototype,"isAdditionalPointSourcesVisible",null),e([m()],B.prototype,"mapImageConversionToolState",null),e([m()],B.prototype,"measureType",null),e([m()],B.prototype,"layer",null),e([m()],B.prototype,"navigationToolActive",void 0),e([j(["after-digitization-complete"]),m({type:k})],B.prototype,"viewModel",void 0),e([m(),x("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],B.prototype,"messages",void 0),e([m(),x("esri/core/t9n/Units")],B.prototype,"measurementUnitMessages",void 0),e([m(),x("esri/t9n/common")],B.prototype,"messagesCommon",void 0),e([m(),x("esri/widgets/Sketch/t9n/Sketch")],B.prototype,"messagesSketch",void 0),e([m()],B.prototype,"pixelMeasurementUnit",void 0),e([m()],B.prototype,"pixelAreaMeasurementUnit",void 0),e([m({readOnly:!0})],B.prototype,"popupEnabled",null),e([m()],B.prototype,"referencePoint",null),e([m()],B.prototype,"showCameraLocations",void 0),e([m()],B.prototype,"showMapFeatures",void 0),e([j(["create","delete","redo","undo","update"]),m({readOnly:!0})],B.prototype,"sketchViewModel",null),e([m()],B.prototype,"view",null),e([m({type:E,nonNullable:!0})],B.prototype,"visibleElements",void 0),e([m()],B.prototype,"determineWorkflowForFeature",null),e([m()],B.prototype,"updateFootprint",null),e([m()],B.prototype,"_actionItems",void 0),e([m()],B.prototype,"_activeMeasurementIcon",null),e([m()],B.prototype,"_activeMeasurementHeading",null),e([m()],B.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([m()],B.prototype,"_measurementToggle",null),e([m()],B.prototype,"_commonActionProperties",null),e([m()],B.prototype,"_imageEnhancementTools",null),e([m()],B.prototype,"_imageGalleryPanel",null),e([m()],B.prototype,"_imageGalleryContext",null),e([m()],B.prototype,"_imageOverlaysComponent",null),e([m()],B.prototype,"_imageOverlayMessages",null),e([m()],B.prototype,"_imageSketchToolsMessages",null),e([m()],B.prototype,"_imageOverlaysPanel",null),e([m()],B.prototype,"_imageViewer",null),e([m()],B.prototype,"_locationToggle",null),e([m()],B.prototype,"_messageBox",null),e([m()],B.prototype,"_navigationToolExpanded",void 0),e([m()],B.prototype,"_navigationTool",void 0),e([m()],B.prototype,"_panoramicViewer",null),e([m()],B.prototype,"_warningTitleElement",void 0),e([m()],B.prototype,"_renderNavigation",null),e([m()],B.prototype,"_renderThumbnails",null),e([m()],B.prototype,"_sketchLoaderTask",void 0),B=e([h("esri.widgets.OrientedImageryViewer")],B);const H=B;export{H as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{prefersReducedMotion as t}from"../core/a11yUtils.js";import{createTask as i}from"../core/asyncUtils.js";import a from"../core/Collection.js";import{deprecatedProperty as o}from"../core/deprecate.js";import s from"../core/Logger.js";import{isAbortError as r}from"../core/promiseUtils.js";import n from"../core/ReactiveMap.js";import{watch as l,initial as c,syncAndInitial as d,whenOnce as g}from"../core/reactiveUtils.js";import{property as m}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{or as p}from"../layers/orientedImagery/transformations/utils.js";import u from"./Widget.js";import{getAllArcPath as v}from"./OrientedImageryViewer/arcUtils.js";import{segmentArcs as y,sectorsRadii as _,featureCircleRadius as w,navigationToolDimensionLength as b,getDelegatedEvents as M}from"./OrientedImageryViewer/constants.js";import{css as T,navigation as C,navigationToolRotationFrom as O,navigationToolRotationTo as f,root as A}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as I,loadImageForAttachment as L,getThumbnailPixelBlock as k,renderImageWithRotation as E}from"./OrientedImageryViewer/galleryUtils.js";import S from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import F from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import V from"./OrientedImageryViewer/components/ImageLocationWidget.js";import{loadCalciteComponents as P}from"./support/componentsUtils.js";import{globalCss as x}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as z}from"./support/decorators/messageBundle.js";import{vmEvent as $}from"./support/decorators/vmEvent.js";import{tsx as j}from"./support/jsxFactory.js";import{substitute as G}from"../intl/substitute.js";const H={overlayMapFeatures:"overlay-map-features",overlayed:"overlayed",overlaysActionHandles:"overlays-action-handles"};let D=class extends u{constructor(e,t){super(e,t),this.digitizationEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new S,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new F,this._actionItems=new n,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1},this._navigationToolExpanded=!1,this._navigationTool=null,this._warningTitleElement=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new a,this._previousAction=null,this._handleDigitizationLayerChange=e=>{this.digitizationLayer&&this.stopDigitization(this.digitizationLayer.id),this.digitizationLayer=this.digitizationLayer===e?null:e,this.digitizationLayer&&this.startDigitization(this.digitizationLayer)},this._handleOverlayLayerDeselect=e=>{const t=e.layer;this.viewModel.removeOverlayedGraphicsOnImage(`${t.id}`),t===this.digitizationLayer&&(this.stopDigitization(t.id),this.digitizationLayer=null),this.removeHandles(`${H.overlayed}-${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(l((()=>t.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible)})),`${H.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,o=a?.dataset.action,s=o?.includes("draw")??!1,r="select-feature"===o,n=o!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&p(r,s&&n)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":s&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=()=>{this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeActionElement=e=>{this._actionItems.delete(e.text)},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._toggleImageAttributes=()=>{this.viewModel.toggleImageAttributes()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this)}initialize(){this.addHandles([l((()=>[this.viewModel?.bestFeatureAngle,this._navigationTool]),(([e,t])=>{t&&this._updateNavigationTool(t)}),c),l((()=>this.currentCoverageVisible),(e=>this._onCurrentCoverageVisibilityChange(e))),l((()=>this.isAdditionalCoverageVisible),(e=>this._onAdditionalCoverageVisibilityChange(e))),l((()=>this.isAdditionalPointSourcesVisible),(e=>this._onAdditionalCameraLocationsVisibility(e))),l((()=>({features:this.currentBestFeature,showCameraLocations:this.showCameraLocations,state:this.viewModel.state})),(({showCameraLocations:e,state:t})=>{"image-loaded"===t&&this.viewModel.overlayCameraLocations(e)}),d),l((()=>({feature:this.currentBestFeature,showMapFeatures:this.showMapFeatures,state:this.viewModel.state})),(async(e,t)=>{if(e.showMapFeatures!==t?.showMapFeatures&&this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures),null!=e.feature&&e.feature!==t?.feature){if(this.viewModel.removeAllOverlayMapFeatures(),await g((()=>"image-loaded"===this.viewModel.state)),await Promise.all(this._overlayedLayers?.map((t=>{this.viewModel.overlayMapFeatures(t,e.showMapFeatures)}))),!this.digitizationLayer)return;this.stopDigitization(this.digitizationLayer.id),this.startDigitization(this.digitizationLayer)}}),c)])}loadDependencies(){return P({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect()}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return o(s.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){o(s.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get digitizationLayer(){return this.viewModel.digitizationLayer}set digitizationLayer(e){this.viewModel.digitizationLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.mapImageConversionToolState=e}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return"image-loaded"===t&&e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}_renderActionBar(){return j("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},j("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle()),j("calcite-action-group",null,this._mapImageConversionToggle(),this._navigationToolToggle(),this._imageEnhancementsToggle()),j("calcite-action-group",null,this._imageGalleryToggle(),this._imageOverlaysToggle(),this._openPopupAction()),j("calcite-action-group",null,this._measurementToolsToggle()),this._actionTooltips())}_actionTooltips(){return[...this._actionItems].map((([e,t])=>j("calcite-tooltip",{closeOnClick:!0,key:e,placement:"bottom",referenceElement:t},j("span",null,e))))}get _activeMeasurementIcon(){const{measureType:e,imageLocationToolActive:t}=this;if(t)return"pin-tear";switch(e){case"area":return"measure-area";case"height":return"measure-building-height-top-base";default:return"measure-line"}}get _activeMeasurementHeading(){const{measureType:e,messages:t}=this,{groundArea:i,heightAboveGround:a,groundDistance:o}=t;switch(e){case"area":return i;case"height":return a;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?j("calcite-action",{active:e,...this._commonActionProperties,class:T.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?j("calcite-action",{active:e,...this._commonActionProperties,class:T.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t},id:i}=this;if("image-loaded"!==e||!t)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const a=this._imageMeasurementToolsLoaderTask?.value;return a?j("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${i}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},j(a,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _commonActionProperties(){return{afterCreate:this._storeActionElement,afterRemoved:this._removeActionElement,afterUpdate:this._storeActionElement,bind:this}}_renderRoot(){const{viewModel:{state:e}}=this;return j("calcite-panel",null,j("calcite-shell",null,j("calcite-panel",{bind:this,class:T.viewerContainer,heading:this.visibleElements.title?this.messages.title:void 0,loading:"image-loading"===e},this.visibleElements.menu?this._renderActionBar():null,this._imageViewer,this._panoramicViewer,this._messageBox,this.invalidCameraHeading?[this._renderWarning(this.messages.invalidCameraHeadingWarningTitle),this._renderWarningTooltip(this.messages.invalidCameraHeadingWarningDescription)]:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel],this._imageEnhancementTools,this._renderSketch()),this._measurementToggle,this._locationToggle))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?j("calcite-action",{active:e,...this._commonActionProperties,class:T.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint}):null}get _imageEnhancementTools(){const{imageEnhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:o}}=this;return e&&"image-loaded"===o?j("calcite-panel",{bind:this,class:T.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleImageEnhancementToolState},j("div",{class:T.imageEnhancementTools},j("div",{class:T.imageEnhancementToolContainer},j("calcite-label",null,this.messages.brightness,j("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:t,onCalciteSliderInput:this._handleBrightnessChange}))),j("div",{class:T.imageEnhancementToolContainer},j("calcite-label",null,this.messages.contrast,j("calcite-slider",{bind:this,labelTicks:!0,max:10,min:-10,ticks:5,value:i,onCalciteSliderInput:this._handleContrastChange}))),j("div",{class:T.imageEnhancementToolContainer},j("calcite-label",null,this.messages.sharpness,j("calcite-slider",{bind:this,labelTicks:!0,max:1,min:0,step:.1,ticks:.5,value:a,onCalciteSliderInput:this._handleSharpnessChange})))),j("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{imageEnhancement:i}=this.visibleElements;return i?j("calcite-action",{active:this.imageEnhancementToolActive,...this._commonActionProperties,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleImageEnhancementToolState,text:this.messages.imageEnhancement}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return j("calcite-panel",{bind:this,class:T.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},j("div",{class:T.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?j("calcite-action",{active:this.galleryOpened,...this._commonActionProperties,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:a,digitizationEnabled:o,digitizationLayer:s,imageOverlaysOpened:r,showCameraLocations:n,showMapFeatures:l,view:c}=this;t||(this._imageOverlaysLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default)));const d=this._imageOverlaysLoaderTask?.value;return d?j(d,{closed:!r,digitizationEnabled:o,digitizationLayer:s,messages:e,overlayedLayers:a,showCameraLocations:n,showMapFeatures:l,view:c,onDigitizationLayerChanged:this._handleDigitizationLayerChange,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesSketch,...this.messagesCommon}}get _imageOverlaysPanel(){const{imageOverlaysOpened:e,viewModel:{state:t}}=this;if(e&&"image-loaded"===t)return this._imageOverlaysContext}get _imageOverlaysContext(){return j("div",{class:T.imageOverlaysContainer,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{viewModel:{state:e},imageOverlaysOpened:t,invalidCameraHeading:i,visibleElements:{imageOverlays:a}}=this;return a?j("calcite-action",{active:t,...this._commonActionProperties,disabled:"image-loaded"!==e||i,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays}):null}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i}=this.viewModel,a=null!=e||"default"!==i,o=this.classes({[T.viewer]:!a,[T.viewerHidden]:a});return j("calcite-panel",{afterCreate:t,bind:this,class:o},this._renderSketch())}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t},imageLocationToolActive:i,messages:{groundLocation:a}}=this;if("image-loaded"===e&&t&&i)return j("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:a,id:a,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},j(V,{groundCoordinates:t,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t},invalidCameraHeading:i,visibleElements:{mapImageConversionTool:a}}=this;return a?j("calcite-action",{active:e,...this._commonActionProperties,disabled:"image-loaded"!==t||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool}):null}_measurementToolsToggle(){const{_activeMeasurementIcon:e,measureType:t,viewModel:i,accuracyParametersMissing:a,messages:o,visibleElements:{measurementTools:s}}=this,{state:r,mode:n}=i,{measurementTools:l,groundDistance:c,groundArea:d,heightAboveGround:g,groundLocation:m}=o;return s?j("calcite-dropdown",{disabled:a,key:"measurement-tools",width:"m"},j("calcite-action",{...this._commonActionProperties,icon:e,slot:"trigger",text:l}),j("calcite-dropdown-group",null,j("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),selected:"distance"===t},c),j("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),selected:"area"===t},d),j("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r||"panoramic"===n,iconStart:"measure-building-height-top-base",key:"height-dropdown",onclick:e=>this._toggleMeasurementSketch(e,"height"),selected:"height"===t},g),j("calcite-dropdown-item",{bind:this,disabled:"image-loaded"!==r,iconStart:"pin-tear",key:"surface-location",onclick:e=>this._toggleLocationTool(e),selected:this.imageLocationToolActive},m))):null}get _messageBox(){const{messages:e,viewModel:{displayMessage:t}}=this;if(!t)return null;const{data:i,key:a,map:o}=t,s=`${o?G(e[a],o):e[a]}`;return j("span",{class:T.messageBox},i?`${s} ${i}`:s)}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t}}=this;return t?j("calcite-action",{active:this.navigationToolActive,...this._commonActionProperties,disabled:"image-loaded"!==e||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?j("calcite-action",{...this._commonActionProperties,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups}):null}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i}=this.viewModel,a=null!=e||"panoramic"!==i,o=this.classes({[T.viewer]:!a,[T.viewerHidden]:a});return j("calcite-panel",{afterCreate:t,bind:this,class:o})}_closeAllImageTools(){this.imageEnhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_lazyLoadImage(e,t){e.forEach((async e=>{if(e.isIntersecting){const a=e.target,o=a.getAttribute("data-src"),n=a.getAttribute("data-rotation"),l=a.getAttribute("data-objectid"),c=n?parseFloat(n)%360:0,{layer:d,_galleryController:{signal:g}}=this;if(!o||!d||!l)return;let m;try{m=I(o)?await L(d,l,{signal:g}):await k(o,{signal:g})}catch(i){r(i)||s.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!m)return;E(m,a,c)}}))}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=i((async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e}))}_loadSketchResources(){this._sketchLoaderTask=i((async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default))}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e){const{invalidCameraHeading:t,viewModel:{state:i}}=this;return t&&"image-loaded"===i?[j("calcite-notice",{class:T.alert,closable:!0,icon:"exclamation-mark-triangle-f",iconFlipRtl:!0,kind:"warning",open:!0,scale:"s"},j("div",{afterCreate:e=>this._storeWarningTitleElement(e),slot:"title"},e))]:null}_renderWarningTooltip(e){const{_warningTitleElement:t}=this;if(e?.length&&t)return j("calcite-tooltip",{closeOnClick:!0,referenceElement:t},e)}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:i,currentBestFeature:a,state:o}}=this;if(!this.container||!a)return null;let s,r,n,l,c;if(i){const{x:e,y:t,direction:a}=i,[o,d,g,m]=y[a];s=`M ${e} ${t} L ${o} ${d} A ${_[2]} ${_[2]} 0 0 1 ${g} ${m} Z`,r=e,l=t,n=y[a][4],c=y[a][5]}const d=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},m=e=>{e.removeEventListener("click",g)},h=a.attributes.objectId,p=e?.map((e=>e?.items)).filter(Boolean).flatMap((e=>e?.map((({x:e,y:t,objectID:i,featureIndexInSector:a,sector:o})=>j("circle",{afterRemoved:m,class:this.classes(T.feature,{selected:h===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":o,key:`${T.feature}-${i}`,onclick:g,r:w}))))),u=e=>{e.removeEventListener("click",d)},M=this.classes({[T.navigationWrapper]:!0,[T.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&"image-loaded"===o?j("div",{bind:this,class:M,key:this.messages.navigationTool},j("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:t()?C:T.rotateWithAnimation,focusable:"false",height:b,role:"img",width:b,xmlns:"http://www.w3.org/2000/svg"},j("defs",null,j("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:r,x2:n,y1:l,y2:c},j("stop",{class:T.navigationPathOffset0,offset:0}),j("stop",{class:T.navigationPathOffset1,offset:1}))),j("g",null,j("circle",{class:this.classes(T.sector,T.outerSector),cx:_[3],cy:_[3],onclick:this._scaleNavigationTool,r:_[3]}),j("circle",{class:T.sector,cx:_[3],cy:_[3],r:_[2]}),j("circle",{class:T.sector,cx:_[3],cy:_[3],r:_[1]}),j("circle",{class:T.sector,cx:_[3],cy:_[3],r:_[0]}),j("path",{class:T.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${T.pointer}-west`}),j("path",{class:this.classes(T.pointer,T.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${T.pointer}-north`}),j("path",{class:T.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${T.pointer}-east`}),j("path",{class:T.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${T.pointer}-south`}),j("path",{class:this.classes(T.sector,T.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:T.sectorSeparator}),v([_[2],_[1],_[0]],_[3],_[3]).map(((t,i)=>j("path",{afterRemoved:u,class:this.classes(T.sector,e?.[i]?.length?T.sectorEnabled:T.sectorDisabled),d:t,"data-sector":`${i}`,key:`${T.sector}-${i}`,onclick:d}))),j("path",{class:this.classes(T.sector,T.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:T.sectorCross}),p,a.attributes.cameraPitch>=5&&s?j("path",{class:T.selectedFeaturePath,d:s,fill:`url(#${this.id}-coverage-fill)`,key:T.selectedFeaturePath}):null))):null}_renderSketch(){const{digitizationLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",o=this._sketchLoaderTask.value;return j("div",{class:T.sketchTools},j(o,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?j("div",{class:T.carouselContent},t?.items.map((({url:t,objectId:i,rotation:a},o)=>j("div",{class:`${T.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${T.carouselItemWrapper}-${o}`},j("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:T.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight}))))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_storeActionElement(e){this._actionItems.set(e.text,e)}_storeNavigationToolReference(e){this._navigationTool=e}_storeWarningTitleElement(e){this._warningTitleElement=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleImageEnhancementToolState(e){e.stopPropagation(),this.imageEnhancementToolActive=!this.imageEnhancementToolActive,this.imageEnhancementToolActive&&(this.galleryOpened&&(this.galleryOpened=!1),this.navigationToolActive&&(this.navigationToolActive=!1),this.imageOverlaysOpened&&(this.imageOverlaysOpened=!1))}_toggleImageOverlays(e){e.stopPropagation(),this.imageOverlaysOpened=!this.imageOverlaysOpened,this.imageOverlaysOpened&&(this.galleryOpened&&(this.galleryOpened=!1),this.navigationToolActive&&(this.navigationToolActive=!1),this.imageEnhancementToolActive&&(this.imageEnhancementToolActive=!1))}_toggleImageGallery(e){e.stopPropagation(),this.galleryOpened=!!this.imageGalleryEnabled&&!this.galleryOpened,this.galleryOpened&&(this.imageEnhancementToolActive&&(this.imageEnhancementToolActive=!1),this.navigationToolActive&&(this.navigationToolActive=!1),this.imageOverlaysOpened&&(this.imageOverlaysOpened=!1))}_toggleLocationTool(e){const t=this.imageLocationToolActive;this._closeAllImageTools(),this.imageLocationToolActive=!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType;this._closeAllImageTools(),this.measureType=i===t?null:t,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){this.navigationToolActive=!this.navigationToolActive,this.navigationToolActive&&(this.galleryOpened&&(this.galleryOpened=!1),this.imageEnhancementToolActive&&(this.imageEnhancementToolActive=!1),this.imageOverlaysOpened&&(this.imageOverlaysOpened=!1))}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(O,`${t}deg`),e.style.setProperty(f,`${t+a}deg`)}async loadBestImage(e){return this.viewModel.loadBestImage(e)}loadImageFromSource(e,t){return this.viewModel.loadImageFromSource(e,t)}async overlayMapFeatures(e,t){return this.removeHandles(`${H.overlayed}-${e.id}`),this.addHandles(l((()=>e.visible),(()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible)})),`${H.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${H.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find((t=>t.id===e))),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return j("div",{class:this.classes(x.widget,A)},this._renderRoot())}async startDigitization(e){return this.viewModel.startDigitization(e)}stopDigitization(e){this.viewModel.stopDigitization(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([m({readOnly:!0})],D.prototype,"accuracyParametersMissing",null),e([m()],D.prototype,"activeLayer",null),e([m()],D.prototype,"currentBestFeature",null),e([m()],D.prototype,"currentCoverageVisible",null),e([m()],D.prototype,"digitizationEnabled",void 0),e([m()],D.prototype,"digitizationLayer",null),e([m()],D.prototype,"disabled",null),e([m()],D.prototype,"features",null),e([m()],D.prototype,"imagePointsInView",null),e([m()],D.prototype,"galleryOpened",void 0),e([m()],D.prototype,"icon",null),e([m()],D.prototype,"imageEnhancementToolActive",void 0),e([m({readOnly:!0})],D.prototype,"imageGalleryEnabled",null),e([m()],D.prototype,"imageLocationToolActive",null),e([m()],D.prototype,"imageOverlaysOpened",void 0),e([m({readOnly:!0})],D.prototype,"invalidCameraHeading",null),e([m()],D.prototype,"isAdditionalCoverageVisible",null),e([m()],D.prototype,"isAdditionalPointSourcesVisible",null),e([m()],D.prototype,"mapImageConversionToolState",null),e([m()],D.prototype,"measureType",null),e([m()],D.prototype,"layer",null),e([m()],D.prototype,"navigationToolActive",void 0),e([$(M()),m({type:S})],D.prototype,"viewModel",void 0),e([m(),z("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],D.prototype,"messages",void 0),e([m(),z("esri/core/t9n/Units")],D.prototype,"measurementUnitMessages",void 0),e([m(),z("esri/t9n/common")],D.prototype,"messagesCommon",void 0),e([m(),z("esri/widgets/Sketch/t9n/Sketch")],D.prototype,"messagesSketch",void 0),e([m()],D.prototype,"pixelMeasurementUnit",void 0),e([m()],D.prototype,"pixelAreaMeasurementUnit",void 0),e([m({readOnly:!0})],D.prototype,"popupEnabled",null),e([m()],D.prototype,"referencePoint",null),e([m()],D.prototype,"showCameraLocations",void 0),e([m()],D.prototype,"showMapFeatures",void 0),e([$(["create","delete","redo","undo","update"]),m({readOnly:!0})],D.prototype,"sketchViewModel",null),e([m()],D.prototype,"view",null),e([m({type:F,nonNullable:!0})],D.prototype,"visibleElements",void 0),e([m()],D.prototype,"determineWorkflowForFeature",null),e([m()],D.prototype,"updateFootprint",null),e([m()],D.prototype,"_actionItems",void 0),e([m()],D.prototype,"_activeMeasurementIcon",null),e([m()],D.prototype,"_activeMeasurementHeading",null),e([m()],D.prototype,"_imageOverlaysLoaderTask",void 0),e([m()],D.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([m()],D.prototype,"_measurementToggle",null),e([m()],D.prototype,"_commonActionProperties",null),e([m()],D.prototype,"_imageEnhancementTools",null),e([m()],D.prototype,"_imageGalleryPanel",null),e([m()],D.prototype,"_imageGalleryContext",null),e([m()],D.prototype,"_imageOverlaysComponent",null),e([m()],D.prototype,"_imageOverlayMessages",null),e([m()],D.prototype,"_imageSketchToolsMessages",null),e([m()],D.prototype,"_imageOverlaysPanel",null),e([m()],D.prototype,"_imageOverlaysContext",null),e([m()],D.prototype,"_imageViewer",null),e([m()],D.prototype,"_locationToggle",null),e([m()],D.prototype,"_messageBox",null),e([m()],D.prototype,"_navigationToolExpanded",void 0),e([m()],D.prototype,"_navigationTool",void 0),e([m()],D.prototype,"_panoramicViewer",null),e([m()],D.prototype,"_warningTitleElement",void 0),e([m()],D.prototype,"_renderNavigation",null),e([m()],D.prototype,"_renderThumbnails",null),e([m()],D.prototype,"_sketchLoaderTask",void 0),D=e([h("esri.widgets.OrientedImageryViewer")],D);const B=D;export{B as default};
package/widgets/Print.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{JSONMap as i}from"../core/jsonMap.js";import{watch as a,whenOnce as l}from"../core/reactiveUtils.js";import{unitName as o}from"../core/unitFormatUtils.js";import{addProxy as n,hasSameOrigin as s}from"../core/urlUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{ensureInteger as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import d from"../geometry/SpatialReference.js";import{isValid as m}from"../geometry/support/spatialReferenceUtils.js";import{reArcGISOnlineDomain as u}from"../portal/support/urlUtils.js";import{getToken as h}from"../rest/utils.js";import{formatJsonMap as b}from"../rest/support/fileFormat.js";import _ from"./Widget.js";import v from"./Print/FileLink.js";import g from"./Print/PrintViewModel.js";import{loadCalciteComponents as y}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{legacyIcon as T}from"./support/legacyIcon.js";import{isRTL as x,isActivationKey as k}from"./support/widgetUtils.js";import{messageBundle as C}from"./support/decorators/messageBundle.js";import{tsx as S}from"./support/jsxFactory.js";import{formatNumber as O}from"../intl/number.js";const $=t.ofType(v),I="map-only";var E;!function(e){e.layout="layoutTab",e.mapOnly="mapOnlyTab",e.export="exportTab"}(E||(E={}));const L="esri-print",F=`${L}__advanced-options-button`,M={base:L,headerTitle:`${L}__header-title`,layoutTabList:`${L}__layout-tab-list`,layoutTab:`${L}__layout-tab`,layoutSection:`${L}__layout-section`,mapOnlySection:`${L}__map-only-section`,panelItemsCentered:`${L}__panel-items--centered`,loader:`${L}__loader`,advancedOptionsButton:F,advancedOptionsButtonContainer:`${F}-container`,advancedOptionsButtonTitle:`${F}-title`,advancedOptionsButtonIconOpened:`${F}-icon--opened`,advancedOptionsButtonIconClosed:`${F}-icon--closed`,advancedOptionsButtonIconClosed_RTL:`${F}-icon--closed-rtl`,swapButton:`${L}__swap-button`,printButton:`${L}__export-button`,printButtonSection:`${L}__export-button-section`,printButtonSectionDivider:`${L}__export-button-section--divider`,templateSelectContainer:`${L}__template-select-container`,templateSelectBlock:`${L}__template-select-block`,templateSelectIcon:`${L}__template-select-icon`,templateSelectError:`${L}__template-select-error`,templateSelectArrow:`${L}__template-select-arrow`,formSectionContainer:`${L}__form-section-container`,formCheckboxLabel:`${L}__form-checkbox-label`,advancedOptionsSection:`${L}__advanced-options-section`,advancedOptionsContainer:`${L}__advanced-options-container`,browseTemplateButtonContainer:`${L}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${L}__browse-template-button-container-filter`,exportedFilesContainer:`${L}__export-panel-container`,exportedFilesTitle:`${L}__export-title`,exportedFile:`${L}__exported-file`,exportedFileLink:`${L}__exported-file-link`,exportedFileLinkTitle:`${L}__exported-file-link-title`,exportedFileLinkDescription:`${L}__exported-file-link-description`,exportedFilesEmpty:`${L}__exported-files-empty`,printWidgetContainer:`${L}__container`,content:`${L}__content`,panelContainer:`${L}__panel-container`,scaleInfoContainer:`${L}__scale-info-container`,scaleInputContainer:`${L}__scale-input-container`,scaleInput:`${L}__scale-input`,sizeContainer:`${L}__size-container`,panelError:`${L}__panel--error`,exportedFileError:`${L}__exported-file--error`,exportedFileLoader:`${L}__exported-file--loader`,exportSection:`${L}__export-section`,exportSectionCentered:`${L}__export-section--centered`,templateButtonContainer:`${L}__template-button-container`,templateDoneButton:`${L}__template-done-button`,templateSelectFlowItemContainer:`${L}__template-select-flow-item-container`,templateSelectFlowItemContent:`${L}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${L}__template-select-flow-item-list-heading`,srLabel:`${L}__sr-label`,invalidWkidText:`${L}__invalid-wkid-text`};function P(e,t,i,a){const l=i/t,o=a/t;return{width:Math.round(e*l),height:Math.round(e*o)}}function B(e){return!isNaN(e)&&e>0}function A(e){return e?.toLowerCase()===I}function R(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const N=new i({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),D=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let j=class extends _{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._exportedFileNameMap={},this._selectedTab=E.layout,this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.exportedLinks=new $,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportEnabled=!1,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new g,this._onInput=e=>{this._selectedTab===E.layout?this.templateOptions.title=e.currentTarget.value:this._selectedTab===E.mapOnly&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=h(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([a((()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format]),(()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=b.apiValues;this._formats=e.format.choiceList.map((e=>{const i=t.find((t=>new RegExp(`\\b${t}\\b`,"i").test(e)))??e;return{value:i,label:e===i?e.toUpperCase():e}})).sort(((e,t)=>e.label.localeCompare(t.label)))}const t=this._formats.some((({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format)));if(!e.format.defaultValue||t);else{const t=this._formats.find((({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue)))?.value;t&&(this.templateOptions.format=t)}})),a((()=>[this.templateOptions.id,this.viewModel.loaded]),(async()=>{const{layout:e}=this.templateOptions;this._selectedTab=A(e)?E.mapOnly:E.layout,this._selectedTab===E.layout&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))})),a((()=>this.templateOptions.dpi),(e=>{e<=0&&(this.templateOptions.dpi=1)})),a((()=>this.viewModel.view?.scale),(e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}))]);for(const{name:a,extension:l}of this.exportedLinks)a&&l&&this._updateExportedFileNameMap(`${a}${l}`);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout((()=>{this._awaitingServerResponse=!0,this.scheduleRender()}),500);this.viewModel.load().then((()=>{clearTimeout(i),this._awaitingServerResponse=!1}))}loadDependencies(){return y({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),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"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:p,layout:u,layoutItem:h,legendEnabled:b,northArrowEnabled:_,scaleBarEnabled:v,scaleEnabled:g,scale:y,width:k}=t,C="ready"!==i.state||this._awaitingServerResponse||!(u||h),O=this._renderTitleOrFileNameSection(),$=S("div",{class:M.formSectionContainer},S("calcite-label",null,e.fileFormatTitle,S("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map((({value:e,label:t},i)=>S("calcite-combobox-item",{key:`file-format-${i}`,selected:e===this.templateOptions.format,textLabel:t,value:e})))))),I=S("calcite-label",{layout:"inline"},S("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),L=S("div",null,S("div",{class:M.formSectionContainer},S("calcite-label",null,e.template,S("calcite-block",{class:M.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},S("calcite-icon",{class:M.templateSelectIcon,icon:(this._selectedTemplate?.layout?D.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?S("calcite-icon",{class:M.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,S("calcite-icon",{class:M.templateSelectArrow,icon:x()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),I),F=S("div",{class:M.formSectionContainer},S("calcite-label",null,e.dpi,S("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._handleDPIChange}))),P=S("div",{class:M.formSectionContainer},S("calcite-label",null,S("div",{class:M.srLabel},e.outSpatialReference,S("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),S("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=c(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new d({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||m(i.outSpatialReference)}}),this._isValidSpatialReference?null:S("div",{class:M.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),B=S("div",{class:this.classes(M.scaleInfoContainer,M.formSectionContainer)},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),S("div",{class:M.scaleInputContainer},S("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${y}`,bind:this,class:M.scaleInput,"data-input-name":"scale",disabled:!g,value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue}),S("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),A=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:M.advancedOptionsContainer,key:"advanced-section-for-layout"},B,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?S("div",{class:M.formSectionContainer,key:"author-info"},S("calcite-label",null,e.author,S("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?S("div",{class:M.formSectionContainer,key:"copyright-text"},S("calcite-label",null,e.copyright,S("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,F,P,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?S("div",{class:M.formSectionContainer,key:"legend-info"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:b,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?S("div",{class:M.formSectionContainer,key:"north-arrow"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:_,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?S("div",{class:M.formSectionContainer,key:"scale-bar"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),R=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:M.advancedOptionsContainer},B,F,P,S("div",{class:M.formSectionContainer},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),N=this.exportedLinks.toArray(),j=this._renderExportedLink(N),V={[M.exportSectionCentered]:!N.length},U=this._selectedTab===E.layout?S("section",{"aria-labelledby":`${this.id}__layoutTab`,class:M.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},S("div",{class:M.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?O:null,L,this._selectedTab===E.layout?$:null,S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(M.panelContainer,M.advancedOptionsSection),collapsible:!0,disabled:!(u||h?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},A))):this._selectedTab===E.mapOnly?S("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:M.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},S("div",{class:M.panelContainer},O,$,S("div",null,S("div",{class:this.classes(M.sizeContainer,M.formSectionContainer)},S("calcite-label",null,e.width,S("calcite-input-number",{bind:this,"data-input-name":"width",value:`${k}`,onCalciteInputNumberInput:this._updateNumberInputValue})),S("calcite-label",null,e.height,S("calcite-input-number",{bind:this,"data-input-name":"height",value:`${p}`,onCalciteInputNumberInput:this._updateNumberInputValue})),S("button",{"aria-label":e.swap,bind:this,class:this.classes(f.widgetButton,M.swapButton,T.swap),onclick:this._switchInput,type:"button"})),I),S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(M.panelContainer,M.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},R))):S("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(M.exportSection,V),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},S("div",{class:M.panelContainer},S("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:M.exportedFilesContainer},0===N.length?S("div",{class:M.exportedFilesEmpty},S("calcite-icon",{icon:"file",scale:"l"}),S("div",null,S(w,{class:M.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),S("div",null,e.exportHint))):j))),H="2d"!==a?.type,z=S("div",{class:M.panelError},a?H?e.sceneViewError:e.serviceError:e.noViewError),W=N.some((({state:e})=>"pending"===e)),q=S("div",{class:M.content,key:"panel"},S("div",null,S("ul",{bind:this,class:M.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===E.layout}`,class:M.layoutTab,"data-tab-id":E.layout,id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===E.mapOnly}`,class:M.layoutTab,"data-tab-id":E.mapOnly,id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===E.export}`,class:M.layoutTab,"data-tab-id":E.export,id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},W?S("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),U),this._selectedTab!==E.export?S("div",{class:this.classes(M.printButtonSection,!this.saveExportHidden&&this.portal?M.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,S("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(M.printButton),disabled:C||!(u||h?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),K=S("calcite-flow",{key:"root-flow"},S("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},S("div",{class:M.printWidgetContainer},this.headerVisible?S("header",{class:M.headerTitle},e.export):null,this.error||H||!a?z:q)),this._renderChooseTemplateFlowItem()),G="initializing"===i.state,J=G?this._renderLoader():K,Q={[M.panelItemsCentered]:G};return S("div",{bind:this,class:this.classes(M.base,f.widget,f.panel,Q)},J)}_getPageSizeLabel(e){if(!e)return;const t=e.layoutTemplateInfo;if(!t)return;const i=N.fromJSON(t.pageUnits.toLowerCase());return`${O(t.pageSize[0])} × ${O(t.pageSize[1])} ${o(this.messagesUnits,i,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l,type:o}=e;if("print-service-template"===o)return this.messages[a];const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter((({layout:t,layoutItem:i})=>!A(t)&&!!i?.id&&e.includes(i.id))):[]}_getDefaultTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter((({layout:t,layoutItem:i})=>!(A(t)||i?.id&&e.includes(i.id)))):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter((({layout:e})=>!A(e)))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)),e.map((e=>S("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},S("calcite-icon",{icon:(e.layout?D.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?S("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?S("calcite-icon",{class:M.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?S("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null)))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=u.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?S("calcite-button",{appearance:"outline",class:n?M.browseTemplateButtonContainerFilter:M.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return S("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},S("div",{class:M.templateSelectFlowItemContainer},S("div",{class:M.templateSelectFlowItemContent},n?null:s,S("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?S("div",{key:"my-templates"},S("div",{class:M.templateSelectFlowItemListHeading},e.myTemplates,S("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta)),this._renderLayoutTemplates(i,!0,!0)):null,a.length?S("div",{key:"org-templates"},S("div",{class:M.templateSelectFlowItemListHeading},e.organizationTemplates,t?S("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?S("div",{key:"default-templates"},S("div",{class:M.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?S("div",{key:"service-templates"},S("div",{class:M.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),S("div",{class:M.templateButtonContainer},S("calcite-button",{class:M.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?S("div",{class:M.formSectionContainer,key:"custom-text-elements"},e.map(((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:S("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,S("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))}))):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l=this._selectedTab===E.layout?e:t,o=this._selectedTab===E.layout?i:a,n=this._selectedTab===E.layout?this.templateOptions.title:this.templateOptions.fileName;return S("div",{class:M.formSectionContainer,key:l},S("calcite-label",null,l,S("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&this._selectedTab===E.layout||"mapOnlyTab"===t&&this._selectedTab===E.mapOnly||"exportTab"===t&&this._selectedTab===E.export)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[M.loader]:this._awaitingServerResponse};return S("div",{class:this.classes(e),key:"loader"})}_updateExportedFileNameMap(e){void 0!==this._exportedFileNameMap[e]?this._exportedFileNameMap[e]++:this._exportedFileNameMap[e]=0}_createFileLink(e,t){const i=t||this.messages.untitled,a=e.format.toLowerCase(),l=a.includes("png")?"png":a,o=i+l;return this._updateExportedFileNameMap(o),new v({name:i,extension:l,count:this._exportedFileNameMap[o]})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find((e=>{const[i]=Object.entries(e)[0];return i===t}))[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(B(l))a[i]=l;else{const e=a[i];t.value=`${e}`}}_handleDPIChange(e){const{templateOptions:t}=this,i=t.dpi;this._updateNumberInputValue(e);const a=t.dpi,{height:l,width:o}=P(a,i,t.width,t.height);t.height=l,t.width=o}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e,saveExportEnabled:t}=this,i=this.viewModel.toPrintTemplate(e),a=this._selectedTab===E.layout?i.layoutOptions?.titleText:e.fileName,l=this._createFileLink(i,a);this.exportedLinks.add(l),this.emit("submit",{link:l,saveExportEnabled:t}),this._selectedTab=E.export,this.viewModel.print(i).then((e=>{l.set({url:e&&e.url,state:"ready"})})).catch((e=>{l.set({error:e,state:"error"})})).then((()=>{this.emit("complete",{link:l,saveExportEnabled:t}),this.scheduleRender()}))}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLink(e){const t=this.messages,i=e.map((e=>{const{error:i,url:a,state:o}=e,r=e.formattedName??"",c="error"===o,p="pending"===o,d="ready"===o;let m=a||null;m&&(m=n(m));const u=s(a,location.href);let h;h=p?t.pending:d?t.ready:t.errorMessage;const b=c?"print-task:cim-symbol-unsupported"===i?.name?t.exportWebMapCIMError:t.exportWebMapError:"";return S("calcite-list-item",{"aria-label":h,key:r,title:b},S("div",{class:M.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},S("div",null,S("div",{class:M.exportedFileLinkTitle},r),S("div",{class:M.exportedFileLinkDescription},p?t.generatingExport:b||(u?t.ready:t.linkReady))),d?S("calcite-icon",{"aria-label":`${r}. ${t.linkReady}`,icon:u?"download-to":"launch",key:`${r}-end-icon`,scale:"s",slot:"content-end"}):null),p?S("calcite-loader",{class:M.exportedFileLoader,inline:!0,key:`${r}-loader`,label:t.generatingExport,scale:"m",slot:"content-start"}):S("calcite-icon",{icon:R(e),key:`${r}-start-icon`,scale:"s",slot:"content-start"}),p?null:this.saveAsButtonCallback&&!c&&this._isFormatAllowedForSaving(e.extension)?S("calcite-action",{"aria-label":`${b}`,icon:"ellipsis",id:`${r}-popover-button`,key:`${r}-action`,slot:"actions-end",text:`${b}`},S("calcite-popover",{autoClose:!0,key:`${r}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${r}-popover-button`,scale:"s"},S("calcite-list",{label:""},e.portalItem?S("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},S("calcite-icon",{icon:"launch2",key:`${r}-launch-icon`,scale:"s",slot:"content-start"})):S("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(l((()=>e.portalItem)).then((e=>{e.itemPageUrl&&this.scheduleRender()})),await this.saveAsButtonCallback(e))}},S("calcite-icon",{icon:"save",key:`${r}-save-icon`,scale:"s",slot:"content-start"})),S("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},S("calcite-icon",{icon:"trash",key:`${r}-delete-icon`,scale:"s",slot:"content-start"}))))):S("calcite-action",{"aria-label":`${b}`,icon:"x",key:`${r}-action`,onclick:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:`${b}`}))}));return S("calcite-list",{filterEnabled:e?.length>10,label:t.exportedLinksList},i)}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,this._selectedTab===E.mapOnly)this.templateOptions.reset(),this.templateOptions.layout=I;else if(this._selectedTab===E.layout){const e=this._selectedTemplate??this.viewModel.defaultTemplate;e?this.viewModel.applyTemplate(e):this.templateOptions.reset()}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(k(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case E.layout:this._toggleTab("ArrowLeft"===t?E.export:E.mapOnly);break;case E.mapOnly:this._toggleTab("ArrowLeft"===t?E.layout:E.export);break;case E.export:this._toggleTab("ArrowLeft"===t?E.mapOnly:E.layout)}e.preventDefault(),e.stopPropagation()}}};e([r()],j.prototype,"_showTemplates",void 0),e([r()],j.prototype,"_isValidSpatialReference",void 0),e([r()],j.prototype,"allowedFormats",null),e([r()],j.prototype,"allowedFormatsForSaving",void 0),e([r()],j.prototype,"allowedLayouts",null),e([r()],j.prototype,"browseTemplateButtonOnClick",void 0),e([r()],j.prototype,"error",null),e([r({type:$})],j.prototype,"exportedLinks",void 0),e([r()],j.prototype,"extraParameters",null),e([r()],j.prototype,"headerVisible",void 0),e([r()],j.prototype,"headingLevel",void 0),e([r()],j.prototype,"icon",null),e([r()],j.prototype,"includeDefaultTemplates",null),e([r()],j.prototype,"includeOrganizationTemplates",void 0),e([r()],j.prototype,"label",null),e([r(),C("esri/widgets/Print/t9n/Print")],j.prototype,"messages",void 0),e([r(),C("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([r(),C("esri/core/t9n/Units")],j.prototype,"messagesUnits",void 0),e([r({type:d})],j.prototype,"outSpatialReference",null),e([r()],j.prototype,"portal",null),e([r()],j.prototype,"saveExportEnabled",void 0),e([r()],j.prototype,"saveExportHidden",void 0),e([r()],j.prototype,"showPrintAreaEnabled",null),e([r()],j.prototype,"printServiceUrl",null),e([r()],j.prototype,"saveAsButtonCallback",void 0),e([r()],j.prototype,"templateCustomTextElements",null),e([r()],j.prototype,"templateOptions",null),e([r()],j.prototype,"view",null),e([r({type:g})],j.prototype,"viewModel",void 0),j=e([p("esri.widgets.Print")],j);const V=j;export{V as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{JSONMap as i}from"../core/jsonMap.js";import{watch as a,whenOnce as l}from"../core/reactiveUtils.js";import{unitName as o}from"../core/unitFormatUtils.js";import{addProxy as n,hasSameOrigin as s}from"../core/urlUtils.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import{ensureInteger as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import d from"../geometry/SpatialReference.js";import{isValid as m}from"../geometry/support/spatialReferenceUtils.js";import{reArcGISOnlineDomain as u}from"../portal/support/urlUtils.js";import{getToken as h}from"../rest/utils.js";import{formatJsonMap as b}from"../rest/support/fileFormat.js";import _ from"./Widget.js";import v from"./Print/FileLink.js";import g from"./Print/PrintViewModel.js";import{loadCalciteComponents as y}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{Heading as w}from"./support/Heading.js";import{legacyIcon as T}from"./support/legacyIcon.js";import{isRTL as x,isActivationKey as k}from"./support/widgetUtils.js";import{messageBundle as C}from"./support/decorators/messageBundle.js";import{tsx as S}from"./support/jsxFactory.js";import{formatNumber as O}from"../intl/number.js";const $=t.ofType(v),I="map-only";var E;!function(e){e.layout="layoutTab",e.mapOnly="mapOnlyTab",e.export="exportTab"}(E||(E={}));const L="esri-print",F=`${L}__advanced-options-button`,M={base:L,headerTitle:`${L}__header-title`,layoutTabList:`${L}__layout-tab-list`,layoutTab:`${L}__layout-tab`,layoutSection:`${L}__layout-section`,mapOnlySection:`${L}__map-only-section`,panelItemsCentered:`${L}__panel-items--centered`,loader:`${L}__loader`,advancedOptionsButton:F,advancedOptionsButtonContainer:`${F}-container`,advancedOptionsButtonTitle:`${F}-title`,advancedOptionsButtonIconOpened:`${F}-icon--opened`,advancedOptionsButtonIconClosed:`${F}-icon--closed`,advancedOptionsButtonIconClosed_RTL:`${F}-icon--closed-rtl`,swapButton:`${L}__swap-button`,printButton:`${L}__export-button`,printButtonSection:`${L}__export-button-section`,printButtonSectionDivider:`${L}__export-button-section--divider`,templateSelectContainer:`${L}__template-select-container`,templateSelectBlock:`${L}__template-select-block`,templateSelectIcon:`${L}__template-select-icon`,templateSelectError:`${L}__template-select-error`,templateSelectArrow:`${L}__template-select-arrow`,formSectionContainer:`${L}__form-section-container`,formCheckboxLabel:`${L}__form-checkbox-label`,advancedOptionsSection:`${L}__advanced-options-section`,advancedOptionsContainer:`${L}__advanced-options-container`,browseTemplateButtonContainer:`${L}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${L}__browse-template-button-container-filter`,exportedFilesContainer:`${L}__export-panel-container`,exportedFilesTitle:`${L}__export-title`,exportedFile:`${L}__exported-file`,exportedFileLink:`${L}__exported-file-link`,exportedFileLinkTitle:`${L}__exported-file-link-title`,exportedFileLinkDescription:`${L}__exported-file-link-description`,exportedFilesEmpty:`${L}__exported-files-empty`,printWidgetContainer:`${L}__container`,content:`${L}__content`,panelContainer:`${L}__panel-container`,scaleInfoContainer:`${L}__scale-info-container`,scaleInputContainer:`${L}__scale-input-container`,scaleInput:`${L}__scale-input`,sizeContainer:`${L}__size-container`,panelError:`${L}__panel--error`,exportedFileError:`${L}__exported-file--error`,exportedFileLoader:`${L}__exported-file--loader`,exportSection:`${L}__export-section`,exportSectionCentered:`${L}__export-section--centered`,templateButtonContainer:`${L}__template-button-container`,templateDoneButton:`${L}__template-done-button`,templateSelectFlowItemContainer:`${L}__template-select-flow-item-container`,templateSelectFlowItemContent:`${L}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${L}__template-select-flow-item-list-heading`,srLabel:`${L}__sr-label`,invalidWkidText:`${L}__invalid-wkid-text`};function P(e,t,i,a){const l=i/t,o=a/t;return{width:Math.round(e*l),height:Math.round(e*o)}}function B(e){return!isNaN(e)&&e>0}function A(e){return e?.toLowerCase()===I}function R(e){const{state:t,extension:i}=e;switch(t){case"pending":return"spinner";case"error":return"exclamation-mark-circle";default:return i?.toLowerCase()?.includes("pdf")?"file-pdf":"file"}}const N=new i({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),D=new Map([["a3-landscape","a3-landscape"],["a3-portrait","a3-portrait"],["a4-landscape","a4-landscape"],["a4-portrait","a4-portrait"],["letter-ansi-a-landscape","ansi-a-landscape"],["letter-ansi-a-portrait","ansi-a-portrait"],["tabloid-ansi-b-landscape","ansi-b-landscape"],["tabloid-ansi-b-portrait","ansi-b-portrait"]]);let j=class extends _{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._exportedFileNameMap={},this._selectedTab=E.layout,this._pendingExportScroll=!1,this._rootNode=null,this._selectedTemplate=null,this._formats=[],this._showTemplates=!1,this._isValidSpatialReference=!0,this.allowedFormatsForSaving=null,this.browseTemplateButtonOnClick=null,this.exportedLinks=new $,this.headerVisible=!0,this.headingLevel=3,this.includeOrganizationTemplates=!0,this.messagesCommon=null,this.messagesUnits=null,this.saveExportEnabled=!1,this.saveExportHidden=!0,this.saveAsButtonCallback=null,this.viewModel=new g,this._onInput=e=>{this._selectedTab===E.layout?this.templateOptions.title=e.currentTarget.value:this._selectedTab===E.mapOnly&&(this.templateOptions.fileName=e.currentTarget.value)},this._handleLinkClick=e=>{const t=e.currentTarget["data-item"];if(!t||"ready"!==t.state||!t.url)return;const i=h(this.viewModel.effectivePrintServiceUrl),a=t.url,l=document.createElement("a");if(l.target="_blank",l.href=a,l.rel="noreferrer",l.download=t.formattedName??"",!i)return l.click(),void e.stopPropagation();e.preventDefault();const o=new URL(a);o.searchParams.set("token",i),l.href=o.href,l.click(),l.href=a},this._focusOnTabChange=this._focusOnTabChange.bind(this)}initialize(){this.addHandles([a((()=>[this.templateOptions.format,this.viewModel.templatesInfo?.format]),(()=>{const{templatesInfo:e}=this.viewModel;if(!e)return;if(this._formats.length!==e.format.choiceList.length){const t=b.apiValues;this._formats=e.format.choiceList.map((e=>{const i=t.find((t=>new RegExp(`\\b${t}\\b`,"i").test(e)))??e;return{value:i,label:e===i?e.toUpperCase():e}})).sort(((e,t)=>e.label.localeCompare(t.label)))}const t=this._formats.some((({value:e})=>new RegExp(`\\b${e}\\b`,"i").test(this.templateOptions.format)));if(!e.format.defaultValue||t);else{const t=this._formats.find((({value:t})=>new RegExp(`\\b${t}\\b`,"i").test(e.format.defaultValue)))?.value;t&&(this.templateOptions.format=t)}})),a((()=>[this.templateOptions.id,this.viewModel.loaded]),(async()=>{const{layout:e}=this.templateOptions;this._selectedTab=A(e)?E.mapOnly:E.layout,this._selectedTab===E.layout&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))})),a((()=>this.templateOptions.dpi),(e=>{e<=0&&(this.templateOptions.dpi=1)})),a((()=>this.viewModel.view?.scale),(e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}))]);for(const{name:a,extension:l}of this.exportedLinks)a&&l&&this._updateExportedFileNameMap(`${a}${l}`);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const i=setTimeout((()=>{this._awaitingServerResponse=!0,this.scheduleRender()}),500);this.viewModel.load().then((()=>{clearTimeout(i),this._awaitingServerResponse=!1}))}loadDependencies(){return y({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),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"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),link:()=>import("@esri/calcite-components/dist/components/calcite-link")})}destroy(){this.viewModel.destroy()}get allowedFormats(){return this.viewModel.allowedFormats}set allowedFormats(e){this.viewModel.allowedFormats=e}get allowedLayouts(){return this.viewModel.allowedLayouts}set allowedLayouts(e){this.viewModel.allowedLayouts=e}get error(){return this.viewModel.error}get extraParameters(){return this.viewModel.extraParameters}set extraParameters(e){this.viewModel.extraParameters=e}get icon(){return"print"}set icon(e){this._overrideIfSome("icon",e)}get includeDefaultTemplates(){return this.viewModel.includeDefaultTemplates}set includeDefaultTemplates(e){this.viewModel.includeDefaultTemplates=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get outSpatialReference(){return this.viewModel.outSpatialReference}set outSpatialReference(e){this.viewModel.outSpatialReference=e}get portal(){return this.viewModel.portal}set portal(e){this.viewModel.portal=e}get showPrintAreaEnabled(){return this.viewModel.showPrintAreaEnabled}set showPrintAreaEnabled(e){this.viewModel.showPrintAreaEnabled=e}get printServiceUrl(){return this.viewModel.printServiceUrl}set printServiceUrl(e){this.viewModel.printServiceUrl=e}get templateCustomTextElements(){return this.viewModel.templateCustomTextElements}set templateCustomTextElements(e){this.viewModel.templateCustomTextElements=e}get templateOptions(){return this.viewModel.templateOptions}set templateOptions(e){this.viewModel.templateOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{messages:e,templateOptions:t,viewModel:i,view:a}=this,{attributionEnabled:l,author:o,copyright:n,dpi:s,format:r,height:p,layout:u,layoutItem:h,legendEnabled:b,northArrowEnabled:_,scaleBarEnabled:v,scaleEnabled:g,scale:y,width:k}=t,C="ready"!==i.state||this._awaitingServerResponse||!(u||h),O=this._renderTitleOrFileNameSection(),$=S("div",{class:M.formSectionContainer},S("calcite-label",null,e.fileFormatTitle,S("calcite-combobox",{clearDisabled:!0,label:e.formatDefaultOption,maxItems:6,placeholder:e.formatDefaultOption,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.templateOptions.format=e.selectedItems[0]?.value??"pdf"}},this._formats.map((({value:e,label:t},i)=>S("calcite-combobox-item",{key:`file-format-${i}`,selected:e===this.templateOptions.format,textLabel:t,value:e})))))),I=S("calcite-label",{layout:"inline"},S("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),L=S("div",null,S("div",{class:M.formSectionContainer},S("calcite-label",null,e.template,S("calcite-block",{class:M.templateSelectContainer,collapsible:!1,description:this._getPageSizeLabel(this._selectedTemplate),heading:this._getTemplateLabel(this._selectedTemplate,!0),key:"template-select-block",loading:"loading"===this._selectedTemplate?.state,onclick:()=>this._showTemplates=!0,onkeydown:e=>{"Enter"!==e.key&&" "!==e.key||(this._showTemplates=!0)},tabIndex:0},S("calcite-icon",{class:M.templateSelectIcon,icon:(this._selectedTemplate?.layout?D.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?S("calcite-icon",{class:M.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,S("calcite-icon",{class:M.templateSelectArrow,icon:x()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),I),F=S("div",{class:M.formSectionContainer},S("calcite-label",null,e.dpi,S("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._handleDPIChange}))),P=S("div",{class:M.formSectionContainer},S("calcite-label",null,S("div",{class:M.srLabel},e.outSpatialReference,S("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),S("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=c(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new d({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||m(i.outSpatialReference)}}),this._isValidSpatialReference?null:S("div",{class:M.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),B=S("div",{class:this.classes(M.scaleInfoContainer,M.formSectionContainer)},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:g,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),S("div",{class:M.scaleInputContainer},S("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${y}`,bind:this,class:M.scaleInput,"data-input-name":"scale",disabled:!g,value:`${y}`,onCalciteInputNumberInput:this._updateNumberInputValue}),S("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),A=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:M.advancedOptionsContainer,key:"advanced-section-for-layout"},B,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?S("div",{class:M.formSectionContainer,key:"author-info"},S("calcite-label",null,e.author,S("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?S("div",{class:M.formSectionContainer,key:"copyright-text"},S("calcite-label",null,e.copyright,S("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,F,P,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?S("div",{class:M.formSectionContainer,key:"legend-info"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:b,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?S("div",{class:M.formSectionContainer,key:"north-arrow"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:_,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?S("div",{class:M.formSectionContainer,key:"scale-bar"},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),R=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:M.advancedOptionsContainer},B,F,P,S("div",{class:M.formSectionContainer},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),N=this.exportedLinks.toArray(),j=this._renderExportedLink(N),V={[M.exportSectionCentered]:!N.length},U=this._selectedTab===E.layout?S("section",{"aria-labelledby":`${this.id}__layoutTab`,class:M.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},S("div",{class:M.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?O:null,L,this._selectedTab===E.layout?$:null,S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(M.panelContainer,M.advancedOptionsSection),collapsible:!0,disabled:!(u||h?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},A))):this._selectedTab===E.mapOnly?S("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:M.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},S("div",{class:M.panelContainer},O,$,S("div",null,S("div",{class:this.classes(M.sizeContainer,M.formSectionContainer)},S("calcite-label",null,e.width,S("calcite-input-number",{bind:this,"data-input-name":"width",value:`${k}`,onCalciteInputNumberInput:this._updateNumberInputValue})),S("calcite-label",null,e.height,S("calcite-input-number",{bind:this,"data-input-name":"height",value:`${p}`,onCalciteInputNumberInput:this._updateNumberInputValue})),S("button",{"aria-label":e.swap,bind:this,class:this.classes(f.widgetButton,M.swapButton,T.swap),onclick:this._switchInput,type:"button"})),I),S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(M.panelContainer,M.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},R))):S("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(M.exportSection,V),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},S("div",{class:M.panelContainer},S("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:M.exportedFilesContainer},0===N.length?S("div",{class:M.exportedFilesEmpty},S("calcite-icon",{icon:"file",scale:"l"}),S("div",null,S(w,{class:M.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),S("div",null,e.exportHint))):j))),H="2d"!==a?.type,z=S("div",{class:M.panelError},a?H?e.sceneViewError:e.serviceError:e.noViewError),W=N.some((({state:e})=>"pending"===e)),q=S("div",{class:M.content,key:"panel"},S("div",null,S("ul",{bind:this,class:M.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===E.layout}`,class:M.layoutTab,"data-tab-id":E.layout,id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===E.mapOnly}`,class:M.layoutTab,"data-tab-id":E.mapOnly,id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===E.export}`,class:M.layoutTab,"data-tab-id":E.export,id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},W?S("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),U),this._selectedTab!==E.export?S("div",{class:this.classes(M.printButtonSection,!this.saveExportHidden&&this.portal?M.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,S("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(M.printButton),disabled:C||!(u||h?.id)&&!r,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),K=S("calcite-flow",{key:"root-flow"},S("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},S("div",{class:M.printWidgetContainer},this.headerVisible?S("header",{class:M.headerTitle},e.export):null,this.error||H||!a?z:q)),this._renderChooseTemplateFlowItem()),G="initializing"===i.state,J=G?this._renderLoader():K,Q={[M.panelItemsCentered]:G};return S("div",{bind:this,class:this.classes(M.base,f.widget,f.panel,Q)},J)}_getPageSizeLabel(e){if(!e)return;const t=e.layoutTemplateInfo;if(!t)return;const i=N.fromJSON(t.pageUnits.toLowerCase());return`${O(t.pageSize[0])} × ${O(t.pageSize[1])} ${o(this.messagesUnits,i,"abbr")}`}_getTemplateLabel(e,t=!1){if(!e)return t?this.messages.selectTemplate:this.messages.untitled;const{label:i,layout:a,layoutItem:l,type:o}=e;if("print-service-template"===o&&this.messages[a])return this.messages[a];const n=i??a??l?.id;return n?.replaceAll("_"," ")??this.messages.untitled}_getPortalTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates&&this.includeOrganizationTemplates?this.viewModel.defaultTemplates.toArray().filter((({layout:t,layoutItem:i})=>!A(t)&&!!i?.id&&e.includes(i.id))):[]}_getDefaultTemplates(){const{portalTemplateIds:e}=this.viewModel;return this.includeDefaultTemplates?this.viewModel.defaultTemplates.toArray().filter((({layout:t,layoutItem:i})=>!(A(t)||i?.id&&e.includes(i.id)))):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter((({layout:e})=>!A(e)))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)),e.map((e=>S("calcite-list-item",{description:this._getPageSizeLabel(e),key:`template-${e.id}-${e.id===this.templateOptions.id}`,label:this._getTemplateLabel(e),selected:e.id===this.templateOptions.id,title:e.description??"",value:e},S("calcite-icon",{icon:(e.layout?D.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?S("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?S("calcite-icon",{class:M.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?S("calcite-action",{icon:"trash",onclick:()=>this.viewModel.removePortalTemplate(e),slot:"actions-end",text:"delete"}):null)))}_renderChooseTemplateFlowItem(){if(!this._showTemplates)return null;const{messages:e}=this,t=u.test(this.portal?.url),i=this.viewModel.browseTemplates.toArray(),a=this._getPortalTemplates(),l=this._getDefaultTemplates(),o=this._getPrintServiceTemplates(),n=i.length+a.length+l.length+o.length>15,s=this.browseTemplateButtonOnClick?S("calcite-button",{appearance:"outline",class:n?M.browseTemplateButtonContainerFilter:M.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return S("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},S("div",{class:M.templateSelectFlowItemContainer},S("div",{class:M.templateSelectFlowItemContent},n?null:s,S("calcite-list",{filterEnabled:n,filterProps:["label"],key:"template-list",label:e.templateList,selectionMode:"single-persist",onCalciteListChange:({currentTarget:e})=>this.viewModel.applyTemplate(e.selectedItems[0]?.value)},n?s:null,i.length?S("div",{key:"my-templates"},S("div",{class:M.templateSelectFlowItemListHeading},e.myTemplates,S("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta)),this._renderLayoutTemplates(i,!0,!0)):null,a.length?S("div",{key:"org-templates"},S("div",{class:M.templateSelectFlowItemListHeading},e.organizationTemplates,t?S("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?S("div",{key:"default-templates"},S("div",{class:M.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?S("div",{key:"service-templates"},S("div",{class:M.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),S("div",{class:M.templateButtonContainer},S("calcite-button",{class:M.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?S("div",{class:M.formSectionContainer,key:"custom-text-elements"},e.map(((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:S("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,S("calcite-input",{bind:this,"data-input-custom":!0,"data-input-name":i,value:a??"",onCalciteInputInput:this._updateInputValue}))}))):null}_renderTitleOrFileNameSection(){const{title:e,fileName:t,titlePlaceHolder:i,fileNamePlaceHolder:a}=this.messages,l=this._selectedTab===E.layout?e:t,o=this._selectedTab===E.layout?i:a,n=this._selectedTab===E.layout?this.templateOptions.title:this.templateOptions.fileName;return S("div",{class:M.formSectionContainer,key:l},S("calcite-label",null,l,S("calcite-input",{placeholder:o,value:n??"",onCalciteInputInput:this._onInput})))}_focusOnTabChange(e){if(!this._activeTabFocusRequested)return;const t=e.getAttribute("data-tab-id");("layoutTab"===t&&this._selectedTab===E.layout||"mapOnlyTab"===t&&this._selectedTab===E.mapOnly||"exportTab"===t&&this._selectedTab===E.export)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[M.loader]:this._awaitingServerResponse};return S("div",{class:this.classes(e),key:"loader"})}_updateExportedFileNameMap(e){void 0!==this._exportedFileNameMap[e]?this._exportedFileNameMap[e]++:this._exportedFileNameMap[e]=0}_createFileLink(e,t){const i=t||this.messages.untitled,a=e.format.toLowerCase(),l=a.includes("png")?"png":a,o=i+l;return this._updateExportedFileNameMap(o),new v({name:i,extension:l,count:this._exportedFileNameMap[o]})}_resetToCurrentScale(){this.templateOptions.scale=this.viewModel.view?.scale}_updateCustomTextElementValue(e,t,i){e.find((e=>{const[i]=Object.entries(e)[0];return i===t}))[t]=i}_updateInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),a=!!t["data-input-custom"],{templateOptions:l}=this;a?this._updateCustomTextElementValue(l.customTextElements,i,t.value):l[i]=t.value}_updateNumberInputValue(e){const t=e.currentTarget,i=t.getAttribute("data-input-name"),{templateOptions:a}=this,l=Number(t.value);if(B(l))a[i]=l;else{const e=a[i];t.value=`${e}`}}_handleDPIChange(e){const{templateOptions:t}=this,i=t.dpi;this._updateNumberInputValue(e);const a=t.dpi,{height:l,width:o}=P(a,i,t.width,t.height);t.height=l,t.width=o}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e,saveExportEnabled:t}=this,i=this.viewModel.toPrintTemplate(e),a=this._selectedTab===E.layout?i.layoutOptions?.titleText:e.fileName,l=this._createFileLink(i,a);this.exportedLinks.add(l),this.emit("submit",{link:l,saveExportEnabled:t}),this._selectedTab=E.export,this.viewModel.print(i).then((e=>{l.set({url:e&&e.url,state:"ready"})})).catch((e=>{l.set({error:e,state:"error"})})).then((()=>{this.emit("complete",{link:l,saveExportEnabled:t}),this.scheduleRender()}))}_switchInput(){[this.templateOptions.width,this.templateOptions.height]=[this.templateOptions.height,this.templateOptions.width]}_scrollExportIntoView(){if(!this._pendingExportScroll)return;this._pendingExportScroll=!1;const e=this._rootNode;if(!e)return;const{clientHeight:t,scrollHeight:i}=e,a=i-t;a>0&&(e.scrollTop=a)}_toggleInputValue(e){const t=e.target,i=t.getAttribute("data-option-name");this.templateOptions[i]=t.checked,"scaleEnabled"===i&&this._resetToCurrentScale()}_renderExportedLink(e){const t=this.messages,i=e.map((e=>{const{error:i,url:a,state:o}=e,r=e.formattedName??"",c="error"===o,p="pending"===o,d="ready"===o;let m=a||null;m&&(m=n(m));const u=s(a,location.href);let h;h=p?t.pending:d?t.ready:t.errorMessage;const b=c?"print-task:cim-symbol-unsupported"===i?.name?t.exportWebMapCIMError:t.exportWebMapError:"";return S("calcite-list-item",{"aria-label":h,key:r,title:b},S("div",{class:M.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},S("div",null,S("div",{class:M.exportedFileLinkTitle},r),S("div",{class:M.exportedFileLinkDescription},p?t.generatingExport:b||(u?t.ready:t.linkReady))),d?S("calcite-icon",{"aria-label":`${r}. ${t.linkReady}`,icon:u?"download-to":"launch",key:`${r}-end-icon`,scale:"s",slot:"content-end"}):null),p?S("calcite-loader",{class:M.exportedFileLoader,inline:!0,key:`${r}-loader`,label:t.generatingExport,scale:"m",slot:"content-start"}):S("calcite-icon",{icon:R(e),key:`${r}-start-icon`,scale:"s",slot:"content-start"}),p?null:this.saveAsButtonCallback&&!c&&this._isFormatAllowedForSaving(e.extension)?S("calcite-action",{"aria-label":`${b}`,icon:"ellipsis",id:`${r}-popover-button`,key:`${r}-action`,slot:"actions-end",text:`${b}`},S("calcite-popover",{autoClose:!0,key:`${r}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${r}-popover-button`,scale:"s"},S("calcite-list",{label:""},e.portalItem?S("calcite-list-item",{label:t.openItem,onCalciteListItemSelect:()=>{const t=e.portalItem;if(!t||!t.itemPageUrl)return;const i=document.createElement("a");i.target="_blank",i.href=t.itemPageUrl,i.rel="noreferrer",i.click()}},S("calcite-icon",{icon:"launch2",key:`${r}-launch-icon`,scale:"s",slot:"content-start"})):S("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(l((()=>e.portalItem)).then((e=>{e.itemPageUrl&&this.scheduleRender()})),await this.saveAsButtonCallback(e))}},S("calcite-icon",{icon:"save",key:`${r}-save-icon`,scale:"s",slot:"content-start"})),S("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},S("calcite-icon",{icon:"trash",key:`${r}-delete-icon`,scale:"s",slot:"content-start"}))))):S("calcite-action",{"aria-label":`${b}`,icon:"x",key:`${r}-action`,onclick:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:`${b}`}))}));return S("calcite-list",{filterEnabled:e?.length>10,label:t.exportedLinksList},i)}_isFormatAllowedForSaving(e){return!this.allowedFormatsForSaving||"all"===this.allowedFormatsForSaving||!(!e||!this.allowedFormatsForSaving.includes(e))}_toggleLayoutPanel(e){const t=e.target;this._toggleTab(t.getAttribute("data-tab-id"))}_toggleTab(e,t=!0){if(this._selectedTab=e,this._selectedTab===E.mapOnly)this.templateOptions.reset(),this.templateOptions.layout=I;else if(this._selectedTab===E.layout){const e=this._selectedTemplate??this.viewModel.defaultTemplate;e?this.viewModel.applyTemplate(e):this.templateOptions.reset()}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(k(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case E.layout:this._toggleTab("ArrowLeft"===t?E.export:E.mapOnly);break;case E.mapOnly:this._toggleTab("ArrowLeft"===t?E.layout:E.export);break;case E.export:this._toggleTab("ArrowLeft"===t?E.mapOnly:E.layout)}e.preventDefault(),e.stopPropagation()}}};e([r()],j.prototype,"_showTemplates",void 0),e([r()],j.prototype,"_isValidSpatialReference",void 0),e([r()],j.prototype,"allowedFormats",null),e([r()],j.prototype,"allowedFormatsForSaving",void 0),e([r()],j.prototype,"allowedLayouts",null),e([r()],j.prototype,"browseTemplateButtonOnClick",void 0),e([r()],j.prototype,"error",null),e([r({type:$})],j.prototype,"exportedLinks",void 0),e([r()],j.prototype,"extraParameters",null),e([r()],j.prototype,"headerVisible",void 0),e([r()],j.prototype,"headingLevel",void 0),e([r()],j.prototype,"icon",null),e([r()],j.prototype,"includeDefaultTemplates",null),e([r()],j.prototype,"includeOrganizationTemplates",void 0),e([r()],j.prototype,"label",null),e([r(),C("esri/widgets/Print/t9n/Print")],j.prototype,"messages",void 0),e([r(),C("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([r(),C("esri/core/t9n/Units")],j.prototype,"messagesUnits",void 0),e([r({type:d})],j.prototype,"outSpatialReference",null),e([r()],j.prototype,"portal",null),e([r()],j.prototype,"saveExportEnabled",void 0),e([r()],j.prototype,"saveExportHidden",void 0),e([r()],j.prototype,"showPrintAreaEnabled",null),e([r()],j.prototype,"printServiceUrl",null),e([r()],j.prototype,"saveAsButtonCallback",void 0),e([r()],j.prototype,"templateCustomTextElements",null),e([r()],j.prototype,"templateOptions",null),e([r()],j.prototype,"view",null),e([r({type:g})],j.prototype,"viewModel",void 0),j=e([p("esri.widgets.Print")],j);const V=j;export{V as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{watch as t}from"../core/reactiveUtils.js";import{createScreenPoint as r}from"../core/screenUtils.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 i}from"../core/accessorSupport/decorators/subclass.js";import{formatNumber as o}from"../intl/number.js";import{defaultUnitPropertyMetadata as l}from"../properties/defaultUnit.js";import a from"./Widget.js";import{css as n}from"./ScaleBar/css.js";import d from"./ScaleBar/ScaleBarViewModel.js";import{globalCss as c}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as p}from"./support/decorators/messageBundle.js";import{tsx as u}from"./support/jsxFactory.js";function m(e,t){return o(e,{style:"unit",unit:t,unitDisplay:"short"})}let h=class extends a{constructor(e,t){super(e,t),this.messages=null,this.style="line",this.viewModel=new d}initialize(){this.addHandles(t((()=>{const{view:e}=this;return[e?.stationary,e?.center,e?.scale,e?.zoom]}),(([e])=>{e&&this.scheduleRender()})))}get icon(){return"actual-size"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get unit(){return this._defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e="disabled"===this.viewModel.state,t={[c.disabled]:e};let r,s;if(!e){const{unit:e,style:t}=this,i="metric"===e||"dual"===e,o=100,l="dual"===e?"line":t;if("imperial"===e||"dual"===e){const e=this.viewModel.getScaleBarProperties(o,"imperial");e&&(s="ruler"===l?this._renderRuler(e):this._renderLine(e,"bottom"))}if(i){const e=this.viewModel.getScaleBarProperties(o,"metric");e&&(r="ruler"===l?this._renderRuler(e):this._renderLine(e,"top"))}}return u("div",{afterCreate:this._handleRootCreateOrUpdate,afterUpdate:this._handleRootCreateOrUpdate,bind:this,class:this.classes(n.base,c.widget,t)},r,s)}_renderRuler(e){const{length:t,unit:r,value:s}=e,i=Math.round(t),o=m(s,r);return u("div",{class:this.classes(n.barContainer,n.rulerBarContainer),key:n.rulerBarContainer},u("div",{class:n.ruler,styles:{width:`${i}px`}},u("div",{class:n.rulerBlock}),u("div",{class:n.rulerBlock}),u("div",{class:n.rulerBlock}),u("div",{class:n.rulerBlock})),u("div",{class:this.classes(n.labelContainer,n.rulerLabelContainer)},u("div",{class:n.label},"0"),u("div",{class:n.label},o)))}_renderLine(e,t){const{length:r,unit:s,value:i}=e,o=Math.round(r),l=m(i,s),a={[n.topLabelContainer]:"top"===t,[n.bottomLabelContainer]:"bottom"===t},d=u("div",{class:this.classes(n.labelContainer,n.lineLabelContainer,a),key:n.labelContainer},u("div",{class:n.label},l)),c={[n.topLine]:"top"===t,[n.bottomLine]:"bottom"===t},p=u("div",{class:this.classes(n.line,c),key:n.line,styles:{width:`${o}px`}});return u("div",{class:this.classes(n.barContainer,n.lineBarContainer),key:n.lineBarContainer},[p,d])}_handleRootCreateOrUpdate(e){if(!this.viewModel)return;const{scaleComputedFrom:t}=this.viewModel,s=e.getBoundingClientRect(),i=s.left+window.pageXOffset,o=s.top+window.pageYOffset,l=r(i,o);(l.x!==t.x||l.y!==t.y)&&(this.viewModel.scaleComputedFrom=l)}};e([s(l)],h.prototype,"_defaultUnit",void 0),e([s()],h.prototype,"icon",null),e([s()],h.prototype,"label",null),e([s(),p("esri/widgets/ScaleBar/t9n/ScaleBar")],h.prototype,"messages",void 0),e([s({type:["ruler","line"]})],h.prototype,"style",void 0),e([s({type:["metric","imperial","dual"]})],h.prototype,"unit",null),e([s()],h.prototype,"view",null),e([s()],h.prototype,"viewModel",void 0),h=e([i("esri.widgets.ScaleBar")],h);const v=h;export{v as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import r from"../core/Logger.js";import{watch as s}from"../core/reactiveUtils.js";import{createScreenPoint as i}from"../core/screenUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{formatNumber as a}from"../intl/number.js";import{defaultUnitPropertyMetadata as n}from"../properties/defaultUnit.js";import d from"./Widget.js";import{css as c}from"./ScaleBar/css.js";import p from"./ScaleBar/ScaleBarViewModel.js";import{globalCss as u}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as h}from"./support/jsxFactory.js";function v(e,t){return a(e,{style:"unit",unit:t,unitDisplay:"short"})}let f=class extends d{constructor(e,s){super(e,s),this.messages=null,this.style="line",this.viewModel=new p,t(r.getLogger(this),"Scale Bar","arcgis-scale-bar",{version:"4.32"})}initialize(){this.addHandles(s((()=>{const{view:e}=this;return[e?.stationary,e?.center,e?.scale,e?.zoom]}),(([e])=>{e&&this.scheduleRender()})))}get icon(){return"actual-size"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get unit(){return this._defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e="disabled"===this.viewModel.state,t={[u.disabled]:e};let r,s;if(!e){const{unit:e,style:t}=this,i="metric"===e||"dual"===e,o=100,l="dual"===e?"line":t;if("imperial"===e||"dual"===e){const e=this.viewModel.getScaleBarProperties(o,"imperial");e&&(s="ruler"===l?this._renderRuler(e):this._renderLine(e,"bottom"))}if(i){const e=this.viewModel.getScaleBarProperties(o,"metric");e&&(r="ruler"===l?this._renderRuler(e):this._renderLine(e,"top"))}}return h("div",{afterCreate:this._handleRootCreateOrUpdate,afterUpdate:this._handleRootCreateOrUpdate,bind:this,class:this.classes(c.base,u.widget,t)},r,s)}_renderRuler(e){const{length:t,unit:r,value:s}=e,i=Math.round(t),o=v(s,r);return h("div",{class:this.classes(c.barContainer,c.rulerBarContainer),key:c.rulerBarContainer},h("div",{class:c.ruler,styles:{width:`${i}px`}},h("div",{class:c.rulerBlock}),h("div",{class:c.rulerBlock}),h("div",{class:c.rulerBlock}),h("div",{class:c.rulerBlock})),h("div",{class:this.classes(c.labelContainer,c.rulerLabelContainer)},h("div",{class:c.label},"0"),h("div",{class:c.label},o)))}_renderLine(e,t){const{length:r,unit:s,value:i}=e,o=Math.round(r),l=v(i,s),a={[c.topLabelContainer]:"top"===t,[c.bottomLabelContainer]:"bottom"===t},n=h("div",{class:this.classes(c.labelContainer,c.lineLabelContainer,a),key:c.labelContainer},h("div",{class:c.label},l)),d={[c.topLine]:"top"===t,[c.bottomLine]:"bottom"===t},p=h("div",{class:this.classes(c.line,d),key:c.line,styles:{width:`${o}px`}});return h("div",{class:this.classes(c.barContainer,c.lineBarContainer),key:c.lineBarContainer},[p,n])}_handleRootCreateOrUpdate(e){if(!this.viewModel)return;const{scaleComputedFrom:t}=this.viewModel,r=e.getBoundingClientRect(),s=r.left+window.pageXOffset,o=r.top+window.pageYOffset,l=i(s,o);(l.x!==t.x||l.y!==t.y)&&(this.viewModel.scaleComputedFrom=l)}};e([o(n)],f.prototype,"_defaultUnit",void 0),e([o()],f.prototype,"icon",null),e([o()],f.prototype,"label",null),e([o(),m("esri/widgets/ScaleBar/t9n/ScaleBar")],f.prototype,"messages",void 0),e([o({type:["ruler","line"]})],f.prototype,"style",void 0),e([o({type:["metric","imperial","dual"]})],f.prototype,"unit",null),e([o()],f.prototype,"view",null),e([o()],f.prototype,"viewModel",void 0),f=e([l("esri.widgets.ScaleBar")],f);const b=f;export{b as default};
package/widgets/Swipe.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import{globalCss as r}from"./support/globalCss.js";import{legacyIcon as o}from"./support/legacyIcon.js";import"./support/widgetUtils.js";import{messageBundle as s}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";import l from"./Swipe/SwipeViewModel.js";const d="esri-swipe",p={base:d,baseDisabled:`${d}--disabled`,vertical:`${d}--vertical`,horizontal:`${d}--horizontal`,container:`${d}__container`,divider:`${d}__divider`,handle:`${d}__handle`,handleHidden:`${d}__handle--hidden`,handleIcon:`${d}__handle-icon`},c={handle:!0,divider:!0};let h=class extends n{constructor(e,t){super(e,t),this.disabled=!1,this.messages=null,this.viewModel=new l,this._pointerOffset=0,this._container=null,this._onContainerPointerDown=this._onContainerPointerDown.bind(this),this._onContainerPointerMove=this._onContainerPointerMove.bind(this),this._onContainerPointerUp=this._onContainerPointerUp.bind(this)}get direction(){return this.viewModel.direction}set direction(e){this.viewModel.direction=e}get dragLabel(){return this.messages?.dragLabel??""}set dragLabel(e){this._overrideIfSome("dragLabel",e)}get icon(){return"compare"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get leadingLayers(){return this.viewModel.leadingLayers}set leadingLayers(e){this.viewModel.leadingLayers=e}get position(){return this.viewModel.position}set position(e){this.viewModel.position=e}get trailingLayers(){return this.viewModel.trailingLayers}set trailingLayers(e){this.viewModel.trailingLayers=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set visibleElements(e){this._set("visibleElements",{...c,...e})}get visibleElements(){return this._get("visibleElements")||c}render(){const{state:e,direction:t}=this.viewModel,i="disabled"===e||this.disabled,n={[r.disabled]:i,[p.baseDisabled]:i,[p.vertical]:"vertical"===t,[p.horizontal]:"horizontal"===t};return a("div",{class:this.classes(p.base,r.widget,n)},"disabled"===e?null:this._renderContainer())}_renderHandle(){const{direction:e}=this.viewModel,{visibleElements:t}=this,i={[o.dragHorizontal]:"vertical"===e,[o.dragVertical]:"horizontal"===e},n=this.classes(p.handle,!t.handle&&p.handleHidden);return a("div",{class:n,key:"handle",role:"presentation"},a("span",{"aria-hidden":"true",class:this.classes(p.handleIcon,i)}))}_renderDivider(){const{visibleElements:e}=this;return e&&e.divider?a("div",{class:p.divider,key:"divider",role:"presentation"}):null}_renderContent(){return[this._renderDivider(),this._renderHandle()]}_renderContainer(){const{disabled:e,dragLabel:t,viewModel:i}=this,{max:n,min:r,direction:o,position:s}=i,l=`${s}%`,d={top:"vertical"===o?l:void 0,left:"vertical"===o?void 0:l},c=this._renderContent();return a("div",e?{class:p.container,key:"container",role:"presentation",styles:d}:{afterCreate:this._afterContainerCreate,"aria-label":t,"aria-orientation":o,"aria-valuemax":`${n}`,"aria-valuemin":`${r}`,"aria-valuenow":`${s}`,"aria-valuetext":l,bind:this,class:p.container,key:"container",onkeydown:this._onContainerKeyDown,role:"slider",styles:d,tabIndex:0,title:t,"touch-action":"none"},c)}_afterContainerCreate(e){this._container=e,e.addEventListener("pointerdown",this._onContainerPointerDown)}_calculatePointerOffset(e){const{direction:t}=this,i=e.target,n=("vertical"===t?i.clientHeight:i.clientWidth)/2,r=i.getBoundingClientRect(),o=e.clientX-r.left,s=e.clientY-r.top;this._pointerOffset="vertical"===t?s-n:o-n}_onContainerPointerDown(e){e.preventDefault(),this._container&&document.activeElement!==this.container&&this._container.focus(),this._calculatePointerOffset(e),document.addEventListener("pointerup",this._onContainerPointerUp),document.addEventListener("pointermove",this._onContainerPointerMove)}_onContainerPointerUp(e){e.preventDefault(),document.removeEventListener("pointerup",this._onContainerPointerUp),document.removeEventListener("pointermove",this._onContainerPointerMove)}_onContainerPointerMove(e){e.preventDefault();const{_pointerOffset:t,container:i,direction:n}=this,{clientX:r,clientY:o}=e,{top:s,left:a,width:l,height:d}=i.getBoundingClientRect(),p=("vertical"===n?o-s-t:r-a-t)/("vertical"===n?d:l)*100;this.position=p}_getKeyPosition(e){const{key:t}=e,{position:i}=this,{max:n,min:r,step:o,stepMultiplier:s,direction:a}=this.viewModel,l=o*s;["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(t)&&(e.preventDefault(),e.stopPropagation());if("vertical"===a?"ArrowDown"===t||"ArrowRight"===t:"ArrowUp"===t||"ArrowRight"===t){return i+(e.shiftKey?l:o)}if("vertical"===a?"ArrowUp"===t||"ArrowLeft"===t:"ArrowDown"===t||"ArrowLeft"===t){return i-(e.shiftKey?l:o)}if("Home"===t)return r;if("End"===t)return n;if("vertical"===a?"PageDown"===t:"PageUp"===t)return i+l;return("vertical"===a?"PageUp"===t:"PageDown"===t)?i-l:null}_onContainerKeyDown(e){const t=this._getKeyPosition(e);"number"==typeof t&&(this.position=t)}};e([t()],h.prototype,"direction",null),e([t()],h.prototype,"disabled",void 0),e([t()],h.prototype,"dragLabel",null),e([t()],h.prototype,"icon",null),e([t()],h.prototype,"label",null),e([t()],h.prototype,"leadingLayers",null),e([t(),s("esri/widgets/Swipe/t9n/Swipe")],h.prototype,"messages",void 0),e([t()],h.prototype,"position",null),e([t()],h.prototype,"trailingLayers",null),e([t()],h.prototype,"view",null),e([t({type:l})],h.prototype,"viewModel",void 0),e([t()],h.prototype,"visibleElements",null),h=e([i("esri.widgets.Swipe")],h);const v=h;export{v as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as t}from"../core/deprecate.js";import i from"../core/Logger.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import o from"./Widget.js";import{globalCss as s}from"./support/globalCss.js";import{legacyIcon as a}from"./support/legacyIcon.js";import"./support/widgetUtils.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{tsx as d}from"./support/jsxFactory.js";import p from"./Swipe/SwipeViewModel.js";const c="esri-swipe",h={base:c,baseDisabled:`${c}--disabled`,vertical:`${c}--vertical`,horizontal:`${c}--horizontal`,container:`${c}__container`,divider:`${c}__divider`,handle:`${c}__handle`,handleHidden:`${c}__handle--hidden`,handleIcon:`${c}__handle-icon`},v={handle:!0,divider:!0};let u=class extends o{constructor(e,r){super(e,r),this.disabled=!1,this.messages=null,this.viewModel=new p,this._pointerOffset=0,this._container=null,t(i.getLogger(this),"Swipe","arcgis-swipe",{version:"4.32"}),this._onContainerPointerDown=this._onContainerPointerDown.bind(this),this._onContainerPointerMove=this._onContainerPointerMove.bind(this),this._onContainerPointerUp=this._onContainerPointerUp.bind(this)}get direction(){return this.viewModel.direction}set direction(e){this.viewModel.direction=e}get dragLabel(){return this.messages?.dragLabel??""}set dragLabel(e){this._overrideIfSome("dragLabel",e)}get icon(){return"compare"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get leadingLayers(){return this.viewModel.leadingLayers}set leadingLayers(e){this.viewModel.leadingLayers=e}get position(){return this.viewModel.position}set position(e){this.viewModel.position=e}get trailingLayers(){return this.viewModel.trailingLayers}set trailingLayers(e){this.viewModel.trailingLayers=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set visibleElements(e){this._set("visibleElements",{...v,...e})}get visibleElements(){return this._get("visibleElements")||v}render(){const{state:e,direction:t}=this.viewModel,i="disabled"===e||this.disabled,r={[s.disabled]:i,[h.baseDisabled]:i,[h.vertical]:"vertical"===t,[h.horizontal]:"horizontal"===t};return d("div",{class:this.classes(h.base,s.widget,r)},"disabled"===e?null:this._renderContainer())}_renderHandle(){const{direction:e}=this.viewModel,{visibleElements:t}=this,i={[a.dragHorizontal]:"vertical"===e,[a.dragVertical]:"horizontal"===e},r=this.classes(h.handle,!t.handle&&h.handleHidden);return d("div",{class:r,key:"handle",role:"presentation"},d("span",{"aria-hidden":"true",class:this.classes(h.handleIcon,i)}))}_renderDivider(){const{visibleElements:e}=this;return e&&e.divider?d("div",{class:h.divider,key:"divider",role:"presentation"}):null}_renderContent(){return[this._renderDivider(),this._renderHandle()]}_renderContainer(){const{disabled:e,dragLabel:t,viewModel:i}=this,{max:r,min:n,direction:o,position:s}=i,a=`${s}%`,l={top:"vertical"===o?a:void 0,left:"vertical"===o?void 0:a},p=this._renderContent();return d("div",e?{class:h.container,key:"container",role:"presentation",styles:l}:{afterCreate:this._afterContainerCreate,"aria-label":t,"aria-orientation":o,"aria-valuemax":`${r}`,"aria-valuemin":`${n}`,"aria-valuenow":`${s}`,"aria-valuetext":a,bind:this,class:h.container,key:"container",onkeydown:this._onContainerKeyDown,role:"slider",styles:l,tabIndex:0,title:t,"touch-action":"none"},p)}_afterContainerCreate(e){this._container=e,e.addEventListener("pointerdown",this._onContainerPointerDown)}_calculatePointerOffset(e){const{direction:t}=this,i=e.target,r=("vertical"===t?i.clientHeight:i.clientWidth)/2,n=i.getBoundingClientRect(),o=e.clientX-n.left,s=e.clientY-n.top;this._pointerOffset="vertical"===t?s-r:o-r}_onContainerPointerDown(e){e.preventDefault(),this._container&&document.activeElement!==this.container&&this._container.focus(),this._calculatePointerOffset(e),document.addEventListener("pointerup",this._onContainerPointerUp),document.addEventListener("pointermove",this._onContainerPointerMove)}_onContainerPointerUp(e){e.preventDefault(),document.removeEventListener("pointerup",this._onContainerPointerUp),document.removeEventListener("pointermove",this._onContainerPointerMove)}_onContainerPointerMove(e){e.preventDefault();const{_pointerOffset:t,container:i,direction:r}=this,{clientX:n,clientY:o}=e,{top:s,left:a,width:l,height:d}=i.getBoundingClientRect(),p=("vertical"===r?o-s-t:n-a-t)/("vertical"===r?d:l)*100;this.position=p}_getKeyPosition(e){const{key:t}=e,{position:i}=this,{max:r,min:n,step:o,stepMultiplier:s,direction:a}=this.viewModel,l=o*s;["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(t)&&(e.preventDefault(),e.stopPropagation());if("vertical"===a?"ArrowDown"===t||"ArrowRight"===t:"ArrowUp"===t||"ArrowRight"===t){return i+(e.shiftKey?l:o)}if("vertical"===a?"ArrowUp"===t||"ArrowLeft"===t:"ArrowDown"===t||"ArrowLeft"===t){return i-(e.shiftKey?l:o)}if("Home"===t)return n;if("End"===t)return r;if("vertical"===a?"PageDown"===t:"PageUp"===t)return i+l;return("vertical"===a?"PageUp"===t:"PageDown"===t)?i-l:null}_onContainerKeyDown(e){const t=this._getKeyPosition(e);"number"==typeof t&&(this.position=t)}};e([r()],u.prototype,"direction",null),e([r()],u.prototype,"disabled",void 0),e([r()],u.prototype,"dragLabel",null),e([r()],u.prototype,"icon",null),e([r()],u.prototype,"label",null),e([r()],u.prototype,"leadingLayers",null),e([r(),l("esri/widgets/Swipe/t9n/Swipe")],u.prototype,"messages",void 0),e([r()],u.prototype,"position",null),e([r()],u.prototype,"trailingLayers",null),e([r()],u.prototype,"view",null),e([r({type:p})],u.prototype,"viewModel",void 0),e([r()],u.prototype,"visibleElements",null),u=e([n("esri.widgets.Swipe")],u);const g=u;export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import o from"../../core/Collection.js";import s from"../../core/Identifiable.js";import{watch as i,initial as r}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{cast as l}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{get as p}from"../../core/accessorSupport/get.js";import c from"../../support/actions/ActionBase.js";import u from"../../support/actions/ActionButton.js";import h from"../../support/actions/ActionToggle.js";import d from"./ListItemPanel.js";var m;const y=o.ofType({key:"type",defaultKeyValue:"button",base:c,typeMap:{button:u,toggle:h}}),b=o.ofType(y);let f=m=class extends(s.IdentifiableMixin(e)){constructor(t){super(t),this.actionsSections=new b,this.actionsOpen=!1,this.checkPublishStatusEnabled=!1,this.hidden=!1,this.layer=null,this.listItemCreatedFunction=null,this.panel=null,this.sortable=!0}initialize(){if(this.addHandles([i((()=>this.panel),(t=>this._setListItemOnPanel(t)),r)]),"function"==typeof this.listItemCreatedFunction){const t={item:this};this.listItemCreatedFunction.call(null,t)}}destroy(){this.panel?.destroy()}get error(){return this.layer?.loadError}castPanel(t){return this.panel?.open&&!t.hasOwnProperty("open")&&(t.open=!0),t?new d(t):null}get publishing(){const{layer:t,checkPublishStatusEnabled:e}=this;return(e&&t&&"publishingInfo"in t&&"publishing"===t.publishingInfo?.status)??!1}get title(){const t=p(this,"layer.layer");return(!t||t&&p(this,"layer.layer.loaded")?this.layer?.title:null)??""}set title(t){this._overrideIfSome("title",t)}clone(){return new m({actionsSections:this.actionsSections.clone(),actionsOpen:this.actionsOpen,checkPublishStatusEnabled:this.checkPublishStatusEnabled,hidden:this.hidden,layer:this.layer,listItemCreatedFunction:this.listItemCreatedFunction,panel:this.panel,sortable:this.sortable,title:this.title})}_setListItemOnPanel(t){t&&(t.listItem=this)}};t([n({type:b})],f.prototype,"actionsSections",void 0),t([n()],f.prototype,"actionsOpen",void 0),t([n()],f.prototype,"checkPublishStatusEnabled",void 0),t([n({readOnly:!0})],f.prototype,"error",null),t([n()],f.prototype,"hidden",void 0),t([n()],f.prototype,"layer",void 0),t([n()],f.prototype,"listItemCreatedFunction",void 0),t([n({type:d})],f.prototype,"panel",void 0),t([l("panel")],f.prototype,"castPanel",null),t([n({readOnly:!0})],f.prototype,"publishing",null),t([n()],f.prototype,"sortable",void 0),t([n()],f.prototype,"title",null),f=m=t([a("esri.widgets.TableList.ListItem")],f);const I=f;export{I as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{isSome as i}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import r from"../../core/Identifiable.js";import{watch as o,initial as l}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import{cast as a}from"../../core/accessorSupport/decorators/cast.js";import"../../core/has.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{get as d}from"../../core/accessorSupport/get.js";import c from"../../support/actions/ActionBase.js";import p from"../../support/actions/ActionButton.js";import u from"../../support/actions/ActionToggle.js";import{canDisplayLayer as y,findLayerListMode as m,getNormalizedChildLayerProperty as b}from"../LayerList/support/layerListUtils.js";import f from"./ListItemPanel.js";var C;const _="layer",v="child-list-mode",g="hide",I=s.ofType({key:"type",defaultKeyValue:"button",base:c,typeMap:{button:p,toggle:u}}),P=s.ofType(I);let S=C=class extends(r.IdentifiableMixin(e)){constructor(t){super(t),this.actionsSections=new P,this.actionsOpen=!1,this.checkPublishStatusEnabled=!1,this.children=new(s.ofType(C)),this.hidden=!1,this.layer=null,this.listItemCreatedFunction=null,this.listModeDisabled=!1,this.open=!1,this.panel=null,this.parent=null,this.sortable=!0}initialize(){if(this.addHandles([o((()=>[this.layer?.listMode,this.listModeDisabled]),(()=>this._watchLayerProperties(this.layer)),l),o((()=>this.checkPublishStatusEnabled),(t=>this._updateChildrenPublishing(t)),l),o((()=>this.panel),(t=>this._setListItemOnPanel(t)),l)]),"function"==typeof this.listItemCreatedFunction){const t={item:this};this.listItemCreatedFunction.call(null,t)}}destroy(){this.panel?.destroy(),this.children.destroyAll()}get error(){return this.layer?.loadError}castPanel(t){return this.panel?.open&&!t.hasOwnProperty("open")&&(t.open=!0),t?new f(t):null}get publishing(){const{layer:t,checkPublishStatusEnabled:e}=this;return(e&&t&&"publishingInfo"in t&&"publishing"===t.publishingInfo?.status)??!1}get title(){const t=d(this,"layer.layer");return(!t||t&&d(this,"layer.layer.loaded")?this.layer?.title:null)??""}set title(t){this._overrideIfSome("title",t)}clone(){return new C({actionsSections:this.actionsSections.clone(),actionsOpen:this.actionsOpen,checkPublishStatusEnabled:this.checkPublishStatusEnabled,children:this.children.clone(),hidden:this.hidden,layer:this.layer,listItemCreatedFunction:this.listItemCreatedFunction,listModeDisabled:this.listModeDisabled,open:this.open,panel:this.panel,parent:this.parent,sortable:this.sortable,title:this.title})}_updateChildrenPublishing(t){this.children?.forEach((e=>e.checkPublishStatusEnabled=t))}_setListItemOnPanel(t){t&&(t.listItem=this)}_createChildItems(t,e){return t.reverse().map((t=>e||y(t)?new C({layer:t,checkPublishStatusEnabled:this.checkPublishStatusEnabled,listItemCreatedFunction:this.listItemCreatedFunction,listModeDisabled:this.listModeDisabled,parent:this}):null)).filter(i)}_createChildren(t){const{listModeDisabled:e,children:i}=this,s=t.reverse().filter((t=>!i.some((e=>e.layer===t))));i.addMany(this._createChildItems(s,e))}_destroyChildren(t){const{children:e}=this,i=e.filter((e=>!!e.layer&&!t.includes(e.layer)));e.destroyMany(i)}_sortChildren(t){this.children.sort(((e,i)=>t.indexOf(i.layer)-t.indexOf(e.layer)))}_destroyAllChildren(){this.removeHandles(v),this.children.destroyAll()}_compileChildren(t){const e=this.listModeDisabled?t:t?.filter((t=>m(t)!==g));t?.length?(this._createChildren(e),this._destroyChildren(e),this._sortChildren(e),this._watchChildLayerListMode(t)):this._destroyAllChildren()}_watchChildLayerListMode(t){this.removeHandles(v),this.listModeDisabled||this.addHandles(t.toArray().map((e=>o((()=>e.listMode),(()=>this._compileChildren(t))))),v)}_watchSublayerChanges(t){t&&this.addHandles(t.on("change",(()=>this._compileChildren(t))),_)}_initializeChildLayers(t){this._compileChildren(t),this._watchSublayerChanges(t)}_watchLayerProperties(t){if(this.removeHandles(_),this.removeHandles(v),!t)return;t.load();if("hide-children"===(!this.listModeDisabled&&m(t)))return void this.children.destroyAll();const e=b(t);e&&this.addHandles(o((()=>t[e]),(i=>{t.hasOwnProperty(e)&&this._initializeChildLayers(i)}),l),_)}};t([n({type:P})],S.prototype,"actionsSections",void 0),t([n()],S.prototype,"actionsOpen",void 0),t([n()],S.prototype,"checkPublishStatusEnabled",void 0),t([n({type:s.ofType(S)})],S.prototype,"children",void 0),t([n({readOnly:!0})],S.prototype,"error",null),t([n()],S.prototype,"hidden",void 0),t([n()],S.prototype,"layer",void 0),t([n()],S.prototype,"listItemCreatedFunction",void 0),t([n({nonNullable:!0})],S.prototype,"listModeDisabled",void 0),t([n()],S.prototype,"open",void 0),t([n({type:f})],S.prototype,"panel",void 0),t([a("panel")],S.prototype,"castPanel",null),t([n()],S.prototype,"parent",void 0),t([n({readOnly:!0})],S.prototype,"publishing",null),t([n()],S.prototype,"sortable",void 0),t([n()],S.prototype,"title",null),S=C=t([h("esri.widgets.TableList.ListItem")],S);const M=S;export{M as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/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{on as o,watch as s,initial as l}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 n}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import d from"./LayerList/LayerListItem.js";import{minDragEnabledItems as c,minFilterItems as m,getLayerType as p,removeDestroyedListItems as h,setFilterPredicate as u}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{calciteListFilterProps as I}from"./support/listUtils.js";import{setFocus as b}from"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{vmEvent as v}from"./support/decorators/vmEvent.js";import{tsx as y}from"./support/jsxFactory.js";import{css as w}from"./TableList/css.js";import L from"./TableList/ListItem.js";import E from"./TableList/TableListViewModel.js";import C from"./TableList/TableListVisibleElements.js";import{getItem as F,sortTablesToIds as M}from"./TableList/support/tableListUtils.js";const P="flat",j=t.ofType(L);let D=class extends(i.IdentifiableMixin(a)){constructor(e,t){super(e,t),this._rootListEl=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`table-${this.uid}`,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=c,this.minFilterItems=m,this.selectedItems=new j,this.selectionMode="none",this.viewModel=new E,this.visibleElements=new C,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=F(e);if(!l?.sortable)return!1;const r=F(t),n=p(t),a=F(i),d=p(i),c=!!n&&!!d&&n===d,m={selected:l,from:r,to:a},h=t.group,u=i.group;return h&&u&&"function"==typeof s?s.call(null,m):c},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)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value;const r=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));M(this.map?.tables,r)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0}}initialize(){this.addHandles([o((()=>this.viewModel.tableItems),"change",(()=>h(this.selectedItems)),l),s((()=>[this.filterPredicate,this._rootListEl]),(()=>u(this._rootListEl,this.filterPredicate)))])}loadDependencies(){return g({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")})}get _dragEnabled(){return this.viewModel.totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.tableItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleItems.filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get icon(){return"table"}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 map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get tableItems(){return this.viewModel.tableItems}get tables(){return this.viewModel.tables}set tables(e){this.viewModel.tables=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,{_visibleItems:t}=this,i={[f.hidden]:"loading"===e,[f.disabled]:"disabled"===e};return y("div",{class:this.classes(w.base,f.widget,f.panel,i)},t?.length?this._renderItems():this._renderNoItems())}_renderNoItemsMessage(){return y("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return y("div",{class:w.itemMessage,key:"esri-layer-list__no-items"},y("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e}=this;return e.toArray().map((({title:t,panel:i},o)=>{const s=()=>this._handlePanelFlowItemBack(i);return y("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:t,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),s()}},i.render(),y("calcite-button",{appearance:"transparent",onclick:s,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,b(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,b(e))}_renderItems(){const{visible:e,collapsed:t,visibleElements:{closeButton:i,collapseButton:o,heading:s,flow:l},_dragEnabled:r,_visibleItems:n,_filterEnabled:a,_rootGroupUid:d,_openedPanelItems:c,selectionMode:m,messages:p,filterPlaceholder:h,filterText:u}=this,g=[y("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!e,collapsed:t,collapsible:o,heading:s?p.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!c.length,onCalciteFlowItemClose:()=>this.visible=!1},y("calcite-list",{afterCreate:e=>{this._rootListEl=e},afterRemoved:()=>{this._rootListEl=null},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":d,displayMode:P,dragEnabled:r,filterEnabled:a,filterPlaceholder:h,filterProps:I,filterText:a?u:"",group:d,key:"root-list",label:p.widgetLabel,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)},n?.toArray().map((e=>this._renderItem(e))),n?.length&&a?y("div",{class:w.filterNoResults,slot:"filter-no-results"},y("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems()];return e?l?y("calcite-flow",{key:"root-flow"},g):g:null}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_renderItem(e){return y(d,{canMove:this._canMove,css:w,displayMode:P,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer.uid}`,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>F(e))).filter(Boolean);i.removeAll(),i.addMany(o)}};e([r()],D.prototype,"_rootListEl",void 0),e([r()],D.prototype,"_focusRootFlowItem",void 0),e([r()],D.prototype,"_focusPanelFlowItem",void 0),e([r()],D.prototype,"_dragEnabled",null),e([r()],D.prototype,"_filterEnabled",null),e([r()],D.prototype,"_visibleItems",null),e([r()],D.prototype,"_openedPanelItems",null),e([r()],D.prototype,"collapsed",void 0),e([r()],D.prototype,"dragEnabled",void 0),e([r()],D.prototype,"filterPlaceholder",void 0),e([r()],D.prototype,"filterPredicate",void 0),e([r()],D.prototype,"filterText",void 0),e([r()],D.prototype,"headingLevel",void 0),e([r()],D.prototype,"icon",null),e([r()],D.prototype,"label",null),e([r()],D.prototype,"listItemCanGiveFunction",void 0),e([r()],D.prototype,"listItemCanReceiveFunction",void 0),e([r()],D.prototype,"listItemCreatedFunction",null),e([r()],D.prototype,"map",null),e([r(),_("esri/widgets/TableList/t9n/TableList")],D.prototype,"messages",void 0),e([r(),_("esri/t9n/common")],D.prototype,"messagesCommon",void 0),e([r()],D.prototype,"minDragEnabledItems",void 0),e([r()],D.prototype,"minFilterItems",void 0),e([r({type:j})],D.prototype,"selectedItems",void 0),e([r()],D.prototype,"selectionMode",void 0),e([r({readOnly:!0})],D.prototype,"tableItems",null),e([r()],D.prototype,"tables",null),e([v("trigger-action"),r({type:E})],D.prototype,"viewModel",void 0),e([r({type:C,nonNullable:!0})],D.prototype,"visibleElements",void 0),D=e([n("esri.widgets.TableList")],D);const T=D;export{T as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Collection.js";import i from"../core/Identifiable.js";import{on as o,watch as s,initial as l}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 n}from"../core/accessorSupport/decorators/subclass.js";import a from"./Widget.js";import d from"./LayerList/LayerListItem.js";import{minDragEnabledItems as c,minFilterItems as m,getLayerType as p,removeDestroyedListItems as h,setFilterPredicate as u}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as g}from"./support/componentsUtils.js";import{globalCss as f}from"./support/globalCss.js";import{calciteListFilterProps as I}from"./support/listUtils.js";import{setFocus as b}from"./support/widgetUtils.js";import{messageBundle as _}from"./support/decorators/messageBundle.js";import{vmEvent as v}from"./support/decorators/vmEvent.js";import{tsx as y}from"./support/jsxFactory.js";import{css as w}from"./TableList/css.js";import L from"./TableList/ListItem.js";import E from"./TableList/TableListViewModel.js";import C from"./TableList/TableListVisibleElements.js";import{getItem as F,sortTablesToIds as M}from"./TableList/support/tableListUtils.js";const P="nested",j=t.ofType(L);let D=class extends(i.IdentifiableMixin(a)){constructor(e,t){super(e,t),this._rootListEl=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`table-${this.uid}`,this.collapsed=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.messages=null,this.messagesCommon=null,this.minDragEnabledItems=c,this.minFilterItems=m,this.selectedItems=new j,this.selectionMode="none",this.viewModel=new E,this.visibleElements=new C,this._canMove=({dragEl:e,fromEl:t,toEl:i},o)=>{const s="pull"===o?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=F(e);if(!l?.sortable)return!1;const r=F(t),n=p(t),a=F(i),d=p(i),c=!!n&&!!d&&n===d,m={selected:l,from:r,to:a},h=t.group,u=i.group;return h&&u&&"function"==typeof s?s.call(null,m):c},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)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=s.value;const r=Array.from(o.children).filter((e=>e?.matches("calcite-list-item"))).map((e=>e.value));M(this.map?.tables,r)},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0}}initialize(){this.addHandles([o((()=>this.viewModel.tableItems),"change",(()=>h(this.selectedItems)),l),s((()=>[this.filterPredicate,this._rootListEl]),(()=>u(this._rootListEl,this.filterPredicate)))])}loadDependencies(){return g({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")})}get _dragEnabled(){return this.viewModel.totalItems>=this.minDragEnabledItems&&this.dragEnabled}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.tableItems?.filter((e=>!e.hidden&&(this.visibleElements.errors||!e.error)))}get _openedPanelItems(){return this._visibleItems.filter((({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled))}get icon(){return"table"}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 map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get tableItems(){return this.viewModel.tableItems}get tables(){return this.viewModel.tables}set tables(e){this.viewModel.tables=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,{_visibleItems:t}=this,i={[f.hidden]:"loading"===e,[f.disabled]:"disabled"===e};return y("div",{class:this.classes(w.base,f.widget,f.panel,i)},t?.length?this._renderItems():this._renderNoItems())}_renderNoItemsMessage(){return y("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return y("div",{class:w.itemMessage,key:"esri-layer-list__no-items"},y("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e}=this;return e.toArray().map((({title:t,panel:i},o)=>{const s=()=>this._handlePanelFlowItemBack(i);return y("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:t,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:o===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),s()}},i.render(),y("calcite-button",{appearance:"transparent",onclick:s,slot:"footer-actions",width:"full"},this.messagesCommon.back))}))}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,b(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,b(e))}_renderItems(){const{visible:e,collapsed:t,visibleElements:{closeButton:i,collapseButton:o,heading:s,flow:l},_dragEnabled:r,_visibleItems:n,_filterEnabled:a,_rootGroupUid:d,_openedPanelItems:c,selectionMode:m,messages:p,filterPlaceholder:h,filterText:u}=this,g=[y("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:i,closed:!e,collapsed:t,collapsible:o,heading:s?p.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!c.length,onCalciteFlowItemClose:()=>this.visible=!1},y("calcite-list",{afterCreate:e=>{this._rootListEl=e},afterRemoved:()=>{this._rootListEl=null},canPull:e=>this._canMove(e,"pull"),canPut:e=>this._canMove(e,"put"),"data-layer-type":d,displayMode:P,dragEnabled:r,filterEnabled:a,filterPlaceholder:h,filterProps:I,filterText:a?u:"",group:d,key:"root-list",label:p.widgetLabel,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)},n?.toArray().map((e=>this._renderItem(e))),n?.length&&a?y("div",{class:w.filterNoResults,slot:"filter-no-results"},y("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems()];return e?l?y("calcite-flow",{key:"root-flow"},g):g:null}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:i,oldIndex:o}=e;t.insertBefore(i,t.children[o])}_renderItem(e){return y(d,{canMove:this._canMove,css:w,displayMode:P,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer.uid}`,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onPanelOpen:this._onPanelOpen,onSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:i}=this;if("none"===t)return;const o=e.target.selectedItems.map((e=>F(e))).filter(Boolean);i.removeAll(),i.addMany(o)}};e([r()],D.prototype,"_rootListEl",void 0),e([r()],D.prototype,"_focusRootFlowItem",void 0),e([r()],D.prototype,"_focusPanelFlowItem",void 0),e([r()],D.prototype,"_dragEnabled",null),e([r()],D.prototype,"_filterEnabled",null),e([r()],D.prototype,"_visibleItems",null),e([r()],D.prototype,"_openedPanelItems",null),e([r()],D.prototype,"collapsed",void 0),e([r()],D.prototype,"dragEnabled",void 0),e([r()],D.prototype,"filterPlaceholder",void 0),e([r()],D.prototype,"filterPredicate",void 0),e([r()],D.prototype,"filterText",void 0),e([r()],D.prototype,"headingLevel",void 0),e([r()],D.prototype,"icon",null),e([r()],D.prototype,"label",null),e([r()],D.prototype,"listItemCanGiveFunction",void 0),e([r()],D.prototype,"listItemCanReceiveFunction",void 0),e([r()],D.prototype,"listItemCreatedFunction",null),e([r()],D.prototype,"map",null),e([r(),_("esri/widgets/TableList/t9n/TableList")],D.prototype,"messages",void 0),e([r(),_("esri/t9n/common")],D.prototype,"messagesCommon",void 0),e([r()],D.prototype,"minDragEnabledItems",void 0),e([r()],D.prototype,"minFilterItems",void 0),e([r({type:j})],D.prototype,"selectedItems",void 0),e([r()],D.prototype,"selectionMode",void 0),e([r({readOnly:!0})],D.prototype,"tableItems",null),e([r()],D.prototype,"tables",null),e([v("trigger-action"),r({type:E})],D.prototype,"viewModel",void 0),e([r({type:C,nonNullable:!0})],D.prototype,"visibleElements",void 0),D=e([n("esri.widgets.TableList")],D);const T=D;export{T as default};
package/widgets/Track.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{property as o}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 i from"./Widget.js";import{loadCalciteComponents as r}from"./support/componentsUtils.js";import{globalCss as s}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as n}from"./support/decorators/messageBundle.js";import{vmEvent as a}from"./support/decorators/vmEvent.js";import{tsx as l}from"./support/jsxFactory.js";import c from"./Track/TrackViewModel.js";const p={base:"esri-track"};let d=class extends i{constructor(e,o){super(e,o),this.messages=null,this.viewModel=new c,this._toggleTracking=()=>{const e=this.viewModel;e&&"feature-unsupported"!==e.state&&"disabled"!==e.state&&("tracking"!==e.state&&"waiting"!==e.state?this.viewModel.start():this.viewModel.stop())}}loadDependencies(){return r({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"compass-north-circle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get rotationEnabled(){return this.viewModel.rotationEnabled}set rotationEnabled(e){this.viewModel.rotationEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get tracking(){return this.viewModel.tracking}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}start(){this.viewModel.start()}stop(){this.viewModel.stop()}render(){const{viewModel:e,messages:o,icon:t}=this,i=e?.state,r="tracking"===i,n=this._localizeError(this.viewModel?.error),a=(r?o?.stopTracking:o?.startTracking)??"",c="feature-unsupported"===i,d=("tracking"===i?"pause":void 0)??t;return l("div",{class:this.classes(p.base,s.widget)},!c&&l("calcite-button",{class:s.widgetButton,disabled:"disabled"===i,iconStart:d,kind:"neutral",label:a,loading:"waiting"===i,onclick:this._toggleTracking,title:a}),n?l("calcite-tooltip",{open:!0,overlayPositioning:"fixed",referenceElement:this.container},n):null)}_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([o()],d.prototype,"geolocationOptions",null),e([o()],d.prototype,"goToLocationEnabled",null),e([o()],d.prototype,"goToOverride",null),e([o()],d.prototype,"graphic",null),e([o()],d.prototype,"icon",null),e([o()],d.prototype,"label",null),e([o(),n("esri/widgets/Track/t9n/Track")],d.prototype,"messages",void 0),e([o()],d.prototype,"rotationEnabled",null),e([o()],d.prototype,"scale",null),e([o({readOnly:!0})],d.prototype,"tracking",null),e([o()],d.prototype,"view",null),e([o({type:c}),a(["track","track-error"])],d.prototype,"viewModel",void 0),d=e([t("esri.widgets.Track")],d);const g=d;export{g 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 r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import s from"./Widget.js";import{loadCalciteComponents as a}from"./support/componentsUtils.js";import{globalCss as n}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{vmEvent as c}from"./support/decorators/vmEvent.js";import{tsx as p}from"./support/jsxFactory.js";import d from"./Track/TrackViewModel.js";const g={base:"esri-track"};let u=class extends s{constructor(e,r){super(e,r),this.messages=null,this.viewModel=new d,this._toggleTracking=()=>{const e=this.viewModel;e&&"feature-unsupported"!==e.state&&"disabled"!==e.state&&("tracking"!==e.state&&"waiting"!==e.state?this.viewModel.start():this.viewModel.stop())},o(t.getLogger(this),"Track","arcgis-track",{version:"4.32"})}loadDependencies(){return a({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),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"compass-north-circle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get rotationEnabled(){return this.viewModel.rotationEnabled}set rotationEnabled(e){this.viewModel.rotationEnabled=e}get scale(){return this.viewModel.scale}set scale(e){this.viewModel.scale=e}get tracking(){return this.viewModel.tracking}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}start(){this.viewModel.start()}stop(){this.viewModel.stop()}render(){const{viewModel:e,messages:o,icon:t}=this,r=e?.state,i="tracking"===r,s=this._localizeError(this.viewModel?.error),a=(i?o?.stopTracking:o?.startTracking)??"",l="feature-unsupported"===r,c=("tracking"===r?"pause":void 0)??t;return p("div",{class:this.classes(g.base,n.widget)},!l&&p("calcite-button",{class:n.widgetButton,disabled:"disabled"===r,iconStart:c,kind:"neutral",label:a,loading:"waiting"===r,onclick:this._toggleTracking,title:a}),s?p("calcite-tooltip",{open:!0,overlayPositioning:"fixed",referenceElement:this.container},s):null)}_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([r()],u.prototype,"geolocationOptions",null),e([r()],u.prototype,"goToLocationEnabled",null),e([r()],u.prototype,"goToOverride",null),e([r()],u.prototype,"graphic",null),e([r()],u.prototype,"icon",null),e([r()],u.prototype,"label",null),e([r(),l("esri/widgets/Track/t9n/Track")],u.prototype,"messages",void 0),e([r()],u.prototype,"rotationEnabled",null),e([r()],u.prototype,"scale",null),e([r({readOnly:!0})],u.prototype,"tracking",null),e([r()],u.prototype,"view",null),e([r({type:d}),c(["track","track-error"])],u.prototype,"viewModel",void 0),u=e([i("esri.widgets.Track")],u);const m=u;export{m as default};