@esri/solutions-components 0.7.35 → 0.7.36

Sign up to get free protection for your applications and to get access to all the features.
@@ -641,7 +641,7 @@ const FeatureList = class {
641
641
  */
642
642
  render() {
643
643
  return (index.h("calcite-panel", { "full-height": true, "full-width": true }, this._isLoading && index.h("calcite-loader", { label: "", scale: "m" }), this._featureItems.length === 0 && !this._isLoading &&
644
- index.h("calcite-notice", { class: "error-msg", icon: "feature-details", kind: "info", open: true }, index.h("div", { slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), index.h("calcite-list", { "selection-appearance": "border", "selection-mode": "single" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
644
+ index.h("calcite-notice", { class: "error-msg", icon: "feature-details", kind: "info", open: true }, index.h("div", { slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), index.h("calcite-list", { "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
645
645
  index.h("div", { class: "width-full", slot: "footer" }, index.h("calcite-pagination", { class: "pagination", "full-width": true, onCalcitePaginationChange: this.pageChanged.bind(this), "page-size": this.pageSize, "start-item": "1", "total-items": this._featuresCount }))));
646
646
  }
647
647
  //--------------------------------------------------------------------------
@@ -689,14 +689,12 @@ const FeatureList = class {
689
689
  this._highlightHandle = null;
690
690
  }
691
691
  //highlight on map only if it is selected item
692
- if (event.target.selected) {
693
- if (this.highlightOnMap) {
694
- const selectedFeatureObjectId = Number(event.target.value);
695
- const selectedLayerView = await mapViewUtils.getFeatureLayerView(this.mapView, this.selectedLayerId);
696
- this._highlightHandle = await mapViewUtils.highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
697
- }
698
- this.featureSelect.emit(selectedFeature);
692
+ if (this.highlightOnMap) {
693
+ const selectedFeatureObjectId = Number(event.target.value);
694
+ const selectedLayerView = await mapViewUtils.getFeatureLayerView(this.mapView, this.selectedLayerId);
695
+ this._highlightHandle = await mapViewUtils.highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
699
696
  }
697
+ this.featureSelect.emit(selectedFeature);
700
698
  }
701
699
  /**
702
700
  * Query the selected feature layer, in descending order of object id's
@@ -409,9 +409,13 @@ const CrowdsourceManager = class {
409
409
  * Update the component layout when its size changes
410
410
  */
411
411
  _onResize() {
412
- this._isMobile = this.el.offsetWidth < 1024;
412
+ const isMobile = this.el.offsetWidth < 1024;
413
+ const forceOpen = !this._isMobile && isMobile;
414
+ this._isMobile = isMobile;
413
415
  this._layoutMode = this._isMobile ? interfaces.ELayoutMode.HORIZONTAL : interfaces.ELayoutMode.GRID;
414
- this._panelOpen = true;
416
+ if (forceOpen) {
417
+ this._panelOpen = true;
418
+ }
415
419
  }
416
420
  /**
417
421
  * Open/Close the appropriate panel.
@@ -92,7 +92,7 @@ const CrowdsourceReporter = class {
92
92
  */
93
93
  render() {
94
94
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
95
- return (index.h(index.Host, null, this._reportSubmitted && index.h("calcite-alert", { "auto-close": true, class: themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, index.h("div", { slot: "title" }, this._translations.reportSubmit), index.h("div", { slot: "message" }, this._translations.submitMsg)), this._featureCreationFailedErrorMsg && index.h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, index.h("div", { slot: "title" }, this._translations.error), index.h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), index.h("div", null, index.h("calcite-shell", { "content-behind": true }, this._getReporter()))));
95
+ return (index.h(index.Host, null, this._reportSubmitted && index.h("calcite-alert", { "auto-close": true, class: themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, index.h("div", { slot: "title" }, this._translations.reportSubmit), index.h("div", { slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && index.h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, index.h("div", { slot: "title" }, this._translations.error), index.h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), index.h("div", null, index.h("calcite-shell", { "content-behind": true }, this._getReporter()))));
96
96
  }
97
97
  //--------------------------------------------------------------------------
98
98
  //
@@ -162,9 +162,7 @@ const CrowdsourceReporter = class {
162
162
  * @protected
163
163
  */
164
164
  getLayerListFlowItem() {
165
- return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this._hasValidLayers &&
166
- index.h("calcite-action", { icon: "sort-ascending-arrow", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.sort, "text-enabled": this.isMobile }), this._hasValidLayers &&
167
- index.h("calcite-action", { icon: "filter", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
165
+ return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
168
166
  index.h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText), index.h("calcite-panel", { "full-height": true, "full-width": true }, index.h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._translations.noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
169
167
  }
170
168
  /**
@@ -341,7 +339,7 @@ const CrowdsourceReporter = class {
341
339
  * @protected
342
340
  */
343
341
  getFeatureListFlowItem(layerId, layerName) {
344
- return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, index.h("calcite-action", { icon: "sort-ascending-arrow", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.sort, "text-enabled": this.isMobile }), index.h("calcite-action", { icon: "filter", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
342
+ return (index.h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
345
343
  index.h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText), index.h("calcite-panel", { "full-height": true }, index.h("feature-list", { class: "height-full", highlightOnMap: true, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, selectedLayerId: layerId }))));
346
344
  }
347
345
  /**
@@ -414,9 +414,13 @@ export class CrowdsourceManager {
414
414
  * Update the component layout when its size changes
415
415
  */
416
416
  _onResize() {
417
- this._isMobile = this.el.offsetWidth < 1024;
417
+ const isMobile = this.el.offsetWidth < 1024;
418
+ const forceOpen = !this._isMobile && isMobile;
419
+ this._isMobile = isMobile;
418
420
  this._layoutMode = this._isMobile ? ELayoutMode.HORIZONTAL : ELayoutMode.GRID;
419
- this._panelOpen = true;
421
+ if (forceOpen) {
422
+ this._panelOpen = true;
423
+ }
420
424
  }
421
425
  /**
422
426
  * Open/Close the appropriate panel.
@@ -97,7 +97,7 @@ export class CrowdsourceReporter {
97
97
  */
98
98
  render() {
99
99
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
100
- return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.reportSubmit), h("div", { slot: "message" }, this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter()))));
100
+ return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.reportSubmit), h("div", { slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter()))));
101
101
  }
102
102
  //--------------------------------------------------------------------------
103
103
  //
@@ -167,9 +167,7 @@ export class CrowdsourceReporter {
167
167
  * @protected
168
168
  */
169
169
  getLayerListFlowItem() {
170
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this._hasValidLayers &&
171
- h("calcite-action", { icon: "sort-ascending-arrow", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.sort, "text-enabled": this.isMobile }), this._hasValidLayers &&
172
- h("calcite-action", { icon: "filter", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
170
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
173
171
  h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._translations.noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
174
172
  }
175
173
  /**
@@ -346,7 +344,7 @@ export class CrowdsourceReporter {
346
344
  * @protected
347
345
  */
348
346
  getFeatureListFlowItem(layerId, layerName) {
349
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, h("calcite-action", { icon: "sort-ascending-arrow", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.sort, "text-enabled": this.isMobile }), h("calcite-action", { icon: "filter", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
347
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
350
348
  h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", highlightOnMap: true, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, selectedLayerId: layerId }))));
351
349
  }
352
350
  /**
@@ -74,7 +74,7 @@ export class FeatureList {
74
74
  */
75
75
  render() {
76
76
  return (h("calcite-panel", { "full-height": true, "full-width": true }, this._isLoading && h("calcite-loader", { label: "", scale: "m" }), this._featureItems.length === 0 && !this._isLoading &&
77
- h("calcite-notice", { class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { "selection-appearance": "border", "selection-mode": "single" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
77
+ h("calcite-notice", { class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
78
78
  h("div", { class: "width-full", slot: "footer" }, h("calcite-pagination", { class: "pagination", "full-width": true, onCalcitePaginationChange: this.pageChanged.bind(this), "page-size": this.pageSize, "start-item": "1", "total-items": this._featuresCount }))));
79
79
  }
80
80
  //--------------------------------------------------------------------------
@@ -122,14 +122,12 @@ export class FeatureList {
122
122
  this._highlightHandle = null;
123
123
  }
124
124
  //highlight on map only if it is selected item
125
- if (event.target.selected) {
126
- if (this.highlightOnMap) {
127
- const selectedFeatureObjectId = Number(event.target.value);
128
- const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayerId);
129
- this._highlightHandle = await highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
130
- }
131
- this.featureSelect.emit(selectedFeature);
125
+ if (this.highlightOnMap) {
126
+ const selectedFeatureObjectId = Number(event.target.value);
127
+ const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayerId);
128
+ this._highlightHandle = await highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
132
129
  }
130
+ this.featureSelect.emit(selectedFeature);
133
131
  }
134
132
  /**
135
133
  * Query the selected feature layer, in descending order of object id's
@@ -461,9 +461,13 @@ const CrowdsourceManager$1 = /*@__PURE__*/ proxyCustomElement(class CrowdsourceM
461
461
  * Update the component layout when its size changes
462
462
  */
463
463
  _onResize() {
464
- this._isMobile = this.el.offsetWidth < 1024;
464
+ const isMobile = this.el.offsetWidth < 1024;
465
+ const forceOpen = !this._isMobile && isMobile;
466
+ this._isMobile = isMobile;
465
467
  this._layoutMode = this._isMobile ? ELayoutMode.HORIZONTAL : ELayoutMode.GRID;
466
- this._panelOpen = true;
468
+ if (forceOpen) {
469
+ this._panelOpen = true;
470
+ }
467
471
  }
468
472
  /**
469
473
  * Open/Close the appropriate panel.
@@ -119,7 +119,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
119
119
  */
120
120
  render() {
121
121
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
122
- return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.reportSubmit), h("div", { slot: "message" }, this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter()))));
122
+ return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.reportSubmit), h("div", { slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter()))));
123
123
  }
124
124
  //--------------------------------------------------------------------------
125
125
  //
@@ -189,9 +189,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
189
189
  * @protected
190
190
  */
191
191
  getLayerListFlowItem() {
192
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this._hasValidLayers &&
193
- h("calcite-action", { icon: "sort-ascending-arrow", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.sort, "text-enabled": this.isMobile }), this._hasValidLayers &&
194
- h("calcite-action", { icon: "filter", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
192
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
195
193
  h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._translations.noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
196
194
  }
197
195
  /**
@@ -368,7 +366,7 @@ const CrowdsourceReporter$1 = /*@__PURE__*/ proxyCustomElement(class Crowdsource
368
366
  * @protected
369
367
  */
370
368
  getFeatureListFlowItem(layerId, layerName) {
371
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, h("calcite-action", { icon: "sort-ascending-arrow", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.sort, "text-enabled": this.isMobile }), h("calcite-action", { icon: "filter", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
369
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
372
370
  h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", highlightOnMap: true, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, selectedLayerId: layerId }))));
373
371
  }
374
372
  /**
@@ -81,7 +81,7 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
81
81
  */
82
82
  render() {
83
83
  return (h("calcite-panel", { "full-height": true, "full-width": true }, this._isLoading && h("calcite-loader", { label: "", scale: "m" }), this._featureItems.length === 0 && !this._isLoading &&
84
- h("calcite-notice", { class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { "selection-appearance": "border", "selection-mode": "single" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
84
+ h("calcite-notice", { class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
85
85
  h("div", { class: "width-full", slot: "footer" }, h("calcite-pagination", { class: "pagination", "full-width": true, onCalcitePaginationChange: this.pageChanged.bind(this), "page-size": this.pageSize, "start-item": "1", "total-items": this._featuresCount }))));
86
86
  }
87
87
  //--------------------------------------------------------------------------
@@ -129,14 +129,12 @@ const FeatureList = /*@__PURE__*/ proxyCustomElement(class FeatureList extends H
129
129
  this._highlightHandle = null;
130
130
  }
131
131
  //highlight on map only if it is selected item
132
- if (event.target.selected) {
133
- if (this.highlightOnMap) {
134
- const selectedFeatureObjectId = Number(event.target.value);
135
- const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayerId);
136
- this._highlightHandle = await highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
137
- }
138
- this.featureSelect.emit(selectedFeature);
132
+ if (this.highlightOnMap) {
133
+ const selectedFeatureObjectId = Number(event.target.value);
134
+ const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayerId);
135
+ this._highlightHandle = await highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
139
136
  }
137
+ this.featureSelect.emit(selectedFeature);
140
138
  }
141
139
  /**
142
140
  * Query the selected feature layer, in descending order of object id's
@@ -637,7 +637,7 @@ const FeatureList = class {
637
637
  */
638
638
  render() {
639
639
  return (h("calcite-panel", { "full-height": true, "full-width": true }, this._isLoading && h("calcite-loader", { label: "", scale: "m" }), this._featureItems.length === 0 && !this._isLoading &&
640
- h("calcite-notice", { class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { "selection-appearance": "border", "selection-mode": "single" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
640
+ h("calcite-notice", { class: "error-msg", icon: "feature-details", kind: "info", open: true }, h("div", { slot: "message" }, this.noFeaturesFoundMsg ? this.noFeaturesFoundMsg : this._translations.featureErrorMsg)), h("calcite-list", { "selection-appearance": "border", "selection-mode": "none" }, !this._isLoading && this._featureItems.length > 0 && this._featureItems), this._featuresCount > this.pageSize &&
641
641
  h("div", { class: "width-full", slot: "footer" }, h("calcite-pagination", { class: "pagination", "full-width": true, onCalcitePaginationChange: this.pageChanged.bind(this), "page-size": this.pageSize, "start-item": "1", "total-items": this._featuresCount }))));
642
642
  }
643
643
  //--------------------------------------------------------------------------
@@ -685,14 +685,12 @@ const FeatureList = class {
685
685
  this._highlightHandle = null;
686
686
  }
687
687
  //highlight on map only if it is selected item
688
- if (event.target.selected) {
689
- if (this.highlightOnMap) {
690
- const selectedFeatureObjectId = Number(event.target.value);
691
- const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayerId);
692
- this._highlightHandle = await highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
693
- }
694
- this.featureSelect.emit(selectedFeature);
688
+ if (this.highlightOnMap) {
689
+ const selectedFeatureObjectId = Number(event.target.value);
690
+ const selectedLayerView = await getFeatureLayerView(this.mapView, this.selectedLayerId);
691
+ this._highlightHandle = await highlightFeatures([selectedFeatureObjectId], selectedLayerView, this.mapView, true);
695
692
  }
693
+ this.featureSelect.emit(selectedFeature);
696
694
  }
697
695
  /**
698
696
  * Query the selected feature layer, in descending order of object id's
@@ -405,9 +405,13 @@ const CrowdsourceManager = class {
405
405
  * Update the component layout when its size changes
406
406
  */
407
407
  _onResize() {
408
- this._isMobile = this.el.offsetWidth < 1024;
408
+ const isMobile = this.el.offsetWidth < 1024;
409
+ const forceOpen = !this._isMobile && isMobile;
410
+ this._isMobile = isMobile;
409
411
  this._layoutMode = this._isMobile ? ELayoutMode.HORIZONTAL : ELayoutMode.GRID;
410
- this._panelOpen = true;
412
+ if (forceOpen) {
413
+ this._panelOpen = true;
414
+ }
411
415
  }
412
416
  /**
413
417
  * Open/Close the appropriate panel.
@@ -88,7 +88,7 @@ const CrowdsourceReporter = class {
88
88
  */
89
89
  render() {
90
90
  const themeClass = this.theme === "dark" ? "calcite-mode-dark" : "calcite-mode-light";
91
- return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.reportSubmit), h("div", { slot: "message" }, this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter()))));
91
+ return (h(Host, null, this._reportSubmitted && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "check-circle", kind: "success", label: "", onCalciteAlertClose: () => { this._reportSubmitted = false; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.reportSubmit), h("div", { slot: "message" }, this.reportSubmittedMessage ? this.reportSubmittedMessage : this._translations.submitMsg)), this._featureCreationFailedErrorMsg && h("calcite-alert", { "auto-close": true, class: themeClass, icon: "x-octagon", kind: "danger", label: "", onCalciteAlertClose: () => { this._featureCreationFailedErrorMsg = ""; }, open: true, placement: "top" }, h("div", { slot: "title" }, this._translations.error), h("div", { slot: "message" }, this._featureCreationFailedErrorMsg)), h("div", null, h("calcite-shell", { "content-behind": true }, this._getReporter()))));
92
92
  }
93
93
  //--------------------------------------------------------------------------
94
94
  //
@@ -158,9 +158,7 @@ const CrowdsourceReporter = class {
158
158
  * @protected
159
159
  */
160
160
  getLayerListFlowItem() {
161
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this._hasValidLayers &&
162
- h("calcite-action", { icon: "sort-ascending-arrow", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.sort, "text-enabled": this.isMobile }), this._hasValidLayers &&
163
- h("calcite-action", { icon: "filter", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
161
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: this.reportsHeader }, this.isMobile && this.getActionToExpandCollapsePanel(), this._hasValidLayers && this.enableNewReports &&
164
162
  h("calcite-button", { appearance: "solid", onClick: this.navigateToChooseCategory.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true, "full-width": true }, h("layer-list", { class: "height-full", layers: this.layers, mapView: this.mapView, noLayerErrorMsg: this._translations.noLayerToDisplayErrorMsg, onLayerSelect: this.displayFeaturesList.bind(this), onLayersListLoaded: this.layerListLoaded.bind(this), ref: el => this._layerList = el, showFeatureCount: true, showNextIcon: true }))));
165
163
  }
166
164
  /**
@@ -337,7 +335,7 @@ const CrowdsourceReporter = class {
337
335
  * @protected
338
336
  */
339
337
  getFeatureListFlowItem(layerId, layerName) {
340
- return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, h("calcite-action", { icon: "sort-ascending-arrow", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.sort, "text-enabled": this.isMobile }), h("calcite-action", { icon: "filter", slot: this.isMobile ? "header-menu-actions" : "header-actions-end", text: this._translations.filter, "text-enabled": this.isMobile }), this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
338
+ return (h("calcite-flow-item", { collapsed: this.isMobile && this._sidePanelCollapsed, heading: layerName, onCalciteFlowItemBack: this.backFromSelectedPanel.bind(this) }, this.isMobile && this.getActionToExpandCollapsePanel(), this.enableNewReports &&
341
339
  h("calcite-button", { appearance: "solid", onClick: this.navigateToCreateFeature.bind(this), slot: "footer", width: "full" }, this.reportButtonText), h("calcite-panel", { "full-height": true }, h("feature-list", { class: "height-full", highlightOnMap: true, mapView: this.mapView, noFeaturesFoundMsg: this._translations.featureErrorMsg, onFeatureSelect: this.onFeatureSelectFromList.bind(this), pageSize: 30, selectedLayerId: layerId }))));
342
340
  }
343
341
  /**
@@ -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,h as i,H as e,g as s}from"./p-7d280d8a.js";import{g as h}from"./p-b04c9dc3.js";import{E as l}from"./p-c1cf3ebc.js";import{g as o}from"./p-2c382841.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this._shouldSetMapView=!1,this.defaultCenter="",this.defaultFilter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableHome=!0,this.enableZoom=!0,this.enableBasemap=!0,this.basemapConfig=void 0,this.showNewestFirst=!0,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.theme="light",this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._hideFooter=!1,this._hideTable=!1,this._isMobile=void 0,this._translations=void 0,this._layer=void 0,this._layoutMode=l.GRID,this._mapInfo=void 0,this._mapView=void 0,this._panelOpen=!0,this._numSelected=0,this._tableOnly=!1}defaultCenterWatchHandler(){this._defaultCenter=this.defaultCenter?this.defaultCenter.split(";").map((t=>parseFloat(t))):void 0}defaultFilterWatchHandler(){this._defaultFilter=JSON.parse(this.defaultFilter)}defaultGlobalIdWatchHandler(){this._defaultGlobalId=this.defaultGlobalId?this.defaultGlobalId.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0}defaultOidWatchHandler(){this._defaultOid=this.defaultOid?this.defaultOid.indexOf(",")>-1?this.defaultOid.split(",").map((t=>parseInt(t,10))):[parseInt(this.defaultOid,10)]:void 0}defaultLevelWatchHandler(){this._defaultLevel=this.defaultLevel?parseInt(this.defaultLevel,10):void 0}enableZoomWatchHandler(){this._initMapZoom()}async featureSelectionChange(t){var i;this._numSelected=null===(i=t.detail)||void 0===i?void 0:i.length}async popupClosed(){this._isMobile&&this.showHideMapPopupAndTable(!1)}async idsFound(t){const i=t.detail;this._tableOnly=i.tableIds.length>0&&0===i.layerIds.length,this._tableOnly&&(this._expandPopup=!0)}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0,this._expandPopup=!1)}async layerSelectionChange(t){const i=t.detail[0],e=await o(this._mapView,i);await e.when((()=>{this._layer=e}))}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return i(e,null,i("calcite-shell",{class:"position-relative"},i("calcite-panel",{class:"width-full height-full "+(this._isMobile&&this._hideTable?"border-width-0":this._isMobile?"border-bottom-width-0":"")},this._getBody(this._layoutMode,this._panelOpen,this._hideTable)),this._getFooter()))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,await this._setMapView())}async componentDidLoad(){this._resizeObserver.observe(this.el)}_getFooter(){var t,e,s,h;const l=(null===(t=this._layer)||void 0===t?void 0:t.editingEnabled)&&(null===(h=null===(s=null===(e=this._layer)||void 0===e?void 0:e.capabilities)||void 0===s?void 0:s.operations)||void 0===h?void 0:h.supportsDelete);return this._isMobile&&this._numSelected>0&&!this._hideFooter?i("div",{class:"width-100",slot:"footer"},i("div",{class:"display-flex padding-1-2"},i("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),l?i("delete-button",{class:"padding-inline-start-1 width-full",id:"solutions-delete",ids:this._layerTable.selectedIds,layer:this._layer}):void 0)):void 0}_getDividerIcon(t,i){let e="";switch(t){case l.HORIZONTAL:e=i?"chevrons-up":"chevrons-down";break;case l.VERTICAL:case l.GRID:e=i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i,e){let s="";switch(t){case l.HORIZONTAL:s=(i&&!e?"height-1-2 display-grid":i&&e?"height-full":"height-0")+" width-full position-relative";break;case l.GRID:s="height-full position-relative "+(i?"width-1-3":"width-0");break;case l.VERTICAL:s="height-full position-relative "+(i?"width-1-2":"width-0")}return s}_getTableSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=(i?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,e,s){return i("calcite-panel",{class:"width-full height-full"},i("div",{class:"width-full height-full overflow-hidden "+(t===l.HORIZONTAL?"":"display-flex")},this._getMapAndCard(t,e,s),this._getTable(t,e,s)))}_getMapAndCard(t,e,s){const h=this._getMapSizeClass(t,e,s);return i("div",{class:`${h} overflow-hidden`},this._getMapNode(t,e),this._getPopupExpandNode())}_getMapNode(t,e){var s;return i("div",{class:`${this._layoutMode!==l.HORIZONTAL||this._isMobile&&!e?"adjusted-height-50":""} overflow-hidden ${t===l.HORIZONTAL||t===l.GRID?"":"visibility-hidden"}`},i("map-card",{basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:!0,hidden:this._expandPopup,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",mapInfos:null===(s=this.mapInfos)||void 0===s?void 0:s.filter((t=>!1!==t.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"]}))}_getPopupExpandNode(){var t;const e=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",h=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,l="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",o=this._expandPopup?1===(null===(t=this.mapInfos)||void 0===t?void 0:t.length)||this._isMobile?"position-absolute-0":"position-absolute-50":"height-full",a=this._isMobile?"display-none height-0":"";return i("div",{class:`${this._isMobile?"calcite-mode-light":"calcite-mode-dark"} ${o} ${this._isMobile&&this._hideTable?"position-absolute-0 width-full height-full":this._isMobile?"display-none height-0":""}`},i("calcite-panel",null,this._isMobile?void 0:i("div",{class:`display-flex align-items-center ${a}`,slot:"header-content"},i("calcite-icon",{icon:"information",scale:"s"}),i("div",{class:"padding-inline-start-75"},this._translations.information)),i("calcite-action",{class:a,disabled:this._tableOnly,icon:e,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),this._tableOnly?void 0:i("calcite-tooltip",{class:l,label:"",placement:"bottom","reference-element":s},i("span",null,h)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return i("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},i("card-manager",{class:(this._expandPopup||this._isMobile?"height-full":"height-50")+" width-full",isMobile:this._isMobile,mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,e,s){const h=s&&this._isMobile?"visibility-hidden":"",o=this._getTableSizeClass(t,e),a=this._getDividerIcon(t,e),d=e?this._translations.close:this._translations.open,n="toggle-layout",r=this.defaultWebmap&&this.defaultLayer;return i("calcite-shell",{class:`${o} ${h} border-bottom`},this._isMobile?void 0:i("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:t===l.HORIZONTAL?"horizontal":"vertical",slot:t===l.HORIZONTAL?"header":"panel-start"},i("calcite-action",{class:"toggle-node",icon:a,id:n,onClick:()=>this._toggleLayout(),text:""}),i("calcite-tooltip",{label:d,placement:"bottom","reference-element":n},i("span",null,d))),i("div",{class:"width-full height-full position-relative"},i("layer-table",{defaultFilter:r?this._defaultFilter:void 0,defaultGlobalId:r?this._defaultGlobalId:void 0,defaultLayerId:r?this.defaultLayer:"",defaultOid:r&&!this.defaultGlobalId?this._defaultOid:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,isMobile:this._isMobile,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:t=>this._layerTable=t,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_onResize(){this._isMobile=this.el.offsetWidth<1024,this._layoutMode=this._isMobile?l.HORIZONTAL:l.GRID,this._panelOpen=!0}_toggleLayout(){this._panelOpen=!this._panelOpen}showHideMapPopupAndTable(t){this._expandPopup=!1,this._hideTable=t,this._hideFooter=t}_getMapInfo(t){let i;return this.mapInfos.some((e=>{if(e.id===t)return i=e,!0})),Object.assign({},i)}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this._mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{defaultCenter:["defaultCenterWatchHandler"],defaultFilter:["defaultFilterWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],defaultOid:["defaultOidWatchHandler"],defaultLevel:["defaultLevelWatchHandler"],enableZoom:["enableZoomWatchHandler"]}}};a.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}";export{a as crowdsource_manager}
6
+ import{r as t,h as i,H as e,g as s}from"./p-7d280d8a.js";import{g as h}from"./p-b04c9dc3.js";import{E as l}from"./p-c1cf3ebc.js";import{g as o}from"./p-2c382841.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";const a=class{constructor(i){t(this,i),this._shouldSetMapView=!1,this.defaultCenter="",this.defaultFilter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableHome=!0,this.enableZoom=!0,this.enableBasemap=!0,this.basemapConfig=void 0,this.showNewestFirst=!0,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.theme="light",this.zoomAndScrollToSelected=!1,this._expandPopup=!1,this._hideFooter=!1,this._hideTable=!1,this._isMobile=void 0,this._translations=void 0,this._layer=void 0,this._layoutMode=l.GRID,this._mapInfo=void 0,this._mapView=void 0,this._panelOpen=!0,this._numSelected=0,this._tableOnly=!1}defaultCenterWatchHandler(){this._defaultCenter=this.defaultCenter?this.defaultCenter.split(";").map((t=>parseFloat(t))):void 0}defaultFilterWatchHandler(){this._defaultFilter=JSON.parse(this.defaultFilter)}defaultGlobalIdWatchHandler(){this._defaultGlobalId=this.defaultGlobalId?this.defaultGlobalId.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0}defaultOidWatchHandler(){this._defaultOid=this.defaultOid?this.defaultOid.indexOf(",")>-1?this.defaultOid.split(",").map((t=>parseInt(t,10))):[parseInt(this.defaultOid,10)]:void 0}defaultLevelWatchHandler(){this._defaultLevel=this.defaultLevel?parseInt(this.defaultLevel,10):void 0}enableZoomWatchHandler(){this._initMapZoom()}async featureSelectionChange(t){var i;this._numSelected=null===(i=t.detail)||void 0===i?void 0:i.length}async popupClosed(){this._isMobile&&this.showHideMapPopupAndTable(!1)}async idsFound(t){const i=t.detail;this._tableOnly=i.tableIds.length>0&&0===i.layerIds.length,this._tableOnly&&(this._expandPopup=!0)}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0,this._expandPopup=!1)}async layerSelectionChange(t){const i=t.detail[0],e=await o(this._mapView,i);await e.when((()=>{this._layer=e}))}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return i(e,null,i("calcite-shell",{class:"position-relative"},i("calcite-panel",{class:"width-full height-full "+(this._isMobile&&this._hideTable?"border-width-0":this._isMobile?"border-bottom-width-0":"")},this._getBody(this._layoutMode,this._panelOpen,this._hideTable)),this._getFooter()))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,await this._setMapView())}async componentDidLoad(){this._resizeObserver.observe(this.el)}_getFooter(){var t,e,s,h;const l=(null===(t=this._layer)||void 0===t?void 0:t.editingEnabled)&&(null===(h=null===(s=null===(e=this._layer)||void 0===e?void 0:e.capabilities)||void 0===s?void 0:s.operations)||void 0===h?void 0:h.supportsDelete);return this._isMobile&&this._numSelected>0&&!this._hideFooter?i("div",{class:"width-100",slot:"footer"},i("div",{class:"display-flex padding-1-2"},i("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),l?i("delete-button",{class:"padding-inline-start-1 width-full",id:"solutions-delete",ids:this._layerTable.selectedIds,layer:this._layer}):void 0)):void 0}_getDividerIcon(t,i){let e="";switch(t){case l.HORIZONTAL:e=i?"chevrons-up":"chevrons-down";break;case l.VERTICAL:case l.GRID:e=i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i,e){let s="";switch(t){case l.HORIZONTAL:s=(i&&!e?"height-1-2 display-grid":i&&e?"height-full":"height-0")+" width-full position-relative";break;case l.GRID:s="height-full position-relative "+(i?"width-1-3":"width-0");break;case l.VERTICAL:s="height-full position-relative "+(i?"width-1-2":"width-0")}return s}_getTableSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=(i?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,e,s){return i("calcite-panel",{class:"width-full height-full"},i("div",{class:"width-full height-full overflow-hidden "+(t===l.HORIZONTAL?"":"display-flex")},this._getMapAndCard(t,e,s),this._getTable(t,e,s)))}_getMapAndCard(t,e,s){const h=this._getMapSizeClass(t,e,s);return i("div",{class:`${h} overflow-hidden`},this._getMapNode(t,e),this._getPopupExpandNode())}_getMapNode(t,e){var s;return i("div",{class:`${this._layoutMode!==l.HORIZONTAL||this._isMobile&&!e?"adjusted-height-50":""} overflow-hidden ${t===l.HORIZONTAL||t===l.GRID?"":"visibility-hidden"}`},i("map-card",{basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:!0,hidden:this._expandPopup,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",mapInfos:null===(s=this.mapInfos)||void 0===s?void 0:s.filter((t=>!1!==t.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"]}))}_getPopupExpandNode(){var t;const e=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",h=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,l="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",o=this._expandPopup?1===(null===(t=this.mapInfos)||void 0===t?void 0:t.length)||this._isMobile?"position-absolute-0":"position-absolute-50":"height-full",a=this._isMobile?"display-none height-0":"";return i("div",{class:`${this._isMobile?"calcite-mode-light":"calcite-mode-dark"} ${o} ${this._isMobile&&this._hideTable?"position-absolute-0 width-full height-full":this._isMobile?"display-none height-0":""}`},i("calcite-panel",null,this._isMobile?void 0:i("div",{class:`display-flex align-items-center ${a}`,slot:"header-content"},i("calcite-icon",{icon:"information",scale:"s"}),i("div",{class:"padding-inline-start-75"},this._translations.information)),i("calcite-action",{class:a,disabled:this._tableOnly,icon:e,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),this._tableOnly?void 0:i("calcite-tooltip",{class:l,label:"",placement:"bottom","reference-element":s},i("span",null,h)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return i("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},i("card-manager",{class:(this._expandPopup||this._isMobile?"height-full":"height-50")+" width-full",isMobile:this._isMobile,mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,e,s){const h=s&&this._isMobile?"visibility-hidden":"",o=this._getTableSizeClass(t,e),a=this._getDividerIcon(t,e),d=e?this._translations.close:this._translations.open,n="toggle-layout",r=this.defaultWebmap&&this.defaultLayer;return i("calcite-shell",{class:`${o} ${h} border-bottom`},this._isMobile?void 0:i("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:t===l.HORIZONTAL?"horizontal":"vertical",slot:t===l.HORIZONTAL?"header":"panel-start"},i("calcite-action",{class:"toggle-node",icon:a,id:n,onClick:()=>this._toggleLayout(),text:""}),i("calcite-tooltip",{label:d,placement:"bottom","reference-element":n},i("span",null,d))),i("div",{class:"width-full height-full position-relative"},i("layer-table",{defaultFilter:r?this._defaultFilter:void 0,defaultGlobalId:r?this._defaultGlobalId:void 0,defaultLayerId:r?this.defaultLayer:"",defaultOid:r&&!this.defaultGlobalId?this._defaultOid:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,isMobile:this._isMobile,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:t=>this._layerTable=t,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_onResize(){const t=this.el.offsetWidth<1024,i=!this._isMobile&&t;this._isMobile=t,this._layoutMode=this._isMobile?l.HORIZONTAL:l.GRID,i&&(this._panelOpen=!0)}_toggleLayout(){this._panelOpen=!this._panelOpen}showHideMapPopupAndTable(t){this._expandPopup=!1,this._hideTable=t,this._hideFooter=t}_getMapInfo(t){let i;return this.mapInfos.some((e=>{if(e.id===t)return i=e,!0})),Object.assign({},i)}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this._mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{defaultCenter:["defaultCenterWatchHandler"],defaultFilter:["defaultFilterWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],defaultOid:["defaultOidWatchHandler"],defaultLevel:["defaultLevelWatchHandler"],enableZoom:["enableZoomWatchHandler"]}}};a.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}";export{a as crowdsource_manager}
@@ -14,4 +14,4 @@ import{r as t,h as i,g as s,c as e,H as a,F as o}from"./p-7d280d8a.js";import{c
14
14
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
15
15
  * v2.4.0
16
16
  */
17
- const P=class{constructor(i){t(this,i),this.calciteFlowItemBack=e(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=e(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=e(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=e(this,"calciteFlowItemToggle",6),this.handlePanelScroll=t=>{t.stopPropagation(),this.calciteFlowItemScroll.emit()},this.handlePanelClose=t=>{t.stopPropagation(),this.calciteFlowItemClose.emit()},this.handlePanelToggle=t=>{t.stopPropagation(),this.collapsed=t.target.collapsed,this.calciteFlowItemToggle.emit()},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){d(this),f(this),g(this)}async componentWillLoad(){await y(this),c(this)}componentDidRender(){p(this)}disconnectedCallback(){m(this),v(this),b(this)}componentDidLoad(){r(this)}effectiveLocaleChange(){w(this,this.effectiveLocale)}async setFocus(){await l(this);const{backButtonEl:t,containerEl:i}=this;return t?t.setFocus():i?i.setFocus():void 0}async scrollContentTo(t){var i;await(null===(i=this.containerEl)||void 0===i?void 0:i.scrollContentTo(t))}renderBackButton(){const{el:t}=this,s="rtl"===h(t),{showBackButton:e,backButtonClick:a,messages:o}=this,n=o.back;return e?i("calcite-action",{"aria-label":n,class:"back-button",icon:s?"chevron-right":"chevron-left",key:"flow-back-button",onClick:a,scale:"s",slot:"header-actions-start",text:n,title:n,ref:this.setBackRef}):null}render(){const{collapsed:t,collapseDirection:s,collapsible:e,closable:o,closed:n,description:l,disabled:c,heading:r,headingLevel:h,loading:d,menuOpen:p,messages:m,overlayPositioning:f}=this;return i(a,null,i(u,{disabled:c},i("calcite-panel",{closable:o,closed:n,collapseDirection:s,collapsed:t,collapsible:e,description:l,disabled:c,heading:r,headingLevel:h,loading:d,menuOpen:p,messageOverrides:m,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,onCalcitePanelToggle:this.handlePanelToggle,overlayPositioning:f,ref:this.setContainerRef},this.renderBackButton(),i("slot",{name:"action-bar",slot:x.actionBar}),i("slot",{name:"header-actions-start",slot:x.headerActionsStart}),i("slot",{name:"header-actions-end",slot:x.headerActionsEnd}),i("slot",{name:"header-content",slot:x.headerContent}),i("slot",{name:"header-menu-actions",slot:x.headerMenuActions}),i("slot",{name:"fab",slot:x.fab}),i("slot",{name:"footer-actions",slot:x.footerActions}),i("slot",{name:"footer",slot:x.footer}),i("slot",null))))}static get assetsDirs(){return["assets"]}get el(){return s(this)}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};P.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}";const S=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.drawComplete=e(this,"drawComplete",7),this.editingAttachment=e(this,"editingAttachment",7),this.mapView=void 0,this.selectedLayerId=void 0,this.customizeSubmit=!1}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async close(){this._editor&&this._editor.destroy()}async submit(){this._editor&&this._editor.viewModel.featureFormViewModel.submit()}async componentWillLoad(){await this.initModules()}async componentDidLoad(){await this.init()}render(){return i(a,{id:"feature-form"})}async init(){this.mapView&&this.selectedLayerId&&await this.createEditorWidget()}async initModules(){const[t,i]=await k(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[],i=document.createElement("div");(await _(this.mapView)).forEach((async i=>{t.push({layer:i,enabled:"feature"===(null==i?void 0:i.type)&&(null==i?void 0:i.id)===this.selectedLayerId,addEnabled:!0,updateEnabled:!1,deleteEnabled:!1})})),this._editor=new this.Editor({allowedWorkflows:"create-features",view:this.mapView,layerInfos:t,visibleElements:{snappingControls:!1},container:i}),this.el.appendChild(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.editingAttachment.emit(!0)):this._addingAttachment&&(this.editingAttachment.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(s);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&this.startCreate()}));this._editor.viewModel.addHandles(e)}async startCreate(){var t;if(null===(t=this._editor.viewModel.featureTemplatesViewModel.items)||void 0===t?void 0:t.length){const t=this._editor.viewModel.featureTemplatesViewModel.items[0].get("items");this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{setTimeout((()=>{this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),this._editor.viewModel.sketchViewModel.on("create",(t=>{"complete"===t.state&&this.drawComplete.emit()})),this.hideEditorsElements()}),700),this.hideEditorsElements()})),1===t.length&&this._editor.viewModel.featureTemplatesViewModel.select(t[0]),this.hideEditorsElements()}}hideEditorsElements(){this.customizeSubmit&&setTimeout((()=>{var t;null===(t=this.el.querySelector(".esri-editor").querySelectorAll("calcite-flow-item"))||void 0===t||t.forEach((t=>{var i,s,e,a,o;const n=null===(e=null===(s=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelector("calcite-panel"))||void 0===s?void 0:s.shadowRoot)||void 0===e?void 0:e.querySelector("article");null===(a=null==n?void 0:n.querySelector("header"))||void 0===a||a.setAttribute("style","display: none"),null===(o=null==n?void 0:n.querySelector("footer"))||void 0===o||o.setAttribute("style","display: none")}))}),700)}async submitted(t){var i;if(!t.invalid.length&&t.valid.length){try{await this._editor.activeWorkflow.commit(),(null===(i=this._editor.viewModel.failures)||void 0===i?void 0:i.length)&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}get el(){return s(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};S.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__update-actions{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}";const W=class{constructor(i){t(this,i),this.featureSelect=e(this,"featureSelect",7),this.selectedLayerId=void 0,this.mapView=void 0,this.noFeaturesFoundMsg=void 0,this.pageSize=100,this.highlightOnMap=!1,this._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._translations=void 0}async selectedLayerWatchHandler(){this._selectedLayer=await j(this.mapView,this.selectedLayerId),await this.initializeFeatureItems()}async componentWillLoad(){await this._getTranslations(),this._isLoading=!0,this._popupUtils=new E,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await j(this.mapView,this.selectedLayerId))}async componentDidLoad(){await this.initializeFeatureItems()}render(){return i("calcite-panel",{"full-height":!0,"full-width":!0},this._isLoading&&i("calcite-loader",{label:"",scale:"m"}),0===this._featureItems.length&&!this._isLoading&&i("calcite-notice",{class:"error-msg",icon:"feature-details",kind:"info",open:!0},i("div",{slot:"message"},this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg)),i("calcite-list",{"selection-appearance":"border","selection-mode":"single"},!this._isLoading&&this._featureItems.length>0&&this._featureItems),this._featuresCount>this.pageSize&&i("div",{class:"width-full",slot:"footer"},i("calcite-pagination",{class:"pagination","full-width":!0,onCalcitePaginationChange:this.pageChanged.bind(this),"page-size":this.pageSize,"start-item":"1","total-items":this._featuresCount})))}async initializeFeatureItems(){this._selectedLayer&&(this._isLoading=!0,this._featureItems=await this.queryPage(0),this._featuresCount=await this._selectedLayer.queryFeatureCount(),this._isLoading=!1)}async pageChanged(t){this._isLoading=!0,this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null);const i=t.target.startItem-1;this._featureItems=await this.queryPage(i),this._isLoading=!1}async featureClicked(t,i){if(this.highlightOnMap&&this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null),t.target.selected){if(this.highlightOnMap){const i=Number(t.target.value),s=await I(this.mapView,this.selectedLayerId);this._highlightHandle=await z([i],s,this.mapView,!0)}this.featureSelect.emit(i)}}async queryPage(t){const i=this._selectedLayer,s=i.objectIdField,e={start:t,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:i.definitionExpression,outSpatialReference:this.mapView.spatialReference.toJSON()};s&&(e.orderByFields=[s.toString()+" DESC"]);const a=await i.queryFeatures(e);return await this.createFeatureItem(a)}async createFeatureItem(t){const i=(null==t?void 0:t.features).map((async t=>{const i=await this._popupUtils.getPopupTitle(t,this.mapView.map);return this.getFeatureItem(t,i)}));return Promise.all(i)}getFeatureItem(t,s){const e=t.attributes[this._selectedLayer.objectIdField].toString();return i("calcite-list-item",{onCalciteListItemSelect:i=>{this.featureClicked(i,t)},value:e},i("div",{class:"popup-title",slot:"content-start"},s=null!=s?s:e),i("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}async _getTranslations(){const t=await L(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{selectedLayerId:["selectedLayerWatchHandler"]}}};W.style=":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.popup-title{font-weight:500;padding:10px 12px}";const B=class{constructor(i){t(this,i),this.layerSelect=e(this,"layerSelect",7),this.layersListLoaded=e(this,"layersListLoaded",7),this.mapView=void 0,this.layers=void 0,this.noLayerErrorMsg=void 0,this.showFeatureCount=!0,this.showNextIcon=!1,this._noLayersToDisplay=!1,this._mapLayerIds=[],this._isLoading=!1,this._translations=void 0}async refresh(){await this.setLayers()}async componentWillLoad(){await this._getTranslations(),this._isLoading=!0}async componentDidLoad(){await this.setLayers(),this._isLoading=!1}render(){return i(o,null,this._isLoading&&i("calcite-loader",{label:"",scale:"m"}),!this._isLoading&&this.mapView&&this._noLayersToDisplay&&i("calcite-notice",{class:"error-msg",icon:"layers-reference",kind:"danger",open:!0},i("div",{slot:"title"},this._translations.error),i("div",{slot:"message"},this.noLayerErrorMsg?this.noLayerErrorMsg:this._translations.noLayerToDisplayErrorMsg)),!this._isLoading&&this.mapView&&i("calcite-list",{"selection-appearance":"border","selection-mode":this.showNextIcon?"none":"single-persist"},this.renderLayerList()))}async setLayers(){this.mapView&&await this.initLayerHash()}async initLayerHash(){const t=[];this._layerItemsHash=await D(this.mapView,!0),(await _(this.mapView)).forEach((async i=>{var s,e;if("feature"===(null==i?void 0:i.type)&&(null==i?void 0:i.editingEnabled)&&(null===(e=null===(s=null==i?void 0:i.capabilities)||void 0===s?void 0:s.operations)||void 0===e?void 0:e.supportsAdd)&&(this._layerItemsHash[i.id].supportsAdd=!0,this.showFeatureCount)){const s=i.createQuery(),e=i.queryFeatureCount(s);t.push(e),e.then((async t=>{const s=isNaN(t)?"":await C(t,{places:0,api:4,type:"decimal"});this._layerItemsHash[i.id].formattedFeatureCount=s}))}})),await Promise.all(t).then((()=>{const t=this.getEditableIds(this._layerItemsHash);this._mapLayerIds=t.reverse(),this.handleNoLayersToDisplay()}),(()=>{this._mapLayerIds=[],this.handleNoLayersToDisplay()}))}handleNoLayersToDisplay(){this._noLayersToDisplay=!(this._mapLayerIds.length>0),this.layersListLoaded.emit(this._mapLayerIds)}getEditableIds(t){var i;const s=(null===(i=this.layers)||void 0===i?void 0:i.length)>0?this.layers:[];return Object.keys(t).reduce(((i,e)=>{let a=t[e].supportsAdd;return(null==s?void 0:s.length)>0&&(a=s.indexOf(e)>-1&&t[e].supportsAdd),a&&i.push(e),i}),[])}renderLayerList(){return this._mapLayerIds.length>0&&this._mapLayerIds.reduce(((t,i)=>(this._layerItemsHash[i]&&t.push(this.getLayerListItem(i)),t)),[])}getLayerListItem(t){const s=this._layerItemsHash[t].formattedFeatureCount;return i("calcite-list-item",{onCalciteListItemSelect:()=>{this.onLayerItemSelected(t)}},i("div",{class:"layer-name",slot:"content-start"},this._layerItemsHash[t].name),this.showFeatureCount&&void 0!==s&&""!==s&&i("div",{class:this.showNextIcon?"":"feature-count",slot:"content-end"},"("+s+")"),this.showNextIcon&&i("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}onLayerItemSelected(t){this.layerSelect.emit({layerId:t,layerName:this._layerItemsHash[t].name})}async _getTranslations(){const t=await L(this.el);this._translations=t[0]}get el(){return s(this)}};B.style=":host{display:block}.error-msg{padding:10px}.layer-name{font-weight:500;padding:10px 12px}.feature-count{padding-right:12px}";export{F as calcite_flow,P as calcite_flow_item,S as create_feature,W as feature_list,B as layer_list}
17
+ const P=class{constructor(i){t(this,i),this.calciteFlowItemBack=e(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=e(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=e(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=e(this,"calciteFlowItemToggle",6),this.handlePanelScroll=t=>{t.stopPropagation(),this.calciteFlowItemScroll.emit()},this.handlePanelClose=t=>{t.stopPropagation(),this.calciteFlowItemClose.emit()},this.handlePanelToggle=t=>{t.stopPropagation(),this.collapsed=t.target.collapsed,this.calciteFlowItemToggle.emit()},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){d(this),f(this),g(this)}async componentWillLoad(){await y(this),c(this)}componentDidRender(){p(this)}disconnectedCallback(){m(this),v(this),b(this)}componentDidLoad(){r(this)}effectiveLocaleChange(){w(this,this.effectiveLocale)}async setFocus(){await l(this);const{backButtonEl:t,containerEl:i}=this;return t?t.setFocus():i?i.setFocus():void 0}async scrollContentTo(t){var i;await(null===(i=this.containerEl)||void 0===i?void 0:i.scrollContentTo(t))}renderBackButton(){const{el:t}=this,s="rtl"===h(t),{showBackButton:e,backButtonClick:a,messages:o}=this,n=o.back;return e?i("calcite-action",{"aria-label":n,class:"back-button",icon:s?"chevron-right":"chevron-left",key:"flow-back-button",onClick:a,scale:"s",slot:"header-actions-start",text:n,title:n,ref:this.setBackRef}):null}render(){const{collapsed:t,collapseDirection:s,collapsible:e,closable:o,closed:n,description:l,disabled:c,heading:r,headingLevel:h,loading:d,menuOpen:p,messages:m,overlayPositioning:f}=this;return i(a,null,i(u,{disabled:c},i("calcite-panel",{closable:o,closed:n,collapseDirection:s,collapsed:t,collapsible:e,description:l,disabled:c,heading:r,headingLevel:h,loading:d,menuOpen:p,messageOverrides:m,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,onCalcitePanelToggle:this.handlePanelToggle,overlayPositioning:f,ref:this.setContainerRef},this.renderBackButton(),i("slot",{name:"action-bar",slot:x.actionBar}),i("slot",{name:"header-actions-start",slot:x.headerActionsStart}),i("slot",{name:"header-actions-end",slot:x.headerActionsEnd}),i("slot",{name:"header-content",slot:x.headerContent}),i("slot",{name:"header-menu-actions",slot:x.headerMenuActions}),i("slot",{name:"fab",slot:x.fab}),i("slot",{name:"footer-actions",slot:x.footerActions}),i("slot",{name:"footer",slot:x.footer}),i("slot",null))))}static get assetsDirs(){return["assets"]}get el(){return s(this)}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};P.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}";const S=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.drawComplete=e(this,"drawComplete",7),this.editingAttachment=e(this,"editingAttachment",7),this.mapView=void 0,this.selectedLayerId=void 0,this.customizeSubmit=!1}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async close(){this._editor&&this._editor.destroy()}async submit(){this._editor&&this._editor.viewModel.featureFormViewModel.submit()}async componentWillLoad(){await this.initModules()}async componentDidLoad(){await this.init()}render(){return i(a,{id:"feature-form"})}async init(){this.mapView&&this.selectedLayerId&&await this.createEditorWidget()}async initModules(){const[t,i]=await k(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[],i=document.createElement("div");(await _(this.mapView)).forEach((async i=>{t.push({layer:i,enabled:"feature"===(null==i?void 0:i.type)&&(null==i?void 0:i.id)===this.selectedLayerId,addEnabled:!0,updateEnabled:!1,deleteEnabled:!1})})),this._editor=new this.Editor({allowedWorkflows:"create-features",view:this.mapView,layerInfos:t,visibleElements:{snappingControls:!1},container:i}),this.el.appendChild(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.editingAttachment.emit(!0)):this._addingAttachment&&(this.editingAttachment.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(s);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&this.startCreate()}));this._editor.viewModel.addHandles(e)}async startCreate(){var t;if(null===(t=this._editor.viewModel.featureTemplatesViewModel.items)||void 0===t?void 0:t.length){const t=this._editor.viewModel.featureTemplatesViewModel.items[0].get("items");this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{setTimeout((()=>{this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),this._editor.viewModel.sketchViewModel.on("create",(t=>{"complete"===t.state&&this.drawComplete.emit()})),this.hideEditorsElements()}),700),this.hideEditorsElements()})),1===t.length&&this._editor.viewModel.featureTemplatesViewModel.select(t[0]),this.hideEditorsElements()}}hideEditorsElements(){this.customizeSubmit&&setTimeout((()=>{var t;null===(t=this.el.querySelector(".esri-editor").querySelectorAll("calcite-flow-item"))||void 0===t||t.forEach((t=>{var i,s,e,a,o;const n=null===(e=null===(s=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelector("calcite-panel"))||void 0===s?void 0:s.shadowRoot)||void 0===e?void 0:e.querySelector("article");null===(a=null==n?void 0:n.querySelector("header"))||void 0===a||a.setAttribute("style","display: none"),null===(o=null==n?void 0:n.querySelector("footer"))||void 0===o||o.setAttribute("style","display: none")}))}),700)}async submitted(t){var i;if(!t.invalid.length&&t.valid.length){try{await this._editor.activeWorkflow.commit(),(null===(i=this._editor.viewModel.failures)||void 0===i?void 0:i.length)&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}get el(){return s(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};S.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__update-actions{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}";const W=class{constructor(i){t(this,i),this.featureSelect=e(this,"featureSelect",7),this.selectedLayerId=void 0,this.mapView=void 0,this.noFeaturesFoundMsg=void 0,this.pageSize=100,this.highlightOnMap=!1,this._featureItems=[],this._featuresCount=0,this._isLoading=!1,this._translations=void 0}async selectedLayerWatchHandler(){this._selectedLayer=await j(this.mapView,this.selectedLayerId),await this.initializeFeatureItems()}async componentWillLoad(){await this._getTranslations(),this._isLoading=!0,this._popupUtils=new E,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await j(this.mapView,this.selectedLayerId))}async componentDidLoad(){await this.initializeFeatureItems()}render(){return i("calcite-panel",{"full-height":!0,"full-width":!0},this._isLoading&&i("calcite-loader",{label:"",scale:"m"}),0===this._featureItems.length&&!this._isLoading&&i("calcite-notice",{class:"error-msg",icon:"feature-details",kind:"info",open:!0},i("div",{slot:"message"},this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg)),i("calcite-list",{"selection-appearance":"border","selection-mode":"none"},!this._isLoading&&this._featureItems.length>0&&this._featureItems),this._featuresCount>this.pageSize&&i("div",{class:"width-full",slot:"footer"},i("calcite-pagination",{class:"pagination","full-width":!0,onCalcitePaginationChange:this.pageChanged.bind(this),"page-size":this.pageSize,"start-item":"1","total-items":this._featuresCount})))}async initializeFeatureItems(){this._selectedLayer&&(this._isLoading=!0,this._featureItems=await this.queryPage(0),this._featuresCount=await this._selectedLayer.queryFeatureCount(),this._isLoading=!1)}async pageChanged(t){this._isLoading=!0,this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null);const i=t.target.startItem-1;this._featureItems=await this.queryPage(i),this._isLoading=!1}async featureClicked(t,i){if(this.highlightOnMap&&this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null),this.highlightOnMap){const i=Number(t.target.value),s=await I(this.mapView,this.selectedLayerId);this._highlightHandle=await z([i],s,this.mapView,!0)}this.featureSelect.emit(i)}async queryPage(t){const i=this._selectedLayer,s=i.objectIdField,e={start:t,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:i.definitionExpression,outSpatialReference:this.mapView.spatialReference.toJSON()};s&&(e.orderByFields=[s.toString()+" DESC"]);const a=await i.queryFeatures(e);return await this.createFeatureItem(a)}async createFeatureItem(t){const i=(null==t?void 0:t.features).map((async t=>{const i=await this._popupUtils.getPopupTitle(t,this.mapView.map);return this.getFeatureItem(t,i)}));return Promise.all(i)}getFeatureItem(t,s){const e=t.attributes[this._selectedLayer.objectIdField].toString();return i("calcite-list-item",{onCalciteListItemSelect:i=>{this.featureClicked(i,t)},value:e},i("div",{class:"popup-title",slot:"content-start"},s=null!=s?s:e),i("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}async _getTranslations(){const t=await L(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{selectedLayerId:["selectedLayerWatchHandler"]}}};W.style=":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.popup-title{font-weight:500;padding:10px 12px}";const B=class{constructor(i){t(this,i),this.layerSelect=e(this,"layerSelect",7),this.layersListLoaded=e(this,"layersListLoaded",7),this.mapView=void 0,this.layers=void 0,this.noLayerErrorMsg=void 0,this.showFeatureCount=!0,this.showNextIcon=!1,this._noLayersToDisplay=!1,this._mapLayerIds=[],this._isLoading=!1,this._translations=void 0}async refresh(){await this.setLayers()}async componentWillLoad(){await this._getTranslations(),this._isLoading=!0}async componentDidLoad(){await this.setLayers(),this._isLoading=!1}render(){return i(o,null,this._isLoading&&i("calcite-loader",{label:"",scale:"m"}),!this._isLoading&&this.mapView&&this._noLayersToDisplay&&i("calcite-notice",{class:"error-msg",icon:"layers-reference",kind:"danger",open:!0},i("div",{slot:"title"},this._translations.error),i("div",{slot:"message"},this.noLayerErrorMsg?this.noLayerErrorMsg:this._translations.noLayerToDisplayErrorMsg)),!this._isLoading&&this.mapView&&i("calcite-list",{"selection-appearance":"border","selection-mode":this.showNextIcon?"none":"single-persist"},this.renderLayerList()))}async setLayers(){this.mapView&&await this.initLayerHash()}async initLayerHash(){const t=[];this._layerItemsHash=await D(this.mapView,!0),(await _(this.mapView)).forEach((async i=>{var s,e;if("feature"===(null==i?void 0:i.type)&&(null==i?void 0:i.editingEnabled)&&(null===(e=null===(s=null==i?void 0:i.capabilities)||void 0===s?void 0:s.operations)||void 0===e?void 0:e.supportsAdd)&&(this._layerItemsHash[i.id].supportsAdd=!0,this.showFeatureCount)){const s=i.createQuery(),e=i.queryFeatureCount(s);t.push(e),e.then((async t=>{const s=isNaN(t)?"":await C(t,{places:0,api:4,type:"decimal"});this._layerItemsHash[i.id].formattedFeatureCount=s}))}})),await Promise.all(t).then((()=>{const t=this.getEditableIds(this._layerItemsHash);this._mapLayerIds=t.reverse(),this.handleNoLayersToDisplay()}),(()=>{this._mapLayerIds=[],this.handleNoLayersToDisplay()}))}handleNoLayersToDisplay(){this._noLayersToDisplay=!(this._mapLayerIds.length>0),this.layersListLoaded.emit(this._mapLayerIds)}getEditableIds(t){var i;const s=(null===(i=this.layers)||void 0===i?void 0:i.length)>0?this.layers:[];return Object.keys(t).reduce(((i,e)=>{let a=t[e].supportsAdd;return(null==s?void 0:s.length)>0&&(a=s.indexOf(e)>-1&&t[e].supportsAdd),a&&i.push(e),i}),[])}renderLayerList(){return this._mapLayerIds.length>0&&this._mapLayerIds.reduce(((t,i)=>(this._layerItemsHash[i]&&t.push(this.getLayerListItem(i)),t)),[])}getLayerListItem(t){const s=this._layerItemsHash[t].formattedFeatureCount;return i("calcite-list-item",{onCalciteListItemSelect:()=>{this.onLayerItemSelected(t)}},i("div",{class:"layer-name",slot:"content-start"},this._layerItemsHash[t].name),this.showFeatureCount&&void 0!==s&&""!==s&&i("div",{class:this.showNextIcon?"":"feature-count",slot:"content-end"},"("+s+")"),this.showNextIcon&&i("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}onLayerItemSelected(t){this.layerSelect.emit({layerId:t,layerName:this._layerItemsHash[t].name})}async _getTranslations(){const t=await L(this.el);this._translations=t[0]}get el(){return s(this)}};B.style=":host{display:block}.error-msg{padding:10px}.layer-name{font-weight:500;padding:10px 12px}.feature-count{padding-right:12px}";export{F as calcite_flow,P as calcite_flow_item,S as create_feature,W as feature_list,B as layer_list}
@@ -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 t,c as i,h as s,H as e,g as h}from"./p-7d280d8a.js";import{l as a,g as o}from"./p-b04c9dc3.js";import{a as l,g as c,q as r}from"./p-2c382841.js";import"./p-d918ec36.js";import"./p-e1a4994d.js";import"./p-c1cf3ebc.js";const n=class{constructor(s){t(this,s),this.togglePanel=i(this,"togglePanel",7),this.description=void 0,this.isMobile=void 0,this.enableAnonymousAccess=void 0,this.enableAnonymousComments=void 0,this.enableComments=void 0,this.enableLogin=void 0,this.enableNewReports=void 0,this.layers=void 0,this.loginTitle=void 0,this.mapView=void 0,this.layerId=void 0,this.objectId=void 0,this.reportButtonText=void 0,this.reportsHeader=void 0,this.reportSubmittedMessage=void 0,this.searchConfiguration=void 0,this.showComments=void 0,this.defaultWebmap="",this.enableSearch=!0,this.enableHome=!0,this.mapInfos=[],this.theme="light",this.enableZoom=!0,this._mapInfo=void 0,this._flowItems=["layer-list"],this._sidePanelCollapsed=!1,this._translations=void 0,this._hasValidLayers=!1,this._selectedLayerName=void 0,this._reportSubmitted=!1,this._showSubmitCancelButton=!1,this._featureCreationFailedErrorMsg=void 0}async isMobileWatchHandler(){this._sidePanelCollapsed=!1}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.setMapView()}))}async componentWillLoad(){this._urlParamsLoaded=!1,await this._initModules(),await this._getTranslations()}render(){const t="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return s(e,null,this._reportSubmitted&&s("calcite-alert",{"auto-close":!0,class:t,icon:"check-circle",kind:"success",label:"",onCalciteAlertClose:()=>{this._reportSubmitted=!1},open:!0,placement:"top"},s("div",{slot:"title"},this._translations.reportSubmit),s("div",{slot:"message"},this.reportSubmittedMessage?this.reportSubmittedMessage:this._translations.submitMsg)),this._featureCreationFailedErrorMsg&&s("calcite-alert",{"auto-close":!0,class:t,icon:"x-octagon",kind:"danger",label:"",onCalciteAlertClose:()=>{this._featureCreationFailedErrorMsg=""},open:!0,placement:"top"},s("div",{slot:"title"},this._translations.error),s("div",{slot:"message"},this._featureCreationFailedErrorMsg)),s("div",null,s("calcite-shell",{"content-behind":!0},this._getReporter())))}async _initModules(){const[t]=await a(["esri/core/reactiveUtils"]);this.reactiveUtils=t}setSelectedLayer(t,i){this._selectedLayerId=t,this._selectedLayerName=i,this._validLayers.forEach((i=>{i.set("visible",!t||i.id===t)}))}_getReporter(){const t=[];return this._flowItems.forEach((i=>{switch(i){case"layer-list":t.push(this.getLayerListFlowItem());break;case"feature-list":t.push(this.getFeatureListFlowItem(this._selectedLayerId,this._selectedLayerName));break;case"feature-details":t.push(this.getFeatureDetailsFlowItem());break;case"reporting-layer-list":t.push(this.getChooseCategoryFlowItem());break;case"feature-create":t.push(this.getFeatureCreateFlowItem())}})),s("calcite-panel",{class:"width-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},this.mapView?s("calcite-flow",null,(null==t?void 0:t.length)>0&&t):s("calcite-loader",{label:"",scale:"m"}))}getLayerListFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this.reportsHeader},this.isMobile&&this.getActionToExpandCollapsePanel(),this._hasValidLayers&&this.enableNewReports&&s("calcite-button",{appearance:"solid",onClick:this.navigateToChooseCategory.bind(this),slot:"footer",width:"full"},this.reportButtonText),s("calcite-panel",{"full-height":!0,"full-width":!0},s("layer-list",{class:"height-full",layers:this.layers,mapView:this.mapView,noLayerErrorMsg:this._translations.noLayerToDisplayErrorMsg,onLayerSelect:this.displayFeaturesList.bind(this),onLayersListLoaded:this.layerListLoaded.bind(this),ref:t=>this._layerList=t,showFeatureCount:!0,showNextIcon:!0})))}getChooseCategoryFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._translations.createReportHeader,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),s("div",{class:"width-full",slot:"footer"},s("calcite-button",{appearance:"solid",class:"footer-top-button footer-button",disabled:!this._selectedLayerId,onClick:this.navigateToCreateFeature.bind(this),width:"full"},this._translations.next),s("calcite-button",{appearance:"outline",class:"footer-button",onClick:this.backFromSelectedPanel.bind(this),width:"full"},this._translations.cancel)),s("calcite-panel",{"full-height":!0,"full-width":!0},s("calcite-notice",{class:"notice-msg",icon:"lightbulb",kind:"success",open:!0},s("div",{slot:"message"},this._translations.chooseCategoryMsg)),s("layer-list",{class:"height-full",layers:this.layers,mapView:this.mapView,noLayerErrorMsg:this._translations.noLayerToDisplayErrorMsg,onLayerSelect:this.highlightSelectedLayer.bind(this),showFeatureCount:!1,showNextIcon:!1})))}getFeatureCreateFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._selectedLayerName,onCalciteFlowItemBack:this.backFromCreateFeaturePanel.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),this._showSubmitCancelButton&&s("div",{class:"width-full",slot:"footer"},s("calcite-button",{appearance:"solid",class:"footer-top-button footer-button",onClick:this.onSubmitButtonClick.bind(this),width:"full"},this._translations.submit),s("calcite-button",{appearance:"outline",class:"footer-button",onClick:this.backFromCreateFeaturePanel.bind(this),width:"full"},this._translations.cancel)),s("calcite-panel",{"full-height":!0,"full-width":!0},s("calcite-notice",{class:"notice-msg",icon:"lightbulb",kind:"success",open:!0},s("div",{slot:"message"},this._translations.featureEditFormInfoMsg)),s("create-feature",{customizeSubmit:!0,mapView:this.mapView,onDrawComplete:this.onDrawComplete.bind(this),onEditingAttachment:this.showSubmitCancelButton.bind(this),onFail:this.createFeatureFailed.bind(this),onSuccess:this.onReportSubmitted.bind(this),ref:t=>this._createFeature=t,selectedLayerId:this._selectedLayerId})))}onDrawComplete(){this._showSubmitCancelButton=!0}showSubmitCancelButton(t){this._showSubmitCancelButton=!t.detail}onSubmitButtonClick(){this._createFeature&&this._createFeature.submit()}backFromCreateFeaturePanel(){this._createFeature&&this._createFeature.close(),this.backFromSelectedPanel()}createFeatureFailed(t){console.error(t.detail),this._featureCreationFailedErrorMsg=t.detail.message}onReportSubmitted(){this._reportSubmitted=!0,this.navigateToHomePage()}navigateToHomePage(){this._createFeature&&this._createFeature.close(),this._layerList&&this._layerList.refresh(),this.setSelectedFeatures([]),this._flowItems=["layer-list"]}highlightSelectedLayer(t){this.setSelectedLayer(t.detail.layerId,t.detail.layerName)}async navigateToCreateFeature(){this._showSubmitCancelButton=!1,this._flowItems=[...this._flowItems,"feature-create"]}navigateToChooseCategory(){this._flowItems=[...this._flowItems,"reporting-layer-list"]}async layerListLoaded(t){const i=t.detail,s=await l(this.mapView);this._validLayers=[],s.forEach((t=>{i.includes(t.id)&&this._validLayers.push(t)})),this.handleMapClick(),this._hasValidLayers=i.length>0,this._urlParamsLoaded||(this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams())}displayFeaturesList(t){this.setSelectedLayer(t.detail.layerId,t.detail.layerName),this._flowItems=[...this._flowItems,"feature-list"]}backFromSelectedPanel(){const t=[...this._flowItems];t.pop(),1!==t.length?this._flowItems=[...t]:this.navigateToHomePage()}toggleSidePanel(){this._sidePanelCollapsed=!this._sidePanelCollapsed,this.togglePanel.emit(this._sidePanelCollapsed)}async onFeatureSelectFromList(t){this.setSelectedFeatures([t.detail]),this._flowItems=[...this._flowItems,"feature-details"]}getFeatureListFlowItem(t,i){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:i,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),this.enableNewReports&&s("calcite-button",{appearance:"solid",onClick:this.navigateToCreateFeature.bind(this),slot:"footer",width:"full"},this.reportButtonText),s("calcite-panel",{"full-height":!0},s("feature-list",{class:"height-full",highlightOnMap:!0,mapView:this.mapView,noFeaturesFoundMsg:this._translations.featureErrorMsg,onFeatureSelect:this.onFeatureSelectFromList.bind(this),pageSize:30,selectedLayerId:t})))}getFeatureDetailsFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._selectedLayerName,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this)},this.isMobile&&this.getActionToExpandCollapsePanel(),s("instant-apps-social-share",{autoUpdateShareUrl:!1,embed:!1,popoverButtonIconScale:"s",ref:t=>this._shareNode=t,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",slot:"header-actions-end",socialMedia:!0,view:this.mapView}),s("calcite-panel",{"full-height":!0},s("info-card",{allowEditing:!1,graphics:this._selectedFeature,isLoading:!1,isMobile:!1,mapView:this.mapView,onSelectionChanged:this.featureDetailsChanged.bind(this),zoomAndScrollToSelected:!0})))}setSelectedFeatures(t){this._selectedFeature=t,this.setCurrentFeature(this._selectedFeature.length?this._selectedFeature[0]:null)}setCurrentFeature(t){if(t&&t.layer){const i=t.layer;this.setSelectedLayer(i.id,i.title),this._currentFeatureId=t.attributes[i.objectIdField]}else this.setSelectedLayer("",""),this._currentFeatureId="";this._updateShareURL()}featureDetailsChanged(t){this.setCurrentFeature(t.detail[0])}getActionToExpandCollapsePanel(){return s("calcite-action",{icon:this._sidePanelCollapsed?"chevrons-up":"chevrons-down",onClick:this.toggleSidePanel.bind(this),slot:"header-actions-end",text:this._sidePanelCollapsed?this._translations.expand:this._translations.collapse})}async setMapView(){this.mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this.mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}handleMapClick(){this._mapClickHandle&&this._mapClickHandle.remove(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",this.onMapClick.bind(this))}async onMapClick(t){this.mapView.popupEnabled=!1;const i={include:this._validLayers},s=await this.mapView.hitTest(t,i);if(s.results.length>0){const t=[];s.results.forEach((function(i){"graphic"===i.type&&t.push(i.graphic)})),this.setSelectedFeatures(t),this._flowItems=this._flowItems.length&&"feature-details"!==this._flowItems[this._flowItems.length-1]?[...this._flowItems,"feature-details"]:[...this._flowItems]}}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}_updateShareURL(){var t,i;const s=null===(t=this._shareNode)||void 0===t?void 0:t.shareUrl;if(!s)return;const e=new URL(s);this._selectedLayerId?e.searchParams.set("layerid",this._selectedLayerId):e.searchParams.delete("layerid"),(null===(i=this._selectedFeature)||void 0===i?void 0:i.length)?e.searchParams.set("oid",this._currentFeatureId):e.searchParams.delete("oid"),this._shareNode.shareUrl=e.href}async loadFeatureFromURLParams(){if(this.layerId&&this.objectId){const t=await c(this.mapView,this.layerId);if(t){const i=await r([Number(this.objectId)],t,[],!1,this.mapView.spatialReference);i.length&&(this._selectedFeature=i,this._flowItems=this._flowItems.length&&"feature-details"!==this._flowItems[this._flowItems.length-1]?[...this._flowItems,"feature-details"]:[...this._flowItems])}}}get el(){return h(this)}static get watchers(){return{isMobile:["isMobileWatchHandler"],mapView:["mapViewWatchHandler"]}}};n.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.notice-msg{padding:10px;width:calc(100% - 20px)}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}";export{n as crowdsource_reporter}