@esri/solutions-components 5.1.0-next.167 → 5.1.0-next.169

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/cdn/{MXF4BYLT.js → 6F7QJJQO.js} +1 -1
  2. package/dist/cdn/6KO7AYJN.js +2 -0
  3. package/dist/cdn/{TSDKMOES.js → CONTIW5Q.js} +4 -4
  4. package/dist/cdn/{YPBSKBT2.js → D6U5SMQX.js} +1 -1
  5. package/dist/cdn/{2LCG2XWX.js → ESJJVBZM.js} +1 -1
  6. package/dist/cdn/{ZWL4JFKS.js → IZSQYFWM.js} +1 -1
  7. package/dist/cdn/{BYOO7TWU.js → JINR6G2D.js} +1 -1
  8. package/dist/cdn/{ZSTC2DJY.js → MBT2S4J5.js} +1 -1
  9. package/dist/cdn/{CVHZAZLS.js → RLMMQ5UC.js} +1 -1
  10. package/dist/cdn/{UOQSRV3X.js → S26SZJC7.js} +3 -2
  11. package/dist/cdn/{LXGPZJIZ.js → S7HFWITF.js} +1 -1
  12. package/dist/cdn/{VXGLGWIF.js → SNA7NRRQ.js} +3 -3
  13. package/dist/cdn/{HLCHUP24.js → WRWWRMHZ.js} +3 -3
  14. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ar.json +1 -1
  15. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bg.json +1 -1
  16. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.bs.json +1 -1
  17. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ca.json +1 -1
  18. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.cs.json +1 -1
  19. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.da.json +1 -1
  20. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.de.json +1 -1
  21. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.el.json +1 -1
  22. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.es.json +1 -1
  23. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.et.json +1 -1
  24. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fi.json +1 -1
  25. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.fr.json +1 -1
  26. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.he.json +1 -1
  27. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hr.json +1 -1
  28. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.hu.json +1 -1
  29. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.id.json +1 -1
  30. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.it.json +1 -1
  31. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ja.json +1 -1
  32. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ko.json +1 -1
  33. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lt.json +1 -1
  34. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.lv.json +1 -1
  35. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.nl.json +1 -1
  36. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.no.json +1 -1
  37. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pl.json +1 -1
  38. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-BR.json +1 -1
  39. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.pt-PT.json +1 -1
  40. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ro.json +1 -1
  41. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.ru.json +1 -1
  42. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sk.json +1 -1
  43. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sl.json +1 -1
  44. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sr.json +1 -1
  45. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.sv.json +1 -1
  46. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.th.json +1 -1
  47. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.tr.json +1 -1
  48. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.uk.json +1 -1
  49. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.vi.json +1 -1
  50. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-CN.json +1 -1
  51. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-HK.json +1 -1
  52. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.zh-TW.json +1 -1
  53. package/dist/cdn/assets/solution-details-card/t9n/messages.ar.json +1 -1
  54. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ar.json +1 -1
  55. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.bg.json +1 -1
  56. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.bs.json +1 -1
  57. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ca.json +1 -1
  58. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.cs.json +1 -1
  59. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.da.json +1 -1
  60. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.de.json +1 -1
  61. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.el.json +1 -1
  62. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.es.json +1 -1
  63. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.et.json +1 -1
  64. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.fi.json +1 -1
  65. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.fr.json +1 -1
  66. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.he.json +1 -1
  67. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.hr.json +1 -1
  68. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.hu.json +1 -1
  69. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.id.json +1 -1
  70. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.it.json +1 -1
  71. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ja.json +1 -1
  72. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ko.json +1 -1
  73. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.lt.json +1 -1
  74. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.lv.json +1 -1
  75. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.nl.json +1 -1
  76. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.no.json +1 -1
  77. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.pl.json +1 -1
  78. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.pt-BR.json +1 -1
  79. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.pt-PT.json +1 -1
  80. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ro.json +1 -1
  81. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.ru.json +1 -1
  82. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sk.json +1 -1
  83. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sl.json +1 -1
  84. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sr.json +1 -1
  85. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.sv.json +1 -1
  86. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.th.json +1 -1
  87. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.tr.json +1 -1
  88. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.uk.json +1 -1
  89. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.vi.json +1 -1
  90. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.zh-CN.json +1 -1
  91. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.zh-HK.json +1 -1
  92. package/dist/cdn/assets/solutions-deploy-app/t9n/messages.zh-TW.json +1 -1
  93. package/dist/cdn/index.js +1 -1
  94. package/dist/chunks/assessBuildRequest.js +3 -2
  95. package/dist/chunks/converter.js +1 -1
  96. package/dist/chunks/designSolution.js +3 -3
  97. package/dist/chunks/updateDesign.js +1 -1
  98. package/dist/components/arcgis-solutions-assistant/customElement.js +307 -289
  99. package/dist/components/create-feature/customElement.js +63 -56
  100. package/dist/components/create-related-feature/customElement.js +12 -9
  101. package/dist/docs/api.json +1 -1
  102. package/dist/docs/docs.json +1 -1
  103. package/dist/docs/web-types.json +1 -1
  104. package/dist/solutions-components_commit.txt +6 -6
  105. package/package.json +1 -1
  106. package/dist/cdn/2NSMAAXL.js +0 -2
