@esri/solutions-components 0.8.9 → 0.8.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. package/dist/assets/t9n/crowdsource-reporter/resources.json +9 -2
  2. package/dist/assets/t9n/crowdsource-reporter/resources_en.json +9 -2
  3. package/dist/cjs/calcite-alert_4.cjs.entry.js +2 -1
  4. package/dist/cjs/calcite-dropdown_4.cjs.entry.js +1 -1
  5. package/dist/cjs/calcite-flow_6.cjs.entry.js +1 -1
  6. package/dist/cjs/card-manager_3.cjs.entry.js +2 -2
  7. package/dist/cjs/crowdsource-manager.cjs.entry.js +25 -17
  8. package/dist/cjs/crowdsource-reporter.cjs.entry.js +1 -1
  9. package/dist/cjs/{downloadUtils-dc349b1a.js → downloadUtils-dd787ddf.js} +2 -2
  10. package/dist/cjs/{index.es-1830a1e6.js → index.es-29fa176d.js} +2 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/map-select-tools_3.cjs.entry.js +2 -2
  13. package/dist/cjs/{mapViewUtils-9dc05308.js → mapViewUtils-82018df6.js} +1 -1
  14. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  15. package/dist/cjs/solutions-components.cjs.js +1 -1
  16. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +15 -0
  17. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +48 -16
  18. package/dist/collection/components/info-card/info-card.js +1 -0
  19. package/dist/collection/demos/crowdsource-manager.html +7 -2
  20. package/dist/collection/utils/mapViewUtils.js +1 -1
  21. package/dist/collection/utils/mapViewUtils.ts +1 -1
  22. package/dist/components/crowdsource-manager.js +26 -18
  23. package/dist/components/info-card2.js +1 -0
  24. package/dist/components/mapViewUtils.js +1 -1
  25. package/dist/esm/calcite-alert_4.entry.js +2 -1
  26. package/dist/esm/calcite-dropdown_4.entry.js +1 -1
  27. package/dist/esm/calcite-flow_6.entry.js +1 -1
  28. package/dist/esm/card-manager_3.entry.js +2 -2
  29. package/dist/esm/crowdsource-manager.entry.js +26 -18
  30. package/dist/esm/crowdsource-reporter.entry.js +1 -1
  31. package/dist/esm/{downloadUtils-df4f21f6.js → downloadUtils-25aa808f.js} +2 -2
  32. package/dist/esm/{index.es-904fb846.js → index.es-a16c9db4.js} +2 -2
  33. package/dist/esm/loader.js +1 -1
  34. package/dist/esm/map-select-tools_3.entry.js +2 -2
  35. package/dist/esm/{mapViewUtils-2ec19fb0.js → mapViewUtils-c83c03a4.js} +1 -1
  36. package/dist/esm/public-notification.entry.js +2 -2
  37. package/dist/esm/solutions-components.js +1 -1
  38. package/dist/solutions-components/demos/crowdsource-manager.html +7 -2
  39. package/dist/solutions-components/{p-95fea07a.entry.js → p-2f687975.entry.js} +1 -1
  40. package/dist/solutions-components/{p-29f518fd.entry.js → p-3e5085ae.entry.js} +2 -2
  41. package/dist/solutions-components/p-40039b84.entry.js +6 -0
  42. package/dist/solutions-components/{p-6557b703.entry.js → p-58997cc1.entry.js} +1 -1
  43. package/dist/solutions-components/{p-602cd811.entry.js → p-82e398cb.entry.js} +1 -1
  44. package/dist/solutions-components/{p-7269c49b.entry.js → p-ae75d7d7.entry.js} +1 -1
  45. package/dist/solutions-components/{p-fca434c8.js → p-b1376c75.js} +2 -2
  46. package/dist/solutions-components/{p-fd82a00f.entry.js → p-b5acfcd8.entry.js} +1 -1
  47. package/dist/solutions-components/{p-ae4d86e8.js → p-bdd77f17.js} +1 -1
  48. package/dist/solutions-components/{p-577efb16.js → p-d9c89479.js} +1 -1
  49. package/dist/solutions-components/{p-760bd17e.entry.js → p-fffc9e08.entry.js} +1 -1
  50. package/dist/solutions-components/solutions-components.esm.js +1 -1
  51. package/dist/solutions-components/utils/mapViewUtils.ts +1 -1
  52. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +13 -1
  53. package/dist/types/components.d.ts +19 -0
  54. package/dist/types/preact.d.ts +3 -1
  55. package/package.json +1 -1
  56. package/dist/solutions-components/p-452fd697.entry.js +0 -6
@@ -44,9 +44,13 @@
44
44
  // esriConfig.portalUrl = "https://holistic.mapsdevext.arcgis.com";
45
45
  // });
46
46
 
47
- function addValues() {
48
- const demo = document.getElementById("demo");
47
+ function infoIconButtonClick(evt) {
48
+ alert('Info button Clicked');
49
+ }
49
50
 
51
+ function addValues() {
52
+ const demo = document.getElementById("demo");
53
+ demo.addEventListener('infoIconButtonClick', infoIconButtonClick);
50
54
  let headerSet = false;
51
55
  let custom = [];
52
56
  var vars = window.location.search.substring(1).split('&');
@@ -198,6 +202,7 @@
198
202
  }
199
203
  }]
200
204
  ];
205
+ demo.hideMapOnLoad = true;
201
206
  }
202
207
  </script>
203
208
  </head>
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as i,h as e,H as n,g as s}from"./p-7d280d8a.js";import{t as o,i as a,d as r,e as l}from"./p-3dd92f0d.js";import{f as c,c as d,d as h,a as p,F as m,r as u}from"./p-db53bde3.js";import{g as b}from"./p-5a9a971a.js";import{c as g,u as w,d as v,I as f}from"./p-6d520a58.js";import{i as y}from"./p-e7afc0a8.js";import{c as k,s as x,a as C}from"./p-a4149333.js";import{c as D}from"./p-1f65ab1e.js";import{o as z}from"./p-2b0454a0.js";import{g as I}from"./p-495e7b9d.js";import{g as j}from"./p-be8ef276.js";import{c as O,o as _}from"./p-577efb16.js";import{s as E}from"./p-322868ec.js";import"./p-7c2be8cc.js";import"./p-a82f35c9.js";import"./p-ba7d55ea.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";import"./p-18f1e8b5.js";
6
+ import{r as t,c as i,h as e,H as n,g as s}from"./p-7d280d8a.js";import{t as o,i as a,d as r,e as l}from"./p-3dd92f0d.js";import{f as c,c as d,d as h,a as p,F as m,r as u}from"./p-db53bde3.js";import{g as b}from"./p-5a9a971a.js";import{c as g,u as w,d as v,I as f}from"./p-6d520a58.js";import{i as y}from"./p-e7afc0a8.js";import{c as k,s as x,a as C}from"./p-a4149333.js";import{c as D}from"./p-1f65ab1e.js";import{o as z}from"./p-2b0454a0.js";import{g as I}from"./p-495e7b9d.js";import{g as j}from"./p-be8ef276.js";import{c as O,o as _}from"./p-d9c89479.js";import{s as E}from"./p-322868ec.js";import"./p-7c2be8cc.js";import"./p-a82f35c9.js";import"./p-ba7d55ea.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";import"./p-18f1e8b5.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
@@ -3,9 +3,9 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as i,h as e,H as s,g as a}from"./p-7d280d8a.js";import{u as o,t as n,g as l,x as r}from"./p-3dd92f0d.js";import{g as c}from"./p-495e7b9d.js";import{s as h,a as d,c as p}from"./p-a4149333.js";import{N as u,c as m,d as v}from"./p-13f2d901.js";import{o as g}from"./p-2b0454a0.js";import{c as f,s as b,d as w,u as y}from"./p-05cb50f9.js";import{K as k}from"./p-9d3b46e2.js";import{g as x,l as z}from"./p-be8ef276.js";import{a as C}from"./p-577efb16.js";import{P as _}from"./p-fb7a5f6e.js";import"./p-5a9a971a.js";import"./p-7c2be8cc.js";import"./p-e7afc0a8.js";import"./p-1f65ab1e.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";
6
+ import{r as t,c as i,h as e,H as s,g as a}from"./p-7d280d8a.js";import{u as o,t as n,g as l,x as r}from"./p-3dd92f0d.js";import{g as c}from"./p-495e7b9d.js";import{s as h,a as d,c as p}from"./p-a4149333.js";import{N as u,c as m,d as v}from"./p-13f2d901.js";import{o as g}from"./p-2b0454a0.js";import{c as f,s as b,d as w,u as y}from"./p-05cb50f9.js";import{K as k}from"./p-9d3b46e2.js";import{g as x,l as z}from"./p-be8ef276.js";import{a as C}from"./p-d9c89479.js";import{P as _}from"./p-fb7a5f6e.js";import"./p-5a9a971a.js";import"./p-7c2be8cc.js";import"./p-e7afc0a8.js";import"./p-1f65ab1e.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
10
10
  * v2.4.0
