@esri/solutions-components 0.8.25 → 0.8.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +6 -6
  2. package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
  3. package/dist/cjs/calcite-alert_4.cjs.entry.js +6 -6
  4. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +1 -1
  5. package/dist/cjs/calcite-flow_6.cjs.entry.js +87 -58
  6. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +7 -7
  7. package/dist/cjs/card-manager_3.cjs.entry.js +2 -2
  8. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  9. package/dist/cjs/crowdsource-reporter.cjs.entry.js +1 -1
  10. package/dist/cjs/deduct-calculator.cjs.entry.js +1 -1
  11. package/dist/cjs/feature-comments.cjs.entry.js +1 -1
  12. package/dist/cjs/feature-form-flow-item.cjs.entry.js +1 -1
  13. package/dist/cjs/feature-list.cjs.entry.js +3 -3
  14. package/dist/cjs/features-flow-item.cjs.entry.js +1 -1
  15. package/dist/cjs/layout-manager.cjs.entry.js +1 -1
  16. package/dist/cjs/list-flow-item.cjs.entry.js +1 -1
  17. package/dist/cjs/loader.cjs.js +1 -1
  18. package/dist/cjs/location-flow-item.cjs.entry.js +1 -1
  19. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  20. package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
  21. package/dist/cjs/public-notification.cjs.entry.js +1 -1
  22. package/dist/cjs/refine-results-flow-item.cjs.entry.js +1 -1
  23. package/dist/cjs/share-item.cjs.entry.js +1 -1
  24. package/dist/cjs/solution-configuration.cjs.entry.js +3 -3
  25. package/dist/cjs/solution-contents_3.cjs.entry.js +3 -3
  26. package/dist/cjs/solution-item-icon.cjs.entry.js +1 -1
  27. package/dist/cjs/solutions-components.cjs.js +1 -1
  28. package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
  29. package/dist/collection/components/create-feature/create-feature.js +82 -50
  30. package/dist/collection/components/create-related-feature/create-related-feature.js +1 -1
  31. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +1 -1
  32. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +1 -1
  33. package/dist/collection/components/deduct-calculator/deduct-calculator.js +1 -1
  34. package/dist/collection/components/delete-button/delete-button.css +4 -0
  35. package/dist/collection/components/delete-button/delete-button.js +2 -2
  36. package/dist/collection/components/edit-card/edit-card.js +1 -1
  37. package/dist/collection/components/feature-comments/feature-comments.js +1 -1
  38. package/dist/collection/components/feature-details/feature-details.js +6 -6
  39. package/dist/collection/components/feature-form-flow-item/feature-form-flow-item.js +1 -1
  40. package/dist/collection/components/feature-list/feature-list.js +3 -3
  41. package/dist/collection/components/features-flow-item/features-flow-item.js +1 -1
  42. package/dist/collection/components/floor-filter/floor-filter.js +1 -1
  43. package/dist/collection/components/info-card/info-card.js +2 -2
  44. package/dist/collection/components/json-editor/json-editor.js +1 -1
  45. package/dist/collection/components/layer-table/layer-table.js +1 -1
  46. package/dist/collection/components/layout-manager/layout-manager.js +1 -1
  47. package/dist/collection/components/list-flow-item/list-flow-item.js +1 -1
  48. package/dist/collection/components/location-flow-item/location-flow-item.js +1 -1
  49. package/dist/collection/components/map-card/map-card.js +1 -1
  50. package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
  51. package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
  52. package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
  53. package/dist/collection/components/map-legend/map-legend.js +1 -1
  54. package/dist/collection/components/map-picker/map-picker.js +1 -1
  55. package/dist/collection/components/map-search/map-search.js +1 -1
  56. package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
  57. package/dist/collection/components/map-tools/map-tools.js +1 -1
  58. package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
  59. package/dist/collection/components/pdf-download/pdf-download.js +1 -1
  60. package/dist/collection/components/public-notification/public-notification.js +1 -1
  61. package/dist/collection/components/refine-results-flow-item/refine-results-flow-item.js +1 -1
  62. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  63. package/dist/collection/components/share-item/share-item.js +1 -1
  64. package/dist/collection/components/solution-configuration/solution-configuration.js +3 -3
  65. package/dist/collection/components/solution-contents/solution-contents.js +1 -1
  66. package/dist/collection/components/solution-item/solution-item.js +1 -1
  67. package/dist/collection/components/solution-item-details/solution-item-details.js +1 -1
  68. package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
  69. package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
  70. package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -1
  71. package/dist/collection/components/solution-resource-item/solution-resource-item.js +1 -1
  72. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +1 -1
  73. package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
  74. package/dist/collection/components/solution-variables/solution-variables.js +1 -1
  75. package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
  76. package/dist/components/create-feature2.js +90 -53
  77. package/dist/components/create-related-feature2.js +1 -1
  78. package/dist/components/crowdsource-manager.js +1 -1
  79. package/dist/components/crowdsource-reporter.js +1 -1
  80. package/dist/components/deduct-calculator2.js +1 -1
  81. package/dist/components/delete-button2.js +3 -3
  82. package/dist/components/edit-card2.js +1 -1
  83. package/dist/components/feature-comments.js +1 -1
  84. package/dist/components/feature-details2.js +6 -6
  85. package/dist/components/feature-form-flow-item.js +1 -1
  86. package/dist/components/feature-list2.js +3 -3
  87. package/dist/components/features-flow-item.js +1 -1
  88. package/dist/components/floor-filter2.js +1 -1
  89. package/dist/components/info-card2.js +2 -2
  90. package/dist/components/json-editor2.js +1 -1
  91. package/dist/components/layer-table2.js +1 -1
  92. package/dist/components/layout-manager.js +1 -1
  93. package/dist/components/list-flow-item.js +1 -1
  94. package/dist/components/location-flow-item.js +1 -1
  95. package/dist/components/map-card2.js +1 -1
  96. package/dist/components/map-draw-tools2.js +1 -1
  97. package/dist/components/map-fullscreen2.js +1 -1
  98. package/dist/components/map-layer-picker2.js +1 -1
  99. package/dist/components/map-legend2.js +1 -1
  100. package/dist/components/map-picker2.js +1 -1
  101. package/dist/components/map-search2.js +1 -1
  102. package/dist/components/map-select-tools2.js +1 -1
  103. package/dist/components/map-tools2.js +1 -1
  104. package/dist/components/pci-calculator.js +1 -1
  105. package/dist/components/pdf-download2.js +1 -1
  106. package/dist/components/public-notification.js +1 -1
  107. package/dist/components/refine-results-flow-item.js +1 -1
  108. package/dist/components/refine-selection2.js +1 -1
  109. package/dist/components/share-item.js +1 -1
  110. package/dist/components/solution-configuration.js +3 -3
  111. package/dist/components/solution-contents2.js +1 -1
  112. package/dist/components/solution-item-details2.js +1 -1
  113. package/dist/components/solution-item-icon2.js +1 -1
  114. package/dist/components/solution-item-sharing2.js +1 -1
  115. package/dist/components/solution-item2.js +1 -1
  116. package/dist/components/solution-organization-variables2.js +1 -1
  117. package/dist/components/solution-resource-item2.js +1 -1
  118. package/dist/components/solution-spatial-ref2.js +1 -1
  119. package/dist/components/solution-template-data2.js +1 -1
  120. package/dist/components/solution-variables2.js +1 -1
  121. package/dist/components/spatial-ref2.js +1 -1
  122. package/dist/esm/basemap-gallery_7.entry.js +6 -6
  123. package/dist/esm/buffer-tools_3.entry.js +1 -1
  124. package/dist/esm/calcite-alert_4.entry.js +6 -6
  125. package/dist/esm/calcite-dropdown-group_2.entry.js +1 -1
  126. package/dist/esm/calcite-flow_6.entry.js +87 -58
  127. package/dist/esm/calcite-shell-panel_14.entry.js +7 -7
  128. package/dist/esm/card-manager_3.entry.js +2 -2
  129. package/dist/esm/crowdsource-manager.entry.js +1 -1
  130. package/dist/esm/crowdsource-reporter.entry.js +1 -1
  131. package/dist/esm/deduct-calculator.entry.js +1 -1
  132. package/dist/esm/feature-comments.entry.js +1 -1
  133. package/dist/esm/feature-form-flow-item.entry.js +1 -1
  134. package/dist/esm/feature-list.entry.js +3 -3
  135. package/dist/esm/features-flow-item.entry.js +1 -1
  136. package/dist/esm/layout-manager.entry.js +1 -1
  137. package/dist/esm/list-flow-item.entry.js +1 -1
  138. package/dist/esm/loader.js +1 -1
  139. package/dist/esm/location-flow-item.entry.js +1 -1
  140. package/dist/esm/map-select-tools_3.entry.js +3 -3
  141. package/dist/esm/pci-calculator.entry.js +1 -1
  142. package/dist/esm/public-notification.entry.js +1 -1
  143. package/dist/esm/refine-results-flow-item.entry.js +1 -1
  144. package/dist/esm/share-item.entry.js +1 -1
  145. package/dist/esm/solution-configuration.entry.js +3 -3
  146. package/dist/esm/solution-contents_3.entry.js +3 -3
  147. package/dist/esm/solution-item-icon.entry.js +1 -1
  148. package/dist/esm/solutions-components.js +1 -1
  149. package/dist/esm/spatial-ref.entry.js +1 -1
  150. package/dist/solutions-components/{p-2c044250.entry.js → p-053be79f.entry.js} +2 -2
  151. package/dist/solutions-components/{p-1ff9eb95.entry.js → p-05b3a5d9.entry.js} +1 -1
  152. package/dist/solutions-components/p-0d17246a.entry.js +6 -0
  153. package/dist/solutions-components/{p-b3160299.entry.js → p-1e915546.entry.js} +1 -1
  154. package/dist/solutions-components/{p-97e343df.entry.js → p-1f4b174f.entry.js} +1 -1
  155. package/dist/solutions-components/p-27e9ea86.entry.js +6 -0
  156. package/dist/solutions-components/{p-72317f8e.entry.js → p-296375d3.entry.js} +2 -2
  157. package/dist/solutions-components/{p-af4be4ce.entry.js → p-2a6db6e8.entry.js} +1 -1
  158. package/dist/solutions-components/p-4870be89.entry.js +6 -0
  159. package/dist/solutions-components/p-51b5ac05.entry.js +6 -0
  160. package/dist/solutions-components/{p-686fa7ce.entry.js → p-66722851.entry.js} +1 -1
  161. package/dist/solutions-components/{p-f35cc7ae.entry.js → p-81747268.entry.js} +1 -1
  162. package/dist/solutions-components/{p-84a5d221.entry.js → p-92eadd14.entry.js} +1 -1
  163. package/dist/solutions-components/{p-fc665a1a.entry.js → p-96c901b4.entry.js} +1 -1
  164. package/dist/solutions-components/p-9cfc59dd.entry.js +6 -0
  165. package/dist/solutions-components/{p-16730f05.entry.js → p-b656b73e.entry.js} +1 -1
  166. package/dist/solutions-components/{p-8c500fd7.entry.js → p-bfdabb9d.entry.js} +1 -1
  167. package/dist/solutions-components/p-c5becad1.entry.js +6 -0
  168. package/dist/solutions-components/{p-102b1f94.entry.js → p-cb20ba34.entry.js} +1 -1
  169. package/dist/solutions-components/p-cd694107.entry.js +17 -0
  170. package/dist/solutions-components/p-e1662e32.entry.js +6 -0
  171. package/dist/solutions-components/p-eda6994e.entry.js +6 -0
  172. package/dist/solutions-components/{p-bf57dbfd.entry.js → p-edcc1f23.entry.js} +1 -1
  173. package/dist/solutions-components/p-f7b791a8.entry.js +6 -0
  174. package/dist/solutions-components/p-fac36b42.entry.js +6 -0
  175. package/dist/solutions-components/{p-33845a79.entry.js → p-fd28754c.entry.js} +1 -1
  176. package/dist/solutions-components/solutions-components.esm.js +1 -1
  177. package/dist/types/components/create-feature/create-feature.d.ts +21 -3
  178. package/package.json +1 -1
  179. package/dist/solutions-components/p-28c6906c.entry.js +0 -6
  180. package/dist/solutions-components/p-3470c0f7.entry.js +0 -6
  181. package/dist/solutions-components/p-3fae9775.entry.js +0 -6
  182. package/dist/solutions-components/p-5b817c98.entry.js +0 -6
  183. package/dist/solutions-components/p-71de367b.entry.js +0 -6
  184. package/dist/solutions-components/p-8a81f3c7.entry.js +0 -6
  185. package/dist/solutions-components/p-aa06f4d1.entry.js +0 -6
  186. package/dist/solutions-components/p-b76b5310.entry.js +0 -6
  187. package/dist/solutions-components/p-c047a6fc.entry.js +0 -6
  188. package/dist/solutions-components/p-c2ec0dcc.entry.js +0 -17
  189. package/dist/solutions-components/p-e9176a44.entry.js +0 -6
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as e,h as i,H as a,g as s}from"./p-6d753a3d.js";import{s as c}from"./p-c8260cf0.js";import{g as l}from"./p-896c9644.js";import{n}from"./p-89a0889f.js";import"./p-bdcf99c0.js";import"./p-c1cf3ebc.js";import"./p-334e6394.js";import"./p-82e085d0.js";import"./p-a230b270.js";import"./p-530b73ce.js";const r=class{constructor(i){t(this,i),this.solutionItemSelected=e(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}valueWatchHandler(t,e){t&&t!==e&&Array.isArray(t)&&t.length>0&&this._treeItemSelected(t[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return i(a,{key:"33b390d73c09e1c8600b44b3037aa101cf9acc84"},i("calcite-tree",{key:"c069c9ab2c75050ac4d15a158422fc012eeddec9"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(t){return t.map((t=>{const e=this.selectedItemId&&this.selectedItemId===t.id;return t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this.renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title))}))}_treeItemSelected(t,e){var i;const a=null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.closest("calcite-tree-item");a&&(a.expanded=!(null==a?void 0:a.expanded)),this.selectedItemId=t,this.solutionItemSelected.emit(t)}static get assetsDirs(){return["item-type-icons"]}get el(){return s(this)}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};r.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const o=class{constructor(e){t(this,e),this.authentication=void 0,this.itemId="",this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}itemIdWatchHandler(){const t=c.getItemInfo(this.itemId);this.itemType=t.type}async componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"8e89133e43142d3dbc612fea40cc02b735624528"},i("div",{key:"48c3774d21fe252315f0e144b8dbd37d0e4c61a9",class:"configuration-container"},i("div",{key:"5ac53ca102edf4e738c2aa21c15f013bc5f11f78",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.groupDetailsTab),i("calcite-tab-title",null,this._translations.sharingTab)),i("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"share-tab"},i("solution-item-sharing",{"group-id":this.itemId})))}_showItemTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.itemDetailsTab),i("calcite-tab-title",null,this._translations.dataTab),i("calcite-tab-title",null,this._translations.propertiesTab),i("calcite-tab-title",null,this._translations.resourcesTab)),i("calcite-tab",{class:"config-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"data-tab"},i("solution-template-data",{instanceid:"data","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"props-tab"},i("solution-template-data",{instanceid:"properties","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"resources-tab"},i("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId})))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};o.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const h=class{constructor(i){t(this,i),this.featureServiceSpatialReferenceChange=e(this,"featureServiceSpatialReferenceChange",7),this.lockedSpatialReferenceChange=e(this,"lockedSpatialReferenceChange",7),this.defaultWkid=102100,this.loaded=!1,this.locked=!0,this.services=[],this.value=this.defaultWkid.toString(),this._srSearchText=void 0,this._translations=void 0}lockedChanged(t){t||this._setFeatureServiceDefaults(this.services),this.lockedSpatialReferenceChange.emit({locked:t})}componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"fe1a18b245d01184a874e538f131cd8665f3e816"},i("div",{key:"6d561e26c7c07860ff3ee8ac04e1c2c940424f1e",class:"spatial-ref"},i("div",{key:"1cdccd9bdb6768ba7565044a82aafd5b8384c06c",class:"spatial-ref-desc"},i("calcite-label",{key:"d8e11b3a7c1aec65073113215519d9a5390196a5"},this._translations.paramDescription)),i("label",{key:"207f2efdda90f8f1312414f93709be208df18e37",class:"switch-label"},i("calcite-switch",{key:"9040d067f9a3809cfebcec2e460e8f900a4e1806",checked:!this.locked,class:"spatial-ref-switch",onCalciteSwitchChange:t=>this._updateLocked(t),scale:"m"}),this._translations.specifyParam),i("div",{key:"fc92e2bb1bbd7ea257fe01c75aa02b5ca541d2c3",class:"spatial-ref-component",id:"spatialRefDefn"},i("calcite-label",{key:"534d7b0a1b7d479ce74cb4ef6e2c0934a29a1996"},this._translations.spatialReferenceInfo,i("label",{key:"2e9bf13ad3a5fa5264816fb96ab3dc8e7b51d46b",class:"spatial-ref-default"},i("spatial-ref",{key:"8beeb6ddb1ca1c4253bd09388951db1785fd1385",defaultWkid:this.defaultWkid,disabled:this.locked,value:this.value}))),this._getFeatureServices(this.services))))}spatialReferenceChange(t){this.value=t.detail.newValue}_updateLocked(t){this.locked=!t.target.checked,this._updateStore(),this.loaded||(t.target.checked&&this._setFeatureServiceDefaults(this.services),this.loaded=!0)}_setFeatureServiceDefaults(t){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((t=>t.checked=!0)),t.forEach((t=>this._updateEnabledServices({detail:{switched:!0}},t)))}_getFeatureServices(t){const e=c.getStoreInfo("spatialReferenceInfo"),a=t.filter((t=>Object.keys(e.services).some((e=>e===t))));return a&&a.length>0?i("div",null,i("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),a.map((t=>i("label",{class:"switch-label"},i("calcite-switch",{checked:e.services[t],class:"spatial-ref-item-switch",disabled:this.locked,onCalciteSwitchChange:e=>this._updateEnabledServices(e,t),scale:"m"}),t)))):null}_updateStore(){const t=c.getStoreInfo("spatialReferenceInfo");t.enabled=!this.locked,t.spatialReference=this.value,c.setStoreInfo("spatialReferenceInfo",t)}_updateEnabledServices(t,e){const i=c.getStoreInfo("spatialReferenceInfo");i.services[e]=t.target.checked,c.setStoreInfo("spatialReferenceInfo",i),this.featureServiceSpatialReferenceChange.emit({name:e,enabled:t.target.checked})}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{locked:["lockedChanged"]}}};h.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-default{margin:0px}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{margin:0.25rem;font-size:0.875rem;line-height:1.25rem}.disabled-div{pointer-events:none;opacity:0.4}.spatial-ref-desc{padding-bottom:0.5rem;padding-inline-start:0.25rem}";export{r as solution_contents,o as solution_item,h as solution_spatial_ref}
6
+ import{r as t,c as e,h as i,H as a,g as s}from"./p-6d753a3d.js";import{s as c}from"./p-c8260cf0.js";import{g as l}from"./p-896c9644.js";import{n}from"./p-89a0889f.js";import"./p-bdcf99c0.js";import"./p-c1cf3ebc.js";import"./p-334e6394.js";import"./p-82e085d0.js";import"./p-a230b270.js";import"./p-530b73ce.js";const r=class{constructor(i){t(this,i),this.solutionItemSelected=e(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}valueWatchHandler(t,e){t&&t!==e&&Array.isArray(t)&&t.length>0&&this._treeItemSelected(t[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return i(a,{key:"7546d1fe9d944520db9f8f81600fb7cf0655f1ab"},i("calcite-tree",{key:"94bea7616cd3bdbb9fbcaddd49bb394e11bcf88b"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(t){return t.map((t=>{const e=this.selectedItemId&&this.selectedItemId===t.id;return t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this.renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title))}))}_treeItemSelected(t,e){var i;const a=null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.closest("calcite-tree-item");a&&(a.expanded=!(null==a?void 0:a.expanded)),this.selectedItemId=t,this.solutionItemSelected.emit(t)}static get assetsDirs(){return["item-type-icons"]}get el(){return s(this)}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};r.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const o=class{constructor(e){t(this,e),this.authentication=void 0,this.itemId="",this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}itemIdWatchHandler(){const t=c.getItemInfo(this.itemId);this.itemType=t.type}async componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"46215591e1f5c87fc30b116fbeeeef5e7eb29b19"},i("div",{key:"dbcb49c592eca9f30b44fb3e8a35d0433ed517d3",class:"configuration-container"},i("div",{key:"9f97e7c2a6a912f3d57d1bc840cab02d13860da2",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.groupDetailsTab),i("calcite-tab-title",null,this._translations.sharingTab)),i("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"share-tab"},i("solution-item-sharing",{"group-id":this.itemId})))}_showItemTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.itemDetailsTab),i("calcite-tab-title",null,this._translations.dataTab),i("calcite-tab-title",null,this._translations.propertiesTab),i("calcite-tab-title",null,this._translations.resourcesTab)),i("calcite-tab",{class:"config-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"data-tab"},i("solution-template-data",{instanceid:"data","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"props-tab"},i("solution-template-data",{instanceid:"properties","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"resources-tab"},i("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId})))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};o.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const d=class{constructor(i){t(this,i),this.featureServiceSpatialReferenceChange=e(this,"featureServiceSpatialReferenceChange",7),this.lockedSpatialReferenceChange=e(this,"lockedSpatialReferenceChange",7),this.defaultWkid=102100,this.loaded=!1,this.locked=!0,this.services=[],this.value=this.defaultWkid.toString(),this._srSearchText=void 0,this._translations=void 0}lockedChanged(t){t||this._setFeatureServiceDefaults(this.services),this.lockedSpatialReferenceChange.emit({locked:t})}componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"2a12d415e9408b646365ace8e3e82138be70f343"},i("div",{key:"f58d6782ac4065f67dd0205271b05d4c0c31d8dc",class:"spatial-ref"},i("div",{key:"5267f203f1c63c5e900b0ead8798f3561d225d42",class:"spatial-ref-desc"},i("calcite-label",{key:"1183f8ee9274be1980dc889ca52f5d0c6a6994af"},this._translations.paramDescription)),i("label",{key:"5367f57784a20501505b0e9cfdd345a8de3fce93",class:"switch-label"},i("calcite-switch",{key:"2d79a69e64f28b6e2aeed52b0b0aa4034ebb6c57",checked:!this.locked,class:"spatial-ref-switch",onCalciteSwitchChange:t=>this._updateLocked(t),scale:"m"}),this._translations.specifyParam),i("div",{key:"60ab36865749f4c59798bf51ff1b5264a3eeeefc",class:"spatial-ref-component",id:"spatialRefDefn"},i("calcite-label",{key:"bc0b446d1f7b0a62f49b579ac0e5f8da33531ed9"},this._translations.spatialReferenceInfo,i("label",{key:"5f2135d975e2254429c8d6a14fe2f2a91fdc3fb9",class:"spatial-ref-default"},i("spatial-ref",{key:"be7c105e3cebba4eed80c88e8b4d539affb67e0e",defaultWkid:this.defaultWkid,disabled:this.locked,value:this.value}))),this._getFeatureServices(this.services))))}spatialReferenceChange(t){this.value=t.detail.newValue}_updateLocked(t){this.locked=!t.target.checked,this._updateStore(),this.loaded||(t.target.checked&&this._setFeatureServiceDefaults(this.services),this.loaded=!0)}_setFeatureServiceDefaults(t){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((t=>t.checked=!0)),t.forEach((t=>this._updateEnabledServices({detail:{switched:!0}},t)))}_getFeatureServices(t){const e=c.getStoreInfo("spatialReferenceInfo"),a=t.filter((t=>Object.keys(e.services).some((e=>e===t))));return a&&a.length>0?i("div",null,i("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),a.map((t=>i("label",{class:"switch-label"},i("calcite-switch",{checked:e.services[t],class:"spatial-ref-item-switch",disabled:this.locked,onCalciteSwitchChange:e=>this._updateEnabledServices(e,t),scale:"m"}),t)))):null}_updateStore(){const t=c.getStoreInfo("spatialReferenceInfo");t.enabled=!this.locked,t.spatialReference=this.value,c.setStoreInfo("spatialReferenceInfo",t)}_updateEnabledServices(t,e){const i=c.getStoreInfo("spatialReferenceInfo");i.services[e]=t.target.checked,c.setStoreInfo("spatialReferenceInfo",i),this.featureServiceSpatialReferenceChange.emit({name:e,enabled:t.target.checked})}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{locked:["lockedChanged"]}}};d.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-default{margin:0px}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{margin:0.25rem;font-size:0.875rem;line-height:1.25rem}.disabled-div{pointer-events:none;opacity:0.4}.spatial-ref-desc{padding-bottom:0.5rem;padding-inline-start:0.25rem}";export{r as solution_contents,o as solution_item,d as solution_spatial_ref}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as e,h as a,a as t,g as i}from"./p-6d753a3d.js";const o=class{constructor(a){e(this,a),this.isPortal=!1,this.type="",this.typeKeywords=[]}render(){return a("div",{key:"af7ed92c2a03f419d04b4dd22b3f5220eb27c444",title:this.type},a("img",{key:"47c91501abf1fad1cec04b4175a1799a6287127b",class:"item-type-icon item-type-icon-margin",height:"16",src:this._getIconUrl(this.type,this.typeKeywords),width:"16"}))}_getIconUrl(e,a){const i=e&&e.toLowerCase()||"";let o=!1,r=!1,s=!1,n=!1,c=!1,p=!1,l="";return a=a||[],i.indexOf("service")>0||"feature collection"===i||"kml"===i||"wms"===i||"wmts"===i||"wfs"===i?(o=a.indexOf("Hosted Service")>-1,"feature service"===i||"feature collection"===i||"kml"===i||"wfs"===i?(n=a.indexOf("Table")>-1,r=a.indexOf("Route Layer")>-1,s=a.indexOf("Markup")>-1,c=-1!==a.indexOf("Spatiotemporal"),l=c&&n?"spatiotemporaltable":n?"table":r?"routelayer":s?"markup":c?"spatiotemporal":o?"featureshosted":"features"):"map service"===i||"wms"===i||"wmts"===i?(c=-1!==a.indexOf("Spatiotemporal"),p=-1!==a.indexOf("Relational"),l=c||p?"mapimages":o||a.indexOf("Tiled")>-1||"wmts"===i?"maptiles":"mapimages"):l="scene service"===i?a.indexOf("Line")>-1?"sceneweblayerline":a.indexOf("3DObject")>-1?"sceneweblayermultipatch":a.indexOf("Point")>-1?"sceneweblayerpoint":a.indexOf("IntegratedMesh")>-1?"sceneweblayermesh":a.indexOf("PointCloud")>-1?"sceneweblayerpointcloud":a.indexOf("Polygon")>-1?"sceneweblayerpolygon":a.indexOf("Building")>-1?"sceneweblayerbuilding":"sceneweblayer":"image service"===i?a.indexOf("Elevation 3D Layer")>-1?"elevationlayer":a.indexOf("Tiled Imagery")>-1?"tiledimagerylayer":"imagery":"stream service"===i?"streamlayer":"vector tile service"===i?"vectortile":"datastore catalog service"===i?"datastorecollection":"geocoding service"===i?"geocodeservice":"geoprocessing service"===i&&a.indexOf("Web Tool")>-1&&this.isPortal?"tool":"layers"):l="web map"===i||"cityengine web scene"===i?"maps":"web scene"===i?a.indexOf("ViewingMode-Local")>-1?"webscenelocal":"websceneglobal":"web mapping application"===i||"mobile application"===i||"application"===i||"operation view"===i||"desktop application"===i?"apps":"map document"===i||"map package"===i||"published map"===i||"scene document"===i||"globe document"===i||"basemap package"===i||"mobile basemap package"===i||"mobile map package"===i||"project package"===i||"project template"===i||"pro map"===i||"layout"===i||"layer"===i&&a.indexOf("ArcGIS Pro")>-1||"explorer map"===i&&a.indexOf("Explorer Document")?"mapsgray":"service definition"===i||"csv"===i||"shapefile"===i||"cad drawing"===i||"geojson"===i||"360 vr experience"===i||"netcdf"===i||"administrative report"===i?"datafiles":"explorer add in"===i||"desktop add in"===i||"windows viewer add in"===i||"windows viewer configuration"===i?"appsgray":"arcgis pro add in"===i||"arcgis pro configuration"===i?"addindesktop":"rule package"===i||"file geodatabase"===i||"sqlite geodatabase"===i||"csv collection"===i||"kml collection"===i||"windows mobile package"===i||"map template"===i||"desktop application template"===i||"gml"===i||"arcpad package"===i||"code sample"===i||"form"===i||"document link"===i||"operations dashboard add in"===i||"rules package"===i||"image"===i||"workflow manager package"===i||"explorer map"===i&&a.indexOf("Explorer Mapping Application")>-1||a.indexOf("Document")>-1?"datafilesgray":"network analysis service"===i||"geoprocessing service"===i||"geodata service"===i||"geometry service"===i||"geoprocessing package"===i||"locator package"===i||"geoprocessing sample"===i||"workflow manager service"===i?"toolsgray":"layer"===i||"layer package"===i||"explorer layer"===i?"layersgray":"scene package"===i?"scenepackage":"mobile scene package"===i?"mobilescenepackage":"tile package"===i||"compact tile package"===i?"tilepackage":"task file"===i?"taskfile":"report template"===i?"report-template":"statistical data collection"===i?"statisticaldatacollection":"insights workbook"===i?"workbook":"insights model"===i?"insightsmodel":"insights page"===i?"insightspage":"insights theme"===i?"insightstheme":"hub initiative"===i?"hubinitiative":"hub page"===i?"hubpage":"hub site application"===i?"hubsite":"hub event"===i?"hubevent":"relational database connection"===i?"relationaldatabaseconnection":"big data file share"===i?"datastorecollection":"image collection"===i?"imagecollection":"desktop style"===i?"desktopstyle":"style"===i?"style":"dashboard"===i?"dashboard":"raster function template"===i?"rasterprocessingtemplate":"vector tile package"===i?"vectortilepackage":"ortho mapping project"===i?"orthomappingproject":"ortho mapping template"===i?"orthomappingtemplate":"solution"===i?"solutions":"geopackage"===i?"geopackage":"deep learning package"===i?"deeplearningpackage":"real time analytic"===i?"realtimeanalytics":"big data analytic"===i?"bigdataanalytics":"feed"===i?"feed":"excalibur imagery project"===i?"excaliburimageryproject":"notebook"===i?"notebook":"storymap"===i?"storymap":"survey123 add in"===i?"survey123addin":"mission"===i?"mission":"mission report"===i?"missionreport":"quickcapture project"===i?"quickcaptureproject":"pro report"===i?"proreport":"urban model"===i?"urbanmodel":"web experience"===i?"experiencebuilder":"web experience template"===i?"webexperiencetemplate":"workflow"===i?"workflow":"kernel gateway connection"===i?"kernelgatewayconnection":"insights script"===i?"insightsscript":"hub initiative template"===i?"hubinitiativetemplate":"storymap theme"===i?"storymaptheme":"group"===i?"group":"maps",l?t("./item-icons/"+l+"16.png"):null}static get assetsDirs(){return["item-icons"]}get el(){return i(this)}};o.style=".item-type-icon{pointer-events:none;display:block;height:1rem;margin-top:0.15em !important;min-width:16px;fill:currentColor;transform:rotate(360deg)}.item-type-icon-margin{margin-inline-end:0.375rem}";export{o as solution_item_icon}
6
+ import{r as e,h as a,a as t,g as i}from"./p-6d753a3d.js";const o=class{constructor(a){e(this,a),this.isPortal=!1,this.type="",this.typeKeywords=[]}render(){return a("div",{key:"3b732e3c889dc83eb649af9d66742304e549d229",title:this.type},a("img",{key:"262f4891209996264e8c0248c926a60f71b9e674",class:"item-type-icon item-type-icon-margin",height:"16",src:this._getIconUrl(this.type,this.typeKeywords),width:"16"}))}_getIconUrl(e,a){const i=e&&e.toLowerCase()||"";let o=!1,r=!1,s=!1,n=!1,c=!1,p=!1,l="";return a=a||[],i.indexOf("service")>0||"feature collection"===i||"kml"===i||"wms"===i||"wmts"===i||"wfs"===i?(o=a.indexOf("Hosted Service")>-1,"feature service"===i||"feature collection"===i||"kml"===i||"wfs"===i?(n=a.indexOf("Table")>-1,r=a.indexOf("Route Layer")>-1,s=a.indexOf("Markup")>-1,c=-1!==a.indexOf("Spatiotemporal"),l=c&&n?"spatiotemporaltable":n?"table":r?"routelayer":s?"markup":c?"spatiotemporal":o?"featureshosted":"features"):"map service"===i||"wms"===i||"wmts"===i?(c=-1!==a.indexOf("Spatiotemporal"),p=-1!==a.indexOf("Relational"),l=c||p?"mapimages":o||a.indexOf("Tiled")>-1||"wmts"===i?"maptiles":"mapimages"):l="scene service"===i?a.indexOf("Line")>-1?"sceneweblayerline":a.indexOf("3DObject")>-1?"sceneweblayermultipatch":a.indexOf("Point")>-1?"sceneweblayerpoint":a.indexOf("IntegratedMesh")>-1?"sceneweblayermesh":a.indexOf("PointCloud")>-1?"sceneweblayerpointcloud":a.indexOf("Polygon")>-1?"sceneweblayerpolygon":a.indexOf("Building")>-1?"sceneweblayerbuilding":"sceneweblayer":"image service"===i?a.indexOf("Elevation 3D Layer")>-1?"elevationlayer":a.indexOf("Tiled Imagery")>-1?"tiledimagerylayer":"imagery":"stream service"===i?"streamlayer":"vector tile service"===i?"vectortile":"datastore catalog service"===i?"datastorecollection":"geocoding service"===i?"geocodeservice":"geoprocessing service"===i&&a.indexOf("Web Tool")>-1&&this.isPortal?"tool":"layers"):l="web map"===i||"cityengine web scene"===i?"maps":"web scene"===i?a.indexOf("ViewingMode-Local")>-1?"webscenelocal":"websceneglobal":"web mapping application"===i||"mobile application"===i||"application"===i||"operation view"===i||"desktop application"===i?"apps":"map document"===i||"map package"===i||"published map"===i||"scene document"===i||"globe document"===i||"basemap package"===i||"mobile basemap package"===i||"mobile map package"===i||"project package"===i||"project template"===i||"pro map"===i||"layout"===i||"layer"===i&&a.indexOf("ArcGIS Pro")>-1||"explorer map"===i&&a.indexOf("Explorer Document")?"mapsgray":"service definition"===i||"csv"===i||"shapefile"===i||"cad drawing"===i||"geojson"===i||"360 vr experience"===i||"netcdf"===i||"administrative report"===i?"datafiles":"explorer add in"===i||"desktop add in"===i||"windows viewer add in"===i||"windows viewer configuration"===i?"appsgray":"arcgis pro add in"===i||"arcgis pro configuration"===i?"addindesktop":"rule package"===i||"file geodatabase"===i||"sqlite geodatabase"===i||"csv collection"===i||"kml collection"===i||"windows mobile package"===i||"map template"===i||"desktop application template"===i||"gml"===i||"arcpad package"===i||"code sample"===i||"form"===i||"document link"===i||"operations dashboard add in"===i||"rules package"===i||"image"===i||"workflow manager package"===i||"explorer map"===i&&a.indexOf("Explorer Mapping Application")>-1||a.indexOf("Document")>-1?"datafilesgray":"network analysis service"===i||"geoprocessing service"===i||"geodata service"===i||"geometry service"===i||"geoprocessing package"===i||"locator package"===i||"geoprocessing sample"===i||"workflow manager service"===i?"toolsgray":"layer"===i||"layer package"===i||"explorer layer"===i?"layersgray":"scene package"===i?"scenepackage":"mobile scene package"===i?"mobilescenepackage":"tile package"===i||"compact tile package"===i?"tilepackage":"task file"===i?"taskfile":"report template"===i?"report-template":"statistical data collection"===i?"statisticaldatacollection":"insights workbook"===i?"workbook":"insights model"===i?"insightsmodel":"insights page"===i?"insightspage":"insights theme"===i?"insightstheme":"hub initiative"===i?"hubinitiative":"hub page"===i?"hubpage":"hub site application"===i?"hubsite":"hub event"===i?"hubevent":"relational database connection"===i?"relationaldatabaseconnection":"big data file share"===i?"datastorecollection":"image collection"===i?"imagecollection":"desktop style"===i?"desktopstyle":"style"===i?"style":"dashboard"===i?"dashboard":"raster function template"===i?"rasterprocessingtemplate":"vector tile package"===i?"vectortilepackage":"ortho mapping project"===i?"orthomappingproject":"ortho mapping template"===i?"orthomappingtemplate":"solution"===i?"solutions":"geopackage"===i?"geopackage":"deep learning package"===i?"deeplearningpackage":"real time analytic"===i?"realtimeanalytics":"big data analytic"===i?"bigdataanalytics":"feed"===i?"feed":"excalibur imagery project"===i?"excaliburimageryproject":"notebook"===i?"notebook":"storymap"===i?"storymap":"survey123 add in"===i?"survey123addin":"mission"===i?"mission":"mission report"===i?"missionreport":"quickcapture project"===i?"quickcaptureproject":"pro report"===i?"proreport":"urban model"===i?"urbanmodel":"web experience"===i?"experiencebuilder":"web experience template"===i?"webexperiencetemplate":"workflow"===i?"workflow":"kernel gateway connection"===i?"kernelgatewayconnection":"insights script"===i?"insightsscript":"hub initiative template"===i?"hubinitiativetemplate":"storymap theme"===i?"storymaptheme":"group"===i?"group":"maps",l?t("./item-icons/"+l+"16.png"):null}static get assetsDirs(){return["item-icons"]}get el(){return i(this)}};o.style=".item-type-icon{pointer-events:none;display:block;height:1rem;margin-top:0.15em !important;min-width:16px;fill:currentColor;transform:rotate(360deg)}.item-type-icon-margin{margin-inline-end:0.375rem}";export{o as solution_item_icon}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as e,h as a,H as r,g as s}from"./p-6d753a3d.js";const t=class{constructor(a){e(this,a)}render(){return a(r,{key:"32113dda304b2f7179d0275f04987e69ce386959"},a("slot",{key:"358d5ea7a03cc7da16e98a92391cf74dfe9fa89b"}))}get el(){return s(this)}};t.style=":host{display:block}";export{t as feature_form_flow_item}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as i,h as t,H as s,g as e,c as h}from"./p-6d753a3d.js";import{g as a,l as o}from"./p-896c9644.js";import{q as l,g as n,e as d,f as c,i as r,j as v,c as p}from"./p-583e5dd0.js";import{d as u}from"./p-6f69de4d.js";import"./p-82e085d0.js";import"./p-c1cf3ebc.js";import"./p-334e6394.js";import"./p-a230b270.js";import"./p-530b73ce.js";const b=class{constructor(t){i(this,t),this.isMobile=void 0,this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(i){const t=i.detail;this._cardLoading=!0;const s=t.length>0?await l(t,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=s.sort(((i,s)=>t.indexOf(i.getObjectId())-t.indexOf(s.getObjectId()))),this._cardLoading=!1}async layerSelectionChange(i){const t=i.detail[0];this.layer=await n(this.mapView,t)}async componentWillLoad(){await this._getTranslations()}render(){var i,e;const h=(null===(i=this._graphics)||void 0===i?void 0:i.length)>0?"":"display-none",a=(null===(e=this._graphics)||void 0===e?void 0:e.length)>0?"display-none":"";return t(s,{key:"343554e5408de156f1973f6d1e3daa8f1ba90675"},t("div",{key:"1852562a795002314236052351cab7c29d36854e",class:"overflow-auto height-full"},t("calcite-shell",{key:"684f013e4397bc50743526357384f782a88a5cd3",class:"position-relative "+h},t("div",{key:"db6d9f4be5448b5596b22f2a4f49c6baefa88466"},t("info-card",{key:"be5cec81cae7ca00a5b57c8d9590541f78b67fbd",graphics:this._graphics,isLoading:this._cardLoading,isMobile:this.isMobile,mapView:this.mapView}))),t("calcite-shell",{key:"df34e0ae6978298130970c60d21203f52fa32e4b",class:"position-relative "+a},t("div",{key:"9525a95dd21745e211ebf888da44eca6a6c17721",class:"padding-1"},t("calcite-notice",{key:"ade0e0a2f09bbe7b7bda6fdb2ce65ba81121e633",icon:"table",open:!0},t("div",{key:"d6fce2d657e23738720e004177c510c3273017f4",slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const i=await a(this.el);this._translations=i[0]}get el(){return e(this)}};b.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}card-manager{display:block}";const f=class{constructor(t){i(this,t),this.featureSelectionChange=h(this,"featureSelectionChange",7),this._ctrlIsPressed=!1,this._defaultFilterHonored=!1,this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._observerSet=!1,this._shiftIsPressed=!1,this._skipOnChange=!1,this.onTableNodeCreate=i=>{this._tableNode=i},this.defaultGlobalId=void 0,this.defaultLayerId=void 0,this.defaultOid=void 0,this.enableAutoRefresh=void 0,this.enableColumnReorder=!0,this.enableCSV=void 0,this.enableInlineEdit=void 0,this.enableShare=void 0,this.isMobile=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.selectedIds=[],this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this.zoomToScale=void 0,this._allIds=[],this._controlsThatFit=void 0,this._csvExporting=!1,this._fetchingData=!1,this._filterActive=!1,this._filterOpen=!1,this._layer=void 0,this._selectAllActive=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=void 0,this._translations=void 0}async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}enableCSVWatchHandler(){var i;(null===(i=this._toolInfos)||void 0===i?void 0:i.length)>0&&this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}enableShareWatchHandler(){this._toolbar&&this._updateToolbar()}_controlsThatFitWatchHandler(){var i;const t=this._controlsThatFit?this._controlsThatFit.reduce(((i,t)=>(i.push(t.id),i)),[]):[];this._toolInfos=null===(i=this._toolInfos)||void 0===i?void 0:i.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}isMobileWatchHandler(){this._toolInfos||this.isMobile||this._initToolInfos()}async mapInfoWatchHandler(){this._resetColumnTemplates(),this._initLayerExpressions(),this._initToolInfos(),this._updateToolbar(),await this._sortTable()}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression=void 0,this._updateShareUrl(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(i=>{this._mapClicked(i)})))}async _layerWatchHandler(){var i;this._fetchingData=!0,await(null===(i=this._layer)||void 0===i?void 0:i.when((async()=>{var i;this._definitionExpression=this._layer.definitionExpression,this._floorField=null===(i=this._layer.floorInfo)||void 0===i?void 0:i.floorField,this._updateFloorDefinitionExpression(),await this._resetTable(),this._initLayerExpressions(),this._updateShareUrl(),this._fetchingData=!1})))}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1)}async selectionChanged(i){const t=i.detail.selectedFeature[0],s=t.getObjectId(),e=this._table;if(e.rowHighlightIds.length&&e.rowHighlightIds.removeAll(),e.rowHighlightIds.add(s),this.zoomAndScrollToSelected){const i=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(i);const e=t.layer;let h;this.mapView.allLayerViews.toArray().some((i=>{if(i.layer.title===e.title&&"feature"===i.layer.type)return h=i,!0})),h&&await d([s],h,this.mapView,!0,void 0,this.zoomToScale)}}async editsComplete(i){const t=i.detail;"delete"!==t&&"add"!==t||(this._allIds=await c(this._layer)),await this._refresh()}async facilityChanged(i){this._floorFacility=i.detail,this._updateFloorDefinitionExpression()}async levelChanged(i){this._floorLevel=i.detail,this._updateFloorDefinitionExpression()}async siteChanged(i){this._floorSite=i.detail,this._updateFloorDefinitionExpression()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver||(this._resizeObserver=new ResizeObserver((()=>this._onResize())))}render(){const i=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",h=this._allIds.length.toString(),a=this.selectedIds.length.toString(),o=this.isMobile?"height-full":"height-full-adjusted";return this._validateActiveActions(),t(s,{key:"92b88fc87d2c0a0eaaef9587d2324a63665b1cc2"},t("calcite-shell",{key:"fcc7190ee18fe6f20ab08a5331a8bcd2c9c83c74"},this._getTableControlRow("header"),t("div",{key:"be1a282eb23580b8f713f27fe198bab1c18ba689",class:`width-full ${o}`},t("calcite-panel",{key:"d5ef6c04334f48c26f01b61f587370c0ee58682f",class:"height-full width-full"},t("calcite-loader",{key:"b31c1977446ed6ca47e96a7a47673e03f938265e",class:e,label:this._translations.fetchingData,scale:"l"}),t("div",{key:"07ce4a7741dc0197816f04e57c5d32cbc5666f0e",class:i,ref:this.onTableNodeCreate})),this.isMobile?void 0:t("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",h).replace("{{selected}}",a)))),this._filterModal())}async componentDidLoad(){this.isMobile||this._observerSet||(this._resizeObserver.observe(this._toolbar),this._observerSet=!0),document.onclick=i=>this._handleDocumentClick(i),document.onkeydown=i=>this._handleKeyDown(i),document.onkeyup=i=>this._handleKeyUp(i)}componentDidRender(){this._updateToolbar()}async _initModules(){const[i,t,s]=await o(["esri/widgets/FeatureTable","esri/core/reactiveUtils","esri/widgets/FeatureTable/support/TableTemplate"]);this.FeatureTable=i,this.reactiveUtils=t,this.TableTemplate=s}_onResize(){this._updateToolbar()}_getTableControlRow(i){return t("div",{class:"display-flex border-bottom height-51",ref:i=>this._toolbar=i,slot:i},this._getActionBar(),this.isMobile?void 0:this._getDropdown("more-table-options"),this.enableShare&&!this.isMobile?this._getShare("share"):void 0)}_getActionBar(){const i=this.isMobile?"width-full":"",s=this.isMobile?"border-top":"";return t("calcite-action-bar",{class:i,expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},t("div",{class:`border-end ${i} ${s}`,id:"solutions-map-layer-picker-container"},t("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,display:"inline-flex",height:50,isMobile:this.isMobile,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChanged(i)},onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showSingleLayerAsLabel:!0,showTables:!0,type:"dropdown"})),this.isMobile?void 0:this._getActions())}_getActions(){const i=this._getActionItems();return null==i?void 0:i.reduce(((i,s)=>(s&&!s.isOverflow&&i.push(s.isDanger?this._getDangerAction(s.icon,s.label,s.func,s.disabled):s.isSublist?t("calcite-dropdown",{closeOnSelectDisabled:!0,id:this._getId(s.icon),onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._showHideDropdown=i},this._getAction(s.active,this._showHideOpen?"chevron-down":s.icon,s.indicator,s.label,s.func,s.disabled,s.loading,"trigger"),this._showHideOpen?this._getFieldlist():void 0):this._getAction(s.active,s.icon,s.indicator,s.label,s.func,s.disabled,s.loading)),i)),[])}_getFieldlist(){return this._columnsInfo?t("calcite-dropdown-group",{"selection-mode":"multiple"},Object.keys(this._columnsInfo).map((i=>t("calcite-dropdown-item",{id:i,onClick:i=>{const t=i.target;this._columnsInfo[t.id]=t.selected,t.selected?this._table.showColumn(t.id):this._table.hideColumn(t.id)},selected:this._columnsInfo[i]},i)))):void 0}_validateEnabledActions(){var i;const t=this._featuresSelected(),s=["zoom-to-object","trash","erase","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&s.indexOf(i.icon)>-1&&(i.disabled=!t)}))}_validateActiveActions(){var i;const t=["filter","list-check-all","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&t.indexOf(i.icon)>-1&&("filter"===i.icon&&(i.indicator=this._filterActive),"list-check-all"===i.icon&&(i.active=this._selectAllActive),"selected-items-filter"===i.icon&&(i.active=this._showOnlySelected))}))}_initToolInfos(){const i=this._featuresSelected(),t=this._featuresEmpty(),s=this._hasFilterExpressions();this._translations&&(this._toolInfos=[{active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!i,isOverflow:!1},s?{active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this._toggleFilter(),disabled:!1,isOverflow:!1}:void 0,this._deleteEnabled?{active:void 0,icon:"trash",indicator:void 0,label:void 0,func:void 0,disabled:!i,isDanger:!0,isOverflow:!1}:void 0,{active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!i,isOverflow:!1},{active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!i,isOverflow:!1},{active:!1,icon:"list-check-all",indicator:!1,func:()=>this._selectAll(),label:this._translations.selectAll,disabled:t,isOverflow:!1},{active:!1,icon:"compare",indicator:!1,func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:t,isOverflow:!1},{active:!1,icon:"refresh",indicator:!1,func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:t,isOverflow:!1}:void 0,{active:!1,icon:this._showHideOpen?"chevron-down":"chevron-right",indicator:!1,func:()=>this._toggleShowHide(),label:this._translations.showHideColumns,disabled:!1,isOverflow:!1,isSublist:!0}],this._defaultVisibleToolSizeInfos=void 0)}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){const i=`${this._floorField} = '${this._floorLevel}'`,t=this._layer.definitionExpression;this._layer.definitionExpression=(null==t?void 0:t.indexOf(this._floorExpression))>-1?t.replace(this._floorExpression,i):t?`${t} AND (${i})`:i,this._floorExpression=i}}_featuresSelected(){return this.selectedIds.length>0}_featuresEmpty(){return 0===this._allIds.length}_hasFilterExpressions(){var i,t,s;let e;return(null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions)&&(null===(s=this._layer)||void 0===s?void 0:s.id)&&(e=this.mapInfo.filterConfig.layerExpressions.filter((i=>i.id===this._layer.id))),(null==e?void 0:e.length)>0}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),!this.isMobile&&this._toolbar&&this._toolInfos&&(this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const i=this._toolbar.offsetWidth;let t=this._toolbarSizeInfos.reduce(((i,t)=>i+t.width),0);const s=["solutions-more","solutions-map-layer-picker-container","solutions-action-share"];if(t>i){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,h)=>(s.indexOf(h.id)<0&&(t>i?t-=h.width:e.push(h)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((i,t)=>(i.push(t.id),i)),[]);let h=!1;const a=[...this._defaultVisibleToolSizeInfos].reduce(((a,o)=>(!h&&s.indexOf(o.id)<0&&(e.indexOf(o.id)>-1||t+o.width<=i)?(e.indexOf(o.id)<0&&(t+=o.width),a.push(o)):s.indexOf(o.id)<0&&t+o.width>i&&(h=!0),a)),[]);this._setControlsThatFit(a,s)}}),250))}_setControlsThatFit(i,t){let s=JSON.stringify(i)!==JSON.stringify(this._controlsThatFit);document.getElementById("solutions-action-bar").childNodes.forEach((i=>{t.indexOf(i.id)<0&&!s&&(s=this._controlsThatFit.map((i=>i.id)).indexOf(i.id)<0)})),s&&(this._controlsThatFit=[...i])}_setToolbarSizeInfos(){let i=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((t,s)=>{0===s?t.childNodes.forEach((t=>{this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0)})):t.referenceElement||(this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0))})),i&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&!i.isOverflow))}_getDropdown(i){const s=this._getDropdownItems();return s.length>0?t("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this._layer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._moreDropdown=i},t("calcite-action",{appearance:"solid",id:i,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},t("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),t("calcite-dropdown-group",{"selection-mode":"none"},s.map((i=>t("calcite-dropdown-group",{class:i.disabled?"disabled":"",selectionMode:i.disabled?"none":"single"},t("calcite-dropdown-item",{disabled:i.loading,iconStart:i.isSublist&&this._showHideOpen?"chevron-down":i.loading?"":i.icon,id:"solutions-subset-list",onClick:i.func},i.loading?t("div",{class:"display-flex"},t("calcite-loader",{inline:!0,label:i.label,scale:"m"}),i.label):i.label))))),this._showHideOpen?this._getFieldlist():void 0):void 0}_getDropdownItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&i.isOverflow))}_getAction(i,s,e,h,a,o,l,n){const d=void 0===this._layer||o;return t("div",{class:"display-flex",id:this._getId(s),slot:n},t("calcite-action",{active:i,appearance:"solid",disabled:d,icon:s,id:s,indicator:e,label:h,loading:l,onClick:a,text:h,textEnabled:!0}),this._getToolTip("bottom",s,h))}_getShare(i){return t("div",{class:"share-action",id:this._getId(i)},t("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"instant-app-share",embed:this.shareIncludeEmbed,popoverButtonIconScale:"s",ref:i=>this._shareNode=i,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",socialMedia:this.shareIncludeSocial,view:this.mapView}),this._getToolTip("bottom",i,this._translations.share))}_updateShareUrl(){var i,t,s,e;const h=null===(i=this._shareNode)||void 0===i?void 0:i.shareUrl;if(!h)return;const a=new URL(h);(null===(t=this.mapInfo)||void 0===t?void 0:t.id)?a.searchParams.set("webmap",this.mapInfo.id):a.searchParams.delete("webmap"),(null===(s=this._layer)||void 0===s?void 0:s.id)?a.searchParams.set("layer",this._layer.id):a.searchParams.delete("layer"),(null===(e=this.selectedIds)||void 0===e?void 0:e.length)>0?a.searchParams.set("oid",this.selectedIds.join(",")):a.searchParams.delete("oid"),this._shareNode.shareUrl=a.href}_getToolTip(i,s,e){return document.getElementById(s)?t("calcite-tooltip",{placement:i,"reference-element":s},t("span",null,e)):void 0}_getId(i){return`solutions-action-${i}`}_getDangerAction(i,s,e,h){const a=void 0===this._layer||h;return t("div",{class:"display-flex",id:this._getId(i)},"trash"===i?t("delete-button",{buttonType:"action",class:"display-flex",disabled:a,icon:i,ids:this._getIds(),layer:this._layer}):t("calcite-action",{appearance:"solid",disabled:a,id:i,onClick:e,text:""},t("calcite-button",{appearance:"transparent",iconStart:i,kind:"danger"},s)),this._getToolTip("bottom",i,s))}_getIds(){return this._table.highlightIds.toArray()}async _getTable(i,t){this._layer&&(await this._layer.when((()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:t},container:i})})),await this._table.when((()=>{this._table.highlightIds.on("change",(i=>{this._handleOnChange(i)}))})))}async _handleOnChange(i){const t=[...this._table.highlightIds.toArray()];if(this._skipOnChange)this._skipOnChange=!1;else{if(this._ctrlIsPressed||this._shiftIsPressed){if(this._ctrlIsPressed)this.selectedIds=t.reverse();else if(this._shiftIsPressed&&(this._skipOnChange=!0,this._previousCurrentId=this._currentId,this._currentId=[...this._table.highlightIds.toArray()].reverse()[0],this._previousCurrentId!==this._currentId)){const i=this._table.activeSortOrders.reduce(((i,t)=>(i.push(`${t.fieldName} ${t.direction}`),i)),[]),s=await r(this._layer,this._layer.definitionExpression,i);let e=!1;const h=this._table.viewModel.getObjectIdIndex(this._previousCurrentId),a=this._table.viewModel.getObjectIdIndex(this._currentId),o=h<a?h:a,l=a>h?a:h;this._skipOnChange=o+1!==l;const n=s.reduce(((i,t)=>{const s=t,h=this._table.viewModel.getObjectIdIndex(s);return s!==this._currentId&&s!==this._previousCurrentId||(e=!e,i.indexOf(s)<0&&i.push(s)),e&&i.indexOf(s)<0&&i.push(s),(this.selectedIds.indexOf(s)>-1||h>=o&&h<=l)&&i.indexOf(s)<0&&h>-1&&i.push(s),i}),[]);this.selectedIds=h<a?n.reverse():n,this._table.highlightIds.addMany(this.selectedIds.filter((i=>t.indexOf(i)<0)))}}else if(this.selectedIds.length>0){this._skipOnChange=!0;const s=this.selectedIds.length>1&&1===i.removed.length?i.removed:t.filter((i=>this.selectedIds.indexOf(i)<0));this._clearSelection(),this.selectedIds=[...s],s.length>0?this._table.highlightIds.add(s[0]):this._skipOnChange=!1}else this.selectedIds=t.reverse();this._finishOnChange()}this._currentId=[...this._table.highlightIds.toArray()].reverse()[0]}_finishOnChange(){this._showOnlySelected&&(this._featuresSelected()?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this.selectedIds)}_resetColumnTemplates(){var i,t;const s=this._getColumnTemplates(null===(i=this._layer)||void 0===i?void 0:i.id,null===(t=this._layer)||void 0===t?void 0:t.fields),e=null==s?void 0:s.some(((i,t)=>{var s;return JSON.stringify(null===(s=this._table)||void 0===s?void 0:s.tableTemplate.columnTemplates[t])!==JSON.stringify(i)}));if(this._table&&s&&(e||!this._columnsInfo)){this._table.tableTemplate=new this.TableTemplate({columnTemplates:s});const i=s.map((i=>i.fieldName));this._initColumnsInfo(i)}}async _resetTable(){var i;if(this._clearSelection(),this._allIds=await c(this._layer),this._table)this._table.view=this.mapView,this._table.layer=this._layer;else{const t=this._getColumnTemplates(this._layer.id,null===(i=this._layer)||void 0===i?void 0:i.fields);await this._getTable(this._tableNode,t)}await this._initLayerRefresh(),this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,await this.reactiveUtils.once((()=>"loaded"===this._table.state)).then((async()=>{this._table.highlightIds.removeAll(),this._table.clearSelectionFilter(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),this._initToolInfos(),this._updateToolbar()}))}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._refreshHandle=this._layer.on("refresh",(i=>{i.dataChanged&&(this._skipOnChange=!0,this._updateAllIds())}))}async _updateAllIds(){this._allIds=await c(this._layer),this.selectedIds=this.selectedIds.filter((i=>this._allIds.indexOf(i)>-1)),await this._refresh()}async _handleDefaults(){var i,t;if(!this._defaultOidHonored&&(null===(i=this.defaultOid)||void 0===i?void 0:i.length)>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=void 0,this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&(null===(t=this.defaultGlobalId)||void 0===t?void 0:t.length)>0&&this._table){const i=await v(this.defaultGlobalId,this._layer),t=(null==i?void 0:i.length)>0?i.map((i=>i.getObjectId())):void 0;t&&await this._selectDefaultFeature(t),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=void 0,this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(i){var t,s;const e=null===(t=this._table)||void 0===t?void 0:t.columns.reduce(((t,s)=>((!i||(null==i?void 0:i.indexOf(s.name))>-1)&&(t[s.name]=!s.hidden),t)),{}),h=null===(s=this._table)||void 0===s?void 0:s.columns.map((i=>i.name));(i?i.filter((i=>h.indexOf(i)<0)):[]).forEach((i=>{e[i]=!0})),this._columnsInfo=i?i.reduce(((i,t)=>(i[t]=e[t],i)),{}):e}async _selectDefaultFeature(i){i.length>0&&this._table.highlightIds.addMany(i)}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){var i,t,s,e,h;let a,o=null===(i=this._layer)||void 0===i?void 0:i.objectIdField,l="desc";(null===(e=null===(s=null===(t=this.mapInfo)||void 0===t?void 0:t.layerOptions)||void 0===s?void 0:s.layers)||void 0===e?void 0:e.length)>0&&(a=this.mapInfo.layerOptions.layers.filter((i=>i.id===this._layer.id)),a&&a.length>0&&(a=a[0],a.sortField&&(null===(h=a.fields)||void 0===h?void 0:h.includes(a.sortField))&&(o=a.sortField),l=(null==a?void 0:a.sortOrder)?a.sortOrder:"desc")),this._table&&this._layer&&(await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(o,l)})))}_forceShowHide(){this._showHideDropdown&&(this._showHideDropdown.open=this._showHideOpen),this._moreDropdown&&(this._moreDropdown.open=this._showHideOpen)}_toggleShowHide(){this._showHideOpen=!this._showHideOpen}_closeShowHide(){this._showHideOpen=!1}_handleDocumentClick(i){var t;const s=null===(t=i.target)||void 0===t?void 0:t.id;this._showHideOpen&&Object.keys(this._columnsInfo).indexOf(s)<0&&"solutions-subset-list"!==s&&"chevron-right"!==s&&(this._closeShowHide(),this._moreDropdown&&(this._moreDropdown.open=!1),this._showHideDropdown&&(this._showHideDropdown.open=!1))}_handleKeyDown(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_handleKeyUp(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_filterModal(){var i,s,e;return t("calcite-modal",{"aria-labelledby":"modal-title",class:"modal",kind:"brand",onCalciteModalClose:()=>{this._closeFilter()},open:this._filterOpen,widthScale:"s"},t("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},null===(s=null===(i=this._translations)||void 0===i?void 0:i.filter)||void 0===s?void 0:s.replace("{{title}}",null===(e=this._layer)||void 0===e?void 0:e.title)),t("div",{slot:"content"},t("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:async()=>this._closeFilter(),comboboxOverlayPositioning:"fixed",layerExpressions:this._layerExpressions,onFilterListReset:()=>this._handleFilterListReset(),onFilterUpdate:()=>this._handleFilterUpdate(),ref:i=>this._filterList=i,view:this.mapView,zoomBtn:!1})))}_handleFilterListReset(){this._filterActive=!1,this._updateShareUrl()}_handleFilterUpdate(){const i=this._layer.definitionExpression;if(this._floorExpression){const t=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=i&&this._floorField&&i.indexOf(`${this._floorField} = '`)>-1?i.replace(t,this._floorExpression):i?`${i} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=this._definitionExpression!==this._layer.definitionExpression&&(!this._floorExpression||this._layer.definitionExpression!==this._floorExpression),this._updateShareUrl()}async _closeFilter(){this._filterOpen&&(this._allIds=await c(this._layer),this._filterOpen=!1)}async _mapClicked(i){const t={include:this._layer},s=await this.mapView.hitTest(i.screenPoint,t);s.results.length>0?(s.results.forEach((i=>{const t=i.graphic.getObjectId();this._table.highlightIds.indexOf(t)<0&&this._table.highlightIds.add(t)})),this._showOnlySelected&&this._table.filterBySelection()):this._clearSelection()}_selectAll(){const i=this._allIds;this._table.highlightIds.removeAll(),this._skipOnChange=!0,this._table.highlightIds.addMany(i),this.selectedIds=i,this._finishOnChange(),this._selectAllActive=!0}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){var i;this.selectedIds=[],null===(i=this._table)||void 0===i||i.highlightIds.removeAll(),this._finishOnChange()}_toggleFilter(){this._filterOpen=!this._filterOpen}_initLayerExpressions(){var i,t;const s=null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions;this._layerExpressions=s?s.filter((i=>{var t;return i.id===(null===(t=this._layer)||void 0===t?void 0:t.id)})):[],this._filterList.layerExpressions=this._layerExpressions,this._filterActive=this._layerExpressions.filter((i=>i.expressions.filter((i=>i.active)).length>0)).length>0}_switchSelected(){const i=[...this.selectedIds];this._table.highlightIds.removeAll();const t=this._allIds.reduce(((t,s)=>(i.indexOf(s)<0&&t.push(s),t)),[]).sort(((i,t)=>i-t));this._skipOnChange=!0,this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange()}async _exportToCSV(){const i={},t=this._table.highlightIds.toArray();i[this._layer.id]={selectionSetNames:[this._layer.title],ids:t,layer:this._layer};const s=this._table.columns.toArray().reduce(((i,t)=>(t.hidden||i.push(t.name.toLocaleLowerCase()),i)),[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,await u(null,i,!1,!1,!0,s,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}_updateToolInfoLoading(i,t){this._toolInfos.some((s=>{if((null==s?void 0:s.icon)===i)return s.loading=t,!0}))}async _refresh(){await this._table.refresh(),this.featureSelectionChange.emit(this.selectedIds)}async _zoom(){if(this._layer){const i=await p(this.mapView,this._layer.id);await d(this.selectedIds,i,this.mapView,!0,void 0,this.zoomToScale)}}async _layerSelectionChanged(i){var t;const s=i.detail[0];if(s!==(null===(t=this._layer)||void 0===t?void 0:t.id)||this._featuresEmpty()){this._fetchingData=!0;const i=await n(this.mapView,s);await i.when((()=>{this._layer=i}))}this._fetchingData=!1}_getColumnTemplates(i,t){var s,e;let h;null===(e=null===(s=this.mapInfo)||void 0===s?void 0:s.layerOptions)||void 0===e||e.layers.some((t=>{if(t.id===i)return h=t,!0}));const a=(null==h?void 0:h.fields)&&(null==h?void 0:h.fieldOrder)?h.fieldOrder.filter((i=>h.fields.indexOf(i)>-1)):void 0;let o;return t&&(o=h&&(null==h?void 0:h.fields)?t.reduce(((i,t)=>{if(h.fields.indexOf(t.name)>-1){const s={type:"field",fieldName:t.name,label:t.alias,menuConfig:this._getMenuConfig(t.name)};i.push(s)}return i}),[]).sort(this._sortFields.bind(this,null==h?void 0:h.fieldOrder)):t.map((i=>({type:"field",fieldName:i.name,label:i.alias,menuConfig:this._getMenuConfig(i.name)})))),a?null==o?void 0:o.sort(this._sortFields.bind(this,a)):o}_sortFields(i,t,s){return(null==i?void 0:i.indexOf(t.fieldName))-i.indexOf(s.fieldName)}_getMenuConfig(i){return{items:[{label:this._translations.hideField,icon:"view-hide",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(i)}}]}}_handleHideClick(i){this._columnsInfo[i]=!1,this._table.hideColumn(i),this._table.tableTemplate.columnTemplates.forEach((t=>{t.fieldName===i&&(t.visible=!1)}))}async _getTranslations(){const i=await a(this.el);this._translations=i[0]}get el(){return e(this)}static get watchers(){return{defaultOid:["defaultOidWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],enableCSV:["enableCSVWatchHandler"],enableInlineEdit:["enableInlineEditWatchHandler"],enableShare:["enableShareWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"],isMobile:["isMobileWatchHandler"],mapInfo:["mapInfoWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],selectedIds:["selectedIdsWatchHandler"]}}};f.style=':host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{font-size:14px !important;color:var(--calcite-color-text-3) !important}.share-action{position:absolute;right:0}html[dir="rtl"] .share-action{left:0}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.instant-app-share{height:50px !important;display:inline-flex}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-modal-content-padding:0}.esri-feature-table__table-container{height:100%}';const m=class{constructor(t){i(this,t),this.mapChanged=h(this,"mapChanged",7),this.beforeMapChanged=h(this,"beforeMapChanged",7),this._defaultWebmapHonored=!1,this._loadedId="",this.appProxies=void 0,this.defaultWebmapId="",this.enableHome=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSingleExpand=!0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.homeZoomIndex=3,this.homeZoomPosition="top-left",this.homeZoomToolsSize="m",this.mapInfos=[],this.mapWidgetsIndex=0,this.mapWidgetsPosition="top-right",this.mapWidgetsSize="m",this.mapView=void 0,this.stackTools=!0,this.theme=void 0,this.toolOrder=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}enableHomeWatchHandler(){this._initHome()}async mapInfoChange(i){await this._loadMap(i.detail)}async componentWillLoad(){await this._initModules()}render(){var i,e;const h=this.hidden?"visibility-hidden-1":"",a="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",o=(null===(i=this.mapInfos)||void 0===i?void 0:i.length)>1?"":"display-none",l=(null===(e=this.mapInfos)||void 0===e?void 0:e.length)>1?"map-height":"height-full";return t(s,{key:"446f04b49a9d744f3abae1e7ae90113f0eb0da08"},t("map-picker",{key:"b3f388a5b0d6a26951f9ae45dff7629376ff4d17",class:o,mapInfos:this.mapInfos,ref:i=>this._mapPicker=i}),t("div",{key:"f5c44c8cf0b22b496a57cd01ebfdf00c0979bebe",class:`${l} ${h}`,ref:i=>this._mapDiv=i}),t("map-tools",{key:"dab560a9cde03901087a1d136599d0fd26964dce",basemapConfig:this.basemapConfig,class:`box-shadow ${a}`,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:this.enableSingleExpand,homeZoomToolsSize:this.homeZoomToolsSize,mapView:this.mapView,mapWidgetsSize:this.mapWidgetsSize,position:this.mapWidgetsPosition,ref:i=>this._mapTools=i,searchConfiguration:this._searchConfiguration,stackTools:this.stackTools,toolOrder:this.toolOrder}))}async _initModules(){const[i,t,s,e]=await o(["esri/WebMap","esri/views/MapView","esri/widgets/Home","esri/config"]);this.WebMap=i,this.MapView=t,this.Home=s,this.esriConfig=e}async _loadMap(i){var t;const s=!this._defaultWebmapHonored&&this.defaultWebmapId,e=null===(t=this.mapInfos)||void 0===t?void 0:t.filter((i=>i.id===this.defaultWebmapId)),h=JSON.stringify(i)!==JSON.stringify(this._webMapInfo);this._webMapInfo=s&&e?e[0]:!(null==i?void 0:i.id)&&this.mapInfos.length>0?this.mapInfos[0]:i;const a=this._webMapInfo.id,o=s&&(null==i?void 0:i.id)===this.defaultWebmapId;if(this._loadedId!==a&&!s||o){const i=new this.WebMap({portalItem:{id:a}});this.appProxies&&(await i.load(),await(l=i,n=this.esriConfig,d=this.appProxies,d&&d.forEach((i=>{l.allLayers.forEach((t=>{t&&t.url===i.sourceUrl&&(t.url=i.proxyUrl,t.portalItem&&t.portalItem.when((()=>{t.portalItem.url=i.proxyUrl})),n.request?.interceptors?.push({urls:i.sourceUrl,before:t=>{t.url&&t.url===i.sourceUrl&&(t.url=i.proxyUrl)}}))}))})),l)),this.mapView=new this.MapView({container:this._mapDiv,map:i,resizeAlign:"center"}),this._loadedId=a,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{this._initHome(),this.mapView.ui.add(this._mapTools,{position:this.mapWidgetsPosition,index:this.mapWidgetsIndex}),this._defaultWebmapHonored=!!o||this._defaultWebmapHonored,this.mapChanged.emit({id:a,mapView:this.mapView})}))}else s?(this._defaultWebmapHonored=!0,this._mapPicker.setMapByID(a)):h&&(this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),this.mapChanged.emit({id:a,mapView:this.mapView}));var l,n,d}_initHome(){if(this.enableHome){this._homeWidget=new this.Home({view:this.mapView}),this.mapView.ui.add(this._homeWidget,{position:this.homeZoomPosition,index:this.homeZoomIndex});const i="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";this._homeWidget.domNode.style.height=i,this._homeWidget.domNode.style.width=i}else this._homeWidget&&this.mapView.ui.remove(this._homeWidget)}get el(){return e(this)}static get watchers(){return{enableHome:["enableHomeWatchHandler"]}}};m.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.box-shadow{box-shadow:none !important}.visibility-hidden-1{visibility:hidden;height:1px;}.display-none{display:none}";export{b as card_manager,f as layer_table,m as map_card}
6
+ import{r as i,h as t,H as s,g as e,c as h}from"./p-6d753a3d.js";import{g as a,l as o}from"./p-896c9644.js";import{q as l,g as n,e as d,f as c,i as r,j as v,c as p}from"./p-583e5dd0.js";import{d as u}from"./p-6f69de4d.js";import"./p-82e085d0.js";import"./p-c1cf3ebc.js";import"./p-334e6394.js";import"./p-a230b270.js";import"./p-530b73ce.js";const b=class{constructor(t){i(this,t),this.isMobile=void 0,this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(i){const t=i.detail;this._cardLoading=!0;const s=t.length>0?await l(t,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=s.sort(((i,s)=>t.indexOf(i.getObjectId())-t.indexOf(s.getObjectId()))),this._cardLoading=!1}async layerSelectionChange(i){const t=i.detail[0];this.layer=await n(this.mapView,t)}async componentWillLoad(){await this._getTranslations()}render(){var i,e;const h=(null===(i=this._graphics)||void 0===i?void 0:i.length)>0?"":"display-none",a=(null===(e=this._graphics)||void 0===e?void 0:e.length)>0?"display-none":"";return t(s,{key:"343554e5408de156f1973f6d1e3daa8f1ba90675"},t("div",{key:"1852562a795002314236052351cab7c29d36854e",class:"overflow-auto height-full"},t("calcite-shell",{key:"684f013e4397bc50743526357384f782a88a5cd3",class:"position-relative "+h},t("div",{key:"db6d9f4be5448b5596b22f2a4f49c6baefa88466"},t("info-card",{key:"be5cec81cae7ca00a5b57c8d9590541f78b67fbd",graphics:this._graphics,isLoading:this._cardLoading,isMobile:this.isMobile,mapView:this.mapView}))),t("calcite-shell",{key:"df34e0ae6978298130970c60d21203f52fa32e4b",class:"position-relative "+a},t("div",{key:"9525a95dd21745e211ebf888da44eca6a6c17721",class:"padding-1"},t("calcite-notice",{key:"ade0e0a2f09bbe7b7bda6fdb2ce65ba81121e633",icon:"table",open:!0},t("div",{key:"d6fce2d657e23738720e004177c510c3273017f4",slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const i=await a(this.el);this._translations=i[0]}get el(){return e(this)}};b.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}card-manager{display:block}";const f=class{constructor(t){i(this,t),this.featureSelectionChange=h(this,"featureSelectionChange",7),this._ctrlIsPressed=!1,this._defaultFilterHonored=!1,this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._observerSet=!1,this._shiftIsPressed=!1,this._skipOnChange=!1,this.onTableNodeCreate=i=>{this._tableNode=i},this.defaultGlobalId=void 0,this.defaultLayerId=void 0,this.defaultOid=void 0,this.enableAutoRefresh=void 0,this.enableColumnReorder=!0,this.enableCSV=void 0,this.enableInlineEdit=void 0,this.enableShare=void 0,this.isMobile=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.selectedIds=[],this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this.zoomToScale=void 0,this._allIds=[],this._controlsThatFit=void 0,this._csvExporting=!1,this._fetchingData=!1,this._filterActive=!1,this._filterOpen=!1,this._layer=void 0,this._selectAllActive=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=void 0,this._translations=void 0}async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}enableCSVWatchHandler(){var i;(null===(i=this._toolInfos)||void 0===i?void 0:i.length)>0&&this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}enableShareWatchHandler(){this._toolbar&&this._updateToolbar()}_controlsThatFitWatchHandler(){var i;const t=this._controlsThatFit?this._controlsThatFit.reduce(((i,t)=>(i.push(t.id),i)),[]):[];this._toolInfos=null===(i=this._toolInfos)||void 0===i?void 0:i.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}isMobileWatchHandler(){this._toolInfos||this.isMobile||this._initToolInfos()}async mapInfoWatchHandler(){this._resetColumnTemplates(),this._initLayerExpressions(),this._initToolInfos(),this._updateToolbar(),await this._sortTable()}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression=void 0,this._updateShareUrl(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(i=>{this._mapClicked(i)})))}async _layerWatchHandler(){var i;this._fetchingData=!0,await(null===(i=this._layer)||void 0===i?void 0:i.when((async()=>{var i;this._definitionExpression=this._layer.definitionExpression,this._floorField=null===(i=this._layer.floorInfo)||void 0===i?void 0:i.floorField,this._updateFloorDefinitionExpression(),await this._resetTable(),this._initLayerExpressions(),this._updateShareUrl(),this._fetchingData=!1})))}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1)}async selectionChanged(i){const t=i.detail.selectedFeature[0],s=t.getObjectId(),e=this._table;if(e.rowHighlightIds.length&&e.rowHighlightIds.removeAll(),e.rowHighlightIds.add(s),this.zoomAndScrollToSelected){const i=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(i);const e=t.layer;let h;this.mapView.allLayerViews.toArray().some((i=>{if(i.layer.title===e.title&&"feature"===i.layer.type)return h=i,!0})),h&&await d([s],h,this.mapView,!0,void 0,this.zoomToScale)}}async editsComplete(i){const t=i.detail;"delete"!==t&&"add"!==t||(this._allIds=await c(this._layer)),await this._refresh()}async facilityChanged(i){this._floorFacility=i.detail,this._updateFloorDefinitionExpression()}async levelChanged(i){this._floorLevel=i.detail,this._updateFloorDefinitionExpression()}async siteChanged(i){this._floorSite=i.detail,this._updateFloorDefinitionExpression()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver||(this._resizeObserver=new ResizeObserver((()=>this._onResize())))}render(){const i=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",h=this._allIds.length.toString(),a=this.selectedIds.length.toString(),o=this.isMobile?"height-full":"height-full-adjusted";return this._validateActiveActions(),t(s,{key:"c0451b25b6253fc017f59f471ced6347a618bdcf"},t("calcite-shell",{key:"b71245a1b347aae2e06ccccd750875d9c0571b1b"},this._getTableControlRow("header"),t("div",{key:"a4c9e51f2cfa9e90bd1b67e8d542e93896321037",class:`width-full ${o}`},t("calcite-panel",{key:"e50e3a4165c02c56f99897fa29f079b2ef1e02ff",class:"height-full width-full"},t("calcite-loader",{key:"ad263eb3ac8558d6cd0777f993f663ddd0f7fbe6",class:e,label:this._translations.fetchingData,scale:"l"}),t("div",{key:"2bcbdf8197b4bcc5102d408538dab17acd803ae9",class:i,ref:this.onTableNodeCreate})),this.isMobile?void 0:t("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",h).replace("{{selected}}",a)))),this._filterModal())}async componentDidLoad(){this.isMobile||this._observerSet||(this._resizeObserver.observe(this._toolbar),this._observerSet=!0),document.onclick=i=>this._handleDocumentClick(i),document.onkeydown=i=>this._handleKeyDown(i),document.onkeyup=i=>this._handleKeyUp(i)}componentDidRender(){this._updateToolbar()}async _initModules(){const[i,t,s]=await o(["esri/widgets/FeatureTable","esri/core/reactiveUtils","esri/widgets/FeatureTable/support/TableTemplate"]);this.FeatureTable=i,this.reactiveUtils=t,this.TableTemplate=s}_onResize(){this._updateToolbar()}_getTableControlRow(i){return t("div",{class:"display-flex border-bottom height-51",ref:i=>this._toolbar=i,slot:i},this._getActionBar(),this.isMobile?void 0:this._getDropdown("more-table-options"),this.enableShare&&!this.isMobile?this._getShare("share"):void 0)}_getActionBar(){const i=this.isMobile?"width-full":"",s=this.isMobile?"border-top":"";return t("calcite-action-bar",{class:i,expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},t("div",{class:`border-end ${i} ${s}`,id:"solutions-map-layer-picker-container"},t("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,display:"inline-flex",height:50,isMobile:this.isMobile,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChanged(i)},onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showSingleLayerAsLabel:!0,showTables:!0,type:"dropdown"})),this.isMobile?void 0:this._getActions())}_getActions(){const i=this._getActionItems();return null==i?void 0:i.reduce(((i,s)=>(s&&!s.isOverflow&&i.push(s.isDanger?this._getDangerAction(s.icon,s.label,s.func,s.disabled):s.isSublist?t("calcite-dropdown",{closeOnSelectDisabled:!0,id:this._getId(s.icon),onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._showHideDropdown=i},this._getAction(s.active,this._showHideOpen?"chevron-down":s.icon,s.indicator,s.label,s.func,s.disabled,s.loading,"trigger"),this._showHideOpen?this._getFieldlist():void 0):this._getAction(s.active,s.icon,s.indicator,s.label,s.func,s.disabled,s.loading)),i)),[])}_getFieldlist(){return this._columnsInfo?t("calcite-dropdown-group",{"selection-mode":"multiple"},Object.keys(this._columnsInfo).map((i=>t("calcite-dropdown-item",{id:i,onClick:i=>{const t=i.target;this._columnsInfo[t.id]=t.selected,t.selected?this._table.showColumn(t.id):this._table.hideColumn(t.id)},selected:this._columnsInfo[i]},i)))):void 0}_validateEnabledActions(){var i;const t=this._featuresSelected(),s=["zoom-to-object","trash","erase","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&s.indexOf(i.icon)>-1&&(i.disabled=!t)}))}_validateActiveActions(){var i;const t=["filter","list-check-all","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&t.indexOf(i.icon)>-1&&("filter"===i.icon&&(i.indicator=this._filterActive),"list-check-all"===i.icon&&(i.active=this._selectAllActive),"selected-items-filter"===i.icon&&(i.active=this._showOnlySelected))}))}_initToolInfos(){const i=this._featuresSelected(),t=this._featuresEmpty(),s=this._hasFilterExpressions();this._translations&&(this._toolInfos=[{active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!i,isOverflow:!1},s?{active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this._toggleFilter(),disabled:!1,isOverflow:!1}:void 0,this._deleteEnabled?{active:void 0,icon:"trash",indicator:void 0,label:void 0,func:void 0,disabled:!i,isDanger:!0,isOverflow:!1}:void 0,{active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!i,isOverflow:!1},{active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!i,isOverflow:!1},{active:!1,icon:"list-check-all",indicator:!1,func:()=>this._selectAll(),label:this._translations.selectAll,disabled:t,isOverflow:!1},{active:!1,icon:"compare",indicator:!1,func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:t,isOverflow:!1},{active:!1,icon:"refresh",indicator:!1,func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:t,isOverflow:!1}:void 0,{active:!1,icon:this._showHideOpen?"chevron-down":"chevron-right",indicator:!1,func:()=>this._toggleShowHide(),label:this._translations.showHideColumns,disabled:!1,isOverflow:!1,isSublist:!0}],this._defaultVisibleToolSizeInfos=void 0)}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){const i=`${this._floorField} = '${this._floorLevel}'`,t=this._layer.definitionExpression;this._layer.definitionExpression=(null==t?void 0:t.indexOf(this._floorExpression))>-1?t.replace(this._floorExpression,i):t?`${t} AND (${i})`:i,this._floorExpression=i}}_featuresSelected(){return this.selectedIds.length>0}_featuresEmpty(){return 0===this._allIds.length}_hasFilterExpressions(){var i,t,s;let e;return(null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions)&&(null===(s=this._layer)||void 0===s?void 0:s.id)&&(e=this.mapInfo.filterConfig.layerExpressions.filter((i=>i.id===this._layer.id))),(null==e?void 0:e.length)>0}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),!this.isMobile&&this._toolbar&&this._toolInfos&&(this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const i=this._toolbar.offsetWidth;let t=this._toolbarSizeInfos.reduce(((i,t)=>i+t.width),0);const s=["solutions-more","solutions-map-layer-picker-container","solutions-action-share"];if(t>i){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,h)=>(s.indexOf(h.id)<0&&(t>i?t-=h.width:e.push(h)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((i,t)=>(i.push(t.id),i)),[]);let h=!1;const a=[...this._defaultVisibleToolSizeInfos].reduce(((a,o)=>(!h&&s.indexOf(o.id)<0&&(e.indexOf(o.id)>-1||t+o.width<=i)?(e.indexOf(o.id)<0&&(t+=o.width),a.push(o)):s.indexOf(o.id)<0&&t+o.width>i&&(h=!0),a)),[]);this._setControlsThatFit(a,s)}}),250))}_setControlsThatFit(i,t){let s=JSON.stringify(i)!==JSON.stringify(this._controlsThatFit);document.getElementById("solutions-action-bar").childNodes.forEach((i=>{t.indexOf(i.id)<0&&!s&&(s=this._controlsThatFit.map((i=>i.id)).indexOf(i.id)<0)})),s&&(this._controlsThatFit=[...i])}_setToolbarSizeInfos(){let i=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((t,s)=>{0===s?t.childNodes.forEach((t=>{this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0)})):t.referenceElement||(this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0))})),i&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&!i.isOverflow))}_getDropdown(i){const s=this._getDropdownItems();return s.length>0?t("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this._layer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._moreDropdown=i},t("calcite-action",{appearance:"solid",id:i,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},t("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),t("calcite-dropdown-group",{"selection-mode":"none"},s.map((i=>t("calcite-dropdown-group",{class:i.disabled?"disabled":"",selectionMode:i.disabled?"none":"single"},t("calcite-dropdown-item",{disabled:i.loading,iconStart:i.isSublist&&this._showHideOpen?"chevron-down":i.loading?"":i.icon,id:"solutions-subset-list",onClick:i.func},i.loading?t("div",{class:"display-flex"},t("calcite-loader",{inline:!0,label:i.label,scale:"m"}),i.label):i.label))))),this._showHideOpen?this._getFieldlist():void 0):void 0}_getDropdownItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&i.isOverflow))}_getAction(i,s,e,h,a,o,l,n){const d=void 0===this._layer||o;return t("div",{class:"display-flex",id:this._getId(s),slot:n},t("calcite-action",{active:i,appearance:"solid",disabled:d,icon:s,id:s,indicator:e,label:h,loading:l,onClick:a,text:h,textEnabled:!0}),this._getToolTip("bottom",s,h))}_getShare(i){return t("div",{class:"share-action",id:this._getId(i)},t("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"instant-app-share",embed:this.shareIncludeEmbed,popoverButtonIconScale:"s",ref:i=>this._shareNode=i,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",socialMedia:this.shareIncludeSocial,view:this.mapView}),this._getToolTip("bottom",i,this._translations.share))}_updateShareUrl(){var i,t,s,e;const h=null===(i=this._shareNode)||void 0===i?void 0:i.shareUrl;if(!h)return;const a=new URL(h);(null===(t=this.mapInfo)||void 0===t?void 0:t.id)?a.searchParams.set("webmap",this.mapInfo.id):a.searchParams.delete("webmap"),(null===(s=this._layer)||void 0===s?void 0:s.id)?a.searchParams.set("layer",this._layer.id):a.searchParams.delete("layer"),(null===(e=this.selectedIds)||void 0===e?void 0:e.length)>0?a.searchParams.set("oid",this.selectedIds.join(",")):a.searchParams.delete("oid"),this._shareNode.shareUrl=a.href}_getToolTip(i,s,e){return document.getElementById(s)?t("calcite-tooltip",{placement:i,"reference-element":s},t("span",null,e)):void 0}_getId(i){return`solutions-action-${i}`}_getDangerAction(i,s,e,h){const a=void 0===this._layer||h;return t("div",{class:"display-flex",id:this._getId(i)},"trash"===i?t("delete-button",{buttonType:"action",class:"display-flex",disabled:a,icon:i,ids:this._getIds(),layer:this._layer}):t("calcite-action",{appearance:"solid",disabled:a,id:i,onClick:e,text:""},t("calcite-button",{appearance:"transparent",iconStart:i,kind:"danger"},s)),this._getToolTip("bottom",i,s))}_getIds(){return this._table.highlightIds.toArray()}async _getTable(i,t){this._layer&&(await this._layer.when((()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:t},container:i})})),await this._table.when((()=>{this._table.highlightIds.on("change",(i=>{this._handleOnChange(i)}))})))}async _handleOnChange(i){const t=[...this._table.highlightIds.toArray()];if(this._skipOnChange)this._skipOnChange=!1;else{if(this._ctrlIsPressed||this._shiftIsPressed){if(this._ctrlIsPressed)this.selectedIds=t.reverse();else if(this._shiftIsPressed&&(this._skipOnChange=!0,this._previousCurrentId=this._currentId,this._currentId=[...this._table.highlightIds.toArray()].reverse()[0],this._previousCurrentId!==this._currentId)){const i=this._table.activeSortOrders.reduce(((i,t)=>(i.push(`${t.fieldName} ${t.direction}`),i)),[]),s=await r(this._layer,this._layer.definitionExpression,i);let e=!1;const h=this._table.viewModel.getObjectIdIndex(this._previousCurrentId),a=this._table.viewModel.getObjectIdIndex(this._currentId),o=h<a?h:a,l=a>h?a:h;this._skipOnChange=o+1!==l;const n=s.reduce(((i,t)=>{const s=t,h=this._table.viewModel.getObjectIdIndex(s);return s!==this._currentId&&s!==this._previousCurrentId||(e=!e,i.indexOf(s)<0&&i.push(s)),e&&i.indexOf(s)<0&&i.push(s),(this.selectedIds.indexOf(s)>-1||h>=o&&h<=l)&&i.indexOf(s)<0&&h>-1&&i.push(s),i}),[]);this.selectedIds=h<a?n.reverse():n,this._table.highlightIds.addMany(this.selectedIds.filter((i=>t.indexOf(i)<0)))}}else if(this.selectedIds.length>0){this._skipOnChange=!0;const s=this.selectedIds.length>1&&1===i.removed.length?i.removed:t.filter((i=>this.selectedIds.indexOf(i)<0));this._clearSelection(),this.selectedIds=[...s],s.length>0?this._table.highlightIds.add(s[0]):this._skipOnChange=!1}else this.selectedIds=t.reverse();this._finishOnChange()}this._currentId=[...this._table.highlightIds.toArray()].reverse()[0]}_finishOnChange(){this._showOnlySelected&&(this._featuresSelected()?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this.selectedIds)}_resetColumnTemplates(){var i,t;const s=this._getColumnTemplates(null===(i=this._layer)||void 0===i?void 0:i.id,null===(t=this._layer)||void 0===t?void 0:t.fields),e=null==s?void 0:s.some(((i,t)=>{var s;return JSON.stringify(null===(s=this._table)||void 0===s?void 0:s.tableTemplate.columnTemplates[t])!==JSON.stringify(i)}));if(this._table&&s&&(e||!this._columnsInfo)){this._table.tableTemplate=new this.TableTemplate({columnTemplates:s});const i=s.map((i=>i.fieldName));this._initColumnsInfo(i)}}async _resetTable(){var i;if(this._clearSelection(),this._allIds=await c(this._layer),this._table)this._table.view=this.mapView,this._table.layer=this._layer;else{const t=this._getColumnTemplates(this._layer.id,null===(i=this._layer)||void 0===i?void 0:i.fields);await this._getTable(this._tableNode,t)}await this._initLayerRefresh(),this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,await this.reactiveUtils.once((()=>"loaded"===this._table.state)).then((async()=>{this._table.highlightIds.removeAll(),this._table.clearSelectionFilter(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),this._initToolInfos(),this._updateToolbar()}))}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._refreshHandle=this._layer.on("refresh",(i=>{i.dataChanged&&(this._skipOnChange=!0,this._updateAllIds())}))}async _updateAllIds(){this._allIds=await c(this._layer),this.selectedIds=this.selectedIds.filter((i=>this._allIds.indexOf(i)>-1)),await this._refresh()}async _handleDefaults(){var i,t;if(!this._defaultOidHonored&&(null===(i=this.defaultOid)||void 0===i?void 0:i.length)>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=void 0,this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&(null===(t=this.defaultGlobalId)||void 0===t?void 0:t.length)>0&&this._table){const i=await v(this.defaultGlobalId,this._layer),t=(null==i?void 0:i.length)>0?i.map((i=>i.getObjectId())):void 0;t&&await this._selectDefaultFeature(t),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=void 0,this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(i){var t,s;const e=null===(t=this._table)||void 0===t?void 0:t.columns.reduce(((t,s)=>((!i||(null==i?void 0:i.indexOf(s.name))>-1)&&(t[s.name]=!s.hidden),t)),{}),h=null===(s=this._table)||void 0===s?void 0:s.columns.map((i=>i.name));(i?i.filter((i=>h.indexOf(i)<0)):[]).forEach((i=>{e[i]=!0})),this._columnsInfo=i?i.reduce(((i,t)=>(i[t]=e[t],i)),{}):e}async _selectDefaultFeature(i){i.length>0&&this._table.highlightIds.addMany(i)}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){var i,t,s,e,h;let a,o=null===(i=this._layer)||void 0===i?void 0:i.objectIdField,l="desc";(null===(e=null===(s=null===(t=this.mapInfo)||void 0===t?void 0:t.layerOptions)||void 0===s?void 0:s.layers)||void 0===e?void 0:e.length)>0&&(a=this.mapInfo.layerOptions.layers.filter((i=>i.id===this._layer.id)),a&&a.length>0&&(a=a[0],a.sortField&&(null===(h=a.fields)||void 0===h?void 0:h.includes(a.sortField))&&(o=a.sortField),l=(null==a?void 0:a.sortOrder)?a.sortOrder:"desc")),this._table&&this._layer&&(await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(o,l)})))}_forceShowHide(){this._showHideDropdown&&(this._showHideDropdown.open=this._showHideOpen),this._moreDropdown&&(this._moreDropdown.open=this._showHideOpen)}_toggleShowHide(){this._showHideOpen=!this._showHideOpen}_closeShowHide(){this._showHideOpen=!1}_handleDocumentClick(i){var t;const s=null===(t=i.target)||void 0===t?void 0:t.id;this._showHideOpen&&Object.keys(this._columnsInfo).indexOf(s)<0&&"solutions-subset-list"!==s&&"chevron-right"!==s&&(this._closeShowHide(),this._moreDropdown&&(this._moreDropdown.open=!1),this._showHideDropdown&&(this._showHideDropdown.open=!1))}_handleKeyDown(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_handleKeyUp(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_filterModal(){var i,s,e;return t("calcite-modal",{"aria-labelledby":"modal-title",class:"modal",kind:"brand",onCalciteModalClose:()=>{this._closeFilter()},open:this._filterOpen,widthScale:"s"},t("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},null===(s=null===(i=this._translations)||void 0===i?void 0:i.filter)||void 0===s?void 0:s.replace("{{title}}",null===(e=this._layer)||void 0===e?void 0:e.title)),t("div",{slot:"content"},t("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:async()=>this._closeFilter(),comboboxOverlayPositioning:"fixed",layerExpressions:this._layerExpressions,onFilterListReset:()=>this._handleFilterListReset(),onFilterUpdate:()=>this._handleFilterUpdate(),ref:i=>this._filterList=i,view:this.mapView,zoomBtn:!1})))}_handleFilterListReset(){this._filterActive=!1,this._updateShareUrl()}_handleFilterUpdate(){const i=this._layer.definitionExpression;if(this._floorExpression){const t=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=i&&this._floorField&&i.indexOf(`${this._floorField} = '`)>-1?i.replace(t,this._floorExpression):i?`${i} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=this._definitionExpression!==this._layer.definitionExpression&&(!this._floorExpression||this._layer.definitionExpression!==this._floorExpression),this._updateShareUrl()}async _closeFilter(){this._filterOpen&&(this._allIds=await c(this._layer),this._filterOpen=!1)}async _mapClicked(i){const t={include:this._layer},s=await this.mapView.hitTest(i.screenPoint,t);s.results.length>0?(s.results.forEach((i=>{const t=i.graphic.getObjectId();this._table.highlightIds.indexOf(t)<0&&this._table.highlightIds.add(t)})),this._showOnlySelected&&this._table.filterBySelection()):this._clearSelection()}_selectAll(){const i=this._allIds;this._table.highlightIds.removeAll(),this._skipOnChange=!0,this._table.highlightIds.addMany(i),this.selectedIds=i,this._finishOnChange(),this._selectAllActive=!0}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){var i;this.selectedIds=[],null===(i=this._table)||void 0===i||i.highlightIds.removeAll(),this._finishOnChange()}_toggleFilter(){this._filterOpen=!this._filterOpen}_initLayerExpressions(){var i,t;const s=null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions;this._layerExpressions=s?s.filter((i=>{var t;return i.id===(null===(t=this._layer)||void 0===t?void 0:t.id)})):[],this._filterList.layerExpressions=this._layerExpressions,this._filterActive=this._layerExpressions.filter((i=>i.expressions.filter((i=>i.active)).length>0)).length>0}_switchSelected(){const i=[...this.selectedIds];this._table.highlightIds.removeAll();const t=this._allIds.reduce(((t,s)=>(i.indexOf(s)<0&&t.push(s),t)),[]).sort(((i,t)=>i-t));this._skipOnChange=!0,this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange()}async _exportToCSV(){const i={},t=this._table.highlightIds.toArray();i[this._layer.id]={selectionSetNames:[this._layer.title],ids:t,layer:this._layer};const s=this._table.columns.toArray().reduce(((i,t)=>(t.hidden||i.push(t.name.toLocaleLowerCase()),i)),[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,await u(null,i,!1,!1,!0,s,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}_updateToolInfoLoading(i,t){this._toolInfos.some((s=>{if((null==s?void 0:s.icon)===i)return s.loading=t,!0}))}async _refresh(){await this._table.refresh(),this.featureSelectionChange.emit(this.selectedIds)}async _zoom(){if(this._layer){const i=await p(this.mapView,this._layer.id);await d(this.selectedIds,i,this.mapView,!0,void 0,this.zoomToScale)}}async _layerSelectionChanged(i){var t;const s=i.detail[0];if(s!==(null===(t=this._layer)||void 0===t?void 0:t.id)||this._featuresEmpty()){this._fetchingData=!0;const i=await n(this.mapView,s);await i.when((()=>{this._layer=i}))}this._fetchingData=!1}_getColumnTemplates(i,t){var s,e;let h;null===(e=null===(s=this.mapInfo)||void 0===s?void 0:s.layerOptions)||void 0===e||e.layers.some((t=>{if(t.id===i)return h=t,!0}));const a=(null==h?void 0:h.fields)&&(null==h?void 0:h.fieldOrder)?h.fieldOrder.filter((i=>h.fields.indexOf(i)>-1)):void 0;let o;return t&&(o=h&&(null==h?void 0:h.fields)?t.reduce(((i,t)=>{if(h.fields.indexOf(t.name)>-1){const s={type:"field",fieldName:t.name,label:t.alias,menuConfig:this._getMenuConfig(t.name)};i.push(s)}return i}),[]).sort(this._sortFields.bind(this,null==h?void 0:h.fieldOrder)):t.map((i=>({type:"field",fieldName:i.name,label:i.alias,menuConfig:this._getMenuConfig(i.name)})))),a?null==o?void 0:o.sort(this._sortFields.bind(this,a)):o}_sortFields(i,t,s){return(null==i?void 0:i.indexOf(t.fieldName))-i.indexOf(s.fieldName)}_getMenuConfig(i){return{items:[{label:this._translations.hideField,icon:"view-hide",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(i)}}]}}_handleHideClick(i){this._columnsInfo[i]=!1,this._table.hideColumn(i),this._table.tableTemplate.columnTemplates.forEach((t=>{t.fieldName===i&&(t.visible=!1)}))}async _getTranslations(){const i=await a(this.el);this._translations=i[0]}get el(){return e(this)}static get watchers(){return{defaultOid:["defaultOidWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],enableCSV:["enableCSVWatchHandler"],enableInlineEdit:["enableInlineEditWatchHandler"],enableShare:["enableShareWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"],isMobile:["isMobileWatchHandler"],mapInfo:["mapInfoWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],selectedIds:["selectedIdsWatchHandler"]}}};f.style=':host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{font-size:14px !important;color:var(--calcite-color-text-3) !important}.share-action{position:absolute;right:0}html[dir="rtl"] .share-action{left:0}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.instant-app-share{height:50px !important;display:inline-flex}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-modal-content-padding:0}.esri-feature-table__table-container{height:100%}';const m=class{constructor(t){i(this,t),this.mapChanged=h(this,"mapChanged",7),this.beforeMapChanged=h(this,"beforeMapChanged",7),this._defaultWebmapHonored=!1,this._loadedId="",this.appProxies=void 0,this.defaultWebmapId="",this.enableHome=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSingleExpand=!0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.homeZoomIndex=3,this.homeZoomPosition="top-left",this.homeZoomToolsSize="m",this.mapInfos=[],this.mapWidgetsIndex=0,this.mapWidgetsPosition="top-right",this.mapWidgetsSize="m",this.mapView=void 0,this.stackTools=!0,this.theme=void 0,this.toolOrder=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}enableHomeWatchHandler(){this._initHome()}async mapInfoChange(i){await this._loadMap(i.detail)}async componentWillLoad(){await this._initModules()}render(){var i,e;const h=this.hidden?"visibility-hidden-1":"",a="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",o=(null===(i=this.mapInfos)||void 0===i?void 0:i.length)>1?"":"display-none",l=(null===(e=this.mapInfos)||void 0===e?void 0:e.length)>1?"map-height":"height-full";return t(s,{key:"4f5c0cd408f92856ceb2ba281a02856064ef6a5a"},t("map-picker",{key:"f69742384dc5ba13bbf257592cc8c35de77590f0",class:o,mapInfos:this.mapInfos,ref:i=>this._mapPicker=i}),t("div",{key:"3ddddf3f674d49ae59fe627af1c67ec59718c9a3",class:`${l} ${h}`,ref:i=>this._mapDiv=i}),t("map-tools",{key:"6cb9518e74af0594ab6b657f0caec3598c250cb2",basemapConfig:this.basemapConfig,class:`box-shadow ${a}`,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:this.enableSingleExpand,homeZoomToolsSize:this.homeZoomToolsSize,mapView:this.mapView,mapWidgetsSize:this.mapWidgetsSize,position:this.mapWidgetsPosition,ref:i=>this._mapTools=i,searchConfiguration:this._searchConfiguration,stackTools:this.stackTools,toolOrder:this.toolOrder}))}async _initModules(){const[i,t,s,e]=await o(["esri/WebMap","esri/views/MapView","esri/widgets/Home","esri/config"]);this.WebMap=i,this.MapView=t,this.Home=s,this.esriConfig=e}async _loadMap(i){var t;const s=!this._defaultWebmapHonored&&this.defaultWebmapId,e=null===(t=this.mapInfos)||void 0===t?void 0:t.filter((i=>i.id===this.defaultWebmapId)),h=JSON.stringify(i)!==JSON.stringify(this._webMapInfo);this._webMapInfo=s&&e?e[0]:!(null==i?void 0:i.id)&&this.mapInfos.length>0?this.mapInfos[0]:i;const a=this._webMapInfo.id,o=s&&(null==i?void 0:i.id)===this.defaultWebmapId;if(this._loadedId!==a&&!s||o){const i=new this.WebMap({portalItem:{id:a}});this.appProxies&&(await i.load(),await(l=i,n=this.esriConfig,d=this.appProxies,d&&d.forEach((i=>{l.allLayers.forEach((t=>{t&&t.url===i.sourceUrl&&(t.url=i.proxyUrl,t.portalItem&&t.portalItem.when((()=>{t.portalItem.url=i.proxyUrl})),n.request?.interceptors?.push({urls:i.sourceUrl,before:t=>{t.url&&t.url===i.sourceUrl&&(t.url=i.proxyUrl)}}))}))})),l)),this.mapView=new this.MapView({container:this._mapDiv,map:i,resizeAlign:"center"}),this._loadedId=a,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{this._initHome(),this.mapView.ui.add(this._mapTools,{position:this.mapWidgetsPosition,index:this.mapWidgetsIndex}),this._defaultWebmapHonored=!!o||this._defaultWebmapHonored,this.mapChanged.emit({id:a,mapView:this.mapView})}))}else s?(this._defaultWebmapHonored=!0,this._mapPicker.setMapByID(a)):h&&(this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),this.mapChanged.emit({id:a,mapView:this.mapView}));var l,n,d}_initHome(){if(this.enableHome){this._homeWidget=new this.Home({view:this.mapView}),this.mapView.ui.add(this._homeWidget,{position:this.homeZoomPosition,index:this.homeZoomIndex});const i="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";this._homeWidget.domNode.style.height=i,this._homeWidget.domNode.style.width=i}else this._homeWidget&&this.mapView.ui.remove(this._homeWidget)}get el(){return e(this)}static get watchers(){return{enableHome:["enableHomeWatchHandler"]}}};m.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.box-shadow{box-shadow:none !important}.visibility-hidden-1{visibility:hidden;height:1px;}.display-none{display:none}";export{b as card_manager,f as layer_table,m as map_card}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as i,h as e,H as s,g as a}from"./p-6d753a3d.js";import{c as o}from"./p-bfd3d428.js";import{C as r}from"./p-c41997d5.js";import{g as n}from"./p-896c9644.js";import{d as h,p as l}from"./p-583e5dd0.js";import{s as c}from"./p-f22a4439.js";import"./p-82e085d0.js";import"./p-c1cf3ebc.js";import"./p-bdcf99c0.js";const d=class{constructor(e){t(this,e),this.calciteInternalDropdownItemChange=i(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach((t=>t.selectionMode=this.selectionMode))},this.mutationObserver=o("mutation",(()=>this.updateItems())),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){var t;this.updateItems(),null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect()}render(){const t=this.groupTitle?e("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?e("div",{class:"dropdown-separator",role:"separator"}):null;return e(s,{key:"c1b662afcbb612d775cea66edb949d71f5f63167","aria-label":this.groupTitle,role:"group"},e("div",{key:"cdfdb0919b1b6006f69f7fbcda0c16c2beefec5e",class:{[r.container]:!0,[`${r.container}--${this.scale}`]:!0}},i,t,e("slot",{key:"166c8236f3315d2f038f61b0619270d2bd9b344a"})))}updateActiveItemOnChange(t){this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{selectionMode:["handlePropsChange"]}}};d.style=":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}";const p=class{constructor(e){t(this,e),this.idsFound=i(this,"idsFound",7),this.noLayersFound=i(this,"noLayersFound",7),this.layerSelectionChange=i(this,"layerSelectionChange",7),this.defaultLayerHonored=!1,this.appearance="transparent",this.defaultLayerId="",this.display="inline-block",this.enabledLayerIds=[],this.enabledTableIds=[],this.height=void 0,this.isMobile=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.placeholderIcon="",this.selectedIds=[],this.scale="m",this.showTables=void 0,this.showSingleLayerAsLabel=!1,this.type="select",this._hasMultipleLayers=!0,this._hasValidLayers=!0,this._isDropdownOpen=void 0,this.ids=[],this.selectedName="",this._translations=void 0}async mapViewWatchHandler(){await this._setLayers(),this.ids.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this._setSelectedLayer(this.ids[0])):(this._hasValidLayers=!1,this.noLayersFound.emit())}async componentWillLoad(){await this._getTranslations(),await this._setLayers(),(this.ids.length>0||1===this.selectedIds.length)&&this.layerSelectionChange.emit(1===this.selectedIds.length?[this.selectedIds[0]]:[this.ids[0]])}render(){const t="map-layer-picker";let i=this.height>0?{height:`${this.height.toString()}px`}:{};return i=Object.assign(Object.assign({},i),{display:this.display}),e(s,{key:"ccb8c7d12a2e631938308380cd4ecd0a1d73c963"},e("div",{key:"aa0992de9bab1c5a555d51542c093cc7cb948200",class:"map-layer-picker-container",style:i},e("div",{key:"a03bca67eb822b492d34abe53db7d05e6fd7ebdf",class:"map-layer-picker",style:i},this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():"combobox"===this.type?this._getCombobox(t):"select"===this.type?this._getSelect(t):this._getDropdown(t):this._getInvalidPlaceholder())))}async componentDidLoad(){if(this.ids.length>0||1===this.selectedIds.length){const t=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];"select"===this.type?this._layerElement.value=t:"dropdown"===this.type&&(this.selectedName=Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t].name:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t].name:"")}}_getInvalidPlaceholder(){return e("div",null,e("calcite-notice",{class:"height-100",icon:"exclamation-mark-triangle",id:"no-valid-layers",kind:"danger",open:!0},e("div",{slot:"message"},this._translations.noLayersFound)),e("calcite-tooltip",{label:this._translations.enableEditUpdate,placement:"bottom","reference-element":"no-valid-layers"},e("span",null,this._translations.enableEditUpdate)))}_getSingleLayerPlaceholder(){return e("div",{class:"layer-picker-label-container cursor-default"},e("calcite-icon",{icon:"layers",scale:"s"}),e("calcite-label",{class:"no-bottom-margin padding-start-1"},this.selectedName))}_getSelect(t){return e("calcite-select",{id:t,label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:t=>{this._layerElement=t},scale:this.scale},this._getMapLayerOptions())}_getCombobox(t){return e("calcite-combobox",{clearDisabled:!0,id:t,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:t=>{this._layerElement=t},scale:this.scale,"selection-mode":"single"},this._getMapLayerOptions())}_getDropdown(t){return e("calcite-dropdown",{class:"layer-picker-dropdown",onCalciteDropdownBeforeClose:()=>this._isDropdownOpen=!1,onCalciteDropdownBeforeOpen:()=>this._isDropdownOpen=!0},this.isMobile?this._getDropdownButton():this._getActionDropdownButton(t),e("calcite-dropdown-group",{"selection-mode":"single"},this._getMapLayerOptions()))}_getActionDropdownButton(t){return e("calcite-action",{id:t,slot:"trigger",text:""},this._getDropdownButton())}_getDropdownButton(){return e("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:this.isMobile?"":"max-width-350",iconEnd:this._isDropdownOpen?"chevron-up":"chevron-down",iconStart:"layers",kind:"neutral",slot:this.isMobile?"trigger":"",width:"full"},e("div",null,this.selectedName))}_getMapLayerOptions(){return this.ids.reduce(((t,i)=>(this._validLayer(i)?t.push(this._getItem(i,"layer")):this._validTable(i)&&t.push(this._getItem(i,"table")),t)),[])}_getItem(t,i){const s="layer"===i?this._layerNameHash[t]:this._tableNameHash[t],a=!!this.onlyShowUpdatableLayers&&!s.supportsUpdate,o=s.name,r=this.selectedIds.indexOf(t)>-1;return"combobox"===this.type?e("calcite-combobox-item",{disabled:a,selected:r,textLabel:o,value:t}):"select"===this.type?e("calcite-option",{disabled:a,label:o,selected:r,value:t}):e("calcite-dropdown-group",{class:a?"disabled":"",selectionMode:a?"none":"single"},e("calcite-dropdown-item",{onClick:a?void 0:()=>{this._setSelectedLayer(t)},selected:r},o))}_setSelectedLayer(t){let i;this.defaultLayerId&&!this.defaultLayerHonored&&(i=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=void 0!==i,t=this.defaultLayerHonored?this.defaultLayerId:t),i=i||this._getLayerFromHash(t),this.selectedName=null==i?void 0:i.name,this.selectedIds=[t],this.layerSelectionChange.emit(this.selectedIds)}_getLayerFromHash(t){return Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t]:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();const t=this.onlyShowUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash),i=this.showTables?this.onlyShowUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[];this.ids=[...t.reverse().filter((t=>{var i;return!((null===(i=this.enabledLayerIds)||void 0===i?void 0:i.length)>0)||this.enabledLayerIds.reverse().indexOf(t)>-1})),...i.reverse().filter((t=>{var i;return!((null===(i=this.enabledTableIds)||void 0===i?void 0:i.length)>0)||this.enabledTableIds.reverse().indexOf(t)>-1}))],this.idsFound.emit({layerIds:t,tableIds:i})}}_getEditableIds(t){return Object.keys(t).reduce(((i,e)=>(t[e].supportsUpdate&&i.push(e),i)),[])}async _initLayerTableHash(){this._layerNameHash=await h(this.mapView,this.onlyShowUpdatableLayers),this._tableNameHash=this.showTables?await l(this.mapView,this.onlyShowUpdatableLayers):{}}_validLayer(t){var i;const e=null===(i=this._layerNameHash[t])||void 0===i?void 0:i.name;return e&&Object.keys(c.managedLayers).indexOf(e)<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)}_validTable(t){var i;const e=null===(i=this._tableNameHash[t])||void 0===i?void 0:i.name,s=e&&this.showTables;return s?c.managedTables.indexOf(e)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(t)>-1):s}_layerSelectionChange(){const t=Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value];JSON.stringify(t)!==JSON.stringify([""])&&(this.selectedIds=t,this.layerSelectionChange.emit(this.selectedIds))}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";export{d as calcite_dropdown_group,p as map_layer_picker}
6
+ import{r as t,c as i,h as e,H as s,g as a}from"./p-6d753a3d.js";import{c as o}from"./p-bfd3d428.js";import{C as r}from"./p-c41997d5.js";import{g as n}from"./p-896c9644.js";import{d as h,p as l}from"./p-583e5dd0.js";import{s as c}from"./p-f22a4439.js";import"./p-82e085d0.js";import"./p-c1cf3ebc.js";import"./p-bdcf99c0.js";const d=class{constructor(e){t(this,e),this.calciteInternalDropdownItemChange=i(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach((t=>t.selectionMode=this.selectionMode))},this.mutationObserver=o("mutation",(()=>this.updateItems())),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){var t;this.updateItems(),null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect()}render(){const t=this.groupTitle?e("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?e("div",{class:"dropdown-separator",role:"separator"}):null;return e(s,{key:"c1b662afcbb612d775cea66edb949d71f5f63167","aria-label":this.groupTitle,role:"group"},e("div",{key:"cdfdb0919b1b6006f69f7fbcda0c16c2beefec5e",class:{[r.container]:!0,[`${r.container}--${this.scale}`]:!0}},i,t,e("slot",{key:"166c8236f3315d2f038f61b0619270d2bd9b344a"})))}updateActiveItemOnChange(t){this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{selectionMode:["handlePropsChange"]}}};d.style=":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}";const p=class{constructor(e){t(this,e),this.idsFound=i(this,"idsFound",7),this.noLayersFound=i(this,"noLayersFound",7),this.layerSelectionChange=i(this,"layerSelectionChange",7),this.defaultLayerHonored=!1,this.appearance="transparent",this.defaultLayerId="",this.display="inline-block",this.enabledLayerIds=[],this.enabledTableIds=[],this.height=void 0,this.isMobile=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.placeholderIcon="",this.selectedIds=[],this.scale="m",this.showTables=void 0,this.showSingleLayerAsLabel=!1,this.type="select",this._hasMultipleLayers=!0,this._hasValidLayers=!0,this._isDropdownOpen=void 0,this.ids=[],this.selectedName="",this._translations=void 0}async mapViewWatchHandler(){await this._setLayers(),this.ids.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this._setSelectedLayer(this.ids[0])):(this._hasValidLayers=!1,this.noLayersFound.emit())}async componentWillLoad(){await this._getTranslations(),await this._setLayers(),(this.ids.length>0||1===this.selectedIds.length)&&this.layerSelectionChange.emit(1===this.selectedIds.length?[this.selectedIds[0]]:[this.ids[0]])}render(){const t="map-layer-picker";let i=this.height>0?{height:`${this.height.toString()}px`}:{};return i=Object.assign(Object.assign({},i),{display:this.display}),e(s,{key:"a96e93924530d926c5e10dd2f7212f3f8c1cbe3c"},e("div",{key:"4b96a73e43e86c31291e4ac60eb15976b01de6a2",class:"map-layer-picker-container",style:i},e("div",{key:"e75c61d8ce0853814dd3903b9e1952cc613b6fbb",class:"map-layer-picker",style:i},this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():"combobox"===this.type?this._getCombobox(t):"select"===this.type?this._getSelect(t):this._getDropdown(t):this._getInvalidPlaceholder())))}async componentDidLoad(){if(this.ids.length>0||1===this.selectedIds.length){const t=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];"select"===this.type?this._layerElement.value=t:"dropdown"===this.type&&(this.selectedName=Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t].name:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t].name:"")}}_getInvalidPlaceholder(){return e("div",null,e("calcite-notice",{class:"height-100",icon:"exclamation-mark-triangle",id:"no-valid-layers",kind:"danger",open:!0},e("div",{slot:"message"},this._translations.noLayersFound)),e("calcite-tooltip",{label:this._translations.enableEditUpdate,placement:"bottom","reference-element":"no-valid-layers"},e("span",null,this._translations.enableEditUpdate)))}_getSingleLayerPlaceholder(){return e("div",{class:"layer-picker-label-container cursor-default"},e("calcite-icon",{icon:"layers",scale:"s"}),e("calcite-label",{class:"no-bottom-margin padding-start-1"},this.selectedName))}_getSelect(t){return e("calcite-select",{id:t,label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:t=>{this._layerElement=t},scale:this.scale},this._getMapLayerOptions())}_getCombobox(t){return e("calcite-combobox",{clearDisabled:!0,id:t,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:t=>{this._layerElement=t},scale:this.scale,"selection-mode":"single"},this._getMapLayerOptions())}_getDropdown(t){return e("calcite-dropdown",{class:"layer-picker-dropdown",onCalciteDropdownBeforeClose:()=>this._isDropdownOpen=!1,onCalciteDropdownBeforeOpen:()=>this._isDropdownOpen=!0},this.isMobile?this._getDropdownButton():this._getActionDropdownButton(t),e("calcite-dropdown-group",{"selection-mode":"single"},this._getMapLayerOptions()))}_getActionDropdownButton(t){return e("calcite-action",{id:t,slot:"trigger",text:""},this._getDropdownButton())}_getDropdownButton(){return e("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:this.isMobile?"":"max-width-350",iconEnd:this._isDropdownOpen?"chevron-up":"chevron-down",iconStart:"layers",kind:"neutral",slot:this.isMobile?"trigger":"",width:"full"},e("div",null,this.selectedName))}_getMapLayerOptions(){return this.ids.reduce(((t,i)=>(this._validLayer(i)?t.push(this._getItem(i,"layer")):this._validTable(i)&&t.push(this._getItem(i,"table")),t)),[])}_getItem(t,i){const s="layer"===i?this._layerNameHash[t]:this._tableNameHash[t],a=!!this.onlyShowUpdatableLayers&&!s.supportsUpdate,o=s.name,r=this.selectedIds.indexOf(t)>-1;return"combobox"===this.type?e("calcite-combobox-item",{disabled:a,selected:r,textLabel:o,value:t}):"select"===this.type?e("calcite-option",{disabled:a,label:o,selected:r,value:t}):e("calcite-dropdown-group",{class:a?"disabled":"",selectionMode:a?"none":"single"},e("calcite-dropdown-item",{onClick:a?void 0:()=>{this._setSelectedLayer(t)},selected:r},o))}_setSelectedLayer(t){let i;this.defaultLayerId&&!this.defaultLayerHonored&&(i=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=void 0!==i,t=this.defaultLayerHonored?this.defaultLayerId:t),i=i||this._getLayerFromHash(t),this.selectedName=null==i?void 0:i.name,this.selectedIds=[t],this.layerSelectionChange.emit(this.selectedIds)}_getLayerFromHash(t){return Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t]:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();const t=this.onlyShowUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash),i=this.showTables?this.onlyShowUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[];this.ids=[...t.reverse().filter((t=>{var i;return!((null===(i=this.enabledLayerIds)||void 0===i?void 0:i.length)>0)||this.enabledLayerIds.reverse().indexOf(t)>-1})),...i.reverse().filter((t=>{var i;return!((null===(i=this.enabledTableIds)||void 0===i?void 0:i.length)>0)||this.enabledTableIds.reverse().indexOf(t)>-1}))],this.idsFound.emit({layerIds:t,tableIds:i})}}_getEditableIds(t){return Object.keys(t).reduce(((i,e)=>(t[e].supportsUpdate&&i.push(e),i)),[])}async _initLayerTableHash(){this._layerNameHash=await h(this.mapView,this.onlyShowUpdatableLayers),this._tableNameHash=this.showTables?await l(this.mapView,this.onlyShowUpdatableLayers):{}}_validLayer(t){var i;const e=null===(i=this._layerNameHash[t])||void 0===i?void 0:i.name;return e&&Object.keys(c.managedLayers).indexOf(e)<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)}_validTable(t){var i;const e=null===(i=this._tableNameHash[t])||void 0===i?void 0:i.name,s=e&&this.showTables;return s?c.managedTables.indexOf(e)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(t)>-1):s}_layerSelectionChange(){const t=Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value];JSON.stringify(t)!==JSON.stringify([""])&&(this.selectedIds=t,this.layerSelectionChange.emit(this.selectedIds))}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";export{d as calcite_dropdown_group,p as map_layer_picker}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as a,h as e,H as i,g as t}from"./p-6d753a3d.js";import{c as l}from"./p-8294d644.js";const s=class{constructor(e){a(this,e),this.showAddDeduct=!1}render(){const a=this.showAddDeduct?"position-relative":"display-none";return e(i,{key:"233eb3eff2bc15f80185cb307036525e29fe8f5b"},e("div",{key:"db45b9f334c57a2b0100b8f4b4ad3c3744410acf",class:this.showAddDeduct?"display-none":"display-grid"},e("div",{key:"eb8750201d287d5558167501aa7ef96eacfa3ae4",class:"label-display"},e("calcite-label",{key:"da7df5155e6913225e7e7518fb5e6a4653c9bf52",class:"label-display"},"Enter comma delimited deduct values",this._getDeductValuesInput())),e("div",{key:"fb09ba5c7f6eab2463d6f170ba123fbfa71bffd2"},this._getCalculateButton())),e("div",{key:"f95f8ae0cdb7130af0dad47c55996556ad02ae34",class:a},e("div",{key:"6ac0a2b8486706dfa8cd00a53cad3e549d87ce52",class:"position-right"},e("calcite-action",{key:"c88e53dcfda877905a674a5dee2c4385651db92a",appearance:"transparent",class:"float-end",icon:"x",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""})),e("deduct-calculator",{key:"58396ab41f9d83629fe504b208eb3168dd86ceb8",class:"display-grid padding-top-1",onDeductValueComplete:a=>this._addDeductValue(a)})))}_getDeductValuesInput(){return e("div",{class:"display-flex"},e("calcite-input",{class:"main-input",ref:a=>{this._deductValuesElement=a}}),e("calcite-action",{appearance:"transparent",icon:"plus-circle",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""}))}_getCalculateButton(){return e("calcite-button",{onClick:()=>this._calculatePCI(this._deductValuesElement.value)},"Calculate PCI")}_toggleShowAddDeduct(){this.showAddDeduct=!this.showAddDeduct}_addDeductValue(a){this._toggleShowAddDeduct(),this._deductValuesElement.value+=Math.abs(parseFloat(this._deductValuesElement.value))>0?`,${a.detail}`:a.detail}_calculatePCI(a){const e=l(a,!0),i=e<=10?"Failed":e<=25?"Serious":e<=40?"Very Poor":e<=55?"Poor":e<=70?"Fair":e<=85?"Satisfactory":"Good";console.log(`PCI: ${e}`),console.log(`Rating: ${i}`),alert("See debug console for results")}get el(){return t(this)}};s.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";export{s as pci_calculator}