@@ -2,15 +2,15 @@
2
2
  import { c as I } from "../../chunks/runtime.js";
3
3
  import { a as x, g as w } from "../../chunks/mapViewUtils.js";
4
4
  import { u as A } from "../../chunks/useT9n.js";
5
- import { css as M, html as n, nothing as y } from "lit";
6
- import { createRef as p, ref as u } from "lit-html/directives/ref.js";
7
- import { LitElement as E, createEvent as c, noShadowRoot as L, safeClassMap as v } from "@arcgis/lumina";
8
- import { p as k } from "../../chunks/queryUtils.js";
5
+ import { css as M, html as o, nothing as y } from "lit";
6
+ import { createRef as d, ref as h } from "lit-html/directives/ref.js";
7
+ import { LitElement as E, createEvent as c, noShadowRoot as k, safeClassMap as v } from "@arcgis/lumina";
8
+ import { p as L } from "../../chunks/queryUtils.js";
9
9
  import P from "@arcgis/core/form/ExpressionInfo.js";
10
- import S from "@arcgis/core/layers/FeatureLayer.js";
10
+ import F from "@arcgis/core/layers/FeatureLayer.js";
11
11
  import C from "@arcgis/core/form/elements/FieldElement.js";
12
12
  import $ from "@arcgis/core/form/FormTemplate.js";
13
- import F from "@arcgis/core/views/MapView.js";
13
+ import S from "@arcgis/core/views/MapView.js";
14
14
  import V from "@arcgis/core/Graphic.js";
15
15
  import * as f from "@arcgis/core/core/reactiveUtils.js";
16
16
  import * as T from "@arcgis/core/rest/locator.js";
@@ -21,7 +21,7 @@ import z from "@arcgis/core/geometry/SpatialReference.js";
21
21
  const H = M`@layer{:host{display:block}.hide-editor-toolbar .esri-editor__panel-toolbar{display:none!important}.esri-editor__panel-content{padding-block:0px!important}.esri-editor .esri-item-list__group__header,.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}.search-widget{width:92%!important;margin:5px 14px 20px}.display-none{display:none!important}.hide-map{height:1%!important;visibility:hidden;position:static!important}.show-map{padding:10px!important;position:absolute!important;bottom:0;height:auto!important;width:calc(100% - 22px)}.notice-msg{padding:10px;width:calc(100% - 20px)}.edit-location-btn{margin:5px;display:flex}.esri-editor__panel-content{padding-block:10px!important}.image-preview-container{padding:10px}.esri-editor{height:auto!important}.height-fit-content{height:fit-content!important}.content-container{padding:1.5rem}.instruction-text{margin-bottom:1.5rem;font-size:1rem}.selected-card{border:2px solid var(--calcite-ui-brand)}.upload-img-footer-container{width:100%;gap:5px;display:grid}.info-container{display:flex;align-items:center;gap:6px;margin-bottom:10px}.info-container calcite-icon{--calcite-icon-color: var(--calcite-color-brand)}.info-container span{font-size:12px;color:var(--calcite-ui-text-3)}.padding-10{padding:10px}.report-selection-container{display:flex;flex-direction:column;padding:10px;--calcite-card-border-color: var(--calcite-color-border-1)}.pb-12{padding-bottom:12px!important}.pt-0{padding-top:0!important}.pt-15{padding-top:15px!important}.option-description-container{display:flex;align-items:center;gap:6px}.cursor-pointer{cursor:pointer;padding:6px 0}.card-body-content{display:flex;flex-direction:row;align-items:center;padding:10px 5px;gap:15px}.text-stack{display:flex;flex-direction:column;gap:2px}.option-title{font-weight:var(--calcite-font-weight-bold);color:var(--calcite-ui-text-1);font-size:var(--calcite-font-size--1)}.option-description{color:var(--calcite-ui-text-3);font-size:var(--calcite-font-size--1)}.action-footer{display:flex;justify-content:center;margin-top:16px}.analysis-wrapper{display:flex;flex-direction:column;align-items:center;gap:5px;text-align:center;margin:auto}.analyzing-icon{--calcite-icon-color: var(--calcite-color-brand);animation:sparkle 2s infinite ease-in-out}.adjusted-height{height:30px!important;min-height:auto!important}@keyframes sparkle{0%,to{transform:scale(1)}50%{transform:scale(1.5)}}@media only screen and (max-width:600px){.esri-editor__panel-content{padding-block:0!important;min-height:0!important}}}`, _ = "geocodedLocation", D = `Extract the address from the user's message and return it in JSON format '{"address":"<address>"}'. If no address is found, return null.`;
