@esri/solutions-components 5.1.0-next.6 → 5.1.0-next.8

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 (101) hide show
  1. package/dist/cdn/{SI3DJJCC.js → 2BANZAQ7.js} +1 -1
  2. package/dist/cdn/{OAS6T2VR.js → 2BQCT6XO.js} +1 -1
  3. package/dist/cdn/{TEXGFAKJ.js → 2W6HTIBW.js} +1 -1
  4. package/dist/cdn/{Q2FDKRDQ.js → 34PDHOYH.js} +1 -1
  5. package/dist/cdn/3HXIBP2A.js +2 -0
  6. package/dist/cdn/{P642ZIKQ.js → 3PUZFKV2.js} +1 -1
  7. package/dist/cdn/{SOFOUNGU.js → 3QC5SJ6C.js} +1 -1
  8. package/dist/cdn/{UUNDSSCA.js → 43NY3NM6.js} +1 -1
  9. package/dist/cdn/{CTVJXR44.js → 4CUFJALA.js} +1 -1
  10. package/dist/cdn/{HIMUNCZ6.js → 4FBEUQIB.js} +1 -1
  11. package/dist/cdn/{DADQNPO4.js → 4ZHQQBPL.js} +1 -1
  12. package/dist/cdn/{VTXVM7WH.js → 5BHMIKFH.js} +1 -1
  13. package/dist/cdn/{4VFF7AI4.js → 5EB5CGE2.js} +1 -1
  14. package/dist/cdn/{7KSFAVG3.js → 5KMILQ5O.js} +1 -1
  15. package/dist/cdn/{RSZTDUO6.js → 5LCHTZTL.js} +1 -1
  16. package/dist/cdn/{R4P3ACBL.js → 62PU7U2Z.js} +1 -1
  17. package/dist/cdn/{4ABITSEM.js → 7MTJZG5N.js} +1 -1
  18. package/dist/cdn/{B4UETHGF.js → 7TTSB4KO.js} +1 -1
  19. package/dist/cdn/{HL7P3CHI.js → ABNTJB3U.js} +1 -1
  20. package/dist/cdn/{KJMVCXRW.js → ADAVBSEY.js} +1 -1
  21. package/dist/cdn/{DXZ6JQQ3.js → BODNQLRD.js} +1 -1
  22. package/dist/cdn/{ZPFYLUCJ.js → BPEZ62VT.js} +1 -1
  23. package/dist/cdn/{CCENFN7F.js → BVJGYRKY.js} +1 -1
  24. package/dist/cdn/{7MXJCE2J.js → CDN3RSUG.js} +1 -1
  25. package/dist/cdn/{XQISEL3T.js → CMK42W7E.js} +1 -1
  26. package/dist/cdn/{2P34QGRO.js → COTZAQ2O.js} +1 -1
  27. package/dist/cdn/{3NR3CDWD.js → EBX4JFH7.js} +1 -1
  28. package/dist/cdn/{F24FJKDG.js → EPAPHJ3B.js} +1 -1
  29. package/dist/cdn/{QXFTJVUF.js → EQTLT2A3.js} +1 -1
  30. package/dist/cdn/{MSSLXF7R.js → F346YHSU.js} +1 -1
  31. package/dist/cdn/{4ZEHQ3GR.js → F6VMV2VA.js} +1 -1
  32. package/dist/cdn/{BDDH5UZP.js → FDTM55XL.js} +1 -1
  33. package/dist/cdn/{P4GNCZ6F.js → FZRH6WPJ.js} +1 -1
  34. package/dist/cdn/{YDNB3Z7B.js → G4EVXSWW.js} +1 -1
  35. package/dist/cdn/{SLC22JQP.js → GNW56CHH.js} +1 -1
  36. package/dist/cdn/{MUM5SE3F.js → GRWRAHYE.js} +1 -1
  37. package/dist/cdn/{32VP7W5E.js → HBHKZGWE.js} +1 -1
  38. package/dist/cdn/{UOEDG3M3.js → HBQN25RR.js} +1 -1
  39. package/dist/cdn/{6TOLIJU5.js → HVLWGULJ.js} +1 -1
  40. package/dist/cdn/{XZXTFYPU.js → ITDDPEQS.js} +1 -1
  41. package/dist/cdn/{VVNSX3BS.js → JAHYUDR2.js} +1 -1
  42. package/dist/cdn/{RSTX3J6D.js → JILNFCMF.js} +1 -1
  43. package/dist/cdn/{RYD5JSIK.js → JNO5VYYI.js} +1 -1
  44. package/dist/cdn/{XFB4UFWT.js → JPCXJ6L4.js} +1 -1
  45. package/dist/cdn/{D7AEFBST.js → KDZGRQXD.js} +1 -1
  46. package/dist/cdn/{42KJMFQR.js → KM5RNKXR.js} +1 -1
  47. package/dist/cdn/{3R5VOUDP.js → KTQ4N7FH.js} +1 -1
  48. package/dist/cdn/{XB2BJKRI.js → LBJLZYFA.js} +1 -1
  49. package/dist/cdn/{SBEXUIYT.js → M434TVGU.js} +1 -1
  50. package/dist/cdn/{GGPVFOLN.js → MQXN47F7.js} +1 -1
  51. package/dist/cdn/{5EKT4E6L.js → MTKEI6BF.js} +1 -1
  52. package/dist/cdn/{OEFCWMHM.js → MUXVFO4M.js} +1 -1
  53. package/dist/cdn/{UFI4ZJNJ.js → N2U6H3NP.js} +1 -1
  54. package/dist/cdn/{HPFJPSEL.js → NDWNF7CQ.js} +1 -1
  55. package/dist/cdn/{TG5Z36QU.js → NPWOQ56Y.js} +1 -1
  56. package/dist/cdn/{C63QDNA2.js → NXVNTNE5.js} +1 -1
  57. package/dist/cdn/{OSPT7DNE.js → OQDI6IHQ.js} +1 -1
  58. package/dist/cdn/{PHWLCAZ4.js → PDZRVXVT.js} +1 -1
  59. package/dist/cdn/{CVC5BYCF.js → PITLQBO6.js} +1 -1
  60. package/dist/cdn/{B5RWUGHH.js → PNLII42L.js} +1 -1
  61. package/dist/cdn/{NYCJKKYN.js → PPXEYILP.js} +1 -1
  62. package/dist/cdn/{MXWRV4QM.js → PYBJ4MQR.js} +1 -1
  63. package/dist/cdn/{ZKQHD6X2.js → PZ7VDYMM.js} +1 -1
  64. package/dist/cdn/{VFSI5MUK.js → Q3RAS2JS.js} +1 -1
  65. package/dist/cdn/{B4AIK4OP.js → Q4GTT7D6.js} +1 -1
  66. package/dist/cdn/{UIVSGAJR.js → QJZL3GS7.js} +1 -1
  67. package/dist/cdn/{5WJS5U7G.js → QY5QGQ2X.js} +1 -1
  68. package/dist/cdn/{3VJ4LKR5.js → RDHQTCGH.js} +1 -1
  69. package/dist/cdn/{P5XWXDR2.js → SEDPMCMZ.js} +1 -1
  70. package/dist/cdn/{SSWZX5KE.js → SF2GPS6K.js} +1 -1
  71. package/dist/cdn/{VDMAJ6AS.js → TER4MTK6.js} +1 -1
  72. package/dist/cdn/{T7REUAY2.js → TF7LQKOT.js} +1 -1
  73. package/dist/cdn/{JTUQKBFR.js → TIKDJQ35.js} +1 -1
  74. package/dist/cdn/{V74VHTFF.js → TWC7OKKZ.js} +1 -1
  75. package/dist/cdn/{KXAY6N2R.js → UFKD4KP3.js} +1 -1
  76. package/dist/cdn/{MCFH5JBU.js → UP35AXF6.js} +1 -1
  77. package/dist/cdn/{6M3LFKC2.js → US4NIGXI.js} +1 -1
  78. package/dist/cdn/{SE7R7GJQ.js → UUTS7RVV.js} +1 -1
  79. package/dist/cdn/{QLXOOL5D.js → V4HAD5FL.js} +1 -1
  80. package/dist/cdn/{M3ESEITD.js → VCI64HUS.js} +1 -1
  81. package/dist/cdn/{VGCXEINY.js → VGZHDJIX.js} +1 -1
  82. package/dist/cdn/{M3KJFMBN.js → VJ6OLNFI.js} +1 -1
  83. package/dist/cdn/{PJ4ERPMV.js → WD3IXGSO.js} +1 -1
  84. package/dist/cdn/WLEJ5757.js +2 -0
  85. package/dist/cdn/{RGH3Z5QC.js → WNJHBSCN.js} +1 -1
  86. package/dist/cdn/{YGZRQS2J.js → WRYTPNUC.js} +1 -1
  87. package/dist/cdn/{P2BP2CM5.js → XHYBCMYO.js} +1 -1
  88. package/dist/cdn/{MB5ER7VL.js → XIB6YS7Q.js} +1 -1
  89. package/dist/cdn/{YWSV24KI.js → XKFGKRYH.js} +1 -1
  90. package/dist/cdn/{3YP4IHTR.js → ZBNOS7AZ.js} +1 -1
  91. package/dist/cdn/{C4SG4U2R.js → ZJ3C3FG2.js} +1 -1
  92. package/dist/cdn/index.js +1 -1
  93. package/dist/components/solution-details-panel/customElement.js +11 -11
  94. package/dist/components/solutions-filter-panel/customElement.js +34 -31
  95. package/dist/docs/api.json +1 -1
  96. package/dist/docs/docs.json +1 -1
  97. package/dist/docs/web-types.json +1 -1
  98. package/dist/solutions-components_commit.txt +5 -5
  99. package/package.json +1 -1
  100. package/dist/cdn/DWUKLLEC.js +0 -2
  101. package/dist/cdn/SGRKAUHN.js +0 -2
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as y}from"./AA7X6GKH.js";import{a as E}from"./2D6XDWYA.js";import{a as $}from"./SLC22JQP.js";import{b as f}from"./JTUQKBFR.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import{F as h,G as u,H as m,J as p,h as b,i as o,l as _,r as w}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([c,S,L])=>{var C=`
2
+ import{a as y}from"./AA7X6GKH.js";import{a as E}from"./2D6XDWYA.js";import{a as $}from"./GNW56CHH.js";import{b as f}from"./TIKDJQ35.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import{F as h,G as u,H as m,J as p,h as b,i as o,l as _,r as w}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([c,S,L])=>{var C=`
3
3
  @media print {
4
4
  @page {
5
5
  size: Portrait;
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import f from"./5KD4GK7Y.js";import e from"./P4FX4W2X.js";import c from"./KGUELU4O.js";import b from"./36HEIJAI.js";import{b as l}from"./JTUQKBFR.js";import"./S423P2GA.js";import{F as i,G as n,H as r,J as o,K as d,h as s,i as a}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([,,,{t:p}])=>{var c=s`:host{display:block}:host .esri-legend__service{margin:0;padding:0}:host .hide{display:none}`,e={service:"esri-legend__service",groupLayer:"esri-legend__group-layer",groupContent:"esri-legend__group-content"},t=class extends r{constructor(){super(),this.layerCaption=i(),this.expanded=!0,this.isChild=!1,this.listenOn(window,"layerCaptionElementExpandUpdated",this.layerCaptionElementExpandUpdatedEmitted)}static{this.properties={expanded:16,legendvm:0,featureCount:5,activeLayerInfo:0,isChild:5}}static{this.styles=c}load(){new MutationObserver(()=>{this.requestUpdate()}).observe(this.el,{attributes:!0})}layerCaptionElementExpandUpdatedEmitted(){this.expanded=!!this.layerCaption.value?.expanded}render(){return a`<div style=${d({borderLeft:"1px solid var(--calcite-color-border-3)"})} class=${`${e.service} ${e.groupLayer}`}><instant-apps-interactive-legend-layer-element-caption class=${o(p(this.el))} .legendvm=${this.legendvm} .featureCount=${this.featureCount} .activeLayerInfo=${this.activeLayerInfo} .isChild=${this.isChild} ${n(this.layerCaption)}></instant-apps-interactive-legend-layer-element-caption><div class=${`${e.groupContent} ${this.expanded?"show":"hide"}`}><slot name=content></slot></div></div>`}};l("instant-apps-interactive-legend-group-legend-element",t);return t},b,c,e,f)
2
+ import f from"./5KD4GK7Y.js";import e from"./P4FX4W2X.js";import c from"./KGUELU4O.js";import b from"./36HEIJAI.js";import{b as l}from"./TIKDJQ35.js";import"./S423P2GA.js";import{F as i,G as n,H as r,J as o,K as d,h as s,i as a}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([,,,{t:p}])=>{var c=s`:host{display:block}:host .esri-legend__service{margin:0;padding:0}:host .hide{display:none}`,e={service:"esri-legend__service",groupLayer:"esri-legend__group-layer",groupContent:"esri-legend__group-content"},t=class extends r{constructor(){super(),this.layerCaption=i(),this.expanded=!0,this.isChild=!1,this.listenOn(window,"layerCaptionElementExpandUpdated",this.layerCaptionElementExpandUpdatedEmitted)}static{this.properties={expanded:16,legendvm:0,featureCount:5,activeLayerInfo:0,isChild:5}}static{this.styles=c}load(){new MutationObserver(()=>{this.requestUpdate()}).observe(this.el,{attributes:!0})}layerCaptionElementExpandUpdatedEmitted(){this.expanded=!!this.layerCaption.value?.expanded}render(){return a`<div style=${d({borderLeft:"1px solid var(--calcite-color-border-3)"})} class=${`${e.service} ${e.groupLayer}`}><instant-apps-interactive-legend-layer-element-caption class=${o(p(this.el))} .legendvm=${this.legendvm} .featureCount=${this.featureCount} .activeLayerInfo=${this.activeLayerInfo} .isChild=${this.isChild} ${n(this.layerCaption)}></instant-apps-interactive-legend-layer-element-caption><div class=${`${e.groupContent} ${this.expanded?"show":"hide"}`}><slot name=content></slot></div></div>`}};l("instant-apps-interactive-legend-group-legend-element",t);return t},b,c,e,f)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"./P5XWXDR2.js";import d from"./HIMUNCZ6.js";import"./US5FON7D.js";import"./VVZAS55G.js";import"./UOEDG3M3.js";import b from"./CEP54NLT.js";import a from"./YVNP437O.js";import{a as F}from"./3AQ7U2PF.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import"./TEHBW75B.js";import"./KU62OLRE.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./B3R52L7H.js";import"./BDXIKPLU.js";import"./G2ME4BAQ.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./73AX72WY.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as L}from"./NDUAEC62.js";import{F as u,G as c,H as w,J as x,K as I,h as m,i as l,l as _,r as p,u as y}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([E,S,$,,{c:d,d:g,g:b},,v])=>{var T=m`@layer{:host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.notice-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500}.feature-list-popup-title-small{font-size:small}.feature-list-popup-title-small-ellipsis{font-size:small;white-space:nowrap!important;text-overflow:ellipsis;overflow:hidden}.popup-title{padding:0 5px;word-break:break-word}.profile-img{margin:0 5px;min-width:32px}.like-container{display:flex;align-items:center;gap:5px;color:gray!important;font-style:italic}.feature-symbol{padding:0 3px;min-width:30px;display:flex;justify-content:center}.search{padding:10px;background-color:var(--calcite-color-foreground-1)!important;border-block-end:1px solid var(--calcite-color-border-3)}}`,f=class extends w{constructor(){super(),this.selectedLayerId="",this.noFeaturesFoundMsg="",this.pageSize=100,this.highlightOnMap=!1,this.highlightOnHover=!1,this.textSize="large",this.showInitialLoading=!0,this.showErrorWhenNoFeatures=!1,this.showUserImageInList=!1,this.showFeatureSymbol=!1,this.applyLayerViewFilter=!1,this.showFullTitle=!0,this.filterByMapExtent=!1,this._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._searchPlaceHolder="",this._fullTextSearchInfo=[],this._translations=F({name:"feature-list",blocking:!0}),this._pagination=u(),this._calciteList=u(),this._validFieldTypes=["small-integer","integer","big-integer","single","long"],this._abbreviatedLikeCount="",this._likeFieldAvailable=!1,this._searchExpression="",this.featureClick=p(),this.featureSelect=p(),this.listenOn(window,"selectedLanguageUpdated",this.selectedLanguageUpdated)}static{this.properties={selectedLayerId:1,mapView:0,noFeaturesFoundMsg:1,pageSize:9,highlightOnMap:5,highlightOnHover:5,sortingInfo:0,whereClause:1,textSize:1,showInitialLoading:5,showErrorWhenNoFeatures:5,showUserImageInList:5,showFeatureSymbol:5,applyLayerViewFilter:5,reportingOptions:0,showFullTitle:5,filterByMapExtent:5,_featureItems:16,_featuresCount:16,_isLoading:16,_searchPlaceHolder:16,_fullTextSearchInfo:16,_translations:16}}static{this.styles=T}static{this.shadowRootOptions=y}willUpdate(e){e.has("selectedLayerId")&&this.selectedLayerWatchHandler(),e.has("sortingInfo")&&this.sortingInfoWatchHandler(),e.has("whereClause")&&this.whereClauseHandler(),e.has("filterByMapExtent")&&this.hasUpdated&&this.filterByMapExtentWatchHandler(this.filterByMapExtent)}async selectedLayerWatchHandler(){this._selectedLayer=this.mapView&&await g(this.mapView,this.selectedLayerId),await this.initializeFeatureItems()}async sortingInfoWatchHandler(){await this.initializeFeatureItems()}async whereClauseHandler(){await this.initializeFeatureItems()}async filterByMapExtentWatchHandler(e){e?this.initializeMapExtentFilter():this._filterByMapExtentHandle&&this._filterByMapExtentHandle.remove()}async refresh(e){if(e&&this._pagination.value){let t={target:{startItem:this._pagination.value.startItem}};await this.pageChanged(t)}else this._searchExpression?await this._searchFullText():await this.initializeFeatureItems()}async selectedLanguageUpdated(e){if(this._pagination.value){let t={target:{startItem:this._pagination.value.startItem}};await this.pageChanged(t)}else await this.initializeFeatureItems()}async load(){this._isLoading=!!this.showInitialLoading,this._popupUtils=new v,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await g(this.mapView,this.selectedLayerId),this._getFullTextSearchInfo()),this.filterByMapExtent&&this.initializeMapExtentFilter()}async loaded(){await this.initializeFeatureItems()}render(){let e=this._canShowFullTextSearch();return l`<calcite-panel>${e&&l`<calcite-input class=search clearable icon=search @calciteInputChange=${this._searchTextChanged} .placeholder=${this._searchPlaceHolder} title type=search></calcite-input>`||""}${this._isLoading&&l`<calcite-loader label scale=m></calcite-loader>`||""}${this.showErrorWhenNoFeatures&&this._featureItems.length===0&&!this._isLoading&&l`<calcite-notice class="notice-msg" icon=feature-details kind=info open><div slot=message>${this.filterByMapExtent?this._translations.featureErrorMsgInCurrentMapView:this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg}</div></calcite-notice>`||""}<calcite-list class=${x(this.textSize==="small"&&!this.showFullTitle?"overflow-hidden":"")} label selection-appearance=border selection-mode=none ${c(this._calciteList)}>${!this._isLoading&&this._featureItems.length>0&&l`<div>${this.filterByMapExtent&&this.getExtentNotice()||""}${this._featureItems}</div>`||""}</calcite-list>${this.pageSize&&this._featuresCount>this.pageSize&&l`<div class="width-full" slot=footer><calcite-pagination class="pagination" @calcitePaginationChange=${this.pageChanged} .pageSize=${this.pageSize} start-item=1 .totalItems=${this._featuresCount} ${c(this._pagination)}></calcite-pagination></div>`||""}</calcite-panel>`}async getWhereCondition(){let e="1=1";if(this.whereClause&&(e=this.whereClause),this._selectedLayer?.definitionExpression&&(e=e+" AND "+this._selectedLayer.definitionExpression),this.applyLayerViewFilter){let t=this.mapView&&await d(this.mapView,this.selectedLayerId);t?.filter?.where&&(e=e+" AND "+t.filter.where)}return e}async initializeFeatureItems(){if(this._selectedLayer){this._pagination.value?.goTo("start"),this._isLoading=!!this.showInitialLoading,this._featureItems=await this.queryPage(0);let e={where:await this.getWhereCondition(),geometry:this.filterByMapExtent?this.mapView?.extent:null};this._featuresCount=await this._selectedLayer.queryFeatureCount(e),this._isLoading=!1}}initializeMapExtentFilter(){this._filterByMapExtentHandle=$.when(()=>this.mapView?.stationary,()=>{this.initializeFeatureItems()},{initial:!0})}async pageChanged(e){this._isLoading=!0,this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=void 0);let t=e.target.startItem-1;this._featureItems=await this.queryPage(t),this._isLoading=!1}_canShowFullTextSearch(){return this._selectedLayer?.capabilities?.query?.supportsFullTextSearch&&this._selectedLayer.indexes.items.filter(e=>e.indexType=="FullText").length>0}_getFullTextSearchInfo(){if(this._fullTextSearchInfo=[],this._selectedLayer?.capabilities?.query?.supportsFullTextSearch){let e=this._selectedLayer.indexes?.filter(t=>t.indexType=="FullText");if(e?.length){let t=[];e.forEach(i=>{t.push(...i.fields.split(","))});let s=[];t.forEach(i=>{let a=this._selectedLayer?.getField(i.trim());s.push(a?.alias||"")}),this._searchPlaceHolder=this._translations.searchPlaceholder?this._translations.searchPlaceholder.replace("{{field_names}}",s.join(", ")):"",this._fullTextSearchInfo.push({onFields:["*"],searchTerm:"",searchType:"prefix"})}}}async _searchTextChanged(e){this._fullTextSearchInfo.forEach(t=>{t.searchTerm=e.target.value}),await this._searchFullText()}async _searchFullText(){this._searchExpression&&this._clearSearchDefinitionExpression();let e=[];if(this._fullTextSearchInfo&&this._fullTextSearchInfo[0].searchTerm){let t=this._selectedLayer?.createQuery();t&&(t.fullText=this._fullTextSearchInfo,e=await this._selectedLayer?.queryObjectIds(t),await this._updateSearchDefinitionExpression(e?.length?e:[-1]))}await this.initializeFeatureItems()}async _updateSearchDefinitionExpression(e){if(this._selectedLayer){let t=this._selectedLayer.definitionExpression;if(e?.length){let s=`objectId in(${e})`;this._selectedLayer.definitionExpression=this._searchExpression&&t&&t?.indexOf(this._searchExpression)>-1?t.replace(this._searchExpression,s):t?`${t} AND (${s})`:s,this._searchExpression=s}else this._clearSearchDefinitionExpression()}}_clearSearchDefinitionExpression(){if(this._selectedLayer){let e=this._selectedLayer?.definitionExpression;this._searchExpression&&e&&e?.indexOf(this._searchExpression)>-1&&(e?.indexOf(" AND ("+this._searchExpression)>-1?this._selectedLayer.definitionExpression=e.replace(` AND (${this._searchExpression})`,""):this._selectedLayer.definitionExpression=e.replace(this._searchExpression,""))}this._searchExpression=""}async featureClicked(e,t){if(this.featureClick.emit(),this.clearHighlights(),this.highlightOnMap){let s=Number(e.target.value),i=this.mapView&&await d(this.mapView,this.selectedLayerId);this._highlightHandle=i&&this.mapView?await b([s],i,this.mapView,!0):void 0}await this.emitSelectedFeature(t)}async emitSelectedFeature(e){let t=e.layer,s=t.createQuery();s.returnGeometry=!0;let i=Number(e.getObjectId());if(!Number.isNaN(i)&&s){s.objectIds=[i];let a=await t.queryFeatures(s);this.featureSelect.emit(a.features[0])}}async onFeatureHover(e){if(this.clearHighlights(),this.highlightOnHover){let t=Number(e.getObjectId()),s=this.mapView&&await d(this.mapView,this.selectedLayerId);s&&(this._highlightHandle=s.highlight([t],{name:"temporary"}))}}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}async queryPage(e){let t=this._selectedLayer;if(t){let s=this.sortingInfo?.field?this.sortingInfo.field:t.objectIdField,i=this.sortingInfo?.order?this.sortingInfo.order:"desc",a=await this.getWhereCondition(),r={start:e,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:a,outSpatialReference:this.mapView?.spatialReference.toJSON(),geometry:this.filterByMapExtent?this.mapView?.extent:null};s&&i&&(r.orderByFields=[s.toString()+" "+i]);let n=await t.queryFeatures(r);return await this.createFeatureItem(n)}else return}async createFeatureItem(e){let t=e?.features,s=this.reportingOptions&&this.reportingOptions[this.selectedLayerId].like,i=t.map(async a=>{let r=this.mapView?.map&&await this._popupUtils?.getPopupTitle(a,this.mapView.map)||"",n,h;return this.showUserImageInList&&this._selectedLayer?.editFieldsInfo?.creatorField&&(n=await this.getUserInformation(a)),this.showFeatureSymbol&&(h=await this.getFeatureSymbol(a)),s&&this.getAbbreviatedLikeCount(a),this.getFeatureItem(a,r,h,n)});return Promise.all(i)}getExtentNotice(){return l`<calcite-notice class="notice-msg" icon=extent-filter kind=brand open scale=s><div slot=message>${this._translations.extentFilterMsg}</div></calcite-notice>`}getAbbreviatedLikeCount(e){let t=this._selectedLayer;if(t){let s=this.reportingOptions&&this.reportingOptions[t.id].likeField;t.fields.forEach(i=>{if(this._validFieldTypes.indexOf(i.type)>-1&&i.name===s&&this.reportingOptions&&this.reportingOptions[t.id].like){this._likeFieldAvailable=!0;let a=e.attributes[s]||0;a>999&&this._translations.millions_value&&this._translations.thousands_value&&(a=a>999999?this._translations.millions_value.replace("{{millions_value}}",Math.floor(a/1e6).toString()):this._translations.thousands_value.replace("{{thousands_value}}",Math.floor(a/1e3).toString())),this._abbreviatedLikeCount=a}})}}getFeatureItem(e,t,s,i){if(this._selectedLayer?.id&&this._calciteList.value){let a=e.attributes[this._selectedLayer.objectIdField].toString();t=t??a;let r=Number(e.attributes[this.reportingOptions?.[this._selectedLayer.id].likeField||""]).toLocaleString(),n=this.textSize==="small"&&!this.showFullTitle?"feature-list-popup-title-small-ellipsis":this.textSize==="small"?"feature-list-popup-title-small":"feature-list-popup-title",h=this.showUserImageInList?115:65,C=this._calciteList.value.offsetWidth-h;return l`<calcite-list-item @mouseleave=${()=>{this.clearHighlights()}} @mouseover=${()=>{this.onFeatureHover(e)}} @calciteListItemSelect=${o=>{this.featureClicked(o,e)}} .value=${a}>${this.showUserImageInList&&l`<calcite-avatar class=profile-img .fullName=${i?.fullName} scale=m slot=content-start .thumbnail=${i?.userProfileUrl} .userId=${i?.id} .username=${i?.fullName?i.username:void 0}></calcite-avatar>`||""}${this.showFeatureSymbol&&s&&l`<div class=feature-symbol slot=content-start ${c(o=>o&&o.replaceChildren(s))}></div>`||""}<div class=${`popup-title ${n}`} slot=content-start style=${I({maxWidth:this.textSize==="large"?"none":`${C}px`})}>${t}</div>${this._likeFieldAvailable&&l`<div class=like-container id=${a.concat("like")??_} slot=content-end><span>${this._abbreviatedLikeCount}</span><calcite-icon icon=thumbs-up scale=s></calcite-icon><calcite-tooltip overlay-positioning=fixed placement=top .referenceElement=${a.concat("like")}>${r}</calcite-tooltip></div>`||""}<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon></calcite-list-item>`}else return}async getUserInformation(e){let t=this._selectedLayer?.editFieldsInfo?.creatorField;if(t){e.attributes.hasOwnProperty(t.toLowerCase())?t=t.toLowerCase():e.attributes.hasOwnProperty(t.toUpperCase())&&(t=t.toUpperCase());let s=`${E.portalUrl}/sharing/rest/community/users/${e.attributes[t]}?f=json&returnUserLicensedItems=true`,i=this.mapView?.map?.portalItem.portal?.credential?.token;i&&(s+=`&token=${i}`);let a=await(await fetch(s)).json(),r=a?.username??e.attributes[t],n=`${E.portalUrl}/sharing/rest/community/users/${r}/info/blob.png`;return a?.access&&i&&(n+=`?token=${i}`),a.userProfileUrl=n,a}else return}async getFeatureSymbol(e){let t=document.createElement("div");return await S?.getDisplayedSymbol(e).then(async s=>{if(s&&await S?.renderPreviewHTML(s,{node:t}),t.children?.length){let i=t.children[0];if(i){let a=Number(i.getAttribute("height")),r=Number(i.getAttribute("width"));r>30&&(t.setAttribute("width","30"),i.setAttribute("width","30")),a>30&&(t.setAttribute("height","30"),i.setAttribute("height","30")),i.setAttribute("viewBox",`0 0 ${r} ${a}`),t.setAttribute("viewBox",`0 0 ${r} ${a}`)}}}),t}};L("feature-list",f);return f},"config","symbols/support/symbolUtils","core/reactiveUtils",a,b,d,e)
2
+ import e from"./SEDPMCMZ.js";import d from"./4FBEUQIB.js";import"./US5FON7D.js";import"./VVZAS55G.js";import"./HBQN25RR.js";import b from"./CEP54NLT.js";import a from"./YVNP437O.js";import{a as F}from"./3AQ7U2PF.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import"./TEHBW75B.js";import"./KU62OLRE.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./B3R52L7H.js";import"./BDXIKPLU.js";import"./G2ME4BAQ.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./73AX72WY.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as L}from"./NDUAEC62.js";import{F as u,G as c,H as w,J as x,K as I,h as m,i as l,l as _,r as p,u as y}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([E,S,$,,{c:d,d:g,g:b},,v])=>{var T=m`@layer{:host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.notice-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500}.feature-list-popup-title-small{font-size:small}.feature-list-popup-title-small-ellipsis{font-size:small;white-space:nowrap!important;text-overflow:ellipsis;overflow:hidden}.popup-title{padding:0 5px;word-break:break-word}.profile-img{margin:0 5px;min-width:32px}.like-container{display:flex;align-items:center;gap:5px;color:gray!important;font-style:italic}.feature-symbol{padding:0 3px;min-width:30px;display:flex;justify-content:center}.search{padding:10px;background-color:var(--calcite-color-foreground-1)!important;border-block-end:1px solid var(--calcite-color-border-3)}}`,f=class extends w{constructor(){super(),this.selectedLayerId="",this.noFeaturesFoundMsg="",this.pageSize=100,this.highlightOnMap=!1,this.highlightOnHover=!1,this.textSize="large",this.showInitialLoading=!0,this.showErrorWhenNoFeatures=!1,this.showUserImageInList=!1,this.showFeatureSymbol=!1,this.applyLayerViewFilter=!1,this.showFullTitle=!0,this.filterByMapExtent=!1,this._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._searchPlaceHolder="",this._fullTextSearchInfo=[],this._translations=F({name:"feature-list",blocking:!0}),this._pagination=u(),this._calciteList=u(),this._validFieldTypes=["small-integer","integer","big-integer","single","long"],this._abbreviatedLikeCount="",this._likeFieldAvailable=!1,this._searchExpression="",this.featureClick=p(),this.featureSelect=p(),this.listenOn(window,"selectedLanguageUpdated",this.selectedLanguageUpdated)}static{this.properties={selectedLayerId:1,mapView:0,noFeaturesFoundMsg:1,pageSize:9,highlightOnMap:5,highlightOnHover:5,sortingInfo:0,whereClause:1,textSize:1,showInitialLoading:5,showErrorWhenNoFeatures:5,showUserImageInList:5,showFeatureSymbol:5,applyLayerViewFilter:5,reportingOptions:0,showFullTitle:5,filterByMapExtent:5,_featureItems:16,_featuresCount:16,_isLoading:16,_searchPlaceHolder:16,_fullTextSearchInfo:16,_translations:16}}static{this.styles=T}static{this.shadowRootOptions=y}willUpdate(e){e.has("selectedLayerId")&&this.selectedLayerWatchHandler(),e.has("sortingInfo")&&this.sortingInfoWatchHandler(),e.has("whereClause")&&this.whereClauseHandler(),e.has("filterByMapExtent")&&this.hasUpdated&&this.filterByMapExtentWatchHandler(this.filterByMapExtent)}async selectedLayerWatchHandler(){this._selectedLayer=this.mapView&&await g(this.mapView,this.selectedLayerId),await this.initializeFeatureItems()}async sortingInfoWatchHandler(){await this.initializeFeatureItems()}async whereClauseHandler(){await this.initializeFeatureItems()}async filterByMapExtentWatchHandler(e){e?this.initializeMapExtentFilter():this._filterByMapExtentHandle&&this._filterByMapExtentHandle.remove()}async refresh(e){if(e&&this._pagination.value){let t={target:{startItem:this._pagination.value.startItem}};await this.pageChanged(t)}else this._searchExpression?await this._searchFullText():await this.initializeFeatureItems()}async selectedLanguageUpdated(e){if(this._pagination.value){let t={target:{startItem:this._pagination.value.startItem}};await this.pageChanged(t)}else await this.initializeFeatureItems()}async load(){this._isLoading=!!this.showInitialLoading,this._popupUtils=new v,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await g(this.mapView,this.selectedLayerId),this._getFullTextSearchInfo()),this.filterByMapExtent&&this.initializeMapExtentFilter()}async loaded(){await this.initializeFeatureItems()}render(){let e=this._canShowFullTextSearch();return l`<calcite-panel>${e&&l`<calcite-input class=search clearable icon=search @calciteInputChange=${this._searchTextChanged} .placeholder=${this._searchPlaceHolder} title type=search></calcite-input>`||""}${this._isLoading&&l`<calcite-loader label scale=m></calcite-loader>`||""}${this.showErrorWhenNoFeatures&&this._featureItems.length===0&&!this._isLoading&&l`<calcite-notice class="notice-msg" icon=feature-details kind=info open><div slot=message>${this.filterByMapExtent?this._translations.featureErrorMsgInCurrentMapView:this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg}</div></calcite-notice>`||""}<calcite-list class=${x(this.textSize==="small"&&!this.showFullTitle?"overflow-hidden":"")} label selection-appearance=border selection-mode=none ${c(this._calciteList)}>${!this._isLoading&&this._featureItems.length>0&&l`<div>${this.filterByMapExtent&&this.getExtentNotice()||""}${this._featureItems}</div>`||""}</calcite-list>${this.pageSize&&this._featuresCount>this.pageSize&&l`<div class="width-full" slot=footer><calcite-pagination class="pagination" @calcitePaginationChange=${this.pageChanged} .pageSize=${this.pageSize} start-item=1 .totalItems=${this._featuresCount} ${c(this._pagination)}></calcite-pagination></div>`||""}</calcite-panel>`}async getWhereCondition(){let e="1=1";if(this.whereClause&&(e=this.whereClause),this._selectedLayer?.definitionExpression&&(e=e+" AND "+this._selectedLayer.definitionExpression),this.applyLayerViewFilter){let t=this.mapView&&await d(this.mapView,this.selectedLayerId);t?.filter?.where&&(e=e+" AND "+t.filter.where)}return e}async initializeFeatureItems(){if(this._selectedLayer){this._pagination.value?.goTo("start"),this._isLoading=!!this.showInitialLoading,this._featureItems=await this.queryPage(0);let e={where:await this.getWhereCondition(),geometry:this.filterByMapExtent?this.mapView?.extent:null};this._featuresCount=await this._selectedLayer.queryFeatureCount(e),this._isLoading=!1}}initializeMapExtentFilter(){this._filterByMapExtentHandle=$.when(()=>this.mapView?.stationary,()=>{this.initializeFeatureItems()},{initial:!0})}async pageChanged(e){this._isLoading=!0,this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=void 0);let t=e.target.startItem-1;this._featureItems=await this.queryPage(t),this._isLoading=!1}_canShowFullTextSearch(){return this._selectedLayer?.capabilities?.query?.supportsFullTextSearch&&this._selectedLayer.indexes.items.filter(e=>e.indexType=="FullText").length>0}_getFullTextSearchInfo(){if(this._fullTextSearchInfo=[],this._selectedLayer?.capabilities?.query?.supportsFullTextSearch){let e=this._selectedLayer.indexes?.filter(t=>t.indexType=="FullText");if(e?.length){let t=[];e.forEach(i=>{t.push(...i.fields.split(","))});let s=[];t.forEach(i=>{let a=this._selectedLayer?.getField(i.trim());s.push(a?.alias||"")}),this._searchPlaceHolder=this._translations.searchPlaceholder?this._translations.searchPlaceholder.replace("{{field_names}}",s.join(", ")):"",this._fullTextSearchInfo.push({onFields:["*"],searchTerm:"",searchType:"prefix"})}}}async _searchTextChanged(e){this._fullTextSearchInfo.forEach(t=>{t.searchTerm=e.target.value}),await this._searchFullText()}async _searchFullText(){this._searchExpression&&this._clearSearchDefinitionExpression();let e=[];if(this._fullTextSearchInfo&&this._fullTextSearchInfo[0].searchTerm){let t=this._selectedLayer?.createQuery();t&&(t.fullText=this._fullTextSearchInfo,e=await this._selectedLayer?.queryObjectIds(t),await this._updateSearchDefinitionExpression(e?.length?e:[-1]))}await this.initializeFeatureItems()}async _updateSearchDefinitionExpression(e){if(this._selectedLayer){let t=this._selectedLayer.definitionExpression;if(e?.length){let s=`objectId in(${e})`;this._selectedLayer.definitionExpression=this._searchExpression&&t&&t?.indexOf(this._searchExpression)>-1?t.replace(this._searchExpression,s):t?`${t} AND (${s})`:s,this._searchExpression=s}else this._clearSearchDefinitionExpression()}}_clearSearchDefinitionExpression(){if(this._selectedLayer){let e=this._selectedLayer?.definitionExpression;this._searchExpression&&e&&e?.indexOf(this._searchExpression)>-1&&(e?.indexOf(" AND ("+this._searchExpression)>-1?this._selectedLayer.definitionExpression=e.replace(` AND (${this._searchExpression})`,""):this._selectedLayer.definitionExpression=e.replace(this._searchExpression,""))}this._searchExpression=""}async featureClicked(e,t){if(this.featureClick.emit(),this.clearHighlights(),this.highlightOnMap){let s=Number(e.target.value),i=this.mapView&&await d(this.mapView,this.selectedLayerId);this._highlightHandle=i&&this.mapView?await b([s],i,this.mapView,!0):void 0}await this.emitSelectedFeature(t)}async emitSelectedFeature(e){let t=e.layer,s=t.createQuery();s.returnGeometry=!0;let i=Number(e.getObjectId());if(!Number.isNaN(i)&&s){s.objectIds=[i];let a=await t.queryFeatures(s);this.featureSelect.emit(a.features[0])}}async onFeatureHover(e){if(this.clearHighlights(),this.highlightOnHover){let t=Number(e.getObjectId()),s=this.mapView&&await d(this.mapView,this.selectedLayerId);s&&(this._highlightHandle=s.highlight([t],{name:"temporary"}))}}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}async queryPage(e){let t=this._selectedLayer;if(t){let s=this.sortingInfo?.field?this.sortingInfo.field:t.objectIdField,i=this.sortingInfo?.order?this.sortingInfo.order:"desc",a=await this.getWhereCondition(),r={start:e,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:a,outSpatialReference:this.mapView?.spatialReference.toJSON(),geometry:this.filterByMapExtent?this.mapView?.extent:null};s&&i&&(r.orderByFields=[s.toString()+" "+i]);let n=await t.queryFeatures(r);return await this.createFeatureItem(n)}else return}async createFeatureItem(e){let t=e?.features,s=this.reportingOptions&&this.reportingOptions[this.selectedLayerId].like,i=t.map(async a=>{let r=this.mapView?.map&&await this._popupUtils?.getPopupTitle(a,this.mapView.map)||"",n,h;return this.showUserImageInList&&this._selectedLayer?.editFieldsInfo?.creatorField&&(n=await this.getUserInformation(a)),this.showFeatureSymbol&&(h=await this.getFeatureSymbol(a)),s&&this.getAbbreviatedLikeCount(a),this.getFeatureItem(a,r,h,n)});return Promise.all(i)}getExtentNotice(){return l`<calcite-notice class="notice-msg" icon=extent-filter kind=brand open scale=s><div slot=message>${this._translations.extentFilterMsg}</div></calcite-notice>`}getAbbreviatedLikeCount(e){let t=this._selectedLayer;if(t){let s=this.reportingOptions&&this.reportingOptions[t.id].likeField;t.fields.forEach(i=>{if(this._validFieldTypes.indexOf(i.type)>-1&&i.name===s&&this.reportingOptions&&this.reportingOptions[t.id].like){this._likeFieldAvailable=!0;let a=e.attributes[s]||0;a>999&&this._translations.millions_value&&this._translations.thousands_value&&(a=a>999999?this._translations.millions_value.replace("{{millions_value}}",Math.floor(a/1e6).toString()):this._translations.thousands_value.replace("{{thousands_value}}",Math.floor(a/1e3).toString())),this._abbreviatedLikeCount=a}})}}getFeatureItem(e,t,s,i){if(this._selectedLayer?.id&&this._calciteList.value){let a=e.attributes[this._selectedLayer.objectIdField].toString();t=t??a;let r=Number(e.attributes[this.reportingOptions?.[this._selectedLayer.id].likeField||""]).toLocaleString(),n=this.textSize==="small"&&!this.showFullTitle?"feature-list-popup-title-small-ellipsis":this.textSize==="small"?"feature-list-popup-title-small":"feature-list-popup-title",h=this.showUserImageInList?115:65,C=this._calciteList.value.offsetWidth-h;return l`<calcite-list-item @mouseleave=${()=>{this.clearHighlights()}} @mouseover=${()=>{this.onFeatureHover(e)}} @calciteListItemSelect=${o=>{this.featureClicked(o,e)}} .value=${a}>${this.showUserImageInList&&l`<calcite-avatar class=profile-img .fullName=${i?.fullName} scale=m slot=content-start .thumbnail=${i?.userProfileUrl} .userId=${i?.id} .username=${i?.fullName?i.username:void 0}></calcite-avatar>`||""}${this.showFeatureSymbol&&s&&l`<div class=feature-symbol slot=content-start ${c(o=>o&&o.replaceChildren(s))}></div>`||""}<div class=${`popup-title ${n}`} slot=content-start style=${I({maxWidth:this.textSize==="large"?"none":`${C}px`})}>${t}</div>${this._likeFieldAvailable&&l`<div class=like-container id=${a.concat("like")??_} slot=content-end><span>${this._abbreviatedLikeCount}</span><calcite-icon icon=thumbs-up scale=s></calcite-icon><calcite-tooltip overlay-positioning=fixed placement=top .referenceElement=${a.concat("like")}>${r}</calcite-tooltip></div>`||""}<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon></calcite-list-item>`}else return}async getUserInformation(e){let t=this._selectedLayer?.editFieldsInfo?.creatorField;if(t){e.attributes.hasOwnProperty(t.toLowerCase())?t=t.toLowerCase():e.attributes.hasOwnProperty(t.toUpperCase())&&(t=t.toUpperCase());let s=`${E.portalUrl}/sharing/rest/community/users/${e.attributes[t]}?f=json&returnUserLicensedItems=true`,i=this.mapView?.map?.portalItem.portal?.credential?.token;i&&(s+=`&token=${i}`);let a=await(await fetch(s)).json(),r=a?.username??e.attributes[t],n=`${E.portalUrl}/sharing/rest/community/users/${r}/info/blob.png`;return a?.access&&i&&(n+=`?token=${i}`),a.userProfileUrl=n,a}else return}async getFeatureSymbol(e){let t=document.createElement("div");return await S?.getDisplayedSymbol(e).then(async s=>{if(s&&await S?.renderPreviewHTML(s,{node:t}),t.children?.length){let i=t.children[0];if(i){let a=Number(i.getAttribute("height")),r=Number(i.getAttribute("width"));r>30&&(t.setAttribute("width","30"),i.setAttribute("width","30")),a>30&&(t.setAttribute("height","30"),i.setAttribute("height","30")),i.setAttribute("viewBox",`0 0 ${r} ${a}`),t.setAttribute("viewBox",`0 0 ${r} ${a}`)}}}),t}};L("feature-list",f);return f},"config","symbols/support/symbolUtils","core/reactiveUtils",a,b,d,e)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import a from"./M536RNIN.js";import{a as h}from"./AA7X6GKH.js";import{b as D}from"./JTUQKBFR.js";import{F as I,G as v,H as b,h as L,i as n,r as f}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([r,m,{a:p,c:$,d:S,e:g,f:u}])=>{var y=L`:host{display:block;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);min-width:200px}:host calcite-dropdown{width:100%}:host calcite-button{--calcite-color-brand: var(--calcite-color-text-3);--calcite-color-brand-hover: var(--calcite-color-text-3)}`,w=class extends b{constructor(){super(...arguments),this.trigger=I(),this.t9nData=null,this.isLoaded=!1,this.icon="language",this.locales=[],this.selectedLanguage=null,this.calciteDropdownOverlayPositioning="absolute",this.selectedLanguageUpdated=f()}static{this.properties={t9nData:16,isLoaded:16,icon:1,portalItem:0,view:0,locales:0,defaultLocale:1,selectedLanguage:1,calciteDropdownOverlayPositioning:1}}static{this.styles=y}async refresh(){try{let e=await u(this.portalItem),t=await g(e);this.t9nData=t;let a={locale:this.selectedLanguage,data:t[this.selectedLanguage]};this.selectedLanguageUpdated.emit(a)}catch{}}async load(){try{this.portalItemResource=await u(this.portalItem);let e=await g(this.portalItemResource);this.t9nData=e??{}}catch{this.t9nData={},console.error("NO PORTAL ITEM RESOURCE AVAILABLE."),this.isLoaded=!0}finally{this.userLocale=this.defaultLocale;let e=new URLSearchParams(window.location.search).get("locale"),t=this.locales?.map(o=>o?.locale)?.filter(o=>o===e)?.length>0,a=$(this.portalItem.portal),c=this.locales?.map(o=>o?.locale)?.filter(o=>o===a)?.length>0;this.selectedLanguage=t?e:c?a:this.userLocale;let i=this.selectedLanguage;if(i!==this.userLocale&&(this.calciteDropdownItemSelectCallback(i)(),this.selectedLanguageUpdated.emit({locale:i,data:this.t9nData?.[i]??null})),this.view){let o=this.view.map;this.defaultWebMapId=o?.portalItem?.id??"";let l=this.locales?.filter(s=>s?.webmap&&s?.webmap!==this.defaultWebMapId&&s?.locale===this.selectedLanguage)?.[0]?.webmap;l&&(this.view.map=new m({portalItem:{id:l}}))}this.isLoaded=!0}}calciteDropdownItemSelectCallback(e){return async()=>{if(!this.isLoaded)return;this.selectedLanguage=e;let{selectedLanguage:t,t9nData:a,userLocale:c}=this,i=this.locales.find(s=>s.locale===t);a&&i&&t!==c&&(i.data=a[e]);let o=new URLSearchParams(window.location.search),l=S(this.selectedLanguage);if(r.setLocale(l),o.set("locale",l),this.view){let s=this.locales.filter(d=>d.locale===t)?.[0]?.webmap;if(s)this.view.map=new m({portalItem:{id:s}});else{let d=this.view?.map?.portalItem?.id;d&&this.defaultWebMapId!==d&&(this.view.map=new m({portalItem:{id:this.defaultWebMapId}}))}}document.documentElement.setAttribute("lang",l),r.prefersRTL()?document.documentElement.setAttribute("dir","rtl"):document.documentElement.setAttribute("dir","ltr"),window.history.replaceState({},"",decodeURIComponent(`${window.location.pathname}?${o}`)),this.selectedLanguageUpdated.emit(i)}}getSelectedLanguageText(e){let t=Object.keys(p.partial).includes(e),a=p[t?"partial":"full"],c=a[e];if(!t&&c==null){let l=r.normalizeMessageBundleLocale(e);c=a[l]}let{language:i,translated:o}=c;return`${i} - ${o}`}render(){let e=this.renderTrigger(),t=this.renderDropdownItems(),a=this.renderDefaultLocale();return n`<calcite-dropdown @calciteDropdownBeforeOpen=${()=>{this.trigger.value&&(this.trigger.value.iconEnd="chevron-up")}} @calciteDropdownBeforeClose=${()=>{this.trigger.value&&(this.trigger.value.iconEnd="chevron-down")}} .overlayPositioning=${this.calciteDropdownOverlayPositioning} width-scale=m>${e}<calcite-dropdown-group>${a}${t}</calcite-dropdown-group></calcite-dropdown>`}renderDefaultLocale(){let{userLocale:e}=this;return h(`default-${e}`,n`<calcite-dropdown-item @calciteDropdownItemSelect=${this.calciteDropdownItemSelectCallback(e)} .selected=${this.selectedLanguage===this.userLocale}>${this.getSelectedLanguageText(e)}</calcite-dropdown-item>`)}renderTrigger(){return n`<calcite-button slot=trigger .iconStart=${this.icon} icon-end=chevron-down width=full appearance=outline ${v(this.trigger)}>${this.getSelectedLanguageText(this.selectedLanguage)}</calcite-button>`}renderDropdownItems(){return this.locales?.map(e=>e.locale)?.map(e=>this.renderDropdownItem(e))}renderDropdownItem(e){let t=this.getSelectedLanguageText(e),a=e===this.selectedLanguage;return h(e,n`<calcite-dropdown-item .selected=${a} @calciteDropdownItemSelect=${this.calciteDropdownItemSelectCallback(e)}>${t}</calcite-dropdown-item>`)}};D("instant-apps-language-switcher",w);return w},"intl","WebMap",a)
2
+ import a from"./M536RNIN.js";import{a as h}from"./AA7X6GKH.js";import{b as D}from"./TIKDJQ35.js";import{F as I,G as v,H as b,h as L,i as n,r as f}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([r,m,{a:p,c:$,d:S,e:g,f:u}])=>{var y=L`:host{display:block;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1);min-width:200px}:host calcite-dropdown{width:100%}:host calcite-button{--calcite-color-brand: var(--calcite-color-text-3);--calcite-color-brand-hover: var(--calcite-color-text-3)}`,w=class extends b{constructor(){super(...arguments),this.trigger=I(),this.t9nData=null,this.isLoaded=!1,this.icon="language",this.locales=[],this.selectedLanguage=null,this.calciteDropdownOverlayPositioning="absolute",this.selectedLanguageUpdated=f()}static{this.properties={t9nData:16,isLoaded:16,icon:1,portalItem:0,view:0,locales:0,defaultLocale:1,selectedLanguage:1,calciteDropdownOverlayPositioning:1}}static{this.styles=y}async refresh(){try{let e=await u(this.portalItem),t=await g(e);this.t9nData=t;let a={locale:this.selectedLanguage,data:t[this.selectedLanguage]};this.selectedLanguageUpdated.emit(a)}catch{}}async load(){try{this.portalItemResource=await u(this.portalItem);let e=await g(this.portalItemResource);this.t9nData=e??{}}catch{this.t9nData={},console.error("NO PORTAL ITEM RESOURCE AVAILABLE."),this.isLoaded=!0}finally{this.userLocale=this.defaultLocale;let e=new URLSearchParams(window.location.search).get("locale"),t=this.locales?.map(o=>o?.locale)?.filter(o=>o===e)?.length>0,a=$(this.portalItem.portal),c=this.locales?.map(o=>o?.locale)?.filter(o=>o===a)?.length>0;this.selectedLanguage=t?e:c?a:this.userLocale;let i=this.selectedLanguage;if(i!==this.userLocale&&(this.calciteDropdownItemSelectCallback(i)(),this.selectedLanguageUpdated.emit({locale:i,data:this.t9nData?.[i]??null})),this.view){let o=this.view.map;this.defaultWebMapId=o?.portalItem?.id??"";let l=this.locales?.filter(s=>s?.webmap&&s?.webmap!==this.defaultWebMapId&&s?.locale===this.selectedLanguage)?.[0]?.webmap;l&&(this.view.map=new m({portalItem:{id:l}}))}this.isLoaded=!0}}calciteDropdownItemSelectCallback(e){return async()=>{if(!this.isLoaded)return;this.selectedLanguage=e;let{selectedLanguage:t,t9nData:a,userLocale:c}=this,i=this.locales.find(s=>s.locale===t);a&&i&&t!==c&&(i.data=a[e]);let o=new URLSearchParams(window.location.search),l=S(this.selectedLanguage);if(r.setLocale(l),o.set("locale",l),this.view){let s=this.locales.filter(d=>d.locale===t)?.[0]?.webmap;if(s)this.view.map=new m({portalItem:{id:s}});else{let d=this.view?.map?.portalItem?.id;d&&this.defaultWebMapId!==d&&(this.view.map=new m({portalItem:{id:this.defaultWebMapId}}))}}document.documentElement.setAttribute("lang",l),r.prefersRTL()?document.documentElement.setAttribute("dir","rtl"):document.documentElement.setAttribute("dir","ltr"),window.history.replaceState({},"",decodeURIComponent(`${window.location.pathname}?${o}`)),this.selectedLanguageUpdated.emit(i)}}getSelectedLanguageText(e){let t=Object.keys(p.partial).includes(e),a=p[t?"partial":"full"],c=a[e];if(!t&&c==null){let l=r.normalizeMessageBundleLocale(e);c=a[l]}let{language:i,translated:o}=c;return`${i} - ${o}`}render(){let e=this.renderTrigger(),t=this.renderDropdownItems(),a=this.renderDefaultLocale();return n`<calcite-dropdown @calciteDropdownBeforeOpen=${()=>{this.trigger.value&&(this.trigger.value.iconEnd="chevron-up")}} @calciteDropdownBeforeClose=${()=>{this.trigger.value&&(this.trigger.value.iconEnd="chevron-down")}} .overlayPositioning=${this.calciteDropdownOverlayPositioning} width-scale=m>${e}<calcite-dropdown-group>${a}${t}</calcite-dropdown-group></calcite-dropdown>`}renderDefaultLocale(){let{userLocale:e}=this;return h(`default-${e}`,n`<calcite-dropdown-item @calciteDropdownItemSelect=${this.calciteDropdownItemSelectCallback(e)} .selected=${this.selectedLanguage===this.userLocale}>${this.getSelectedLanguageText(e)}</calcite-dropdown-item>`)}renderTrigger(){return n`<calcite-button slot=trigger .iconStart=${this.icon} icon-end=chevron-down width=full appearance=outline ${v(this.trigger)}>${this.getSelectedLanguageText(this.selectedLanguage)}</calcite-button>`}renderDropdownItems(){return this.locales?.map(e=>e.locale)?.map(e=>this.renderDropdownItem(e))}renderDropdownItem(e){let t=this.getSelectedLanguageText(e),a=e===this.selectedLanguage;return h(e,n`<calcite-dropdown-item .selected=${a} @calciteDropdownItemSelect=${this.calciteDropdownItemSelectCallback(e)}>${t}</calcite-dropdown-item>`)}};D("instant-apps-language-switcher",w);return w},"intl","WebMap",a)
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import{a as F}from"./HBPD3T7H.js";import a from"./KTQ4N7FH.js";import{b as g}from"./DLBZRD4H.js";import{a as I}from"./3AQ7U2PF.js";import{b}from"./NDUAEC62.js";import{H as N,J as S,h as A,i as c,r as m}from"./P4KZ6OZF.js";export default $arcgis.t(([{D:y,E:v,K:T,a:C,b:R,t:_}])=>{var f=A`.width-full{width:100%}calcite-panel{--calcite-panel-background-color: var(--calcite-color-foreground-1);--calcite-panel-footer-space: var(--calcite-spacing-sm)}.border-color{--calcite-block-border-color: transparent}calcite-block{margin:0;--calcite-block-content-space: 0}.tree-padding{padding:0 .2rem}.display-none{display:none}`,O={PUBLICSAFETY:["EMERGENCYMANAGEMENT","FIRESERVICE","LAWENFORCEMENT"],STATEANDLOCALGOVERNMENT:["AGRICULTURE","AIRPORT","ASSESSMENTANDTAXATION","ELECTIONS","EMERGENCYMANAGEMENT","FIRESERVICE","FISHANDWILDLIFE","HEALTHANDHUMANSERVICES","LAWENFORCEMENT","NATURALRESOURCES","PARKS","PLANNINGANDDEVELOPMENT","PUBLICWORKS","TRANSPORTATION"],UTILITIES:["DISTRICTENERGY","ELECTRIC","GAS","SEWER","STORMWATER","WATER"]},$=Object.keys(y).reduce((u,e)=>{let t=e;return u[t]=O[t]??[],u},{}),E=class extends N{constructor(){super(),this.hideIndustryFilter=!1,this.isAIDialogOpen=!1,this.showReset=!1,this._activeFilterSettings={categories:[]},this._isMobile=!1,this._translations=I({name:"solutions-filter-panel",blocking:!0}),this._userFirstName="",this._configContextConsumer=g({context:R,subscribe:!0,callback:e=>{e?.userSession&&!this._userFirstName&&this._loadUserFirstName()}}),this._isMobileContextConsumer=g({context:C,subscribe:!0,callback:e=>this._isMobile=e}),this.applyFilter=m(),this.toggleFilter=m(),this._handleFilterRemoved=e=>{let t=e.detail;Array.isArray(t)&&(this._activeFilterSettings={...this._activeFilterSettings,categories:[...t]})},this._industryMatchName=e=>{let t=Object.keys(this._translations.industries).find(o=>o.toUpperCase()===e.replaceAll(" ","").toUpperCase());return t&&t in this._translations.industries?this._translations.industries[t]:e},this._domainMatchName=e=>{let t=Object.keys(this._translations.industriesDomain).find(o=>o.toUpperCase()===e.replaceAll(" ","").toUpperCase());return t&&t in this._translations.industriesDomain?this._translations.industriesDomain[t]:e},this.listenOn(window,"filterRemoved",this._handleFilterRemoved),this.listenOn(window,"closeAssistant",()=>{this.isAIDialogOpen=!1}),this.listenOn(window,"openAssistant",()=>{this.isAIDialogOpen=!0})}static{this.properties={hideIndustryFilter:5,isAIDialogOpen:5,showReset:5,_activeFilterSettings:16,_isMobile:16,_translations:16,_userFirstName:16}}static{this.styles=f}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}changeIndustryFilter(e,t,o,h){if(e!==""||t!==""){let n=[];if(t!==""){let i=y[e],a=this._industryMatchName(i),s=v[t],r=this._domainMatchName(s);n=[{displayValue:a,type:"industry",value:e,industry:e,domain:""},{displayValue:r,type:"domain",value:t,industry:e,domain:t}]}else n=[{displayValue:o,type:t!==""?"domain":"industry",value:t!==""?t:e,industry:e,domain:t}];this._activeFilterSettings={...this._activeFilterSettings,categories:[...n]},h&&this.applyFilter.emit(n)}else{let n={displayValue:o,type:"industry",value:e,industry:e,domain:t};this._activeFilterSettings={...this._activeFilterSettings,categories:[n]},h&&this.applyFilter.emit(n)}}clearFilters(){this.changeIndustryFilter("","",""),this.applyFilter.emit(null)}async load(){await this._loadUserFirstName(),this._isMobileContextConsumer.value&&(this._isMobile=this._isMobileContextConsumer.value)}render(){return c`<calcite-panel description heading>${this.showReset&&c`<calcite-action appearance=solid icon=reset @click=${()=>{this.clearFilters()}} slot=header-actions-end .text=${this._translations.resetFilters} text-enabled></calcite-action>`||""}<calcite-block-group .label=${this._translations.filters} scale=l>${!this.hideIndustryFilter&&this.renderIndustryBlock()||""}</calcite-block-group><calcite-button id=solutions-assistant-button icon-start=speech-bubbles label="Solutions Assistant" @click=${()=>{this._telemetry?.logEvent({category:T.ASSISTANT,action:"Open"}),this.isAIDialogOpen=!0}} round scale=l slot=footer-start></calcite-button><calcite-tooltip reference-element=solutions-assistant-button placement=right slot=footer-start offset-distance=10 open><span>${this._translations.assistant.welcomeTip}</span></calcite-tooltip><arcgis-solutions-assistant .open=${this.isAIDialogOpen} .userFirstName=${this._userFirstName}></arcgis-solutions-assistant></calcite-panel>`}renderIndustryBlock(){let e=(i,a)=>!this._activeFilterSettings||!this._activeFilterSettings.categories?!1:this._activeFilterSettings.categories.some(s=>s.industry===i&&(s.domain??"")===a),t=i=>!this._activeFilterSettings||!this._activeFilterSettings.categories?!1:this._activeFilterSettings.categories.some(a=>a.industry===i&&(a.domain??"")===""),o=(i,a)=>a.length>0&&(t(i)||this._activeFilterSettings.categories?.some(s=>s.industry===i&&!!s.domain&&a.includes(s.domain))===!0),h=(i,a)=>F(a,s=>s,s=>{let r=Object.keys(this._translations.industriesDomain).find(l=>l.toUpperCase()===s.toUpperCase()),d=r&&r in this._translations.industriesDomain?this._translations.industriesDomain[r]:s,p=e(i,s);return c`<calcite-tree-item .label=${d} @click=${l=>{l.detail!==0&&this.changeIndustryFilter(i,s,d,!0)}} @keydown=${l=>{_(l,()=>{this.changeIndustryFilter(i,s,d,!0)})}} .selected=${p||void 0}>${d}</calcite-tree-item>`}),n=F(Object.entries($),([i,a])=>i,([i,a])=>{let s=this._industryMatchName(i),r=a,d=t(i),p=o(i,r);return c`<calcite-tree-item .label=${s} @click=${l=>{l.detail!==0&&this.changeIndustryFilter(i,"",s,!0)}} @keydown=${l=>{_(l,()=>{this.changeIndustryFilter(i,"",s,!0)})}} .selected=${d||void 0} .expanded=${p?!0:void 0}>${s}${r.length>0&&c`<calcite-tree slot=children selection-mode=multiple>${h(i,r)}</calcite-tree>`||""}</calcite-tree-item>`});return c`<calcite-block description expanded class="border-color" .heading=${this._translations.industriesHeader} .label=${this._translations.industriesHeader}><calcite-action class=${S(this._isMobile?"":"display-none")} icon=x @click=${this._toggleFilter} slot=content-end text></calcite-action><calcite-tree selection-mode=single-persist class="tree-padding">${n}</calcite-tree></calcite-block>`}_toggleFilter(){this.toggleFilter.emit()}async _loadUserFirstName(){try{let e=await this._configContextConsumer.value?.userSession?.getUser();if(e?.fullName){let t=e.fullName.split(" ")[0];this._userFirstName=t}}catch{}}};b("solutions-filter-panel",E);return E},a)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as e}from"./AA7X6GKH.js";import{a as _}from"./SLC22JQP.js";import{b as f}from"./JTUQKBFR.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import{F as d,G as v,H as h,J as o,L as a,h as l,i as t,u as m}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";var $=l`@layer{:host{display:block}.instant-apps-popover__content{display:flex;flex-direction:column;padding:0 5% 5%;max-width:35vw;font-family:var(--calcite-sans-family);font-size:.875rem}.instant-apps-popover__content .instant-apps-popover__action{align-self:flex-start;--calcite-color-foreground-2: transparent}.instant-apps-popover__content span{display:inline-block;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);margin:0 0 10px;font-family:var(--calcite-sans-family)}.instant-apps-popover__content p{line-height:19.12px;margin:0 0 10px;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.instant-apps-popover__content .instant-apps-popover__footer span{margin-bottom:0;font-weight:400;font-size:.875rem;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:first-child{--calcite-color-foreground-3: transparent}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:last-child{margin-left:5px}.instant-apps-popover__content .instant-apps-popover__img{width:100%;margin-bottom:10px}.instant-apps-popover__content.instant-apps-popover--action-disabled{padding:5%}.instant-apps-popover__content.instant-apps-popover--action-disabled #subtitle{margin:0 0 10px}}`,n={content:"instant-apps-popover__content",buttonContainer:"instant-apps-popover__button-container",action:"instant-apps-popover__action",actionDisabled:"instant-apps-popover--action-disabled",img:"instant-apps-popover__img",footer:"instant-apps-popover__footer"},p=class extends h{constructor(){super(...arguments),this._messages=_({name:"instant-apps-popover"}),this.popoverEl=d(),this.popoverTitle="",this.subtitle="",this.content="",this.placement="trailing-start",this.pagination=!1,this.disableAction=!1}static{this.properties={popoverTitle:3,subtitle:3,content:3,imgSrc:3,imgAlt:3,mediaSrc:3,index:11,referenceElement:3,parent:0,placement:1,refId:1,pagination:7,disableAction:7,popoverAction:0,messageOverrides:0}}static{this.styles=$}static{this.shadowRootOptions=m}updated(){!this.hasUpdated&&this.popoverEl.value&&(this.popoverEl.value.referenceElement=this.referenceElement)}render(){return t`<calcite-popover .heading=${this.popoverTitle} auto-close .placement=${this.placement} .messageOverrides=${{close:this._messages.close}} trigger-disabled ref-id=${this.refId??a} closable .referenceElement=${this.referenceElement} .label=${this.popoverTitle} ${v(this.popoverEl)}><div class=${`${n.content}${this.disableAction?` ${n.actionDisabled}`:""}`}>${this.disableAction?null:e("popover-action",t`<calcite-action class=${o(n.action)} @click=${this.popoverAction} .icon=${document.dir==="rtl"?"chevron-right":"chevron-left"} text-enabled .text=${this._messages.back??""}></calcite-action>`)}<section><span id=subtitle>${this.subtitle}</span><p>${this.content}</p>${this.imgSrc?e(`iac-popover-img-${this.refId}`,t`<img class=${o(n.img)} src=${this.imgSrc??a} alt=${(this.imgAlt?this.imgAlt:"")??a}>`):null}</section>${this.pagination?e(`iac-popover-footer-${this.index}`,t`<div class=${o(n.footer)}><span>${this.index+1} ${this._messages?.of} ${this.parent?.instantAppsPopovers?.size}</span>${this.renderPagination()}</div>`):null}</div></calcite-popover>`}renderPagination(){let{index:r,_messages:s,parent:i}=this;if(!i)return null;let g=i.instantAppsPopovers.size,u=r===0,c=r===g-1;return e("pagination-button-container",t`<div class=${o(n.buttonContainer)}>${u?null:e("prev",t`<calcite-button @click=${async()=>await i?.previous()} appearance=outline kind=neutral>${s.back}</calcite-button>`)}${e("next",t`<calcite-button @click=${async()=>{c?await i?.done():await i?.next()}}>${c?s.done:s.next}</calcite-button>`)}</div>`)}};f("instant-apps-popover",p);export{p as InstantAppsPopover};
2
+ import{a as e}from"./AA7X6GKH.js";import{a as _}from"./GNW56CHH.js";import{b as f}from"./TIKDJQ35.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import{F as d,G as v,H as h,J as o,L as a,h as l,i as t,u as m}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";var $=l`@layer{:host{display:block}.instant-apps-popover__content{display:flex;flex-direction:column;padding:0 5% 5%;max-width:35vw;font-family:var(--calcite-sans-family);font-size:.875rem}.instant-apps-popover__content .instant-apps-popover__action{align-self:flex-start;--calcite-color-foreground-2: transparent}.instant-apps-popover__content span{display:inline-block;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);margin:0 0 10px;font-family:var(--calcite-sans-family)}.instant-apps-popover__content p{line-height:19.12px;margin:0 0 10px;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer{display:flex;flex-direction:row;align-items:center;justify-content:space-between}.instant-apps-popover__content .instant-apps-popover__footer span{margin-bottom:0;font-weight:400;font-size:.875rem;font-family:var(--calcite-sans-family)}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:first-child{--calcite-color-foreground-3: transparent}.instant-apps-popover__content .instant-apps-popover__footer calcite-button:last-child{margin-left:5px}.instant-apps-popover__content .instant-apps-popover__img{width:100%;margin-bottom:10px}.instant-apps-popover__content.instant-apps-popover--action-disabled{padding:5%}.instant-apps-popover__content.instant-apps-popover--action-disabled #subtitle{margin:0 0 10px}}`,n={content:"instant-apps-popover__content",buttonContainer:"instant-apps-popover__button-container",action:"instant-apps-popover__action",actionDisabled:"instant-apps-popover--action-disabled",img:"instant-apps-popover__img",footer:"instant-apps-popover__footer"},p=class extends h{constructor(){super(...arguments),this._messages=_({name:"instant-apps-popover"}),this.popoverEl=d(),this.popoverTitle="",this.subtitle="",this.content="",this.placement="trailing-start",this.pagination=!1,this.disableAction=!1}static{this.properties={popoverTitle:3,subtitle:3,content:3,imgSrc:3,imgAlt:3,mediaSrc:3,index:11,referenceElement:3,parent:0,placement:1,refId:1,pagination:7,disableAction:7,popoverAction:0,messageOverrides:0}}static{this.styles=$}static{this.shadowRootOptions=m}updated(){!this.hasUpdated&&this.popoverEl.value&&(this.popoverEl.value.referenceElement=this.referenceElement)}render(){return t`<calcite-popover .heading=${this.popoverTitle} auto-close .placement=${this.placement} .messageOverrides=${{close:this._messages.close}} trigger-disabled ref-id=${this.refId??a} closable .referenceElement=${this.referenceElement} .label=${this.popoverTitle} ${v(this.popoverEl)}><div class=${`${n.content}${this.disableAction?` ${n.actionDisabled}`:""}`}>${this.disableAction?null:e("popover-action",t`<calcite-action class=${o(n.action)} @click=${this.popoverAction} .icon=${document.dir==="rtl"?"chevron-right":"chevron-left"} text-enabled .text=${this._messages.back??""}></calcite-action>`)}<section><span id=subtitle>${this.subtitle}</span><p>${this.content}</p>${this.imgSrc?e(`iac-popover-img-${this.refId}`,t`<img class=${o(n.img)} src=${this.imgSrc??a} alt=${(this.imgAlt?this.imgAlt:"")??a}>`):null}</section>${this.pagination?e(`iac-popover-footer-${this.index}`,t`<div class=${o(n.footer)}><span>${this.index+1} ${this._messages?.of} ${this.parent?.instantAppsPopovers?.size}</span>${this.renderPagination()}</div>`):null}</div></calcite-popover>`}renderPagination(){let{index:r,_messages:s,parent:i}=this;if(!i)return null;let g=i.instantAppsPopovers.size,u=r===0,c=r===g-1;return e("pagination-button-container",t`<div class=${o(n.buttonContainer)}>${u?null:e("prev",t`<calcite-button @click=${async()=>await i?.previous()} appearance=outline kind=neutral>${s.back}</calcite-button>`)}${e("next",t`<calcite-button @click=${async()=>{c?await i?.done():await i?.next()}}>${c?s.done:s.next}</calcite-button>`)}</div>`)}};f("instant-apps-popover",p);export{p as InstantAppsPopover};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import b from"./C4SG4U2R.js";import a from"./3R5VOUDP.js";import"./DLBZRD4H.js";import"./UOEDG3M3.js";import"./3AQ7U2PF.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import"./TEHBW75B.js";import"./KU62OLRE.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./B3R52L7H.js";import"./BDXIKPLU.js";import"./G2ME4BAQ.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./73AX72WY.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import"./NDUAEC62.js";import"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([,{c:o}])=>{return o},a,b)
2
+ import b from"./ZJ3C3FG2.js";import a from"./KTQ4N7FH.js";import"./DLBZRD4H.js";import"./HBQN25RR.js";import"./3AQ7U2PF.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import"./TEHBW75B.js";import"./KU62OLRE.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./B3R52L7H.js";import"./BDXIKPLU.js";import"./G2ME4BAQ.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./73AX72WY.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import"./NDUAEC62.js";import"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([,{c:o}])=>{return o},a,b)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"./VJEG4LOG.js";import{a as V}from"./BM666UZR.js";import c from"./HIMUNCZ6.js";import"./US5FON7D.js";import"./VVZAS55G.js";import{a as L}from"./DLBZRD4H.js";import"./UOEDG3M3.js";import b from"./CEP54NLT.js";import a from"./YVNP437O.js";import{a as E}from"./3AQ7U2PF.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import"./TEHBW75B.js";import"./KU62OLRE.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./B3R52L7H.js";import"./BDXIKPLU.js";import"./G2ME4BAQ.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./73AX72WY.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as T,c as k}from"./NDUAEC62.js";import{F as h,G as d,H as x,J as p,h as S,i as l,l as m,r as w,s as v,u as $}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([A,G,M,N,u,f,,{g:C,j:I},{a:P,d:O,e:D,f:R}])=>{var U=S`@layer{:host{display:block;--calcite-input-message-spacing-value: 0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-bottom-0{padding-bottom:0!important}.padding-inline-start-0{padding-inline-start:0!important}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-block-start-1{padding-block-start:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-top-1-2{padding-block-start:.5rem!important}.padding-top-1{padding-top:1rem}.indent-group{border-inline-start:1px solid var(--calcite-color-border-2);margin-bottom:.5rem;padding-inline-start:1rem;margin-inline-start:.5rem}.margin-bottom-0-5{margin-bottom:.5rem}.margin-top-0-5{margin-top:.5rem!important}.instructional-text{line-height:1;padding:0!important;margin:0;color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--2)}.info-blue{color:var(--calcite-color-status-info)}.info-message{justify-content:center;display:grid}.font-bold{font-weight:700}.header-label{font-weight:700;font-size:var(--calcite-font-size-0)}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:.5rem}.margin-top-0{margin-block-start:0!important}.margin-top-1{margin-top:1rem!important}.label-margin-0{--calcite-label-margin-bottom: 0}.list-label{color:var(--calcite-color-text-1);font-weight:var(--calcite-font-weight-bold)!important}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3: var(--calcite-color-brand);--calcite-color-foreground-2: var(--calcite-color-brand-hover);--calcite-color-text-1: var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}.list-container{padding:0 1rem 1rem}.list-items{align-items:center;background-color:#fff;box-shadow:0 1px 3px #0000001a;font-family:sans-serif;padding:12px 16px}.list-item{display:flex;align-items:center;justify-content:space-between}.item-label{color:#4a4a4a;font-size:16px}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}calcite-segmented-control{--calcite-segmented-control-border-color: var(--calcite-color-border-2)}calcite-segmented-control-item{--calcite-segmented-control-color: var(--calcite-color-text-3)}calcite-segmented-control-item[checked]{--calcite-segmented-control-border-color: var(--calcite-color-surface-highlight);--calcite-segmented-control-background-color: var(--calcite-color-surface-highlight);--calcite-segmented-control-color: var(--calcite-color-text-highlight)}calcite-action-bar{--calcite-internal-action-bar-gap: 0px;--calcite-internal-action-bar-padding: 0px}}`,b=class extends v{constructor(){super(),this.managedLayers={},this.managedTables=[],this.highlightHandles=[]}removeHandles(){this.highlightHandles.forEach(e=>{e?.remove()}),this.highlightHandles=[]}},y=class extends x{constructor(){super(),this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=!1,this.customExport=!1,this.customExportURL="",this.defaultBufferDistance=0,this.defaultBufferUnit="feet",this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.featureHighlightEnabled=!1,this.noResultText="",this.initialNotice="",this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType="PDF",this._fetchingData=!1,this._isMobile=!1,this._numDuplicates=0,this._pageType="LIST",this._saveEnabled=!1,this._selectionSets=[],this._segmentType="STANDARD",this._selectedReportingLayerId="",this._isInitialLoading=!0,this._translations=E({name:"public-notification",blocking:!0}),this._downloadTools=h(),this.layoutTemplateSelectRef=h(),this.reportTemplateSelectRef=h(),this._onboardingImageUrl="",this._popupsEnabled=!1,this._removeDuplicates=h(),this._selectTools=h(),this._refineSelection=h(),this._titleElement=h(),this._titleValue=void 0,this._numSelected=0,this._pnStateContextProvider=L({context:V}),this._refineGraphics=[],this._layoutTemplates=[],this._reportTemplates=[],this._reportTemplatesInfo=[],this.searchConfigurationChange=w(),this.listenOn(window,"selectionSetsChanged",this.selectionSetsChanged),this._pnState=new b,this._pnStateContextProvider.setValue(this._pnState)}static{this.properties={addresseeLayerIds:0,bufferColor:1,bufferOutlineColor:1,customLabelEnabled:5,customExport:5,customExportURL:1,defaultBufferDistance:9,defaultBufferUnit:1,defaultExportTitle:1,defaultNumLabelsPerPage:9,enableLayerFeatures:5,enableLayerFeaturesOnLoad:5,enableSearchDistance:5,enableSearchDistanceOnLoad:5,enableSketchTools:5,featureEffect:0,featureHighlightEnabled:5,mapView:0,noResultText:1,initialNotice:1,searchConfiguration:0,selectionLayerIds:0,showRefineSelection:5,showSearchSettings:5,sketchLineSymbol:0,sketchPointSymbol:0,sketchPolygonSymbol:0,_exportGraphics:16,_addMap:16,_addResults:16,_addTitle:16,_downloadActive:16,_exportType:16,_fetchingData:16,_isMobile:16,_numDuplicates:16,_pageType:16,_saveEnabled:16,_selectionSets:16,_segmentType:16,_selectedReportingLayerId:16,_isInitialLoading:16,_translations:16}}static{this.styles=U}static{this.shadowRootOptions=$}willUpdate(e){e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView),e.has("searchConfiguration")&&this.searchConfiguration&&this.watchSearchConfigurationHandler(this.searchConfiguration,e.get("searchConfiguration")),e.has("sketchLineSymbol")&&this.sketchLineSymbolWatchHandler(this.sketchLineSymbol,e.get("sketchLineSymbol")),e.has("sketchPointSymbol")&&this.sketchPointSymbolWatchHandler(this.sketchPointSymbol,e.get("sketchPointSymbol")),e.has("sketchPolygonSymbol")&&this.sketchPolygonSymbolWatchHandler(this.sketchPolygonSymbol,e.get("sketchPolygonSymbol")),e.has("_pageType")&&(this.hasUpdated||this._pageType!=="LIST")&&this.pageTypeWatchHandler(this._pageType,e.get("_pageType"))}async mapViewWatchHandler(e){e?.popup&&(this._popupsEnabled=e?.popupEnabled),this.searchConfiguration&&this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(e,t){let i=JSON.stringify(e);this.mapView&&(i!==JSON.stringify(t)||i&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(i),this._searchConfiguration&&this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setLineSymbol(e)}async sketchPointSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setPointSymbol(e)}async sketchPolygonSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setPolygonSymbol(e)}async pageTypeWatchHandler(e,t){if(this._checkPopups(),this.mapView?.popup&&(this.mapView.popupEnabled=e!=="LIST"?!1:this._popupsEnabled),e==="EXPORT"&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),(t==="SELECT"||t==="REFINE")&&await this._clearSelection(),t==="EXPORT"&&this._removeExportGraphics(),e!=="SELECT")return this._highlightFeatures()}selectionSetsChanged(e){this._selectionSets=[...e.detail]}connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia("(max-width: 600px)"),this.listenOn(this._mediaQuery,"change",e=>this._setIsMobile(e))}async load(){this._initSymbols(),this._onboardingImageUrl=k("assets/public-notification/images/onboarding.png")}render(){let e=this._isMobile?"footer":"header";return l`<calcite-shell>${this._isInitialLoading?l`<calcite-loader label></calcite-loader>`:l`<calcite-action-bar class="border-bottom-1 action-bar-size" expand-disabled layout=horizontal slot=${e??m}>${this._getActionGroup("list-check","LIST",this._translations.myLists)}${this.showRefineSelection?this._getActionGroup("test-data","REFINE",this._translations.refineSelection):null}${this._getActionGroup("export","EXPORT",this._translations.export)}</calcite-action-bar>${this._getPage(this._pageType)}`}</calcite-shell>`}async loaded(){this.searchConfiguration&&this._initSearchConfiguration(this.searchConfiguration),this.customExport&&this.customExportURL&&await this._setTemplates(),this._isInitialLoading=!1}_initSearchConfiguration(e){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=e,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(e){let t=e?.type==="simple-line";this.sketchLineSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(e){let t=e?.type==="simple-marker";this.sketchPointSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(e){let t=e?.type==="simple-fill";this.sketchPolygonSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(e){this._isMobile=e.matches}_getActionGroup(e,t,i){let s=this.showRefineSelection?"w-1-3":"w-1-2";return l`<calcite-action-group class=${p(s)} layout=horizontal><div class="background-override"><calcite-action .active=${this._pageType===t} alignment=center appearance=solid class="width-full height-full" .icon=${e} id=${e??m} @click=${()=>{this._setPageType(t)}} text></calcite-action></div><calcite-tooltip label placement=bottom .referenceElement=${e}><span>${i}</span></calcite-tooltip></calcite-action-group>`}_setPageType(e){this._pageType=e}_getPage(e){let t;switch(e){case"LIST":t=this._getListPage();break;case"SELECT":t=this._getSelectPage();break;case"EXPORT":t=this._getExportPage();break;case"REFINE":t=this._getRefinePage();break}return t}_getListPage(){let e=this._hasSelections(),t=e?this._translations.listHasSetsTip:this.initialNotice!==""?this.initialNotice:this._translations.selectLayerAndAdd;return l`<calcite-panel>${this._getLabel(this._translations.myLists,!1,"header-label")}${this._getNotice(t||"","padding-sides-1 padding-bottom-1","word-wrap-anywhere")}${e?this._getSelectionSetList():this._getOnboardingImage()}<div class="display-flex padding-1"><calcite-button @click=${()=>{this._setPageType("SELECT")}} width=full><span class="font-weight-500">${this._translations.add}</span></calcite-button></div></calcite-panel>`}_getOnboardingImage(){return l`<div class="display-flex padding-sides-1"><img class="img-container" role=presentation src=${this._onboardingImageUrl??m}></div>`}_getSelectionSetList(){return l`<div class="padding-top-1-2 padding-bottom-1-2"><calcite-list class="list-border margin-sides-1" label>${this._selectionSets.reduce((e,t,i)=>{let s=this._getSelectionSetIds(t),a=!0;return t.workflowType==="REFINE"&&(a=Object.keys(t.refineInfos).reduce((o,c)=>{let n=t.refineInfos[c];return o+=n.addIds.length+n.removeIds.length,o},0)>0),a&&e.push(l`<calcite-list-item .label=${t.label} @click=${()=>this.mapView&&this._gotoSelection(t,this.mapView)}><div slot=content><div class="list-label">${t.label}</div><div class="list-description">${t?.layerView?.layer.title}</div><div class="list-description">${this._translations.selectedFeatures.replace("{{n}}",s.length.toString())}</div></div>${this._getAction(!0,"pencil","",o=>this._openSelection(t,o),!1,"actions-end")}${this._getAction(!0,"x","",o=>this._deleteSelection(i,o),!1,"actions-end")}</calcite-list-item>`),e},[])}</calcite-list></div>`}_getSelectionSetIds(e){return e.workflowType!=="REFINE"?e.selectedIds:Object.keys(e.refineInfos).reduce((t,i)=>[...t,...e.refineInfos[i].addIds],[])}_hasSelections(e=!1){let t=[],i=this._selectionSets.some(s=>s.workflowType==="REFINE"?(t=this._getSelectionSetIds(s),!0):!1);return e&&i?t.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){let e=this._getExportInfos(),t=this.mapView?.map&&await P(this.mapView.map,e),i=t&&O(t);return t&&i?t.length-i.length:0}_getExportInfos(){return this._selectionSets.reduce((e,t)=>{if(t.download)if(t.workflowType!=="REFINE"&&t?.layerView){let i=t.layerView.layer.id;i!==void 0&&this._updateIds(i,t.layerView,t.selectedIds,e)}else Object.keys(t.refineInfos).forEach(i=>{let s=t.refineInfos[i];s.addIds.length>0&&this._updateIds(i,s.layerView,s.addIds,e)});return e},{})}_updateIds(e,t,i,s){return s[e]?s[e].ids=s[e].ids.concat(i):s[e]={layerView:t,ids:i},s}_getSelectPage(){let e=this._translations.selectSearchTip;return l`<calcite-panel>${this._getLabel(this._translations?.stepTwoFull,!0,"header-label")}${this._getNotice(e,"padding-1","word-wrap-anywhere")}<div><map-select-tools .bufferColor=${this.bufferColor} .bufferOutlineColor=${this.bufferOutlineColor} class="" .customLabelEnabled=${this.customLabelEnabled} .defaultBufferDistance=${this.defaultBufferDistance} .defaultBufferUnit=${this.defaultBufferUnit} .enableLayerFeatures=${this.enableLayerFeatures} .enableLayerFeaturesOnLoad=${this.enableLayerFeaturesOnLoad} .enableSearchDistance=${this.enableSearchDistance} .enableSearchDistanceOnLoad=${this.enableSearchDistanceOnLoad} .enableSketchTools=${this.enableSketchTools} .enabledLayerIds=${this.addresseeLayerIds} header-label-class .isUpdate=${!!this._activeSelection} .mapView=${this.mapView} .noResultText=${this.noResultText} @selectionSetChange=${this._updateForSelection} .searchConfiguration=${this._searchConfiguration} .searchDistanceEnabled=${this.enableSearchDistanceOnLoad} .selectionLayerIds=${this.selectionLayerIds} .selectionSet=${this._activeSelection} .sketchLineSymbol=${this.sketchLineSymbol} .sketchPointSymbol=${this.sketchPointSymbol} .sketchPolygonSymbol=${this.sketchPolygonSymbol} .useLayerFeaturesEnabled=${this.enableLayerFeaturesOnLoad} ${d(this._selectTools)}></map-select-tools></div>${this._getPageNavButtons(this._translations.done,this._numSelected===0,()=>{this._saveSelection()},this._translations.cancel,!1,()=>{this._home()})}</calcite-panel>`}_getExportPage(){let e=this._hasSelections(this.showRefineSelection),t=this._numDuplicates>0?"display-block":"display-none",i=this.customExport&&this.customExportURL&&this._layoutTemplates.length;return l`<calcite-panel><div>${this._getLabel(this._translations.export,!1,"header-label")}${e?l`<div>${this._getNotice(this._translations.exportTip,"padding-sides-1")}${this._getLabel(this._translations.exportListsLabel,!1,"")}${this._getExportSelectionLists()}<div class=${`padding-sides-1 ${t}`}><div class="display-flex"><calcite-label layout=inline><calcite-checkbox ${d(this._removeDuplicates)}></calcite-checkbox><div class="display-flex">${this._translations.removeDuplicate}<div class="info-message padding-start-1-2"><calcite-input-message class="info-blue margin-top-0" scale=m>${` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`}</calcite-input-message></div></div></calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=remove-duplicates-icon scale=s></calcite-icon></div><calcite-popover closable label overlay-positioning=fixed reference-element=remove-duplicates-icon><span class="tooltip-message">${this._translations.duplicatesTip}</span></calcite-popover></div><div class="border-bottom"></div><div class="segmented-controls padding-top-sides-1">${this._getLabel(this._translations.exportOptions,!0,"","margin-bottom-0-5")}${this._getSegmentedControls()}</div>${i?this._getCustomPrintOptions():l`<div class="padding-1 padding-bottom-0">${this._getExportOptions()}</div>`}<div class="padding-1 display-flex"><calcite-button .disabled=${!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults} .loading=${this._fetchingData} @click=${()=>this._segmentType==="CUSTOM"?this._customExport():void this._standardExport()} width=full><span class="font-weight-500">${this._translations.export}</span></calcite-button></div></div>`:this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")}</div></calcite-panel>`}_customExport(){if(!this.mapView)return;let e=this.layoutTemplateSelectRef.value?this.layoutTemplateSelectRef.value.selectedOption.value:"",t=this.reportTemplateSelectRef.value?this.reportTemplateSelectRef.value.selectedOption.value:"";this._fetchingData=!0;let i=this._reportTemplatesInfo.find(n=>n.reportTemplate===t),s=i?{...i.reportOptions}:{},a=this._selectedReportingLayerId;s?.reportSectionOverrides&&Object.keys(s.reportSectionOverrides).forEach(n=>{s.reportSectionOverrides[n].sourceId=a});let o=new G({layout:e,report:t,format:"pdf",layoutOptions:{titleText:this._titleElement.value?.value},reportOptions:s}),c=new M({view:this.mapView,template:o});N.execute(this.customExportURL,c).then(n=>{let g=this._titleValue;if(!g){let r=this._getSelectionIdsAndViews(this._selectionSets,!0),_=R(r);g=D(_)}n.url&&g&&this._downloadCustomPDF(n.url,g),this._fetchingData=!1}).catch(n=>{this._fetchingData=!1,console.error(n)})}async _downloadCustomPDF(e,t){try{let i=await fetch(e);if(!i.ok)throw new Error(`Failed to fetch PDF: ${i.statusText}`);let s=await i.blob(),a=window.URL.createObjectURL(s),o=document.createElement("a");o.href=a,o.download=t||"download.pdf";let c=document.getElementById("custom-export-div");c&&(c.appendChild(o),o.click(),window.URL.revokeObjectURL(a),c.removeChild(o))}catch(i){console.error("Download failed:",i)}}_exportTypeChange(e){this._exportType=e.target.value}_segmentTypeChange(e){this._titleValue="",this._segmentType=e.target.value}_getSegmentedControls(){return this.customExport&&this.customExportURL&&this._layoutTemplates.length?this._getStandardAndCustomSegmentedControl():this._getPDFAndCSVSementedControl()}_getPDFAndCSVSementedControl(){return l`<calcite-segmented-control class="w-100 calcite-segments" @calciteSegmentedControlChange=${this._exportTypeChange} width=full><calcite-segmented-control-item .checked=${this._exportType==="PDF"} class="w-50 end-border" value=PDF><span class="font-weight-500">${this._translations.pdf}</span></calcite-segmented-control-item><calcite-segmented-control-item .checked=${this._exportType==="CSV"} class="w-50" value=CSV><span class="font-weight-500">${this._translations.csv}</span></calcite-segmented-control-item></calcite-segmented-control>`}_getStandardAndCustomSegmentedControl(){return l`<calcite-segmented-control class="w-100 calcite-segments" @calciteSegmentedControlChange=${this._segmentTypeChange} width=full><calcite-segmented-control-item .checked=${this._segmentType==="STANDARD"} class="w-50 end-border" value=STANDARD><span class="font-weight-500">${this._translations.standard}</span></calcite-segmented-control-item><calcite-segmented-control-item .checked=${this._segmentType==="CUSTOM"} class="w-50" value=CUSTOM><span class="font-weight-500">${this._translations.custom}</span></calcite-segmented-control-item></calcite-segmented-control>`}_getCustomPrintOptions(){return this._segmentType==="STANDARD"?this._getStandardExportOptions():this._getCustomExportOptions()}_getStandardExportOptions(){return l`<div class="padding-1 padding-bottom-0"><calcite-label layout=inline alignment=start scale=m><calcite-radio-button .checked=${this._exportType==="PDF"} scale=m value=PDF @calciteRadioButtonChange=${this._exportTypeChange}></calcite-radio-button>${this._translations.pdf}</calcite-label><div class=indent-group>${this._getExportOptions()}</div><calcite-label layout=inline class="margin-top-1" alignment=start scale=m><calcite-radio-button .checked=${this._exportType==="CSV"} scale=m value=CSV @calciteRadioButtonChange=${this._exportTypeChange}></calcite-radio-button>${this._translations.csv}</calcite-label></div>`}_getCustomExportOptions(){let e=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",t=[],i=this._getSelectionIdsAndViews(this._selectionSets,!0);return Object.keys(i).forEach(s=>{i[s].ids.length&&t.push(s)}),l`<div id=custom-export-div class="padding-top-sides-1"><p class="instructional-text">${this._translations.formattingTip}</p>${t.length>1&&l`<p class="instructional-text margin-top-0-5">${this._translations.selectMatchingInputLayersLabel}</p>`||""}<div class=${"margin-top-1"}>${this._getLabel(this._translations.title,!0,"","none")}<calcite-input-text class="padding-inline-start-0 padding-top-1-2" @calciteInputTextInput=${()=>this._changeTitle()} .placeholder=${this._translations.titlePlaceholder} .value=${e} ${d(this._titleElement)}></calcite-input-text></div><div class=${"margin-top-1"}>${this._getLabel(this._translations.layoutTemplate,!0,"","none")}</div><calcite-select class="padding-inline-start-0 padding-top-1-2" label ${d(this.layoutTemplateSelectRef)}>${this._layoutTemplates.map((s,a)=>l`<calcite-option .selected=${a===0} .value=${s}>${s}</calcite-option>`)}</calcite-select>${this._reportTemplates?.length&&l`<div class=${"margin-top-1"}>${this._getLabel(this._translations.reportTemplate,!0,"","none")}</div><calcite-select class="padding-inline-start-0 padding-top-1-2" label ${d(this.reportTemplateSelectRef)}>${this._reportTemplates.map((s,a)=>l`<calcite-option .selected=${a===0} .value=${s}>${s}</calcite-option>`)}</calcite-select><div class=${"padding-top-sides-1 padding-inline-start-0 display-flex margin-bottom-0-5"}><calcite-label class="label-margin-0" layout=inline>${this._translations.reportLayer}</calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=information id=filter-message-info scale=s></calcite-icon><calcite-popover closable label overlay-positioning=fixed reference-element=filter-message-info><span class="tooltip-message">${this._translations.sourceLayerWarning}</span></calcite-popover></div><map-layer-picker .disabled=${t.length<=1} .enabledLayerIds=${t} .mapView=${this.mapView} @layerSelectionChange=${s=>{this._selectedReportingLayerId=s.detail[0]}} .selectedIds=${[this._selectedReportingLayerId]}></map-layer-picker>`||""}</div>`}async _setTemplates(){let e=this.customExportURL,t=`${e.split("/GPServer")?.[0]}/GPServer`;try{let i=await this.getTasksInfo(t),s="",a=i.tasks?.map(async r=>{await this.getTaskType(r,t)==="GetReportTemplatesInfo"&&(s=`${t}/${r}`)});a&&await Promise.all(a),s&&i.executionType&&await this._fetchReportTemplates(s,i.executionType);let o=(await f(e,{authMode:"auto",responseType:"json",query:{f:"json"}}))?.data,c=o.parameters.find(r=>r.name==="Layout_Template"&&Array.isArray(r.choiceList)),n=o.parameters.find(r=>r.name==="Report_Template"&&Array.isArray(r.choiceList));this._layoutTemplates=c?c.choiceList:[];let g=n?n.choiceList:[];this._reportTemplates=this._reportTemplatesInfo.length?g.filter(r=>this._reportTemplatesInfo.some(_=>_.reportTemplate===r)):[]}catch(i){console.error(i)}}async getTaskType(e,t){if(!e||!t)return Promise.resolve("");let i=`${t}/${e}`;try{let s=(await f(i,{authMode:"auto",responseType:"json",query:{f:"json"}}))?.data?.name||"";return Promise.resolve(s)}catch(s){return console.error(s),Promise.resolve("")}}async getTasksInfo(e){if(!e)return Promise.resolve({});let t=`${e}?f=json`,i={authMode:"auto",responseType:"json",query:{f:"json"}};try{let s=(await f(t,i))?.data,a=s?.tasks,o=s?.executionType==="esriExecutionTypeSynchronous"?"execute":"submitJob";return{tasks:a,supportedOperations:o,executionType:s?.executionType}}catch(s){return console.error(s),{}}}async _fetchReportTemplates(e,t){if(e)try{if(t==="esriExecutionTypeSynchronous"){let i=(await u.execute(e,{}))?.results?.find(s=>s.paramName==="Output_JSON");this._reportTemplatesInfo=i?.value??[]}else{let i=await u.submitJob(e,{});await i.waitForJobCompletion();let s=await i.fetchResultData("Output_JSON");this._reportTemplatesInfo=s?.value??[]}this._reportTemplatesInfo=this._reportTemplatesInfo.filter(i=>{let s=i.reportOptions;if(s?.reportSectionOverrides){let a=0;return Object.keys(s.reportSectionOverrides).forEach(o=>{s.reportSectionOverrides[o].hasOwnProperty("sourceId")&&a++}),a<=1}else return!0})}catch(i){console.error("Failed to fetch report templates:",i)}}_getExportOptions(){let e=this._exportType==="PDF"?"display-block":"display-none",t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",a=this._addResults?"":"display-none";return l`<div class=${p(e)}><p class="instructional-text">${this._translations.selectContentTip}</p><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addResults} @calciteCheckboxChange=${()=>this._addResults=!this._addResults}></calcite-checkbox>${this._translations.addResults}</calcite-label></div><div class=${`indent-group margin-top-1 ${a}`}><div class="margin-bottom-0-5"><calcite-label class="label-margin-0">${this._translations.selectPDFLabelOption}</calcite-label></div><div><pdf-download .defaultNumLabelsPerPage=${Number.parseInt(this.defaultNumLabelsPerPage.toString(),10)} .disabled=${!this._downloadActive} ${d(this._downloadTools)}></pdf-download></div></div><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addTitle} @calciteCheckboxChange=${()=>this._addTitle=!this._addTitle}></calcite-checkbox>${this._translations.title}</calcite-label></div><div class=${`${t} indent-group margin-top-0-5`}><calcite-input-text class="padding-inline-start-0 padding-top-1-2" @calciteInputTextInput=${()=>this._changeTitle()} .placeholder=${this._translations.titlePlaceholder} .value=${s} ${d(this._titleElement)}></calcite-input-text></div><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addMap} @calciteCheckboxChange=${()=>this._handleAddMapChange()}></calcite-checkbox>${this._translations.includeMap}</calcite-label></div><div class=${`padding-top-sides-1 padding-inline-start-0 ${i}`}><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._exportGraphics} @calciteCheckboxChange=${()=>this._handleExportGraphicsChange()}></calcite-checkbox>${this._translations.listGraphics}</calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=list-graphics-icon scale=s></calcite-icon><calcite-popover closable label overlay-positioning=fixed reference-element=list-graphics-icon><span class="tooltip-message">${this._translations.listGraphicsTip}</span></calcite-popover></div></div>`}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(e){let t,i=this._pnStateContextProvider.value;return Object.keys(i.managedLayers).some(s=>{let a=this.mapView?.map.layers.findIndex(o=>o.title===s);return i.managedLayers[s]===e&&a!==void 0?(t=this.mapView?.map.layers.getItemAt(a),!0):!1}),t}_updateExportGraphics(e=!1){(e||!this._exportGraphics||!this._addMap)&&this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){let e=this._getManagedLayer("sketch"),t=this._getManagedLayer("buffer");e&&e.graphics.removeAll(),t&&t.graphics.removeAll()}_addExportGraphics(){let e=this._getManagedLayer("sketch"),t=this._getManagedLayer("buffer");this._refineGraphics.forEach(i=>{e?.add(i.drawnGraphic),t?.add(i.bufferGraphic)}),this._selectionSets.forEach(i=>{if(i.download&&(e&&i.sketchGraphic&&e.graphics.add(i.sketchGraphic),t)){let s={type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}},a=new A({geometry:i.buffer,symbol:s});a&&t.graphics.add(a)}})}_getRefinePage(){let e=this._hasSelections();return l`<calcite-panel>${this._getLabel(this._translations.refineSelection,!1,"header-label")}${e?l`<div>${this._getNotice(this._translations.refineTip,"padding-sides-1")}<refine-selection .enabledLayerIds=${this.selectionLayerIds} .mapView=${this.mapView} .drawnGraphicsArr=${this._refineGraphics} .selectionSets=${this._selectionSets} .sketchLineSymbol=${this.sketchLineSymbol} .sketchPointSymbol=${this.sketchPointSymbol} .sketchPolygonSymbol=${this.sketchPolygonSymbol} .bufferColor=${this.bufferColor} .bufferOutlineColor=${this.bufferOutlineColor} .defaultBufferDistance=${this.defaultBufferDistance} .defaultBufferUnit=${this.defaultBufferUnit} .enableSearchDistance=${this.enableSearchDistance} .enableSearchDistanceOnLoad=${this.enableSearchDistanceOnLoad} .searchDistanceEnabled=${this.enableSearchDistanceOnLoad} ${d(this._refineSelection)}></refine-selection></div>`:this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1")}</calcite-panel>`}_getPageNavButtons(e,t,i,s,a,o){return l`<div class="padding-bottom-1"><div class="display-flex padding-top-sides-1"><calcite-button .disabled=${t} @click=${i} width=full><span class="font-weight-500">${e}</span></calcite-button></div><div class="display-flex padding-top-1-2 padding-sides-1"><calcite-button appearance=outline .disabled=${a} @click=${o} width=full><span class="font-weight-500">${s}</span></calcite-button></div></div>`}_changeTitle(){this._titleElement.value?.value&&(this._titleValue=this._titleElement.value.value||"")}_getNotice(e,t="padding-1",i=""){return l`<calcite-notice class=${p(t)} icon=lightbulb kind=success open><div class=${p(i)} slot=message>${e}</div></calcite-notice>`}_getLabel(e,t=!1,i="font-bold",s="padding-top-sides-1"){return i+=t?" label-margin-0":"",l`<div class=${p(s)}><calcite-label class=${p(i)}>${e}</calcite-label></div>`}_getExportSelectionLists(){return this._selectionSets.reduce((e,t)=>{let i=this._getSelectionSetIds(t),s=t.workflowType!=="REFINE"||i.length>0;return!this._downloadActive&&t.download&&s&&(this._downloadActive=!0),s&&e.push(l`<div class="display-flex padding-sides-1 padding-bottom-1"><calcite-checkbox .checked=${t.download} class="align-center" @calciteCheckboxChange=${()=>{this._toggleDownload(t.id)}}></calcite-checkbox><calcite-list class="list-border margin-start-1-2 width-full" id=download-list label><calcite-list-item .disabled=${!t.download} .label=${t.label} @click=${()=>{this._toggleDownload(t.id)}}><div slot=content><div class="list-label">${t.label}</div><div class="list-description">${t.layerView?.layer.title}</div><div class="list-description">${this._translations.selectedFeatures.replace("{{n}}",i.length.toString())}</div></div></calcite-list-item></calcite-list></div>`),e},[])||l`<div></div>`}async _toggleDownload(e){let t=!1;this._selectionSets=this._selectionSets.map(i=>{let s=!1;return i.refineInfos&&Object.keys(i.refineInfos).forEach(a=>{i.refineInfos[a].addIds.length&&(s=!0)}),(i.workflowType!=="REFINE"||s)&&(i.download=i.id===e?!i.download:i.download,t=i.download?!0:t),i}),this._updateExportGraphics(!0),this._downloadActive=t,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _standardExport(){let e=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType==="PDF"){let t="";this._addMap&&this.mapView&&(t=(await this.mapView.takeScreenshot({width:1500,height:2e3}))?.dataUrl),this._fetchingData=!0,this._downloadTools.value&&this._removeDuplicates.value&&this.mapView?.map&&await this._downloadTools.value.downloadPDF(this.mapView.map,e,this._removeDuplicates.value.checked,this._addTitle&&this._titleElement.value?this._titleElement.value.value:"",t),this._fetchingData=!1}this._exportType==="CSV"&&(this._fetchingData=!0,this._downloadTools.value&&this.mapView?.map&&await this._downloadTools.value.downloadCSV(this.mapView.map,e,this._removeDuplicates.value?.checked||!1),this._fetchingData=!1)}_getSelectionIdsAndViews(e,t=!1){return(t?e.filter(i=>i.download):e).reduce((i,s)=>{if(s.workflowType==="REFINE")Object.keys(s.refineInfos).forEach(a=>{let o=s.refineInfos[a];if(o.addIds){let c=o.layerView.layer.id;i=this._updateExportInfos(i,c,s.label,o.addIds,o.layerView)}});else{let a=s?.layerView?.layer.id;a!==void 0&&s.layerView&&(i=this._updateExportInfos(i,a,s.label,s.selectedIds,s.layerView))}return i},{})}_updateExportInfos(e,t,i,s,a){return t&&Object.keys(e).indexOf(t)>-1?(e[t].ids=[...new Set([...e[t].ids,...s])],e[t].selectionSetNames.push(i)):t&&(e[t]={ids:s,layerView:a,selectionSetNames:[i]}),e}_getAction(e,t,i,s,a=!1,o=""){return l`<calcite-action appearance=solid .disabled=${!e} .icon=${t} icon-flip-rtl .indicator=${a} @click=${s} slot=${o??m} .text=${i}></calcite-action>`}_updateForSelection(e){this._numSelected=e.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType("LIST")}async _saveSelection(){let e=await this._selectTools.value?.getSelection();if(e){let t=this._selectTools.value?.isUpdate;this._selectionSets=t?this._selectionSets.map(i=>i.id===e.id?e:i):[...this._selectionSets,e]}return this._home()}async _clearSelection(){await this._selectTools.value?.clearSelection(),this._numSelected=0,this._activeSelection=void 0}async _deleteSelection(e,t){return t.stopPropagation(),this._selectionSets=this._selectionSets.filter((i,s)=>(i.workflowType==="REFINE"&&(this._refineGraphics=[]),s!==e?i:!1)),this._highlightFeatures()}_gotoSelection(e,t){e.selectedIds&&e.layerView&&I(e.selectedIds,e.layerView,t,this.featureHighlightEnabled,this.featureEffect)}_openSelection(e,t){t.stopPropagation(),this._activeSelection=e,this._pageType=e.workflowType==="REFINE"?"REFINE":"SELECT"}async _highlightFeatures(){let e=this._pnStateContextProvider.value;this._clearHighlight();let t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType==="EXPORT"),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){let a=t[i[s]];if(a.layerView&&this.mapView){let o=await C(a.ids,a.layerView,this.mapView);e.highlightHandles.push(o)}}}_checkPopups(){typeof this._popupsEnabled!="boolean"&&(this._popupsEnabled=!!this.mapView?.popupEnabled)}_clearHighlight(){let e=this._pnStateContextProvider.value;e&&e.highlightHandles&&e.removeHandles()}};T("public-notification",y);return y},"Graphic","rest/support/PrintTemplate","rest/support/PrintParameters","rest/print","rest/geoprocessor","request",a,b,c,e)
2
+ import e from"./VJEG4LOG.js";import{a as V}from"./BM666UZR.js";import c from"./4FBEUQIB.js";import"./US5FON7D.js";import"./VVZAS55G.js";import{a as L}from"./DLBZRD4H.js";import"./HBQN25RR.js";import b from"./CEP54NLT.js";import a from"./YVNP437O.js";import{a as E}from"./3AQ7U2PF.js";import"./DIKAKOU5.js";import"./S423P2GA.js";import"./TEHBW75B.js";import"./KU62OLRE.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./3IHLJADI.js";import"./B3R52L7H.js";import"./BDXIKPLU.js";import"./G2ME4BAQ.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LPBP7CBN.js";import"./3FMOO3PJ.js";import"./73AX72WY.js";import"./JUUVYK2H.js";import"./DKD2EGQP.js";import"./4HFHJOS3.js";import"./45M33Q5G.js";import"./FES7B3SJ.js";import{b as T,c as k}from"./NDUAEC62.js";import{F as h,G as d,H as x,J as p,h as S,i as l,l as m,r as w,s as v,u as $}from"./P4KZ6OZF.js";import"./QPIMTXPL.js";export default $arcgis.t(([A,G,M,N,u,f,,{g:C,j:I},{a:P,d:O,e:D,f:R}])=>{var U=S`@layer{:host{display:block;--calcite-input-message-spacing-value: 0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-bottom-0{padding-bottom:0!important}.padding-inline-start-0{padding-inline-start:0!important}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-block-start-1{padding-block-start:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-top-1-2{padding-block-start:.5rem!important}.padding-top-1{padding-top:1rem}.indent-group{border-inline-start:1px solid var(--calcite-color-border-2);margin-bottom:.5rem;padding-inline-start:1rem;margin-inline-start:.5rem}.margin-bottom-0-5{margin-bottom:.5rem}.margin-top-0-5{margin-top:.5rem!important}.instructional-text{line-height:1;padding:0!important;margin:0;color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--2)}.info-blue{color:var(--calcite-color-status-info)}.info-message{justify-content:center;display:grid}.font-bold{font-weight:700}.header-label{font-weight:700;font-size:var(--calcite-font-size-0)}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:.5rem}.margin-top-0{margin-block-start:0!important}.margin-top-1{margin-top:1rem!important}.label-margin-0{--calcite-label-margin-bottom: 0}.list-label{color:var(--calcite-color-text-1);font-weight:var(--calcite-font-weight-bold)!important}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3: var(--calcite-color-brand);--calcite-color-foreground-2: var(--calcite-color-brand-hover);--calcite-color-text-1: var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}.list-container{padding:0 1rem 1rem}.list-items{align-items:center;background-color:#fff;box-shadow:0 1px 3px #0000001a;font-family:sans-serif;padding:12px 16px}.list-item{display:flex;align-items:center;justify-content:space-between}.item-label{color:#4a4a4a;font-size:16px}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);max-width:400px}calcite-segmented-control{--calcite-segmented-control-border-color: var(--calcite-color-border-2)}calcite-segmented-control-item{--calcite-segmented-control-color: var(--calcite-color-text-3)}calcite-segmented-control-item[checked]{--calcite-segmented-control-border-color: var(--calcite-color-surface-highlight);--calcite-segmented-control-background-color: var(--calcite-color-surface-highlight);--calcite-segmented-control-color: var(--calcite-color-text-highlight)}calcite-action-bar{--calcite-internal-action-bar-gap: 0px;--calcite-internal-action-bar-padding: 0px}}`,b=class extends v{constructor(){super(),this.managedLayers={},this.managedTables=[],this.highlightHandles=[]}removeHandles(){this.highlightHandles.forEach(e=>{e?.remove()}),this.highlightHandles=[]}},y=class extends x{constructor(){super(),this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=!1,this.customExport=!1,this.customExportURL="",this.defaultBufferDistance=0,this.defaultBufferUnit="feet",this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.featureHighlightEnabled=!1,this.noResultText="",this.initialNotice="",this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType="PDF",this._fetchingData=!1,this._isMobile=!1,this._numDuplicates=0,this._pageType="LIST",this._saveEnabled=!1,this._selectionSets=[],this._segmentType="STANDARD",this._selectedReportingLayerId="",this._isInitialLoading=!0,this._translations=E({name:"public-notification",blocking:!0}),this._downloadTools=h(),this.layoutTemplateSelectRef=h(),this.reportTemplateSelectRef=h(),this._onboardingImageUrl="",this._popupsEnabled=!1,this._removeDuplicates=h(),this._selectTools=h(),this._refineSelection=h(),this._titleElement=h(),this._titleValue=void 0,this._numSelected=0,this._pnStateContextProvider=L({context:V}),this._refineGraphics=[],this._layoutTemplates=[],this._reportTemplates=[],this._reportTemplatesInfo=[],this.searchConfigurationChange=w(),this.listenOn(window,"selectionSetsChanged",this.selectionSetsChanged),this._pnState=new b,this._pnStateContextProvider.setValue(this._pnState)}static{this.properties={addresseeLayerIds:0,bufferColor:1,bufferOutlineColor:1,customLabelEnabled:5,customExport:5,customExportURL:1,defaultBufferDistance:9,defaultBufferUnit:1,defaultExportTitle:1,defaultNumLabelsPerPage:9,enableLayerFeatures:5,enableLayerFeaturesOnLoad:5,enableSearchDistance:5,enableSearchDistanceOnLoad:5,enableSketchTools:5,featureEffect:0,featureHighlightEnabled:5,mapView:0,noResultText:1,initialNotice:1,searchConfiguration:0,selectionLayerIds:0,showRefineSelection:5,showSearchSettings:5,sketchLineSymbol:0,sketchPointSymbol:0,sketchPolygonSymbol:0,_exportGraphics:16,_addMap:16,_addResults:16,_addTitle:16,_downloadActive:16,_exportType:16,_fetchingData:16,_isMobile:16,_numDuplicates:16,_pageType:16,_saveEnabled:16,_selectionSets:16,_segmentType:16,_selectedReportingLayerId:16,_isInitialLoading:16,_translations:16}}static{this.styles=U}static{this.shadowRootOptions=$}willUpdate(e){e.has("mapView")&&this.mapView&&this.mapViewWatchHandler(this.mapView),e.has("searchConfiguration")&&this.searchConfiguration&&this.watchSearchConfigurationHandler(this.searchConfiguration,e.get("searchConfiguration")),e.has("sketchLineSymbol")&&this.sketchLineSymbolWatchHandler(this.sketchLineSymbol,e.get("sketchLineSymbol")),e.has("sketchPointSymbol")&&this.sketchPointSymbolWatchHandler(this.sketchPointSymbol,e.get("sketchPointSymbol")),e.has("sketchPolygonSymbol")&&this.sketchPolygonSymbolWatchHandler(this.sketchPolygonSymbol,e.get("sketchPolygonSymbol")),e.has("_pageType")&&(this.hasUpdated||this._pageType!=="LIST")&&this.pageTypeWatchHandler(this._pageType,e.get("_pageType"))}async mapViewWatchHandler(e){e?.popup&&(this._popupsEnabled=e?.popupEnabled),this.searchConfiguration&&this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(e,t){let i=JSON.stringify(e);this.mapView&&(i!==JSON.stringify(t)||i&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(i),this._searchConfiguration&&this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setLineSymbol(e)}async sketchPointSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setPointSymbol(e)}async sketchPolygonSymbolWatchHandler(e,t){e&&JSON.stringify(e)!==JSON.stringify(t)&&this._setPolygonSymbol(e)}async pageTypeWatchHandler(e,t){if(this._checkPopups(),this.mapView?.popup&&(this.mapView.popupEnabled=e!=="LIST"?!1:this._popupsEnabled),e==="EXPORT"&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),(t==="SELECT"||t==="REFINE")&&await this._clearSelection(),t==="EXPORT"&&this._removeExportGraphics(),e!=="SELECT")return this._highlightFeatures()}selectionSetsChanged(e){this._selectionSets=[...e.detail]}connectedCallback(){super.connectedCallback(),this._mediaQuery=window.matchMedia("(max-width: 600px)"),this.listenOn(this._mediaQuery,"change",e=>this._setIsMobile(e))}async load(){this._initSymbols(),this._onboardingImageUrl=k("assets/public-notification/images/onboarding.png")}render(){let e=this._isMobile?"footer":"header";return l`<calcite-shell>${this._isInitialLoading?l`<calcite-loader label></calcite-loader>`:l`<calcite-action-bar class="border-bottom-1 action-bar-size" expand-disabled layout=horizontal slot=${e??m}>${this._getActionGroup("list-check","LIST",this._translations.myLists)}${this.showRefineSelection?this._getActionGroup("test-data","REFINE",this._translations.refineSelection):null}${this._getActionGroup("export","EXPORT",this._translations.export)}</calcite-action-bar>${this._getPage(this._pageType)}`}</calcite-shell>`}async loaded(){this.searchConfiguration&&this._initSearchConfiguration(this.searchConfiguration),this.customExport&&this.customExportURL&&await this._setTemplates(),this._isInitialLoading=!1}_initSearchConfiguration(e){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=e,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(e){let t=e?.type==="simple-line";this.sketchLineSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(e){let t=e?.type==="simple-marker";this.sketchPointSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(e){let t=e?.type==="simple-fill";this.sketchPolygonSymbol=t?e:this._jsonUtils?.fromJSON(e||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(e){this._isMobile=e.matches}_getActionGroup(e,t,i){let s=this.showRefineSelection?"w-1-3":"w-1-2";return l`<calcite-action-group class=${p(s)} layout=horizontal><div class="background-override"><calcite-action .active=${this._pageType===t} alignment=center appearance=solid class="width-full height-full" .icon=${e} id=${e??m} @click=${()=>{this._setPageType(t)}} text></calcite-action></div><calcite-tooltip label placement=bottom .referenceElement=${e}><span>${i}</span></calcite-tooltip></calcite-action-group>`}_setPageType(e){this._pageType=e}_getPage(e){let t;switch(e){case"LIST":t=this._getListPage();break;case"SELECT":t=this._getSelectPage();break;case"EXPORT":t=this._getExportPage();break;case"REFINE":t=this._getRefinePage();break}return t}_getListPage(){let e=this._hasSelections(),t=e?this._translations.listHasSetsTip:this.initialNotice!==""?this.initialNotice:this._translations.selectLayerAndAdd;return l`<calcite-panel>${this._getLabel(this._translations.myLists,!1,"header-label")}${this._getNotice(t||"","padding-sides-1 padding-bottom-1","word-wrap-anywhere")}${e?this._getSelectionSetList():this._getOnboardingImage()}<div class="display-flex padding-1"><calcite-button @click=${()=>{this._setPageType("SELECT")}} width=full><span class="font-weight-500">${this._translations.add}</span></calcite-button></div></calcite-panel>`}_getOnboardingImage(){return l`<div class="display-flex padding-sides-1"><img class="img-container" role=presentation src=${this._onboardingImageUrl??m}></div>`}_getSelectionSetList(){return l`<div class="padding-top-1-2 padding-bottom-1-2"><calcite-list class="list-border margin-sides-1" label>${this._selectionSets.reduce((e,t,i)=>{let s=this._getSelectionSetIds(t),a=!0;return t.workflowType==="REFINE"&&(a=Object.keys(t.refineInfos).reduce((o,c)=>{let n=t.refineInfos[c];return o+=n.addIds.length+n.removeIds.length,o},0)>0),a&&e.push(l`<calcite-list-item .label=${t.label} @click=${()=>this.mapView&&this._gotoSelection(t,this.mapView)}><div slot=content><div class="list-label">${t.label}</div><div class="list-description">${t?.layerView?.layer.title}</div><div class="list-description">${this._translations.selectedFeatures.replace("{{n}}",s.length.toString())}</div></div>${this._getAction(!0,"pencil","",o=>this._openSelection(t,o),!1,"actions-end")}${this._getAction(!0,"x","",o=>this._deleteSelection(i,o),!1,"actions-end")}</calcite-list-item>`),e},[])}</calcite-list></div>`}_getSelectionSetIds(e){return e.workflowType!=="REFINE"?e.selectedIds:Object.keys(e.refineInfos).reduce((t,i)=>[...t,...e.refineInfos[i].addIds],[])}_hasSelections(e=!1){let t=[],i=this._selectionSets.some(s=>s.workflowType==="REFINE"?(t=this._getSelectionSetIds(s),!0):!1);return e&&i?t.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){let e=this._getExportInfos(),t=this.mapView?.map&&await P(this.mapView.map,e),i=t&&O(t);return t&&i?t.length-i.length:0}_getExportInfos(){return this._selectionSets.reduce((e,t)=>{if(t.download)if(t.workflowType!=="REFINE"&&t?.layerView){let i=t.layerView.layer.id;i!==void 0&&this._updateIds(i,t.layerView,t.selectedIds,e)}else Object.keys(t.refineInfos).forEach(i=>{let s=t.refineInfos[i];s.addIds.length>0&&this._updateIds(i,s.layerView,s.addIds,e)});return e},{})}_updateIds(e,t,i,s){return s[e]?s[e].ids=s[e].ids.concat(i):s[e]={layerView:t,ids:i},s}_getSelectPage(){let e=this._translations.selectSearchTip;return l`<calcite-panel>${this._getLabel(this._translations?.stepTwoFull,!0,"header-label")}${this._getNotice(e,"padding-1","word-wrap-anywhere")}<div><map-select-tools .bufferColor=${this.bufferColor} .bufferOutlineColor=${this.bufferOutlineColor} class="" .customLabelEnabled=${this.customLabelEnabled} .defaultBufferDistance=${this.defaultBufferDistance} .defaultBufferUnit=${this.defaultBufferUnit} .enableLayerFeatures=${this.enableLayerFeatures} .enableLayerFeaturesOnLoad=${this.enableLayerFeaturesOnLoad} .enableSearchDistance=${this.enableSearchDistance} .enableSearchDistanceOnLoad=${this.enableSearchDistanceOnLoad} .enableSketchTools=${this.enableSketchTools} .enabledLayerIds=${this.addresseeLayerIds} header-label-class .isUpdate=${!!this._activeSelection} .mapView=${this.mapView} .noResultText=${this.noResultText} @selectionSetChange=${this._updateForSelection} .searchConfiguration=${this._searchConfiguration} .searchDistanceEnabled=${this.enableSearchDistanceOnLoad} .selectionLayerIds=${this.selectionLayerIds} .selectionSet=${this._activeSelection} .sketchLineSymbol=${this.sketchLineSymbol} .sketchPointSymbol=${this.sketchPointSymbol} .sketchPolygonSymbol=${this.sketchPolygonSymbol} .useLayerFeaturesEnabled=${this.enableLayerFeaturesOnLoad} ${d(this._selectTools)}></map-select-tools></div>${this._getPageNavButtons(this._translations.done,this._numSelected===0,()=>{this._saveSelection()},this._translations.cancel,!1,()=>{this._home()})}</calcite-panel>`}_getExportPage(){let e=this._hasSelections(this.showRefineSelection),t=this._numDuplicates>0?"display-block":"display-none",i=this.customExport&&this.customExportURL&&this._layoutTemplates.length;return l`<calcite-panel><div>${this._getLabel(this._translations.export,!1,"header-label")}${e?l`<div>${this._getNotice(this._translations.exportTip,"padding-sides-1")}${this._getLabel(this._translations.exportListsLabel,!1,"")}${this._getExportSelectionLists()}<div class=${`padding-sides-1 ${t}`}><div class="display-flex"><calcite-label layout=inline><calcite-checkbox ${d(this._removeDuplicates)}></calcite-checkbox><div class="display-flex">${this._translations.removeDuplicate}<div class="info-message padding-start-1-2"><calcite-input-message class="info-blue margin-top-0" scale=m>${` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`}</calcite-input-message></div></div></calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=remove-duplicates-icon scale=s></calcite-icon></div><calcite-popover closable label overlay-positioning=fixed reference-element=remove-duplicates-icon><span class="tooltip-message">${this._translations.duplicatesTip}</span></calcite-popover></div><div class="border-bottom"></div><div class="segmented-controls padding-top-sides-1">${this._getLabel(this._translations.exportOptions,!0,"","margin-bottom-0-5")}${this._getSegmentedControls()}</div>${i?this._getCustomPrintOptions():l`<div class="padding-1 padding-bottom-0">${this._getExportOptions()}</div>`}<div class="padding-1 display-flex"><calcite-button .disabled=${!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults} .loading=${this._fetchingData} @click=${()=>this._segmentType==="CUSTOM"?this._customExport():void this._standardExport()} width=full><span class="font-weight-500">${this._translations.export}</span></calcite-button></div></div>`:this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")}</div></calcite-panel>`}_customExport(){if(!this.mapView)return;let e=this.layoutTemplateSelectRef.value?this.layoutTemplateSelectRef.value.selectedOption.value:"",t=this.reportTemplateSelectRef.value?this.reportTemplateSelectRef.value.selectedOption.value:"";this._fetchingData=!0;let i=this._reportTemplatesInfo.find(n=>n.reportTemplate===t),s=i?{...i.reportOptions}:{},a=this._selectedReportingLayerId;s?.reportSectionOverrides&&Object.keys(s.reportSectionOverrides).forEach(n=>{s.reportSectionOverrides[n].sourceId=a});let o=new G({layout:e,report:t,format:"pdf",layoutOptions:{titleText:this._titleElement.value?.value},reportOptions:s}),c=new M({view:this.mapView,template:o});N.execute(this.customExportURL,c).then(n=>{let g=this._titleValue;if(!g){let r=this._getSelectionIdsAndViews(this._selectionSets,!0),_=R(r);g=D(_)}n.url&&g&&this._downloadCustomPDF(n.url,g),this._fetchingData=!1}).catch(n=>{this._fetchingData=!1,console.error(n)})}async _downloadCustomPDF(e,t){try{let i=await fetch(e);if(!i.ok)throw new Error(`Failed to fetch PDF: ${i.statusText}`);let s=await i.blob(),a=window.URL.createObjectURL(s),o=document.createElement("a");o.href=a,o.download=t||"download.pdf";let c=document.getElementById("custom-export-div");c&&(c.appendChild(o),o.click(),window.URL.revokeObjectURL(a),c.removeChild(o))}catch(i){console.error("Download failed:",i)}}_exportTypeChange(e){this._exportType=e.target.value}_segmentTypeChange(e){this._titleValue="",this._segmentType=e.target.value}_getSegmentedControls(){return this.customExport&&this.customExportURL&&this._layoutTemplates.length?this._getStandardAndCustomSegmentedControl():this._getPDFAndCSVSementedControl()}_getPDFAndCSVSementedControl(){return l`<calcite-segmented-control class="w-100 calcite-segments" @calciteSegmentedControlChange=${this._exportTypeChange} width=full><calcite-segmented-control-item .checked=${this._exportType==="PDF"} class="w-50 end-border" value=PDF><span class="font-weight-500">${this._translations.pdf}</span></calcite-segmented-control-item><calcite-segmented-control-item .checked=${this._exportType==="CSV"} class="w-50" value=CSV><span class="font-weight-500">${this._translations.csv}</span></calcite-segmented-control-item></calcite-segmented-control>`}_getStandardAndCustomSegmentedControl(){return l`<calcite-segmented-control class="w-100 calcite-segments" @calciteSegmentedControlChange=${this._segmentTypeChange} width=full><calcite-segmented-control-item .checked=${this._segmentType==="STANDARD"} class="w-50 end-border" value=STANDARD><span class="font-weight-500">${this._translations.standard}</span></calcite-segmented-control-item><calcite-segmented-control-item .checked=${this._segmentType==="CUSTOM"} class="w-50" value=CUSTOM><span class="font-weight-500">${this._translations.custom}</span></calcite-segmented-control-item></calcite-segmented-control>`}_getCustomPrintOptions(){return this._segmentType==="STANDARD"?this._getStandardExportOptions():this._getCustomExportOptions()}_getStandardExportOptions(){return l`<div class="padding-1 padding-bottom-0"><calcite-label layout=inline alignment=start scale=m><calcite-radio-button .checked=${this._exportType==="PDF"} scale=m value=PDF @calciteRadioButtonChange=${this._exportTypeChange}></calcite-radio-button>${this._translations.pdf}</calcite-label><div class=indent-group>${this._getExportOptions()}</div><calcite-label layout=inline class="margin-top-1" alignment=start scale=m><calcite-radio-button .checked=${this._exportType==="CSV"} scale=m value=CSV @calciteRadioButtonChange=${this._exportTypeChange}></calcite-radio-button>${this._translations.csv}</calcite-label></div>`}_getCustomExportOptions(){let e=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",t=[],i=this._getSelectionIdsAndViews(this._selectionSets,!0);return Object.keys(i).forEach(s=>{i[s].ids.length&&t.push(s)}),l`<div id=custom-export-div class="padding-top-sides-1"><p class="instructional-text">${this._translations.formattingTip}</p>${t.length>1&&l`<p class="instructional-text margin-top-0-5">${this._translations.selectMatchingInputLayersLabel}</p>`||""}<div class=${"margin-top-1"}>${this._getLabel(this._translations.title,!0,"","none")}<calcite-input-text class="padding-inline-start-0 padding-top-1-2" @calciteInputTextInput=${()=>this._changeTitle()} .placeholder=${this._translations.titlePlaceholder} .value=${e} ${d(this._titleElement)}></calcite-input-text></div><div class=${"margin-top-1"}>${this._getLabel(this._translations.layoutTemplate,!0,"","none")}</div><calcite-select class="padding-inline-start-0 padding-top-1-2" label ${d(this.layoutTemplateSelectRef)}>${this._layoutTemplates.map((s,a)=>l`<calcite-option .selected=${a===0} .value=${s}>${s}</calcite-option>`)}</calcite-select>${this._reportTemplates?.length&&l`<div class=${"margin-top-1"}>${this._getLabel(this._translations.reportTemplate,!0,"","none")}</div><calcite-select class="padding-inline-start-0 padding-top-1-2" label ${d(this.reportTemplateSelectRef)}>${this._reportTemplates.map((s,a)=>l`<calcite-option .selected=${a===0} .value=${s}>${s}</calcite-option>`)}</calcite-select><div class=${"padding-top-sides-1 padding-inline-start-0 display-flex margin-bottom-0-5"}><calcite-label class="label-margin-0" layout=inline>${this._translations.reportLayer}</calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=information id=filter-message-info scale=s></calcite-icon><calcite-popover closable label overlay-positioning=fixed reference-element=filter-message-info><span class="tooltip-message">${this._translations.sourceLayerWarning}</span></calcite-popover></div><map-layer-picker .disabled=${t.length<=1} .enabledLayerIds=${t} .mapView=${this.mapView} @layerSelectionChange=${s=>{this._selectedReportingLayerId=s.detail[0]}} .selectedIds=${[this._selectedReportingLayerId]}></map-layer-picker>`||""}</div>`}async _setTemplates(){let e=this.customExportURL,t=`${e.split("/GPServer")?.[0]}/GPServer`;try{let i=await this.getTasksInfo(t),s="",a=i.tasks?.map(async r=>{await this.getTaskType(r,t)==="GetReportTemplatesInfo"&&(s=`${t}/${r}`)});a&&await Promise.all(a),s&&i.executionType&&await this._fetchReportTemplates(s,i.executionType);let o=(await f(e,{authMode:"auto",responseType:"json",query:{f:"json"}}))?.data,c=o.parameters.find(r=>r.name==="Layout_Template"&&Array.isArray(r.choiceList)),n=o.parameters.find(r=>r.name==="Report_Template"&&Array.isArray(r.choiceList));this._layoutTemplates=c?c.choiceList:[];let g=n?n.choiceList:[];this._reportTemplates=this._reportTemplatesInfo.length?g.filter(r=>this._reportTemplatesInfo.some(_=>_.reportTemplate===r)):[]}catch(i){console.error(i)}}async getTaskType(e,t){if(!e||!t)return Promise.resolve("");let i=`${t}/${e}`;try{let s=(await f(i,{authMode:"auto",responseType:"json",query:{f:"json"}}))?.data?.name||"";return Promise.resolve(s)}catch(s){return console.error(s),Promise.resolve("")}}async getTasksInfo(e){if(!e)return Promise.resolve({});let t=`${e}?f=json`,i={authMode:"auto",responseType:"json",query:{f:"json"}};try{let s=(await f(t,i))?.data,a=s?.tasks,o=s?.executionType==="esriExecutionTypeSynchronous"?"execute":"submitJob";return{tasks:a,supportedOperations:o,executionType:s?.executionType}}catch(s){return console.error(s),{}}}async _fetchReportTemplates(e,t){if(e)try{if(t==="esriExecutionTypeSynchronous"){let i=(await u.execute(e,{}))?.results?.find(s=>s.paramName==="Output_JSON");this._reportTemplatesInfo=i?.value??[]}else{let i=await u.submitJob(e,{});await i.waitForJobCompletion();let s=await i.fetchResultData("Output_JSON");this._reportTemplatesInfo=s?.value??[]}this._reportTemplatesInfo=this._reportTemplatesInfo.filter(i=>{let s=i.reportOptions;if(s?.reportSectionOverrides){let a=0;return Object.keys(s.reportSectionOverrides).forEach(o=>{s.reportSectionOverrides[o].hasOwnProperty("sourceId")&&a++}),a<=1}else return!0})}catch(i){console.error("Failed to fetch report templates:",i)}}_getExportOptions(){let e=this._exportType==="PDF"?"display-block":"display-none",t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",a=this._addResults?"":"display-none";return l`<div class=${p(e)}><p class="instructional-text">${this._translations.selectContentTip}</p><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addResults} @calciteCheckboxChange=${()=>this._addResults=!this._addResults}></calcite-checkbox>${this._translations.addResults}</calcite-label></div><div class=${`indent-group margin-top-1 ${a}`}><div class="margin-bottom-0-5"><calcite-label class="label-margin-0">${this._translations.selectPDFLabelOption}</calcite-label></div><div><pdf-download .defaultNumLabelsPerPage=${Number.parseInt(this.defaultNumLabelsPerPage.toString(),10)} .disabled=${!this._downloadActive} ${d(this._downloadTools)}></pdf-download></div></div><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addTitle} @calciteCheckboxChange=${()=>this._addTitle=!this._addTitle}></calcite-checkbox>${this._translations.title}</calcite-label></div><div class=${`${t} indent-group margin-top-0-5`}><calcite-input-text class="padding-inline-start-0 padding-top-1-2" @calciteInputTextInput=${()=>this._changeTitle()} .placeholder=${this._translations.titlePlaceholder} .value=${s} ${d(this._titleElement)}></calcite-input-text></div><div class="padding-top-sides-1 padding-inline-start-0"><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._addMap} @calciteCheckboxChange=${()=>this._handleAddMapChange()}></calcite-checkbox>${this._translations.includeMap}</calcite-label></div><div class=${`padding-top-sides-1 padding-inline-start-0 ${i}`}><calcite-label class="label-margin-0" layout=inline><calcite-checkbox .checked=${this._exportGraphics} @calciteCheckboxChange=${()=>this._handleExportGraphicsChange()}></calcite-checkbox>${this._translations.listGraphics}</calcite-label><calcite-icon class="padding-start-1-2 icon" .flipRtl=${this._translations._lang?.toLowerCase()!=="he"} icon=question id=list-graphics-icon scale=s></calcite-icon><calcite-popover closable label overlay-positioning=fixed reference-element=list-graphics-icon><span class="tooltip-message">${this._translations.listGraphicsTip}</span></calcite-popover></div></div>`}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(e){let t,i=this._pnStateContextProvider.value;return Object.keys(i.managedLayers).some(s=>{let a=this.mapView?.map.layers.findIndex(o=>o.title===s);return i.managedLayers[s]===e&&a!==void 0?(t=this.mapView?.map.layers.getItemAt(a),!0):!1}),t}_updateExportGraphics(e=!1){(e||!this._exportGraphics||!this._addMap)&&this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){let e=this._getManagedLayer("sketch"),t=this._getManagedLayer("buffer");e&&e.graphics.removeAll(),t&&t.graphics.removeAll()}_addExportGraphics(){let e=this._getManagedLayer("sketch"),t=this._getManagedLayer("buffer");this._refineGraphics.forEach(i=>{e?.add(i.drawnGraphic),t?.add(i.bufferGraphic)}),this._selectionSets.forEach(i=>{if(i.download&&(e&&i.sketchGraphic&&e.graphics.add(i.sketchGraphic),t)){let s={type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}},a=new A({geometry:i.buffer,symbol:s});a&&t.graphics.add(a)}})}_getRefinePage(){let e=this._hasSelections();return l`<calcite-panel>${this._getLabel(this._translations.refineSelection,!1,"header-label")}${e?l`<div>${this._getNotice(this._translations.refineTip,"padding-sides-1")}<refine-selection .enabledLayerIds=${this.selectionLayerIds} .mapView=${this.mapView} .drawnGraphicsArr=${this._refineGraphics} .selectionSets=${this._selectionSets} .sketchLineSymbol=${this.sketchLineSymbol} .sketchPointSymbol=${this.sketchPointSymbol} .sketchPolygonSymbol=${this.sketchPolygonSymbol} .bufferColor=${this.bufferColor} .bufferOutlineColor=${this.bufferOutlineColor} .defaultBufferDistance=${this.defaultBufferDistance} .defaultBufferUnit=${this.defaultBufferUnit} .enableSearchDistance=${this.enableSearchDistance} .enableSearchDistanceOnLoad=${this.enableSearchDistanceOnLoad} .searchDistanceEnabled=${this.enableSearchDistanceOnLoad} ${d(this._refineSelection)}></refine-selection></div>`:this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1")}</calcite-panel>`}_getPageNavButtons(e,t,i,s,a,o){return l`<div class="padding-bottom-1"><div class="display-flex padding-top-sides-1"><calcite-button .disabled=${t} @click=${i} width=full><span class="font-weight-500">${e}</span></calcite-button></div><div class="display-flex padding-top-1-2 padding-sides-1"><calcite-button appearance=outline .disabled=${a} @click=${o} width=full><span class="font-weight-500">${s}</span></calcite-button></div></div>`}_changeTitle(){this._titleElement.value?.value&&(this._titleValue=this._titleElement.value.value||"")}_getNotice(e,t="padding-1",i=""){return l`<calcite-notice class=${p(t)} icon=lightbulb kind=success open><div class=${p(i)} slot=message>${e}</div></calcite-notice>`}_getLabel(e,t=!1,i="font-bold",s="padding-top-sides-1"){return i+=t?" label-margin-0":"",l`<div class=${p(s)}><calcite-label class=${p(i)}>${e}</calcite-label></div>`}_getExportSelectionLists(){return this._selectionSets.reduce((e,t)=>{let i=this._getSelectionSetIds(t),s=t.workflowType!=="REFINE"||i.length>0;return!this._downloadActive&&t.download&&s&&(this._downloadActive=!0),s&&e.push(l`<div class="display-flex padding-sides-1 padding-bottom-1"><calcite-checkbox .checked=${t.download} class="align-center" @calciteCheckboxChange=${()=>{this._toggleDownload(t.id)}}></calcite-checkbox><calcite-list class="list-border margin-start-1-2 width-full" id=download-list label><calcite-list-item .disabled=${!t.download} .label=${t.label} @click=${()=>{this._toggleDownload(t.id)}}><div slot=content><div class="list-label">${t.label}</div><div class="list-description">${t.layerView?.layer.title}</div><div class="list-description">${this._translations.selectedFeatures.replace("{{n}}",i.length.toString())}</div></div></calcite-list-item></calcite-list></div>`),e},[])||l`<div></div>`}async _toggleDownload(e){let t=!1;this._selectionSets=this._selectionSets.map(i=>{let s=!1;return i.refineInfos&&Object.keys(i.refineInfos).forEach(a=>{i.refineInfos[a].addIds.length&&(s=!0)}),(i.workflowType!=="REFINE"||s)&&(i.download=i.id===e?!i.download:i.download,t=i.download?!0:t),i}),this._updateExportGraphics(!0),this._downloadActive=t,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _standardExport(){let e=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType==="PDF"){let t="";this._addMap&&this.mapView&&(t=(await this.mapView.takeScreenshot({width:1500,height:2e3}))?.dataUrl),this._fetchingData=!0,this._downloadTools.value&&this._removeDuplicates.value&&this.mapView?.map&&await this._downloadTools.value.downloadPDF(this.mapView.map,e,this._removeDuplicates.value.checked,this._addTitle&&this._titleElement.value?this._titleElement.value.value:"",t),this._fetchingData=!1}this._exportType==="CSV"&&(this._fetchingData=!0,this._downloadTools.value&&this.mapView?.map&&await this._downloadTools.value.downloadCSV(this.mapView.map,e,this._removeDuplicates.value?.checked||!1),this._fetchingData=!1)}_getSelectionIdsAndViews(e,t=!1){return(t?e.filter(i=>i.download):e).reduce((i,s)=>{if(s.workflowType==="REFINE")Object.keys(s.refineInfos).forEach(a=>{let o=s.refineInfos[a];if(o.addIds){let c=o.layerView.layer.id;i=this._updateExportInfos(i,c,s.label,o.addIds,o.layerView)}});else{let a=s?.layerView?.layer.id;a!==void 0&&s.layerView&&(i=this._updateExportInfos(i,a,s.label,s.selectedIds,s.layerView))}return i},{})}_updateExportInfos(e,t,i,s,a){return t&&Object.keys(e).indexOf(t)>-1?(e[t].ids=[...new Set([...e[t].ids,...s])],e[t].selectionSetNames.push(i)):t&&(e[t]={ids:s,layerView:a,selectionSetNames:[i]}),e}_getAction(e,t,i,s,a=!1,o=""){return l`<calcite-action appearance=solid .disabled=${!e} .icon=${t} icon-flip-rtl .indicator=${a} @click=${s} slot=${o??m} .text=${i}></calcite-action>`}_updateForSelection(e){this._numSelected=e.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType("LIST")}async _saveSelection(){let e=await this._selectTools.value?.getSelection();if(e){let t=this._selectTools.value?.isUpdate;this._selectionSets=t?this._selectionSets.map(i=>i.id===e.id?e:i):[...this._selectionSets,e]}return this._home()}async _clearSelection(){await this._selectTools.value?.clearSelection(),this._numSelected=0,this._activeSelection=void 0}async _deleteSelection(e,t){return t.stopPropagation(),this._selectionSets=this._selectionSets.filter((i,s)=>(i.workflowType==="REFINE"&&(this._refineGraphics=[]),s!==e?i:!1)),this._highlightFeatures()}_gotoSelection(e,t){e.selectedIds&&e.layerView&&I(e.selectedIds,e.layerView,t,this.featureHighlightEnabled,this.featureEffect)}_openSelection(e,t){t.stopPropagation(),this._activeSelection=e,this._pageType=e.workflowType==="REFINE"?"REFINE":"SELECT"}async _highlightFeatures(){let e=this._pnStateContextProvider.value;this._clearHighlight();let t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType==="EXPORT"),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){let a=t[i[s]];if(a.layerView&&this.mapView){let o=await C(a.ids,a.layerView,this.mapView);e.highlightHandles.push(o)}}}_checkPopups(){typeof this._popupsEnabled!="boolean"&&(this._popupsEnabled=!!this.mapView?.popupEnabled)}_clearHighlight(){let e=this._pnStateContextProvider.value;e&&e.highlightHandles&&e.removeHandles()}};T("public-notification",y);return y},"Graphic","rest/support/PrintTemplate","rest/support/PrintParameters","rest/print","rest/geoprocessor","request",a,b,c,e)