11
- */const j={slow:14e3,medium:1e4,fast:6e3},W="container",q=class{constructor(e){t(this,e),this.calciteAlertBeforeClose=i(this,"calciteAlertBeforeClose",6),this.calciteAlertClose=i(this,"calciteAlertClose",6),this.calciteAlertBeforeOpen=i(this,"calciteAlertBeforeOpen",6),this.calciteAlertOpen=i(this,"calciteAlertOpen",6),this.calciteInternalAlertSync=i(this,"calciteInternalAlertSync",6),this.calciteInternalAlertRegister=i(this,"calciteInternalAlertRegister",6),this.autoCloseTimeoutId=null,this.totalOpenTime=0,this.totalHoverTime=0,this.openTransitionProp="opacity",this.setTransitionEl=t=>{this.transitionEl=t},this.closeAlert=()=>{this.autoCloseTimeoutId=null,this.queued=!1,this.open=!1,this.queue=this.queue.filter((t=>t!==this.el)),this.determineActiveAlert(),this.calciteInternalAlertSync.emit({queue:this.queue})},this.actionsEndSlotChangeHandler=t=>{this.hasEndActions=o(t)},this.handleMouseOver=()=>{window.clearTimeout(this.autoCloseTimeoutId),this.totalOpenTime=Date.now()-this.initialOpenTime,this.lastMouseOverBegin=Date.now()},this.handleMouseLeave=()=>{const t=Date.now()-this.lastMouseOverBegin,i=j[this.autoCloseDuration]-this.totalOpenTime+this.totalHoverTime;this.totalHoverTime=this.totalHoverTime?t+this.totalHoverTime:t,this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),i)},this.open=!1,this.autoClose=!1,this.autoCloseDuration="medium",this.kind="brand",this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.numberingSystem=void 0,this.placement="bottom",this.scale="m",this.messages=void 0,this.messageOverrides=void 0,this.slottedInShell=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.numberStringFormatter=new u,this.hasEndActions=!1,this.queue=[],this.queueLength=0,this.queued=!1}openHandler(){g(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.open||(this.queue=this.queue.filter((t=>t!==this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}))}onMessagesChange(){}updateDuration(){this.autoClose&&this.autoCloseTimeoutId&&(window.clearTimeout(this.autoCloseTimeoutId),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),j[this.autoCloseDuration]))}connectedCallback(){m(this),f(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.numberStringFormatter.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"}}async componentWillLoad(){h(this),await b(this),this.open&&g(this)}componentDidLoad(){d(this)}disconnectedCallback(){window.dispatchEvent(new CustomEvent("calciteInternalAlertUnregister",{detail:{alert:this.el}})),window.clearTimeout(this.autoCloseTimeoutId),window.clearTimeout(this.queueTimeout),v(this),w(this),this.slottedInShell=!1}render(){const{open:t,autoClose:i,label:a,placement:o,queued:l}=this,c=i?"alert":"alertdialog",h=!t,d=r(k,this.icon,this.kind),p=this.queueLength>1;return e(s,{"aria-hidden":n(h),"aria-label":a,"calcite-hydrated-hidden":h,role:c},e("div",{class:{[W]:!0,"container--queued":l,[`${W}--${o}`]:!0,"container--slotted-in-shell":this.slottedInShell},onPointerEnter:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseOver:null,onPointerLeave:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseLeave:null,ref:this.setTransitionEl},d&&this.renderIcon(d),e("div",{class:"text-container"},e("slot",{name:"title"}),e("slot",{name:"message"}),e("slot",{name:"link"})),this.renderActionsEnd(),p?this.renderQueueCount():null,this.renderCloseButton(),t&&!l&&i?e("div",{class:"dismiss-progress"}):null))}renderCloseButton(){return e("button",{"aria-label":this.messages.close,class:"close",key:"close",onClick:this.closeAlert,type:"button",ref:t=>this.closeButton=t},e("calcite-icon",{icon:"x",scale:c(this.scale)}))}renderQueueCount(){const t=this.numberStringFormatter.numberFormatter.format(this.queueLength>2?this.queueLength-1:1);return e("div",{class:{"queue-count":!0,"queue-count--active":this.queueLength>1},key:"queue-count"},e("calcite-chip",{scale:this.scale,value:t},t))}renderActionsEnd(){return e("div",{class:"actions-end"},e("slot",{name:"actions-end",onSlotchange:this.actionsEndSlotChangeHandler}))}renderIcon(t){return e("div",{class:"icon"},e("calcite-icon",{flipRtl:this.iconFlipRtl,icon:t,scale:c(this.scale)}))}alertSync(t){this.queue!==t.detail.queue&&(this.queue=t.detail.queue),this.queueLength=this.queue.length,this.determineActiveAlert(),t.stopPropagation()}alertRegister(){this.open&&!this.queue.includes(this.el)&&(this.queued=!0,this.queue.push(this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}),this.determineActiveAlert()}alertUnregister(t){const i=this.queue.filter((i=>i!==t.detail.alert));this.queue=i,window.dispatchEvent(new CustomEvent("calciteInternalAlertSync",{detail:{queue:i}}))}async setFocus(){await p(this);const t=l(this.el,{selector:"calcite-link"});if(this.closeButton||t)return t?t.setFocus():void(this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){y(this,this.effectiveLocale),this.numberStringFormatter.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"}}numberingSystemChange(){this.numberStringFormatter.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"}}determineActiveAlert(){var t;(null===(t=this.queue)||void 0===t?void 0:t[0])===this.el&&(this.openAlert(),this.autoClose&&!this.autoCloseTimeoutId&&(this.initialOpenTime=Date.now(),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),j[this.autoCloseDuration])))}onBeforeOpen(){this.calciteAlertBeforeOpen.emit()}onOpen(){this.calciteAlertOpen.emit()}onBeforeClose(){this.calciteAlertBeforeClose.emit()}onClose(){this.calciteAlertClose.emit()}openAlert(){window.clearTimeout(this.queueTimeout),this.queueTimeout=window.setTimeout((()=>this.queued=!1),300)}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],autoCloseDuration:["updateDuration"],effectiveLocale:["effectiveLocaleChange"],numberingSystem:["numberingSystemChange"]}}};q.style=':host{--calcite-alert-edge-distance:2rem;--calcite-alert-dismiss-progress-background:var(--calcite-color-transparent-tint);display:block}.container{pointer-events:none;position:fixed;z-index:var(--calcite-z-index-toast);margin-inline:auto;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:-moz-min-content;min-inline-size:min-content;align-items:center;justify-content:center;background-color:var(--calcite-color-foreground-1);text-align:start;opacity:0;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);border-radius:var(--calcite-border-radius);border-block-start:0 solid transparent;border-inline:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3);inline-size:var(--calcite-alert-width);max-inline-size:calc(100% - var(--calcite-alert-edge-distance) * 2);transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out}.container--bottom,.container--top{inset-inline-end:0;inset-inline-start:0}.container[class*=bottom]{transform:translate3d(0, var(--calcite-alert-edge-distance), 0);inset-block-end:var(--calcite-alert-edge-distance)}.container[class*=top]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);inset-block-start:var(--calcite-alert-edge-distance)}.container[class*=start]{inset-inline-start:var(--calcite-alert-edge-distance);inset-inline-end:auto}.container[class*=end]{inset-inline-end:var(--calcite-alert-edge-distance);inset-inline-start:auto}.icon{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0px;margin-block:auto;margin-inline-end:auto;padding-inline-start:var(--calcite-alert-spacing-token-large)}.close{display:flex;cursor:pointer;align-items:center;justify-content:flex-end;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-color-text-3);outline:2px solid transparent;outline-offset:2px;-webkit-appearance:none;padding:var(--calcite-alert-spacing-token-large);outline-color:transparent}.close:focus{outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.close:hover,.close:focus{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.close:active{background-color:var(--calcite-color-foreground-3)}.queue-count{visibility:hidden;display:flex;min-inline-size:-moz-min-content;min-inline-size:min-content;cursor:default;align-items:center;justify-content:space-around;align-self:stretch;overflow:hidden;background-color:var(--calcite-color-foreground-1);text-align:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline:0 solid transparent;border-start-end-radius:0}.queue-count--active{visibility:visible;opacity:1}.dismiss-progress{position:absolute;display:block;inline-size:100%;overflow:hidden;inset-inline:0;inset-block-start:-2px;block-size:2px;border-radius:var(--calcite-border-radius) var(--calcite-border-radius) 0 0}.dismiss-progress:after{position:absolute;inset-block-start:0px;display:block;block-size:2px;content:"";background-color:var(--calcite-alert-dismiss-progress-background);inset-inline-end:0}.actions-end{display:flex;align-self:stretch}.text-container{box-sizing:border-box;display:flex;min-inline-size:0px;flex:1 1 auto;flex-direction:column;overflow-wrap:break-word;padding-block:var(--calcite-alert-spacing-token-small);padding-inline:var(--calcite-alert-spacing-token-large) var(--calcite-alert-spacing-token-small)}.footer{position:relative;display:flex;inline-size:auto;justify-content:flex-end;align-self:stretch;padding-block-start:1px;block-size:inherit}:host([scale=s]){--calcite-alert-width:40em;--calcite-alert-spacing-token-small:0.5rem;--calcite-alert-spacing-token-large:0.75rem;--calcite-alert-footer-height:2rem;--calcite-alert-footer-divider-gap:0.125rem}:host([scale=s]) slot[name=title]::slotted(*),:host([scale=s]) *::slotted([slot=title]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) slot[name=message]::slotted(*),:host([scale=s]) *::slotted([slot=message]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) slot[name=link]::slotted(*),:host([scale=s]) *::slotted([slot=link]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .queue-count{margin-inline:0.5rem}:host([scale=s]) .container{--calcite-alert-min-height:3.5rem}:host([scale=m]){--calcite-alert-width:50em;--calcite-alert-spacing-token-small:0.75rem;--calcite-alert-spacing-token-large:1rem;--calcite-alert-footer-height:3rem;--calcite-alert-footer-divider-gap:0.25rem}:host([scale=m]) slot[name=title]::slotted(*),:host([scale=m]) *::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) slot[name=message]::slotted(*),:host([scale=m]) *::slotted([slot=message]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) slot[name=link]::slotted(*),:host([scale=m]) *::slotted([slot=link]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .queue-count{margin-inline:0.75rem}:host([scale=m]) .container{--calcite-alert-min-height:4.1875rem}:host([scale=l]){--calcite-alert-width:60em;--calcite-alert-spacing-token-small:1rem;--calcite-alert-spacing-token-large:1.25rem;--calcite-alert-footer-height:4rem;--calcite-alert-footer-divider-gap:0.5rem}:host([scale=l]) slot[name=title]::slotted(*),:host([scale=l]) *::slotted([slot=title]){margin-block-end:0.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) slot[name=message]::slotted(*),:host([scale=l]) *::slotted([slot=message]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) slot[name=link]::slotted(*),:host([scale=l]) *::slotted([slot=link]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .queue-count{margin-inline:1rem}:host([scale=l]) .container{--calcite-alert-min-height:5.625rem}:host([open]) .container:not(.container--queued){border-block-start-width:2px;opacity:1;pointer-events:initial}:host([open]) .container:not(.container--queued)[class*=bottom]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit)}:host([open]) .container:not(.container--queued)[class*=top]{transform:translate3d(0, var(--calcite-alert-edge-distance), inherit)}:host([auto-close])>.queue-count{border-inline-end:0 solid transparent}slot[name=title]::slotted(*),*::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}slot[name=message]::slotted(*),*::slotted([slot=message]){margin:0px;display:inline;font-size:var(--calcite-font-size--1);line-height:1.375;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);margin-inline-end:0.5rem}slot[name=link]::slotted(*),*::slotted([slot=link]){display:inline-flex;color:var(--calcite-color-text-link)}:host([kind=brand]) .container{border-block-start-color:var(--calcite-color-brand)}:host([kind=brand]) .container .icon{color:var(--calcite-color-brand)}:host([kind=info]) .container{border-block-start-color:var(--calcite-color-status-info)}:host([kind=info]) .container .icon{color:var(--calcite-color-status-info)}:host([kind=danger]) .container{border-block-start-color:var(--calcite-color-status-danger)}:host([kind=danger]) .container .icon{color:var(--calcite-color-status-danger)}:host([kind=success]) .container{border-block-start-color:var(--calcite-color-status-success)}:host([kind=success]) .container .icon{color:var(--calcite-color-status-success)}:host([kind=warning]) .container{border-block-start-color:var(--calcite-color-status-warning)}:host([kind=warning]) .container .icon{color:var(--calcite-color-status-warning)}:host([auto-close-duration=fast]) .dismiss-progress:after{animation:dismissProgress 6000ms ease-out}:host(:hover[auto-close-duration=fast]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=medium]) .dismiss-progress:after{animation:dismissProgress 10000ms ease-out}:host(:hover[auto-close-duration=medium]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=slow]) .dismiss-progress:after{animation:dismissProgress 14000ms ease-out}:host(:hover[auto-close-duration=slow]) .dismiss-progress:after{animation-play-state:paused}@keyframes dismissProgress{0%{inline-size:0px;opacity:0.75}100%{inline-size:100%;opacity:1}}.container--slotted-in-shell{position:absolute}:host([hidden]){display:none}[hidden]{display:none}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}';const H=class{constructor(e){t(this,e),this.editsComplete=i(this,"editsComplete",7),this.buttonType="button",this.disabled=!1,this.icon=void 0,this.ids=[],this.layer=void 0,this._confirmDelete=!1,this._deleteEndabled=!1,this._isDeleting=!1,this._supportsDelete=void 0,this._translations=void 0}async idsWatchHandler(){this._setDeleteEnabled()}async layerWatchHandler(){this._setDeleteEnabled()}async componentWillLoad(){await this._getTranslations()}render(){return e(s,null,"button"===this.buttonType?e("calcite-button",{appearance:"outline",disabled:!this._deleteEndabled,id:"solutions-delete",kind:"danger",onClick:()=>this._delete(),width:"full"},this._translations.deleteCount.replace("{{n}}",this.ids.length.toString())):e("calcite-action",{appearance:"solid",compact:!0,disabled:!this._deleteEndabled,id:this.icon,onClick:()=>this._delete(),scale:"s",text:this._translations.delete},e("calcite-button",{appearance:"transparent",iconStart:this.icon,kind:"danger"},this._translations.delete)),this._deleteMessage())}async componentDidLoad(){this._setDeleteEnabled()}_setDeleteEnabled(){var t,i,e,s;this._supportsDelete=(null===(t=this.layer)||void 0===t?void 0:t.editingEnabled)&&(null===(s=null===(e=null===(i=this.layer)||void 0===i?void 0:i.capabilities)||void 0===e?void 0:e.operations)||void 0===s?void 0:s.supportsDelete),this._deleteEndabled=!this.disabled||this._supportsDelete&&this.ids.length>0}_delete(){this._confirmDelete=!0}_deleteMessage(){const t=1===this.ids.length?this._translations.confirmSingle:this._translations.confirmMultiple;return e("calcite-modal",{"aria-labelledby":"modal-title",kind:"danger",onCalciteModalClose:()=>this._deleteClosed(),open:this._confirmDelete},e("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations.deleteFeature),e("div",{slot:"content"},t),e("calcite-button",{appearance:"outline",kind:"danger",onClick:()=>this._deleteClosed(),slot:"secondary",width:"full"},this._translations.cancel),e("calcite-button",{kind:"danger",loading:this._isDeleting,onClick:()=>{this._deleteFeatures()},slot:"primary",width:"full"},this._translations.delete))}async _deleteFeatures(){this._isDeleting=!0;const t=this.ids.map((t=>({objectId:t})));await this.layer.applyEdits({deleteFeatures:t}),this._isDeleting=!1,this._deleteClosed(),this.editsComplete.emit("delete")}_deleteClosed(){this._confirmDelete=!1}async _getTranslations(){const t=await x(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{ids:["idsWatchHandler"],layer:["layerWatchHandler"]}}};H.style=":host{display:block}";const E=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editsComplete=i(this,"editsComplete",7),this.refreshGraphics=i(this,"refreshGraphics",7),this._shouldClose=!1,this.graphics=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._editorLoading=!1,this._translations=void 0}async graphicsWatchHandler(){0===this.graphics.length&&this.open&&await this._closeEdit(!0)}async openWatchHandler(t){var i;t&&(null===(i=this.graphics)||void 0===i?void 0:i.length)>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit(!0)}async featureSelectionChange(){this.open&&await this._closeEdit(!1)}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){var t,i;(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&(null===(i=this.graphics[0])||void 0===i?void 0:i.layer)&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=this._layer.on("edits",(()=>{this.editsComplete.emit()})))}render(){var t;const i=!((null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled),a=this._editorLoading?"display-none":"position-absolute",o=this._editorLoading?"":"display-none";return e(s,null,e("div",{class:"position-absolute"},i?e("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},e("div",{slot:"message"},this._translations.enableEditing)):void 0,e("div",{class:"position-absolute"},e("div",{class:a,id:"feature-form",ref:t=>this._editContainer=t}),e("calcite-loader",{class:o,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await z(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=(await C(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:!1})));this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,layerInfos:i,visibleElements:{snappingControls:!1},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>{var t;return null===(t=this._editor.viewModel.activeWorkflow)||void 0===t?void 0:t.activeWorkflow}),(t=>{var i,e;"update-table-record"!==(null==t?void 0:t.type)&&"create-features"!==(null==t?void 0:t.type)||(this._shouldClose=!1),((null==t?void 0:t.type)||(null==t?void 0:t.hasPendingEdits)||this._editor.activeWorkflow)&&(null===(e=null===(i=this._editor)||void 0===i?void 0:i.activeWorkflow)||void 0===e?void 0:e.started)||(this.open=!1)})),this._editContainer.appendChild(t)}}async _closeEdit(t){var i,e,s,a;this._shouldClose=!0,t&&(null===(i=this._editor)||void 0===i?void 0:i.activeWorkflow)?((null===(s=null===(e=this._editor.activeWorkflow)||void 0===e?void 0:e.activeWorkflow)||void 0===s?void 0:s.hasPendingEdits)&&(await this._editor.activeWorkflow.reset(),await this._editor.cancelWorkflow()),this._editor.destroy()):this.graphicIndex>-1&&(null===(a=this.graphics)||void 0===a?void 0:a.length)>0&&this.refreshGraphics.emit(this.graphics),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await x(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],open:["openWatchHandler"]}}};E.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-color-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-color-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-color-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}";const S=class{constructor(e){t(this,e),this.popupClosed=i(this,"popupClosed",7),this.selectionChanged=i(this,"selectionChanged",7),this.graphics=void 0,this.isLoading=!1,this.isMobile=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this.allowEditing=!0,this.highlightEnabled=!0,this.paginationEnabled=!0,this.position="absolute",this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._mobileTitle="",this._showListView=!1,this._translations=void 0}async graphicsWatchHandler(){await this.setGraphics()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async refresh(){await this.setGraphics()}async back(){this._features.previous(),this._count=this._getCount()}async next(){this._features.next(),this._count=this._getCount()}async toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async updateCurrentGraphic(t){this._features.selectedFeatureWidget.graphic=t}async closeEdit(){this._editRecordOpen=!1}async layerSelectionChange(){var t;this._showListView=!1,(null===(t=this._features)||void 0===t?void 0:t.viewModel)&&(this._features.viewModel.featureMenuOpen=!1,this._features.close())}async refreshGraphics(t){this.graphics=[...t.detail]}async componentWillLoad(){await this._initModules(),await this._getTranslations(),this._popupUtils=new _}async componentDidLoad(){var t;(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&await this.setGraphics()}render(){var t,i,a,o,n,l,r,c,h;const d=this.isLoading?"":"display-none",p=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",u=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",m=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",v=(null===(i=null===(t=this._features)||void 0===t?void 0:t.features)||void 0===i?void 0:i.length)<2,g=this.isMobile?"display-none":"",f=null===(o=null===(a=this._features)||void 0===a?void 0:a.selectedFeature)||void 0===o?void 0:o.getObjectId(),b=parseInt(null==f?void 0:f.toString(),10)>-1?[f]:[],w=(null===(n=this._layer)||void 0===n?void 0:n.editingEnabled)&&(null===(c=null===(r=null===(l=this._layer)||void 0===l?void 0:l.capabilities)||void 0===r?void 0:r.operations)||void 0===c?void 0:c.supportsDelete);return e(s,null,e("calcite-shell",{style:{position:this.position}},this._getHeader(),e("calcite-loader",{class:d,label:this._translations.fetchingData}),e("div",{class:"esri-widget feature-node "+p,id:"features-node"}),e("div",{class:`${m} width-100`,slot:"footer"},this.allowEditing&&e("div",{class:"display-flex top-border padding-1-2"},e("calcite-button",{appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile&&w?e("delete-button",{class:"padding-inline-start-1 width-100",id:"solutions-delete",ids:b,layer:this._layer,onEditsComplete:()=>this._closePopup()}):void 0,e("calcite-tooltip",{placement:"bottom","reference-element":"solutions-edit"},e("span",null,this._translations.edit)),this.isMobile?e("calcite-tooltip",{placement:"bottom","reference-element":"solutions-delete"},e("span",null,this._translations.delete)):void 0),this.paginationEnabled&&!v&&e("div",{class:`display-flex padding-1-2 button-container top-border ${g}`},e("div",null,e("calcite-button",{appearance:"transparent",disabled:v,iconStart:"chevron-left",id:"solutions-back",onClick:()=>this._back(),width:"full"}),e("calcite-tooltip",{placement:"top","reference-element":"solutions-back"},e("span",null,this._translations.back))),e("calcite-action",{class:"pagination-action",onClick:()=>this._toggleListView(),scale:"s",text:"",textEnabled:!0},e("span",{class:"pagination-count"},this._count)),e("div",null,e("calcite-button",{appearance:"transparent",disabled:v,iconStart:"chevron-right",id:"solutions-next",onClick:()=>this._next(),width:"full"}),e("calcite-tooltip",{placement:"top","reference-element":"solutions-next"},e("span",null,this._translations.next))))),e("edit-card",{class:u,graphicIndex:null===(h=this._features)||void 0===h?void 0:h.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),e("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},e("div",{slot:"title"},this._translations.editDisabled),e("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await z(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async setGraphics(){var t;this._features||await this._initFeaturesWidget(),this.graphics.length>0?(this._layer=null===(t=this.graphics[0])||void 0===t?void 0:t.layer,this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._mobileTitle=await this._popupUtils.getPopupTitle(this.graphics[0],this.mapView.map),this._features.open({features:this.graphics})):(this._features.clear(),this._features.close()),this._count=this._getCount()}async _initFeaturesWidget(){var t;return void 0!==this.isMobile?await(null===(t=this.mapView)||void 0===t?void 0:t.when((()=>{this._features?(this._features.view=this.mapView,this._features.visibleElements.actionBar=!1,this._features.visibleElements.closeButton=!1,this._features.visibleElements.heading=!this.isMobile):(this._features=new this.Features({view:this.mapView,container:"features-node",visibleElements:{actionBar:!1,closeButton:!1,heading:!this.isMobile}}),this._features.viewModel.highlightEnabled=this.highlightEnabled,this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{t||(this._showListView=t)})),this.zoomAndScrollToSelected&&this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit({selectedFeature:[this._features.selectedFeature],selectedFeatureIndex:this._features.selectedFeatureIndex})})))}))):Promise.resolve()}_getHeader(){return this.isMobile&&!this._editRecordOpen?e("calcite-panel",{class:"border-width-0",slot:"header"},e("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),e("span",{class:"font-bold",slot:"header-content"},this._mobileTitle)):void 0}_closePopup(){this.popupClosed.emit()}_alertClosed(){this._alertOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){var t,i,e;const s=((null===(t=this._features)||void 0===t?void 0:t.viewModel.selectedFeatureIndex)+1).toString(),a=null===(e=null===(i=this._features)||void 0===i?void 0:i.features)||void 0===e?void 0:e.length.toString();return this._translations.indexOfTotal.replace("{{index}}",s).replace("{{total}}",a)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await x(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],mapView:["mapViewWatchHandler"]}}};S.style=":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node{position:relative !important}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:center;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}.pagination-action{position:relative;left:3px}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand)}";export{q as calcite_alert,H as delete_button,E as edit_card,S as info_card}
11
+ */const j={slow:14e3,medium:1e4,fast:6e3},W="container",q=class{constructor(e){t(this,e),this.calciteAlertBeforeClose=i(this,"calciteAlertBeforeClose",6),this.calciteAlertClose=i(this,"calciteAlertClose",6),this.calciteAlertBeforeOpen=i(this,"calciteAlertBeforeOpen",6),this.calciteAlertOpen=i(this,"calciteAlertOpen",6),this.calciteInternalAlertSync=i(this,"calciteInternalAlertSync",6),this.calciteInternalAlertRegister=i(this,"calciteInternalAlertRegister",6),this.autoCloseTimeoutId=null,this.totalOpenTime=0,this.totalHoverTime=0,this.openTransitionProp="opacity",this.setTransitionEl=t=>{this.transitionEl=t},this.closeAlert=()=>{this.autoCloseTimeoutId=null,this.queued=!1,this.open=!1,this.queue=this.queue.filter((t=>t!==this.el)),this.determineActiveAlert(),this.calciteInternalAlertSync.emit({queue:this.queue})},this.actionsEndSlotChangeHandler=t=>{this.hasEndActions=o(t)},this.handleMouseOver=()=>{window.clearTimeout(this.autoCloseTimeoutId),this.totalOpenTime=Date.now()-this.initialOpenTime,this.lastMouseOverBegin=Date.now()},this.handleMouseLeave=()=>{const t=Date.now()-this.lastMouseOverBegin,i=j[this.autoCloseDuration]-this.totalOpenTime+this.totalHoverTime;this.totalHoverTime=this.totalHoverTime?t+this.totalHoverTime:t,this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),i)},this.open=!1,this.autoClose=!1,this.autoCloseDuration="medium",this.kind="brand",this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.numberingSystem=void 0,this.placement="bottom",this.scale="m",this.messages=void 0,this.messageOverrides=void 0,this.slottedInShell=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.numberStringFormatter=new u,this.hasEndActions=!1,this.queue=[],this.queueLength=0,this.queued=!1}openHandler(){g(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.open||(this.queue=this.queue.filter((t=>t!==this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}))}onMessagesChange(){}updateDuration(){this.autoClose&&this.autoCloseTimeoutId&&(window.clearTimeout(this.autoCloseTimeoutId),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),j[this.autoCloseDuration]))}connectedCallback(){m(this),f(this),this.open&&!this.queued&&this.calciteInternalAlertRegister.emit(),this.numberStringFormatter.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"}}async componentWillLoad(){h(this),await b(this),this.open&&g(this)}componentDidLoad(){d(this)}disconnectedCallback(){window.dispatchEvent(new CustomEvent("calciteInternalAlertUnregister",{detail:{alert:this.el}})),window.clearTimeout(this.autoCloseTimeoutId),window.clearTimeout(this.queueTimeout),v(this),w(this),this.slottedInShell=!1}render(){const{open:t,autoClose:i,label:a,placement:o,queued:l}=this,c=i?"alert":"alertdialog",h=!t,d=r(k,this.icon,this.kind),p=this.queueLength>1;return e(s,{"aria-hidden":n(h),"aria-label":a,"calcite-hydrated-hidden":h,role:c},e("div",{class:{[W]:!0,"container--queued":l,[`${W}--${o}`]:!0,"container--slotted-in-shell":this.slottedInShell},onPointerEnter:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseOver:null,onPointerLeave:this.autoClose&&this.autoCloseTimeoutId?this.handleMouseLeave:null,ref:this.setTransitionEl},d&&this.renderIcon(d),e("div",{class:"text-container"},e("slot",{name:"title"}),e("slot",{name:"message"}),e("slot",{name:"link"})),this.renderActionsEnd(),p?this.renderQueueCount():null,this.renderCloseButton(),t&&!l&&i?e("div",{class:"dismiss-progress"}):null))}renderCloseButton(){return e("button",{"aria-label":this.messages.close,class:"close",key:"close",onClick:this.closeAlert,type:"button",ref:t=>this.closeButton=t},e("calcite-icon",{icon:"x",scale:c(this.scale)}))}renderQueueCount(){const t=this.numberStringFormatter.numberFormatter.format(this.queueLength>2?this.queueLength-1:1);return e("div",{class:{"queue-count":!0,"queue-count--active":this.queueLength>1},key:"queue-count"},e("calcite-chip",{scale:this.scale,value:t},t))}renderActionsEnd(){return e("div",{class:"actions-end"},e("slot",{name:"actions-end",onSlotchange:this.actionsEndSlotChangeHandler}))}renderIcon(t){return e("div",{class:"icon"},e("calcite-icon",{flipRtl:this.iconFlipRtl,icon:t,scale:c(this.scale)}))}alertSync(t){this.queue!==t.detail.queue&&(this.queue=t.detail.queue),this.queueLength=this.queue.length,this.determineActiveAlert(),t.stopPropagation()}alertRegister(){this.open&&!this.queue.includes(this.el)&&(this.queued=!0,this.queue.push(this.el)),this.calciteInternalAlertSync.emit({queue:this.queue}),this.determineActiveAlert()}alertUnregister(t){const i=this.queue.filter((i=>i!==t.detail.alert));this.queue=i,window.dispatchEvent(new CustomEvent("calciteInternalAlertSync",{detail:{queue:i}}))}async setFocus(){await p(this);const t=l(this.el,{selector:"calcite-link"});if(this.closeButton||t)return t?t.setFocus():void(this.closeButton&&this.closeButton.focus())}effectiveLocaleChange(){y(this,this.effectiveLocale),this.numberStringFormatter.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"}}numberingSystemChange(){this.numberStringFormatter.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,signDisplay:"always"}}determineActiveAlert(){var t;(null===(t=this.queue)||void 0===t?void 0:t[0])===this.el&&(this.openAlert(),this.autoClose&&!this.autoCloseTimeoutId&&(this.initialOpenTime=Date.now(),this.autoCloseTimeoutId=window.setTimeout((()=>this.closeAlert()),j[this.autoCloseDuration])))}onBeforeOpen(){this.calciteAlertBeforeOpen.emit()}onOpen(){this.calciteAlertOpen.emit()}onBeforeClose(){this.calciteAlertBeforeClose.emit()}onClose(){this.calciteAlertClose.emit()}openAlert(){window.clearTimeout(this.queueTimeout),this.queueTimeout=window.setTimeout((()=>this.queued=!1),300)}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],autoCloseDuration:["updateDuration"],effectiveLocale:["effectiveLocaleChange"],numberingSystem:["numberingSystemChange"]}}};q.style=':host{--calcite-alert-edge-distance:2rem;--calcite-alert-dismiss-progress-background:var(--calcite-color-transparent-tint);display:block}.container{pointer-events:none;position:fixed;z-index:var(--calcite-z-index-toast);margin-inline:auto;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:-moz-min-content;min-inline-size:min-content;align-items:center;justify-content:center;background-color:var(--calcite-color-foreground-1);text-align:start;opacity:0;--tw-shadow:0 6px 20px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.08);--tw-shadow-colored:0 6px 20px -4px var(--tw-shadow-color), 0 4px 12px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);border-radius:var(--calcite-border-radius);border-block-start:0 solid transparent;border-inline:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3);inline-size:var(--calcite-alert-width);max-inline-size:calc(100% - var(--calcite-alert-edge-distance) * 2);transition:var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), opacity var(--calcite-internal-animation-timing-slow) cubic-bezier(0.215, 0.44, 0.42, 0.88), all var(--calcite-animation-timing) ease-in-out}.container--bottom,.container--top{inset-inline-end:0;inset-inline-start:0}.container[class*=bottom]{transform:translate3d(0, var(--calcite-alert-edge-distance), 0);inset-block-end:var(--calcite-alert-edge-distance)}.container[class*=top]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), 0);inset-block-start:var(--calcite-alert-edge-distance)}.container[class*=start]{inset-inline-start:var(--calcite-alert-edge-distance);inset-inline-end:auto}.container[class*=end]{inset-inline-end:var(--calcite-alert-edge-distance);inset-inline-start:auto}.icon{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0px;margin-block:auto;margin-inline-end:auto;padding-inline-start:var(--calcite-alert-spacing-token-large)}.close{display:flex;cursor:pointer;align-items:center;justify-content:flex-end;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-color-text-3);outline:2px solid transparent;outline-offset:2px;-webkit-appearance:none;padding:var(--calcite-alert-spacing-token-large);outline-color:transparent}.close:focus{outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}.close:hover,.close:focus{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.close:active{background-color:var(--calcite-color-foreground-3)}.queue-count{visibility:hidden;display:flex;min-inline-size:-moz-min-content;min-inline-size:min-content;cursor:default;align-items:center;justify-content:space-around;align-self:stretch;overflow:hidden;background-color:var(--calcite-color-foreground-1);text-align:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline:0 solid transparent;border-start-end-radius:0}.queue-count--active{visibility:visible;opacity:1}.dismiss-progress{position:absolute;display:block;inline-size:100%;overflow:hidden;inset-inline:0;inset-block-start:-2px;block-size:2px;border-radius:var(--calcite-border-radius) var(--calcite-border-radius) 0 0}.dismiss-progress:after{position:absolute;inset-block-start:0px;display:block;block-size:2px;content:"";background-color:var(--calcite-alert-dismiss-progress-background);inset-inline-end:0}.actions-end{display:flex;align-self:stretch}.text-container{box-sizing:border-box;display:flex;min-inline-size:0px;flex:1 1 auto;flex-direction:column;overflow-wrap:break-word;padding-block:var(--calcite-alert-spacing-token-small);padding-inline:var(--calcite-alert-spacing-token-large) var(--calcite-alert-spacing-token-small)}.footer{position:relative;display:flex;inline-size:auto;justify-content:flex-end;align-self:stretch;padding-block-start:1px;block-size:inherit}:host([scale=s]){--calcite-alert-width:40em;--calcite-alert-spacing-token-small:0.5rem;--calcite-alert-spacing-token-large:0.75rem;--calcite-alert-footer-height:2rem;--calcite-alert-footer-divider-gap:0.125rem}:host([scale=s]) slot[name=title]::slotted(*),:host([scale=s]) *::slotted([slot=title]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) slot[name=message]::slotted(*),:host([scale=s]) *::slotted([slot=message]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) slot[name=link]::slotted(*),:host([scale=s]) *::slotted([slot=link]){font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .queue-count{margin-inline:0.5rem}:host([scale=s]) .container{--calcite-alert-min-height:3.5rem}:host([scale=m]){--calcite-alert-width:50em;--calcite-alert-spacing-token-small:0.75rem;--calcite-alert-spacing-token-large:1rem;--calcite-alert-footer-height:3rem;--calcite-alert-footer-divider-gap:0.25rem}:host([scale=m]) slot[name=title]::slotted(*),:host([scale=m]) *::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) slot[name=message]::slotted(*),:host([scale=m]) *::slotted([slot=message]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) slot[name=link]::slotted(*),:host([scale=m]) *::slotted([slot=link]){font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .queue-count{margin-inline:0.75rem}:host([scale=m]) .container{--calcite-alert-min-height:4.1875rem}:host([scale=l]){--calcite-alert-width:60em;--calcite-alert-spacing-token-small:1rem;--calcite-alert-spacing-token-large:1.25rem;--calcite-alert-footer-height:4rem;--calcite-alert-footer-divider-gap:0.5rem}:host([scale=l]) slot[name=title]::slotted(*),:host([scale=l]) *::slotted([slot=title]){margin-block-end:0.25rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) slot[name=message]::slotted(*),:host([scale=l]) *::slotted([slot=message]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) slot[name=link]::slotted(*),:host([scale=l]) *::slotted([slot=link]){font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .queue-count{margin-inline:1rem}:host([scale=l]) .container{--calcite-alert-min-height:5.625rem}:host([open]) .container:not(.container--queued){border-block-start-width:2px;opacity:1;pointer-events:initial}:host([open]) .container:not(.container--queued)[class*=bottom]{transform:translate3d(0, calc(-1 * var(--calcite-alert-edge-distance)), inherit)}:host([open]) .container:not(.container--queued)[class*=top]{transform:translate3d(0, var(--calcite-alert-edge-distance), inherit)}:host([auto-close])>.queue-count{border-inline-end:0 solid transparent}slot[name=title]::slotted(*),*::slotted([slot=title]){font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}slot[name=message]::slotted(*),*::slotted([slot=message]){margin:0px;display:inline;font-size:var(--calcite-font-size--1);line-height:1.375;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2);margin-inline-end:0.5rem}slot[name=link]::slotted(*),*::slotted([slot=link]){display:inline-flex;color:var(--calcite-color-text-link)}:host([kind=brand]) .container{border-block-start-color:var(--calcite-color-brand)}:host([kind=brand]) .container .icon{color:var(--calcite-color-brand)}:host([kind=info]) .container{border-block-start-color:var(--calcite-color-status-info)}:host([kind=info]) .container .icon{color:var(--calcite-color-status-info)}:host([kind=danger]) .container{border-block-start-color:var(--calcite-color-status-danger)}:host([kind=danger]) .container .icon{color:var(--calcite-color-status-danger)}:host([kind=success]) .container{border-block-start-color:var(--calcite-color-status-success)}:host([kind=success]) .container .icon{color:var(--calcite-color-status-success)}:host([kind=warning]) .container{border-block-start-color:var(--calcite-color-status-warning)}:host([kind=warning]) .container .icon{color:var(--calcite-color-status-warning)}:host([auto-close-duration=fast]) .dismiss-progress:after{animation:dismissProgress 6000ms ease-out}:host(:hover[auto-close-duration=fast]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=medium]) .dismiss-progress:after{animation:dismissProgress 10000ms ease-out}:host(:hover[auto-close-duration=medium]) .dismiss-progress:after{animation-play-state:paused}:host([auto-close-duration=slow]) .dismiss-progress:after{animation:dismissProgress 14000ms ease-out}:host(:hover[auto-close-duration=slow]) .dismiss-progress:after{animation-play-state:paused}@keyframes dismissProgress{0%{inline-size:0px;opacity:0.75}100%{inline-size:100%;opacity:1}}.container--slotted-in-shell{position:absolute}:host([hidden]){display:none}[hidden]{display:none}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}';const H=class{constructor(e){t(this,e),this.editsComplete=i(this,"editsComplete",7),this.buttonType="button",this.disabled=!1,this.icon=void 0,this.ids=[],this.layer=void 0,this._confirmDelete=!1,this._deleteEndabled=!1,this._isDeleting=!1,this._supportsDelete=void 0,this._translations=void 0}async idsWatchHandler(){this._setDeleteEnabled()}async layerWatchHandler(){this._setDeleteEnabled()}async componentWillLoad(){await this._getTranslations()}render(){return e(s,null,"button"===this.buttonType?e("calcite-button",{appearance:"outline",disabled:!this._deleteEndabled,id:"solutions-delete",kind:"danger",onClick:()=>this._delete(),width:"full"},this._translations.deleteCount.replace("{{n}}",this.ids.length.toString())):e("calcite-action",{appearance:"solid",compact:!0,disabled:!this._deleteEndabled,id:this.icon,onClick:()=>this._delete(),scale:"s",text:this._translations.delete},e("calcite-button",{appearance:"transparent",iconStart:this.icon,kind:"danger"},this._translations.delete)),this._deleteMessage())}async componentDidLoad(){this._setDeleteEnabled()}_setDeleteEnabled(){var t,i,e,s;this._supportsDelete=(null===(t=this.layer)||void 0===t?void 0:t.editingEnabled)&&(null===(s=null===(e=null===(i=this.layer)||void 0===i?void 0:i.capabilities)||void 0===e?void 0:e.operations)||void 0===s?void 0:s.supportsDelete),this._deleteEndabled=!this.disabled||this._supportsDelete&&this.ids.length>0}_delete(){this._confirmDelete=!0}_deleteMessage(){const t=1===this.ids.length?this._translations.confirmSingle:this._translations.confirmMultiple;return e("calcite-modal",{"aria-labelledby":"modal-title",kind:"danger",onCalciteModalClose:()=>this._deleteClosed(),open:this._confirmDelete},e("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations.deleteFeature),e("div",{slot:"content"},t),e("calcite-button",{appearance:"outline",kind:"danger",onClick:()=>this._deleteClosed(),slot:"secondary",width:"full"},this._translations.cancel),e("calcite-button",{kind:"danger",loading:this._isDeleting,onClick:()=>{this._deleteFeatures()},slot:"primary",width:"full"},this._translations.delete))}async _deleteFeatures(){this._isDeleting=!0;const t=this.ids.map((t=>({objectId:t})));await this.layer.applyEdits({deleteFeatures:t}),this._isDeleting=!1,this._deleteClosed(),this.editsComplete.emit("delete")}_deleteClosed(){this._confirmDelete=!1}async _getTranslations(){const t=await x(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{ids:["idsWatchHandler"],layer:["layerWatchHandler"]}}};H.style=":host{display:block}";const E=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editsComplete=i(this,"editsComplete",7),this.refreshGraphics=i(this,"refreshGraphics",7),this._shouldClose=!1,this.graphics=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._editorLoading=!1,this._translations=void 0}async graphicsWatchHandler(){0===this.graphics.length&&this.open&&await this._closeEdit(!0)}async openWatchHandler(t){var i;t&&(null===(i=this.graphics)||void 0===i?void 0:i.length)>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit(!0)}async featureSelectionChange(){this.open&&await this._closeEdit(!1)}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){var t,i;(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&(null===(i=this.graphics[0])||void 0===i?void 0:i.layer)&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=this._layer.on("edits",(()=>{this.editsComplete.emit()})))}render(){var t;const i=!((null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled),a=this._editorLoading?"display-none":"position-absolute",o=this._editorLoading?"":"display-none";return e(s,null,e("div",{class:"position-absolute"},i?e("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},e("div",{slot:"message"},this._translations.enableEditing)):void 0,e("div",{class:"position-absolute"},e("div",{class:a,id:"feature-form",ref:t=>this._editContainer=t}),e("calcite-loader",{class:o,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await z(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=(await C(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:!1})));this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,layerInfos:i,visibleElements:{snappingControls:!1},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>{var t;return null===(t=this._editor.viewModel.activeWorkflow)||void 0===t?void 0:t.activeWorkflow}),(t=>{var i,e;"update-table-record"!==(null==t?void 0:t.type)&&"create-features"!==(null==t?void 0:t.type)||(this._shouldClose=!1),((null==t?void 0:t.type)||(null==t?void 0:t.hasPendingEdits)||this._editor.activeWorkflow)&&(null===(e=null===(i=this._editor)||void 0===i?void 0:i.activeWorkflow)||void 0===e?void 0:e.started)||(this.open=!1)})),this._editContainer.appendChild(t)}}async _closeEdit(t){var i,e,s,a;this._shouldClose=!0,t&&(null===(i=this._editor)||void 0===i?void 0:i.activeWorkflow)?((null===(s=null===(e=this._editor.activeWorkflow)||void 0===e?void 0:e.activeWorkflow)||void 0===s?void 0:s.hasPendingEdits)&&(await this._editor.activeWorkflow.reset(),await this._editor.cancelWorkflow()),this._editor.destroy()):this.graphicIndex>-1&&(null===(a=this.graphics)||void 0===a?void 0:a.length)>0&&this.refreshGraphics.emit(this.graphics),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await x(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],open:["openWatchHandler"]}}};E.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-color-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-color-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-color-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}";const S=class{constructor(e){t(this,e),this.popupClosed=i(this,"popupClosed",7),this.selectionChanged=i(this,"selectionChanged",7),this.graphics=void 0,this.isLoading=!1,this.isMobile=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this.allowEditing=!0,this.highlightEnabled=!0,this.paginationEnabled=!0,this.position="absolute",this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._mobileTitle="",this._showListView=!1,this._translations=void 0}async graphicsWatchHandler(){await this.setGraphics()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async refresh(){await this.setGraphics()}async back(){this._features.previous(),this._count=this._getCount()}async next(){this._features.next(),this._count=this._getCount()}async toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async updateCurrentGraphic(t){this._features.selectedFeatureWidget.graphic=t}async closeEdit(){this._editRecordOpen=!1}async layerSelectionChange(){var t;this._showListView=!1,(null===(t=this._features)||void 0===t?void 0:t.viewModel)&&(this._features.viewModel.featureMenuOpen=!1,this._features.close())}async refreshGraphics(t){this.graphics=[...t.detail]}async componentWillLoad(){await this._initModules(),await this._getTranslations(),this._popupUtils=new _}async componentDidLoad(){var t;(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&await this.setGraphics()}render(){var t,i,a,o,n,l,r,c,h;const d=this.isLoading?"":"display-none",p=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",u=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",m=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",v=(null===(i=null===(t=this._features)||void 0===t?void 0:t.features)||void 0===i?void 0:i.length)<2,g=this.isMobile?"display-none":"",f=null===(o=null===(a=this._features)||void 0===a?void 0:a.selectedFeature)||void 0===o?void 0:o.getObjectId(),b=parseInt(null==f?void 0:f.toString(),10)>-1?[f]:[],w=(null===(n=this._layer)||void 0===n?void 0:n.editingEnabled)&&(null===(c=null===(r=null===(l=this._layer)||void 0===l?void 0:l.capabilities)||void 0===r?void 0:r.operations)||void 0===c?void 0:c.supportsDelete);return e(s,null,e("calcite-shell",{style:{position:this.position}},this._getHeader(),e("calcite-loader",{class:d,label:this._translations.fetchingData}),e("div",{class:"esri-widget feature-node "+p,id:"features-node"}),e("div",{class:`${m} width-100`,slot:"footer"},this.allowEditing&&e("div",{class:"display-flex top-border padding-1-2"},e("calcite-button",{appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile&&w?e("delete-button",{class:"padding-inline-start-1 width-100",id:"solutions-delete",ids:b,layer:this._layer,onEditsComplete:()=>this._closePopup()}):void 0,e("calcite-tooltip",{placement:"bottom","reference-element":"solutions-edit"},e("span",null,this._translations.edit)),this.isMobile?e("calcite-tooltip",{placement:"bottom","reference-element":"solutions-delete"},e("span",null,this._translations.delete)):void 0),this.paginationEnabled&&!v&&e("div",{class:`display-flex padding-1-2 button-container top-border ${g}`},e("div",null,e("calcite-button",{appearance:"transparent",disabled:v,iconStart:"chevron-left",id:"solutions-back",onClick:()=>this._back(),width:"full"}),e("calcite-tooltip",{placement:"top","reference-element":"solutions-back"},e("span",null,this._translations.back))),e("calcite-action",{class:"pagination-action",onClick:()=>this._toggleListView(),scale:"s",text:"",textEnabled:!0},e("span",{class:"pagination-count"},this._count)),e("div",null,e("calcite-button",{appearance:"transparent",disabled:v,iconStart:"chevron-right",id:"solutions-next",onClick:()=>this._next(),width:"full"}),e("calcite-tooltip",{placement:"top","reference-element":"solutions-next"},e("span",null,this._translations.next))))),e("edit-card",{class:u,graphicIndex:null===(h=this._features)||void 0===h?void 0:h.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),e("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},e("div",{slot:"title"},this._translations.editDisabled),e("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await z(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async setGraphics(){var t;this._features||await this._initFeaturesWidget(),this.graphics.length>0?(this._layer=null===(t=this.graphics[0])||void 0===t?void 0:t.layer,this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._mobileTitle=await this._popupUtils.getPopupTitle(this.graphics[0],this.mapView.map),this._features.open({features:this.graphics})):(this._features.clear(),this._features.close()),this._count=this._getCount()}async _initFeaturesWidget(){var t;return void 0!==this.isMobile?await(null===(t=this.mapView)||void 0===t?void 0:t.when((()=>{this._features?(this._features.view=this.mapView,this._features.visibleElements.actionBar=!1,this._features.visibleElements.closeButton=!1,this._features.visibleElements.heading=!this.isMobile):(this._features=new this.Features({view:this.mapView,container:"features-node",visibleElements:{actionBar:!1,closeButton:!1,heading:!this.isMobile}}),this._features.viewModel.highlightEnabled=this.highlightEnabled,this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{this._count=this._getCount(),t||(this._showListView=t)})),this.zoomAndScrollToSelected&&this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit({selectedFeature:[this._features.selectedFeature],selectedFeatureIndex:this._features.selectedFeatureIndex})})))}))):Promise.resolve()}_getHeader(){return this.isMobile&&!this._editRecordOpen?e("calcite-panel",{class:"border-width-0",slot:"header"},e("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),e("span",{class:"font-bold",slot:"header-content"},this._mobileTitle)):void 0}_closePopup(){this.popupClosed.emit()}_alertClosed(){this._alertOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){var t,i,e;const s=((null===(t=this._features)||void 0===t?void 0:t.viewModel.selectedFeatureIndex)+1).toString(),a=null===(e=null===(i=this._features)||void 0===i?void 0:i.features)||void 0===e?void 0:e.length.toString();return this._translations.indexOfTotal.replace("{{index}}",s).replace("{{total}}",a)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await x(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],mapView:["mapViewWatchHandler"]}}};S.style=":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node{position:relative !important}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:center;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}.pagination-action{position:relative;left:3px}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand)}";export{q as calcite_alert,H as delete_button,E as edit_card,S as info_card}
@@ -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 i,c as t,h as e,H as s,g as o}from"./p-7d280d8a.js";import{g as h}from"./p-be8ef276.js";import{E as l}from"./p-c1cf3ebc.js";import{g as a}from"./p-d9c89479.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";const d=class{constructor(e){i(this,e),this.infoIconButtonClick=t(this,"infoIconButtonClick",7),this._defaultCenterHonored=!1,this._defaultLevelHonored=!1,this._shouldSetMapView=!1,this.appProxies=void 0,this.basemapConfig=void 0,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.enableAutoRefresh=!1,this.enableBasemap=!0,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableHome=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableZoom=!0,this.hideMapOnLoad=!1,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.popupHeaderColor=void 0,this.popupHeaderHoverColor=void 0,this.popupHeaderHoverTextColor=void 0,this.popupHeaderTextColor=void 0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=!0,this.theme="light",this.zoomAndScrollToSelected=!1,this.zoomToScale=void 0,this._expandPopup=this.hideMapOnLoad,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}enableZoomWatchHandler(){this._initMapZoom()}async featureSelectionChange(i){var t;this._numSelected=null===(t=i.detail)||void 0===t?void 0:t.length}async popupClosed(){this._isMobile&&this.showHideMapPopupAndTable(!1)}async idsFound(i){const t=i.detail;this._tableOnly=t.tableIds.length>0&&0===t.layerIds.length,this._tableOnly&&(this._expandPopup=!0)}async layoutChanged(i){this._layoutMode=i.detail}async mapChanged(i){this._mapChange=i.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0)}async layerSelectionChange(i){const t=i.detail[0],e=await a(this._mapView,t);await e.when((()=>{this._layer=e}))}async mapInfoChange(){this._expandPopup=this.hideMapOnLoad}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return e(s,null,e("calcite-shell",{class:"position-relative"},e("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 i,t,s,o;const h=(null===(i=this._layer)||void 0===i?void 0:i.editingEnabled)&&(null===(o=null===(s=null===(t=this._layer)||void 0===t?void 0:t.capabilities)||void 0===s?void 0:s.operations)||void 0===o?void 0:o.supportsDelete);return this._isMobile&&this._numSelected>0&&!this._hideFooter?e("div",{class:"width-100",slot:"footer"},e("div",{class:"display-flex padding-1-2"},e("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),h?e("delete-button",{class:"padding-inline-start-1 width-full",id:"solutions-delete",ids:this._layerTable.selectedIds,layer:this._layer}):void 0)):void 0}_getDividerIcon(i,t){let e="";switch(i){case l.HORIZONTAL:e=t?"chevrons-up":"chevrons-down";break;case l.VERTICAL:case l.GRID:e=t?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(i,t,e){let s="";switch(i){case l.HORIZONTAL:s=(t&&!e?"height-1-2 display-grid":t&&e?"height-full":"height-0")+" width-full position-relative";break;case l.GRID:s="height-full position-relative "+(t?"width-1-3":"width-0");break;case l.VERTICAL:s="height-full position-relative "+(t?"width-1-2":"width-0")}return s}_getTableSizeClass(i,t){let e="";switch(i){case l.HORIZONTAL:e=(t?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=(t?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(t?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(i,t,s){const o="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return e("calcite-panel",{class:"width-full height-full"},e("div",{class:"width-full height-full overflow-hidden "+(i===l.HORIZONTAL?"":"display-flex")},this._getMapAndCard(i,t,s),this._getTable(i,t,s)),e("div",{class:"floating-container",onClick:this.infoButtonClick.bind(this)},e("calcite-button",{appearance:"solid",class:`floating-button ${o}`,"icon-start":"information-letter",kind:"neutral",label:"",round:!0,scale:"l","split-child":"primary",width:"auto"})))}infoButtonClick(){this.infoIconButtonClick.emit()}_getMapAndCard(i,t,s){const o=this._getMapSizeClass(i,t,s);return e("div",{class:`${o} overflow-hidden`},this._getMapNode(t),this._getPopupExpandNode())}_getMapNode(i){var t;return e("div",{class:(this._layoutMode!==l.HORIZONTAL||this._isMobile&&!i?"adjusted-height-50":"")+" overflow-hidden"},e("map-card",{appProxies:this.appProxies,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&&!this._isMobile,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",mapInfos:null===(t=this.mapInfos)||void 0===t?void 0:t.filter((i=>!1!==i.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"]}))}_getPopupExpandNode(){var i;const t=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",o=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,h="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",l=this._expandPopup?1===(null===(i=this.mapInfos)||void 0===i?void 0:i.length)||this._isMobile?"position-absolute-0":"position-absolute-50":"height-full",a=this._isMobile?"display-none height-0":"";return e("div",{class:`${this._isMobile?"calcite-mode-light":"calcite-mode-dark"} ${l} ${this._isMobile&&this._hideTable?"position-absolute-0 width-full height-full":this._isMobile?"display-none height-0":""}`,style:{"--calcite-color-foreground-1":this.popupHeaderColor,"--calcite-color-foreground-2":this.popupHeaderHoverColor,"--calcite-color-text-3":this.popupHeaderHoverTextColor,"--calcite-color-text-2":this.popupHeaderTextColor}},e("calcite-panel",null,this._isMobile?void 0:e("div",{class:`display-flex align-items-center ${a}`,slot:"header-content"},e("calcite-icon",{icon:"information",scale:"s"}),e("div",{class:"padding-inline-start-75"},this._translations.information)),e("calcite-action",{class:a,disabled:this._tableOnly,icon:t,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),this._tableOnly?void 0:e("calcite-tooltip",{class:h,label:"",placement:"bottom","reference-element":s},e("span",null,o)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup}_getCardNode(){return e("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},e("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(i,t,s){var o,h;const a=s&&this._isMobile?"visibility-hidden":"",d=this._getTableSizeClass(i,t),n=this._getDividerIcon(i,t),r=t?this._translations.close:this._translations.open,c="toggle-layout",p=i===l.HORIZONTAL?"horizontal":"vertical",g=i===l.HORIZONTAL?"header":"panel-start",u=this.defaultWebmap&&this.defaultLayer,b=this.defaultGlobalId?(null===(o=this.defaultGlobalId)||void 0===o?void 0:o.indexOf(","))>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0,f=this.defaultOid?(null===(h=this.defaultOid)||void 0===h?void 0:h.indexOf(","))>-1?this.defaultOid.split(",").map((i=>parseInt(i,10))):[parseInt(this.defaultOid,10)]:void 0;return e("calcite-shell",{class:`${d} ${a} border-bottom`},this._isMobile?void 0:e("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:p,slot:g},e("calcite-action",{class:"toggle-node",icon:n,id:c,onClick:()=>this._toggleLayout(),text:""}),e("calcite-tooltip",{label:r,placement:"bottom","reference-element":c},e("span",null,r))),e("div",{class:"width-full height-full position-relative"},e("layer-table",{defaultGlobalId:u?b:void 0,defaultLayerId:u?this.defaultLayer:"",defaultOid:u&&!b?f: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:i=>this._layerTable=i,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected})))}_onResize(){const i=this.el.offsetWidth<1024,t=!this._isMobile&&i;this._isMobile=i,this._layoutMode=this._isMobile?l.HORIZONTAL:l.GRID,t&&(this._panelOpen=!0)}_toggleLayout(){this._panelOpen=!this._panelOpen}showHideMapPopupAndTable(i){this._expandPopup=!1,this._hideTable=i,this._hideFooter=i}_getMapInfo(i){let t;return this.mapInfos.some((e=>{if(e.id===i)return t=e,!0})),Object.assign({},t)}async _setMapView(){var i;this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1;const t=!this.defaultCenter||this._defaultCenterHonored||null===(i=this.defaultCenter)||void 0===i?void 0:i.split(";").map((i=>parseFloat(i))),e=!this.defaultLevel||this._defaultLevelHonored?void 0:parseInt(this.defaultLevel,10);t&&e&&(await this._mapView.goTo({center:t,zoom:e}),this._defaultCenterHonored=!0,this._defaultLevelHonored=!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 i=await h(this.el);this._translations=i[0]}get el(){return o(this)}static get watchers(){return{enableZoom:["enableZoomWatchHandler"]}}};d.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}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}";export{d as crowdsource_manager}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as i,a as s,h as e,H as a,g as l}from"./p-7d280d8a.js";import{b as o,c as n,a as h}from"./p-c1cf3ebc.js";import{l as c,g as d}from"./p-be8ef276.js";import{d as r,h as p}from"./p-577efb16.js";import{s as g}from"./p-322868ec.js";import{c as b,r as m}from"./p-fca434c8.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-18f1e8b5.js";import"./p-b503d01d.js";import"./p-a230b270.js";import"./p-94c634ba.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._onboardingImageUrl="",this._titleValue=void 0,this._numSelected=0,this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}async mapViewWatchHandler(t){(null==t?void 0:t.popup)&&(this._popupsEnabled=null==t?void 0:t.popup.autoOpenEnabled),this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);this.mapView&&(s!==JSON.stringify(i)||s&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){var s;if(this._checkPopups(),(null===(s=this.mapView)||void 0===s?void 0:s.popup)&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),i===n.EXPORT&&this._removeExportGraphics(),t!==n.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("../assets/data/images/onboarding.png")}render(){return e(a,null,e("calcite-shell",null,e("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async componentDidLoad(){this._initSearchConfiguration(this.searchConfiguration)}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i,s]=await c(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils","esri/Graphic"]);this._geometryEngine=t,this._jsonUtils=i,this.Graphic=s}_initSearchConfiguration(t){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=t,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return e("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},e("div",{class:"background-override"},e("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},e("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},e("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return e("div",{class:"display-flex padding-sides-1"},e("img",{class:"img-container",src:this._onboardingImageUrl}))}_getSelectionSetList(){return e("div",{class:"padding-top-1-2 padding-bottom-1-2"},e("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{var a;const l=this._getSelectionSetIds(i);let o=!0;return i.workflowType===h.REFINE&&(o=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),o&&t.push(e("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(a=null==i?void 0:i.layerView)||void 0===a?void 0:a.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",l.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==h.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===h.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==h.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return e("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),e("div",null,e("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return e("calcite-panel",null,e("div",null,this._getLabel(this._translations.export,!1),t?e("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),e("div",{class:"padding-sides-1 "+i},e("div",{class:"display-flex"},e("calcite-label",{layout:"inline"},e("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),e("div",{class:"display-flex"},this._translations.removeDuplicate,e("div",{class:"info-message padding-start-1-2"},e("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"remove-duplicates-icon",scale:"s"})),e("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},e("span",{class:"tooltip-message"},this._translations.duplicatesTip))),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},e("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},e("span",{class:"font-weight-500"},this._translations.pdf)),e("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},e("span",{class:"font-weight-500"},this._translations.csv)))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},e("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",a=this._addResults?"":"display-none";return e("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),e("div",{class:`padding-top-sides-1 ${a}`},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:`padding-sides-1 ${a}`},e("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:s})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),e("div",{class:`padding-top-sides-1 ${i}`},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"list-graphics-icon",scale:"s"}),e("calcite-popover",{closable:!0,label:"",referenceElement:"list-graphics-icon"},e("span",{class:"tooltip-message"},this._translations.listGraphicsTip))))}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(t){let i;return Object.keys(g.managedLayers).some((s=>{const e=this.mapView.map.layers.findIndex((t=>t.title===s));if(g.managedLayers[s]===t)return i=this.mapView.map.layers.getItemAt(e),!0})),i}_updateExportGraphics(t=!1){!t&&this._exportGraphics&&this._addMap||this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");t&&t.graphics.removeAll(),i&&i.graphics.removeAll()}_addExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");this._selectionSets.forEach((s=>{if(s.download&&(t&&t.graphics.add(s.sketchGraphic),i)){const t=new this.Graphic({geometry:s.buffer,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});i.graphics.add(t)}}))}_getRefinePage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?e("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),e("refine-selection",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,a,l,o){return e("div",{class:"padding-bottom-1"},e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},e("span",{class:"font-weight-500"},t))),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},e("span",{class:"font-weight-500"},a))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{var s;const a=this._getSelectionSetIds(i),l=i.workflowType!==h.REFINE||a.length>0;return!this._downloadActive&&i.download&&l&&(this._downloadActive=!0),l&&t.push(e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),e("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},e("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",a.length.toString()))))))),t}),[])||e("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._updateExportGraphics(!0),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=null==t?void 0:t.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var s;if(i.workflowType===h.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const e=null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.id;t=this._updateExportInfos(t,e,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,a,l=!1,o=""){return e("calcite-action",{disabled:!t,icon:i,indicator:l,onClick:a,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){var t,i;const s=await(null===(t=this._selectTools)||void 0===t?void 0:t.getSelection()),e=null===(i=this._selectTools)||void 0===i?void 0:i.isUpdate;return this._selectionSets=e?this._selectionSets.map((t=>t.id===s.id?s:t)):[...this._selectionSets,s],this._home()}async _clearSelection(){var t;await(null===(t=this._selectTools)||void 0===t?void 0:t.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){r(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===h.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];g.highlightHandles.push(await p(e.ids,e.layerView,this.mapView))}}_checkPopups(){var t;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(t=this.mapView)||void 0===t?void 0:t.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await d(this.el);this._translations=t[0]}get el(){return l(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
6
+ import{r as t,c as i,a as s,h as e,H as a,g as l}from"./p-7d280d8a.js";import{b as o,c as n,a as h}from"./p-c1cf3ebc.js";import{l as c,g as d}from"./p-be8ef276.js";import{d as r,h as p}from"./p-d9c89479.js";import{s as g}from"./p-322868ec.js";import{c as b,r as m}from"./p-b1376c75.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-18f1e8b5.js";import"./p-b503d01d.js";import"./p-a230b270.js";import"./p-94c634ba.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this._onboardingImageUrl="",this._titleValue=void 0,this._numSelected=0,this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}async mapViewWatchHandler(t){(null==t?void 0:t.popup)&&(this._popupsEnabled=null==t?void 0:t.popup.autoOpenEnabled),this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);this.mapView&&(s!==JSON.stringify(i)||s&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){var s;if(this._checkPopups(),(null===(s=this.mapView)||void 0===s?void 0:s.popup)&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),i===n.EXPORT&&this._removeExportGraphics(),t!==n.SELECT)return this._highlightFeatures()}selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("../assets/data/images/onboarding.png")}render(){return e(a,null,e("calcite-shell",null,e("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async componentDidLoad(){this._initSearchConfiguration(this.searchConfiguration)}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i,s]=await c(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils","esri/Graphic"]);this._geometryEngine=t,this._jsonUtils=i,this.Graphic=s}_initSearchConfiguration(t){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=t,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===(null==t?void 0:t.type)?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return e("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},e("div",{class:"background-override"},e("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),e("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},e("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),e("div",{class:"display-flex padding-1"},e("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},e("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return e("div",{class:"display-flex padding-sides-1"},e("img",{class:"img-container",src:this._onboardingImageUrl}))}_getSelectionSetList(){return e("div",{class:"padding-top-1-2 padding-bottom-1-2"},e("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{var a;const l=this._getSelectionSetIds(i);let o=!0;return i.workflowType===h.REFINE&&(o=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),o&&t.push(e("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(a=null==i?void 0:i.layerView)||void 0===a?void 0:a.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",l.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==h.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===h.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==h.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return e("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),e("div",null,e("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return e("calcite-panel",null,e("div",null,this._getLabel(this._translations.export,!1),t?e("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),e("div",{class:"padding-sides-1 "+i},e("div",{class:"display-flex"},e("calcite-label",{layout:"inline"},e("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),e("div",{class:"display-flex"},this._translations.removeDuplicate,e("div",{class:"info-message padding-start-1-2"},e("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"remove-duplicates-icon",scale:"s"})),e("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},e("span",{class:"tooltip-message"},this._translations.duplicatesTip))),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},e("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},e("span",{class:"font-weight-500"},this._translations.pdf)),e("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},e("span",{class:"font-weight-500"},this._translations.csv)))),e("div",{class:"padding-bottom-1"},this._getExportOptions()),e("div",{class:"padding-1 display-flex"},e("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},e("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",a=this._addResults?"":"display-none";return e("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),e("div",{class:`padding-top-sides-1 ${a}`},e("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),e("div",{class:`padding-sides-1 ${a}`},e("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),e("div",{class:t},this._getLabel(this._translations.title,!0,""),e("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:s})),e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),e("div",{class:`padding-top-sides-1 ${i}`},e("calcite-label",{class:"label-margin-0",layout:"inline"},e("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"list-graphics-icon",scale:"s"}),e("calcite-popover",{closable:!0,label:"",referenceElement:"list-graphics-icon"},e("span",{class:"tooltip-message"},this._translations.listGraphicsTip))))}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(t){let i;return Object.keys(g.managedLayers).some((s=>{const e=this.mapView.map.layers.findIndex((t=>t.title===s));if(g.managedLayers[s]===t)return i=this.mapView.map.layers.getItemAt(e),!0})),i}_updateExportGraphics(t=!1){!t&&this._exportGraphics&&this._addMap||this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");t&&t.graphics.removeAll(),i&&i.graphics.removeAll()}_addExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");this._selectionSets.forEach((s=>{if(s.download&&(t&&t.graphics.add(s.sketchGraphic),i)){const t=new this.Graphic({geometry:s.buffer,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});i.graphics.add(t)}}))}_getRefinePage(){const t=this._hasSelections();return e("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?e("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),e("refine-selection",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,a,l,o){return e("div",{class:"padding-bottom-1"},e("div",{class:"display-flex padding-top-sides-1"},e("calcite-button",{disabled:i,onClick:s,width:"full"},e("span",{class:"font-weight-500"},t))),e("div",{class:"display-flex padding-top-1-2 padding-sides-1"},e("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},e("span",{class:"font-weight-500"},a))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return e("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},e("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return e("div",{class:"padding-top-sides-1"},e("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{var s;const a=this._getSelectionSetIds(i),l=i.workflowType!==h.REFINE||a.length>0;return!this._downloadActive&&i.download&&l&&(this._downloadActive=!0),l&&t.push(e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),e("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},e("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},e("div",{slot:"content"},e("div",{class:"list-label"},i.label),e("div",{class:"list-description"},null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.title),e("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",a.length.toString()))))))),t}),[])||e("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._updateExportGraphics(!0),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=null==t?void 0:t.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{var s;if(i.workflowType===h.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const e=null===(s=null==i?void 0:i.layerView)||void 0===s?void 0:s.layer.id;t=this._updateExportInfos(t,e,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,a,l=!1,o=""){return e("calcite-action",{disabled:!t,icon:i,indicator:l,onClick:a,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){var t,i;const s=await(null===(t=this._selectTools)||void 0===t?void 0:t.getSelection()),e=null===(i=this._selectTools)||void 0===i?void 0:i.isUpdate;return this._selectionSets=e?this._selectionSets.map((t=>t.id===s.id?s:t)):[...this._selectionSets,s],this._home()}async _clearSelection(){var t;await(null===(t=this._selectTools)||void 0===t?void 0:t.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){r(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===h.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];g.highlightHandles.push(await p(e.ids,e.layerView,this.mapView))}}_checkPopups(){var t;"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=null===(t=this.mapView)||void 0===t?void 0:t.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await d(this.el);this._translations=t[0]}get el(){return l(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
@@ -3,7 +3,7 @@
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,g as s,c as e,H as a,F as o}from"./p-7d280d8a.js";import{c as n}from"./p-1f65ab1e.js";import{c as h,s as l,a as c}from"./p-a4149333.js";import{a as r}from"./p-3dd92f0d.js";import{c as d,u as p,d as u,I as m}from"./p-6d520a58.js";import{c as g,d as f}from"./p-13f2d901.js";import{c as v,s as y,d as b,u as w}from"./p-05cb50f9.js";import{S as k}from"./p-7d04ff20.js";import{l as x,g as L,f as C}from"./p-be8ef276.js";import{a as S,g as _,b as j,h as F,c as I}from"./p-577efb16.js";import{P as D}from"./p-fb7a5f6e.js";import"./p-5a9a971a.js";import"./p-7c2be8cc.js";import"./p-ba7d55ea.js";import"./p-e7afc0a8.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";
6
+ 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 as n}from"./p-1f65ab1e.js";import{c as h,s as l,a as c}from"./p-a4149333.js";import{a as r}from"./p-3dd92f0d.js";import{c as d,u as p,d as u,I as m}from"./p-6d520a58.js";import{c as g,d as f}from"./p-13f2d901.js";import{c as v,s as y,d as b,u as w}from"./p-05cb50f9.js";import{S as k}from"./p-7d04ff20.js";import{l as x,g as L,f as C}from"./p-be8ef276.js";import{a as S,g as _,b as j,h as F,c as I}from"./p-d9c89479.js";import{P as D}from"./p-fb7a5f6e.js";import"./p-5a9a971a.js";import"./p-7c2be8cc.js";import"./p-ba7d55ea.js";import"./p-e7afc0a8.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as i,h as t,H as s,g as e,c as h}from"./p-7d280d8a.js";import{g as o,l as a}from"./p-be8ef276.js";import{q as l,g as n,d,e as r,f as c,i as v}from"./p-577efb16.js";import{d as p}from"./p-fca434c8.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";import"./p-b503d01d.js";import"./p-a230b270.js";import"./p-94c634ba.js";const u=class{constructor(t){i(this,t),this.isMobile=void 0,this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(i){const t=i.detail;this._cardLoading=!0;const s=t.length>0?await l(t,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=s.sort(((i,s)=>t.indexOf(i.getObjectId())-t.indexOf(s.getObjectId()))),this._cardLoading=!1}async layerSelectionChange(i){const t=i.detail[0];this.layer=await n(this.mapView,t)}async componentWillLoad(){await this._getTranslations()}render(){var i,e;const h=(null===(i=this._graphics)||void 0===i?void 0:i.length)>0?"":"display-none",o=(null===(e=this._graphics)||void 0===e?void 0:e.length)>0?"display-none":"";return t(s,null,t("div",{class:"overflow-auto height-full"},t("calcite-shell",{class:"position-relative "+h},t("div",null,t("info-card",{graphics:this._graphics,isLoading:this._cardLoading,isMobile:this.isMobile,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),t("calcite-shell",{class:"position-relative "+o},t("div",{class:"padding-1"},t("calcite-notice",{icon:"table",open:!0},t("div",{slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const i=await o(this.el);this._translations=i[0]}get el(){return e(this)}};u.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}card-manager{display:block}";const b=class{constructor(t){i(this,t),this.featureSelectionChange=h(this,"featureSelectionChange",7),this._ctrlIsPressed=!1,this._defaultFilterHonored=!1,this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._observerSet=!1,this._shiftIsPressed=!1,this._skipOnChange=!1,this.onTableNodeCreate=i=>{this._tableNode=i},this.defaultGlobalId=void 0,this.defaultLayerId=void 0,this.defaultOid=void 0,this.enableAutoRefresh=void 0,this.enableColumnReorder=!0,this.enableCSV=void 0,this.enableInlineEdit=void 0,this.enableShare=void 0,this.isMobile=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.selectedIds=[],this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this._allIds=[],this._controlsThatFit=void 0,this._csvExporting=!1,this._fetchingData=!1,this._filterActive=!1,this._filterOpen=!1,this._layer=void 0,this._selectAllActive=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=void 0,this._translations=void 0}async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}enableCSVWatchHandler(){var i;(null===(i=this._toolInfos)||void 0===i?void 0:i.length)>0&&this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}enableShareWatchHandler(){this._toolbar&&this._updateToolbar()}_controlsThatFitWatchHandler(){var i;const t=this._controlsThatFit?this._controlsThatFit.reduce(((i,t)=>(i.push(t.id),i)),[]):[];this._toolInfos=null===(i=this._toolInfos)||void 0===i?void 0:i.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}isMobileWatchHandler(){this._toolInfos||this.isMobile||this._initToolInfos()}async mapInfoWatchHandler(){this._resetColumnTemplates(),this._initLayerExpressions(),this._initToolInfos(),this._updateToolbar()}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression=void 0,this._updateShareUrl(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(i=>{this._mapClicked(i)})))}async _layerWatchHandler(){var i;this._fetchingData=!0,await(null===(i=this._layer)||void 0===i?void 0:i.when((async()=>{var i;this._definitionExpression=this._layer.definitionExpression,this._floorField=null===(i=this._layer.floorInfo)||void 0===i?void 0:i.floorField,this._updateFloorDefinitionExpression(),await this._resetTable(),this._initLayerExpressions(),this._updateShareUrl(),this._fetchingData=!1})))}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1)}async selectionChanged(i){const t=i.detail.selectedFeature[0],s=t.getObjectId();if(this.zoomAndScrollToSelected){const i=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(i);const e=t.layer;let h;this.mapView.allLayerViews.toArray().some((i=>{if(i.layer.title===e.title&&"feature"===i.layer.type)return h=i,!0})),h&&await d([s],h,this.mapView,!0)}}async editsComplete(i){const t=i.detail;"delete"!==t&&"add"!==t||(this._allIds=await r(this._layer)),await this._refresh()}async facilityChanged(i){this._floorFacility=i.detail,this._updateFloorDefinitionExpression()}async levelChanged(i){this._floorLevel=i.detail,this._updateFloorDefinitionExpression()}async siteChanged(i){this._floorSite=i.detail,this._updateFloorDefinitionExpression()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver||(this._resizeObserver=new ResizeObserver((()=>this._onResize())))}render(){const i=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",h=this._allIds.length.toString(),o=this.selectedIds.length.toString(),a=this.isMobile?"height-full":"height-full-adjusted";return this._validateActiveActions(),t(s,null,t("calcite-shell",null,this._getTableControlRow("header"),t("div",{class:`width-full ${a}`},t("calcite-panel",{class:"height-full width-full"},t("calcite-loader",{class:e,label:this._translations.fetchingData,scale:"l"}),t("div",{class:i,ref:this.onTableNodeCreate})),this.isMobile?void 0:t("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",h).replace("{{selected}}",o)))),this._filterModal())}async componentDidLoad(){this.isMobile||this._observerSet||(this._resizeObserver.observe(this._toolbar),this._observerSet=!0),document.onclick=i=>this._handleDocumentClick(i),document.onkeydown=i=>this._handleKeyDown(i),document.onkeyup=i=>this._handleKeyUp(i)}componentDidRender(){this._updateToolbar()}async _initModules(){const[i,t,s]=await a(["esri/widgets/FeatureTable","esri/core/reactiveUtils","esri/widgets/FeatureTable/support/TableTemplate"]);this.FeatureTable=i,this.reactiveUtils=t,this.TableTemplate=s}_onResize(){this._updateToolbar()}_getTableControlRow(i){return t("div",{class:"display-flex border-bottom height-51",ref:i=>this._toolbar=i,slot:i},this._getActionBar(),this.isMobile?void 0:this._getDropdown("more-table-options"),this.enableShare&&!this.isMobile?this._getShare("share"):void 0)}_getActionBar(){const i=this.isMobile?"width-full":"",s=this.isMobile?"border-top":"";return t("calcite-action-bar",{class:i,expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},t("div",{class:`border-end ${i} ${s}`,id:"solutions-map-layer-picker-container"},t("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,display:"inline-flex",height:50,isMobile:this.isMobile,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChanged(i)},onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showSingleLayerAsLabel:!0,showTables:!0,type:"dropdown"})),this.isMobile?void 0:this._getActions())}_getActions(){const i=this._getActionItems();return null==i?void 0:i.reduce(((i,s)=>(s&&!s.isOverflow&&i.push(s.isDanger?this._getDangerAction(s.icon,s.label,s.func,s.disabled):s.isSublist?t("calcite-dropdown",{closeOnSelectDisabled:!0,id:this._getId(s.icon),onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._showHideDropdown=i},this._getAction(s.active,this._showHideOpen?"chevron-down":s.icon,s.indicator,s.label,s.func,s.disabled,s.loading,"trigger"),this._showHideOpen?this._getFieldlist():void 0):this._getAction(s.active,s.icon,s.indicator,s.label,s.func,s.disabled,s.loading)),i)),[])}_getFieldlist(){return this._columnsInfo?t("calcite-dropdown-group",{"selection-mode":"multiple"},Object.keys(this._columnsInfo).map((i=>t("calcite-dropdown-item",{id:i,onClick:i=>{const t=i.target;this._columnsInfo[t.id]=t.selected,t.selected?this._table.showColumn(t.id):this._table.hideColumn(t.id)},selected:this._columnsInfo[i]},i)))):void 0}_validateEnabledActions(){var i;const t=this._featuresSelected(),s=["zoom-to-object","trash","erase","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&s.indexOf(i.icon)>-1&&(i.disabled=!t)}))}_validateActiveActions(){var i;const t=["filter","list-check-all","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&t.indexOf(i.icon)>-1&&("filter"===i.icon&&(i.indicator=this._filterActive),"list-check-all"===i.icon&&(i.active=this._selectAllActive),"selected-items-filter"===i.icon&&(i.active=this._showOnlySelected))}))}_initToolInfos(){const i=this._featuresSelected(),t=this._featuresEmpty(),s=this._hasFilterExpressions();this._translations&&(this._toolInfos=[{active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!i,isOverflow:!1},s?{active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this._toggleFilter(),disabled:!1,isOverflow:!1}:void 0,this._deleteEnabled?{active:void 0,icon:"trash",indicator:void 0,label:void 0,func:void 0,disabled:!i,isDanger:!0,isOverflow:!1}:void 0,{active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!i,isOverflow:!1},{active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!i,isOverflow:!1},{active:!1,icon:"list-check-all",indicator:!1,func:()=>this._selectAll(),label:this._translations.selectAll,disabled:t,isOverflow:!1},{active:!1,icon:"compare",indicator:!1,func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:t,isOverflow:!1},{active:!1,icon:"refresh",indicator:!1,func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:t,isOverflow:!1}:void 0,{active:!1,icon:this._showHideOpen?"chevron-down":"chevron-right",indicator:!1,func:()=>this._toggleShowHide(),label:this._translations.showHideColumns,disabled:!1,isOverflow:!1,isSublist:!0}],this._defaultVisibleToolSizeInfos=void 0)}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){const i=`${this._floorField} = '${this._floorLevel}'`,t=this._layer.definitionExpression;this._layer.definitionExpression=(null==t?void 0:t.indexOf(this._floorExpression))>-1?t.replace(this._floorExpression,i):t?`${t} AND (${i})`:i,this._floorExpression=i}}_featuresSelected(){return this.selectedIds.length>0}_featuresEmpty(){return 0===this._allIds.length}_hasFilterExpressions(){var i,t,s;let e;return(null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions)&&(null===(s=this._layer)||void 0===s?void 0:s.id)&&(e=this.mapInfo.filterConfig.layerExpressions.filter((i=>i.id===this._layer.id))),(null==e?void 0:e.length)>0}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),!this.isMobile&&this._toolbar&&this._toolInfos&&(this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const i=this._toolbar.offsetWidth;let t=this._toolbarSizeInfos.reduce(((i,t)=>i+t.width),0);const s=["solutions-more","solutions-map-layer-picker-container","solutions-action-share"];if(t>i){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,h)=>(s.indexOf(h.id)<0&&(t>i?t-=h.width:e.push(h)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((i,t)=>(i.push(t.id),i)),[]);let h=!1;const o=[...this._defaultVisibleToolSizeInfos].reduce(((o,a)=>(!h&&s.indexOf(a.id)<0&&(e.indexOf(a.id)>-1||t+a.width<=i)?(e.indexOf(a.id)<0&&(t+=a.width),o.push(a)):s.indexOf(a.id)<0&&t+a.width>i&&(h=!0),o)),[]);this._setControlsThatFit(o,s)}}),250))}_setControlsThatFit(i,t){let s=JSON.stringify(i)!==JSON.stringify(this._controlsThatFit);document.getElementById("solutions-action-bar").childNodes.forEach((i=>{t.indexOf(i.id)<0&&!s&&(s=this._controlsThatFit.map((i=>i.id)).indexOf(i.id)<0)})),s&&(this._controlsThatFit=[...i])}_setToolbarSizeInfos(){let i=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((t,s)=>{0===s?t.childNodes.forEach((t=>{this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0)})):t.referenceElement||(this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0))})),i&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&!i.isOverflow))}_getDropdown(i){const s=this._getDropdownItems();return s.length>0?t("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this._layer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._moreDropdown=i},t("calcite-action",{appearance:"solid",id:i,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},t("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),t("calcite-dropdown-group",{"selection-mode":"none"},s.map((i=>t("calcite-dropdown-group",{class:i.disabled?"disabled":"",selectionMode:i.disabled?"none":"single"},t("calcite-dropdown-item",{disabled:i.loading,iconStart:i.isSublist&&this._showHideOpen?"chevron-down":i.loading?"":i.icon,id:"solutions-subset-list",onClick:i.func},i.loading?t("div",{class:"display-flex"},t("calcite-loader",{inline:!0,label:i.label,scale:"m"}),i.label):i.label))))),this._showHideOpen?this._getFieldlist():void 0):void 0}_getDropdownItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&i.isOverflow))}_getAction(i,s,e,h,o,a,l,n){const d=void 0===this._layer||a;return t("div",{class:"display-flex",id:this._getId(s),slot:n},t("calcite-action",{active:i,appearance:"solid",disabled:d,icon:s,id:s,indicator:e,label:h,loading:l,onClick:o,text:h,textEnabled:!0}),this._getToolTip("bottom",s,h))}_getShare(i){return t("div",{class:"share-action",id:this._getId(i)},t("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"instant-app-share",embed:this.shareIncludeEmbed,popoverButtonIconScale:"s",ref:i=>this._shareNode=i,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",socialMedia:this.shareIncludeSocial,view:this.mapView}),this._getToolTip("bottom",i,this._translations.share))}_updateShareUrl(){var i,t,s,e;const h=null===(i=this._shareNode)||void 0===i?void 0:i.shareUrl;if(!h)return;const o=new URL(h);(null===(t=this.mapInfo)||void 0===t?void 0:t.id)?o.searchParams.set("webmap",this.mapInfo.id):o.searchParams.delete("webmap"),(null===(s=this._layer)||void 0===s?void 0:s.id)?o.searchParams.set("layer",this._layer.id):o.searchParams.delete("layer"),(null===(e=this.selectedIds)||void 0===e?void 0:e.length)>0?o.searchParams.set("oid",this.selectedIds.join(",")):o.searchParams.delete("oid"),this._shareNode.shareUrl=o.href}_getToolTip(i,s,e){return document.getElementById(s)?t("calcite-tooltip",{placement:i,"reference-element":s},t("span",null,e)):void 0}_getId(i){return`solutions-action-${i}`}_getDangerAction(i,s,e,h){const o=void 0===this._layer||h;return t("div",{class:"display-flex",id:this._getId(i)},"trash"===i?t("delete-button",{buttonType:"action",class:"display-flex",disabled:o,icon:i,ids:this._getIds(),layer:this._layer}):t("calcite-action",{appearance:"solid",disabled:o,id:i,onClick:e,text:""},t("calcite-button",{appearance:"transparent",iconStart:i,kind:"danger"},s)),this._getToolTip("bottom",i,s))}_getIds(){return this._table.highlightIds.toArray()}async _getTable(i,t){this._layer&&(await this._layer.when((()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:t},container:i})})),await this._table.when((()=>{this._table.highlightIds.on("change",(i=>{this._handleOnChange(i)}))})))}async _handleOnChange(i){const t=[...this._table.highlightIds.toArray()];if(this._skipOnChange)this._skipOnChange=!1;else{if(this._ctrlIsPressed||this._shiftIsPressed){if(this._ctrlIsPressed)this.selectedIds=t.reverse();else if(this._shiftIsPressed&&(this._skipOnChange=!0,this._previousCurrentId=this._currentId,this._currentId=[...this._table.highlightIds.toArray()].reverse()[0],this._previousCurrentId!==this._currentId)){const i=this._table.activeSortOrders.reduce(((i,t)=>(i.push(`${t.fieldName} ${t.direction}`),i)),[]),s=await c(this._layer,this._layer.definitionExpression,i);let e=!1;const h=this._table.viewModel.getObjectIdIndex(this._previousCurrentId),o=this._table.viewModel.getObjectIdIndex(this._currentId),a=h<o?h:o,l=o>h?o:h;this._skipOnChange=a+1!==l;const n=s.reduce(((i,t)=>{const s=t,h=this._table.viewModel.getObjectIdIndex(s);return s!==this._currentId&&s!==this._previousCurrentId||(e=!e,i.indexOf(s)<0&&i.push(s)),e&&i.indexOf(s)<0&&i.push(s),(this.selectedIds.indexOf(s)>-1||h>=a&&h<=l)&&i.indexOf(s)<0&&h>-1&&i.push(s),i}),[]);this.selectedIds=h<o?n.reverse():n,this._table.highlightIds.addMany(this.selectedIds.filter((i=>t.indexOf(i)<0)))}}else if(this.selectedIds.length>0){this._skipOnChange=!0;const s=this.selectedIds.length>1&&1===i.removed.length?i.removed:t.filter((i=>this.selectedIds.indexOf(i)<0));this._clearSelection(),this.selectedIds=[...s],s.length>0?this._table.highlightIds.add(s[0]):this._skipOnChange=!1}else this.selectedIds=t.reverse();this._finishOnChange()}this._currentId=[...this._table.highlightIds.toArray()].reverse()[0]}_finishOnChange(){this._showOnlySelected&&(this._featuresSelected()?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this.selectedIds)}_resetColumnTemplates(){var i,t;const s=this._getColumnTemplates(null===(i=this._layer)||void 0===i?void 0:i.id,null===(t=this._layer)||void 0===t?void 0:t.fields),e=null==s?void 0:s.some(((i,t)=>{var s;return JSON.stringify(null===(s=this._table)||void 0===s?void 0:s.tableTemplate.columnTemplates[t])!==JSON.stringify(i)}));if(this._table&&s&&(e||!this._columnsInfo)){this._table.tableTemplate=new this.TableTemplate({columnTemplates:s});const i=s.map((i=>i.fieldName));this._initColumnsInfo(i)}}async _resetTable(){var i;if(this._clearSelection(),this._allIds=await r(this._layer),this._table)this._table.view=this.mapView,this._table.layer=this._layer;else{const t=this._getColumnTemplates(this._layer.id,null===(i=this._layer)||void 0===i?void 0:i.fields);await this._getTable(this._tableNode,t)}await this._initLayerRefresh(),this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,await this.reactiveUtils.once((()=>"loaded"===this._table.state)).then((async()=>{this._table.highlightIds.removeAll(),this._table.clearSelectionFilter(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),this._initToolInfos(),this._updateToolbar()}))}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._refreshHandle=this._layer.on("refresh",(i=>{i.dataChanged&&(this._skipOnChange=!0,this._updateAllIds())}))}async _updateAllIds(){this._allIds=await r(this._layer),this.selectedIds=this.selectedIds.filter((i=>this._allIds.indexOf(i)>-1)),await this._refresh()}async _handleDefaults(){var i,t;if(!this._defaultOidHonored&&(null===(i=this.defaultOid)||void 0===i?void 0:i.length)>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=void 0,this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&(null===(t=this.defaultGlobalId)||void 0===t?void 0:t.length)>0&&this._table){const i=await v(this.defaultGlobalId,this._layer),t=(null==i?void 0:i.length)>0?i.map((i=>i.getObjectId())):void 0;t&&await this._selectDefaultFeature(t),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=void 0,this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(i){var t,s;const e=null===(t=this._table)||void 0===t?void 0:t.columns.reduce(((t,s)=>((!i||(null==i?void 0:i.indexOf(s.name))>-1)&&(t[s.name]=!s.hidden),t)),{}),h=null===(s=this._table)||void 0===s?void 0:s.columns.map((i=>i.name));(i?i.filter((i=>h.indexOf(i)<0)):[]).forEach((i=>{e[i]=!0})),this._columnsInfo=i?i.reduce(((i,t)=>(i[t]=e[t],i)),{}):e}async _selectDefaultFeature(i){i.length>0&&this._table.highlightIds.addMany(i)}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){this._table&&this._layer&&this.showNewestFirst&&(await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(this._layer.objectIdField,"desc")})))}_forceShowHide(){this._showHideDropdown&&(this._showHideDropdown.open=this._showHideOpen),this._moreDropdown&&(this._moreDropdown.open=this._showHideOpen)}_toggleShowHide(){this._showHideOpen=!this._showHideOpen}_closeShowHide(){this._showHideOpen=!1}_handleDocumentClick(i){var t;const s=null===(t=i.target)||void 0===t?void 0:t.id;this._showHideOpen&&Object.keys(this._columnsInfo).indexOf(s)<0&&"solutions-subset-list"!==s&&"chevron-right"!==s&&(this._closeShowHide(),this._moreDropdown&&(this._moreDropdown.open=!1),this._showHideDropdown&&(this._showHideDropdown.open=!1))}_handleKeyDown(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_handleKeyUp(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_filterModal(){var i,s,e;return t("calcite-modal",{"aria-labelledby":"modal-title",class:"modal",kind:"brand",onCalciteModalClose:()=>{this._closeFilter()},open:this._filterOpen,widthScale:"s"},t("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},null===(s=null===(i=this._translations)||void 0===i?void 0:i.filter)||void 0===s?void 0:s.replace("{{title}}",null===(e=this._layer)||void 0===e?void 0:e.title)),t("div",{slot:"content"},t("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:async()=>this._closeFilter(),comboboxOverlayPositioning:"fixed",layerExpressions:this._layerExpressions,onFilterListReset:()=>this._handleFilterListReset(),onFilterUpdate:()=>this._handleFilterUpdate(),ref:i=>this._filterList=i,view:this.mapView,zoomBtn:!1})))}_handleFilterListReset(){this._filterActive=!1,this._updateShareUrl()}_handleFilterUpdate(){const i=this._layer.definitionExpression;if(this._floorExpression){const t=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=i&&this._floorField&&i.indexOf(`${this._floorField} = '`)>-1?i.replace(t,this._floorExpression):i?`${i} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=this._definitionExpression!==this._layer.definitionExpression&&(!this._floorExpression||this._layer.definitionExpression!==this._floorExpression),this._updateShareUrl()}async _closeFilter(){this._filterOpen&&(this._allIds=await r(this._layer),this._filterOpen=!1)}async _mapClicked(i){const t={include:this._layer},s=await this.mapView.hitTest(i.screenPoint,t);s.results.length>0?(s.results.forEach((i=>{const t=i.graphic.getObjectId();this._table.highlightIds.indexOf(t)<0&&this._table.highlightIds.add(t)})),this._showOnlySelected&&this._table.filterBySelection()):this._clearSelection()}_selectAll(){const i=this._allIds;this._table.highlightIds.removeAll(),this._skipOnChange=!0,this._table.highlightIds.addMany(i),this.selectedIds=i,this._finishOnChange(),this._selectAllActive=!0}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){var i;this.selectedIds=[],null===(i=this._table)||void 0===i||i.highlightIds.removeAll(),this._finishOnChange()}_toggleFilter(){this._filterOpen=!this._filterOpen}_initLayerExpressions(){var i,t;const s=null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions;this._layerExpressions=s?s.filter((i=>{var t;return i.id===(null===(t=this._layer)||void 0===t?void 0:t.id)})):[],this._filterList.layerExpressions=this._layerExpressions,this._filterActive=this._layerExpressions.filter((i=>i.expressions.filter((i=>i.active)).length>0)).length>0}_switchSelected(){const i=[...this.selectedIds];this._table.highlightIds.removeAll();const t=this._allIds.reduce(((t,s)=>(i.indexOf(s)<0&&t.push(s),t)),[]).sort(((i,t)=>i-t));this._skipOnChange=!0,this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange()}async _exportToCSV(){const i={},t=this._table.highlightIds.toArray();i[this._layer.id]={selectionSetNames:[this._layer.title],ids:t,layer:this._layer};const s=this._table.columns.toArray().reduce(((i,t)=>(t.hidden||i.push(t.name.toLocaleLowerCase()),i)),[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,await p(null,i,!1,!1,!0,s,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}_updateToolInfoLoading(i,t){this._toolInfos.some((s=>{if((null==s?void 0:s.icon)===i)return s.loading=t,!0}))}async _refresh(){await this._table.refresh(),this.featureSelectionChange.emit(this.selectedIds)}_zoom(){this._table.zoomToSelection()}async _layerSelectionChanged(i){var t;const s=i.detail[0];if(s!==(null===(t=this._layer)||void 0===t?void 0:t.id)||this._featuresEmpty()){this._fetchingData=!0;const i=await n(this.mapView,s);await i.when((()=>{this._layer=i}))}this._fetchingData=!1}_getColumnTemplates(i,t){var s,e;let h;null===(e=null===(s=this.mapInfo)||void 0===s?void 0:s.layerOptions)||void 0===e||e.layers.some((t=>{if(t.id===i)return h=t,!0}));const o=(null==h?void 0:h.fields)&&(null==h?void 0:h.fieldOrder)?h.fieldOrder.filter((i=>h.fields.indexOf(i)>-1)):void 0;let a;return t&&(a=h&&(null==h?void 0:h.fields)?t.reduce(((i,t)=>{if(h.fields.indexOf(t.name)>-1){const s={type:"field",fieldName:t.name,label:t.alias,menuConfig:this._getMenuConfig(t.name)};i.push(s)}return i}),[]).sort(this._sortFields.bind(this,null==h?void 0:h.fieldOrder)):t.map((i=>({type:"field",fieldName:i.name,label:i.alias,menuConfig:this._getMenuConfig(i.name)})))),o?null==a?void 0:a.sort(this._sortFields.bind(this,o)):a}_sortFields(i,t,s){return(null==i?void 0:i.indexOf(t.fieldName))-i.indexOf(s.fieldName)}_getMenuConfig(i){return{items:[{label:this._translations.hideField,iconClass:"esri-icon-non-visible",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(i)}}]}}_handleHideClick(i){this._columnsInfo[i]=!1,this._table.hideColumn(i),this._table.tableTemplate.columnTemplates.forEach((t=>{t.fieldName===i&&(t.visible=!1)}))}async _getTranslations(){const i=await o(this.el);this._translations=i[0]}get el(){return e(this)}static get watchers(){return{defaultOid:["defaultOidWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],enableCSV:["enableCSVWatchHandler"],enableInlineEdit:["enableInlineEditWatchHandler"],enableShare:["enableShareWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"],isMobile:["isMobileWatchHandler"],mapInfo:["mapInfoWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],selectedIds:["selectedIdsWatchHandler"]}}};b.style=':host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{font-size:14px !important;color:var(--calcite-color-text-3) !important}.share-action{position:absolute;right:0}html[dir="rtl"] .share-action{left:0}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.instant-app-share{height:50px !important;display:inline-flex}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-modal-content-padding:0}';const m=class{constructor(t){i(this,t),this.mapChanged=h(this,"mapChanged",7),this.beforeMapChanged=h(this,"beforeMapChanged",7),this._defaultWebmapHonored=!1,this._loadedId="",this.appProxies=void 0,this.defaultWebmapId="",this.enableHome=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSingleExpand=!0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.homeZoomIndex=3,this.homeZoomPosition="top-left",this.homeZoomToolsSize="m",this.mapInfos=[],this.mapWidgetsIndex=0,this.mapWidgetsPosition="top-right",this.mapWidgetsSize="m",this.mapView=void 0,this.stackTools=!0,this.theme=void 0,this.toolOrder=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}enableHomeWatchHandler(){this._initHome()}async mapInfoChange(i){await this._loadMap(i.detail)}async componentWillLoad(){await this._initModules()}render(){var i,e;const h=this.hidden?"visibility-hidden-1":"",o="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",a=(null===(i=this.mapInfos)||void 0===i?void 0:i.length)>1?"":"display-none",l=(null===(e=this.mapInfos)||void 0===e?void 0:e.length)>1?"map-height":"height-full";return t(s,null,t("map-picker",{class:a,mapInfos:this.mapInfos,ref:i=>this._mapPicker=i}),t("div",{class:`${l} ${h}`,ref:i=>this._mapDiv=i}),t("map-tools",{basemapConfig:this.basemapConfig,class:`box-shadow ${o}`,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:this.enableSingleExpand,homeZoomToolsSize:this.homeZoomToolsSize,mapView:this.mapView,mapWidgetsSize:this.mapWidgetsSize,position:this.mapWidgetsPosition,ref:i=>this._mapTools=i,searchConfiguration:this._searchConfiguration,stackTools:this.stackTools,toolOrder:this.toolOrder}))}async _initModules(){const[i,t,s,e]=await a(["esri/WebMap","esri/views/MapView","esri/widgets/Home","esri/config"]);this.WebMap=i,this.MapView=t,this.Home=s,this.esriConfig=e}async _loadMap(i){var t;const s=!this._defaultWebmapHonored&&this.defaultWebmapId,e=null===(t=this.mapInfos)||void 0===t?void 0:t.filter((i=>i.id===this.defaultWebmapId)),h=JSON.stringify(i)!==JSON.stringify(this._webMapInfo);this._webMapInfo=s&&e?e[0]:!(null==i?void 0:i.id)&&this.mapInfos.length>0?this.mapInfos[0]:i;const o=this._webMapInfo.id,a=s&&(null==i?void 0:i.id)===this.defaultWebmapId;if(this._loadedId!==o&&!s||a){const i=new this.WebMap({portalItem:{id:o}});this.appProxies&&(await i.load(),await(l=i,n=this.esriConfig,d=this.appProxies,d&&d.forEach((i=>{l.allLayers.forEach((t=>{t&&t.url===i.sourceUrl&&(t.url=i.proxyUrl,t.portalItem&&t.portalItem.when((()=>{t.portalItem.url=i.proxyUrl})),n.request?.interceptors?.push({urls:i.sourceUrl,before:t=>{t.url&&t.url===i.sourceUrl&&(t.url=i.proxyUrl)}}))}))})),l)),this.mapView=new this.MapView({container:this._mapDiv,map:i,resizeAlign:"center"}),this._loadedId=o,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{this._initHome(),this.mapView.ui.add(this._mapTools,{position:this.mapWidgetsPosition,index:this.mapWidgetsIndex}),this._defaultWebmapHonored=!!a||this._defaultWebmapHonored,this.mapChanged.emit({id:o,mapView:this.mapView})}))}else s?(this._defaultWebmapHonored=!0,this._mapPicker.setMapByID(o)):h&&(this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),this.mapChanged.emit({id:o,mapView:this.mapView}));var l,n,d}_initHome(){if(this.enableHome){this._homeWidget=new this.Home({view:this.mapView}),this.mapView.ui.add(this._homeWidget,{position:this.homeZoomPosition,index:this.homeZoomIndex});const i="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";this._homeWidget.domNode.style.height=i,this._homeWidget.domNode.style.width=i}else this._homeWidget&&this.mapView.ui.remove(this._homeWidget)}get el(){return e(this)}static get watchers(){return{enableHome:["enableHomeWatchHandler"]}}};m.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.box-shadow{box-shadow:none !important}.visibility-hidden-1{visibility:hidden;height:1px;}.display-none{display:none}";export{u as card_manager,b as layer_table,m as map_card}
6
+ import{r as i,h as t,H as s,g as e,c as h}from"./p-7d280d8a.js";import{g as o,l as a}from"./p-be8ef276.js";import{q as l,g as n,d,e as r,f as c,i as v}from"./p-d9c89479.js";import{d as p}from"./p-b1376c75.js";import"./p-8ddc7786.js";import"./p-e2d0ad1b.js";import"./p-c1cf3ebc.js";import"./p-b503d01d.js";import"./p-a230b270.js";import"./p-94c634ba.js";const u=class{constructor(t){i(this,t),this.isMobile=void 0,this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(i){const t=i.detail;this._cardLoading=!0;const s=t.length>0?await l(t,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=s.sort(((i,s)=>t.indexOf(i.getObjectId())-t.indexOf(s.getObjectId()))),this._cardLoading=!1}async layerSelectionChange(i){const t=i.detail[0];this.layer=await n(this.mapView,t)}async componentWillLoad(){await this._getTranslations()}render(){var i,e;const h=(null===(i=this._graphics)||void 0===i?void 0:i.length)>0?"":"display-none",o=(null===(e=this._graphics)||void 0===e?void 0:e.length)>0?"display-none":"";return t(s,null,t("div",{class:"overflow-auto height-full"},t("calcite-shell",{class:"position-relative "+h},t("div",null,t("info-card",{graphics:this._graphics,isLoading:this._cardLoading,isMobile:this.isMobile,mapView:this.mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))),t("calcite-shell",{class:"position-relative "+o},t("div",{class:"padding-1"},t("calcite-notice",{icon:"table",open:!0},t("div",{slot:"message"},this._translations.selectFeaturesToStart))))))}async _getTranslations(){const i=await o(this.el);this._translations=i[0]}get el(){return e(this)}};u.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}card-manager{display:block}";const b=class{constructor(t){i(this,t),this.featureSelectionChange=h(this,"featureSelectionChange",7),this._ctrlIsPressed=!1,this._defaultFilterHonored=!1,this._defaultGlobalIdHonored=!1,this._defaultOidHonored=!1,this._observerSet=!1,this._shiftIsPressed=!1,this._skipOnChange=!1,this.onTableNodeCreate=i=>{this._tableNode=i},this.defaultGlobalId=void 0,this.defaultLayerId=void 0,this.defaultOid=void 0,this.enableAutoRefresh=void 0,this.enableColumnReorder=!0,this.enableCSV=void 0,this.enableInlineEdit=void 0,this.enableShare=void 0,this.isMobile=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.selectedIds=[],this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this._allIds=[],this._controlsThatFit=void 0,this._csvExporting=!1,this._fetchingData=!1,this._filterActive=!1,this._filterOpen=!1,this._layer=void 0,this._selectAllActive=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=void 0,this._translations=void 0}async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}enableCSVWatchHandler(){var i;(null===(i=this._toolInfos)||void 0===i?void 0:i.length)>0&&this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}enableShareWatchHandler(){this._toolbar&&this._updateToolbar()}_controlsThatFitWatchHandler(){var i;const t=this._controlsThatFit?this._controlsThatFit.reduce(((i,t)=>(i.push(t.id),i)),[]):[];this._toolInfos=null===(i=this._toolInfos)||void 0===i?void 0:i.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}isMobileWatchHandler(){this._toolInfos||this.isMobile||this._initToolInfos()}async mapInfoWatchHandler(){this._resetColumnTemplates(),this._initLayerExpressions(),this._initToolInfos(),this._updateToolbar()}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression=void 0,this._updateShareUrl(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(i=>{this._mapClicked(i)})))}async _layerWatchHandler(){var i;this._fetchingData=!0,await(null===(i=this._layer)||void 0===i?void 0:i.when((async()=>{var i;this._definitionExpression=this._layer.definitionExpression,this._floorField=null===(i=this._layer.floorInfo)||void 0===i?void 0:i.floorField,this._updateFloorDefinitionExpression(),await this._resetTable(),this._initLayerExpressions(),this._updateShareUrl(),this._fetchingData=!1})))}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1)}async selectionChanged(i){const t=i.detail.selectedFeature[0],s=t.getObjectId();if(this.zoomAndScrollToSelected){const i=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(i);const e=t.layer;let h;this.mapView.allLayerViews.toArray().some((i=>{if(i.layer.title===e.title&&"feature"===i.layer.type)return h=i,!0})),h&&await d([s],h,this.mapView,!0)}}async editsComplete(i){const t=i.detail;"delete"!==t&&"add"!==t||(this._allIds=await r(this._layer)),await this._refresh()}async facilityChanged(i){this._floorFacility=i.detail,this._updateFloorDefinitionExpression()}async levelChanged(i){this._floorLevel=i.detail,this._updateFloorDefinitionExpression()}async siteChanged(i){this._floorSite=i.detail,this._updateFloorDefinitionExpression()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver||(this._resizeObserver=new ResizeObserver((()=>this._onResize())))}render(){const i=this._fetchingData?"display-none":"",e=this._fetchingData?"":"display-none",h=this._allIds.length.toString(),o=this.selectedIds.length.toString(),a=this.isMobile?"height-full":"height-full-adjusted";return this._validateActiveActions(),t(s,null,t("calcite-shell",null,this._getTableControlRow("header"),t("div",{class:`width-full ${a}`},t("calcite-panel",{class:"height-full width-full"},t("calcite-loader",{class:e,label:this._translations.fetchingData,scale:"l"}),t("div",{class:i,ref:this.onTableNodeCreate})),this.isMobile?void 0:t("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",h).replace("{{selected}}",o)))),this._filterModal())}async componentDidLoad(){this.isMobile||this._observerSet||(this._resizeObserver.observe(this._toolbar),this._observerSet=!0),document.onclick=i=>this._handleDocumentClick(i),document.onkeydown=i=>this._handleKeyDown(i),document.onkeyup=i=>this._handleKeyUp(i)}componentDidRender(){this._updateToolbar()}async _initModules(){const[i,t,s]=await a(["esri/widgets/FeatureTable","esri/core/reactiveUtils","esri/widgets/FeatureTable/support/TableTemplate"]);this.FeatureTable=i,this.reactiveUtils=t,this.TableTemplate=s}_onResize(){this._updateToolbar()}_getTableControlRow(i){return t("div",{class:"display-flex border-bottom height-51",ref:i=>this._toolbar=i,slot:i},this._getActionBar(),this.isMobile?void 0:this._getDropdown("more-table-options"),this.enableShare&&!this.isMobile?this._getShare("share"):void 0)}_getActionBar(){const i=this.isMobile?"width-full":"",s=this.isMobile?"border-top":"";return t("calcite-action-bar",{class:i,expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},t("div",{class:`border-end ${i} ${s}`,id:"solutions-map-layer-picker-container"},t("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,display:"inline-flex",height:50,isMobile:this.isMobile,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChanged(i)},onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",showSingleLayerAsLabel:!0,showTables:!0,type:"dropdown"})),this.isMobile?void 0:this._getActions())}_getActions(){const i=this._getActionItems();return null==i?void 0:i.reduce(((i,s)=>(s&&!s.isOverflow&&i.push(s.isDanger?this._getDangerAction(s.icon,s.label,s.func,s.disabled):s.isSublist?t("calcite-dropdown",{closeOnSelectDisabled:!0,id:this._getId(s.icon),onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._showHideDropdown=i},this._getAction(s.active,this._showHideOpen?"chevron-down":s.icon,s.indicator,s.label,s.func,s.disabled,s.loading,"trigger"),this._showHideOpen?this._getFieldlist():void 0):this._getAction(s.active,s.icon,s.indicator,s.label,s.func,s.disabled,s.loading)),i)),[])}_getFieldlist(){return this._columnsInfo?t("calcite-dropdown-group",{"selection-mode":"multiple"},Object.keys(this._columnsInfo).map((i=>t("calcite-dropdown-item",{id:i,onClick:i=>{const t=i.target;this._columnsInfo[t.id]=t.selected,t.selected?this._table.showColumn(t.id):this._table.hideColumn(t.id)},selected:this._columnsInfo[i]},i)))):void 0}_validateEnabledActions(){var i;const t=this._featuresSelected(),s=["zoom-to-object","trash","erase","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&s.indexOf(i.icon)>-1&&(i.disabled=!t)}))}_validateActiveActions(){var i;const t=["filter","list-check-all","selected-items-filter"];null===(i=this._toolInfos)||void 0===i||i.forEach((i=>{i&&t.indexOf(i.icon)>-1&&("filter"===i.icon&&(i.indicator=this._filterActive),"list-check-all"===i.icon&&(i.active=this._selectAllActive),"selected-items-filter"===i.icon&&(i.active=this._showOnlySelected))}))}_initToolInfos(){const i=this._featuresSelected(),t=this._featuresEmpty(),s=this._hasFilterExpressions();this._translations&&(this._toolInfos=[{active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!i,isOverflow:!1},s?{active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this._toggleFilter(),disabled:!1,isOverflow:!1}:void 0,this._deleteEnabled?{active:void 0,icon:"trash",indicator:void 0,label:void 0,func:void 0,disabled:!i,isDanger:!0,isOverflow:!1}:void 0,{active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!i,isOverflow:!1},{active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!i,isOverflow:!1},{active:!1,icon:"list-check-all",indicator:!1,func:()=>this._selectAll(),label:this._translations.selectAll,disabled:t,isOverflow:!1},{active:!1,icon:"compare",indicator:!1,func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:t,isOverflow:!1},{active:!1,icon:"refresh",indicator:!1,func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:t,isOverflow:!1}:void 0,{active:!1,icon:this._showHideOpen?"chevron-down":"chevron-right",indicator:!1,func:()=>this._toggleShowHide(),label:this._translations.showHideColumns,disabled:!1,isOverflow:!1,isSublist:!0}],this._defaultVisibleToolSizeInfos=void 0)}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){const i=`${this._floorField} = '${this._floorLevel}'`,t=this._layer.definitionExpression;this._layer.definitionExpression=(null==t?void 0:t.indexOf(this._floorExpression))>-1?t.replace(this._floorExpression,i):t?`${t} AND (${i})`:i,this._floorExpression=i}}_featuresSelected(){return this.selectedIds.length>0}_featuresEmpty(){return 0===this._allIds.length}_hasFilterExpressions(){var i,t,s;let e;return(null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions)&&(null===(s=this._layer)||void 0===s?void 0:s.id)&&(e=this.mapInfo.filterConfig.layerExpressions.filter((i=>i.id===this._layer.id))),(null==e?void 0:e.length)>0}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),!this.isMobile&&this._toolbar&&this._toolInfos&&(this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const i=this._toolbar.offsetWidth;let t=this._toolbarSizeInfos.reduce(((i,t)=>i+t.width),0);const s=["solutions-more","solutions-map-layer-picker-container","solutions-action-share"];if(t>i){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,h)=>(s.indexOf(h.id)<0&&(t>i?t-=h.width:e.push(h)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((i,t)=>(i.push(t.id),i)),[]);let h=!1;const o=[...this._defaultVisibleToolSizeInfos].reduce(((o,a)=>(!h&&s.indexOf(a.id)<0&&(e.indexOf(a.id)>-1||t+a.width<=i)?(e.indexOf(a.id)<0&&(t+=a.width),o.push(a)):s.indexOf(a.id)<0&&t+a.width>i&&(h=!0),o)),[]);this._setControlsThatFit(o,s)}}),250))}_setControlsThatFit(i,t){let s=JSON.stringify(i)!==JSON.stringify(this._controlsThatFit);document.getElementById("solutions-action-bar").childNodes.forEach((i=>{t.indexOf(i.id)<0&&!s&&(s=this._controlsThatFit.map((i=>i.id)).indexOf(i.id)<0)})),s&&(this._controlsThatFit=[...i])}_setToolbarSizeInfos(){let i=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((t,s)=>{0===s?t.childNodes.forEach((t=>{this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0)})):t.referenceElement||(this._toolbarSizeInfos.push({id:t.id,width:t.offsetWidth}),i||(i=t.offsetWidth>0))})),i&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&!i.isOverflow))}_getDropdown(i){const s=this._getDropdownItems();return s.length>0?t("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this._layer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:i=>this._moreDropdown=i},t("calcite-action",{appearance:"solid",id:i,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},t("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),t("calcite-dropdown-group",{"selection-mode":"none"},s.map((i=>t("calcite-dropdown-group",{class:i.disabled?"disabled":"",selectionMode:i.disabled?"none":"single"},t("calcite-dropdown-item",{disabled:i.loading,iconStart:i.isSublist&&this._showHideOpen?"chevron-down":i.loading?"":i.icon,id:"solutions-subset-list",onClick:i.func},i.loading?t("div",{class:"display-flex"},t("calcite-loader",{inline:!0,label:i.label,scale:"m"}),i.label):i.label))))),this._showHideOpen?this._getFieldlist():void 0):void 0}_getDropdownItems(){var i;return null===(i=this._toolInfos)||void 0===i?void 0:i.filter((i=>i&&i.isOverflow))}_getAction(i,s,e,h,o,a,l,n){const d=void 0===this._layer||a;return t("div",{class:"display-flex",id:this._getId(s),slot:n},t("calcite-action",{active:i,appearance:"solid",disabled:d,icon:s,id:s,indicator:e,label:h,loading:l,onClick:o,text:h,textEnabled:!0}),this._getToolTip("bottom",s,h))}_getShare(i){return t("div",{class:"share-action",id:this._getId(i)},t("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"instant-app-share",embed:this.shareIncludeEmbed,popoverButtonIconScale:"s",ref:i=>this._shareNode=i,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",socialMedia:this.shareIncludeSocial,view:this.mapView}),this._getToolTip("bottom",i,this._translations.share))}_updateShareUrl(){var i,t,s,e;const h=null===(i=this._shareNode)||void 0===i?void 0:i.shareUrl;if(!h)return;const o=new URL(h);(null===(t=this.mapInfo)||void 0===t?void 0:t.id)?o.searchParams.set("webmap",this.mapInfo.id):o.searchParams.delete("webmap"),(null===(s=this._layer)||void 0===s?void 0:s.id)?o.searchParams.set("layer",this._layer.id):o.searchParams.delete("layer"),(null===(e=this.selectedIds)||void 0===e?void 0:e.length)>0?o.searchParams.set("oid",this.selectedIds.join(",")):o.searchParams.delete("oid"),this._shareNode.shareUrl=o.href}_getToolTip(i,s,e){return document.getElementById(s)?t("calcite-tooltip",{placement:i,"reference-element":s},t("span",null,e)):void 0}_getId(i){return`solutions-action-${i}`}_getDangerAction(i,s,e,h){const o=void 0===this._layer||h;return t("div",{class:"display-flex",id:this._getId(i)},"trash"===i?t("delete-button",{buttonType:"action",class:"display-flex",disabled:o,icon:i,ids:this._getIds(),layer:this._layer}):t("calcite-action",{appearance:"solid",disabled:o,id:i,onClick:e,text:""},t("calcite-button",{appearance:"transparent",iconStart:i,kind:"danger"},s)),this._getToolTip("bottom",i,s))}_getIds(){return this._table.highlightIds.toArray()}async _getTable(i,t){this._layer&&(await this._layer.when((()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:t},container:i})})),await this._table.when((()=>{this._table.highlightIds.on("change",(i=>{this._handleOnChange(i)}))})))}async _handleOnChange(i){const t=[...this._table.highlightIds.toArray()];if(this._skipOnChange)this._skipOnChange=!1;else{if(this._ctrlIsPressed||this._shiftIsPressed){if(this._ctrlIsPressed)this.selectedIds=t.reverse();else if(this._shiftIsPressed&&(this._skipOnChange=!0,this._previousCurrentId=this._currentId,this._currentId=[...this._table.highlightIds.toArray()].reverse()[0],this._previousCurrentId!==this._currentId)){const i=this._table.activeSortOrders.reduce(((i,t)=>(i.push(`${t.fieldName} ${t.direction}`),i)),[]),s=await c(this._layer,this._layer.definitionExpression,i);let e=!1;const h=this._table.viewModel.getObjectIdIndex(this._previousCurrentId),o=this._table.viewModel.getObjectIdIndex(this._currentId),a=h<o?h:o,l=o>h?o:h;this._skipOnChange=a+1!==l;const n=s.reduce(((i,t)=>{const s=t,h=this._table.viewModel.getObjectIdIndex(s);return s!==this._currentId&&s!==this._previousCurrentId||(e=!e,i.indexOf(s)<0&&i.push(s)),e&&i.indexOf(s)<0&&i.push(s),(this.selectedIds.indexOf(s)>-1||h>=a&&h<=l)&&i.indexOf(s)<0&&h>-1&&i.push(s),i}),[]);this.selectedIds=h<o?n.reverse():n,this._table.highlightIds.addMany(this.selectedIds.filter((i=>t.indexOf(i)<0)))}}else if(this.selectedIds.length>0){this._skipOnChange=!0;const s=this.selectedIds.length>1&&1===i.removed.length?i.removed:t.filter((i=>this.selectedIds.indexOf(i)<0));this._clearSelection(),this.selectedIds=[...s],s.length>0?this._table.highlightIds.add(s[0]):this._skipOnChange=!1}else this.selectedIds=t.reverse();this._finishOnChange()}this._currentId=[...this._table.highlightIds.toArray()].reverse()[0]}_finishOnChange(){this._showOnlySelected&&(this._featuresSelected()?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this.selectedIds)}_resetColumnTemplates(){var i,t;const s=this._getColumnTemplates(null===(i=this._layer)||void 0===i?void 0:i.id,null===(t=this._layer)||void 0===t?void 0:t.fields),e=null==s?void 0:s.some(((i,t)=>{var s;return JSON.stringify(null===(s=this._table)||void 0===s?void 0:s.tableTemplate.columnTemplates[t])!==JSON.stringify(i)}));if(this._table&&s&&(e||!this._columnsInfo)){this._table.tableTemplate=new this.TableTemplate({columnTemplates:s});const i=s.map((i=>i.fieldName));this._initColumnsInfo(i)}}async _resetTable(){var i;if(this._clearSelection(),this._allIds=await r(this._layer),this._table)this._table.view=this.mapView,this._table.layer=this._layer;else{const t=this._getColumnTemplates(this._layer.id,null===(i=this._layer)||void 0===i?void 0:i.fields);await this._getTable(this._tableNode,t)}await this._initLayerRefresh(),this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,await this.reactiveUtils.once((()=>"loaded"===this._table.state)).then((async()=>{this._table.highlightIds.removeAll(),this._table.clearSelectionFilter(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),this._initToolInfos(),this._updateToolbar()}))}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._refreshHandle=this._layer.on("refresh",(i=>{i.dataChanged&&(this._skipOnChange=!0,this._updateAllIds())}))}async _updateAllIds(){this._allIds=await r(this._layer),this.selectedIds=this.selectedIds.filter((i=>this._allIds.indexOf(i)>-1)),await this._refresh()}async _handleDefaults(){var i,t;if(!this._defaultOidHonored&&(null===(i=this.defaultOid)||void 0===i?void 0:i.length)>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=void 0,this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&(null===(t=this.defaultGlobalId)||void 0===t?void 0:t.length)>0&&this._table){const i=await v(this.defaultGlobalId,this._layer),t=(null==i?void 0:i.length)>0?i.map((i=>i.getObjectId())):void 0;t&&await this._selectDefaultFeature(t),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=void 0,this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(i){var t,s;const e=null===(t=this._table)||void 0===t?void 0:t.columns.reduce(((t,s)=>((!i||(null==i?void 0:i.indexOf(s.name))>-1)&&(t[s.name]=!s.hidden),t)),{}),h=null===(s=this._table)||void 0===s?void 0:s.columns.map((i=>i.name));(i?i.filter((i=>h.indexOf(i)<0)):[]).forEach((i=>{e[i]=!0})),this._columnsInfo=i?i.reduce(((i,t)=>(i[t]=e[t],i)),{}):e}async _selectDefaultFeature(i){i.length>0&&this._table.highlightIds.addMany(i)}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){this._table&&this._layer&&this.showNewestFirst&&(await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(this._layer.objectIdField,"desc")})))}_forceShowHide(){this._showHideDropdown&&(this._showHideDropdown.open=this._showHideOpen),this._moreDropdown&&(this._moreDropdown.open=this._showHideOpen)}_toggleShowHide(){this._showHideOpen=!this._showHideOpen}_closeShowHide(){this._showHideOpen=!1}_handleDocumentClick(i){var t;const s=null===(t=i.target)||void 0===t?void 0:t.id;this._showHideOpen&&Object.keys(this._columnsInfo).indexOf(s)<0&&"solutions-subset-list"!==s&&"chevron-right"!==s&&(this._closeShowHide(),this._moreDropdown&&(this._moreDropdown.open=!1),this._showHideDropdown&&(this._showHideDropdown.open=!1))}_handleKeyDown(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_handleKeyUp(i){this._ctrlIsPressed=i.ctrlKey,this._shiftIsPressed=i.shiftKey}_filterModal(){var i,s,e;return t("calcite-modal",{"aria-labelledby":"modal-title",class:"modal",kind:"brand",onCalciteModalClose:()=>{this._closeFilter()},open:this._filterOpen,widthScale:"s"},t("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},null===(s=null===(i=this._translations)||void 0===i?void 0:i.filter)||void 0===s?void 0:s.replace("{{title}}",null===(e=this._layer)||void 0===e?void 0:e.title)),t("div",{slot:"content"},t("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:async()=>this._closeFilter(),comboboxOverlayPositioning:"fixed",layerExpressions:this._layerExpressions,onFilterListReset:()=>this._handleFilterListReset(),onFilterUpdate:()=>this._handleFilterUpdate(),ref:i=>this._filterList=i,view:this.mapView,zoomBtn:!1})))}_handleFilterListReset(){this._filterActive=!1,this._updateShareUrl()}_handleFilterUpdate(){const i=this._layer.definitionExpression;if(this._floorExpression){const t=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=i&&this._floorField&&i.indexOf(`${this._floorField} = '`)>-1?i.replace(t,this._floorExpression):i?`${i} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=this._definitionExpression!==this._layer.definitionExpression&&(!this._floorExpression||this._layer.definitionExpression!==this._floorExpression),this._updateShareUrl()}async _closeFilter(){this._filterOpen&&(this._allIds=await r(this._layer),this._filterOpen=!1)}async _mapClicked(i){const t={include:this._layer},s=await this.mapView.hitTest(i.screenPoint,t);s.results.length>0?(s.results.forEach((i=>{const t=i.graphic.getObjectId();this._table.highlightIds.indexOf(t)<0&&this._table.highlightIds.add(t)})),this._showOnlySelected&&this._table.filterBySelection()):this._clearSelection()}_selectAll(){const i=this._allIds;this._table.highlightIds.removeAll(),this._skipOnChange=!0,this._table.highlightIds.addMany(i),this.selectedIds=i,this._finishOnChange(),this._selectAllActive=!0}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){var i;this.selectedIds=[],null===(i=this._table)||void 0===i||i.highlightIds.removeAll(),this._finishOnChange()}_toggleFilter(){this._filterOpen=!this._filterOpen}_initLayerExpressions(){var i,t;const s=null===(t=null===(i=this.mapInfo)||void 0===i?void 0:i.filterConfig)||void 0===t?void 0:t.layerExpressions;this._layerExpressions=s?s.filter((i=>{var t;return i.id===(null===(t=this._layer)||void 0===t?void 0:t.id)})):[],this._filterList.layerExpressions=this._layerExpressions,this._filterActive=this._layerExpressions.filter((i=>i.expressions.filter((i=>i.active)).length>0)).length>0}_switchSelected(){const i=[...this.selectedIds];this._table.highlightIds.removeAll();const t=this._allIds.reduce(((t,s)=>(i.indexOf(s)<0&&t.push(s),t)),[]).sort(((i,t)=>i-t));this._skipOnChange=!0,this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange()}async _exportToCSV(){const i={},t=this._table.highlightIds.toArray();i[this._layer.id]={selectionSetNames:[this._layer.title],ids:t,layer:this._layer};const s=this._table.columns.toArray().reduce(((i,t)=>(t.hidden||i.push(t.name.toLocaleLowerCase()),i)),[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,await p(null,i,!1,!1,!0,s,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}_updateToolInfoLoading(i,t){this._toolInfos.some((s=>{if((null==s?void 0:s.icon)===i)return s.loading=t,!0}))}async _refresh(){await this._table.refresh(),this.featureSelectionChange.emit(this.selectedIds)}_zoom(){this._table.zoomToSelection()}async _layerSelectionChanged(i){var t;const s=i.detail[0];if(s!==(null===(t=this._layer)||void 0===t?void 0:t.id)||this._featuresEmpty()){this._fetchingData=!0;const i=await n(this.mapView,s);await i.when((()=>{this._layer=i}))}this._fetchingData=!1}_getColumnTemplates(i,t){var s,e;let h;null===(e=null===(s=this.mapInfo)||void 0===s?void 0:s.layerOptions)||void 0===e||e.layers.some((t=>{if(t.id===i)return h=t,!0}));const o=(null==h?void 0:h.fields)&&(null==h?void 0:h.fieldOrder)?h.fieldOrder.filter((i=>h.fields.indexOf(i)>-1)):void 0;let a;return t&&(a=h&&(null==h?void 0:h.fields)?t.reduce(((i,t)=>{if(h.fields.indexOf(t.name)>-1){const s={type:"field",fieldName:t.name,label:t.alias,menuConfig:this._getMenuConfig(t.name)};i.push(s)}return i}),[]).sort(this._sortFields.bind(this,null==h?void 0:h.fieldOrder)):t.map((i=>({type:"field",fieldName:i.name,label:i.alias,menuConfig:this._getMenuConfig(i.name)})))),o?null==a?void 0:a.sort(this._sortFields.bind(this,o)):a}_sortFields(i,t,s){return(null==i?void 0:i.indexOf(t.fieldName))-i.indexOf(s.fieldName)}_getMenuConfig(i){return{items:[{label:this._translations.hideField,iconClass:"esri-icon-non-visible",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(i)}}]}}_handleHideClick(i){this._columnsInfo[i]=!1,this._table.hideColumn(i),this._table.tableTemplate.columnTemplates.forEach((t=>{t.fieldName===i&&(t.visible=!1)}))}async _getTranslations(){const i=await o(this.el);this._translations=i[0]}get el(){return e(this)}static get watchers(){return{defaultOid:["defaultOidWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],enableCSV:["enableCSVWatchHandler"],enableInlineEdit:["enableInlineEditWatchHandler"],enableShare:["enableShareWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"],isMobile:["isMobileWatchHandler"],mapInfo:["mapInfoWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],selectedIds:["selectedIdsWatchHandler"]}}};b.style=':host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{font-size:14px !important;color:var(--calcite-color-text-3) !important}.share-action{position:absolute;right:0}html[dir="rtl"] .share-action{left:0}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.instant-app-share{height:50px !important;display:inline-flex}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-modal-content-padding:0}';const m=class{constructor(t){i(this,t),this.mapChanged=h(this,"mapChanged",7),this.beforeMapChanged=h(this,"beforeMapChanged",7),this._defaultWebmapHonored=!1,this._loadedId="",this.appProxies=void 0,this.defaultWebmapId="",this.enableHome=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSingleExpand=!0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.homeZoomIndex=3,this.homeZoomPosition="top-left",this.homeZoomToolsSize="m",this.mapInfos=[],this.mapWidgetsIndex=0,this.mapWidgetsPosition="top-right",this.mapWidgetsSize="m",this.mapView=void 0,this.stackTools=!0,this.theme=void 0,this.toolOrder=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0}enableHomeWatchHandler(){this._initHome()}async mapInfoChange(i){await this._loadMap(i.detail)}async componentWillLoad(){await this._initModules()}render(){var i,e;const h=this.hidden?"visibility-hidden-1":"",o="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",a=(null===(i=this.mapInfos)||void 0===i?void 0:i.length)>1?"":"display-none",l=(null===(e=this.mapInfos)||void 0===e?void 0:e.length)>1?"map-height":"height-full";return t(s,null,t("map-picker",{class:a,mapInfos:this.mapInfos,ref:i=>this._mapPicker=i}),t("div",{class:`${l} ${h}`,ref:i=>this._mapDiv=i}),t("map-tools",{basemapConfig:this.basemapConfig,class:`box-shadow ${o}`,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:this.enableSingleExpand,homeZoomToolsSize:this.homeZoomToolsSize,mapView:this.mapView,mapWidgetsSize:this.mapWidgetsSize,position:this.mapWidgetsPosition,ref:i=>this._mapTools=i,searchConfiguration:this._searchConfiguration,stackTools:this.stackTools,toolOrder:this.toolOrder}))}async _initModules(){const[i,t,s,e]=await a(["esri/WebMap","esri/views/MapView","esri/widgets/Home","esri/config"]);this.WebMap=i,this.MapView=t,this.Home=s,this.esriConfig=e}async _loadMap(i){var t;const s=!this._defaultWebmapHonored&&this.defaultWebmapId,e=null===(t=this.mapInfos)||void 0===t?void 0:t.filter((i=>i.id===this.defaultWebmapId)),h=JSON.stringify(i)!==JSON.stringify(this._webMapInfo);this._webMapInfo=s&&e?e[0]:!(null==i?void 0:i.id)&&this.mapInfos.length>0?this.mapInfos[0]:i;const o=this._webMapInfo.id,a=s&&(null==i?void 0:i.id)===this.defaultWebmapId;if(this._loadedId!==o&&!s||a){const i=new this.WebMap({portalItem:{id:o}});this.appProxies&&(await i.load(),await(l=i,n=this.esriConfig,d=this.appProxies,d&&d.forEach((i=>{l.allLayers.forEach((t=>{t&&t.url===i.sourceUrl&&(t.url=i.proxyUrl,t.portalItem&&t.portalItem.when((()=>{t.portalItem.url=i.proxyUrl})),n.request?.interceptors?.push({urls:i.sourceUrl,before:t=>{t.url&&t.url===i.sourceUrl&&(t.url=i.proxyUrl)}}))}))})),l)),this.mapView=new this.MapView({container:this._mapDiv,map:i,resizeAlign:"center"}),this._loadedId=o,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{this._initHome(),this.mapView.ui.add(this._mapTools,{position:this.mapWidgetsPosition,index:this.mapWidgetsIndex}),this._defaultWebmapHonored=!!a||this._defaultWebmapHonored,this.mapChanged.emit({id:o,mapView:this.mapView})}))}else s?(this._defaultWebmapHonored=!0,this._mapPicker.setMapByID(o)):h&&(this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),this.mapChanged.emit({id:o,mapView:this.mapView}));var l,n,d}_initHome(){if(this.enableHome){this._homeWidget=new this.Home({view:this.mapView}),this.mapView.ui.add(this._homeWidget,{position:this.homeZoomPosition,index:this.homeZoomIndex});const i="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";this._homeWidget.domNode.style.height=i,this._homeWidget.domNode.style.width=i}else this._homeWidget&&this.mapView.ui.remove(this._homeWidget)}get el(){return e(this)}static get watchers(){return{enableHome:["enableHomeWatchHandler"]}}};m.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 51px)}.height-full{height:100%}.box-shadow{box-shadow:none !important}.visibility-hidden-1{visibility:hidden;height:1px;}.display-none{display:none}";export{u as card_manager,b as layer_table,m as map_card}