22
22
  class N extends E {
23
23
  constructor() {
24
- super(...arguments), this.customizeSubmit = !1, this.enableSearch = !1, this.enableSnapping = !1, this.floorLevel = "", this.isMobile = !1, this.selectedLayerId = "", this.showGuidingMsg = !0, this.submitNewReportsMessage = "", this.updateMapPosition = !1, this.reportingArea = !1, this.reportingAreaLayer = "", this.reportingAreaMessage = "", this.showSketchWidgets = !1, this.allowMultipleCreation = !1, this.popupEnabled = !1, this.showLayerVisibilityMsg = !1, this.enablePhotoLocation = !1, this.enableMessageLocation = !1, this._currentPage = "templatePicker", this._showSearchComponent = this.enableSearch, this._layerInfos = [], this._inValidGeometryDrawn = !1, this._selectedImageBase64 = "", this._enteredMessage = "", this._analysisFailed = !1, this._translations = A({ name: "create-feature", blocking: !0 }), this._addingAttachment = !1, this._uploadedImage = null, this._calciteNotice = p(), this._editor = p(), this._mapViewContainer = p(), this._searchRef = p(), this._inputImageForAI = p(), this._guidingMessageRefNode = p(), this._abortController = new AbortController(), this._awaitingLayerEdits = !1, this._pendingAttachmentUpload = !1, this.success = c(), this.fail = c(), this.drawComplete = c(), this.editingLocation = c(), this.editingAttachment = c(), this.progressStatus = c(), this.modeChanged = c(), this.activeFeatureCountChange = c(), this.createFeatureEditorInitialized = c(), this.createFeatureEditorClosed = c(), this._onLayerEdits = async (e) => {
24
+ super(...arguments), this.customizeSubmit = !1, this.enableSearch = !1, this.enableSnapping = !1, this.floorLevel = "", this.isMobile = !1, this.selectedLayerId = "", this.showGuidingMsg = !0, this.submitNewReportsMessage = "", this.updateMapPosition = !1, this.reportingArea = !1, this.reportingAreaLayer = "", this.reportingAreaMessage = "", this.showSketchWidgets = !1, this.allowMultipleCreation = !1, this.popupEnabled = !1, this.showLayerVisibilityMsg = !1, this.enablePhotoLocation = !1, this.enableMessageLocation = !1, this._currentPage = "templatePicker", this._showSearchComponent = this.enableSearch, this._layerInfos = [], this._inValidGeometryDrawn = !1, this._selectedImageBase64 = "", this._enteredMessage = "", this._analysisFailed = !1, this._translations = A({ name: "create-feature", blocking: !0 }), this._addingAttachment = !1, this._uploadedImage = null, this._calciteNotice = d(), this._editor = d(), this._mapViewContainer = d(), this._searchRef = d(), this._inputImageForAI = d(), this._messageTextAreaRef = d(), this._guidingMessageRefNode = d(), this._abortController = new AbortController(), this._awaitingLayerEdits = !1, this._pendingAttachmentUpload = !1, this.success = c(), this.fail = c(), this.drawComplete = c(), this.editingLocation = c(), this.editingAttachment = c(), this.progressStatus = c(), this.modeChanged = c(), this.activeFeatureCountChange = c(), this.createFeatureEditorInitialized = c(), this.createFeatureEditorClosed = c(), this._onLayerEdits = async (e) => {
25
25
  if (!this._awaitingLayerEdits)
26
26
  return;
27
27
  const t = [
@@ -58,7 +58,7 @@ class N extends E {
58
58
  this.styles = H;
59
59
  }
60
60
  static {
61
- this.shadowRootOptions = L;
61
+ this.shadowRootOptions = k;
62
62
  }
63
63
  willUpdate(e) {
64
64
  e.has("mapView") && this.hasUpdated && this.mapViewWatchHandler(), e.has("isMobile") && this.hasUpdated && this.isMobileHandler(), e.has("enableSearch") && this.hasUpdated && this.searchHandler(), e.has("searchConfiguration") && this.hasUpdated && this.searchConfigurationHandler(this.searchConfiguration, e.get("searchConfiguration"));
@@ -108,33 +108,36 @@ class N extends E {
108
108
  async loaded() {
109
109
  this._aiAnalysisInfo && !this._aiAnalysisInfo.canUseAI && await this.init();
110
110
  }
111
- async updated() {
112
- if (this.isMobile && this.updateMapPosition) {
113
- const e = this._currentPage === "drawing" ? 80 : 30;
111
+ async updated(e) {
112
+ if (e.has("_currentPage") && await this._focusActivePageInput(), this.isMobile && this.updateMapPosition) {
113
+ const t = this._currentPage === "drawing" ? 80 : 30;
114
114
  await this._searchRef.value?.componentOnReady();
115
- const t = this._showSearchComponent ? this._searchRef.value?.offsetHeight : 0;
115
+ const i = this._showSearchComponent ? this._searchRef.value?.offsetHeight : 0;
116
116
  await this._calciteNotice.value?.componentOnReady();
117
- const a = (this._calciteNotice.value?.offsetHeight || 0) + t + e;
118
- this._mapViewContainer.value && (this._mapViewContainer.value.style.top = `${a}px`);
117
+ const s = (this._calciteNotice.value?.offsetHeight || 0) + i + t;
118
+ this._mapViewContainer.value && (this._mapViewContainer.value.style.top = `${s}px`);
119
119
  }
120
120
  this.reportingAreaMessage && this._guidingMessageRefNode.value?.children[0] && (this._guidingMessageRefNode.value.children[0].style.margin = "0px");
121
121
  }
122
+ async _focusActivePageInput() {
123
+ this._currentPage === "messageInput" ? (await this._messageTextAreaRef.value?.componentOnReady(), await this._messageTextAreaRef.value?.setFocus()) : this._currentPage === "imageUpload" && (await this._inputImageForAI.value?.componentOnReady(), await this._inputImageForAI.value?.setFocus());
124
+ }
122
125
  async disconnectedCallback() {
123
126
  super.disconnectedCallback(), this._editor.value && (this._editor.value.activeWorkflow?.activeWorkflow?.hasPendingEdits && (await this._editor.value.activeWorkflow.reset(), await this._editor.value.cancelWorkflow()), await this._editor.value.destroy(), this.enableSnapping && this.mapView?.ui.view && (this.mapView.ui.view.grid = null), this._removeHandlers(), this.createFeatureEditorClosed.emit());
124
127
  }
125
128
  render() {
126
129
  const e = this._currentPage === "loading" ? "" : "display-none", t = this.isMobile && this.updateMapPosition ? "show-map" : "display-none", i = this._inValidGeometryDrawn ? "danger" : "success", a = this._inValidGeometryDrawn ? "exclamation-mark-triangle" : "lightbulb", s = this.showLayerVisibilityMsg && this._currentPage === "templatePicker", r = (this.showGuidingMsg || s) && this._currentPage !== "loading" && this._currentPage !== "drawingMultipleFeatures";
127
- let o = this._translations.chooseCategoryMsg;
128
- const l = this._aiAnalysisInfo?.results?.filter((h) => !h.success && h.key !== _), d = l?.length ? !0 : this._analysisFailed, m = this._getAnalysisErrorMessage(l?.length), g = this._aiAnalysisInfo?.canUseAI && ["chooseReportType", "analyzingImage", "analyzingMessage", "imageUpload", "messageInput"].includes(this._currentPage);
129
- return this._inValidGeometryDrawn ? o = this.reportingAreaMessage || this._translations.reportOutsideAreaMessage : this._currentPage === "drawing" || this._currentPage === "editing" ? o = this._translations.provideLocationMsg : this._currentPage === "featureForm" ? o = this._aiAnalysisInfo?.results?.filter((h) => h.success).length ? this._analysisMode === "text" ? this._translations.textReviewMsg : this._translations.formReviewMsg : this._translations.provideDetailsMsg : s && (o = this._translations.enableFeatureTemplatesMessage), n`${d && n`<calcite-alert auto-close icon=x-octagon kind=danger label @calciteAlertClose=${() => {
130
+ let n = this._translations.chooseCategoryMsg;
131
+ const l = this._aiAnalysisInfo?.results?.filter((u) => !u.success && u.key !== _), p = l?.length ? !0 : this._analysisFailed, m = this._getAnalysisErrorMessage(l?.length), g = this._aiAnalysisInfo?.canUseAI && ["chooseReportType", "analyzingImage", "analyzingMessage", "imageUpload", "messageInput"].includes(this._currentPage);
132
+ return this._inValidGeometryDrawn ? n = this.reportingAreaMessage || this._translations.reportOutsideAreaMessage : this._currentPage === "drawing" || this._currentPage === "editing" ? n = this._translations.provideLocationMsg : this._currentPage === "featureForm" ? n = this._aiAnalysisInfo?.results?.filter((u) => u.success).length ? this._analysisMode === "text" ? this._translations.textReviewMsg : this._translations.formReviewMsg : this._translations.provideDetailsMsg : s && (n = this._translations.enableFeatureTemplatesMessage), o`${p && o`<calcite-alert auto-close icon=x-octagon kind=danger label @calciteAlertClose=${() => {
130
133
  this._analysisFailed = !1;
131
- }} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${m}</div></calcite-alert>` || ""}${g && n`<calcite-panel>${this._currentPage === "chooseReportType" && this._getReportTypePage() || ""}${this._currentPage === "imageUpload" && this._aiImageExtractionPage() || ""}${this._currentPage === "messageInput" && this._aiTextExtractionPage() || ""}${this._currentPage === "analyzingImage" && this._getAnalyzingImagePage() || ""}${this._currentPage === "analyzingMessage" && this._getAnalyzingMessagePage() || ""}</calcite-panel>` || ""}${!g && n`${r && n`<calcite-notice class="notice-msg" .icon=${a} .kind=${i} open ${u(this._calciteNotice)}><div slot=message .innerHTML=${o ?? ""} ${u(this._guidingMessageRefNode)}></div></calcite-notice>` || ""}${this._selectedImageBase64 && this._currentPage === "featureForm" && n`<div class="image-preview-container"><calcite-label>${this._translations.photo}</calcite-label><img class="width-full" src=${this._selectedImageBase64 ?? y}></div>` || ""}<calcite-loader class=${v(e)} label scale=s></calcite-loader>${this._currentPage === "featureForm" && this.isMobile && n`<calcite-button appearance=transparent class="edit-location-btn" icon-start=pin @click=${this.editLocation}>${this._translations.editLocationLabel}</calcite-button>` || ""}${this._showSearchComponent && this._updatedMapView && this._selectedLayer && this._getSearchComponent() || ""}${this._updatedMapView && this._selectedLayer && this._getEditor() || ""}` || ""}<div class=${v(t)} ${u(this._mapViewContainer)}></div>`;
134
+ }} open placement=top><div slot=title>${this._translations.error}</div><div slot=message>${m}</div></calcite-alert>` || ""}${g && o`<calcite-panel>${this._currentPage === "chooseReportType" && this._getReportTypePage() || ""}${this._currentPage === "imageUpload" && this._aiImageExtractionPage() || ""}${this._currentPage === "messageInput" && this._aiTextExtractionPage() || ""}${this._currentPage === "analyzingImage" && this._getAnalyzingImagePage() || ""}${this._currentPage === "analyzingMessage" && this._getAnalyzingMessagePage() || ""}</calcite-panel>` || ""}${!g && o`${r && o`<calcite-notice class="notice-msg" .icon=${a} .kind=${i} open ${h(this._calciteNotice)}><div slot=message .innerHTML=${n ?? ""} ${h(this._guidingMessageRefNode)}></div></calcite-notice>` || ""}${this._selectedImageBase64 && this._currentPage === "featureForm" && o`<div class="image-preview-container"><calcite-label>${this._translations.photo}</calcite-label><img class="width-full" src=${this._selectedImageBase64 ?? y}></div>` || ""}<calcite-loader class=${v(e)} label scale=s></calcite-loader>${this._currentPage === "featureForm" && this.isMobile && o`<calcite-button appearance=transparent class="edit-location-btn" icon-start=pin @click=${this.editLocation}>${this._translations.editLocationLabel}</calcite-button>` || ""}${this._showSearchComponent && this._updatedMapView && this._selectedLayer && this._getSearchComponent() || ""}${this._updatedMapView && this._selectedLayer && this._getEditor() || ""}` || ""}<div class=${v(t)} ${h(this._mapViewContainer)}></div>`;
132
135
  }
133
136
  async init() {
134
137
  this.mapView && this.selectedLayerId && (this._updatedMapView = this.mapView, await (this.isMobile && this.updateMapPosition ? this.createMobileMapView() : this._loadLayerInfos()));
135
138
  }
136
139
  async createMobileMapView() {
137
- this._mapViewContainer.value && this.mapView && (this._mapViewContainer.value.classList.add("hide-map"), await new F({
140
+ this._mapViewContainer.value && this.mapView && (this._mapViewContainer.value.classList.add("hide-map"), await new S({
138
141
  map: this.mapView.map,
139
142
  container: this._mapViewContainer.value,
140
143
  zoom: this.mapView.zoom,
@@ -168,13 +171,13 @@ class N extends E {
168
171
  }
169
172
  _getReportTypePage() {
170
173
  const e = this._hasImageExtraction(), t = this._hasTextExtraction();
171
- return n`<div class="report-selection-container"><calcite-label class="pb-12">${this._translations.createReportHeading}</calcite-label><div class="option-description-container"><span class="option-description">${this._translations.aiAssistedReport}</span><calcite-icon icon=effects scale=s></calcite-icon></div>${t && n`<calcite-card class="cursor-pointer pt-0" @click=${() => {
174
+ return o`<div class="report-selection-container"><calcite-label class="pb-12">${this._translations.createReportHeading}</calcite-label><div class="option-description-container"><span class="option-description">${this._translations.aiAssistedReport}</span><calcite-icon icon=effects scale=s></calcite-icon></div>${t && o`<calcite-card class="cursor-pointer pt-0" @click=${() => {
172
175
  this._analysisMode = "text", this.progressStatus.emit(35), this._currentPage = "messageInput";
173
176
  }} @keydown=${(i) => {
174
177
  this._activateCardFromKeyboard(i, () => {
175
178
  this._analysisMode = "text", this.progressStatus.emit(35), this._currentPage = "messageInput";
176
179
  });
177
- }}><div slot=description class="card-body-content"><calcite-icon icon=speech-bubble scale=m></calcite-icon><div class="text-stack"><span class="option-title">${this._translations.useDescription}</span><span class="option-description">${this._translations.aiTextAssistantDescription}</span></div></div></calcite-card>` || ""}${e && n`<calcite-card class="cursor-pointer" @click=${() => {
180
+ }}><div slot=description class="card-body-content"><calcite-icon icon=speech-bubble scale=m></calcite-icon><div class="text-stack"><span class="option-title">${this._translations.useDescription}</span><span class="option-description">${this._translations.aiTextAssistantDescription}</span></div></div></calcite-card>` || ""}${e && o`<calcite-card class="cursor-pointer" @click=${() => {
178
181
  this._analysisMode = "image", this.progressStatus.emit(35), this._currentPage = "imageUpload";
179
182
  }} @keydown=${(i) => {
180
183
  this._activateCardFromKeyboard(i, () => {
@@ -192,29 +195,29 @@ class N extends E {
192
195
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
193
196
  }
194
197
  _getEditor() {
195
- return n`<arcgis-editor class=height-fit-content .view=${this._updatedMapView} .layerInfos=${this._layerInfos} hide-edit-features-section .hideSettingsMenu=${!this.enableSnapping} .hideSketch=${!this.showSketchWidgets || this._selectedLayer?.geometryType === "point"} .hideSnappingControlsElementsEnabledToggle=${!this.enableSnapping} @arcgisReady=${this._onEditorComponentReady} @arcgisPropertyChange=${this._onEditorPropertyChange} @arcgisSketchUpdate=${this._onSketchUpdate} ${u(this._editor)}></arcgis-editor>`;
198
+ return o`<arcgis-editor class=height-fit-content .view=${this._updatedMapView} .layerInfos=${this._layerInfos} hide-edit-features-section .hideSettingsMenu=${!this.enableSnapping} .hideSketch=${!this.showSketchWidgets || this._selectedLayer?.geometryType === "point"} .hideSnappingControlsElementsEnabledToggle=${!this.enableSnapping} @arcgisReady=${this._onEditorComponentReady} @arcgisPropertyChange=${this._onEditorPropertyChange} @arcgisSketchUpdate=${this._onSketchUpdate} ${h(this._editor)}></arcgis-editor>`;
196
199
  }
197
200
  _getSearchComponent() {
198
201
  const e = this._currentPage === "drawing" || this._currentPage === "editing" ? "" : "display-none", t = this.searchConfiguration && this._updatedMapView ? this._getSearchConfig(this.searchConfiguration, this._updatedMapView) : void 0;
199
- return this._updateSearchActiveSourceIndex(), n`<arcgis-search class=${`search-widget ${e}`} .view=${this._updatedMapView} @arcgisSearchComplete=${this.searchComplete} popup-disabled result-graphic-disabled .includeDefaultSourcesDisabled=${!!t?.sources?.length} .sources=${t?.sources || []} .allPlaceholder=${t?.allPlaceholder} .searchAllDisabled=${!t?.searchAllEnabled} ${u(this._searchRef)}></arcgis-search>`;
202
+ return this._updateSearchActiveSourceIndex(), o`<arcgis-search class=${`search-widget ${e}`} .view=${this._updatedMapView} @arcgisSearchComplete=${this.searchComplete} popup-disabled result-graphic-disabled .includeDefaultSourcesDisabled=${!!t?.sources?.length} .sources=${t?.sources || []} .allPlaceholder=${t?.allPlaceholder} .searchAllDisabled=${!t?.searchAllEnabled} ${h(this._searchRef)}></arcgis-search>`;
200
203
  }
201
204
  _aiImageExtractionPage() {
202
205
  const e = this._selectedImageBase64 !== "", t = e ? this._translations.replaceImage : this._translations.imageUploadLimitHint;
203
- return n`<calcite-notice class="notice-msg" icon=effects kind=brand open><div slot=message>${this._translations.aiAssistantProcessingHint}</div></calcite-notice><div class="padding-10"><calcite-label><div>${this._translations.photo}<span style="color: var(--calcite-color-status-danger)">*</span></div><calcite-input type=file accept="image/*;capture=camera" @calciteInputInput=${this._onImageUpload} ${u(this._inputImageForAI)}></calcite-input></calcite-label><div class="info-container"><calcite-icon aria-hidden=true icon=information scale=s></calcite-icon><span>${t}</span></div>${e && n`<img alt=${this._translations.photo ?? y} class="width-full" src=${this._selectedImageBase64 ?? y}>` || ""}</div><div slot=footer class="upload-img-footer-container"><calcite-button width=full .disabled=${!e} id=next-btn @click=${this._analyzeImage}>${this._translations.next}</calcite-button><calcite-button width=full appearance=outline kind=brand @click=${() => this.modeChanged.emit()}>${this._translations.cancel}</calcite-button></div>`;
206
+ return o`<calcite-notice class="notice-msg" icon=effects kind=brand open><div slot=message>${this._translations.aiAssistantProcessingHint}</div></calcite-notice><div class="padding-10"><calcite-label><div>${this._translations.photo}<span style="color: var(--calcite-color-status-danger)">*</span></div><calcite-input type=file accept="image/*;capture=camera" @calciteInputInput=${this._onImageUpload} ${h(this._inputImageForAI)}></calcite-input></calcite-label><div class="info-container"><calcite-icon aria-hidden=true icon=information scale=s></calcite-icon><span>${t}</span></div>${e && o`<img alt=${this._translations.photo ?? y} class="width-full" src=${this._selectedImageBase64 ?? y}>` || ""}</div><div slot=footer class="upload-img-footer-container"><calcite-button width=full .disabled=${!e} id=next-btn @click=${this._analyzeImage}>${this._translations.next}</calcite-button><calcite-button width=full appearance=outline kind=brand @click=${() => this.modeChanged.emit()}>${this._translations.cancel}</calcite-button></div>`;
204
207
  }
205
208
  _aiTextExtractionPage() {
206
209
  const e = this._enteredMessage.trim();
207
- return n`<calcite-notice class="notice-msg" icon=effects kind=brand open><div slot=message>${this._translations.aiTextProcessingHint}</div></calcite-notice><div class="padding-10"><calcite-label><div>${this._translations.description}<span style="color: var(--calcite-color-status-danger)">*</span></div><calcite-text-area @input=${(t) => {
210
+ return o`<calcite-notice class="notice-msg" icon=effects kind=brand open><div slot=message>${this._translations.aiTextProcessingHint}</div></calcite-notice><div class="padding-10"><calcite-label><div>${this._translations.description}<span style="color: var(--calcite-color-status-danger)">*</span></div><calcite-text-area @input=${(t) => {
208
211
  this._enteredMessage = t.target.value;
209
- }} .placeholder=${this._translations.messageInputHint} resize=vertical rows=6 .value=${this._enteredMessage}></calcite-text-area></calcite-label><div class="info-container"><calcite-icon icon=information scale=s></calcite-icon><span>${this._translations.descriptionRequiredHint}</span></div></div><div slot=footer class="upload-img-footer-container"><calcite-button width=full .disabled=${!e} id=next-btn @click=${this._analyzeMessage}>${this._translations.next}</calcite-button><calcite-button width=full appearance=outline kind=brand @click=${() => this.modeChanged.emit()}>${this._translations.cancel}</calcite-button></div>`;
212
+ }} .placeholder=${this._translations.messageInputHint} resize=vertical rows=6 .value=${this._enteredMessage} ${h(this._messageTextAreaRef)}></calcite-text-area></calcite-label><div class="info-container"><calcite-icon icon=information scale=s></calcite-icon><span>${this._translations.descriptionRequiredHint}</span></div></div><div slot=footer class="upload-img-footer-container"><calcite-button width=full .disabled=${!e} id=next-btn @click=${this._analyzeMessage}>${this._translations.next}</calcite-button><calcite-button width=full appearance=outline kind=brand @click=${() => this.modeChanged.emit()}>${this._translations.cancel}</calcite-button></div>`;
210
213
  }
211
214
  _getAnalyzingImagePage() {
212
- return n`<div class="analysis-wrapper"><calcite-label layout=inline><calcite-icon class="analyzing-icon" icon=effects scale=s></calcite-icon><span>${this._translations.analyzingImage}</span></calcite-label><calcite-button class="skip-btn" appearance=transparent @click=${() => {
215
+ return o`<div class="analysis-wrapper"><calcite-label layout=inline><calcite-icon class="analyzing-icon" icon=effects scale=s></calcite-icon><span>${this._translations.analyzingImage}</span></calcite-label><calcite-button class="skip-btn" appearance=transparent @click=${() => {
213
216
  this._abortController.abort(), this._currentPage = "templatePicker";
214
217
  }}>${this._translations.skip}</calcite-button></div>`;
215
218
  }
216
219
  _getAnalyzingMessagePage() {
217
- return n`<div class="analysis-wrapper"><calcite-label layout=inline><calcite-icon class="analyzing-icon" icon=effects scale=s></calcite-icon><span>${this._translations.analyzingText}</span></calcite-label><calcite-button class="skip-btn" appearance=transparent @click=${() => {
220
+ return o`<div class="analysis-wrapper"><calcite-label layout=inline><calcite-icon class="analyzing-icon" icon=effects scale=s></calcite-icon><span>${this._translations.analyzingText}</span></calcite-label><calcite-button class="skip-btn" appearance=transparent @click=${() => {
218
221
  this._abortController.abort(), this._currentPage = "templatePicker";
219
222
  }}>${this._translations.skip}</calcite-button></div>`;
220
223
  }
@@ -236,18 +239,18 @@ class N extends E {
236
239
  }
237
240
  try {
238
241
  this._analysisMode = "image", this._currentPage = "analyzingImage", this.progressStatus.emit(45);
239
- const i = this._inputImageForAI.value.files[0], a = await new Promise((r, o) => {
242
+ const i = this._inputImageForAI.value.files[0], a = await new Promise((r, n) => {
240
243
  const l = new FileReader();
241
- l.onloadend = () => r(l.result), l.onerror = o, this._inputImageForAI.value && l.readAsDataURL(i);
244
+ l.onloadend = () => r(l.result), l.onerror = n, this._inputImageForAI.value && l.readAsDataURL(i);
242
245
  });
243
246
  if (this.enablePhotoLocation) {
244
247
  const r = await R.gps(i);
245
248
  if (r?.longitude && r.latitude && this.mapView?.spatialReference) {
246
- const o = new U({
249
+ const n = new U({
247
250
  longitude: r.longitude,
248
251
  latitude: r.latitude,
249
252
  spatialReference: new z({ wkid: 4326 })
250
- }), l = await k(o, this.mapView.spatialReference);
253
+ }), l = await L(n, this.mapView.spatialReference);
251
254
  this._aiAnalysisInfo && (this._aiAnalysisInfo.location = l);
252
255
  }
253
256
  }
@@ -256,7 +259,7 @@ class N extends E {
256
259
  const r = {
257
260
  input: a,
258
261
  data: s
259
- }, o = await b(t.imageUrl, {
262
+ }, n = await b(t.imageUrl, {
260
263
  method: "post",
261
264
  headers: {
262
265
  "Content-Type": "application/json",
@@ -267,7 +270,7 @@ class N extends E {
267
270
  responseType: "json",
268
271
  signal: e
269
272
  });
270
- this._aiAnalysisInfo && (this._aiAnalysisInfo.results = o.data.results);
273
+ this._aiAnalysisInfo && (this._aiAnalysisInfo.results = n.data.results);
271
274
  }
272
275
  this._currentPage = "loading", await this.init();
273
276
  } catch (i) {
@@ -299,8 +302,8 @@ class N extends E {
299
302
  signal: e
300
303
  });
301
304
  if (this._aiAnalysisInfo && (this._aiAnalysisInfo.results = r.data.results, s.url)) {
302
- const o = this._getExtractedAddress(r.data.results);
303
- o && (this._aiAnalysisInfo.location = await this._geocodeExtractedAddress(o, {
305
+ const n = this._getExtractedAddress(r.data.results);
306
+ n && (this._aiAnalysisInfo.location = await this._geocodeExtractedAddress(n, {
304
307
  url: s.url,
305
308
  singleLineFieldName: s.singleLineFieldName
306
309
  }));
@@ -425,24 +428,28 @@ class N extends E {
425
428
  }), await t.sketchViewModel.update(a);
426
429
  }
427
430
  _getSearchConfig(e, t) {
428
- const i = e.sources;
429
- return i && i?.length > 0 ? (i.forEach((a) => {
430
- if (a.hasOwnProperty("layer")) {
431
- const r = a, o = r.layer?.id, l = o ? t.map?.findLayerById(o) : "", d = r?.layer?.url;
432
- l ? r.layer = l : d && (r.layer = new S(d));
431
+ const i = e?.sources;
432
+ if (!i || i.length === 0)
433
+ return { ...e };
434
+ const a = i.map((s) => {
435
+ if (s.hasOwnProperty("layer")) {
436
+ const r = { ...s }, n = r.layer?.id, l = n ? t.map?.findLayerById(n) : "", p = r?.layer?.url;
437
+ return l ? r.layer = l : p && (r.layer = new F(p)), r;
433
438
  }
434
- }), i?.forEach((a) => {
435
- if (a.hasOwnProperty("locator")) {
436
- const r = a;
439
+ if (s.hasOwnProperty("locator")) {
440
+ const r = { ...s };
437
441
  if (r?.name === "ArcGIS World Geocoding Service") {
438
- const o = r.outFields || ["Addr_type", "Match_addr", "StAddr", "City"];
439
- r.outFields = o, r.singleLineFieldName = "SingleLine";
442
+ const n = r.outFields || ["Addr_type", "Match_addr", "StAddr", "City"];
443
+ r.outFields = n, r.singleLineFieldName = "SingleLine";
440
444
  }
441
- r.url = r.url, delete r.url;
445
+ return delete r.url, r;
442
446
  }
443
- })) : e = {
444
- ...e
445
- }, e;
447
+ return s;
448
+ });
449
+ return {
450
+ ...e,
451
+ sources: a
452
+ };
446
453
  }
447
454
  _updateSearchActiveSourceIndex() {
448
455
  this._searchRef.value && (this._searchRef.value.searchAllDisabled ? this._searchRef.value.activeSourceIndex = 0 : this._searchRef.value.activeSourceIndex = -1);
@@ -473,16 +480,16 @@ class N extends E {
473
480
  },
474
481
  valueExpression: s.name
475
482
  });
476
- this._updatedMapView?.map.editableLayers.forEach((o) => {
477
- const l = this.formElements.orgElements, d = this.formElements.orgExpressionInfos, m = [...l];
478
- if (m.push(r), o.type === "feature") {
479
- const g = o, h = new $({
483
+ this._updatedMapView?.map.editableLayers.forEach((n) => {
484
+ const l = this.formElements.orgElements, p = this.formElements.orgExpressionInfos, m = [...l];
485
+ if (m.push(r), n.type === "feature") {
486
+ const g = n, u = new $({
480
487
  title: g?.formTemplate?.title,
481
488
  description: g?.formTemplate?.description,
482
489
  elements: m,
483
- expressionInfos: [s].concat(d)
490
+ expressionInfos: [s].concat(p)
484
491
  });
485
- o.formTemplate = h;
492
+ n.formTemplate = u;
486
493
  }
487
494
  });
488
495
  }
@@ -12,8 +12,8 @@ class k extends b {
12
12
  const e = this._editor.value;
13
13
  e && (h.watch(() => e.state, (t) => {
14
14
  t === "adding-attachment" || t === "editing-attachment" ? (this._addingAttachment = !0, this.isActionPending.emit(!0)) : this._addingAttachment && (this.isActionPending.emit(!1), this._addingAttachment = !1);
15
- }), h.watch(() => e.activeWorkflow?.formViewModel?.state, (t) => {
16
- t === "ready" && this.formReady.emit();
15
+ }), h.watch(() => e.activeWorkflow?.formViewModel?.status, (t) => {
16
+ t === "loaded" && this.formReady.emit();
17
17
  }));
18
18
  };
19
19
  }
@@ -78,20 +78,23 @@ class k extends b {
78
78
  };
79
79
  }
80
80
  async submitted(e) {
81
- if (e.invalid.length) {
81
+ if (e.results[0]?.invalidFields.length || e.results[0]?.invalidAttachmentElementIds.length) {
82
82
  this._isSubmitBtnClicked = !1;
83
83
  return;
84
84
  }
85
- if (e.valid.length && this._isSubmitBtnClicked) {
85
+ if (this._isSubmitBtnClicked) {
86
86
  this._isSubmitBtnClicked = !1;
87
87
  try {
88
88
  if (this._editor.value?.activeWorkflow) {
89
89
  await this._editor.value.activeWorkflow.commit();
90
- const t = this._editor.value.activeWorkflow.failures;
91
- t?.length && t.some((i) => {
92
- if (i.error)
93
- throw i.error;
94
- });
90
+ const t = this._editor.value.activeWorkflow.data?.viewModel?.failures;
91
+ if (t?.length) {
92
+ t.some((i) => {
93
+ if (i.error)
94
+ throw i.error;
95
+ });
96
+ return;
97
+ }
95
98
  }
96
99
  } catch (t) {
97
100
  this.fail.emit(t);