@arcgis/core 4.33.0-next.20250421 → 4.33.0-next.20250423

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 (175) hide show
  1. package/arcade/geometry/constructors.js +1 -1
  2. package/assets/components/assets/icon/mosaicMethodBlend16.json +1 -0
  3. package/assets/components/assets/icon/mosaicMethodBlend24.json +1 -0
  4. package/assets/components/assets/icon/mosaicMethodBlend32.json +1 -0
  5. package/assets/components/assets/icon/mosaicMethodByAttribute16.json +1 -0
  6. package/assets/components/assets/icon/mosaicMethodByAttribute24.json +1 -0
  7. package/assets/components/assets/icon/mosaicMethodByAttribute32.json +1 -0
  8. package/assets/components/assets/icon/mosaicMethodClosestToCenter16.json +1 -0
  9. package/assets/components/assets/icon/mosaicMethodClosestToCenter24.json +1 -0
  10. package/assets/components/assets/icon/mosaicMethodClosestToCenter32.json +1 -0
  11. package/assets/components/assets/icon/mosaicMethodClosestToNadir16.json +1 -0
  12. package/assets/components/assets/icon/mosaicMethodClosestToNadir24.json +1 -0
  13. package/assets/components/assets/icon/mosaicMethodClosestToNadir32.json +1 -0
  14. package/assets/components/assets/icon/mosaicMethodFirst16.json +1 -0
  15. package/assets/components/assets/icon/mosaicMethodFirst24.json +1 -0
  16. package/assets/components/assets/icon/mosaicMethodFirst32.json +1 -0
  17. package/assets/components/assets/icon/mosaicMethodLast16.json +1 -0
  18. package/assets/components/assets/icon/mosaicMethodLast24.json +1 -0
  19. package/assets/components/assets/icon/mosaicMethodLast32.json +1 -0
  20. package/assets/components/assets/icon/mosaicMethodLockRaster16.json +1 -0
  21. package/assets/components/assets/icon/mosaicMethodLockRaster24.json +1 -0
  22. package/assets/components/assets/icon/mosaicMethodLockRaster32.json +1 -0
  23. package/assets/components/assets/icon/mosaicMethodMaximum16.json +1 -0
  24. package/assets/components/assets/icon/mosaicMethodMaximum24.json +1 -0
  25. package/assets/components/assets/icon/mosaicMethodMaximum32.json +1 -0
  26. package/assets/components/assets/icon/mosaicMethodMean16.json +1 -0
  27. package/assets/components/assets/icon/mosaicMethodMean24.json +1 -0
  28. package/assets/components/assets/icon/mosaicMethodMean32.json +1 -0
  29. package/assets/components/assets/icon/mosaicMethodMinimum16.json +1 -0
  30. package/assets/components/assets/icon/mosaicMethodMinimum24.json +1 -0
  31. package/assets/components/assets/icon/mosaicMethodMinimum32.json +1 -0
  32. package/assets/components/assets/icon/mosaicMethodNone16.json +1 -0
  33. package/assets/components/assets/icon/mosaicMethodNone24.json +1 -0
  34. package/assets/components/assets/icon/mosaicMethodNone32.json +1 -0
  35. package/assets/components/assets/icon/mosaicMethodNorthWest16.json +1 -0
  36. package/assets/components/assets/icon/mosaicMethodNorthWest24.json +1 -0
  37. package/assets/components/assets/icon/mosaicMethodNorthWest32.json +1 -0
  38. package/assets/components/assets/icon/mosaicMethodSeamline16.json +1 -0
  39. package/assets/components/assets/icon/mosaicMethodSeamline24.json +1 -0
  40. package/assets/components/assets/icon/mosaicMethodSeamline32.json +1 -0
  41. package/assets/components/assets/icon/mosaicMethodSum16.json +1 -0
  42. package/assets/components/assets/icon/mosaicMethodSum24.json +1 -0
  43. package/assets/components/assets/icon/mosaicMethodSum32.json +1 -0
  44. package/assets/esri/core/workers/RemoteClient.js +1 -1
  45. package/assets/esri/core/workers/chunks/{b2f9f0767dadf185120c.js → 00612d6e05b1c8647668.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{f54546c155fba2fd3a7e.js → 05d7d8ff3e4cbad32580.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{b1e275607d9754079f60.js → 079434fe765c53d304f2.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{0eed612e82a279ac8d1e.js → 11b55e7e76e50fe11bbe.js} +1 -1
  49. package/assets/esri/core/workers/chunks/235efd948ae470a6f238.js +1 -0
  50. package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js → 30551c1d3e4fa7be86c1.js} +2 -2
  51. package/assets/esri/core/workers/chunks/{0c6f2808c57ff820bfdd.js.LICENSE.txt → 30551c1d3e4fa7be86c1.js.LICENSE.txt} +1 -1
  52. package/assets/esri/core/workers/chunks/3293b4041c222299428f.js +1 -0
  53. package/assets/esri/core/workers/chunks/{78242f2bf742b33d99fa.js → 3795793643f4db64af0e.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js → 3cf001abca8ad933bccf.js} +2 -2
  55. package/assets/esri/core/workers/chunks/{38f9ede26098eb03ca2d.js.LICENSE.txt → 3cf001abca8ad933bccf.js.LICENSE.txt} +1 -1
  56. package/assets/esri/core/workers/chunks/{a91f2d1deb950f46ad09.js → 4f8782b3b6ad414409e8.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js → 543eb46b55cacd6e1dbc.js} +2 -2
  58. package/assets/esri/core/workers/chunks/{dbaa4b8d37aab40d7bd1.js.LICENSE.txt → 543eb46b55cacd6e1dbc.js.LICENSE.txt} +1 -1
  59. package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js → 577f24923fa4d08360e4.js} +2 -2
  60. package/assets/esri/core/workers/chunks/{93f792f5b94f3745b57d.js.LICENSE.txt → 577f24923fa4d08360e4.js.LICENSE.txt} +1 -1
  61. package/assets/esri/core/workers/chunks/{f46c4a69ef2f763e905b.js → 5d63dfa5a60c88e03b28.js} +1 -1
  62. package/assets/esri/core/workers/chunks/7bfa18dd8771d4932533.js +1 -0
  63. package/assets/esri/core/workers/chunks/{96cddbbeef61a4f33f29.js → 7c42281188b874ffcdad.js} +1 -1
  64. package/assets/esri/core/workers/chunks/82555a39a60110ca2713.js +1 -0
  65. package/assets/esri/core/workers/chunks/8dd26b12c625d20196ed.js +319 -0
  66. package/assets/esri/core/workers/chunks/{736a11e64e5f03e3936b.js → 9408a72968cbd985dd24.js} +53 -53
  67. package/assets/esri/core/workers/chunks/{c2f38c66fae2cdb57445.js → 96e5d192c8d23c1e324f.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{796cf1c2ca9955595836.js → 9b2ab27159500315fbc1.js} +1 -1
  69. package/assets/esri/core/workers/chunks/a79511b926a2830bb160.js +1 -0
  70. package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js → ac9c6779771ec855da79.js} +2 -2
  71. package/assets/esri/core/workers/chunks/{814d72abbfdd4552e4ec.js.LICENSE.txt → ac9c6779771ec855da79.js.LICENSE.txt} +1 -1
  72. package/assets/esri/core/workers/chunks/{ef6e805c49e1afdf966b.js → c054198c6438cb57f188.js} +1 -1
  73. package/assets/esri/core/workers/chunks/c5d786166a5609b85276.js.LICENSE.txt +1 -1
  74. package/assets/esri/core/workers/chunks/{601fc99426f0213b0769.js → cbec01223d51cdb9ee79.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{90c893959145827961ac.js → cd9343c78a7c3acdbbcd.js} +1 -1
  76. package/assets/esri/core/workers/chunks/d81bebbb6fe000200d35.js +1 -0
  77. package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js → d8dc922f7466300b668f.js} +2 -2
  78. package/assets/esri/core/workers/chunks/{5db336767959507c07e5.js.LICENSE.txt → d8dc922f7466300b668f.js.LICENSE.txt} +1 -1
  79. package/assets/esri/core/workers/chunks/e524462c63834fae7e01.js +2 -0
  80. package/assets/esri/core/workers/chunks/{02176f84d6d57f1bc1c8.js.LICENSE.txt → e524462c63834fae7e01.js.LICENSE.txt} +1 -1
  81. package/assets/esri/core/workers/chunks/{e7e987558cf017c62458.js → ebfa4a0334401f5e004a.js} +1 -1
  82. package/assets/esri/core/workers/chunks/{60d3b329e69f3cddb7f4.js → fa8a3c75f9b41d31559b.js} +1 -1
  83. package/assets/esri/core/workers/chunks/fd36b7aaf0d8e0c84471.js +1 -0
  84. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  85. package/assets/esri/themes/dark/main.css +1 -1
  86. package/assets/esri/themes/light/main.css +1 -1
  87. package/assets/esri/themes/light/view.css +1 -1
  88. package/chunks/Bufferer-CicaNej1.js +1 -1
  89. package/chunks/Envelope.js +1 -1
  90. package/chunks/GeodeticDistanceCalculator-CcF1gMZX.js +1 -1
  91. package/chunks/Geometry.js +1 -1
  92. package/chunks/OperatorGeodesicBuffer.js +1 -1
  93. package/chunks/OperatorGeodeticArea.js +1 -1
  94. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  95. package/chunks/OperatorGeodeticLength.js +1 -1
  96. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  97. package/chunks/OperatorProximityGeodesic.js +1 -1
  98. package/chunks/OperatorShapePreservingLength.js +1 -1
  99. package/chunks/OperatorShapePreservingProject.js +1 -1
  100. package/chunks/OperatorSimplifyOGC.js +5 -0
  101. package/chunks/Point2D.js +1 -1
  102. package/chunks/ProjectionTransformation.js +1 -1
  103. package/chunks/QuadraticBezier.js +1 -1
  104. package/chunks/languageUtils.js +1 -1
  105. package/chunks/relateOperator.js +1 -1
  106. package/chunks/vxlLayer.js +1 -1
  107. package/geometry/operators/extendOperator.js +1 -1
  108. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  109. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  110. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  111. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  112. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  113. package/geometry/operators/gx/operatorMinimumBoundingCircle.js +1 -1
  114. package/geometry/operators/gx/operatorSimplifyOGC.js +5 -0
  115. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  116. package/geometry/operators/reshapeOperator.js +1 -1
  117. package/geometry/operators/simplifyOGCOperator.d.ts +6 -0
  118. package/geometry/operators/simplifyOGCOperator.js +5 -0
  119. package/geometry/operators/support/jsonConverter.js +1 -1
  120. package/interfaces.d.ts +463 -55
  121. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  122. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  123. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  124. package/layers/support/wmsUtils.js +1 -1
  125. package/package.json +2 -2
  126. package/smartMapping/renderers/size.d.ts +1 -0
  127. package/smartMapping/renderers/size.js +1 -1
  128. package/smartMapping/renderers/support/referenceSizeUtils.js +1 -1
  129. package/smartMapping/renderers/support/regenerateUtils.js +1 -1
  130. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  131. package/smartMapping/renderers/support/spikeUtils.js +1 -1
  132. package/support/revision.js +1 -1
  133. package/versionManagement/utils.js +1 -1
  134. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  135. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  136. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  137. package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
  138. package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
  139. package/views/3d/layers/graphics/pipeline/TileActionSynchronizer.js +5 -0
  140. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  141. package/views/3d/webgl/ManagedFBO.js +1 -1
  142. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  143. package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
  144. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  145. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  146. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  147. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  148. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  149. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  150. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  151. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  152. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  153. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  154. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  155. package/views/interactive/Tooltip.js +1 -1
  156. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  157. package/views/layers/LineOfSightLayerView.d.ts +4 -0
  158. package/views/layers/LineOfSightLayerView.js +5 -0
  159. package/views/webgl/FramebufferObject.js +1 -1
  160. package/views/webgl/formats.js +5 -0
  161. package/views/webgl/textureUtils.js +1 -1
  162. package/widgets/Print/CustomTemplate.js +1 -1
  163. package/widgets/Print/PrintViewModel.js +1 -1
  164. package/widgets/Print/utils.js +1 -1
  165. package/widgets/Print.js +1 -1
  166. package/assets/esri/core/workers/chunks/02176f84d6d57f1bc1c8.js +0 -2
  167. package/assets/esri/core/workers/chunks/0a7cba60a5286ba621d4.js +0 -1
  168. package/assets/esri/core/workers/chunks/2cbab0c078d0b844934c.js +0 -1
  169. package/assets/esri/core/workers/chunks/38557792ff9516fc991b.js +0 -1
  170. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +0 -1
  171. package/assets/esri/core/workers/chunks/873327fc41edd3830afa.js +0 -319
  172. package/assets/esri/core/workers/chunks/d28e2c9bdf514236b011.js +0 -1
  173. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +0 -1
  174. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +0 -1
  175. package/views/3d/webgl/formats.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import{isSome as e}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import i from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import{clone as a}from"../../core/lang.js";import r from"../../core/Loadable.js";import l from"../../core/ReactiveMap.js";import{watch as n,initial as p}from"../../core/reactiveUtils.js";import{createScreenPoint as m}from"../../core/screenUtils.js";import{unitType as u,convertUnit as h,getMetersPerUnitForSR as d,inchesPerMeter as c}from"../../core/unitUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import T from"../../geometry/Extent.js";import v from"../../geometry/SpatialReference.js";import{formatDate as w,convertDateFormatToIntlOptions as _}from"../../intl/date.js";import{getLocaleParts as I}from"../../intl/locale.js";import g from"../../portal/Portal.js";import O from"../../portal/PortalQueryParams.js";import{reArcGISOnlineDomain as b}from"../../portal/support/urlUtils.js";import{execute as x,getTaskInfo as P,PrintServiceTask as S}from"../../rest/print.js";import{formatJsonMap as E}from"../../rest/support/fileFormat.js";import{fromJSON as U}from"../../rest/support/layoutTemplate.js";import L from"../../rest/support/PrintParameters.js";import C from"../../rest/support/PrintTemplate.js";import{getExtent as k}from"../../views/2d/viewpointUtils.js";import{ViewEventPriorities as j}from"../../views/input/InputManager.js";import H from"../../views/overlay/BoxOverlayItem.js";import F from"./CustomTemplate.js";import D from"./TemplateOptions.js";import{fetchLayoutTemplateInfos as A}from"./utils.js";const W=[30,144,255,255],R=[237,211,23,255],M=[216,48,32,255],z=new Set(["GISProfessionalStdUT","GISProfessionalAdvUT"]),V=/(\/GPServer\/).+/i,G=new o({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),B=s.ofType(F);function q(t){t.layoutOptions??={},t.layoutOptions.customTextElements??=[];const e="date";if(!t.layoutOptions.customTextElements.find((t=>e in t))){const{customTextElements:e}=t.layoutOptions;let s=w(Date.now(),_("short-date"));"ar"===I()?.language&&(s="‏"+s),e.push({date:s})}}function N(t,e,s){if(!e)return;!(e.visible===s)&&t.layoutOptions&&(t.layoutOptions.elementOverrides?t.layoutOptions.elementOverrides[e.name]={visible:s}:t.layoutOptions.elementOverrides={[e.name]:{visible:s}})}let J=class extends r{constructor(t){super(t),this._serviceTemplateCustomTextElements=null,this._templateIdToCustomTemplate=new l,this._isFreeHand=!1,this._freeHandWidth=0,this._freehandHeight=0,this._asyncPrintTaskUrl=null,this._layoutInfoTaskUrl=null,this._customLayoutOptions=null,this.allowedFormats="all",this.allowedLayouts="all",this.browseTemplates=new B,this.defaultTemplates=new B,this.error=null,this.extraParameters=null,this.includeDefaultTemplates=!0,this.outSpatialReference=null,this.portal=g.getDefault(),this.portalTemplateIds=[],this.printServiceTemplates=new B,this.defaultTemplate=null,this.showPrintAreaEnabled=!1,this.printServiceUrl=null,this.printTimeout=12e4,this.templatesInfo=null,this.updateDelay=1e3,this.view=null,this.templateCustomTextElements=null,this.templateOptions=new D}initialize(){this.addHandles([n((()=>[this.showPrintAreaEnabled,this.view]),(()=>{this.showPrintAreaEnabled?this._enablePrintPreview():(this.removeHandles("overlay-handler"),this.view?.overlay?.removeItem(this._getOverlayItem()))})),n((()=>[this.templateOptions.layout,this.templateOptions.layoutItem]),(()=>{this.loaded&&this._processTemplateOptions()}))])}destroy(){this.removeHandles("overlay-handler"),this.view&&(this._overlayItem&&(this.view.overlay?.removeItem(this._overlayItem),this._overlayItem.destroy(),this._overlayItem=null),this.view=null)}get effectivePrintServiceUrl(){return this.printServiceUrl??null}get effectiveTemplateCustomTextElements(){if(!this._serviceTemplateCustomTextElements)return{};const t=a(this._serviceTemplateCustomTextElements);return this.templateCustomTextElements&&Object.keys(this.templateCustomTextElements).forEach((e=>{const s=t[e];if(s){const t=this.templateCustomTextElements?.[e];s.forEach((e=>{const[s]=Object.entries(e)[0];t?.forEach((t=>{const[i,o]=Object.entries(t)[0];s===i&&(e[s]=o)}))}))}})),Object.freeze(t)}get state(){return"loading"===this.loadStatus?"initializing":"failed"===this.loadStatus||this.error?"error":"loaded"===this.loadStatus&&this.view?.ready?"ready":"disabled"}async load(t){return this.addResolvingPromise(this._loadResources(t).catch((t=>this.error=t))),this}async print(t){const{view:e,extraParameters:s,updateDelay:o,outSpatialReference:a}=this;if(!e)throw new i("print:view-required","view is not set");q(t);const r=this._getOverlayItem(),l=t.scalePreserved||!this.showPrintAreaEnabled?void 0:k(new T,e.viewpoint,"map-only"===t.layout?[t.exportOptions.width,t.exportOptions.height]:[r.boxWidth,r.boxHeight]),n=new L({view:e,template:t,extent:l,extraParameters:s,updateDelay:o,outSpatialReference:a});try{const e=!!t.layoutItem?.id&&(this.portalTemplateIds.includes(t.layoutItem.id)||this.browseTemplates.some((e=>e.layoutItem?.id===t.layoutItem?.id)));return await x(e&&this._asyncPrintTaskUrl?this._asyncPrintTaskUrl:this.effectivePrintServiceUrl,n,{timeout:this.printTimeout})}catch(p){throw new i("print:export-error","An error occurred while exporting the web map.",{error:p})}}toPrintTemplate({attributionEnabled:t,author:e,copyright:s,customTextElements:o,dpi:a,forceFeatureAttributes:r,format:l,height:n,id:p,includeTables:m,layout:u,layoutItem:h,legendEnabled:d,northArrowEnabled:c,scale:y,scaleBarEnabled:f,scaleEnabled:T,title:v,width:w}){if(!u&&!h)throw new i("print:layout-required","layout is not set");const _=new C({attributionVisible:t,forceFeatureAttributes:r,format:l,includeTables:m,layout:u,layoutItem:h,layoutOptions:{authorText:e||"",copyrightText:s||"",customTextElements:o,titleText:v||""},outScale:y??0,scalePreserved:T});if(w&&(_.exportOptions.width=w),n&&(_.exportOptions.height=n),a&&(_.exportOptions.dpi=a),_.layoutOptions){d||(_.layoutOptions.legendLayers=[]);const t=this.getLayoutTemplateById(p)?.mapSurroundInfoOptions;if(t){const e=t.northArrow;for(const t of e)N(_,t,c);const s=t.scaleBar;for(const t of s)N(_,t,f);const i=t.legend;for(const t of i)N(_,t,d)}}return _}getLayoutTemplateById(t){return t?this._templateIdToCustomTemplate.get(t):null}async addPortalTemplate(t){if(!this.portal||!t?.id)return;try{t.loaded||await t.load()}catch{return void this.applyTemplate(this.defaultTemplate)}const e=new F({type:"browse-template",layoutInfoTaskUrl:this._layoutInfoTaskUrl,label:t.title,layoutItem:t});this._templateIdToCustomTemplate.set(e.id,e),this.browseTemplates.add(e)}removePortalTemplate(t){t.layoutItem&&this.templateOptions.id===t.layoutItem.id&&(this.defaultTemplate?this.applyTemplate(this.defaultTemplate):this.templateOptions.reset()),this.browseTemplates.remove(t),this._templateIdToCustomTemplate.delete(t.id)}async applyTemplate(t){if(!t)return void this.templateOptions.reset();!t.layout||!this.templatesInfo||this.templatesInfo.layout.choiceList.includes(t.layout)||(this.defaultTemplate?t=this.defaultTemplate:this.templateOptions.reset());const e=t.layout||t.layoutItem?.id,s=e?this.templateCustomTextElements?.[e]:void 0;if(await this.templateOptions.applyTemplate(t,{customTextElements:s,customLayoutOptions:this._customLayoutOptions}),e&&this._serviceTemplateCustomTextElements&&!this._serviceTemplateCustomTextElements[e]&&t.layoutTemplateInfo?.layoutOptions?.customTextElements){const s=a(this._serviceTemplateCustomTextElements);s[e]=t.layoutTemplateInfo.layoutOptions.customTextElements,this._serviceTemplateCustomTextElements=Object.freeze(s)}}async _loadResources(t){if(this.destroyed)return;await this._loadUrls(t);const[e,s]=await Promise.all([this._getLayoutToLayoutTemplateInfos(t),this._getPrintServiceTemplatesInfo(t)]);await this._loadAllTemplates(e,s,t),this._processPrintServiceTemplatesInfo(s),await this._processTemplateOptions(),this._updateOverLayItem()}async _processTemplateOptions(){const{layout:t,layoutItem:e}=this.templateOptions;if("map-only"!==t&&!this.templateOptions.id)if(this._customLayoutOptions={legend:this.templateOptions.legendEnabled,northArrow:this.templateOptions.northArrowEnabled,scaleBar:this.templateOptions.scaleBarEnabled},e?.id){try{e.loaded||await e.load()}catch{return void this.applyTemplate(this.defaultTemplate)}let t=this._templateIdToCustomTemplate.get(e.id);t||(t=new F({label:e.title,layoutItem:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl}),this._templateIdToCustomTemplate.set(t.id,t)),await this.applyTemplate(t)}else if(t){const t=this.defaultTemplates.find((t=>t.layout===this.templateOptions.layout))??this.printServiceTemplates.find((t=>t.layout===this.templateOptions.layout));await this.applyTemplate(t??this.defaultTemplate)}}async _loadPortal(t){try{await this.portal.load(t)}catch(e){throw new i("print:could-not-load-portal","Cannot load print resource information from portal",{error:e,url:this.effectivePrintServiceUrl})}}async _loadUrls(t){if(this.printServiceUrl)this._set("effectivePrintServiceUrl",this.printServiceUrl),await this._updateLayoutInfoTaskUrl(this.effectivePrintServiceUrl,t);else{await this._loadPortal(t);const{printTask:e,asyncPrintTask:s,layoutInfoTask:i}=this.portal?.helperServices??{};this._set("effectivePrintServiceUrl",e?.url),this._asyncPrintTaskUrl=s?.url,await this._updateLayoutInfoTaskUrl(i?.url||this.effectivePrintServiceUrl,t)}const e=this.effectivePrintServiceUrl?.toLowerCase().split("/");if(!e?.includes("gpserver"))throw new i("print:invalid-print-service-url","Can't fetch print templates information from provided URL",{url:this.effectivePrintServiceUrl})}async _updateLayoutInfoTaskUrl(t,e){if(!t)return;const s=await P(t,S.GetLayoutTemplatesInfo,e);s&&(this._layoutInfoTaskUrl=t.replace(V,`$1${encodeURI(s.displayName)}`))}_getPortalDefaultTemplates(t,e){return this.portal?.helperServices?.printTask?.templates?.filter((t=>"map_only"!==t.layout.toLowerCase()&&(!e||e.includes(U(t.layout)))))?.map((e=>{const s=F.fromJSON(e);if(s.type="default-template",s.layoutInfoTaskUrl=this._layoutInfoTaskUrl,s.layout){const e=t.get(s.layout);e&&s.setLayoutTemplateInfo(e)}return s}))??[]}async _getPortalCustomTemplates(t){if(this.printServiceUrl||!this.portal)return[];const{layoutGroupQuery:e,user:s}=this.portal,i=b.test(this.portal.url),o=s?.userLicenseTypeId,a=o&&z.has(o);if(!e||i&&!a)return[];const r=new O({query:e,disableExtraQuery:!0}),l=await this.portal.queryGroups(r,t);if(!l.total)return[];const n=l.results[0],p=new O({num:100,query:"type:Layout",sortField:n.sortField,sortOrder:n.sortOrder??void 0}),m=(await n.queryItems(p,t)).results;if(!m.length)return[];return m.map((t=>(this.portalTemplateIds.push(t.id),new F({type:"default-template",label:t.title,layoutItem:t,layoutInfoTaskUrl:this._layoutInfoTaskUrl}))))}async _loadAllTemplates(t,e,s){let i=!1;const o=e?.layout?.choiceList;if(this.includeDefaultTemplates&&this.portal&&!this.printServiceUrl){const e=this._getPortalDefaultTemplates(t,o);i=!!e.length,this.defaultTemplates.addMany(e);const a=await this._getPortalCustomTemplates(s);this.defaultTemplates.addMany(a);for(const t of this.defaultTemplates)this._templateIdToCustomTemplate.set(t.id,t)}i||t.forEach(((t,e)=>{if(!o||o.includes(e)){const s=new F({type:"print-service-template",layout:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl});s.setLayoutTemplateInfo(t),this.printServiceTemplates.add(s),this._templateIdToCustomTemplate.set(s.id,s)}}))}_processPrintServiceTemplatesInfo(t){this._set("templatesInfo",t);const e=t?.layout?.defaultValue;if(e&&"map-only"!==e){const t=this.defaultTemplates.find((t=>t.layout===e))??this.printServiceTemplates.find((t=>t.layout===e))??this.defaultTemplates.at(0)??this.printServiceTemplates.at(0);this._set("defaultTemplate",t)}}async _getLayoutToLayoutTemplateInfos(t){const e=await A(this._layoutInfoTaskUrl,void 0,t),s=new Map,i={};for(const o of e){const t=U(o.layoutTemplate);s.set(t,o),i[t]=o.layoutOptions.customTextElements}return this._serviceTemplateCustomTextElements=Object.freeze(i),s}async _getPrintServiceTemplatesInfo(t){const e=await P(this.effectivePrintServiceUrl,S.ExportWebMap,t);if(!e)throw new i("print:unavailable-service-info","Can't fetch templates info from service");const{parameters:s}=e,o=s.find((({name:t})=>"Format"===t)),a=s.find((({name:t})=>"Layout_Template"===t));return{format:this._getFormat(o),layout:this._getLayout(a)}}_getFormat(t){const s="all"===this.allowedFormats?t.choiceList:t.choiceList.filter((t=>"string"!=typeof this.allowedFormats&&this.allowedFormats.some((e=>new RegExp(`\\b${e}\\b`,"i").test(t))))),i=(s.length?s:t.choiceList).map((t=>E.fromJSON(t))).filter(e),o=E.fromJSON(t.defaultValue),a=i.some((t=>new RegExp(`\\b${o}\\b`,"i").test(t)))?o:i[0];return{choiceList:i,defaultValue:a}}_getLayout(t){const s=t.choiceList.filter((t=>"map_only"!==t.toLowerCase())),i="all"===this.allowedLayouts?s:s.filter((t=>this.allowedLayouts.includes(U(t)))),o=(i.length?i:s).map(U).filter(e),a=U(t.defaultValue),r=o.includes(a)?a:o.find((t=>/(?=.*letter)(?=.*landscape)/i.test(t)))??o.find((t=>/(?=.*a4)(?=.*landscape)/i.test(t)))??o[0];return{choiceList:o,defaultValue:r}}_getOverlayItem(){return this._overlayItem||(this._overlayItem=new H({strokeDash:[5],strokeWidth:2,strokeColor:[30,144,255,255]})),this._overlayItem}_enablePrintPreview(){if(!this.view?.overlay)return;const t=this.templateOptions,e=this._getOverlayItem();this.addHandles([n((()=>[t.width,t.height,t.scaleEnabled,t.scale,t.layout,t.layoutItem,t.id,t.state,this.view?.scale,this.view?.size,this.view?.state.paddedViewState.size,this.view?.state.padding,this.loaded]),(()=>this._updateOverLayItem()),p),this.view?.on("drag",["Shift"],(t=>this._handleDrag(t)),j.WIDGET),this.view?.on("key-down",["Escape"],(()=>this._resetDrag()),j.WIDGET)],"overlay-handler"),this.view.overlay.addItem(e)}_updateOverLayItem(){if(!this.view)return;const t=this.templateOptions,e=this._getOverlayItem(),s=t.layoutItem?.id??t.layout,i=this.view,o=i.spatialReference,[a,r]=i.state.paddedViewState.size,l=i.state.padding;let n=0,p=0;if("map-only"===s)null!=t.width&&null!=t.height&&(n=t.width,p=t.height);else if(s){const e=t.id?this._templateIdToCustomTemplate.get(t.id):null,{webMapFrameSize:s,pageUnits:i}=e?.layoutTemplateInfo??{};let l=!1;if(s&&i)if(this._isFreeHand){const t=s[0]/s[1];n=this._freeHandWidth,p=this._freehandHeight,n>p?p=n/t:n=p*t}else{const t=G.fromJSON(i.toLowerCase()),e=o.unit;u(t)===u(e)?(n=h(s[0],t,e),p=h(s[1],t,e)):(l=!0,n=s[0],p=s[1])}if(!this._isFreeHand)if(t.scaleEnabled&&t.scale){const e=l?Math.min(a/n,r/p):d(o)*c*t.dpi;n*=e,p*=e}else if(0===n||0===p)n=a,p=r;else{const t=(a-.1*a)/n,e=(r-.1*r)/p,s=Math.min(t,e);n*=s,p*=s}}const{scaleEnabled:m,scale:y}=t,f=m&&y?y/this.view.scale:1;if(e.boxWidth=n*f||a,e.boxHeight=p*f||r,l&&(e.padding=l),e.backgroundWidth=a??0,e.backgroundHeight=r??0,"loading"===this.loadStatus)e.strokeColor=R;else if("loaded"===this.loadStatus)switch(this.templateOptions.state){case"pending":e.strokeColor=R;break;case"ready":e.strokeColor=W;break;case"error":e.strokeColor=M}}_resetDrag(){this._isFreeHand=!1,this._updateOverLayItem()}_handleDrag(t){switch(t.action){case"start":this._start();break;case"update":this._update(t);break;case"end":this._end()}t.stopPropagation()}_start(){this._isFreeHand=!0}_update(t){const e=this._getOverlayItem(),{x:s,y:i}=t,{x:o,y:a}=t.origin;s>o?(e.x=o,e.boxWidth=s-o):(e.x=s,e.boxWidth=o-s),i>a?(e.y=a,e.boxHeight=i-a):(e.y=i,e.boxHeight=a-i)}_end(){const t=this._getOverlayItem();if(!this.view||null==t.x||null==t.y)return;const e=this.view,s=e.toMap(m(t.x+.5*t.boxWidth,t.y+.5*t.boxHeight));t.x=null,t.y=null,e.goTo({center:s}),this._freeHandWidth=t.boxWidth,this._freehandHeight=t.boxHeight,"map-only"===this.templateOptions.layout&&(this.templateOptions.width=this._freeHandWidth,this.templateOptions.height=this._freehandHeight),this.templateOptions.scale=this.view.scale,this._updateOverLayItem()}};t([y()],J.prototype,"_serviceTemplateCustomTextElements",void 0),t([y()],J.prototype,"_templateIdToCustomTemplate",void 0),t([y()],J.prototype,"allowedFormats",void 0),t([y()],J.prototype,"allowedLayouts",void 0),t([y({type:B})],J.prototype,"browseTemplates",void 0),t([y({type:B})],J.prototype,"defaultTemplates",void 0),t([y()],J.prototype,"error",void 0),t([y()],J.prototype,"extraParameters",void 0),t([y()],J.prototype,"includeDefaultTemplates",void 0),t([y({readOnly:!0})],J.prototype,"effectivePrintServiceUrl",null),t([y()],J.prototype,"effectiveTemplateCustomTextElements",null),t([y({type:v})],J.prototype,"outSpatialReference",void 0),t([y({type:g})],J.prototype,"portal",void 0),t([y()],J.prototype,"portalTemplateIds",void 0),t([y({type:B})],J.prototype,"printServiceTemplates",void 0),t([y({readOnly:!0})],J.prototype,"defaultTemplate",void 0),t([y()],J.prototype,"showPrintAreaEnabled",void 0),t([y()],J.prototype,"printServiceUrl",void 0),t([y()],J.prototype,"printTimeout",void 0),t([y({readOnly:!0})],J.prototype,"state",null),t([y({readOnly:!0})],J.prototype,"templatesInfo",void 0),t([y()],J.prototype,"updateDelay",void 0),t([y()],J.prototype,"view",void 0),t([y()],J.prototype,"templateCustomTextElements",void 0),t([y({type:D})],J.prototype,"templateOptions",void 0),J=t([f("esri.widgets.Print.PrintViewModel")],J);const $=J;export{$ as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import{isSome as e}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import i from"../../core/Error.js";import{clone as o}from"../../core/lang.js";import a from"../../core/Loadable.js";import r from"../../core/ReactiveMap.js";import{watch as l,initial as n}from"../../core/reactiveUtils.js";import{createScreenPoint as p}from"../../core/screenUtils.js";import{unitType as m,convertUnit as h,getMetersPerUnitForSR as u,inchesPerMeter as d}from"../../core/unitUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import f from"../../geometry/Extent.js";import T from"../../geometry/SpatialReference.js";import{formatDate as v,convertDateFormatToIntlOptions as w}from"../../intl/date.js";import{getLocaleParts as _}from"../../intl/locale.js";import I from"../../portal/Portal.js";import g from"../../portal/PortalQueryParams.js";import{reArcGISOnlineDomain as O}from"../../portal/support/urlUtils.js";import{execute as x,getTaskInfo as b,PrintServiceTask as E}from"../../rest/print.js";import{formatJsonMap as P}from"../../rest/support/fileFormat.js";import{fromJSON as S}from"../../rest/support/layoutTemplate.js";import L from"../../rest/support/PrintParameters.js";import U from"../../rest/support/PrintTemplate.js";import{getExtent as k}from"../../views/2d/viewpointUtils.js";import{ViewEventPriorities as C}from"../../views/input/InputManager.js";import j from"../../views/overlay/BoxOverlayItem.js";import F from"./CustomTemplate.js";import H from"./FileLink.js";import M from"./TemplateOptions.js";import{fetchLayoutTemplateInfos as D,valueUnitKebabDict as A}from"./utils.js";const W=[30,144,255,255],R=[237,211,23,255],N=[216,48,32,255],z=new Set(["GISProfessionalStdUT","GISProfessionalAdvUT"]),V=/(\/GPServer\/).+/i,G=s.ofType(F),B=s.ofType(H);function q(t){t.layoutOptions??={},t.layoutOptions.customTextElements??=[];const e="date";if(!t.layoutOptions.customTextElements.find((t=>e in t))){const{customTextElements:e}=t.layoutOptions;let s=v(Date.now(),w("short-date"));"ar"===_()?.language&&(s="‏"+s),e.push({date:s})}}function $(t,e,s){if(!e)return;!(e.visible===s)&&t.layoutOptions&&(t.layoutOptions.elementOverrides?t.layoutOptions.elementOverrides[e.name]={visible:s}:t.layoutOptions.elementOverrides={[e.name]:{visible:s}})}let J=class extends a{constructor(t){super(t),this._serviceTemplateCustomTextElements=null,this._templateIdToCustomTemplate=new r,this._isFreeHand=!1,this._freeHandWidth=0,this._freehandHeight=0,this._asyncPrintTaskUrl=null,this._layoutInfoTaskUrl=null,this._customLayoutOptions=null,this._exportedFileNameMap={},this.allowedFormats="all",this.allowedLayouts="all",this.browseTemplates=new G,this.defaultTemplates=new G,this.error=null,this.exportedLinks=new B,this.extraParameters=null,this.includeDefaultTemplates=!0,this.outSpatialReference=null,this.portal=I.getDefault(),this.portalTemplateIds=[],this.printServiceTemplates=new G,this.defaultTemplate=null,this.showPrintAreaEnabled=!1,this.printServiceUrl=null,this.printTimeout=12e4,this.templatesInfo=null,this.updateDelay=1e3,this.view=null,this.templateCustomTextElements=null,this.templateOptions=new M}initialize(){this.addHandles([l((()=>[this.showPrintAreaEnabled,this.view]),(()=>{this.showPrintAreaEnabled?this._enablePrintPreview():(this.removeHandles("overlay-handler"),this.view?.overlay?.removeItem(this._getOverlayItem()))})),l((()=>[this.templateOptions.layout,this.templateOptions.layoutItem]),(()=>{this.loaded&&this._processTemplateOptions()}))])}destroy(){this.removeHandles("overlay-handler"),this.view&&(this._overlayItem&&(this.view.overlay?.removeItem(this._overlayItem),this._overlayItem.destroy(),this._overlayItem=null),this.view=null)}get effectivePrintServiceUrl(){return this.printServiceUrl??null}get effectiveTemplateCustomTextElements(){if(!this._serviceTemplateCustomTextElements)return{};const t=o(this._serviceTemplateCustomTextElements);return this.templateCustomTextElements&&Object.keys(this.templateCustomTextElements).forEach((e=>{const s=t[e];if(s){const t=this.templateCustomTextElements?.[e];s.forEach((e=>{const[s]=Object.entries(e)[0];t?.forEach((t=>{const[i,o]=Object.entries(t)[0];s===i&&(e[s]=o)}))}))}})),Object.freeze(t)}get state(){return"loading"===this.loadStatus?"initializing":"failed"===this.loadStatus||this.error?"error":"loaded"===this.loadStatus&&this.view?.ready?"ready":"disabled"}async load(t){return this.addResolvingPromise(this._loadResources(t).catch((t=>this.error=t))),this}async print(t){const{view:e,extraParameters:s,updateDelay:o,outSpatialReference:a}=this;if(!e)throw new i("print:view-required","view is not set");q(t);const r=this._getOverlayItem(),l=t.scalePreserved||!this.showPrintAreaEnabled?void 0:k(new f,e.viewpoint,"map-only"===t.layout?[t.exportOptions.width,t.exportOptions.height]:[r.boxWidth,r.boxHeight]),n=new L({view:e,template:t,extent:l,extraParameters:s,updateDelay:o,outSpatialReference:a});try{const e=!!t.layoutItem?.id&&(this.portalTemplateIds.includes(t.layoutItem.id)||this.browseTemplates.some((e=>e.layoutItem?.id===t.layoutItem?.id)));return await x(e&&this._asyncPrintTaskUrl?this._asyncPrintTaskUrl:this.effectivePrintServiceUrl,n,{timeout:this.printTimeout})}catch(p){throw new i("print:export-error","An error occurred while exporting the web map.",{error:p})}}toPrintTemplate({attributionEnabled:t,author:e,copyright:s,customTextElements:o,dpi:a,forceFeatureAttributes:r,format:l,height:n,id:p,includeTables:m,layout:h,layoutItem:u,legendEnabled:d,northArrowEnabled:c,scale:y,scaleBarEnabled:f,scaleEnabled:T,title:v,width:w}){if(!h&&!u)throw new i("print:layout-required","layout is not set");const _=new U({attributionVisible:t,forceFeatureAttributes:r,format:l,includeTables:m,layout:h,layoutItem:u,layoutOptions:{authorText:e||"",copyrightText:s||"",customTextElements:o,titleText:v||""},outScale:y??0,scalePreserved:T});if(w&&(_.exportOptions.width=w),n&&(_.exportOptions.height=n),a&&(_.exportOptions.dpi=a),_.layoutOptions){d||(_.layoutOptions.legendLayers=[]);const t=this.getLayoutTemplateById(p)?.mapSurroundInfoOptions;if(t){const e=t.northArrow;for(const t of e)$(_,t,c);const s=t.scaleBar;for(const t of s)$(_,t,f);const i=t.legend;for(const t of i)$(_,t,d)}}return _}getLayoutTemplateById(t){return t?this._templateIdToCustomTemplate.get(t):null}async addPortalTemplate(t){if(!this.portal||!t?.id)return;try{t.loaded||await t.load()}catch{return void this.applyTemplate(this.defaultTemplate)}const e=new F({type:"browse-template",layoutInfoTaskUrl:this._layoutInfoTaskUrl,label:t.title,layoutItem:t});this._templateIdToCustomTemplate.set(e.id,e),this.browseTemplates.add(e)}removePortalTemplate(t){t.layoutItem&&this.templateOptions.id===t.layoutItem.id&&(this.defaultTemplate?this.applyTemplate(this.defaultTemplate):this.templateOptions.reset()),this.browseTemplates.remove(t),this._templateIdToCustomTemplate.delete(t.id)}async applyTemplate(t){if(this.templateOptions.reset(),!t)return;if("map-only"===t)return void(this.templateOptions.layout="map-only");!t.layout||!this.templatesInfo||this.templatesInfo.layout.choiceList.includes(t.layout)||(this.defaultTemplate?t=this.defaultTemplate:this.templateOptions.reset());const e=t.layout||t.layoutItem?.id,s=e?this.templateCustomTextElements?.[e]:void 0;if(await this.templateOptions.applyTemplate(t,{customTextElements:s,customLayoutOptions:this._customLayoutOptions}),e&&this._serviceTemplateCustomTextElements&&!this._serviceTemplateCustomTextElements[e]&&t.layoutTemplateInfo?.layoutOptions?.customTextElements){const s=o(this._serviceTemplateCustomTextElements);s[e]=t.layoutTemplateInfo.layoutOptions.customTextElements,this._serviceTemplateCustomTextElements=Object.freeze(s)}}createExportedFileLink(t){const e=this.toPrintTemplate(this.templateOptions).format.toLowerCase(),s=e.includes("png")?"png":e,i=t+s;return this._updateExportedFileNameMap(i),new H({name:t,extension:s,count:this._exportedFileNameMap[i]})}export(t){const e=this.createExportedFileLink(t);this.exportedLinks.add(e);const s=this.print(this.toPrintTemplate(this.templateOptions)).then((t=>e.set({url:t?.url,state:"ready"}))).catch((t=>e.set({error:t,state:"error"})));return{link:e,promise:s}}async _loadResources(t){if(this.destroyed)return;await this._loadUrls(t);const[e,s]=await Promise.all([this._getLayoutToLayoutTemplateInfos(t),this._getPrintServiceTemplatesInfo(t)]);await this._loadAllTemplates(e,s,t),this._processPrintServiceTemplatesInfo(s),await this._processTemplateOptions(),this._updateOverLayItem();for(const{name:i,extension:o}of this.exportedLinks)i&&o&&this._updateExportedFileNameMap(`${i}${o}`)}_updateExportedFileNameMap(t){void 0!==this._exportedFileNameMap[t]?this._exportedFileNameMap[t]++:this._exportedFileNameMap[t]=0}async _processTemplateOptions(){const{layout:t,layoutItem:e}=this.templateOptions;if("map-only"!==t&&!this.templateOptions.id)if(this._customLayoutOptions={legend:this.templateOptions.legendEnabled,northArrow:this.templateOptions.northArrowEnabled,scaleBar:this.templateOptions.scaleBarEnabled},e?.id){try{e.loaded||await e.load()}catch{return void this.applyTemplate(this.defaultTemplate)}let t=this._templateIdToCustomTemplate.get(e.id);t||(t=new F({label:e.title,layoutItem:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl}),this._templateIdToCustomTemplate.set(t.id,t)),await this.applyTemplate(t)}else if(t){const t=this.defaultTemplates.find((t=>t.layout===this.templateOptions.layout))??this.printServiceTemplates.find((t=>t.layout===this.templateOptions.layout));await this.applyTemplate(t??this.defaultTemplate)}}async _loadPortal(t){try{await this.portal.load(t)}catch(e){throw new i("print:could-not-load-portal","Cannot load print resource information from portal",{error:e,url:this.effectivePrintServiceUrl})}}async _loadUrls(t){if(this.printServiceUrl)this._set("effectivePrintServiceUrl",this.printServiceUrl),await this._updateLayoutInfoTaskUrl(this.effectivePrintServiceUrl,t);else{await this._loadPortal(t);const{printTask:e,asyncPrintTask:s,layoutInfoTask:i}=this.portal?.helperServices??{};this._set("effectivePrintServiceUrl",e?.url),this._asyncPrintTaskUrl=s?.url,await this._updateLayoutInfoTaskUrl(i?.url||this.effectivePrintServiceUrl,t)}const e=this.effectivePrintServiceUrl?.toLowerCase().split("/");if(!e?.includes("gpserver"))throw new i("print:invalid-print-service-url","Can't fetch print templates information from provided URL",{url:this.effectivePrintServiceUrl})}async _updateLayoutInfoTaskUrl(t,e){if(!t)return;const s=await b(t,E.GetLayoutTemplatesInfo,e);s&&(this._layoutInfoTaskUrl=t.replace(V,`$1${encodeURI(s.displayName)}`))}_getPortalDefaultTemplates(t,e){return this.portal?.helperServices?.printTask?.templates?.filter((t=>"map_only"!==t.layout.toLowerCase()&&(!e||e.includes(S(t.layout)))))?.map((e=>{const s=F.fromJSON(e);if(s.type="default-template",s.layoutInfoTaskUrl=this._layoutInfoTaskUrl,s.layout){const e=t.get(s.layout);e&&s.setLayoutTemplateInfo(e)}return s}))??[]}async _getPortalCustomTemplates(t){if(this.printServiceUrl||!this.portal)return[];const{layoutGroupQuery:e,user:s}=this.portal,i=O.test(this.portal.url),o=s?.userLicenseTypeId,a=o&&z.has(o);if(!e||i&&!a)return[];const r=new g({query:e,disableExtraQuery:!0}),l=await this.portal.queryGroups(r,t);if(!l.total)return[];const n=l.results[0],p=new g({num:100,query:"type:Layout",sortField:n.sortField,sortOrder:n.sortOrder??void 0}),m=(await n.queryItems(p,t)).results;if(!m.length)return[];return m.map((t=>(this.portalTemplateIds.push(t.id),new F({type:"default-template",label:t.title,layoutItem:t,layoutInfoTaskUrl:this._layoutInfoTaskUrl}))))}async _loadAllTemplates(t,e,s){let i=!1;const o=e?.layout?.choiceList;if(this.includeDefaultTemplates&&this.portal&&!this.printServiceUrl){const e=this._getPortalDefaultTemplates(t,o);i=!!e.length,this.defaultTemplates.addMany(e);const a=await this._getPortalCustomTemplates(s);this.defaultTemplates.addMany(a);for(const t of this.defaultTemplates)this._templateIdToCustomTemplate.set(t.id,t)}i||t.forEach(((t,e)=>{if(!o||o.includes(e)){const s=new F({type:"print-service-template",layout:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl});s.setLayoutTemplateInfo(t),this.printServiceTemplates.add(s),this._templateIdToCustomTemplate.set(s.id,s)}}))}_processPrintServiceTemplatesInfo(t){this._set("templatesInfo",t);const e=t?.layout?.defaultValue;if(e&&"map-only"!==e){const t=this.defaultTemplates.find((t=>t.layout===e))??this.printServiceTemplates.find((t=>t.layout===e))??this.defaultTemplates.at(0)??this.printServiceTemplates.at(0);this._set("defaultTemplate",t)}}async _getLayoutToLayoutTemplateInfos(t){const e=await D(this._layoutInfoTaskUrl,void 0,t),s=new Map,i={};for(const o of e){const t=S(o.layoutTemplate);s.set(t,o),i[t]=o.layoutOptions.customTextElements}return this._serviceTemplateCustomTextElements=Object.freeze(i),s}async _getPrintServiceTemplatesInfo(t){const e=await b(this.effectivePrintServiceUrl,E.ExportWebMap,t);if(!e)throw new i("print:unavailable-service-info","Can't fetch templates info from service");const{parameters:s}=e,o=s.find((({name:t})=>"Format"===t)),a=s.find((({name:t})=>"Layout_Template"===t));return{format:this._getFormat(o),layout:this._getLayout(a)}}_getFormat(t){const s="all"===this.allowedFormats?t.choiceList:t.choiceList.filter((t=>"string"!=typeof this.allowedFormats&&this.allowedFormats.some((e=>new RegExp(`\\b${e}\\b`,"i").test(t))))),i=(s.length?s:t.choiceList).map((t=>P.fromJSON(t))).filter(e),o=P.fromJSON(t.defaultValue),a=i.some((t=>new RegExp(`\\b${o}\\b`,"i").test(t)))?o:i[0];return{choiceList:i,defaultValue:a}}_getLayout(t){const s=t.choiceList.filter((t=>"map_only"!==t.toLowerCase())),i="all"===this.allowedLayouts?s:s.filter((t=>this.allowedLayouts.includes(S(t)))),o=(i.length?i:s).map(S).filter(e),a=S(t.defaultValue),r=o.includes(a)?a:o.find((t=>/(?=.*letter)(?=.*landscape)/i.test(t)))??o.find((t=>/(?=.*a4)(?=.*landscape)/i.test(t)))??o[0];return{choiceList:o,defaultValue:r}}_getOverlayItem(){return this._overlayItem||(this._overlayItem=new j({strokeDash:[5],strokeWidth:2,strokeColor:[30,144,255,255]})),this._overlayItem}_enablePrintPreview(){if(!this.view?.overlay)return;const t=this.templateOptions,e=this._getOverlayItem();this.addHandles([l((()=>[t.width,t.height,t.scaleEnabled,t.scale,t.layout,t.layoutItem,t.id,t.state,this.view?.scale,this.view?.size,this.view?.state.paddedViewState.size,this.view?.state.padding,this.loaded]),(()=>this._updateOverLayItem()),n),this.view?.on("drag",["Shift"],(t=>this._handleDrag(t)),C.WIDGET),this.view?.on("key-down",["Escape"],(()=>this._resetDrag()),C.WIDGET)],"overlay-handler"),this.view.overlay.addItem(e)}_updateOverLayItem(){if(!this.view)return;const t=this.templateOptions,e=this._getOverlayItem(),s=t.layoutItem?.id??t.layout,i=this.view,o=i.spatialReference,[a,r]=i.state.paddedViewState.size,l=i.state.padding;let n=0,p=0;if("map-only"===s)null!=t.width&&null!=t.height&&(n=t.width,p=t.height);else if(s){const e=t.id?this._templateIdToCustomTemplate.get(t.id):null,{webMapFrameSize:s,pageUnits:i}=e?.layoutTemplateInfo??{};let l=!1;if(s&&i)if(this._isFreeHand){const t=s[0]/s[1];n=this._freeHandWidth,p=this._freehandHeight,n>p?p=n/t:n=p*t}else{const t=A.fromJSON(i.toLowerCase()),e=o.unit;m(t)===m(e)?(n=h(s[0],t,e),p=h(s[1],t,e)):(l=!0,n=s[0],p=s[1])}if(!this._isFreeHand)if(t.scaleEnabled&&t.scale){const e=l?Math.min(a/n,r/p):u(o)*d*t.dpi;n*=e,p*=e}else if(0===n||0===p)n=a,p=r;else{const t=(a-.1*a)/n,e=(r-.1*r)/p,s=Math.min(t,e);n*=s,p*=s}}const{scaleEnabled:c,scale:y}=t,f=c&&y?y/this.view.scale:1;if(e.boxWidth=n*f||a,e.boxHeight=p*f||r,l&&(e.padding=l),e.backgroundWidth=a??0,e.backgroundHeight=r??0,"loading"===this.loadStatus)e.strokeColor=R;else if("loaded"===this.loadStatus)switch(this.templateOptions.state){case"pending":e.strokeColor=R;break;case"ready":e.strokeColor=W;break;case"error":e.strokeColor=N}}_resetDrag(){this._isFreeHand=!1,this._updateOverLayItem()}_handleDrag(t){switch(t.action){case"start":this._start();break;case"update":this._update(t);break;case"end":this._end()}t.stopPropagation()}_start(){this._isFreeHand=!0}_update(t){const e=this._getOverlayItem(),{x:s,y:i}=t,{x:o,y:a}=t.origin;s>o?(e.x=o,e.boxWidth=s-o):(e.x=s,e.boxWidth=o-s),i>a?(e.y=a,e.boxHeight=i-a):(e.y=i,e.boxHeight=a-i)}_end(){const t=this._getOverlayItem();if(!this.view||null==t.x||null==t.y)return;const e=this.view,s=e.toMap(p(t.x+.5*t.boxWidth,t.y+.5*t.boxHeight));t.x=null,t.y=null,e.goTo({center:s}),this._freeHandWidth=t.boxWidth,this._freehandHeight=t.boxHeight,"map-only"===this.templateOptions.layout&&(this.templateOptions.width=this._freeHandWidth,this.templateOptions.height=this._freehandHeight),this.templateOptions.scale=this.view.scale,this._updateOverLayItem()}};t([c()],J.prototype,"_serviceTemplateCustomTextElements",void 0),t([c()],J.prototype,"_templateIdToCustomTemplate",void 0),t([c()],J.prototype,"allowedFormats",void 0),t([c()],J.prototype,"allowedLayouts",void 0),t([c({type:G})],J.prototype,"browseTemplates",void 0),t([c({type:G})],J.prototype,"defaultTemplates",void 0),t([c()],J.prototype,"error",void 0),t([c({type:B})],J.prototype,"exportedLinks",void 0),t([c()],J.prototype,"extraParameters",void 0),t([c()],J.prototype,"includeDefaultTemplates",void 0),t([c({readOnly:!0})],J.prototype,"effectivePrintServiceUrl",null),t([c()],J.prototype,"effectiveTemplateCustomTextElements",null),t([c({type:T})],J.prototype,"outSpatialReference",void 0),t([c({type:I})],J.prototype,"portal",void 0),t([c()],J.prototype,"portalTemplateIds",void 0),t([c({type:G})],J.prototype,"printServiceTemplates",void 0),t([c({readOnly:!0})],J.prototype,"defaultTemplate",void 0),t([c()],J.prototype,"showPrintAreaEnabled",void 0),t([c()],J.prototype,"printServiceUrl",void 0),t([c()],J.prototype,"printTimeout",void 0),t([c({readOnly:!0})],J.prototype,"state",null),t([c({readOnly:!0})],J.prototype,"templatesInfo",void 0),t([c()],J.prototype,"updateDelay",void 0),t([c()],J.prototype,"view",void 0),t([c()],J.prototype,"templateCustomTextElements",void 0),t([c({type:M})],J.prototype,"templateOptions",void 0),J=t([y("esri.widgets.Print.PrintViewModel")],J);const Q=J;export{Q 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.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Error.js";import{getTaskExecutionMode as o,PrintServiceTask as r}from"../../rest/print.js";import{execute as e}from"../../rest/geoprocessor/execute.js";import{submitJob as a}from"../../rest/geoprocessor/submitJob.js";async function i(i,s,n){if(!i)throw new t("print:invalid-layout-info-task-url","Can't fetch layout template info",{url:i});if("async"===await o(i,r.GetLayoutTemplatesInfo,n)){const t=await a(i,s,void 0,n||void 0);await t.waitForJobCompletion();return(await t.fetchResultData("Output_JSON")).value}return(await e(i,s,null,n)).results[0].value}export{i as fetchLayoutTemplateInfos};
5
+ import e from"../../core/Error.js";import{JSONMap as t}from"../../core/jsonMap.js";import{getTaskExecutionMode as r,PrintServiceTask as i}from"../../rest/print.js";import{execute as o}from"../../rest/geoprocessor/execute.js";import{submitJob as a}from"../../rest/geoprocessor/submitJob.js";async function s(t,s,m){if(!t)throw new e("print:invalid-layout-info-task-url","Can't fetch layout template info",{url:t});if("async"===await r(t,i.GetLayoutTemplatesInfo,m)){const e=await a(t,s,void 0,m||void 0);await e.waitForJobCompletion();return(await e.fetchResultData("Output_JSON")).value}return(await o(t,s,null,m)).results[0].value}const m=new t({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});export{s as fetchLayoutTemplateInfos,m as valueUnitKebabDict};
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.33/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{findToken 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 f}from"./support/componentsUtils.js";import{globalCss as y}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,tsxFragment as I}from"./support/jsxFactory.js";import{formatNumber as O}from"../intl/number.js";const $=t.ofType(v),E="map-only";var L;!function(e){e.layout="layoutTab",e.mapOnly="mapOnlyTab",e.export="exportTab"}(L||(L={}));const F="esri-print",M=`${F}__advanced-options-button`,P={base:F,headerTitle:`${F}__header-title`,layoutTabList:`${F}__layout-tab-list`,layoutTab:`${F}__layout-tab`,layoutSection:`${F}__layout-section`,mapOnlySection:`${F}__map-only-section`,panelItemsCentered:`${F}__panel-items--centered`,loader:`${F}__loader`,advancedOptionsButton:M,advancedOptionsButtonContainer:`${M}-container`,advancedOptionsButtonTitle:`${M}-title`,advancedOptionsButtonIconOpened:`${M}-icon--opened`,advancedOptionsButtonIconClosed:`${M}-icon--closed`,advancedOptionsButtonIconClosed_RTL:`${M}-icon--closed-rtl`,swapButton:`${F}__swap-button`,printButton:`${F}__export-button`,printButtonSection:`${F}__export-button-section`,printButtonSectionDivider:`${F}__export-button-section--divider`,templateSelectContainer:`${F}__template-select-container`,templateSelectBlock:`${F}__template-select-block`,templateSelectIcon:`${F}__template-select-icon`,templateSelectError:`${F}__template-select-error`,templateSelectArrow:`${F}__template-select-arrow`,formSectionContainer:`${F}__form-section-container`,formCheckboxLabel:`${F}__form-checkbox-label`,advancedOptionsSection:`${F}__advanced-options-section`,advancedOptionsContainer:`${F}__advanced-options-container`,browseTemplateButtonContainer:`${F}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${F}__browse-template-button-container-filter`,exportedFilesContainer:`${F}__export-panel-container`,exportedFilesTitle:`${F}__export-title`,exportedFile:`${F}__exported-file`,exportedFileLink:`${F}__exported-file-link`,exportedFileLinkTitle:`${F}__exported-file-link-title`,exportedFileLinkDescription:`${F}__exported-file-link-description`,exportedFilesEmpty:`${F}__exported-files-empty`,printWidgetContainer:`${F}__container`,content:`${F}__content`,panelContainer:`${F}__panel-container`,scaleInfoContainer:`${F}__scale-info-container`,scaleInputContainer:`${F}__scale-input-container`,scaleInput:`${F}__scale-input`,sizeContainer:`${F}__size-container`,panelError:`${F}__panel--error`,exportedFileError:`${F}__exported-file--error`,exportedFileLoader:`${F}__exported-file--loader`,exportSection:`${F}__export-section`,exportSectionCentered:`${F}__export-section--centered`,templateButtonContainer:`${F}__template-button-container`,templateDoneButton:`${F}__template-done-button`,templateSelectFlowItemContainer:`${F}__template-select-flow-item-container`,templateSelectFlowItemContent:`${F}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${F}__template-select-flow-item-list-heading`,srLabel:`${F}__sr-label`,invalidWkidText:`${F}__invalid-wkid-text`};function A(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 N(e){return e?.toLowerCase()===E}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 D=new i({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),j=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 V=class extends _{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._exportedFileNameMap={},this._selectedTab=L.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===L.layout?this.templateOptions.title=e.currentTarget.value:this._selectedTab===L.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=N(e)?L.mapOnly:L.layout,this._selectedTab===L.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 f({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:f,width:k}=t,C="ready"!==i.state||this._awaitingServerResponse||!(u||h),I=this._renderTitleOrFileNameSection(),O=S("div",{class:P.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})))))),$=S("calcite-label",{layout:"inline"},S("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),E=S("div",null,S("div",{class:P.formSectionContainer},S("calcite-label",null,e.template,S("calcite-block",{class:P.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:P.templateSelectIcon,icon:(this._selectedTemplate?.layout?j.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?S("calcite-icon",{class:P.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,S("calcite-icon",{class:P.templateSelectArrow,icon:x()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),$),F=S("div",{class:P.formSectionContainer},S("calcite-label",null,e.dpi,S("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._handleDPIChange}))),M=S("div",{class:P.formSectionContainer},S("calcite-label",null,S("div",{class:P.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:P.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),A=S("div",{class:this.classes(P.scaleInfoContainer,P.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:P.scaleInputContainer},S("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${f}`,bind:this,class:P.scaleInput,"data-input-name":"scale",disabled:!g,value:`${f}`,onCalciteInputNumberInput:this._updateNumberInputValue}),S("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!g,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),B=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:P.advancedOptionsContainer,key:"advanced-section-for-layout"},A,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?S("div",{class:P.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:P.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,M,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?S("div",{class:P.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:P.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:P.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),N=S("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:P.advancedOptionsContainer},A,F,M,S("div",{class:P.formSectionContainer},S("calcite-label",{layout:"inline"},S("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),R=this.exportedLinks.toArray(),D=this._renderExportedLinkItems(R),V={[P.exportSectionCentered]:!R.length},U=this._selectedTab===L.layout?S("section",{"aria-labelledby":`${this.id}__layoutTab`,class:P.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},S("div",{class:P.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?I:null,E,this._selectedTab===L.layout?O:null,S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(P.panelContainer,P.advancedOptionsSection),collapsible:!0,disabled:!(u||h?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},B))):this._selectedTab===L.mapOnly?S("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:P.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},S("div",{class:P.panelContainer},I,O,S("div",null,S("div",{class:this.classes(P.sizeContainer,P.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(y.widgetButton,P.swapButton,T.swap),onclick:this._switchInput,type:"button"})),$),S("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(P.panelContainer,P.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},N))):S("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(P.exportSection,V),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},S("div",{class:P.panelContainer},S("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:P.exportedFilesContainer},0===R.length?S("div",{class:P.exportedFilesEmpty},S("calcite-icon",{icon:"file",scale:"l"}),S("div",null,S(w,{class:P.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),S("div",null,e.exportHint))):D))),H="2d"!==a?.type,z=S("div",{class:P.panelError},a?H?e.sceneViewError:e.serviceError:e.noViewError),W=R.some((({state:e})=>"pending"===e)),q=S("div",{class:P.content,key:"panel"},S("div",null,S("ul",{bind:this,class:P.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===L.layout}`,class:P.layoutTab,"data-tab-id":L.layout,id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===L.mapOnly}`,class:P.layoutTab,"data-tab-id":L.mapOnly,id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),S("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===L.export}`,class:P.layoutTab,"data-tab-id":L.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!==L.export?S("div",{class:this.classes(P.printButtonSection,!this.saveExportHidden&&this.portal?P.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(P.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:P.printWidgetContainer},this.headerVisible?S("header",{class:P.headerTitle},e.export):null,this.error||H||!a?z:q)),this._renderChooseTemplateFlowItem()),G="initializing"===i.state,J=G?this._renderLoader():K,Q={[P.panelItemsCentered]:G};return S("div",{bind:this,class:this.classes(P.base,y.widget,y.panel,Q)},J)}_getPageSizeLabel(e){if(!e)return;const t=e.layoutTemplateInfo;if(!t)return;const i=D.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})=>!N(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})=>!(N(t)||i?.id&&e.includes(i.id)))):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter((({layout:e})=>!N(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?j.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:P.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?P.browseTemplateButtonContainerFilter:P.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:P.templateSelectFlowItemContainer},S("div",{class:P.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:P.templateSelectFlowItemListHeading},e.myTemplates,t?S("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?S("div",{key:"org-templates"},S("div",{class:P.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:P.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:P.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),S("div",{class:P.templateButtonContainer},S("calcite-button",{class:P.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?S("div",{class:P.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===L.layout?e:t,o=this._selectedTab===L.layout?i:a,n=this._selectedTab===L.layout?this.templateOptions.title:this.templateOptions.fileName;return S("div",{class:P.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===L.layout||"mapOnlyTab"===t&&this._selectedTab===L.mapOnly||"exportTab"===t&&this._selectedTab===L.export)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[P.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}=A(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===L.layout?i.layoutOptions?.titleText:e.fileName,l=this._createFileLink(i,a);this.exportedLinks.add(l),this.emit("submit",{link:l,saveExportEnabled:t}),this._selectedTab=L.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()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:a}=e,o=this.saveAsButtonCallback&&"error"!==a&&this._isFormatAllowedForSaving(e.extension);return"pending"!==a&&o?S("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-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:`${i}-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:`${i}-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:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e,t){const i=this.messages,{url:a,state:l}=e,o=e.formattedName??"";let r=a||null;r&&(r=n(r));const c=s(r,location.href);return S("div",{class:P.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},S("div",null,S("div",{class:P.exportedFileLinkTitle},o),S("div",{class:P.exportedFileLinkDescription},"pending"===l?i.generatingExport:t||(c?i.ready:i.linkReady))),"ready"===l?S("calcite-icon",{"aria-label":`${o}. ${i.linkReady}`,icon:c?"download-to":"launch",key:`${o}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?S("calcite-loader",{class:P.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):S("calcite-icon",{icon:R(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e,t){const{state:i}=e,a=e.formattedName??"",l=this.saveAsButtonCallback&&"error"!==i&&this._isFormatAllowedForSaving(e.extension);return"pending"!==i?S("calcite-action",{"aria-label":`${t}`,icon:l?"ellipsis":"x",id:l?`${a}-popover-button`:void 0,key:l?`${a}-saveAs-action`:`${a}-action`,onclick:l?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:`${t}`}):null}_renderExportedLinkItem(e){const t=this.messages,{error:i,state:a}=e,l=e.formattedName??"";let o;switch(a){case"pending":o=t.pending;break;case"ready":o=t.ready;break;case"error":o=t.errorMessage}const n="error"===a?"print-task:cim-symbol-unsupported"===i?.name?t.exportWebMapCIMError:t.exportWebMapError:"";return S(I,null,S("calcite-list-item",{"aria-label":o,key:l,title:n},this._renderExportedLinkItemContent(e,n),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e,n)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return S("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList},e.map(this._renderExportedLinkItem.bind(this)))}_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===L.mapOnly)this.templateOptions.reset(),this.templateOptions.layout=E;else if(this._selectedTab===L.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 L.layout:this._toggleTab("ArrowLeft"===t?L.export:L.mapOnly);break;case L.mapOnly:this._toggleTab("ArrowLeft"===t?L.layout:L.export);break;case L.export:this._toggleTab("ArrowLeft"===t?L.mapOnly:L.layout)}e.preventDefault(),e.stopPropagation()}}};e([r()],V.prototype,"_showTemplates",void 0),e([r()],V.prototype,"_isValidSpatialReference",void 0),e([r()],V.prototype,"allowedFormats",null),e([r()],V.prototype,"allowedFormatsForSaving",void 0),e([r()],V.prototype,"allowedLayouts",null),e([r()],V.prototype,"browseTemplateButtonOnClick",void 0),e([r()],V.prototype,"error",null),e([r({type:$})],V.prototype,"exportedLinks",void 0),e([r()],V.prototype,"extraParameters",null),e([r()],V.prototype,"headerVisible",void 0),e([r()],V.prototype,"headingLevel",void 0),e([r()],V.prototype,"icon",null),e([r()],V.prototype,"includeDefaultTemplates",null),e([r()],V.prototype,"includeOrganizationTemplates",void 0),e([r()],V.prototype,"label",null),e([r(),C("esri/widgets/Print/t9n/Print")],V.prototype,"messages",void 0),e([r(),C("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([r(),C("esri/core/t9n/Units")],V.prototype,"messagesUnits",void 0),e([r({type:d})],V.prototype,"outSpatialReference",null),e([r()],V.prototype,"portal",null),e([r()],V.prototype,"saveExportEnabled",void 0),e([r()],V.prototype,"saveExportHidden",void 0),e([r()],V.prototype,"showPrintAreaEnabled",null),e([r()],V.prototype,"printServiceUrl",null),e([r()],V.prototype,"saveAsButtonCallback",void 0),e([r()],V.prototype,"templateCustomTextElements",null),e([r()],V.prototype,"templateOptions",null),e([r()],V.prototype,"view",null),e([r({type:g})],V.prototype,"viewModel",void 0),V=e([p("esri.widgets.Print")],V);const U=V;export{U as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{JSONMap as t}from"../core/jsonMap.js";import{watch as i,whenOnce as a}from"../core/reactiveUtils.js";import{unitName as l}from"../core/unitFormatUtils.js";import{addProxy as o,hasSameOrigin as n}from"../core/urlUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{ensureInteger as r}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/SpatialReference.js";import{isValid as d}from"../geometry/support/spatialReferenceUtils.js";import{reArcGISOnlineDomain as m}from"../portal/support/urlUtils.js";import{findToken as u}from"../rest/utils.js";import{formatJsonMap as h}from"../rest/support/fileFormat.js";import b from"./Widget.js";import _ from"./Print/PrintViewModel.js";import{loadCalciteComponents as v}from"./support/componentsUtils.js";import{globalCss as g}from"./support/globalCss.js";import{Heading as f}from"./support/Heading.js";import{legacyIcon as y}from"./support/legacyIcon.js";import{isRTL as w,isActivationKey as T}from"./support/widgetUtils.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{tsx as x,tsxFragment as C}from"./support/jsxFactory.js";import{formatNumber as S}from"../intl/number.js";const I="map-only";var O;!function(e){e.layout="layoutTab",e.mapOnly="mapOnlyTab",e.export="exportTab"}(O||(O={}));const $="esri-print",E=`${$}__advanced-options-button`,L={base:$,headerTitle:`${$}__header-title`,layoutTabList:`${$}__layout-tab-list`,layoutTab:`${$}__layout-tab`,layoutSection:`${$}__layout-section`,mapOnlySection:`${$}__map-only-section`,panelItemsCentered:`${$}__panel-items--centered`,loader:`${$}__loader`,advancedOptionsButton:E,advancedOptionsButtonContainer:`${E}-container`,advancedOptionsButtonTitle:`${E}-title`,advancedOptionsButtonIconOpened:`${E}-icon--opened`,advancedOptionsButtonIconClosed:`${E}-icon--closed`,advancedOptionsButtonIconClosed_RTL:`${E}-icon--closed-rtl`,swapButton:`${$}__swap-button`,printButton:`${$}__export-button`,printButtonSection:`${$}__export-button-section`,printButtonSectionDivider:`${$}__export-button-section--divider`,templateSelectContainer:`${$}__template-select-container`,templateSelectBlock:`${$}__template-select-block`,templateSelectIcon:`${$}__template-select-icon`,templateSelectError:`${$}__template-select-error`,templateSelectArrow:`${$}__template-select-arrow`,formSectionContainer:`${$}__form-section-container`,formCheckboxLabel:`${$}__form-checkbox-label`,advancedOptionsSection:`${$}__advanced-options-section`,advancedOptionsContainer:`${$}__advanced-options-container`,browseTemplateButtonContainer:`${$}__browse-template-button-container`,browseTemplateButtonContainerFilter:`${$}__browse-template-button-container-filter`,exportedFilesContainer:`${$}__export-panel-container`,exportedFilesTitle:`${$}__export-title`,exportedFile:`${$}__exported-file`,exportedFileLink:`${$}__exported-file-link`,exportedFileLinkTitle:`${$}__exported-file-link-title`,exportedFileLinkDescription:`${$}__exported-file-link-description`,exportedFilesEmpty:`${$}__exported-files-empty`,printWidgetContainer:`${$}__container`,content:`${$}__content`,panelContainer:`${$}__panel-container`,scaleInfoContainer:`${$}__scale-info-container`,scaleInputContainer:`${$}__scale-input-container`,scaleInput:`${$}__scale-input`,sizeContainer:`${$}__size-container`,panelError:`${$}__panel--error`,exportedFileError:`${$}__exported-file--error`,exportedFileLoader:`${$}__exported-file--loader`,exportSection:`${$}__export-section`,exportSectionCentered:`${$}__export-section--centered`,templateButtonContainer:`${$}__template-button-container`,templateDoneButton:`${$}__template-done-button`,templateSelectFlowItemContainer:`${$}__template-select-flow-item-container`,templateSelectFlowItemContent:`${$}__template-select-flow-item-content`,templateSelectFlowItemListHeading:`${$}__template-select-flow-item-list-heading`,srLabel:`${$}__sr-label`,invalidWkidText:`${$}__invalid-wkid-text`};function F(e,t,i,a){const l=i/t,o=a/t;return{width:Math.round(e*l),height:Math.round(e*o)}}function M(e){return!isNaN(e)&&e>0}function P(e){return e?.toLowerCase()===I}function A(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 B=new t({inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"}),R=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 D=class extends b{constructor(e,t){super(e,t),this._activeTabFocusRequested=!1,this._awaitingServerResponse=!1,this._selectedTab=O.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.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 _,this._onInput=e=>{this._selectedTab===O.layout?this.templateOptions.title=e.currentTarget.value:this._selectedTab===O.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=u(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([i((()=>[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=h.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)}})),i((()=>[this.templateOptions.id,this.viewModel.loaded]),(async()=>{const{layout:e}=this.templateOptions;this._selectedTab=P(e)?O.mapOnly:O.layout,this._selectedTab===O.layout&&this.viewModel.loaded&&(this._selectedTemplate=this.viewModel.getLayoutTemplateById(this.templateOptions.id))})),i((()=>this.templateOptions.dpi),(e=>{e<=0&&(this.templateOptions.dpi=1)})),i((()=>this.viewModel.view?.scale),(e=>{!e||this.templateOptions.scaleEnabled&&this.templateOptions.scale||(this.templateOptions.scale=e)}))]);const{height:e,width:t}=this.templateOptions;this.templateOptions.width=t||800,this.templateOptions.height=e||1100;const a=setTimeout((()=>{this._awaitingServerResponse=!0,this.scheduleRender()}),500);this.viewModel.load().then((()=>{clearTimeout(a),this._awaitingServerResponse=!1}))}loadDependencies(){return v({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 exportedLinks(){return this.viewModel.exportedLinks}set exportedLinks(e){this.viewModel.exportedLinks=e}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:c,height:m,layout:u,layoutItem:h,legendEnabled:b,northArrowEnabled:_,scaleBarEnabled:v,scaleEnabled:T,scale:k,width:C}=t,S="ready"!==i.state||this._awaitingServerResponse||!(u||h),I=this._renderTitleOrFileNameSection(),$=x("div",{class:L.formSectionContainer},x("calcite-label",null,e.fileFormatTitle,x("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)=>x("calcite-combobox-item",{key:`file-format-${i}`,selected:e===this.templateOptions.format,textLabel:t,value:e})))))),E=x("calcite-label",{layout:"inline"},x("calcite-switch",{checked:this.showPrintAreaEnabled,onCalciteSwitchChange:e=>{this.showPrintAreaEnabled=!!e.currentTarget.checked}}),e.printPreview),F=x("div",null,x("div",{class:L.formSectionContainer},x("calcite-label",null,e.template,x("calcite-block",{class:L.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},x("calcite-icon",{class:L.templateSelectIcon,icon:(this._selectedTemplate?.layout?R.get(this._selectedTemplate.layout):null)||"custom-print",key:"template-select-icon",scale:"l",slot:"content-start"}),"error"===this._selectedTemplate?.state?x("calcite-icon",{class:L.templateSelectError,icon:"exclamation-mark-circle",key:"template-select-error",scale:"s",slot:"actions-end"}):null,x("calcite-icon",{class:L.templateSelectArrow,icon:w()?"chevron-left":"chevron-right",key:"template-select-arrow",scale:"s",slot:"actions-end"})))),E),M=x("div",{class:L.formSectionContainer},x("calcite-label",null,e.dpi,x("calcite-input-number",{bind:this,"data-input-name":"dpi",min:1,value:`${s}`,onCalciteInputNumberInput:this._handleDPIChange}))),P=x("div",{class:L.formSectionContainer},x("calcite-label",null,x("div",{class:L.srLabel},e.outSpatialReference,x("calcite-link",{href:"https://developers.arcgis.com/rest/services-reference/enterprise/using-spatial-references/",target:"_blank"},"(WKID)")),x("calcite-input-number",{bind:this,"data-input-name":"outSpatialReference",integer:!0,numberButtonType:"none",value:i.outSpatialReference?.wkid?.toString()??"",onCalciteInputNumberInput:({currentTarget:e})=>{const t=r(e.value);i.outSpatialReference=Number.isNaN(t)||null==t?null:new p({wkid:t}),this._isValidSpatialReference=!i.outSpatialReference||d(i.outSpatialReference)}}),this._isValidSpatialReference?null:x("div",{class:L.invalidWkidText,key:`out-sr-${i.outSpatialReference?.wkid}`},e.invalidWkid))),A=x("div",{class:this.classes(L.scaleInfoContainer,L.formSectionContainer)},x("calcite-label",{layout:"inline"},x("calcite-checkbox",{bind:this,checked:T,"data-option-name":"scaleEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scale),x("div",{class:L.scaleInputContainer},x("calcite-input-number",{"aria-label":e.scaleLabel,"aria-valuenow":`${k}`,bind:this,class:L.scaleInput,"data-input-name":"scale",disabled:!T,value:`${k}`,onCalciteInputNumberInput:this._updateNumberInputValue}),x("calcite-button",{appearance:"outline","aria-label":e.reset,bind:this,disabled:!T,iconStart:"refresh",kind:"neutral",onclick:this._resetToCurrentScale}))),B=x("div",{"aria-labelledby":`${this.id}__advancedOptionsForLayout`,class:L.advancedOptionsContainer,key:"advanced-section-for-layout"},A,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasAuthorText??1?x("div",{class:L.formSectionContainer,key:"author-info"},x("calcite-label",null,e.author,x("calcite-input",{bind:this,"data-input-name":"author",value:o??"",onCalciteInputInput:this._updateInputValue}))):null,this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasCopyrightText??1?x("div",{class:L.formSectionContainer,key:"copyright-text"},x("calcite-label",null,e.copyright,x("calcite-input",{bind:this,"data-input-name":"copyright",value:n??"",onCalciteInputInput:this._updateInputValue}))):null,M,P,this._renderCustomTextElementSection(),this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasLegend??1?x("div",{class:L.formSectionContainer,key:"legend-info"},x("calcite-label",{layout:"inline"},x("calcite-checkbox",{bind:this,checked:!!b,"data-option-name":"legendEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.legend)):null,this._selectedTemplate?.mapSurroundInfoOptions?.northArrow.length?x("div",{class:L.formSectionContainer,key:"north-arrow"},x("calcite-label",{layout:"inline"},x("calcite-checkbox",{bind:this,checked:!!_,"data-option-name":"northArrowEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.northArrow)):null,this._selectedTemplate?.mapSurroundInfoOptions?.scaleBar.length?x("div",{class:L.formSectionContainer,key:"scale-bar"},x("calcite-label",{layout:"inline"},x("calcite-checkbox",{bind:this,checked:!!v,"data-option-name":"scaleBarEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.scaleBar)):null),D=x("div",{"aria-labelledby":`${this.id}__advancedOptionsForMapOnly`,class:L.advancedOptionsContainer},A,M,P,x("div",{class:L.formSectionContainer},x("calcite-label",{layout:"inline"},x("calcite-checkbox",{bind:this,checked:l,"data-option-name":"attributionEnabled",onCalciteCheckboxChange:this._toggleInputValue}),e.attribution)),this._renderCustomTextElementSection()),N=this.exportedLinks.toArray(),V=this._renderExportedLinkItems(N),j={[L.exportSectionCentered]:!N.length},U=this._selectedTab===O.layout?x("section",{"aria-labelledby":`${this.id}__layoutTab`,class:L.layoutSection,id:`${this.id}__layoutContent`,key:"esri-print__layoutContent",role:"tabpanel"},x("div",{class:L.panelContainer},this._selectedTemplate?.layoutTemplateInfo?.layoutOptions?.hasTitleText??1?I:null,F,this._selectedTab===O.layout?$:null,x("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(L.panelContainer,L.advancedOptionsSection),collapsible:!0,disabled:!(u||h?.id),heading:e.advancedOptions,id:"advancedOptionsForLayout",key:"advanced-options-for-layout"},B))):this._selectedTab===O.mapOnly?x("section",{"aria-labelledby":`${this.id}__mapOnlyTab`,class:L.mapOnlySection,id:`${this.id}__mapOnlyContent`,key:"esri-print__mapOnlyContent",role:"tabpanel"},x("div",{class:L.panelContainer},I,$,x("div",null,x("div",{class:this.classes(L.sizeContainer,L.formSectionContainer)},x("calcite-label",null,e.width,x("calcite-input-number",{bind:this,"data-input-name":"width",value:`${C}`,onCalciteInputNumberInput:this._updateNumberInputValue})),x("calcite-label",null,e.height,x("calcite-input-number",{bind:this,"data-input-name":"height",value:`${m}`,onCalciteInputNumberInput:this._updateNumberInputValue})),x("button",{"aria-label":e.swap,bind:this,class:this.classes(g.widgetButton,L.swapButton,y.swap),onclick:this._switchInput,type:"button"})),E),x("calcite-block",{"aria-label":e.advancedOptions,class:this.classes(L.panelContainer,L.advancedOptionsSection),collapsible:!0,heading:e.advancedOptions,id:"advancedOptionsForMapOnly",key:"advanced-options-for-map-only"},D))):x("section",{"aria-labelledby":`${this.id}__exportTab`,class:this.classes(L.exportSection,j),id:`${this.id}__exportContent`,key:"esri-print__exportContent",role:"tabpanel"},x("div",{class:L.panelContainer},x("div",{afterUpdate:this._scrollExportIntoView,bind:this,class:L.exportedFilesContainer},0===N.length?x("div",{class:L.exportedFilesEmpty},x("calcite-icon",{icon:"file",scale:"l"}),x("div",null,x(f,{class:L.exportedFilesTitle,level:this.headingLevel},e.noExportedFiles),x("div",null,e.exportHint))):V))),H="2d"!==a?.type,z=x("div",{class:L.panelError},a?H?e.sceneViewError:e.serviceError:e.noViewError),W=N.some((({state:e})=>"pending"===e)),q=x("div",{class:L.content,key:"panel"},x("div",null,x("ul",{bind:this,class:L.layoutTabList,onclick:this._toggleLayoutPanel,onkeydown:this._handleLayoutPanelKeyDown,role:"tablist"},x("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===O.layout}`,class:L.layoutTab,"data-tab-id":O.layout,id:`${this.id}__layoutTab`,role:"tab",tabIndex:0},e.layoutTab),x("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===O.mapOnly}`,class:L.layoutTab,"data-tab-id":O.mapOnly,id:`${this.id}__mapOnlyTab`,role:"tab",tabIndex:0},e.mapOnlyTab),x("li",{afterCreate:this._focusOnTabChange,afterUpdate:this._focusOnTabChange,"aria-selected":`${this._selectedTab===O.export}`,class:L.layoutTab,"data-tab-id":O.export,id:`${this.id}__exportedFilesTab`,role:"tab",tabIndex:0},W?x("calcite-loader",{inline:!0,label:"loading",scale:"s"}):null,e.exportsTab)),U),this._selectedTab!==O.export?x("div",{class:this.classes(L.printButtonSection,!this.saveExportHidden&&this.portal?L.printButtonSectionDivider:null),key:"export-button-section"},!this.saveExportHidden&&this.portal?x("calcite-label",{layout:"inline"},x("calcite-checkbox",{bind:this,checked:this.saveExportEnabled,onCalciteCheckboxChange:e=>{this.saveExportEnabled=!!e.currentTarget.checked}}),e.saveExportToMyContent):null,x("calcite-button",{"aria-label":e.exportDescription,bind:this,class:this.classes(L.printButton),disabled:S||!(u||h?.id)&&!c,onclick:this._handlePrintMap,scale:"l",width:"full"},e.export)):null),K=x("calcite-flow",{key:"root-flow"},x("calcite-flow-item",{bind:this,key:"root-flow-item",selected:!this._showTemplates},x("div",{class:L.printWidgetContainer},this.headerVisible?x("header",{class:L.headerTitle},e.export):null,this.error||H||!a?z:q)),this._renderChooseTemplateFlowItem()),G="initializing"===i.state,J=G?this._renderLoader():K,Q={[L.panelItemsCentered]:G};return x("div",{bind:this,class:this.classes(L.base,g.widget,g.panel,Q)},J)}_getPageSizeLabel(e){if(!e)return;const t=e.layoutTemplateInfo;if(!t)return;const i=B.fromJSON(t.pageUnits.toLowerCase());return`${S(t.pageSize[0])} × ${S(t.pageSize[1])} ${l(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})=>!P(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})=>!(P(t)||i?.id&&e.includes(i.id)))):[]}_getPrintServiceTemplates(){return this.includeDefaultTemplates&&this._getDefaultTemplates().length?[]:this.viewModel.printServiceTemplates.toArray().filter((({layout:e})=>!P(e)))}_renderLayoutTemplates(e,t=!1,i=!1){return t&&e.sort(((e,t)=>(e.label??"")>(t.label??"")?1:-1)),e.map((e=>x("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},x("calcite-icon",{icon:(e.layout?R.get(e.layout):null)||"custom-print",slot:"content-start"}),"loading"===e.state?x("calcite-loader",{inline:!0,key:`template-loader-${e.id}`,label:"loading",scale:"s",slot:"content-end"}):null,"error"===e?.state?x("calcite-icon",{class:L.templateSelectError,icon:"exclamation-mark-circle",key:`template-error-${e.id}`,scale:"s",slot:"content-end"}):null,i?x("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=m.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?x("calcite-button",{appearance:"outline",class:n?L.browseTemplateButtonContainerFilter:L.browseTemplateButtonContainer,iconStart:"folder",key:"browse-template-button",onclick:this.browseTemplateButtonOnClick,slot:n?"filter-actions-end":"default"},n?null:e.browseTemplates):null;return x("calcite-flow-item",{bind:this,closable:!1,heading:e.chooseTemplate,key:"template-flow-item",selected:this._showTemplates,onCalciteFlowItemBack:e=>{e.preventDefault(),this._showTemplates=!1}},x("div",{class:L.templateSelectFlowItemContainer},x("div",{class:L.templateSelectFlowItemContent},n?null:s,x("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?x("div",{key:"my-templates"},x("div",{class:L.templateSelectFlowItemListHeading},e.myTemplates,t?x("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(i,!0,!0)):null,a.length?x("div",{key:"org-templates"},x("div",{class:L.templateSelectFlowItemListHeading},e.organizationTemplates,t?x("calcite-chip",{appearance:"outline",kind:"neutral",label:e.beta,scale:"s"},e.beta):null),this._renderLayoutTemplates(a)):null,i.length||a.length?l.length?x("div",{key:"default-templates"},x("div",{class:L.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(l,!0)):null:this._renderLayoutTemplates(l,!0),i.length||a.length?o.length?x("div",{key:"service-templates"},x("div",{class:L.templateSelectFlowItemListHeading},e.defaultTemplates),this._renderLayoutTemplates(o)):null:this._renderLayoutTemplates(o))),x("div",{class:L.templateButtonContainer},x("calcite-button",{class:L.templateDoneButton,onclick:()=>this._showTemplates=!1},this.messagesCommon.done))))}_renderCustomTextElementSection(){const{customTextElements:e}=this.templateOptions;return e?x("div",{class:L.formSectionContainer,key:"custom-text-elements"},e.map(((e,t)=>{const[i,a]=Object.entries(e)[0];return"date"===i?null:x("calcite-label",{key:`custom-text-elements-${i}-${t}`},i,x("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===O.layout?e:t,o=this._selectedTab===O.layout?i:a,n=this._selectedTab===O.layout?this.templateOptions.title:this.templateOptions.fileName;return x("div",{class:L.formSectionContainer,key:l},x("calcite-label",null,l,x("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===O.layout||"mapOnlyTab"===t&&this._selectedTab===O.mapOnly||"exportTab"===t&&this._selectedTab===O.export)&&(e.focus(),this._activeTabFocusRequested=!1)}_renderLoader(){const e={[L.loader]:this._awaitingServerResponse};return x("div",{class:this.classes(e),key:"loader"})}_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(M(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}=F(a,i,t.width,t.height);t.height=l,t.width=o}_handlePrintMap(){this._pendingExportScroll=!0;const{templateOptions:e,saveExportEnabled:t}=this,i=this._selectedTab===O.layout?e.title:e.fileName,{link:a,promise:l}=this.viewModel.export(i||this.messages.untitled);this.emit("submit",{link:a,saveExportEnabled:t}),this._selectedTab=O.export,l.then((e=>{this.emit("complete",{link:e,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()}_renderExportedLinkItemPopover(e){const t=this.messages,i=e.formattedName??"",{state:l}=e,o=this.saveAsButtonCallback&&"error"!==l&&this._isFormatAllowedForSaving(e.extension);return"pending"!==l&&o?x("calcite-popover",{autoClose:!0,key:`${i}-popover`,label:"Popover",offsetDistance:1,overlayPositioning:"fixed",pointerDisabled:!0,referenceElement:`${i}-popover-button`,scale:"s"},x("calcite-list",{label:""},e.portalItem?x("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()}},x("calcite-icon",{icon:"launch2",key:`${i}-launch-icon`,scale:"s",slot:"content-start"})):x("calcite-list-item",{label:t.saveAs,onCalciteListItemSelect:async()=>{this.saveAsButtonCallback&&(a((()=>e.portalItem)).then((e=>{e.itemPageUrl&&this.scheduleRender()})),await this.saveAsButtonCallback(e))}},x("calcite-icon",{icon:"save",key:`${i}-save-icon`,scale:"s",slot:"content-start"})),x("calcite-list-item",{label:this.messagesCommon.delete,onCalciteListItemSelect:()=>this.exportedLinks.remove(e)},x("calcite-icon",{icon:"trash",key:`${i}-delete-icon`,scale:"s",slot:"content-start"})))):null}_renderExportedLinkItemContent(e,t){const i=this.messages,{url:a,state:l}=e,s=e.formattedName??"";let r=a||null;r&&(r=o(r));const c=n(r,location.href);return x("div",{class:L.exportedFile,"data-item":e,onclick:this._handleLinkClick,slot:"content"},x("div",null,x("div",{class:L.exportedFileLinkTitle},s),x("div",{class:L.exportedFileLinkDescription},"pending"===l?i.generatingExport:t||(c?i.ready:i.linkReady))),"ready"===l?x("calcite-icon",{"aria-label":`${s}. ${i.linkReady}`,icon:c?"download-to":"launch",key:`${s}-end-icon`,scale:"s",slot:"content-end"}):null)}_renderExportedLinkItemIcon(e){const t=e.formattedName??"";return"pending"===e.state?x("calcite-loader",{class:L.exportedFileLoader,inline:!0,key:`${t}-loader`,label:this.messages.generatingExport,scale:"m",slot:"content-start"}):x("calcite-icon",{icon:A(e),key:`${t}-start-icon`,scale:"s",slot:"content-start"})}_renderExportedLinkItemAction(e,t){const{state:i}=e,a=e.formattedName??"",l=this.saveAsButtonCallback&&"error"!==i&&this._isFormatAllowedForSaving(e.extension);return"pending"!==i?x("calcite-action",{"aria-label":`${t}`,icon:l?"ellipsis":"x",id:l?`${a}-popover-button`:void 0,key:l?`${a}-saveAs-action`:`${a}-action`,onclick:l?void 0:()=>{this.exportedLinks.remove(e)},slot:"actions-end",text:`${t}`}):null}_renderExportedLinkItem(e){const t=this.messages,{error:i,state:a}=e,l=e.formattedName??"";let o;switch(a){case"pending":o=t.pending;break;case"ready":o=t.ready;break;case"error":o=t.errorMessage}const n="error"===a?"print-task:cim-symbol-unsupported"===i?.name?t.exportWebMapCIMError:t.exportWebMapError:"";return x(C,null,x("calcite-list-item",{"aria-label":o,key:l,title:n},this._renderExportedLinkItemContent(e,n),this._renderExportedLinkItemIcon(e),this._renderExportedLinkItemAction(e,n)),this._renderExportedLinkItemPopover(e))}_renderExportedLinkItems(e){return x("calcite-list",{filterEnabled:e?.length>10,label:this.messages.exportedLinksList},e.map(this._renderExportedLinkItem.bind(this)))}_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===O.mapOnly)this.viewModel.applyTemplate(I);else if(this._selectedTab===O.layout){const e=this._selectedTemplate??this.viewModel.defaultTemplate;this.viewModel.applyTemplate(e)}t&&(this._activeTabFocusRequested=!0)}_handleLayoutPanelKeyDown(e){const{key:t}=e,i=e.target.getAttribute("data-tab-id");if(T(t))return this._toggleTab(i),e.preventDefault(),void e.stopPropagation();if("ArrowLeft"===t||"ArrowRight"===t){switch(i){case O.layout:this._toggleTab("ArrowLeft"===t?O.export:O.mapOnly);break;case O.mapOnly:this._toggleTab("ArrowLeft"===t?O.layout:O.export);break;case O.export:this._toggleTab("ArrowLeft"===t?O.mapOnly:O.layout)}e.preventDefault(),e.stopPropagation()}}};e([s()],D.prototype,"_showTemplates",void 0),e([s()],D.prototype,"_isValidSpatialReference",void 0),e([s()],D.prototype,"allowedFormats",null),e([s()],D.prototype,"allowedFormatsForSaving",void 0),e([s()],D.prototype,"allowedLayouts",null),e([s()],D.prototype,"browseTemplateButtonOnClick",void 0),e([s()],D.prototype,"error",null),e([s()],D.prototype,"exportedLinks",null),e([s()],D.prototype,"extraParameters",null),e([s()],D.prototype,"headerVisible",void 0),e([s()],D.prototype,"headingLevel",void 0),e([s()],D.prototype,"icon",null),e([s()],D.prototype,"includeDefaultTemplates",null),e([s()],D.prototype,"includeOrganizationTemplates",void 0),e([s()],D.prototype,"label",null),e([s(),k("esri/widgets/Print/t9n/Print")],D.prototype,"messages",void 0),e([s(),k("esri/t9n/common")],D.prototype,"messagesCommon",void 0),e([s(),k("esri/core/t9n/Units")],D.prototype,"messagesUnits",void 0),e([s({type:p})],D.prototype,"outSpatialReference",null),e([s()],D.prototype,"portal",null),e([s()],D.prototype,"saveExportEnabled",void 0),e([s()],D.prototype,"saveExportHidden",void 0),e([s()],D.prototype,"showPrintAreaEnabled",null),e([s()],D.prototype,"printServiceUrl",null),e([s()],D.prototype,"saveAsButtonCallback",void 0),e([s()],D.prototype,"templateCustomTextElements",null),e([s()],D.prototype,"templateOptions",null),e([s()],D.prototype,"view",null),e([s({type:_})],D.prototype,"viewModel",void 0),D=e([c("esri.widgets.Print")],D);const N=D;export{N as default};
@@ -1,2 +0,0 @@
1
- /*! For license information please see 02176f84d6d57f1bc1c8.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7292],{7804:(t,e,i)=>{i.d(e,{OA:()=>o,WL:()=>s,u$:()=>r});const o={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r=t=>(...e)=>({_$litDirective$:t,values:e});class s{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}},14813:(t,e,i)=>{i.d(e,{Qu:()=>s,qu:()=>r});var o=i(34088);let r=!1;const s=t=>{r=!0,(0,o.s)(t)}},18504:(t,e,i)=>{i.d(e,{Rt:()=>s,mY:()=>a});var o=i(36752);const{I:r}=o.ge,s=t=>void 0===t.strings,n={},a=(t,e=n)=>t._$AH=e},26031:(t,e,i)=>{i.d(e,{WF:()=>w,lh:()=>v,le:()=>A,s6:()=>$,CP:()=>k,zl:()=>x,Bq:()=>C,pf:()=>E});var o=i(98015);function r(t){let e=t;for(;e=e.parentNode??e.host;)if(e?.constructor?.lumina){const i=e;return i.manager?.loadedCalled||i._offspring.push(t),i._postLoad.promise}return!1}var s=Object.defineProperty;var n=globalThis.HTMLElement??function(t){const e=t.split(":");return 1===e.length?[e[0],(0,o.j1)(e[0])]:e};function a([t,e]){this[t]=e}(class extends n{constructor(){super(),this._store={},this._pendingAttributes=[],this._postLoad=new o.cY,this._postLoaded=new o.cY,this._offspring=[],this._saveInstanceProperties();const t=this.constructor;t._LitConstructor?this._initializeComponent({a:t._LitConstructor}):t._loadPromise.then(this._initializeComponent.bind(this)).catch((t=>{this._postLoaded.reject(t),setTimeout((()=>{throw t}))}))}static{this.lumina=!0}static _initializePrototype(){this._properties?.forEach(this._bindProp,this),this._asyncMethods?.forEach(this._bindAsync,this),this._syncMethods?.forEach(this._bindSync,this)}static _bindProp(t){s(this.prototype,t,{configurable:!0,enumerable:!0,get(){return this._store[t]},set(e){this._store[t]=e}})}static _bindAsync(t){s(this.prototype,t,{async value(...e){this._litElement||await this._postLoaded.promise;const i=this._litElement;return await i[t](...e)},configurable:!0})}static _bindSync(t){s(this.prototype,t,{value(...e){return this._litElement[t](...e)},configurable:!0})}get manager(){return this._litElement?.manager}_saveInstanceProperties(){const t=this.constructor,e=this;t._properties?.forEach((t=>{Object.hasOwn(this,t)&&(this._store[t]=e[t],delete e[t])}))}attributeChangedCallback(t,e,i){this._litElement?.attributeChangedCallback(t,e,i),this._litElement||this._pendingAttributes.push(t)}connectedCallback(){this._litElement?this._litElement.connectedCallback?.():queueMicrotask((()=>{this._ancestorLoad=r(this)}))}disconnectedCallback(){this._litElement?.disconnectedCallback?.()}async componentOnReady(){return await this._postLoaded.promise,this}_initializeComponent(t){const e=this.constructor,i=e._name,o=this._store,r=Object.values(t).find((t=>t.tagName===i)),n=`${i}--lazy`;let c=r;for(;c&&!Object.hasOwn(c,"lumina");)c=Object.getPrototypeOf(c);!function(t){const e=t.prototype,i=Element.prototype;Object.hasOwn(e,"isConnected")||(e.setAttribute=function(t,e){i.setAttribute.call(this.el,t,e)},e.removeAttribute=function(t){i.removeAttribute.call(this.el,t)},s(e,"isConnected",{get(){return Reflect.get(i,"isConnected",this.el)}}))}(c),!e._LitConstructor&&(e._LitConstructor=r,customElements.define(n,r)),r.lazy=this;const l=document.createElement(n);r.lazy=void 0,this._litElement=l,this._store=l,this._pendingAttributes.forEach((t=>{const e=this.getAttribute(t);l.attributeChangedCallback(t,null,e)})),Object.entries(o).forEach(a,l);const h=this.isConnected;(h||this._ancestorLoad)&&(l.connectedCallback?.(),h||l.disconnectedCallback())}addController(){}requestUpdate(){this._litElement?.requestUpdate()}});var c={},l=i(90286);Event,Event;var h=i(28760);h.W3,h.Ec;var d=i(46337),u=i(36752),p=i(7804);const f=(0,p.u$)(class extends p.WL{constructor(t){if(super(t),t.type!==p.OA.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const o=!!e[t];o===this.st.has(t)||this.nt?.has(t)||(o?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return u.c0}}),g="important",m=" !"+g,y=(0,p.u$)(class extends p.WL{constructor(t){if(super(t),t.type!==p.OA.ATTRIBUTE||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,i)=>{const o=t[i];return null==o?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`}),"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const o=e[t];if(null!=o){this.ft.add(t);const e="string"==typeof o&&o.endsWith(m);t.includes("-")||e?i.setProperty(t,e?o.slice(0,-11):o,e?g:""):i[t]=o}}return u.c0}});i(56328);var b=(t="",e={},i=(0,l.Gk)())=>{const o={emit:o=>{""===t&&(0,l.hq)();const r=new CustomEvent(t,{detail:o,cancelable:!0,bubbles:!0,composed:!0,...e});return i.el.dispatchEvent(r),r}};return""===t&&(0,l.Nh)(void 0,(e=>{t=e.key}),o),o},v=b.bind(null,""),_=()=>{},w=class t extends d.WF{constructor(){super(),this.el=this.constructor.lazy??this,this.manager=(0,l.lr)(this),this._postLoad=this.constructor.lazy?._postLoad??new o.cY,this._offspring=this.constructor.lazy?._offspring??[],this._postLoaded=this.constructor.lazy?._postLoaded??new o.cY,this._enableUpdating=this.enableUpdating,this.enableUpdating=_;const e=t.prototype.shouldUpdate;this.shouldUpdate!==e&&(this._originalShouldUpdate=this.shouldUpdate,this.shouldUpdate=e),d.S$&&this.el.setAttribute(this.constructor.runtime.hydratedAttribute,"")}static finalizeStyles(t){const e=super.finalizeStyles(t),i=this.shadowRootOptions===c;return void 0===this.runtime?.commonStyles||i?e:[this.runtime.commonStyles,...e]}static createProperty(t,e){const i="number"==typeof e?e:Array.isArray(e)?e[0]:0,r=Array.isArray(e)?e[1]:void 0;super.createProperty(t,{attribute:!!(1&i&&"string"==typeof t)&&(0,o.j1)(t),reflect:!!(2&i),type:4&i?Boolean:8&i?Number:void 0,state:!!(16&i),readOnly:!!(32&i),noAccessor:!!(64&i),...r})}static{this.lumina=!0}connectedCallback(){if(this.el.hasAttribute("defer-hydration"))return;const t=!this.manager.connectedCalled;super.connectedCallback(),t&&queueMicrotask((()=>this._load().catch((t=>{this._postLoaded.reject(t),setTimeout((()=>{throw t}))}))))}createRenderRoot(){const t=this.el.shadowRoot,e=this.constructor,i=e.shadowRootOptions,o=t??(i===c?this.el:this.el.attachShadow(i));if(Object.defineProperty(this,"shadowRoot",{value:o}),t)return d.WF.prototype.createRenderRoot.call(this),t;if(this.isConnected){const t=o.getRootNode();t.adoptedStyleSheets=[...t.adoptedStyleSheets,...e.elementStyles.map((t=>"styleSheet"in t?t.styleSheet:t))]}return o}async _load(){const t=this.el._ancestorLoad??r(this.el);t&&await t,await this.manager._load(),this._enableUpdating(!0),this.performUpdate(),this._postLoad.resolve(),await Promise.resolve();const e=this._offspring.filter((t=>!t.manager?.loadedCalled));e.length&&await Promise.allSettled(e.map((async t=>await t.componentOnReady()))),this._offspring.length=0,this.el.setAttribute(this.constructor.runtime.hydratedAttribute,""),this.manager._loaded(),this._postLoaded.resolve()}shouldUpdate(t){return this.$changes=t,this._originalShouldUpdate?.(t)??!0}listen(t,e,i){const o=e?.bind(this)??e;this.manager.onLifecycle((()=>(this.el.addEventListener(t,o,i),()=>this.el.removeEventListener(t,o,i))))}listenOn(t,e,i,o){const r=i?.bind(this)??i;this.manager.onLifecycle((()=>(t.addEventListener(e,r,o),()=>t.removeEventListener(e,r,o))))}async componentOnReady(){return await this._postLoaded.promise,this}};function A(t){let e;const i=t=>{e=new URL(t,globalThis.location?.href||void 0).href},o={...t,getAssetPath(t){const i=new URL(t,e);return i.origin!==globalThis.location?.origin?i.href:i.pathname},setAssetPath:i,customElement(t,e){e.runtime=o,e.tagName=t,customElements.get(t)||customElements.define(t,e)}};return i(t.defaultAssetPath),o}w.$createEvent=b;var k=t=>"object"==typeof t&&null!=t?f(t):t,x=t=>"object"==typeof t&&null!=t?y(t):t,$=u.s6;function C(t,e,i){null==i?t.removeAttribute(e):t.setAttribute(e,i)}var E={toAttribute:t=>!0===t?"":!1===t?null:t}},28760:(t,e,i)=>{i.d(e,{Ec:()=>m,W3:()=>g,mN:()=>b});var o=i(33826);const{is:r,defineProperty:s,getOwnPropertyDescriptor:n,getOwnPropertyNames:a,getOwnPropertySymbols:c,getPrototypeOf:l}=Object,h=globalThis,d=h.trustedTypes,u=d?d.emptyScript:"",p=h.reactiveElementPolyfillSupport,f=(t,e)=>t,g={toAttribute(t,e){switch(e){case Boolean:t=t?u:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>!r(t,e),y={attribute:!0,type:String,converter:g,reflect:!1,hasChanged:m};Symbol.metadata??=Symbol("metadata"),h.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&s(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:r}=n(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return o?.call(this)},set(e){const s=o?.call(this);r.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(f("elementProperties")))return;const t=l(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(f("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(f("properties"))){const t=this.properties,e=[...a(t),...c(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift((0,o.sk)(t))}else void 0!==t&&e.push((0,o.sk)(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return(0,o.Rf)(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(void 0!==o&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:g).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,o=i._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=i.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:g;this._$Em=o,this[o]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??m)(this[t],e))return;this.P(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[f("elementProperties")]=new Map,b[f("finalized")]=new Map,p?.({ReactiveElement:b}),(h.reactiveElementVersions??=[]).push("2.0.4")},33826:(t,e,i)=>{i.d(e,{AH:()=>c,Rf:()=>l,sk:()=>h});const o=globalThis,r=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),n=new WeakMap;class a{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(e,t))}return t}toString(){return this.cssText}}const c=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new a(i,t,s)},l=(t,e)=>{if(r)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),r=o.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=i.cssText,t.appendChild(e)}},h=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,s))(e)})(t):t},34088:(t,e,i)=>{i.d(e,{C:()=>a,D:()=>c,c:()=>g,f:()=>d,g:()=>m,l:()=>u,s:()=>y});var o=i(26031),r=i(46337);const s="calcite-mode-auto",n="calcite-mode-dark",a={autoMode:s,darkMode:n,lightMode:"calcite-mode-light",rtl:"calcite--rtl",calciteAnimate:"calcite-animate",calciteAnimateInUp:"calcite-animate__in-up",calciteAnimateInDown:"calcite-animate__in-down",calciteAnimateInRight:"calcite-animate__in-right",calciteAnimateInLeft:"calcite-animate__in-left"},c={filter:250,nextTick:0,resize:150,reposition:100};function l(){const{classList:t}=document.body,e=window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>t.contains(n)||t.contains(s)&&e?"dark":"light",o=t=>document.body.dispatchEvent(new CustomEvent("calciteModeChange",{bubbles:!0,detail:{mode:t}})),r=t=>{a!==t&&o(t),a=t};let a=i();o(a),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(t=>r(t.matches?"dark":"light"))),new MutationObserver((()=>r(i()))).observe(document.body,{attributes:!0,attributeFilter:["class"]})}const h=globalThis.calciteConfig,d=h?.focusTrapStack||[],u=h?.logLevel||"info",p="3.2.0-next.15";r.S$||("interactive"===document.readyState?l():document.addEventListener("DOMContentLoaded",(()=>l()),{once:!0})),function(){if(h&&h.version)return;console.info(`Using Calcite Components ${p} [Date: 2025-04-16, Revision: dc2a53829]`);const t=h||globalThis.calciteConfig||{};Object.defineProperty(t,"version",{value:p,writable:!1}),globalThis.calciteConfig=t}();const f=(0,o.le)({defaultAssetPath:"https://cdn.jsdelivr.net/npm/@esri/calcite-components@3.2.0-next.15/dist/calcite/",hydratedAttribute:"calcite-hydrated"}),{customElement:g,getAssetPath:m,setAssetPath:y}=f},36752:(t,e,i)=>{i.d(e,{JW:()=>$,XX:()=>V,c0:()=>E,ej:()=>C,ge:()=>F,qy:()=>x,s6:()=>L});const o=globalThis,r=o.trustedTypes,s=r?r.createPolicy("lit-html",{createHTML:t=>t}):void 0,n="$lit$",a=`lit$${Math.random().toFixed(9).slice(2)}$`,c="?"+a,l=`<${c}>`,h=document,d=()=>h.createComment(""),u=t=>null===t||"object"!=typeof t&&"function"!=typeof t,p=Array.isArray,f=t=>p(t)||"function"==typeof t?.[Symbol.iterator],g="[ \t\n\f\r]",m=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,y=/-->/g,b=/>/g,v=RegExp(`>|${g}(?:([^\\s"'>=/]+)(${g}*=${g}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),_=/'/g,w=/"/g,A=/^(?:script|style|textarea|title)$/i,k=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),x=k(1),$=k(2),C=k(3),E=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),S=new WeakMap,O=h.createTreeWalker(h,129);function T(t,e){if(!p(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const U=(t,e)=>{const i=t.length-1,o=[];let r,s=2===e?"<svg>":3===e?"<math>":"",c=m;for(let e=0;e<i;e++){const i=t[e];let h,d,u=-1,p=0;for(;p<i.length&&(c.lastIndex=p,d=c.exec(i),null!==d);)p=c.lastIndex,c===m?"!--"===d[1]?c=y:void 0!==d[1]?c=b:void 0!==d[2]?(A.test(d[2])&&(r=RegExp("</"+d[2],"g")),c=v):void 0!==d[3]&&(c=v):c===v?">"===d[0]?(c=r??m,u=-1):void 0===d[1]?u=-2:(u=c.lastIndex-d[2].length,h=d[1],c=void 0===d[3]?v:'"'===d[3]?w:_):c===w||c===_?c=v:c===y||c===b?c=m:(c=v,r=void 0);const f=c===v&&t[e+1].startsWith("/>")?" ":"";s+=c===m?i+l:u>=0?(o.push(h),i.slice(0,u)+n+i.slice(u)+a+f):i+a+(-2===u?e:f)}return[T(t,s+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]};class P{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,l=0;const h=t.length-1,u=this.parts,[p,f]=U(t,e);if(this.el=P.createElement(p,i),O.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=O.nextNode())&&u.length<h;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(n)){const e=f[l++],i=o.getAttribute(t).split(a),r=/([.?@])?(.*)/.exec(e);u.push({type:1,index:s,name:r[2],strings:i,ctor:"."===r[1]?I:"?"===r[1]?M:"@"===r[1]?N:z}),o.removeAttribute(t)}else t.startsWith(a)&&(u.push({type:6,index:s}),o.removeAttribute(t));if(A.test(o.tagName)){const t=o.textContent.split(a),e=t.length-1;if(e>0){o.textContent=r?r.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],d()),O.nextNode(),u.push({type:2,index:++s});o.append(t[e],d())}}}else if(8===o.nodeType)if(o.data===c)u.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(a,t+1));)u.push({type:7,index:s}),t+=a.length-1}s++}}static createElement(t,e){const i=h.createElement("template");return i.innerHTML=t,i}}function j(t,e,i=t,o){if(e===E)return e;let r=void 0!==o?i._$Co?.[o]:i._$Cl;const s=u(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),void 0===s?r=void 0:(r=new s(t),r._$AT(t,i,o)),void 0!==o?(i._$Co??=[])[o]=r:i._$Cl=r),void 0!==r&&(e=j(t,r._$AS(t,e.values),r,o)),e}class R{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,o=(t?.creationScope??h).importNode(e,!0);O.currentNode=o;let r=O.nextNode(),s=0,n=0,a=i[0];for(;void 0!==a;){if(s===a.index){let e;2===a.type?e=new D(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new W(r,this,t)),this._$AV.push(e),a=i[++n]}s!==a?.index&&(r=O.nextNode(),s++)}return O.currentNode=h,o}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class D{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,o){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=j(this,t,e),u(t)?t===L||null==t||""===t?(this._$AH!==L&&this._$AR(),this._$AH=L):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):f(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==L&&u(this._$AH)?this._$AA.nextSibling.data=t:this.T(h.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=P.createElement(T(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new R(o,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=S.get(t.strings);return void 0===e&&S.set(t.strings,e=new P(t)),e}k(t){p(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const r of t)o===e.length?e.push(i=new D(this.O(d()),this.O(d()),this,this.options)):i=e[o],i._$AI(r),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class z{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,r){this.type=1,this._$AH=L,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=L}_$AI(t,e=this,i,o){const r=this.strings;let s=!1;if(void 0===r)t=j(this,t,e,0),s=!u(t)||t!==this._$AH&&t!==E,s&&(this._$AH=t);else{const o=t;let n,a;for(t=r[0],n=0;n<r.length-1;n++)a=j(this,o[i+n],e,n),a===E&&(a=this._$AH[n]),s||=!u(a)||a!==this._$AH[n],a===L?t=L:t!==L&&(t+=(a??"")+r[n+1]),this._$AH[n]=a}s&&!o&&this.j(t)}j(t){t===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends z{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===L?void 0:t}}class M extends z{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==L)}}class N extends z{constructor(t,e,i,o,r){super(t,e,i,o,r),this.type=5}_$AI(t,e=this){if((t=j(this,t,e,0)??L)===E)return;const i=this._$AH,o=t===L&&i!==L||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==L&&(i===L||o);o&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class W{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){j(this,t)}}const F={M:n,P:a,A:c,C:1,L:U,R,D:f,V:j,I:D,H:z,N:M,U:N,B:I,F:W},H=o.litHtmlPolyfillSupport;H?.(P,D),(o.litHtmlVersions??=[]).push("3.2.1");const V=(t,e,i)=>{const o=i?.renderBefore??e;let r=o._$litPart$;if(void 0===r){const t=i?.renderBefore??null;o._$litPart$=r=new D(e.insertBefore(d(),t),t,void 0,i??{})}return r._$AI(t),r}},37330:(t,e,i)=>{i.d(e,{I:()=>nt});var o=function(){return o=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},o.apply(this,arguments)},r={exports:{}},s={},n={exports:{}},a={};function c(){return{"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1}}var l=/javascript\s*\:/gim;a.whiteList={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1},a.getDefaultWhiteList=c,a.onAttr=function(t,e,i){},a.onIgnoreAttr=function(t,e,i){},a.safeAttrValue=function(t,e){return l.test(e)?"":e};var h=function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},d=function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")},u=a,p=function(t,e){";"!==(t=d(t))[t.length-1]&&(t+=";");var i=t.length,o=!1,r=0,s=0,n="";function a(){if(!o){var i=h(t.slice(r,s)),a=i.indexOf(":");if(-1!==a){var c=h(i.slice(0,a)),l=h(i.slice(a+1));if(c){var d=e(r,n.length,c,l,i);d&&(n+=d+"; ")}}}r=s+1}for(;s<i;s++){var c=t[s];if("/"===c&&"*"===t[s+1]){var l=t.indexOf("*/",s+2);if(-1===l)break;r=(s=l+1)+1,o=!1}else"("===c?o=!0:")"===c?o=!1:";"===c?o||a():"\n"===c&&a()}return h(n)};function f(t){return null==t}function g(t){(t=function(t){var e={};for(var i in t)e[i]=t[i];return e}(t||{})).whiteList=t.whiteList||u.whiteList,t.onAttr=t.onAttr||u.onAttr,t.onIgnoreAttr=t.onIgnoreAttr||u.onIgnoreAttr,t.safeAttrValue=t.safeAttrValue||u.safeAttrValue,this.options=t}g.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,i=e.whiteList,o=e.onAttr,r=e.onIgnoreAttr,s=e.safeAttrValue;return p(t,(function(t,e,n,a,c){var l=i[n],h=!1;if(!0===l?h=l:"function"==typeof l?h=l(a):l instanceof RegExp&&(h=l.test(a)),!0!==h&&(h=!1),a=s(n,a)){var d,u={position:e,sourcePosition:t,source:c,isWhite:h};return h?f(d=o(n,a,u))?n+":"+a:d:f(d=r(n,a,u))?void 0:d}}))};var m=g;!function(t,e){var i=a,o=m;for(var r in(e=t.exports=function(t,e){return new o(e).process(t)}).FilterCSS=o,i)e[r]=i[r]}(n,n.exports);var y=n.exports,b={indexOf:function(t,e){var i,o;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,o=t.length;i<o;i++)if(t[i]===e)return i;return-1},forEach:function(t,e,i){var o,r;if(Array.prototype.forEach)return t.forEach(e,i);for(o=0,r=t.length;o<r;o++)e.call(i,t[o],o,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var e=/\s|\n|\t/.exec(t);return e?e.index:-1}},v=y.FilterCSS,_=y.getDefaultWhiteList,w=b;var A=new v;function k(t){return t.replace(x,"&lt;").replace($,"&gt;")}var x=/</g,$=/>/g,C=/"/g,E=/&quot;/g,L=/&#([a-zA-Z0-9]*);?/gim,S=/&colon;?/gim,O=/&newline;?/gim,T=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,U=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,P=/u\s*r\s*l\s*\(.*/gi;function j(t){return t.replace(C,"&quot;")}function R(t){return t.replace(E,'"')}function D(t){return t.replace(L,(function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))}))}function z(t){return t.replace(S,":").replace(O," ")}function I(t){for(var e="",i=0,o=t.length;i<o;i++)e+=t.charCodeAt(i)<32?" ":t.charAt(i);return w.trim(e)}function M(t){return I(t=z(t=D(t=R(t))))}function N(t){return k(t=j(t))}s.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},s.getDefaultWhiteList=function(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}},s.onTag=function(t,e,i){},s.onIgnoreTag=function(t,e,i){},s.onTagAttr=function(t,e,i){},s.onIgnoreTagAttr=function(t,e,i){},s.safeAttrValue=function(t,e,i,o){if(i=M(i),"href"===e||"src"===e){if("#"===(i=w.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===e){if(T.lastIndex=0,T.test(i))return""}else if("style"===e){if(U.lastIndex=0,U.test(i))return"";if(P.lastIndex=0,P.test(i)&&(T.lastIndex=0,T.test(i)))return"";!1!==o&&(i=(o=o||A).process(i))}return N(i)},s.escapeHtml=k,s.escapeQuote=j,s.unescapeQuote=R,s.escapeHtmlEntities=D,s.escapeDangerHtml5Entities=z,s.clearNonPrintableCharacter=I,s.friendlyAttrValue=M,s.escapeAttrValue=N,s.onIgnoreTagStripAll=function(){return""},s.StripTagBody=function(t,e){"function"!=typeof e&&(e=function(){});var i=!Array.isArray(t),o=[],r=!1;return{onIgnoreTag:function(s,n,a){if(function(e){return!!i||-1!==w.indexOf(t,e)}(s)){if(a.isClosing){var c=a.position+10;return o.push([!1!==r?r:a.position,c]),r=!1,"[/removed]"}return r||(r=a.position),"[removed]"}return e(s,n,a)},remove:function(t){var e="",i=0;return w.forEach(o,(function(o){e+=t.slice(i,o[0]),i=o[1]})),e+=t.slice(i)}}},s.stripCommentTag=function(t){for(var e="",i=0;i<t.length;){var o=t.indexOf("\x3c!--",i);if(-1===o){e+=t.slice(i);break}e+=t.slice(i,o);var r=t.indexOf("--\x3e",o);if(-1===r)break;i=r+3}return e},s.stripBlankChar=function(t){var e=t.split("");return(e=e.filter((function(t){var e=t.charCodeAt(0);return!(127===e||e<=31&&10!==e&&13!==e)}))).join("")},s.cssFilter=A,s.getDefaultCSSWhiteList=_;var W={},F=b;function H(t){var e,i=F.spaceIndex(t);return e=-1===i?t.slice(1,-1):t.slice(1,i+1),"/"===(e=F.trim(e).toLowerCase()).slice(0,1)&&(e=e.slice(1)),"/"===e.slice(-1)&&(e=e.slice(0,-1)),e}function V(t){return"</"===t.slice(0,2)}var q=/[^a-zA-Z0-9\\_:.-]/gim;function B(t,e){for(;e<t.length;e++){var i=t[e];if(" "!==i)return"="===i?e:-1}}function Y(t,e){for(;e<t.length;e++){var i=t[e];if(" "!==i)return"'"===i||'"'===i?e:-1}}function X(t,e){for(;e>0;e--){var i=t[e];if(" "!==i)return"="===i?e:-1}}function Z(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}W.parseTag=function(t,e,i){var o="",r=0,s=!1,n=!1,a=0,c=t.length,l="",h="";t:for(a=0;a<c;a++){var d=t.charAt(a);if(!1===s){if("<"===d){s=a;continue}}else if(!1===n){if("<"===d){o+=i(t.slice(r,a)),s=a,r=a;continue}if(">"===d){o+=i(t.slice(r,s)),l=H(h=t.slice(s,a+1)),o+=e(s,o.length,l,h,V(h)),r=a+1,s=!1;continue}if('"'===d||"'"===d)for(var u=1,p=t.charAt(a-u);""===p.trim()||"="===p;){if("="===p){n=d;continue t}p=t.charAt(a-++u)}}else if(d===n){n=!1;continue}}return r<t.length&&(o+=i(t.substr(r))),o},W.parseAttr=function(t,e){var i=0,o=0,r=[],s=!1,n=t.length;function a(t,i){if(!((t=(t=F.trim(t)).replace(q,"").toLowerCase()).length<1)){var o=e(t,i||"");o&&r.push(o)}}for(var c=0;c<n;c++){var l,h=t.charAt(c);if(!1!==s||"="!==h)if(!1===s||c!==o){if(/\s|\n|\t/.test(h)){if(t=t.replace(/\s|\n|\t/g," "),!1===s){if(-1===(l=B(t,c))){a(F.trim(t.slice(i,c))),s=!1,i=c+1;continue}c=l-1;continue}if(-1===(l=X(t,c-1))){a(s,Z(F.trim(t.slice(i,c)))),s=!1,i=c+1;continue}}}else{if(-1===(l=t.indexOf(h,c+1)))break;a(s,F.trim(t.slice(o+1,l))),s=!1,i=(c=l)+1}else s=t.slice(i,c),i=c+1,o='"'===t.charAt(i)||"'"===t.charAt(i)?i:Y(t,c+1)}return i<t.length&&(!1===s?a(t.slice(i)):a(s,Z(F.trim(t.slice(i))))),F.trim(r.join(" "))};var G=y.FilterCSS,K=s,J=W,Q=J.parseTag,tt=J.parseAttr,et=b;function it(t){return null==t}function ot(t){(t=function(t){var e={};for(var i in t)e[i]=t[i];return e}(t||{})).stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=K.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i.toLowerCase()]=t[i].map((function(t){return t.toLowerCase()})):e[i.toLowerCase()]=t[i];return e}(t.whiteList||t.allowList):t.whiteList=K.whiteList,t.onTag=t.onTag||K.onTag,t.onTagAttr=t.onTagAttr||K.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||K.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||K.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||K.safeAttrValue,t.escapeHtml=t.escapeHtml||K.escapeHtml,this.options=t,!1===t.css?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new G(t.css))}ot.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,i=e.whiteList,o=e.onTag,r=e.onIgnoreTag,s=e.onTagAttr,n=e.onIgnoreTagAttr,a=e.safeAttrValue,c=e.escapeHtml,l=this.cssFilter;e.stripBlankChar&&(t=K.stripBlankChar(t)),e.allowCommentTag||(t=K.stripCommentTag(t));var h=!1;e.stripIgnoreTagBody&&(h=K.StripTagBody(e.stripIgnoreTagBody,r),r=h.onIgnoreTag);var d=Q(t,(function(t,e,h,d,u){var p={sourcePosition:t,position:e,isClosing:u,isWhite:Object.prototype.hasOwnProperty.call(i,h)},f=o(h,d,p);if(!it(f))return f;if(p.isWhite){if(p.isClosing)return"</"+h+">";var g=function(t){var e=et.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var i="/"===(t=et.trim(t.slice(e+1,-1)))[t.length-1];return i&&(t=et.trim(t.slice(0,-1))),{html:t,closing:i}}(d),m=i[h],y=tt(g.html,(function(t,e){var i=-1!==et.indexOf(m,t),o=s(h,t,e,i);return it(o)?i?(e=a(h,t,e,l))?t+'="'+e+'"':t:it(o=n(h,t,e,i))?void 0:o:o}));return d="<"+h,y&&(d+=" "+y),g.closing&&(d+=" /"),d+">"}return it(f=r(h,d,p))?c(d):f}),c);return h&&(d=h.remove(d)),d};var rt=ot;!function(t,e){var i=s,o=W,r=rt;function n(t,e){return new r(e).process(t)}(e=t.exports=n).filterXSS=n,e.FilterXSS=r,function(){for(var t in i)e[t]=i[t];for(var r in o)e[r]=o[r]}(),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)}(r,r.exports);var st=r.exports,nt=function(){function t(t,e){var i,r=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],article:["style"],aside:["style"],audio:["autoplay","controls","loop","muted","preload"],b:[],blockquote:["style"],br:[],code:["style"],dd:["style"],del:["style"],details:["open","style"],div:["align","aria-hidden","aria-label","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],footer:["style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],header:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],main:["style"],mark:["style"],nav:["style"],ol:[],p:["style"],pre:["style"],section:["style"],source:["media","src","type"],span:["aria-hidden","aria-label","style"],strong:[],sub:["style"],summary:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],time:["style"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.arcgisCSSWhiteList=o(o({},st.getDefaultCSSWhiteList()),{"align-items":!0,"align-self":!0,flex:!0,"flex-basis":!0,"flex-direction":!0,"flex-flow":!0,"flex-grow":!0,"flex-shrink":!0,"flex-wrap":!0,float:!0,gap:!0,grid:!0,"grid-area":!0,"grid-auto-columns":!0,"grid-auto-flow":!0,"grid-auto-rows":!0,"grid-column":!0,"grid-column-end":!0,"grid-column-start":!0,"grid-row":!0,"grid-row-end":!0,"grid-row-start":!0,"grid-template":!0,"grid-template-areas":!0,"grid-template-columns":!0,"grid-template-rows":!0,"justify-content":!0,"justify-items":!0,"justify-self":!0,"line-height":!0,overflow:!0}),this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(t,e,i,o){return"a"===t&&"href"===e||("img"===t||"source"===t)&&"src"===e?r.sanitizeUrl(i):st.safeAttrValue(t,e,i,o)}},this._entityMap={"&":"&#x38;","<":"&#x3C;",">":"&#x3E;",'"':"&#x22;","'":"&#x27;","/":"&#x2F;"},t&&!e?i=t:t&&e?((i=Object.create(this.arcgisFilterOptions)).css={whiteList:this.arcgisCSSWhiteList},Object.keys(t).forEach((function(e){if("whiteList"===e)i.whiteList=r._extendObjectOfArrays([r.arcgisWhiteList,t.whiteList||{}]);else if("css"===e){var o=t.css.whiteList;null!=o&&t.css instanceof Object&&Object.keys(o).forEach((function(t){return i.css.whiteList[t]=o[t]}))}else i[e]=t[e]}))):((i=Object.create(this.arcgisFilterOptions)).whiteList=this.arcgisWhiteList,i.css={whiteList:this.arcgisCSSWhiteList}),this.xssFilterOptions=i,this._xssFilter=new st.FilterXSS(i)}return t.prototype.sanitize=function(t,e){switch(void 0===e&&(e={}),typeof t){case"number":return isNaN(t)||!isFinite(t)?null:t;case"boolean":return t;case"string":return this._xssFilter.process(t);case"object":return this._iterateOverObject(t,e);default:if(e.allowUndefined&&void 0===t)return;return null}},t.prototype.sanitizeUrl=function(t,e){var i=(null!=e?e:{}).isProtocolRequired,o=void 0===i||i,r=this._trim(t.substring(0,t.indexOf(":"))),s="/"===t,n=/^#/.test(t),a=r&&this.allowedProtocols.indexOf(r.toLowerCase())>-1;return s||n||a?st.escapeAttrValue(t):r||o?"":st.escapeAttrValue("https://".concat(t))},t.prototype.sanitizeHTMLAttribute=function(t,e,i,o){return"function"==typeof this.xssFilterOptions.safeAttrValue?this.xssFilterOptions.safeAttrValue(t,e,i,o):st.safeAttrValue(t,e,i,o)},t.prototype.validate=function(t,e){void 0===e&&(e={});var i=this.sanitize(t,e);return{isValid:t===i,sanitized:i}},t.prototype.encodeHTML=function(t){var e=this;return String(t).replace(/[&<>"'\/]/g,(function(t){return e._entityMap[t]}))},t.prototype.encodeAttrValue=function(t){var e=/^[a-zA-Z0-9]$/;return String(t).replace(/[\x00-\xFF]/g,(function(i,o){return e.test(i)?i:"&#x".concat(Number(t.charCodeAt(o)).toString(16),";")}))},t.prototype._extendObjectOfArrays=function(t){var e={};return t.forEach((function(t){Object.keys(t).forEach((function(i){Array.isArray(t[i])&&Array.isArray(e[i])?e[i]=e[i].concat(t[i]):e[i]=t[i]}))})),e},t.prototype._iterateOverObject=function(t,e){var i=this;void 0===e&&(e={});try{var o=!1,r=void 0;if(Array.isArray(t))r=t.reduce((function(t,r){var s=i.validate(r,e);return s.isValid?t.concat([r]):(o=!0,t.concat([s.sanitized]))}),[]);else{if(!function(t){if("object"!=typeof t||null===t)return!1;if("[object Object]"!==Object.prototype.toString.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t)){if(e.allowUndefined&&void 0===t)return;return null}r=Object.keys(t).reduce((function(r,s){var n=t[s],a=i.validate(n,e);return a.isValid?r[s]=n:(o=!0,r[s]=a.sanitized),r}),{})}return o?r:t}catch(t){return null}},t.prototype._trim=function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},t}()},46337:(t,e,i)=>{i.d(e,{WF:()=>s,qy:()=>r.qy,S$:()=>a,s6:()=>r.s6,JW:()=>r.JW});var o=i(28760),r=i(36752);class s extends o.mN{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=(0,r.XX)(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return r.c0}}s._$litElement$=!0,s.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const n=globalThis.litElementPolyfillSupport;n?.({LitElement:s}),(globalThis.litElementVersions??=[]).push("4.1.1");const a=!1},56328:(t,e,i)=>{i.d(e,{V:()=>n});var o=i(36752),r=i(7804),s=i(18504);const n=(0,r.u$)(class extends r.WL{constructor(t){if(super(t),t.type!==r.OA.PROPERTY&&t.type!==r.OA.ATTRIBUTE&&t.type!==r.OA.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!(0,s.Rt)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===o.c0||e===o.s6)return e;const i=t.element,n=t.name;if(t.type===r.OA.PROPERTY){if(e===i[n])return o.c0}else if(t.type===r.OA.BOOLEAN_ATTRIBUTE){if(!!e===i.hasAttribute(n))return o.c0}else if(t.type===r.OA.ATTRIBUTE&&i.getAttribute(n)===e+"")return o.c0;return(0,s.mY)(t),e}})},90286:(t,e,i)=>{i.d(e,{hq:()=>x,aK:()=>V,yr:()=>X,Gk:()=>a,Nh:()=>O,lr:()=>T,oW:()=>B});var o,r=i(98015),s=Symbol.for("controller");function n(t){o!==t&&(o=t,queueMicrotask((()=>{o===t&&(o=void 0)})))}function a(t){return o}var c,l=[];function h(t){if(void 0===t)return void(l=[]);const e=l.indexOf(t);l=-1===e?[...l,t]:l.slice(0,e+1),queueMicrotask((()=>{l=[]}))}function d(){return l}var u,p=async(t,e)=>{const i=g(t);if(void 0===i)return t;if(await i.ready,"function"==typeof e){const t=i.watchExports((i=>e(i,t)))}return i.exports},f=async t=>{const e=g(t);return await e.ready,e},g=t=>{const e=a().manager.internals.resolveExports(t);if(void 0!==e)return e;if((t=>"object"==typeof t&&null!==t&&(s in t||"hostConnected"in t||"hostDisconnected"in t||"hostUpdate"in t||"hostUpdated"in t))(t))return t;const i=function(){const t=c;return c=void 0,t}();return void 0!==i?i:void 0},m={setter:!1,getter:!1,readOnly:!1},y=new WeakMap;u=s;var b=class{constructor(t){this._callbacks={hostConnected:[],hostDisconnected:[],hostLoad:[],hostLoaded:[],hostUpdate:[],hostUpdated:[],hostDestroy:[],hostLifecycle:[]},this._ready=new r.cY,this._lifecycleCleanups=[],this.connectedCalled=!1,this._loadCalled=!1,this.loadedCalled=!1,this[u]=!0,this.ready=this._ready.promise,this._exports=w(this),this._exportWatchers=new Set;const e=t??a(new.target.name);this.component=e,this.component.addController(this),void 0===this.component.manager||(h(this),queueMicrotask((()=>this.catchUpLifecycle())))}catchUpLifecycle(){const{manager:t}=this.component;!t.connectedCalled||this.connectedCalled||this.triggerConnected(),!t._loadCalled||this.triggerLoad().then((()=>{!t.loadedCalled||this.triggerLoaded()})).catch(console.error)}get exports(){return this._exports}set exports(t){const e=this._exports;e!==t&&(this._exports=t,this._exportWatchers.forEach(r.UF),this.connectedCalled&&!1!==this.assignedProperty&&this.component.requestUpdate(this.assignedProperty,e)),this._ready.resolve(t)}setProvisionalExports(t,e=!0){this._exports=e?w(t):t,this._exportWatchers.forEach(r.UF)}watchExports(t){const e=()=>t(this._exports);return this._exportWatchers.add(e),()=>{this._exportWatchers.delete(e)}}get use(){return n(this.component),p}get useRef(){return n(this.component),f}get useRefSync(){return n(this.component),g}controllerRemoved(){this.component.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this._callbacks.hostConnected.push(t)}onDisconnected(t){this._callbacks.hostDisconnected.push(t)}onLoad(t){this._callbacks.hostLoad.push(t)}onLoaded(t){this._callbacks.hostLoaded.push(t)}onUpdate(t){this._callbacks.hostUpdate.push(t)}onUpdated(t){this._callbacks.hostUpdated.push(t)}onDestroy(t){this._callbacks.hostDestroy.push(t)}onLifecycle(t){this._callbacks.hostLifecycle.push(t),this.connectedCalled&&this.component.el.isConnected&&this._callLifecycle(t)}triggerConnected(){const t=this;t.hostConnected&&(0,r.UF)(t.hostConnected,t),this._callbacks.hostConnected.forEach(r.UF),this.triggerLifecycle(),this.connectedCalled=!0}triggerDisconnected(){const t=this;t.hostDisconnected&&(0,r.UF)(t.hostDisconnected,t),this._callbacks.hostDisconnected.forEach(r.UF),this._lifecycleCleanups.forEach(r.UF),this._lifecycleCleanups=[]}async triggerLoad(){if(this._loadCalled)return;this._loadCalled=!0;const t=this;t.hostLoad&&await(0,r.ao)(t.hostLoad,t),this._callbacks.hostLoad.length>0&&await Promise.allSettled(this._callbacks.hostLoad.map(r.ao)),this._ready.resolve(this._exports)}triggerLoaded(){if(this.loadedCalled)return;const t=this;t.hostLoaded&&(0,r.UF)(t.hostLoaded,t),this._callbacks.hostLoaded.forEach(r.UF),this.loadedCalled=!0}triggerUpdate(t){const e=this;e.hostUpdate&&(0,r.UF)(e.hostUpdate,e,t),this._callbacks.hostUpdate.forEach(v,t)}triggerUpdated(t){const e=this;e.hostUpdated&&(0,r.UF)(e.hostUpdated,e,t),this._callbacks.hostUpdated.forEach(v,t)}triggerDestroy(){const t=this;t.hostDestroy&&(0,r.UF)(t.hostDestroy,t),this._callbacks.hostDestroy.forEach(r.UF)}triggerLifecycle(){const t=this;t.hostLifecycle&&this._callLifecycle((()=>t.hostLifecycle())),this._callbacks.hostLifecycle.forEach(this._callLifecycle,this)}_callLifecycle(t){n(this.component);const e=(0,r.UF)(t);(Array.isArray(e)?e:[e]).forEach((t=>{"function"==typeof t?this._lifecycleCleanups.push(t):"object"==typeof t&&"function"==typeof t.remove&&this._lifecycleCleanups.push(t.remove)}))}};function v(t){(0,r.UF)(t,void 0,this)}var _=b;function w(t){if("object"!=typeof t&&"function"!=typeof t||null===t)return t;const e=new Proxy(t,{get(t,i,o){if(!A.has(i)||!(i in t)||t[i]!==e)return i in t||i in Promise.prototype||"symbol"==typeof i?"function"==typeof t?t[i]:Reflect.get(t,i,o):void 0},set:(t,e,i,o)=>Reflect.set(t,e,i,o)});return e}var A=new Set(["exports","_exports"]),k=void 0;function x(){Array.from(k?.entries()??[]).forEach((([t,{callbacks:e}])=>{const i=Object.keys(t);e.forEach((t=>t(i)))})),k=void 0}function $(t,e,i){var o;const s=e,n=t.manager.internals;(o=n.allWatchers)[s]??(o[s]=[]);const a=n.allWatchers[s],c=i,l=(t,e,i)=>(0,r.UF)(c,null,t,e,i);return a.push(l),()=>{const t=a.indexOf(l);-1!==t&&a.splice(t,1)}}var C=class{constructor(t){this.enabledWatchers={},this.allWatchers={},this.enableReadonly=()=>{if(this.enableReadonly=void 0,!this.component.manager.isLit)return;const t=this.component.manager.internals;Object.entries(t.members).forEach((([e,[i]])=>{var o;2048&i&&((o=t.setters)[e]??(o[e]=[]),t.setters[e].push(t.readonlySetter))}))},this.trackedValue=S,this.keyTrackers=[],this.getters={},this.setters={},this.accessorGetter={},this.accessorSetter={},this._exports=new WeakMap,this.readonlySetter=(t,e,i)=>{if(m.readOnly)return t;throw new Error(`Cannot assign to read-only property "${i}" of ${this.component.el.tagName.toLowerCase()}. Trying to assign "${String(t)}"`)},this.component=t}firePropTrackers(t,e){const i=this.keyTrackers;this.trackedValue=S,this.keyTrackers=[],i.forEach((i=>i(t,e)))}getSetProxy(t){const e=this.component,i=e.constructor.prototype;if(this._getSetProxy(i,t,"class"),e.manager.isLit)return;const o=e.el.constructor.prototype;i!==o&&this._getSetProxy(o,t,"html")}_getSetProxy(t,e,i){const o=(r=this.component,s=e,r.manager.internals.members?.[s]?.[0]);var r,s;let n;do{n=Object.getOwnPropertyDescriptor(t,e)}while(!n&&(t=Object.getPrototypeOf(t)));if(!n)return;const a=n.get,c=n.set,l=L in a,h=L in c;if(l&&h)return;const d=!l,u=!h,p=d?function(){let t=a.call(this);const i=y.get(this);if(m.getter||void 0===i)return t;const o=i.manager.internals;t=o.accessorGetter[e](t,e);const r=o.getters[e]??E;for(let i=0;i<r.length;i++)t=r[i](t,e);return t}:a,f=u?function(t){const i=a.call(this),r=y.get(this);if(void 0===r)return void c.call(this,t);let s=r.manager.isLit?t??void 0:function(t,e=8){return null==t||"object"==typeof t||"function"==typeof t?t:4&e?"false"!==t&&(""===t||!!t):2&e?Number.parseFloat(t):1&e?String(t):t}(t,o);const n=r.manager.internals;if(s===i)c.call(this,s);else{const t=m.setter?E:n.setters[e]??E;for(let o=0;o<t.length&&(s=t[o](s,i,e),s!==i);o++);s=n.accessorSetter[e](s,i,e),c.call(this,s),s!==i&&n.enabledWatchers[e]?.forEach((t=>t(s,i,e)))}n.keyTrackers.length>0&&n?.firePropTrackers(e,t)}:c;d&&(p[L]=!0),u&&(f[L]=!0),Object.defineProperty(t,e,{...n,get:p,set:f})}markExports(t,e){("object"==typeof e&&null!==e||"function"==typeof e)&&this._exports.set(e,t)}resolveExports(t){return"object"==typeof t&&null!==t||"function"==typeof t?this._exports.get(t):void 0}},E=[],L=Symbol(),S=Symbol();function O(t=[a(),...d()],e,i){const o=Array.isArray(t)?t:[t];let s=o.length+1;const n=t=>{s-=1,void 0!==t&&(s=Math.min(s,0)),0===s&&e(t)};o.forEach((t=>function(t,e,i){const o=Object.keys(t),s=o.length;void 0===k&&queueMicrotask(x),k??(k=new Map);let n=k.get(t);return void 0===n&&(n={callbacks:[],keyCount:s},k.set(t,n)),n.keyCount!==s&&(n.callbacks.forEach((t=>t(o))),n.callbacks=[],n.keyCount=s),n.callbacks.push((o=>{const n=t=>(0,r.UF)(e,null,t),a=o[s];void 0===a?n(void 0):t[a]===i?n(a):n(void 0)})),i}(t,(e=>n(void 0===e?void 0:{key:e,host:t,isReactive:!1})),i)));const c=o.find((t=>"manager"in t&&"object"==typeof t.manager&&t.manager.component===t));return c&&function(t,e,i){const o=t.manager.internals;o.trackedValue!==S&&o.trackedValue!==i&&o.firePropTrackers(void 0,void 0),0===o.keyTrackers.length&&queueMicrotask((()=>o.firePropTrackers(void 0,void 0))),o.trackedValue=i,o.keyTrackers.push(((t,o)=>(0,r.UF)(e,void 0,i===o?t:void 0)))}(c,(t=>n(void 0===t?void 0:{key:t,host:c,isReactive:!0})),i),i}var T=(t,e)=>new U(t,e),U=class extends _{constructor(t,e){const i="addController"in t,o=new Set,a=t;if(a.addController=function(e){o.add(e),!(s in e)&&t.renderRoot&&t.el.isConnected&&e.hostConnected?.()},a.removeController=function(t){o.delete(t),t.controllerRemoved?.()},!i){const i=e??t.constructor.__forceUpdate;a.requestUpdate=()=>i(t)}super(t),this.internals=new C(this.component),this.destroyed=!1,this._updatePromise=new r.cY,this._originalLifecycles={},this.isLit=i,this.component.manager=this,function(t,e){if(e){const e=t.constructor.elementProperties;t.manager.internals.members=Object.fromEntries(Array.from(e,(([t,e])=>e.noAccessor?void 0:[t,[(e.readOnly?2048:0)|(e.state?32:16)]])).filter(r.EA))}else{const e=t.constructor,i=e.__registerControllers?.(t)??void 0;if(e.__registerControllers=void 0,"object"!=typeof i)throw new Error("Failed to retrieve component meta");t.manager.internals.members=Object.fromEntries(Object.entries(i).filter((([t,[e]])=>!!(63&e))))}}(t,i),this._controllers=o,this.exports=void 0,this.hasDestroy=P in this.component&&"function"==typeof this.component.destroy,this._bindLifecycleMethods();const c=this.internals;Object.keys(c.members).forEach((t=>{c.accessorGetter[t]=R,c.accessorSetter[t]=R,c.getSetProxy(t)})),i?this.internals.enabledWatchers=this.internals.allWatchers:Object.defineProperty(t,"updateComplete",{get:async()=>await this._updatePromise.promise}),queueMicrotask(c.enableReadonly),n(t),y.set(t.el,t),y.set(t,t)}_bindLifecycleMethods(){const t=this.component,e=this.isLit,i=t.el===t;this._originalLifecycles={_connectedCallback:e||i?void 0:t.connectedCallback,_disconnectedCallback:e||i?void 0:t.disconnectedCallback,_load:e?t.load:t.componentWillLoad,_loaded:e?t.loaded:t.componentDidLoad,_willUpdate:e?void 0:t.componentWillUpdate,_updated:e?void 0:t.componentDidUpdate,_destroy:t.destroy};const o=this._connectedCallback.bind(this),r=this._disconnectedCallback.bind(this),s=this._update.bind(this),n=this._updated.bind(this);e?t.constructor.prototype.addController.call(t,{hostConnected:o,hostDisconnected:r,hostUpdate:s,hostUpdated:n}):(t.connectedCallback=o,t.disconnectedCallback=r,t.componentWillLoad=this._load.bind(this),t.componentDidLoad=this._loaded.bind(this),t.componentWillUpdate=s,t.componentDidUpdate=n),this.hasDestroy&&(t.destroy=this.destroy.bind(this))}_connectedCallback(){if(this.destroyed){const t=this.component.el.tagName.toLowerCase();throw this.component.el.remove(),new Error(`The ${t} component has already been destroyed. It cannot be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${P} prop.`)}void 0!==this._autoDestroyTimeout&&clearTimeout(this._autoDestroyTimeout);const t=this.internals;t.enabledWatchers=t.allWatchers,x(),t.enableReadonly?.(),this._controllers.forEach(D),this._originalLifecycles._connectedCallback?.call(this.component)}_disconnectedCallback(){this.destroyed||(this._controllers.forEach(z),this._originalLifecycles._disconnectedCallback?.call(this.component),this.hasDestroy&&this._setAutoDestroyTimeout())}async _load(){await Promise.allSettled(Array.from(this._controllers,I)),await(this._originalLifecycles._load?.call(this.component)),this.hasDestroy&&$(this.component,P,(()=>this._setAutoDestroyTimeout()))}_loaded(){this._controllers.forEach(M),this._originalLifecycles._loaded?.call(this.component)}_update(){const t=this.component;return this._controllers.forEach(N,t.$changes),this._originalLifecycles._willUpdate?.call(this.component)}_updated(){const t=this.component;if(this._controllers.forEach(W,t.$changes),this._originalLifecycles._updated?.call(this.component),this.isLit)t.$changes=new Map;else{const t=this._updatePromise;this._updatePromise=new r.cY,t.resolve(!0)}}async destroy(){if(!this.destroyed){if(this.component.el.isConnected){this.hasDestroy=!1;try{this.component.el.remove()}finally{this.hasDestroy=!0}}this._autoDestroyTimeout=void 0,this.destroyed=!0,this._controllers.forEach(F),this._controllers.clear(),await(this._originalLifecycles._destroy?.call(this.component))}}_setAutoDestroyTimeout(){if(void 0!==this._autoDestroyTimeout&&clearTimeout(this._autoDestroyTimeout),!this.component.el.isConnected&&!this.component.autoDestroyDisabled){const t=()=>{this.destroy().catch(console.error)};this._autoDestroyTimeout=(0,r.oK)(t,j)}}},P="autoDestroyDisabled",j=1e3,R=t=>t;function D(t){"triggerConnected"in t?t.triggerConnected():(0,r.UF)(t.hostConnected,t)}function z(t){"triggerDisconnected"in t?t.triggerDisconnected():(0,r.UF)(t.hostDisconnected,t)}async function I(t){"triggerLoad"in t?await t.triggerLoad():await(0,r.ao)(t.hostLoad,t)}function M(t){"triggerLoaded"in t?t.triggerLoaded():(0,r.UF)(t.hostLoaded,t)}function N(t){"triggerUpdate"in t?t.triggerUpdate(this):(0,r.UF)(t.hostUpdate,t,this)}function W(t){"triggerUpdated"in t?t.triggerUpdated(this):(0,r.UF)(t.hostUpdated,t,this)}function F(t){"triggerDestroy"in t?t.triggerDestroy():(0,r.UF)(t.hostDestroy,t)}var H,V=t=>e=>q(e,t),q=(H=class extends b{constructor(t,e){super(t);const i=this.exports;try{n(this.component);const t=e(this.component,this),o=this.exports!==i;if(t instanceof Promise){o||this.setProvisionalExports(t);const e=t.then((t=>{this.exports=t,super.catchUpLifecycle()})).catch((t=>{this._ready.reject(t),console.error(t)}));this.onLoad((async()=>await e))}else o&&void 0===t||(this.exports=t),queueMicrotask((()=>super.catchUpLifecycle()))}catch(t){this._ready.reject(t),console.error(t)}}catchUpLifecycle(){}},(...t)=>{const e=d(),i=new H(...t),o=i.exports;h(e.at(-1));const r=i.component.manager.internals;var s;return r.markExports(i,o),i.watchExports((t=>r.markExports(i,t))),c!==(s=i)&&(c=s,queueMicrotask((()=>{c===s&&(c=void 0)}))),O([i.component,...e].reverse(),(t=>void 0===t?void 0:function(t,{host:e,key:i,isReactive:o},r){const s=e,n=s[i]!==t.exports,a=s[i]!==r,c=r!==t.exports;n&&!a&&c&&(s[i]=t.exports);if(e===t.component){if(o){const e=t.component.manager.internals;a&&e.markExports(t,s[i]),$(t.component,i,(i=>{i!==t.exports&&e.markExports(t,i)}))}t.assignedProperty=o?void 0:i}t.watchExports((()=>{if(s[i]===t.exports)return;const e=t.component.manager,o=e.internals.setters[i]?.includes(e.internals.readonlySetter);o?function(){m.readOnly=!0;try{return void(s[i]=t.exports)}finally{m.readOnly=!1}}():s[i]=t.exports}))}(i,t,o)),o)}),B=(t,e)=>new Y(t,e),Y=class extends b{constructor(t,e){super(),this._attributes=t,this._callback=e,this._observer=new MutationObserver((i=>{i.forEach((i=>{t.includes(i.attributeName)&&e.call(this.component,this.component.el.getAttribute(i.attributeName),i.oldValue,i.attributeName)}))}))}hostConnected(){this._attributes.forEach((t=>{this.component.el.hasAttribute(t)&&this._callback.call(this.component,null,this.component.el.getAttribute(t),t)})),this._observer.observe(this.component.el,{attributes:!0,attributeOldValue:!0,attributeFilter:this._attributes})}hostDisconnected(){this._observer.disconnect()}},X=t=>(e={})=>q(void 0,((i,o)=>{const s=(0,r.kn)(i.el),n={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},a=i;function c(t){const e=o.exports,i=e._original??e,r=Z(i,t);t&&(r._original=i),o.exports=r}return o.onLifecycle((()=>(0,r.hd)(i.el,(()=>t("./assets")),(({t9nLocale:t,t9nStrings:e,lang:r})=>{const s={...e,_lang:r,_t9nLocale:t,_loading:!1};o.exports=s;const n=e.componentLabel;"string"==typeof n&&"label"in i&&null==i.label&&(i.label??(i.label=n)),c(a.messageOverrides)}),e.name))),"messageOverrides"in a&&o.onLifecycle((()=>$(a,"messageOverrides",c))),e.blocking?(o.setProvisionalExports(n,!1),o.ready):n}));function Z(t,e){if(!e)return t;const i={...t};return Object.entries(e).forEach((([e,o])=>{i[e]="object"==typeof o?Z(t[e],o):o??t[e]})),i}},98015:(t,e,i)=>{i.d(e,{EA:()=>k,UF:()=>n,ao:()=>a,cY:()=>o,hd:()=>m,j1:()=>y,kn:()=>f,oK:()=>v});var o=class{resolve(t){}reject(t){}constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}};var r={};function s(t,e,i){const o=function(t,e){let i=t;for(;i;){const t=i.closest?.(e);if(t)return t;const o=i.getRootNode?.();if(o===globalThis.document)return null;i=o.host}return null}(t,`[${e}]`);return o?.getAttribute(e)??i}function n(t,e,...i){try{return t?.call(e,...i)}catch(e){console.error(e,t)}}async function a(t,e,...i){try{const o=t?.call(e,...i);return o instanceof Promise?await o:o}catch(e){console.error(e,t)}}var c=new Set(["ar","bg","bs","ca","cs","da","de","el","en","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nl","nb","no","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"]),l="en",h={pt:"pt-PT",nb:"no",zh:"zh-CN"};async function d(t,e,i=""){const o=`${e}/${i}`,r=`${o}${t}.json`;return u[r]??(u[r]=p(t,o)),await u[r]}var u={};async function p(t,e){const i=`${e}${t}.json`;try{const t=await fetch(i);if(t.ok)return await t.json()}catch(t){return console.error(t),{}}return t===l?{}:await p(l,e)}function f(t){const e=s(t,"lang",globalThis.navigator?.language||l);return{lang:e,t9nLocale:g(e)}}function g(t){const[e,i]=t.split("-"),o=e.toLowerCase();let r=o;return i&&(r=`${o}-${i.toUpperCase()}`),r=h[r]??r,c.has(r)?r:i?g(o):l}function m(t,e,i,o){let s;const n=()=>{(async function(t,e,i=t.tagName.toLowerCase().split("-").slice(1).join("-")){const{lang:o,t9nLocale:r}=f(t),s=`${e}/${i}/t9n`;return{lang:o,t9nLocale:r,t9nStrings:null===i?{}:await d(r,s,"messages.")}})(t,e(),o).then((t=>{s?.lang===t.lang&&s.t9nLocale===t.t9nLocale&&s.t9nStrings===t.t9nStrings||i(t),s=t})).catch(console.error)};return queueMicrotask(n),function(t,e,i){const{subscribe:o}=function(t){const e=t.join(","),i=r[e];if(void 0!==i)return i;const o=new Set,s=new MutationObserver((t=>o.forEach((e=>e(t)))));globalThis.document&&s.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0});const n={subscribe:t=>(o.add(t),()=>{o.delete(t),0===o.size&&(s.disconnect(),r[e]=void 0)})};return r[e]=n,n}(e);return o((e=>{const o=e.some((e=>function(t,e){let i=t;for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode instanceof ShadowRoot?i.parentNode.host:i.parentNode}return!1}(t,e.target)));o&&i()}))}(t,["lang"],n)}var y=t=>t.replace(b,((t,e)=>`${0===e?"":"-"}${t.toLowerCase()}`)),b=/[A-Z]+(?![a-z])|[A-Z]/gu;function v(t,e){const i=e>_?w:e/A;let o=0;const r=setInterval((()=>{o+=i,o>=e&&(clearInterval(r),t())}),i);return r}var _=4e3,w=2e3,A=4;function k(t){return void 0!==t}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4111],{8303:(t,e,r)=>{r.d(e,{A:()=>C});var s=r(90237),o=r(92602),i=r(70333),n=r(78888),a=r(60999),p=r(49186),u=r(53966),l=r(97768),d=r(74887),c=r(84952),y=r(10107),h=(r(44208),r(87811),r(36005)),m=r(40608),g=r(43937),f=r(77548),v=r(20655),w=r(80812),F=r(41318),A=r(10407);const C=t=>{let e=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,l.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,e,r){if(e.itemId)return new w.default({id:e.itemId,portal:r?.portal})}writePortalItem(t,e){t?.id&&(e.itemId=t.id)}async loadFromPortal(t,e){if(this.portalItem?.id)try{const{load:s}=await r.e(1204).then(r.bind(r,41204));return(0,d.Te)(e),await s({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap,populateGroupLayer:t.populateGroupLayer},e)}catch(t){throw(0,d.zf)(t)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${t}`),t}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch((t=>((0,d.QP)(t),!0))))}async setUserPrivileges(t,e){if(!o.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:r,fullEdit:s},content:{updateItem:o}}=await this._fetchUserPrivileges(t,e);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",o)}catch(t){(0,d.QP)(t)}}async _fetchUserPrivileges(t,e){let r=this.portalItem;if(!t||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(e);const s=!i.id?.findCredential(this.url),o=t===r.id;if(o&&r.portal.user)return this._getUserPrivileges(r,s);let n,a;if(o)n=r.portal.url;else try{n=await(0,f.wI)(this.url,e)}catch(t){(0,d.QP)(t)}if(!n||!(0,c.b8)(n,r.portal.url))return this._fetchFallbackUserPrivileges(e);try{const t=null!=e?e.signal:null;a=await(i.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:t}))}catch(t){(0,d.QP)(t)}const p=!0,u=!1,l=!1;if(!a)return{features:{edit:p,fullEdit:u},content:{updateItem:l}};try{if(o?await r.reload():(r=new w.default({id:t,portal:{url:n}}),await r.load(e)),r.portal.user)return this._getUserPrivileges(r,s)}catch(t){(0,d.QP)(t)}return{features:{edit:p,fullEdit:u},content:{updateItem:l}}}_getUserPrivileges(t,e){const r=(0,A.It)(t);return e&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(t){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(t)}catch(t){(0,d.QP)(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const e=this.url?i.id?.findCredential(this.url):null;if(!e)return!0;const r=I.credential===e?I.user:await this._fetchEditingUser(t);return I.credential=e,I.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const e=this.portalItem?.portal?.user;if(e)return e;const r=i.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const s=`${r.owningSystemUrl}/sharing/rest`,o=v.A.getDefault();if(o&&o.loaded&&(0,c.S8)(o.restUrl)===(0,c.S8)(s))return o.user;const p=`${s}/community/self`,u=null!=t?t.signal:null,l=await(0,a.Ke)((0,n.A)(p,{authMode:"no-prompt",query:{f:"json"},signal:u}));return l.ok?F.A.fromJSON(l.value.data):null}read(t,e){e&&(e.layer=this),super.read(t,e)}write(t,e){const r=e?.portal,s=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&s&&!(0,c.ut)(s.restUrl,r.restUrl)?(e.messages&&e.messages.push(new p.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...e,layer:this})}};return(0,s._)([(0,y.MZ)({type:w.default})],e.prototype,"portalItem",null),(0,s._)([(0,h.w)("web-document","portalItem",["itemId"])],e.prototype,"readPortalItem",null),(0,s._)([(0,g.K)("web-document","portalItem",{itemId:{type:String}})],e.prototype,"writePortalItem",null),(0,s._)([(0,y.MZ)({clonable:!1})],e.prototype,"resourceReferences",void 0),(0,s._)([(0,y.MZ)({type:Boolean,readOnly:!0})],e.prototype,"userHasEditingPrivileges",void 0),(0,s._)([(0,y.MZ)({type:Boolean,readOnly:!0})],e.prototype,"userHasFullEditingPrivileges",void 0),(0,s._)([(0,y.MZ)({type:Boolean,readOnly:!0})],e.prototype,"userHasUpdateItemPrivileges",void 0),e=(0,s._)([(0,m.$)("esri.layers.mixins.PortalLayer")],e),e},I={credential:null,user:null}},18768:(t,e,r)=>{r.d(e,{b:()=>p});var s=r(90237),o=r(53966),i=r(10107),n=(r(44208),r(87811),r(40608)),a=r(60694);const p=t=>{let e=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const t=(0,a.qg)(this.url);if(t?.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",(0,a.Jf)(t,o.A.getLogger(this)))}};return(0,s._)([(0,i.MZ)()],e.prototype,"title",null),(0,s._)([(0,i.MZ)({type:String})],e.prototype,"url",null),e=(0,s._)([(0,n.$)("esri.layers.mixins.ArcGISService")],e),e}},20557:(t,e,r)=>{r.d(e,{Fm:()=>p,Hz:()=>y,JQ:()=>c,JZ:()=>F,ND:()=>m,R_:()=>n,U9:()=>d,fu:()=>o,nr:()=>h,oF:()=>i,rq:()=>u,z$:()=>l});const s=[["binary","application/octet-stream","bin",""]];function o(t,e){return null!=f(e.name,t?.supportedFormats??[])}function i(t,e){if(!t)return!1;const r=u(e,t.supportedFormats??[]);return null!=r&&t.editFormats.includes(r)}function n(t,e){return v(function(t,e){const r=t.toLowerCase();return g(e).find((t=>w(t)===r))}(t,e))}function a(t,e){return v(f(t,e))}function p(t,e){return w(function(t,e){return g(e).find((e=>v(e)===t))}(t,e))}function u(t,e){return a(t.name,e)??n(t.type,e)}function l(t,e,r){return n(t,r)??a(e,r)}function d({supportedFormats:t}){return l("model/gltf-binary","glb",t)}function c(t){const e=d(t);return null!=e&&t.editFormats.includes(e)}function y(t){if(!t)return null;const e=d(t),r=function({supportedFormats:t}){return l("model/gltf+json","gltf",t)}(t);let s=null;for(const o of t.queryFormats){if(o===e)return o;o===r&&(s=o)}return s}function h({supportedFormats:t}){return l("application/esri3do-SR_world","wld",t)}function m({supportedFormats:t}){return l("application/esri3do-SR_prj","prj",t)}function g(t){return[...s,...t]}function f(t,e){const r=t.toLowerCase();return g(e).find((t=>function(t){return t?.[2].split(",").map((t=>t.toLowerCase()))??[]}(t).some((t=>r.endsWith(t)))))}function v(t){return t?.[0]}function w(t){return t?.[1].toLowerCase()}function F(t){return t.tables?.find((t=>"assetMaps"===t.role))}},22453:(t,e,r)=>{r.d(e,{S:()=>h,d:()=>T});var s=r(44208),o=r(60694),i=r(20557);function n(t,e,r){return!!p(t,e,r)}function a(t,e,r){return p(t,e,r)}function p(t,e,r){return t&&t.hasOwnProperty(e)?t[e]:r}const u={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function l(t){const e=t?.supportedSpatialAggregationStatistics?.map((t=>t.toLowerCase()));return{envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function d(t,e){const r=t?.supportedOperationsWithCacheHint?.map((t=>t.toLowerCase()));return!!r?.includes(e.toLowerCase())}function c(t){const e=t?.supportedStatisticTypes?.map((t=>t.toLowerCase()));return{count:!!e?.includes("count"),sum:!!e?.includes("sum"),min:!!e?.includes("min"),max:!!e?.includes("max"),avg:!!e?.includes("avg"),var:!!e?.includes("var"),stddev:!!e?.includes("stddev"),percentileContinuous:!!e?.includes("percentile_continuous"),percentileDiscrete:!!e?.includes("percentile_discrete"),envelope:!!e?.includes("envelopeaggregate"),centroid:!!e?.includes("centroidaggregate"),convexHull:!!e?.includes("convexhullaggregate")}}function y(t){const e=t?.supportedNormalizationTypes?.map((t=>t.toLowerCase()));return{field:!!e?.includes("field"),log:!!e?.includes("log"),naturalLog:!!e?.includes("naturallog"),percentOfTotal:!!e?.includes("percentoftotal"),squareRoot:!!e?.includes("squareroot")}}function h(t,e){return{analytics:m(t),attachment:g(t),data:f(t),metadata:v(t),operations:w(t.capabilities,t,e),query:F(t,e),queryAttributeBins:I(t),queryRelated:A(t),queryTopFeatures:C(t),editing:_(t)}}function m(t){return{supportsCacheHint:d(t.advancedQueryCapabilities,"queryAnalytics")}}function g(t){const e=t.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:d(t.advancedQueryCapabilities,"queryAttachments"),supportsOrderByFields:n(t.advancedQueryCapabilities,"supportsQueryAttachmentOrderByFields",!1),supportsResize:n(t,"supportsAttachmentsResizing",!1)};return e&&Array.isArray(e)&&e.forEach((t=>{const e=u[t.name];e&&(r[e]=!!t.isEnabled)})),r}function f(t){return{isVersioned:n(t,"isDataVersioned",!1),isBranchVersioned:n(t,"isDataBranchVersioned",!1),supportsAttachment:n(t,"hasAttachments",!1),supportsM:n(t,"hasM",!1),supportsZ:n(t,"hasZ",!1)}}function v(t){return{supportsAdvancedFieldProperties:n(t,"supportsFieldDescriptionProperty",!1)}}function w(t,e,r){const s=t?.toLowerCase().split(",").map((t=>t.trim()))??[],i=r?(0,o.qg)(r):null,a=s.includes("MapServer"===i?.serverType?"data":"query"),p=s.includes("editing")&&!e.datesInUnknownTimezone;let u=p&&s.includes("create"),l=p&&s.includes("delete"),d=p&&s.includes("update");const c=s.includes("changetracking"),y=e.advancedQueryCapabilities;return p&&!(u||l||d)&&(u=l=d=!0),{supportsCalculate:n(e,"supportsCalculate",!1),supportsTruncate:n(e,"supportsTruncate",!1),supportsValidateSql:n(e,"supportsValidateSql",!1),supportsAdd:u,supportsDelete:l,supportsEditing:p,supportsChangeTracking:c,supportsQuery:a,supportsQueryAnalytics:n(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:n(y,"supportsQueryAttachments",!1),supportsQueryBins:n(y,"supportsQueryBins",!1),supportsQueryTopFeatures:n(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:n(e,"supportsAttachmentsResizing",!1),supportsSync:s.includes("sync"),supportsUpdate:d,supportsExceedsLimitStatistics:n(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:n(e,"supportsAsyncConvert3D",!1)}}function F(t,e){const r=t.advancedQueryCapabilities,p=t.ownershipBasedAccessControlForFeatures,u=t.archivingInfo,c=t.currentVersion,y=e?.includes("MapServer"),h=!y||c>=(0,s.A)("mapserver-pbf-version-support"),m=(0,o.Wo)(e),g=new Set((t.supportedQueryFormats??"").split(",").map((t=>t.toLowerCase().trim())));return{maxRecordCount:a(t,"maxRecordCount",void 0),maxRecordCountFactor:a(t,"maxRecordCountFactor",void 0),maxUniqueIDCount:a(t,"maxUniqueIDCount",void 0),standardMaxRecordCount:a(t,"standardMaxRecordCount",void 0),supportedSpatialAggregationStatistics:l(r),supportsCacheHint:n(r,"supportsQueryWithCacheHint",!1)||d(r,"query"),supportsCentroid:n(r,"supportsReturningGeometryCentroid",!1),supportsCompactGeometry:m,supportsCurrentUser:n(r,"supportsCurrentUserQueries",!1),supportsDefaultSpatialReference:n(r,"supportsDefaultSR",!1),supportsDisjointSpatialRelationship:n(r,"supportsDisjointSpatialRel",!1),supportsDistance:n(r,"supportsQueryWithDistance",!1),supportsDistinct:n(r,"supportsDistinct",t.supportsAdvancedQueries),supportsExtent:n(r,"supportsReturningQueryExtent",!1),supportsFormatPBF:h&&g.has("pbf"),supportsFullTextSearch:n(r,"supportsFullTextSearch",!1),supportsGeometryProperties:n(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:n(r,"supportsHavingClause",!1),supportsHistoricMoment:n(u,"supportsQueryWithHistoricMoment",!1),supportsMaxRecordCountFactor:n(r,"supportsMaxRecordCountFactor",!1),supportsOrderBy:n(r,"supportsOrderBy",t.supportsAdvancedQueries),supportsPagination:n(r,"supportsPagination",!1),supportsPercentileStatistics:n(r,"supportsPercentileStatistics",!1),supportsQuantization:n(t,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:n(t,"supportsQuantizationEditMode",!1),supportsQueryByAnonymous:n(p,"allowAnonymousToQuery",!0),supportsQueryByOthers:n(p,"allowOthersToQuery",!0),supportsQueryGeometry:n(t,"supportsReturningQueryGeometry",!1),supportsResultType:n(r,"supportsQueryWithResultType",!1),supportsReturnMesh:!!(0,i.Hz)(t.infoFor3D),supportsSpatialAggregationStatistics:n(r,"supportsSpatialAggregationStatistics",!1),supportsSqlExpression:n(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:n(t,"useStandardizedQueries",!1),supportsStatistics:n(r,"supportsStatistics",t.supportsStatistics),supportsTopFeaturesQuery:n(r,"supportsTopFeaturesQuery",!1),supportsTrueCurve:n(r,"supportsTrueCurve",!1),tileMaxRecordCount:a(t,"tileMaxRecordCount",void 0)}}function A(t){const e=t.advancedQueryCapabilities,r=n(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:n(e,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:d(e,"queryRelated")}}function C(t){return{supportsCacheHint:d(t.advancedQueryCapabilities,"queryTopFilter")}}function I(t){const e=t?t.queryBinsCapabilities:void 0;return{supportsDate:n(e,"supportsDateBin",!1),supportsFixedInterval:n(e,"supportsFixedIntervalBin",!1),supportsAutoInterval:n(e,"supportsAutoIntervalBin",!1),supportsFixedBoundaries:n(e,"supportsFixedBoundariesBin",!1),supportsStackBy:n(e,"supportsStackBy",!1),supportsSplitBy:n(e,"supportsSplitBy",!1),supportsSnapToData:n(e,"supportsSnapToData",!1),supportsReturnFullIntervalBin:n(e,"supportsReturnFullIntervalBin",!1),supportsFirstDayOfWeek:n(e,"supportsFirstDayOfWeek",!1),supportsNormalization:n(e,"supportsNormalization",!1),supportedStatistics:c(e),supportedNormalizationTypes:y(e)}}function _(t){const e=t.ownershipBasedAccessControlForFeatures,r=t?t.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:n(t,"allowGeometryUpdates",!0),supportsGlobalId:n(t,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:n(t,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:n(t,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:n(t,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:n(t,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:n(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:n(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:n(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:n(e,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:n(r,"supportsAsyncApplyEdits",!1),zDefault:a(t,"zDefault",void 0)}}function T(t){return{operations:{supportsAppend:n(t,"supportsAppend",!1),supportsCoverageQuery:t?.playbackInfo?.klv["0601"]??!1,supportsExportClip:n(t,"supportsExportClip",!1),supportsExportFrameset:n(t,"supportsExportFrameset",!1),supportsMensuration:n(t,"supportsMensuration",!1),supportsPreviews:n(t,"supportsPreviews",!1),supportsUpdate:n(t,"supportsUpdate",!1)}}}},29005:(t,e,r)=>{r.d(e,{A:()=>d});var s=r(90237),o=r(69540),i=r(66552),n=r(25482),a=r(10107),p=(r(44208),r(53966),r(87811),r(40608));const u=new i.J({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let l=class extends(o.A.ClonableMixin(n.A)){constructor(t){super(t),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,s._)([(0,a.MZ)({json:{write:!0}})],l.prototype,"name",void 0),(0,s._)([(0,a.MZ)({json:{write:!0}})],l.prototype,"description",void 0),(0,s._)([(0,a.MZ)({json:{read:u.read,write:u.write}})],l.prototype,"drawingTool",void 0),(0,s._)([(0,a.MZ)({json:{write:!0}})],l.prototype,"prototype",void 0),(0,s._)([(0,a.MZ)({json:{write:!0}})],l.prototype,"thumbnail",void 0),l=(0,s._)([(0,p.$)("esri.layers.support.FeatureTemplate")],l);const d=l},37352:(t,e,r)=>{r.d(e,{A:()=>l});var s,o=r(90237),i=r(5503),n=r(25482),a=r(10107),p=(r(44208),r(53966),r(87811),r(40608));let u=s=class extends n.A{constructor(t){super(t),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new i.A}clone(){return new s({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,o._)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],u.prototype,"floorField",void 0),(0,o._)([(0,a.MZ)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,o._)([(0,a.MZ)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=s=(0,o._)([(0,p.$)("esri.layers.support.LayerFloorInfo")],u);const l=u},45067:(t,e,r)=>{r.d(e,{A:()=>c});var s=r(90237),o=r(69540),i=r(66552),n=r(25482),a=r(10107),p=(r(44208),r(53966),r(87811),r(40608));const u=new i.J({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),l=new i.J({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let d=class extends(o.A.ClonableMixin(n.A)){constructor(t){super(t),this.cardinality=null,this.catalogId=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};(0,s._)([(0,a.MZ)({json:{read:u.read,write:u.write}})],d.prototype,"cardinality",void 0),(0,s._)([(0,a.MZ)({json:{name:"catalogID"}})],d.prototype,"catalogId",void 0),(0,s._)([(0,a.MZ)({json:{read:!0,write:!0}})],d.prototype,"composite",void 0),(0,s._)([(0,a.MZ)({json:{read:!0,write:!0}})],d.prototype,"id",void 0),(0,s._)([(0,a.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyField",void 0),(0,s._)([(0,a.MZ)({json:{read:!0,write:!0}})],d.prototype,"keyFieldInRelationshipTable",void 0),(0,s._)([(0,a.MZ)({json:{read:!0,write:!0}})],d.prototype,"name",void 0),(0,s._)([(0,a.MZ)({json:{read:!0,write:!0}})],d.prototype,"relatedTableId",void 0),(0,s._)([(0,a.MZ)({json:{read:!0,write:!0}})],d.prototype,"relationshipTableId",void 0),(0,s._)([(0,a.MZ)({json:{read:l.read,write:l.write}})],d.prototype,"role",void 0),d=(0,s._)([(0,p.$)("esri.layers.support.Relationship")],d);const c=d},52136:(t,e,r)=>{r.d(e,{p:()=>n});var s=r(90237),o=r(10107),i=(r(44208),r(53966),r(87811),r(40608));const n=t=>{let e=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(t){null!=t?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,s._)([(0,o.MZ)({type:String})],e.prototype,"apiKey",null),e=(0,s._)([(0,i.$)("esri.layers.mixins.APIKeyMixin")],e),e}},69208:(t,e,r)=>{r.d(e,{d:()=>n});var s=r(90237),o=r(10107),i=(r(44208),r(53966),r(87811),r(40608));const n=t=>{let e=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,s._)([(0,o.MZ)({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=(0,s._)([(0,i.$)("esri.layers.mixins.CustomParametersMixin")],e),e}}}]);