@esri/solutions-components 0.10.44 → 0.10.46
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +5 -5
- package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/{calcite-alert_5.cjs.entry.js → calcite-alert_6.cjs.entry.js} +136 -0
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +6 -6
- package/dist/cjs/{calcite-shell_3.cjs.entry.js → calcite-shell.cjs.entry.js} +0 -256
- package/dist/cjs/card-manager_3.cjs.entry.js +13 -7
- package/dist/cjs/crowdsource-manager.cjs.entry.js +25 -4
- package/dist/cjs/delete-dialog.cjs.entry.js +131 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +19 -19
- package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +2 -2
- package/dist/cjs/share-item.cjs.entry.js +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +3 -3
- package/dist/cjs/solution-contents_3.cjs.entry.js +3 -3
- package/dist/cjs/solution-item-accordion.cjs.entry.js +1 -1
- package/dist/cjs/solution-item-icon.cjs.entry.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +4 -0
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +31 -3
- package/dist/collection/components/layer-table/layer-table.js +32 -7
- package/dist/collection/components/map-card/map-card.js +1 -1
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
- package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
- package/dist/collection/components/map-legend/map-legend.js +1 -1
- package/dist/collection/components/map-picker/map-picker.js +1 -1
- package/dist/collection/components/map-search/map-search.js +1 -1
- package/dist/collection/components/map-select-tools/map-select-tools.js +54 -20
- package/dist/collection/components/map-tools/map-tools.js +1 -1
- package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
- package/dist/collection/components/pdf-download/pdf-download.js +1 -1
- package/dist/collection/components/public-notification/public-notification.js +2 -2
- package/dist/collection/components/refine-selection/refine-selection.js +1 -1
- package/dist/collection/components/share-item/share-item.js +1 -1
- package/dist/collection/components/solution-configuration/solution-configuration.js +3 -3
- package/dist/collection/components/solution-contents/solution-contents.js +1 -1
- package/dist/collection/components/solution-item/solution-item.js +1 -1
- package/dist/collection/components/solution-item-accordion/solution-item-accordion.js +1 -1
- package/dist/collection/components/solution-item-details/solution-item-details.js +1 -1
- package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
- package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
- package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -1
- package/dist/collection/components/solution-resource-item/solution-resource-item.js +1 -1
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +1 -1
- package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
- package/dist/collection/components/solution-variables/solution-variables.js +1 -1
- package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
- package/dist/collection/utils/interfaces.ts +4 -0
- package/dist/components/crowdsource-manager.js +27 -5
- package/dist/components/layer-table2.js +84 -91
- package/dist/components/map-card2.js +1 -1
- package/dist/components/map-draw-tools2.js +1 -1
- package/dist/components/map-fullscreen2.js +1 -1
- package/dist/components/map-layer-picker2.js +1 -1
- package/dist/components/map-legend2.js +1 -1
- package/dist/components/map-picker2.js +1 -1
- package/dist/components/map-search2.js +1 -1
- package/dist/components/map-select-tools2.js +19 -19
- package/dist/components/map-tools2.js +1 -1
- package/dist/components/pci-calculator.js +1 -1
- package/dist/components/pdf-download2.js +1 -1
- package/dist/components/public-notification.js +2 -2
- package/dist/components/refine-selection2.js +1 -1
- package/dist/components/share-item.js +1 -1
- package/dist/components/solution-configuration.js +3 -3
- package/dist/components/solution-contents2.js +1 -1
- package/dist/components/solution-item-accordion.js +1 -1
- package/dist/components/solution-item-details2.js +1 -1
- package/dist/components/solution-item-icon2.js +1 -1
- package/dist/components/solution-item-sharing2.js +1 -1
- package/dist/components/solution-item2.js +1 -1
- package/dist/components/solution-organization-variables2.js +1 -1
- package/dist/components/solution-resource-item2.js +1 -1
- package/dist/components/solution-spatial-ref2.js +1 -1
- package/dist/components/solution-template-data2.js +1 -1
- package/dist/components/solution-variables2.js +1 -1
- package/dist/components/spatial-ref.js +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +5 -5
- package/dist/esm/buffer-tools_3.entry.js +1 -1
- package/dist/esm/{calcite-alert_5.entry.js → calcite-alert_6.entry.js} +136 -1
- package/dist/esm/calcite-combobox_3.entry.js +1 -1
- package/dist/esm/calcite-shell-panel_14.entry.js +6 -6
- package/dist/esm/{calcite-shell_3.entry.js → calcite-shell.entry.js} +2 -256
- package/dist/esm/card-manager_3.entry.js +13 -7
- package/dist/esm/crowdsource-manager.entry.js +25 -4
- package/dist/esm/delete-dialog.entry.js +127 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +19 -19
- package/dist/esm/pci-calculator.entry.js +1 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/share-item.entry.js +1 -1
- package/dist/esm/solution-configuration.entry.js +3 -3
- package/dist/esm/solution-contents_3.entry.js +3 -3
- package/dist/esm/solution-item-accordion.entry.js +1 -1
- package/dist/esm/solution-item-icon.entry.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +1 -1
- package/dist/solutions-components/{p-ce53e33d.entry.js → p-11c2426d.entry.js} +2 -2
- package/dist/solutions-components/p-1336a071.entry.js +6 -0
- package/dist/solutions-components/{p-5001cc41.entry.js → p-274aa753.entry.js} +1 -1
- package/dist/solutions-components/{p-e1e21798.entry.js → p-36b864ba.entry.js} +1 -1
- package/dist/solutions-components/p-41503b16.entry.js +6 -0
- package/dist/solutions-components/{p-561c0e02.entry.js → p-44dc3dec.entry.js} +1 -1
- package/dist/solutions-components/{p-471d5c7f.entry.js → p-45ab1117.entry.js} +2 -2
- package/dist/solutions-components/p-49ed272d.entry.js +11 -0
- package/dist/solutions-components/{p-b7fbaeb7.entry.js → p-6b5b52c1.entry.js} +1 -1
- package/dist/solutions-components/{p-62d8796c.entry.js → p-7475b8b4.entry.js} +2 -2
- package/dist/solutions-components/{p-80e81af7.entry.js → p-7bcfe068.entry.js} +1 -1
- package/dist/solutions-components/{p-41314f33.entry.js → p-96027923.entry.js} +1 -1
- package/dist/solutions-components/p-9c25ee2c.entry.js +6 -0
- package/dist/solutions-components/{p-8d4a4498.entry.js → p-b6d50640.entry.js} +1 -1
- package/dist/solutions-components/p-b8d1b57a.entry.js +6 -0
- package/dist/solutions-components/p-b95968fa.entry.js +6 -0
- package/dist/solutions-components/p-d2f8d8a8.entry.js +6 -0
- package/dist/solutions-components/{p-d51c07d2.entry.js → p-f57978f3.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/interfaces.ts +4 -0
- package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +19 -0
- package/dist/types/components/layer-table/layer-table.d.ts +5 -5
- package/dist/types/components/map-select-tools/map-select-tools.d.ts +8 -8
- package/dist/types/components.d.ts +23 -2
- package/dist/types/preact.d.ts +2 -1
- package/dist/types/utils/interfaces.d.ts +3 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-0a2e5861.entry.js +0 -6
- package/dist/solutions-components/p-56beff4c.entry.js +0 -6
- package/dist/solutions-components/p-8b92fe23.entry.js +0 -6
- package/dist/solutions-components/p-8e2f4995.entry.js +0 -6
- package/dist/solutions-components/p-d7afbe8d.entry.js +0 -11
- package/dist/solutions-components/p-f0509d41.entry.js +0 -6
@@ -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 e,h as i,H as s,g as a,F as o}from"./p-4e6eb06e.js";import{s as n,t as c,o as l,z as r,g as h}from"./p-621ad249.js";import{g as d}from"./p-4a291f79.js";import{s as p,a as f,c as b}from"./p-ad9d1221.js";import{N as m,c as u,d as g}from"./p-895e7b9c.js";import{o as y}from"./p-c7f8b7f0.js";import{c as v,s as w,d as k,u as x}from"./p-efaa77a0.js";import{K as _}from"./p-876c3f5f.js";import{u as C,I as z}from"./p-d6902512.js";import{S as E}from"./p-3776809a.js";import{l as W,g as
|
6
|
+
import{r as t,c as e,h as i,H as s,g as a,F as o}from"./p-4e6eb06e.js";import{s as n,t as c,o as l,z as r,g as h}from"./p-621ad249.js";import{g as d}from"./p-4a291f79.js";import{s as p,a as f,c as b}from"./p-ad9d1221.js";import{N as m,c as u,d as g}from"./p-895e7b9c.js";import{o as y}from"./p-c7f8b7f0.js";import{c as v,s as w,d as k,u as x}from"./p-efaa77a0.js";import{K as _}from"./p-876c3f5f.js";import{u as C,I as z}from"./p-d6902512.js";import{S as E}from"./p-3776809a.js";import{l as W,g as H}from"./p-f4aadb3b.js";import{a as F,g as j}from"./p-d572627c.js";import{P as L}from"./p-cd482a33.js";import"./p-7d542581.js";import"./p-91371f97.js";import"./p-4f82eb55.js";import"./p-233f219c.js";import"./p-ff336351.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";import"./p-ff9e28d1.js";import"./p-7530a02f.js";import"./p-d0d020a5.js";import"./p-9bb44f57.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/dev/LICENSE.md for details.
|
@@ -14,4 +14,4 @@ import{r as t,c as e,h as i,H as s,g as a,F as o}from"./p-4e6eb06e.js";import{s
|
|
14
14
|
* See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
15
15
|
* v2.13.0
|
16
16
|
*/
|
17
|
-
const O=class{constructor(i){t(this,i),this.calciteFlowItemBack=e(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=e(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=e(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=e(this,"calciteFlowItemToggle",6),this.handleInternalPanelScroll=t=>{t.target===this.containerEl&&(t.stopPropagation(),this.calciteFlowItemScroll.emit())},this.handleInternalPanelClose=t=>{t.target===this.containerEl&&(t.stopPropagation(),this.closed=!0,this.calciteFlowItemClose.emit())},this.handleInternalPanelToggle=t=>{t.target===this.containerEl&&(t.stopPropagation(),this.collapsed=t.target.collapsed,this.calciteFlowItemToggle.emit())},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.beforeClose=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){u(this),v(this)}async componentWillLoad(){await w(this),p(this)}componentDidRender(){C(this)}disconnectedCallback(){g(this),k(this)}componentDidLoad(){f(this)}effectiveLocaleChange(){x(this,this.effectiveLocale)}async setFocus(){await b(this);const{backButtonEl:t,containerEl:e}=this;return t?t.setFocus():e?e.setFocus():void 0}async scrollContentTo(t){await(this.containerEl?.scrollContentTo(t))}renderBackButton(){const{el:t}=this,e="rtl"===h(t),{showBackButton:s,backButtonClick:a,messages:o}=this,n=o.back;return s?i("calcite-action",{"aria-label":n,class:"back-button",icon:e?"chevron-right":"chevron-left",key:"flow-back-button",onClick:a,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:n,title:n}):null}render(){const{collapsed:t,collapseDirection:e,collapsible:a,closable:o,closed:n,description:c,disabled:l,heading:r,headingLevel:h,loading:d,menuOpen:p,messages:f,overlayPositioning:b,beforeClose:m}=this;return i(s,{key:"2e7872bb2687db0b67ddbf375f8ec0beaabbda36"},i(z,{key:"a9418954405a2cec2092bae3be5d77f02306e3c9",disabled:l},i("calcite-panel",{key:"d563c751421bf2d66c03286deaa613e09f585546",beforeClose:m,closable:o,closed:n,collapseDirection:e,collapsed:t,collapsible:a,description:c,disabled:l,heading:r,headingLevel:h,loading:d,menuOpen:p,messageOverrides:f,onCalcitePanelClose:this.handleInternalPanelClose,onCalcitePanelScroll:this.handleInternalPanelScroll,onCalcitePanelToggle:this.handleInternalPanelToggle,overlayPositioning:b,ref:this.setContainerRef,scale:this.scale},this.renderBackButton(),i("slot",{key:"c506ec8bb4debbd6a9da6c7941878de49776f614",name:"action-bar",slot:E.actionBar}),i("slot",{key:"e76e55e654ff878acff734bdf387402a9e262159",name:"alerts",slot:E.alerts}),i("slot",{key:"f7ab8839d7b101e31087130ebf3e36af1ec7da24",name:"header-actions-start",slot:E.headerActionsStart}),i("slot",{key:"2932c4c15b168732356b8e55fcc3064f5b3f4cf5",name:"header-actions-end",slot:E.headerActionsEnd}),i("slot",{key:"1ef8a9050683022733695445092f8c626487d87b",name:"header-content",slot:E.headerContent}),i("slot",{key:"24c0ab570a601a6c0edfb0c820e580fd24b158ce",name:"header-menu-actions",slot:E.headerMenuActions}),i("slot",{key:"ec55bbe7ba939a6efb35225850c37a1aadb97275",name:"fab",slot:E.fab}),i("slot",{key:"aa0bfec47656ef9f7f575cd933897a7909e5badc",name:"content-top",slot:E.contentTop}),i("slot",{key:"e23532d080e2df529c2aeb6af043c6efe7a0ab6d",name:"content-bottom",slot:E.contentBottom}),i("slot",{key:"db6ffc0d9300c77067a4c88ab277de685c7713af",name:"footer-start",slot:E.footerStart}),i("slot",{key:"5f249356da9292f34c4036d0d0741f048fe999e9",name:"footer",slot:E.footer}),i("slot",{key:"7476137bacc0f3be5c97682c5027f74d73254765",name:"footer-end",slot:E.footerEnd}),i("slot",{key:"58f60a46c42a05abe9b100a57d478d991e4f25bc",name:"footer-actions",slot:E.footerActions}),i("slot",{key:"926a8d94b76b6fcdef6dfd219ba8180c44f81c35"}))))}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};O.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}";const R=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.drawComplete=e(this,"drawComplete",7),this.editingAttachment=e(this,"editingAttachment",7),this.progressStatus=e(this,"progressStatus",7),this.modeChanged=e(this,"modeChanged",7),this.mapView=void 0,this.selectedLayerId=void 0,this.customizeSubmit=!1,this.locale=void 0,this.searchConfiguration=void 0,this.isMobile=void 0,this.floorLevel=void 0,this.formElements=void 0,this.enableSearch=!1,this.showGuidingMsg=!0,this.showGuidingMsgWhileDrawing=!0,this._editorLoading=!1,this._currentPage="templatePicker",this._translations=void 0}get el(){return a(this)}Editor;ExpressionInfo;FieldElement;FormTemplate;_editor;FeatureLayer;MapView;_updatedMapView;Search;_search;reactiveUtils;_addingAttachment;_container;_mapViewContainer;_isSubmitBtnClicked=!1;_selectedLayer;_searchDiv;_calciteNotice;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async isMobileHandler(){this.modeChanged.emit()}async _editorLoadingWatchHandler(t){if(t){if(this._container?.classList.add("display-none"),this._selectedLayer?.isTable){const t={layer:this._selectedLayer,template:this._selectedLayer.templates[0]};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(t),await this.hideEditorsElements()}else await this.startCreate();this._container?.classList.remove("display-none"),this._editorLoading=!1}}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async refresh(t){this._editor&&this._setFloorLevel(t)}success;fail;drawComplete;editingAttachment;progressStatus;modeChanged;async componentWillLoad(){await this._getTranslations(),await this.initModules()}async componentDidLoad(){await this.init()}componentDidRender(){this.isMobile&&(this._mapViewContainer.style.top=`${this._calciteNotice.offsetHeight+this._searchDiv.offsetHeight+80}px`)}disconnectedCallback(){this._editor&&this._editor.destroy()}render(){const t="drawing"===this._currentPage?"":"display-none",e=this._editorLoading?"":"display-none",s=this._editorLoading?"display-none":"",a=this.isMobile?"show-map":"display-none";let n=this._translations.chooseCategoryMsg;return"drawing"===this._currentPage?n=this._translations.provideLocationMsg:"featureForm"===this._currentPage&&(n=this._translations.provideDetailsMsg),i(o,{key:"788b2ebb85b603452d4b4de05711510f7480c895"},this.showGuidingMsg&&(this.showGuidingMsgWhileDrawing||"drawing"!==this._currentPage)&&i("calcite-notice",{key:"cf41e701f5a7605531fa6351acf13ea20e219f7a",class:"notice-msg",icon:"lightbulb",kind:"success",open:!0,ref:t=>this._calciteNotice=t},i("div",{key:"1bb493a8e5a962c8a8c75ac37156edbf866c3916",slot:"message"},n)),i("calcite-loader",{key:"5d2e9a465cb7c6dbde8d941497fda87b4fc7c258",class:e,label:"",scale:"s"}),i("div",{key:"23b8651f4040443ba731173d1818b515b718b754",class:s,id:"feature-form"}),this.enableSearch&&i("div",{key:"7f628d09111295d46fbf7b9605999c2ef88c258d",class:`search-widget ${t} ${s}`,id:"search-widget-ref",ref:t=>this._searchDiv=t}),i("div",{key:"3def9aaab0a2f03076a6c4c645cf5a080bbb9e75",class:`${a}`,ref:t=>{this._mapViewContainer=t}}))}async init(){this.mapView&&this.selectedLayerId&&(this._updatedMapView=this.mapView,await(this.isMobile?this.createMobileMapView():this._loadWidgets()))}async initModules(){const[t,e,i,s,a,o,n]=await W(["esri/widgets/Editor","esri/core/reactiveUtils","esri/widgets/Search","esri/form/ExpressionInfo","esri/form/elements/FieldElement","esri/form/FormTemplate","esri/views/MapView"]);this.Editor=t,this.reactiveUtils=e,this.Search=i,this.ExpressionInfo=s,this.FieldElement=a,this.FormTemplate=o,this.MapView=n}async createMobileMapView(){this._mapViewContainer.classList.add("hide-map"),await new this.MapView({map:this.mapView.map,container:this._mapViewContainer,zoom:this.mapView.zoom}).when((t=>{this._updatedMapView=t,this._loadWidgets()}),(t=>{console.log(t)}))}async _loadWidgets(){await this.createEditorWidget(),this.enableSearch&&await this.createSearchWidget()}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[];this._container=document.createElement("div"),this._container?.classList.add("display-none");const e=await j(this._updatedMapView);this._selectedLayer=await H(this.mapView,this.selectedLayerId),this._selectedLayer?.isTable||e.forEach((async e=>{t.push({layer:e,enabled:"feature"===e?.type&&e?.id===this.selectedLayerId,addEnabled:!0,updateEnabled:!1,deleteEnabled:!1})})),this._editor=new this.Editor({view:this._updatedMapView,layerInfos:t,visibleElements:{snappingControls:!1,createFeaturesSection:!0,editFeaturesSection:!1},container:this._container}),this._mapViewContainer?this.el.insertBefore(this._container,this._mapViewContainer):this.el.appendChild(this._container);const i=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.editingAttachment.emit(!0)):this._addingAttachment&&(this.editingAttachment.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&"create-features"!==this._editor.viewModel?.activeWorkflow?.type&&(this.progressStatus.emit(.5),this._editorLoading=!0)}));this._editor.viewModel.addHandles(s);const a=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&(this._mapViewContainer?.classList?.replace("show-map","hide-map"),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),setTimeout((()=>{this._setFloorLevel(this.floorLevel)}),50),this._currentPage="featureForm",this.progressStatus.emit(1),this.drawComplete.emit())}));this._editor.viewModel.addHandles(a);const o=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"creating-features"===t&&"disabled"===this._editor.viewModel.featureFormViewModel.state&&(this._mapViewContainer?.classList?.replace("hide-map","show-map"),this._selectedLayer&&!this._selectedLayer.isTable&&(this._currentPage="drawing"))}));this._editor.viewModel.addHandles(o)}async startCreate(){return await this.hideEditorsElements(),new Promise(((t,e)=>{if(this._editor.viewModel.featureTemplatesViewModel.items?.length){const i=this._editor.viewModel.featureTemplatesViewModel.items[0].get("items");this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{this.progressStatus.emit(.75),setTimeout((()=>{this.hideEditorsElements().then((()=>{t({})}),(t=>e(t)))}),700)})),1===i.length&&this._editor.viewModel.featureTemplatesViewModel.select(i[0]);const s=i.length>1;this.hideEditorsElements().then((()=>{s&&t({})}),(t=>s&&e(t)))}}))}async createSearchWidget(){let t={view:this._updatedMapView};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this._updatedMapView)}),this._search=new this.Search(t),this._search.container="search-widget-ref",this._search.popupEnabled=!1,this._search.resultGraphicEnabled=!1;let e=null;this._search.on("search-complete",(t=>{this._updatedMapView.goTo(t.results[0].results[0].extent),"point"===this._selectedLayer.geometryType&&(e=t.results[0].results[0]?.feature.geometry)}));const i=this.reactiveUtils.watch((()=>this._search.viewModel.state),(t=>{"ready"===t&&setTimeout((()=>{this._editor.viewModel.sketchViewModel.createGraphic&&e&&(this._editor.viewModel.sketchViewModel.createGraphic.set("geometry",e),this._editor.viewModel.sketchViewModel.complete(),this.hideEditorsElements())}),100)}));this._search.viewModel.addHandles(i)}_getSearchConfig(t,e){const i=t.sources;return i?.length>0?(t.includeDefaultSources=!1,i.forEach((t=>{if(t.hasOwnProperty("layer")){const i=t,s=i.layer?.id,a=s?e.map.findLayerById(s):null,o=i?.layer?.url;a?i.layer=a:o&&(i.layer=new this.FeatureLayer(o))}})),i?.forEach((t=>{if(t.hasOwnProperty("locator")){const e=t;"ArcGIS World Geocoding Service"===e?.name&&(e.outFields=e.outFields||["Addr_type","Match_addr","StAddr","City"],e.singleLineFieldName="SingleLine"),e.url=e.url,delete e.url}}))):t={...t,includeDefaultSources:!0},t}async _setFloorLevel(t){if(!t)return;const e=this._selectedLayer;if(e?.floorInfo?.floorField){const i=e.fields.find((t=>t.name===e.floorInfo.floorField));if(i&&!e?.formTemplate)this._editor.viewModel.featureFormViewModel.setValue(i.name,t),i.editable=!1;else if(e.formTemplate&&this.formElements){const i=new this.ExpressionInfo({expression:`"${t}"`,name:"floor-info-test",title:"Floor Info",returnType:"string"}),s=new this.FieldElement({label:e.floorInfo.floorField,editableExpression:"false",fieldName:e.floorInfo.floorField,input:{type:"text-box",maxLength:50,minLength:0},valueExpression:i.name});this._updatedMapView.map.editableLayers.forEach((t=>{const e=this.formElements.orgExpressionInfos,a=[...this.formElements.orgElements];a.push(s);const o=new this.FormTemplate({title:t.formTemplate.title,description:t.formTemplate.description,elements:a,expressionInfos:[i].concat(e)});t.formTemplate=o}))}}}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector(".esri-editor")?.querySelectorAll("calcite-flow-item")?.forEach((t=>{const e=t.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");e?.querySelector("header")?.setAttribute("style","display: none"),e?.querySelector("footer")?.setAttribute("style","display: none")})))}async submitted(t){if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(t.valid.length&&this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{await this._editor.activeWorkflow.commit(),this._editor.viewModel.failures?.length&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}timeout(t){return new Promise((e=>setTimeout(e,t)))}async _getTranslations(){const t=await F(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],isMobile:["isMobileHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};R.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 14px 20px 14px}.display-none{display:none !important}.hide-map{height:1%;visibility:hidden}.show-map{padding:10px !important;position:absolute !important;bottom:0;height:auto !important;width:calc(100% - 22px)}.notice-msg{padding:10px;width:calc(100% - 20px)}.esri-editor__panel-content{padding-block:10px !important}@media only screen and (max-width: 600px){.esri-editor__panel-content{padding-block:0 !important;min-height:0 !important}}";const q=class{constructor(i){t(this,i),this.closeEdit=e(this,"closeEdit",7),this.editsComplete=e(this,"editsComplete",7),this.refreshGraphics=e(this,"refreshGraphics",7),this.enableEditGeometry=!1,this.graphics=void 0,this.locale=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._editorLoading=!1,this._translations=void 0}get el(){return a(this)}_activeWorkflowHandle;_addRelatedRecordHandle;_attachmentHandle;_editHandle;_layerEditHandle;Editor;_editor;_layer;_editContainer;_editControlElements;_editingDisabled;_shouldClose=!1;reactiveUtils;async graphicsWatchHandler(){0===this.graphics.length&&this.open&&await this._closeEdit(!0)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async openWatchHandler(t){t&&this.graphics?.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)}closeEdit;editsComplete;refreshGraphics;async featureSelectionChange(){this.open&&await this._closeEdit(!1)}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){this.graphics?.length>0&&this.graphics[0]?.layer&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=("subtype-sublayer"===this._layer.type?this._layer.parent:this._layer).on("edits",(()=>{this.editsComplete.emit()})))}render(){const t=this._editorLoading?"display-none":"position-absolute",e=this._editorLoading?"":"display-none";return i(s,{key:"15ae3de9c8ab0a66a0185ffaafc27f03e19c77b7"},i("div",{key:"bbaa7dbc405259b64dfceca89e45abf6372c76c3",class:"position-absolute"},this.graphics?.length>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled?void 0:i("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},i("div",{slot:"message"},this._translations.enableEditing)),i("div",{key:"eb8b08fa0b08cf93581fb8e76d59bd8b5446770f",class:"position-absolute"},i("div",{key:"03e525373c09fbcd4dad213738d97b99f1549975",class:t,id:"feature-form",ref:t=>this._editContainer=t}),i("calcite-loader",{key:"1cc46d8f6499a90736e05c2eed9bff71aff35d12",class:e,label:"",scale:"s"}))))}async _initModules(){const[t,e]=await W(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=e}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),e=(await j(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:this.enableEditGeometry})));this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,layerInfos:e,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((()=>this._editor.viewModel.activeWorkflow?.activeWorkflow),(t=>{"update-table-record"!==t?.type&&"create-features"!==t?.type||(this._shouldClose=!1),(t?.type||t?.hasPendingEdits||this._editor.activeWorkflow)&&this._editor?.activeWorkflow?.started||(this.open=!1)})),this._editContainer.appendChild(t)}}async _closeEdit(t){this._shouldClose=!0,t&&this._editor?.activeWorkflow?(this._editor.activeWorkflow?.activeWorkflow?.hasPendingEdits&&(await this._editor.activeWorkflow.reset(),await this._editor.cancelWorkflow()),this._editor.destroy()):this.graphicIndex>-1&&this.graphics?.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 F(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],locale:["localeWatchHandler"],open:["openWatchHandler"]}}};q.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{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}.esri-editor__panel-content{padding-block:10px !important}";const U=class{constructor(i){t(this,i),this.popupClosed=e(this,"popupClosed",7),this.selectionChanged=e(this,"selectionChanged",7),this.enableEditGeometry=!1,this.graphics=void 0,this.isLoading=!1,this.isMobile=void 0,this.mapView=void 0,this.allowEditing=!0,this.highlightEnabled=!0,this.locale=void 0,this.paginationEnabled=!0,this.position="absolute",this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._mobileTitle="",this._showListView=!1,this._translations=void 0}get el(){return a(this)}Features;_editEnabled;_features;_layer;_popupUtils;_featuresNodeId="features-node"+(new Date).getMilliseconds().toString();reactiveUtils;async graphicsWatchHandler(){await this.setGraphics()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async localeWatchHandler(){if(this.el.lang=this.locale,await this._getTranslations(),this._features){const t=[...this.graphics];this.graphics=[],this.graphics=t}}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}popupClosed;selectionChanged;async closeEdit(){this._editRecordOpen=!1}async layerSelectionChange(){this._showListView=!1,this._features?.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 L}async componentDidLoad(){this.graphics?.length>0&&await this.setGraphics()}render(){const t=this.isLoading?"":"display-none",e=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",a=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",o=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",n=this._features?.features?.length<2,c=this.isMobile?"display-none":"",l=this._features?.selectedFeature?.getObjectId(),r=parseInt(l?.toString(),10)>-1?[l]:[],h=this._layer?.editingEnabled&&this._layer?.capabilities?.operations?.supportsDelete;return i(s,{key:"54e47d0ec2be9149c3e667c9e940842804d96964"},i("calcite-shell",{key:"14bb280d394ceaa74463979886ab09cdf393b26e",style:{position:this.position}},this._getHeader(),i("calcite-loader",{key:"3226709e73de16c795c348513183b26b88b7a726",class:t,label:this._translations.fetchingData}),i("div",{key:"ba4b0c34620c60e849bdf0ada785b9976156dd1c",class:"esri-widget feature-node "+e,id:this._featuresNodeId}),i("div",{key:"440a4d3c0530f97031df2e2ab9511ef6035fb5da",class:`${o} width-100`,slot:"footer"},this.allowEditing&&i("div",{key:"172b2e2cc10bdfb104057376ceba5d7f5f19ad61",class:"display-flex top-border padding-1-2"},i("calcite-button",{key:"242daf0ec6c3fe4fcc11be4bbc19f810836714ec",appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile&&h?i("delete-button",{class:"padding-inline-start-1 width-100",id:"solutions-delete",ids:r,layer:this._layer,locale:this.locale,onEditsComplete:()=>this._closePopup()}):void 0,i("calcite-tooltip",{key:"760f8fcd1bcff2060e0a98e84a222107e55fef22",placement:"bottom","reference-element":"solutions-edit"},i("span",{key:"30656b92e9bdbf3a9548586d91fc23bce2da9db3"},this._translations.edit)),this.isMobile?i("calcite-tooltip",{placement:"bottom","reference-element":"solutions-delete"},i("span",null,this._translations.delete)):void 0),this.paginationEnabled&&!n&&i("div",{key:"161902561c9686d74a511338dfc02efce0095af7",class:`display-flex padding-1-2 button-container top-border ${c}`},i("div",{key:"afd1459e3f69f60d96103854fe3dae71f18fc41e"},i("calcite-button",{key:"59063d7fa2cf886afca66857cb1f74e42789e59f",appearance:"transparent",disabled:n,iconFlipRtl:"both",iconStart:"chevron-left",id:"solutions-back",onClick:()=>this._back(),width:"full"}),i("calcite-tooltip",{key:"412e00bc323494bb1e3a7dbeef59ab9bcd6ff8e0",placement:"top","reference-element":"solutions-back"},i("span",{key:"7c1512be35f16b4441c2a364e1b7a87e3c7caf97"},this._translations.back))),i("calcite-action",{key:"d4790efec0d13e6726ffe9d438683db6887d00b8",class:"pagination-action",iconFlipRtl:!0,onClick:()=>this._toggleListView(),scale:"s",text:"",textEnabled:!0},i("span",{key:"98663d5c3b2f445db4e38cba98b8149c53cbc474",class:"pagination-count"},this._count)),i("div",{key:"6ca88610950cf2852e2dc67588c77fd464ece3c5"},i("calcite-button",{key:"577739ef819676dfd9cdee560a8cd22edcd9c6b7",appearance:"transparent",disabled:n,iconFlipRtl:"both",iconStart:"chevron-right",id:"solutions-next",onClick:()=>this._next(),width:"full"}),i("calcite-tooltip",{key:"73a4f907d1a2f46a980c451572f1ba1e1b0b0596",placement:"top","reference-element":"solutions-next"},i("span",{key:"d5f67497df866592b30d6c328f9f45716eb16153"},this._translations.next))))),i("edit-card",{key:"c8094993be5203f464cea4f632c14dbefa263a73",class:a,enableEditGeometry:this.enableEditGeometry,graphicIndex:this._features?.selectedFeatureIndex,graphics:this.graphics,locale:this.locale,mapView:this.mapView,open:this._editRecordOpen}),i("calcite-alert",{key:"0b9fd2109d7c6b51b91088ecbec50956a2d8d3d8",icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},i("div",{key:"c8b7b452430d6fedda5288fd58efae5526adeda7",slot:"title"},this._translations.editDisabled),i("div",{key:"b2dc954d43bb08908723f70796df5c77108d92d8",slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,e]=await W(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=e}async setGraphics(){this._features||await this._initFeaturesWidget(),this.graphics.length>0?(this._layer=this.graphics[0]?.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(){return void 0!==this.isMobile?await(this.mapView?.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:this._featuresNodeId,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.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?i("calcite-panel",{class:"border-width-0",slot:"header"},i("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),i("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(){const t=(this._features?.viewModel.selectedFeatureIndex+1).toString(),e=this._features?.features?.length.toString();return this._translations.indexOfTotal.replace("{{index}}",t).replace("{{total}}",e)}_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 F(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"]}}};U.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);font-weight:bold}";export{V as calcite_alert,O as calcite_flow_item,R as create_feature,q as edit_card,U as info_card}
|
17
|
+
const O=class{constructor(i){t(this,i),this.calciteFlowItemBack=e(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=e(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=e(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=e(this,"calciteFlowItemToggle",6),this.handleInternalPanelScroll=t=>{t.target===this.containerEl&&(t.stopPropagation(),this.calciteFlowItemScroll.emit())},this.handleInternalPanelClose=t=>{t.target===this.containerEl&&(t.stopPropagation(),this.closed=!0,this.calciteFlowItemClose.emit())},this.handleInternalPanelToggle=t=>{t.target===this.containerEl&&(t.stopPropagation(),this.collapsed=t.target.collapsed,this.calciteFlowItemToggle.emit())},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=t=>{this.backButtonEl=t},this.setContainerRef=t=>{this.containerEl=t},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.beforeClose=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){u(this),v(this)}async componentWillLoad(){await w(this),p(this)}componentDidRender(){C(this)}disconnectedCallback(){g(this),k(this)}componentDidLoad(){f(this)}effectiveLocaleChange(){x(this,this.effectiveLocale)}async setFocus(){await b(this);const{backButtonEl:t,containerEl:e}=this;return t?t.setFocus():e?e.setFocus():void 0}async scrollContentTo(t){await(this.containerEl?.scrollContentTo(t))}renderBackButton(){const{el:t}=this,e="rtl"===h(t),{showBackButton:s,backButtonClick:a,messages:o}=this,n=o.back;return s?i("calcite-action",{"aria-label":n,class:"back-button",icon:e?"chevron-right":"chevron-left",key:"flow-back-button",onClick:a,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:n,title:n}):null}render(){const{collapsed:t,collapseDirection:e,collapsible:a,closable:o,closed:n,description:c,disabled:l,heading:r,headingLevel:h,loading:d,menuOpen:p,messages:f,overlayPositioning:b,beforeClose:m}=this;return i(s,{key:"2e7872bb2687db0b67ddbf375f8ec0beaabbda36"},i(z,{key:"a9418954405a2cec2092bae3be5d77f02306e3c9",disabled:l},i("calcite-panel",{key:"d563c751421bf2d66c03286deaa613e09f585546",beforeClose:m,closable:o,closed:n,collapseDirection:e,collapsed:t,collapsible:a,description:c,disabled:l,heading:r,headingLevel:h,loading:d,menuOpen:p,messageOverrides:f,onCalcitePanelClose:this.handleInternalPanelClose,onCalcitePanelScroll:this.handleInternalPanelScroll,onCalcitePanelToggle:this.handleInternalPanelToggle,overlayPositioning:b,ref:this.setContainerRef,scale:this.scale},this.renderBackButton(),i("slot",{key:"c506ec8bb4debbd6a9da6c7941878de49776f614",name:"action-bar",slot:E.actionBar}),i("slot",{key:"e76e55e654ff878acff734bdf387402a9e262159",name:"alerts",slot:E.alerts}),i("slot",{key:"f7ab8839d7b101e31087130ebf3e36af1ec7da24",name:"header-actions-start",slot:E.headerActionsStart}),i("slot",{key:"2932c4c15b168732356b8e55fcc3064f5b3f4cf5",name:"header-actions-end",slot:E.headerActionsEnd}),i("slot",{key:"1ef8a9050683022733695445092f8c626487d87b",name:"header-content",slot:E.headerContent}),i("slot",{key:"24c0ab570a601a6c0edfb0c820e580fd24b158ce",name:"header-menu-actions",slot:E.headerMenuActions}),i("slot",{key:"ec55bbe7ba939a6efb35225850c37a1aadb97275",name:"fab",slot:E.fab}),i("slot",{key:"aa0bfec47656ef9f7f575cd933897a7909e5badc",name:"content-top",slot:E.contentTop}),i("slot",{key:"e23532d080e2df529c2aeb6af043c6efe7a0ab6d",name:"content-bottom",slot:E.contentBottom}),i("slot",{key:"db6ffc0d9300c77067a4c88ab277de685c7713af",name:"footer-start",slot:E.footerStart}),i("slot",{key:"5f249356da9292f34c4036d0d0741f048fe999e9",name:"footer",slot:E.footer}),i("slot",{key:"7476137bacc0f3be5c97682c5027f74d73254765",name:"footer-end",slot:E.footerEnd}),i("slot",{key:"58f60a46c42a05abe9b100a57d478d991e4f25bc",name:"footer-actions",slot:E.footerActions}),i("slot",{key:"926a8d94b76b6fcdef6dfd219ba8180c44f81c35"}))))}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};O.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}";const R=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.drawComplete=e(this,"drawComplete",7),this.editingAttachment=e(this,"editingAttachment",7),this.progressStatus=e(this,"progressStatus",7),this.modeChanged=e(this,"modeChanged",7),this.mapView=void 0,this.selectedLayerId=void 0,this.customizeSubmit=!1,this.locale=void 0,this.searchConfiguration=void 0,this.isMobile=void 0,this.floorLevel=void 0,this.formElements=void 0,this.enableSearch=!1,this.showGuidingMsg=!0,this.showGuidingMsgWhileDrawing=!0,this._editorLoading=!1,this._currentPage="templatePicker",this._translations=void 0}get el(){return a(this)}Editor;ExpressionInfo;FieldElement;FormTemplate;_editor;FeatureLayer;MapView;_updatedMapView;Search;_search;reactiveUtils;_addingAttachment;_container;_mapViewContainer;_isSubmitBtnClicked=!1;_selectedLayer;_searchDiv;_calciteNotice;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async isMobileHandler(){this.modeChanged.emit()}async _editorLoadingWatchHandler(t){if(t){if(this._container?.classList.add("display-none"),this._selectedLayer?.isTable){const t={layer:this._selectedLayer,template:this._selectedLayer.templates[0]};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(t),await this.hideEditorsElements()}else await this.startCreate();this._container?.classList.remove("display-none"),this._editorLoading=!1}}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async refresh(t){this._editor&&this._setFloorLevel(t)}success;fail;drawComplete;editingAttachment;progressStatus;modeChanged;async componentWillLoad(){await this._getTranslations(),await this.initModules()}async componentDidLoad(){await this.init()}componentDidRender(){this.isMobile&&(this._mapViewContainer.style.top=`${this._calciteNotice.offsetHeight+this._searchDiv.offsetHeight+80}px`)}disconnectedCallback(){this._editor&&this._editor.destroy()}render(){const t="drawing"===this._currentPage?"":"display-none",e=this._editorLoading?"":"display-none",s=this._editorLoading?"display-none":"",a=this.isMobile?"show-map":"display-none";let n=this._translations.chooseCategoryMsg;return"drawing"===this._currentPage?n=this._translations.provideLocationMsg:"featureForm"===this._currentPage&&(n=this._translations.provideDetailsMsg),i(o,{key:"788b2ebb85b603452d4b4de05711510f7480c895"},this.showGuidingMsg&&(this.showGuidingMsgWhileDrawing||"drawing"!==this._currentPage)&&i("calcite-notice",{key:"cf41e701f5a7605531fa6351acf13ea20e219f7a",class:"notice-msg",icon:"lightbulb",kind:"success",open:!0,ref:t=>this._calciteNotice=t},i("div",{key:"1bb493a8e5a962c8a8c75ac37156edbf866c3916",slot:"message"},n)),i("calcite-loader",{key:"5d2e9a465cb7c6dbde8d941497fda87b4fc7c258",class:e,label:"",scale:"s"}),i("div",{key:"23b8651f4040443ba731173d1818b515b718b754",class:s,id:"feature-form"}),this.enableSearch&&i("div",{key:"7f628d09111295d46fbf7b9605999c2ef88c258d",class:`search-widget ${t} ${s}`,id:"search-widget-ref",ref:t=>this._searchDiv=t}),i("div",{key:"3def9aaab0a2f03076a6c4c645cf5a080bbb9e75",class:`${a}`,ref:t=>{this._mapViewContainer=t}}))}async init(){this.mapView&&this.selectedLayerId&&(this._updatedMapView=this.mapView,await(this.isMobile?this.createMobileMapView():this._loadWidgets()))}async initModules(){const[t,e,i,s,a,o,n]=await W(["esri/widgets/Editor","esri/core/reactiveUtils","esri/widgets/Search","esri/form/ExpressionInfo","esri/form/elements/FieldElement","esri/form/FormTemplate","esri/views/MapView"]);this.Editor=t,this.reactiveUtils=e,this.Search=i,this.ExpressionInfo=s,this.FieldElement=a,this.FormTemplate=o,this.MapView=n}async createMobileMapView(){this._mapViewContainer.classList.add("hide-map"),await new this.MapView({map:this.mapView.map,container:this._mapViewContainer,zoom:this.mapView.zoom}).when((t=>{this._updatedMapView=t,this._loadWidgets()}),(t=>{console.log(t)}))}async _loadWidgets(){await this.createEditorWidget(),this.enableSearch&&await this.createSearchWidget()}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[];this._container=document.createElement("div"),this._container?.classList.add("display-none");const e=await F(this._updatedMapView);this._selectedLayer=await j(this.mapView,this.selectedLayerId),this._selectedLayer?.isTable||e.forEach((async e=>{t.push({layer:e,enabled:"feature"===e?.type&&e?.id===this.selectedLayerId,addEnabled:!0,updateEnabled:!1,deleteEnabled:!1})})),this._editor=new this.Editor({view:this._updatedMapView,layerInfos:t,visibleElements:{snappingControls:!1,createFeaturesSection:!0,editFeaturesSection:!1},container:this._container}),this._mapViewContainer?this.el.insertBefore(this._container,this._mapViewContainer):this.el.appendChild(this._container);const i=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.editingAttachment.emit(!0)):this._addingAttachment&&(this.editingAttachment.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&"create-features"!==this._editor.viewModel?.activeWorkflow?.type&&(this.progressStatus.emit(.5),this._editorLoading=!0)}));this._editor.viewModel.addHandles(s);const a=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&(this._mapViewContainer?.classList?.replace("show-map","hide-map"),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),setTimeout((()=>{this._setFloorLevel(this.floorLevel)}),50),this._currentPage="featureForm",this.progressStatus.emit(1),this.drawComplete.emit())}));this._editor.viewModel.addHandles(a);const o=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"creating-features"===t&&"disabled"===this._editor.viewModel.featureFormViewModel.state&&(this._mapViewContainer?.classList?.replace("hide-map","show-map"),this._selectedLayer&&!this._selectedLayer.isTable&&(this._currentPage="drawing"))}));this._editor.viewModel.addHandles(o)}async startCreate(){return await this.hideEditorsElements(),new Promise(((t,e)=>{if(this._editor.viewModel.featureTemplatesViewModel.items?.length){const i=this._editor.viewModel.featureTemplatesViewModel.items[0].get("items");this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{this.progressStatus.emit(.75),setTimeout((()=>{this.hideEditorsElements().then((()=>{t({})}),(t=>e(t)))}),700)})),1===i.length&&this._editor.viewModel.featureTemplatesViewModel.select(i[0]);const s=i.length>1;this.hideEditorsElements().then((()=>{s&&t({})}),(t=>s&&e(t)))}}))}async createSearchWidget(){let t={view:this._updatedMapView};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this._updatedMapView)}),this._search=new this.Search(t),this._search.container="search-widget-ref",this._search.popupEnabled=!1,this._search.resultGraphicEnabled=!1;let e=null;this._search.on("search-complete",(t=>{this._updatedMapView.goTo(t.results[0].results[0].extent),"point"===this._selectedLayer.geometryType&&(e=t.results[0].results[0]?.feature.geometry)}));const i=this.reactiveUtils.watch((()=>this._search.viewModel.state),(t=>{"ready"===t&&setTimeout((()=>{this._editor.viewModel.sketchViewModel.createGraphic&&e&&(this._editor.viewModel.sketchViewModel.createGraphic.set("geometry",e),this._editor.viewModel.sketchViewModel.complete(),this.hideEditorsElements())}),100)}));this._search.viewModel.addHandles(i)}_getSearchConfig(t,e){const i=t.sources;return i?.length>0?(t.includeDefaultSources=!1,i.forEach((t=>{if(t.hasOwnProperty("layer")){const i=t,s=i.layer?.id,a=s?e.map.findLayerById(s):null,o=i?.layer?.url;a?i.layer=a:o&&(i.layer=new this.FeatureLayer(o))}})),i?.forEach((t=>{if(t.hasOwnProperty("locator")){const e=t;"ArcGIS World Geocoding Service"===e?.name&&(e.outFields=e.outFields||["Addr_type","Match_addr","StAddr","City"],e.singleLineFieldName="SingleLine"),e.url=e.url,delete e.url}}))):t={...t,includeDefaultSources:!0},t}async _setFloorLevel(t){if(!t)return;const e=this._selectedLayer;if(e?.floorInfo?.floorField){const i=e.fields.find((t=>t.name===e.floorInfo.floorField));if(i&&!e?.formTemplate)this._editor.viewModel.featureFormViewModel.setValue(i.name,t),i.editable=!1;else if(e.formTemplate&&this.formElements){const i=new this.ExpressionInfo({expression:`"${t}"`,name:"floor-info-test",title:"Floor Info",returnType:"string"}),s=new this.FieldElement({label:e.floorInfo.floorField,editableExpression:"false",fieldName:e.floorInfo.floorField,input:{type:"text-box",maxLength:50,minLength:0},valueExpression:i.name});this._updatedMapView.map.editableLayers.forEach((t=>{const e=this.formElements.orgExpressionInfos,a=[...this.formElements.orgElements];a.push(s);const o=new this.FormTemplate({title:t.formTemplate.title,description:t.formTemplate.description,elements:a,expressionInfos:[i].concat(e)});t.formTemplate=o}))}}}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector(".esri-editor")?.querySelectorAll("calcite-flow-item")?.forEach((t=>{const e=t.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");e?.querySelector("header")?.setAttribute("style","display: none"),e?.querySelector("footer")?.setAttribute("style","display: none")})))}async submitted(t){if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(t.valid.length&&this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{await this._editor.activeWorkflow.commit(),this._editor.viewModel.failures?.length&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}timeout(t){return new Promise((e=>setTimeout(e,t)))}async _getTranslations(){const t=await H(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],isMobile:["isMobileHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};R.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 14px 20px 14px}.display-none{display:none !important}.hide-map{height:1%;visibility:hidden}.show-map{padding:10px !important;position:absolute !important;bottom:0;height:auto !important;width:calc(100% - 22px)}.notice-msg{padding:10px;width:calc(100% - 20px)}.esri-editor__panel-content{padding-block:10px !important}@media only screen and (max-width: 600px){.esri-editor__panel-content{padding-block:0 !important;min-height:0 !important}}";const q=class{constructor(i){t(this,i),this.editsComplete=e(this,"editsComplete",7),this.deleteDialog=void 0,this.buttonType="button",this.disabled=!1,this.icon=void 0,this.ids=[],this.layer=void 0,this.locale=void 0,this._confirmDelete=!1,this._deleteEndabled=!1,this._supportsDelete=void 0,this._translations=void 0}get el(){return a(this)}async idsWatchHandler(){this._setDeleteEnabled()}async layerWatchHandler(){this._setDeleteEnabled()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}editsComplete;async componentWillLoad(){await this._getTranslations()}render(){return i(s,{key:"1816da3d5cd7903b4e699dffa4ac4836dca722bb"},"button"===this.buttonType?i("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())):i("calcite-action",{appearance:"solid",compact:!0,disabled:!this._deleteEndabled,id:this.icon,onClick:()=>this._delete(),scale:"s",text:this._translations.delete},i("calcite-button",{appearance:"transparent",iconStart:this.icon,kind:"danger"},this._translations.delete)),this._deleteMessage(),i("calcite-tooltip",{key:"26fc4d4b4ea02b7a6c5e3f87abe2c5b8f96a3654",placement:"bottom","reference-element":"button"===this.buttonType?"solutions-delete":this.icon},i("span",{key:"c2f7b101bb3a99274fe7f364ad29365c212d856e"},this._translations.delete)))}async componentDidLoad(){this._setDeleteEnabled()}_setDeleteEnabled(){this._supportsDelete=this.layer?.editingEnabled&&this.layer?.capabilities?.operations?.supportsDelete,this._deleteEndabled=!this.disabled||this._supportsDelete&&this.ids.length>0}_delete(){this._confirmDelete=!0}_deleteMessage(){return this.deleteDialog?this.deleteDialog:i("delete-dialog",{id:"solution-delete-dialog",ids:this.ids,layer:this.layer,locale:this.locale,onDeleteDialogClose:()=>this._confirmDelete=!1,open:this._confirmDelete})}async _getTranslations(){const t=await H(this.el);this._translations=t[0]}static get watchers(){return{ids:["idsWatchHandler"],layer:["layerWatchHandler"],locale:["localeWatchHandler"]}}};q.style=":host{display:block}.delete-modal{position:fixed}";const U=class{constructor(i){t(this,i),this.closeEdit=e(this,"closeEdit",7),this.editsComplete=e(this,"editsComplete",7),this.refreshGraphics=e(this,"refreshGraphics",7),this.enableEditGeometry=!1,this.graphics=void 0,this.locale=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._editorLoading=!1,this._translations=void 0}get el(){return a(this)}_activeWorkflowHandle;_addRelatedRecordHandle;_attachmentHandle;_editHandle;_layerEditHandle;Editor;_editor;_layer;_editContainer;_editControlElements;_editingDisabled;_shouldClose=!1;reactiveUtils;async graphicsWatchHandler(){0===this.graphics.length&&this.open&&await this._closeEdit(!0)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async openWatchHandler(t){t&&this.graphics?.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)}closeEdit;editsComplete;refreshGraphics;async featureSelectionChange(){this.open&&await this._closeEdit(!1)}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){this.graphics?.length>0&&this.graphics[0]?.layer&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=("subtype-sublayer"===this._layer.type?this._layer.parent:this._layer).on("edits",(()=>{this.editsComplete.emit()})))}render(){const t=this._editorLoading?"display-none":"position-absolute",e=this._editorLoading?"":"display-none";return i(s,{key:"15ae3de9c8ab0a66a0185ffaafc27f03e19c77b7"},i("div",{key:"bbaa7dbc405259b64dfceca89e45abf6372c76c3",class:"position-absolute"},this.graphics?.length>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled?void 0:i("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},i("div",{slot:"message"},this._translations.enableEditing)),i("div",{key:"eb8b08fa0b08cf93581fb8e76d59bd8b5446770f",class:"position-absolute"},i("div",{key:"03e525373c09fbcd4dad213738d97b99f1549975",class:t,id:"feature-form",ref:t=>this._editContainer=t}),i("calcite-loader",{key:"1cc46d8f6499a90736e05c2eed9bff71aff35d12",class:e,label:"",scale:"s"}))))}async _initModules(){const[t,e]=await W(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=e}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),e=(await F(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:this.enableEditGeometry})));this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,layerInfos:e,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((()=>this._editor.viewModel.activeWorkflow?.activeWorkflow),(t=>{"update-table-record"!==t?.type&&"create-features"!==t?.type||(this._shouldClose=!1),(t?.type||t?.hasPendingEdits||this._editor.activeWorkflow)&&this._editor?.activeWorkflow?.started||(this.open=!1)})),this._editContainer.appendChild(t)}}async _closeEdit(t){this._shouldClose=!0,t&&this._editor?.activeWorkflow?(this._editor.activeWorkflow?.activeWorkflow?.hasPendingEdits&&(await this._editor.activeWorkflow.reset(),await this._editor.cancelWorkflow()),this._editor.destroy()):this.graphicIndex>-1&&this.graphics?.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 H(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],locale:["localeWatchHandler"],open:["openWatchHandler"]}}};U.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{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}.esri-editor__panel-content{padding-block:10px !important}";const $=class{constructor(i){t(this,i),this.popupClosed=e(this,"popupClosed",7),this.selectionChanged=e(this,"selectionChanged",7),this.enableEditGeometry=!1,this.graphics=void 0,this.isLoading=!1,this.isMobile=void 0,this.mapView=void 0,this.allowEditing=!0,this.highlightEnabled=!0,this.locale=void 0,this.paginationEnabled=!0,this.position="absolute",this._alertOpen=!1,this._count="",this._editRecordOpen=!1,this._mobileTitle="",this._showListView=!1,this._translations=void 0}get el(){return a(this)}Features;_editEnabled;_features;_layer;_popupUtils;_featuresNodeId="features-node"+(new Date).getMilliseconds().toString();reactiveUtils;async graphicsWatchHandler(){await this.setGraphics()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async localeWatchHandler(){if(this.el.lang=this.locale,await this._getTranslations(),this._features){const t=[...this.graphics];this.graphics=[],this.graphics=t}}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}popupClosed;selectionChanged;async closeEdit(){this._editRecordOpen=!1}async layerSelectionChange(){this._showListView=!1,this._features?.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 L}async componentDidLoad(){this.graphics?.length>0&&await this.setGraphics()}render(){const t=this.isLoading?"":"display-none",e=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",a=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",o=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",n=this._features?.features?.length<2,c=this.isMobile?"display-none":"",l=this._features?.selectedFeature?.getObjectId(),r=parseInt(l?.toString(),10)>-1?[l]:[],h=this._layer?.editingEnabled&&this._layer?.capabilities?.operations?.supportsDelete;return i(s,{key:"54e47d0ec2be9149c3e667c9e940842804d96964"},i("calcite-shell",{key:"14bb280d394ceaa74463979886ab09cdf393b26e",style:{position:this.position}},this._getHeader(),i("calcite-loader",{key:"3226709e73de16c795c348513183b26b88b7a726",class:t,label:this._translations.fetchingData}),i("div",{key:"ba4b0c34620c60e849bdf0ada785b9976156dd1c",class:"esri-widget feature-node "+e,id:this._featuresNodeId}),i("div",{key:"440a4d3c0530f97031df2e2ab9511ef6035fb5da",class:`${o} width-100`,slot:"footer"},this.allowEditing&&i("div",{key:"172b2e2cc10bdfb104057376ceba5d7f5f19ad61",class:"display-flex top-border padding-1-2"},i("calcite-button",{key:"242daf0ec6c3fe4fcc11be4bbc19f810836714ec",appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile&&h?i("delete-button",{class:"padding-inline-start-1 width-100",id:"solutions-delete",ids:r,layer:this._layer,locale:this.locale,onEditsComplete:()=>this._closePopup()}):void 0,i("calcite-tooltip",{key:"760f8fcd1bcff2060e0a98e84a222107e55fef22",placement:"bottom","reference-element":"solutions-edit"},i("span",{key:"30656b92e9bdbf3a9548586d91fc23bce2da9db3"},this._translations.edit)),this.isMobile?i("calcite-tooltip",{placement:"bottom","reference-element":"solutions-delete"},i("span",null,this._translations.delete)):void 0),this.paginationEnabled&&!n&&i("div",{key:"161902561c9686d74a511338dfc02efce0095af7",class:`display-flex padding-1-2 button-container top-border ${c}`},i("div",{key:"afd1459e3f69f60d96103854fe3dae71f18fc41e"},i("calcite-button",{key:"59063d7fa2cf886afca66857cb1f74e42789e59f",appearance:"transparent",disabled:n,iconFlipRtl:"both",iconStart:"chevron-left",id:"solutions-back",onClick:()=>this._back(),width:"full"}),i("calcite-tooltip",{key:"412e00bc323494bb1e3a7dbeef59ab9bcd6ff8e0",placement:"top","reference-element":"solutions-back"},i("span",{key:"7c1512be35f16b4441c2a364e1b7a87e3c7caf97"},this._translations.back))),i("calcite-action",{key:"d4790efec0d13e6726ffe9d438683db6887d00b8",class:"pagination-action",iconFlipRtl:!0,onClick:()=>this._toggleListView(),scale:"s",text:"",textEnabled:!0},i("span",{key:"98663d5c3b2f445db4e38cba98b8149c53cbc474",class:"pagination-count"},this._count)),i("div",{key:"6ca88610950cf2852e2dc67588c77fd464ece3c5"},i("calcite-button",{key:"577739ef819676dfd9cdee560a8cd22edcd9c6b7",appearance:"transparent",disabled:n,iconFlipRtl:"both",iconStart:"chevron-right",id:"solutions-next",onClick:()=>this._next(),width:"full"}),i("calcite-tooltip",{key:"73a4f907d1a2f46a980c451572f1ba1e1b0b0596",placement:"top","reference-element":"solutions-next"},i("span",{key:"d5f67497df866592b30d6c328f9f45716eb16153"},this._translations.next))))),i("edit-card",{key:"c8094993be5203f464cea4f632c14dbefa263a73",class:a,enableEditGeometry:this.enableEditGeometry,graphicIndex:this._features?.selectedFeatureIndex,graphics:this.graphics,locale:this.locale,mapView:this.mapView,open:this._editRecordOpen}),i("calcite-alert",{key:"0b9fd2109d7c6b51b91088ecbec50956a2d8d3d8",icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},i("div",{key:"c8b7b452430d6fedda5288fd58efae5526adeda7",slot:"title"},this._translations.editDisabled),i("div",{key:"b2dc954d43bb08908723f70796df5c77108d92d8",slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,e]=await W(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=e}async setGraphics(){this._features||await this._initFeaturesWidget(),this.graphics.length>0?(this._layer=this.graphics[0]?.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(){return void 0!==this.isMobile?await(this.mapView?.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:this._featuresNodeId,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.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?i("calcite-panel",{class:"border-width-0",slot:"header"},i("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),i("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(){const t=(this._features?.viewModel.selectedFeatureIndex+1).toString(),e=this._features?.features?.length.toString();return this._translations.indexOfTotal.replace("{{index}}",t).replace("{{total}}",e)}_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 H(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"]}}};$.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);font-weight:bold}";export{V as calcite_alert,O as calcite_flow_item,R as create_feature,q as delete_button,U as edit_card,$ as info_card}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as e,g as a,h as i,H as t}from"./p-4e6eb06e.js";import{c as l}from"./p-747d4b59.js";const s=class{constructor(a){e(this,a),this.showAddDeduct=!1}get el(){return a(this)}_deductValuesElement;render(){const e=this.showAddDeduct?"position-relative":"display-none";return i(t,{key:"
|
6
|
+
import{r as e,g as a,h as i,H as t}from"./p-4e6eb06e.js";import{c as l}from"./p-747d4b59.js";const s=class{constructor(a){e(this,a),this.showAddDeduct=!1}get el(){return a(this)}_deductValuesElement;render(){const e=this.showAddDeduct?"position-relative":"display-none";return i(t,{key:"4f333fa9aecd33cf2b34d85802c79256073f940c"},i("div",{key:"6946f22e384fac51a20e2efb7b4ddbf2de7517ed",class:this.showAddDeduct?"display-none":"display-grid"},i("div",{key:"e30e88571eb1b89588798d51ba788e4b6dc7d269",class:"label-display"},i("calcite-label",{key:"034582e553ac4191939095cec8d836bc567ea77e",class:"label-display"},"Enter comma delimited deduct values",this._getDeductValuesInput())),i("div",{key:"7fc1ae8d901b0a1ce820e53e225b275f1d779eb6"},this._getCalculateButton())),i("div",{key:"b74849f5007f54d3019be5e18a85769186edfffa",class:e},i("div",{key:"ae8bf9314b0ead0b3f9d220d81cc410c2a29dc6f",class:"position-right"},i("calcite-action",{key:"cac38dc7e539275a0baeb0511fb8a09e8f96fa7a",appearance:"transparent",class:"float-end",icon:"x",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""})),i("deduct-calculator",{key:"68bcd78e3ef4505e5b1e5f0ea76d15f9e00fc18d",class:"display-grid padding-top-1",onDeductValueComplete:e=>this._addDeductValue(e)})))}_getDeductValuesInput(){return i("div",{class:"display-flex"},i("calcite-input",{class:"main-input",ref:e=>{this._deductValuesElement=e}}),i("calcite-action",{appearance:"transparent",icon:"plus-circle",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""}))}_getCalculateButton(){return i("calcite-button",{onClick:()=>this._calculatePCI(this._deductValuesElement.value)},"Calculate PCI")}_toggleShowAddDeduct(){this.showAddDeduct=!this.showAddDeduct}_addDeductValue(e){this._toggleShowAddDeduct(),this._deductValuesElement.value+=Math.abs(parseFloat(this._deductValuesElement.value))>0?`,${e.detail}`:e.detail}_calculatePCI(e){const a=l(e,!0),i=a<=10?"Failed":a<=25?"Serious":a<=40?"Very Poor":a<=55?"Poor":a<=70?"Fair":a<=85?"Satisfactory":"Good";console.log(`PCI: ${a}`),console.log(`Rating: ${i}`),alert("See debug console for results")}};s.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";export{s as pci_calculator}
|
@@ -44,4 +44,4 @@ function qt(t,e,i){const{items:a,messages:o}=i,s=a.length,n=B(i,t)+1;return func
|
|
44
44
|
* See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
45
45
|
* v2.13.0
|
46
46
|
*/
|
47
|
-
const Xt="actions-end",Yt="actions-start";dt.deprecated("component",{name:"value-list-item",removalVersion:3,suggested:"list-item"});const Qt=class{constructor(i){t(this,i),this.calciteListItemChange=e(this,"calciteListItemChange",6),this.calciteListItemRemove=e(this,"calciteListItemRemove",7),this.calciteValueListItemDragHandleBlur=e(this,"calciteValueListItemDragHandleBlur",6),this.pickListItem=null,this.guid=`calcite-value-list-item-${L()}`,this.getPickListRef=t=>this.pickListItem=t,this.handleKeyDown=t=>{" "===t.key&&(this.handleActivated=!this.handleActivated)},this.handleBlur=()=>{this.handleActivated=!1,this.calciteValueListItemDragHandleBlur.emit({item:this.el,handle:this.handleEl})},this.handleSelectChange=t=>{this.selected=t.detail.selected},this.description=void 0,this.disabled=!1,this.deselectDisabled=!1,this.nonInteractive=!1,this.handleActivated=!1,this.icon=null,this.iconFlipRtl=!1,this.label=void 0,this.metadata=void 0,this.removable=!1,this.selected=!1,this.value=void 0}connectedCallback(){c(this)}disconnectedCallback(){r(this)}componentWillLoad(){R(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}async toggleSelected(t){this.pickListItem.toggleSelected(t)}async setFocus(){return await N(this),this.pickListItem?.setFocus()}calciteListItemChangeHandler(t){t.detail.item=this.el}renderActionsEnd(){const{el:t}=this;return y(t,Xt)?i("slot",{name:Xt,slot:bt.actionsEnd}):null}renderActionsStart(){const{el:t}=this;return y(t,Yt)?i("slot",{name:Yt,slot:bt.actionsStart}):null}renderHandle(){const{icon:t,iconFlipRtl:e}=this;if(t===pt.grip)return i("span",{class:{[ht.handle]:!0,[ht.handleActivated]:this.handleActivated},"data-js-handle":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,ref:t=>this.handleEl=t,role:"button",tabindex:"0"},i("calcite-icon",{flipRtl:e,icon:"drag",scale:"s"}))}render(){return i(s,{key:"2fc2a1a70b75c2a812f14391915c06c852db8906",id:this.el.id||this.guid},i(A,{key:"7bcc26a8f85923865a318dbdf31954a62035b853",disabled:this.disabled},this.renderHandle(),i("calcite-pick-list-item",{key:"abdbbafe6d426da62e39584e85111811beae719b",description:this.description,deselectDisabled:this.deselectDisabled,disabled:this.disabled,label:this.label,metadata:this.metadata,nonInteractive:this.nonInteractive,onCalciteListItemChange:this.handleSelectChange,ref:this.getPickListRef,removable:this.removable,selected:this.selected,value:this.value},this.renderActionsStart(),this.renderActionsEnd())))}get el(){return o(this)}};Qt.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{margin-block-end:1px;box-sizing:border-box;display:flex;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-2);--tw-shadow:0 1px 0 var(--calcite-color-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition:background-color var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}:host *{box-sizing:border-box}calcite-pick-list-item{position:relative;margin:0px;flex-grow:1;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([active]),:host([selected]){--tw-shadow:0 0 0 1px var(--calcite-color-brand);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.handle{display:flex;cursor:move;align-items:center;justify-content:center;border-style:none;background-color:transparent;padding-block:0px;padding-inline:0.25rem;color:var(--calcite-color-border-input);outline-color:transparent}.handle:hover{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.handle:focus{outline:2px solid var(--calcite-ui-focus-color, 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 )}.handle--activated{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}.handle calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}";const Zt=class{constructor(e){t(this,e),this.hasChanges=!1,this.hasErrors=!1,this.instanceid="",this.locale=void 0,this.value=""}get el(){return o(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentDidLoad(){const t=document.getElementById(`${this.instanceid}-container`);if(t){this._editor=monaco.editor.create(t,{value:this.value,language:"json",theme:"vs",minimap:{enabled:!1},automaticLayout:!0,scrollBeyondLastLine:!1}),this._currentModel=this._editor.getModel(),this._contentChanged=this._currentModel.onDidChangeContent(this._onEditorChange.bind(this));const e=monaco.editor.setModelMarkers,i=this;monaco.editor.setModelMarkers=function(t,a,o){t.id===i._currentModel.id&&(i._flagEditorHasErrors(o.length>0),i.hasErrors||(i._flagEditorHasChanges(i._currentModel?.canUndo()),i._currentModel?.canUndo()&&i._flagEditorContentChanged()),document.getElementById(`${i.instanceid}-errorFlag`).style.visibility=i.hasErrors?"visible":"hidden"),e.call(monaco.editor,t,a,o)},this._diffEditor=monaco.editor.createDiffEditor(document.getElementById(`${this.instanceid}-diff-container`),{automaticLayout:!0}),this._setDiffModel(),this._loaded=!0,this._toggleUndoRedo()}}async componentWillLoad(){this._initValueObserver(),await this._getTranslations()}render(){return i(s,{key:"ba7c8a397da913d86f5d294cdfbb5ec1b84d89de"},i("div",{key:"bc5c6d1ee443b2096cc44d0b66850d4ebe8462da",id:`${this.instanceid}-editor-container`,class:"editor-container padding-right"},i("div",{key:"dbaf682cba354ce7eef21b03a71832fd39911332",class:"editor-controls"},i("div",{key:"e454e1dd36aa620abf2ffb7877bebb9adc70ff15",class:"editor-buttons"},i("calcite-icon",{key:"1de67e151c6e65b004a431d89dc785ca286a8e11",id:`${this.instanceid}-errorFlag`,icon:"exclamation-mark-triangle",title:this._translations.errorFlag,scale:"s",class:"edit-error-flag"}),i("calcite-button",{key:"33de20955d29287a3ec981e7650562a036343e3a",id:`${this.instanceid}-undo`,color:"blue",appearance:"solid",title:this._translations.undo,onClick:()=>this._undo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"9bed02f1e8a367ad2ed764747f044a4ce27de52b",icon:"undo",scale:"s"})),i("calcite-button",{key:"07562443286c4eeec28577a7cff0401e8cea0ba8",id:`${this.instanceid}-redo`,color:"blue",appearance:"solid",title:this._translations.redo,onClick:()=>this._redo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"5f24902a66eae644d0d358a4826a98d45e905493",icon:"redo",scale:"s"})),i("calcite-button",{key:"02f4f3f8ab93e5f1146176ec3699e2a6d25ecbeb",id:`${this.instanceid}-diff`,color:"blue",appearance:"solid",title:this._translations.diff,onClick:()=>this._toggleEditor(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"0bcd20d28e9ec34f1736a2888d78bfcd9cb82a4d",icon:"compare",scale:"s"})),i("calcite-button",{key:"cf3a7672ebd3ebef00123096ec304456b8f102fc",id:`${this.instanceid}-search`,appearance:"outline",color:"blue",title:this._translations.search,onClick:()=>this._search(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"36aac5e89ebf593d8d1981d7b8f6267fbbadfd24",icon:"search",scale:"s"})),i("calcite-button",{key:"cc981ff7580acfa3a3395c4ce7a96b3022bbbb4b",id:`${this.instanceid}-reset`,color:"blue",appearance:"solid",disabled:!0,title:this._translations.cancelEdits,onClick:()=>this._reset(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"3c4fc1da749f4b4f64d814fcd58dc035634f6b1b",icon:"reset",scale:"s"})))),i("div",{key:"6c33ec4851d804dac7fd9762e3c8c7e416a27cf4",class:"edit-parent"},i("div",{key:"a6e9721127bbd43f9974af65e0899489370e1868",id:`${this.instanceid}-container`,class:"json-edit-container"}),i("div",{key:"c1d1ea305c0e451c24beddb8ac3f8e85a3fca088",id:`${this.instanceid}-diff-container`,class:"json-edit-container display-none"}))))}_cancelEditsBtnHandler;_contentChanged;_currentModel;_diffEditor;_editor;_loaded=!1;_searchBtnHandler;_translations;_useDiffEditor=!1;_valueObserver;async getEditorContents(){return new Promise(((t,e)=>{try{t(this._currentModel.getValue())}catch(t){e(t)}}))}async prepareForDeletion(){this._searchBtnHandler?.removeEventListener("click",this._search),this._cancelEditsBtnHandler?.removeEventListener("click",this._reset),this._valueObserver?.disconnect(),this._contentChanged?.dispose(),this._editor?.dispose()}async replaceCurrentSelection(t){const e=this._editor.getSelection();this._editor.executeEdits("",[{range:e,text:t}])}async reset(){return new Promise(((t,e)=>{try{this._reset(),t({success:!0})}catch(t){e(t)}}))}_disableButton(t){document.getElementById(t)?.setAttribute("disabled","")}_enableButton(t){document.getElementById(t)?.removeAttribute("disabled")}_flagEditorContentChanged(){window.dispatchEvent(new CustomEvent("solutionEditorContentChanged",{detail:{id:this.instanceid,contents:this._currentModel.getValue()},bubbles:!0,cancelable:!1,composed:!0}))}_flagEditorHasChanges(t){this.hasChanges!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasChanges",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasChanges=t)}_flagEditorHasErrors(t){this.hasErrors!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasErrors",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasErrors=t)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}_initValueObserver(){this._valueObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"value"===t.attributeName&&t.target[t.attributeName]!==t.oldValue&&this._loaded&&this._currentModel.setValue(this.value)}))})),this._valueObserver.observe(this.el,{attributes:!0,attributeOldValue:!0})}_onEditorChange(){this._toggleUndoRedo()}_redo(){this._currentModel?.canRedo()&&(this._currentModel.redo(),this._toggleUndoRedo())}_reset(){this._currentModel.setValue(this.value),this._toggleUndoRedo()}_search(){this._editor.trigger("toggleFind","actions.find")}_setDiffModel(){this._diffEditor&&this._diffEditor.setModel({original:monaco.editor.createModel(this.value,"json"),modified:this._editor.getModel()})}_toggleEditor(){this._useDiffEditor=!this._useDiffEditor;let t=document.getElementById(`${this.instanceid}-diff-container`),e=document.getElementById(`${this.instanceid}-container`);this._useDiffEditor?(this._setDiffModel(),t.classList.remove("display-none"),e.classList.add("display-none")):(t.classList.add("display-none"),e.classList.remove("display-none"))}_toggleUndoRedo(){this._currentModel?.canUndo()?this._enableButton(`${this.instanceid}-undo`):this._disableButton(`${this.instanceid}-undo`),this._currentModel?.canRedo()?this._enableButton(`${this.instanceid}-redo`):this._disableButton(`${this.instanceid}-redo`),this._currentModel?.canUndo()||this._currentModel?.canRedo()?this._enableButton(`${this.instanceid}-reset`):this._disableButton(`${this.instanceid}-reset`)}_undo(){this._currentModel?.canUndo()&&(this._currentModel.undo(),this._toggleUndoRedo())}static get assetsDirs(){return["assets"]}static get watchers(){return{locale:["localeWatchHandler"]}}};Zt.style=":host{display:block}.editor-container{position:relative;height:100%}.editor-controls{height:2.75rem;padding-right:0.5rem;background-color:#F4F4F4}.editor-buttons{float:right}html[dir=rtl] .editor-buttons{float:left}.edit-error-flag{padding-top:0.5rem;color:red;visibility:hidden}.edit-button{padding-inline-start:0.5rem}.editor-text{width:100%;overflow-y:auto;background-color:#FFFFFF}.edit-width{width:100%}.edit-parent{box-sizing:border-box;width:100%;height:calc(100% - 46px)}.json-edit-container{height:100%;width:100%;border:1px #808080 solid}.padding-right{padding-inline-end:0.125rem}.btn{margin-bottom:1rem;display:flex;align-content:center;height:25px;width:120px}.select-ctrl{margin-bottom:1rem}.all-edits{margin-top:4rem}.floating-title{font-size:2rem;z-index:100;position:absolute;left:0.5rem;pointer-events:none}.floating-title-button{pointer-events:auto}.json-editor-position1{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:100%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2a{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2b{position:absolute;right:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}";const te=class{constructor(e){t(this,e),this.itemId="",this.locale=void 0,this.itemDetails={accessInformation:"",description:"",licenseInfo:"",snippet:"",tags:[],title:""},this.itemEdit=void 0,this._translations=void 0,this.thumbnail=void 0,this.thumbnailContainer=void 0}get el(){return o(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}async componentWillRender(){return this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit&&(this.itemDetails=this.itemEdit.item,this.itemType=this.itemDetails.type),Promise.resolve()}render(){return i(s,{key:"9a0ddf363cb5e8abc5cbfd45ec0958befd81415d"},i("div",{key:"0efb572f551fe4962ea9114bd32dc2004d47e00a",class:"parent-container"},i("div",{key:"57ba57b956322c3339ea9265640def266717493b",class:"inputBottomSeparation"},i("calcite-input",{key:"e359cea6b2e94823970bbf8beb93e117963fa730",id:"item-title",value:this.itemDetails.title})),i("div",{key:"c7b490a6f1f64ec2b10e8796ad3826d88e25280c",class:"inputBottomSeparation"},i("input",{key:"776e1efb6ee1e29e75727f984165fa77bc36515d",accept:".jpg,.gif,.png,image/jpg,image/gif,image/png",class:"display-none",onChange:t=>this._updateThumbnail(t),ref:t=>this.browseForThumbnail=t,type:"file"}),i("button",{key:"12ece37e4d8ae802cb4fc2dbd3e1843496c674cb",class:"font-size--3 btn-link inline-block trailer-quarter",onClick:()=>this._getThumbnail()},i("svg",{key:"5301bac0dd37771122384b968aca05eb9a714a12",class:"icon-inline icon-inline--on-left",height:"16",viewBox:"0 0 16 16",width:"16"},i("path",{key:"a73dbc1d758fa28afe87dfc36efb5085f115b09c",d:"M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z"})),this._translations.editThumbnail),i("div",{key:"c07d1d3b4f38672855b2a4f3cfd66b91d85ad050",class:"flex"},i("div",{key:"7de852550f467b8bb0bd8fa87c72552747d7397b",class:"img-container",ref:t=>this.thumbnailContainer=t},i("img",{key:"7111cafeabac088b5ff729eed71746966ea66ae2",class:"scale-down",height:"133",id:"item-thumbnail",ref:t=>this.thumbnail=t,width:"200"})),i("div",{key:"4b0be864e8c38b9a8185ba301582a742cbf8188a",class:"snippet-count-container"},i("calcite-input",{key:"9e307dc8a67f77dc61e0deeaf3aa528007921b1b",id:"item-snippet",maxLength:250,type:"textarea",value:this.itemDetails.snippet}),i("label",{key:"83c0d63adc182afcb83f45bcbcec778552768b65",class:"font-size--3",id:"item-snippet-count",ref:t=>this.itemSnippetCount=t})))),i("calcite-label",{key:"1e17c1ae545adb010e216ac566e9cba5eec1fc1a"},this._translations.description,i("label",{key:"c0e125cd881b013af6da14de78635f9922163e39",id:"item-description-label"},i("calcite-input",{key:"1cf2cb27f67edfee86fc9a36ae296f81ef6c4429",id:"item-description",type:"textarea",value:this.itemDetails.description}))),i("calcite-label",{key:"1f61dee7f09260a0277af8a8e3d620e229ce4225"},this._translations.tags,i("label",{key:"73820279fa0134328f24741857e028c89b5caebc",id:"item-tags-label"},i("calcite-input",{key:"88dc8f7cd156dfa5f52ae8412241c2f0bfca357c",id:"item-tags",value:(this.itemDetails.tags&&Array.isArray(this.itemDetails.tags)?this.itemDetails.tags:[this.itemDetails.tags]).join(",")}))),"Group"!==this.itemType?i("calcite-label",null,this._translations.credits,i("label",{id:"item-credits-label"},i("calcite-input",{id:"item-credits",value:this.itemDetails.accessInformation}))):null,"Group"!==this.itemType?i("calcite-label",null,i("label",{id:"item-terms-label"},this._translations.termsOfUse,i("calcite-input",{id:"item-terms",type:"textarea",value:this.itemDetails.licenseInfo}))):null))}componentDidRender(){this._loadThumb()}browseForThumbnail;itemType;itemSnippetCount;inputReceivedHandler(t){switch(t.target.id){case"item-title":this.itemDetails.title=t.target.value,this._updateStore();break;case"item-snippet":t.target.value.length>250&&(t.target.value=t.target.value.substring(0,250)),this.itemDetails.snippet=t.target.value,this._updateLengthLabel(this.itemDetails.snippet),this._updateStore();break;case"item-description":this.itemDetails.description=t.target.value,this._updateStore();break;case"item-tags":this.itemDetails.tags=t.target.value,this._updateStore();break;case"item-credits":this.itemDetails.accessInformation=t.target.value,this._updateStore();break;case"item-terms":this.itemDetails.licenseInfo=t.target.value,this._updateStore()}}_getThumbnail(){this.browseForThumbnail.click()}_loadThumb(){this.thumbnail&&this.itemEdit?.thumbnail?(this.thumbnail.src=URL.createObjectURL(this.itemEdit.thumbnail),this.thumbnailContainer.classList.remove("empty-box"),this.thumbnail.classList.remove("display-none")):(this.thumbnailContainer.classList.add("empty-box"),this.thumbnail.classList.add("display-none"))}_updateLengthLabel(t){this.itemSnippetCount.innerText=this._translations.snippetCountPattern.replace("{{n}}",t.length.toString())}_updateStore(){this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit.item=this.itemDetails,ft.setItemInfo(this.itemEdit)}_updateThumbnail(t){const e=t.target.files;e&&e[0]&&this.thumbnail&&(this.thumbnail.src=URL.createObjectURL(e[0]),this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit.thumbnail=e[0],ft.replaceItemThumbnail(this.itemEdit))}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"]}}};te.style=".inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.icon-inline--on-left,.icon-inline--on-right{display:inline;vertical-align:middle;margin-inline-end:0.375rem;fill:#0079c1}.scale-down{-o-object-fit:scale-down;object-fit:scale-down}.img-container{display:inline;margin-inline-end:1rem;max-width:363px}.summary-count-container{display:inline;flex-grow:1;margin-inline-start:0.75rem}.snippet-count-container{width:calc(100vw - 363px)}.parent-container{max-width:100%;padding:1rem}label{position:relative;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem;display:block;min-width:-moz-min-content;min-width:min-content}";const ee=class{constructor(e){t(this,e),this.groupId="",this.locale=void 0,this._translations=void 0,this.sharing=[]}get el(){return o(this)}itemIdWatchHandler(){const t=ft.getItemInfo(this.groupId);this.sharing=t.groupDetails}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}render(){return i(s,{key:"1c7dbee68fbf0eabf736fb783f173ade2f408122"},i("div",{key:"3c3d88ab122d4a8bc69363224a2754c4a4b092ba",class:"container-border"},i("calcite-label",{key:"137bb704b258a3cd1e5e5b7a18c53aca331d7f91"},this._translations.groupInfo),this._renderItems(this.sharing)))}async getShareInfo(){return this.sharing}_renderItems(t){return t&&t.length>0?t.map((t=>i("calcite-label",{layout:"inline"},i("calcite-switch",{checked:t.shareItem,id:t.id,name:"setting",onCalciteSwitchChange:t=>this._updateItem(t),scale:"m",value:"enabled"}),i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title)))):null}_updateItem(t){const e=t.target.id;this.sharing=this.sharing.map((i=>{if(i.id===e){i.shareItem=t.target.checked;const a=ft.getItemInfo(e);if(i.shareItem)a.groups?a.groups.indexOf(this.groupId)<0&&a.groups.push(this.groupId):a.groups=[this.groupId];else if(a.groups){const t=a.groups.indexOf(this.groupId);t>-1&&a.groups.splice(t,1)}ft.setItemInfo(a)}return i}))}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{groupId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};ee.style=":host{display:block}.container-border{padding:1rem}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const ie=class{constructor(i){t(this,i),this.organizationVariableSelected=e(this,"organizationVariableSelected",7),this.locale=void 0,this.value="",this._organizationVariables=[],this._translations=void 0}get el(){return o(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}valueWatchHandler(){this._organizationVariables=JSON.parse(this.value)}async componentWillLoad(){return this._getTranslations()}render(){return i(s,{key:"3f72a5c1b8fb6bcdab858ee061eadb38cb9965d9"},i("div",{key:"118c7cafc8330c44e72a59a76fd81ca0f39696e1"},i("h4",{key:"86934bdf3cbf162a732a53579e324c5fff8beead",class:"org-var-header"},this._translations.orgVariables)),i("div",{key:"ed5c1df397286a7d1c8e61b5ce04623fa13d74cc",class:"container-border"},i("calcite-tree",{key:"47f4f9bf5a81ded9a37a33a94fac6a230263e917",id:"variable-label"},this._renderHierarchy(this._organizationVariables))))}organizationVariableSelected;_renderHierarchy(t){return t.map((t=>i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.organizationVariableSelected.emit({itemId:t,value:e})}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],value:["valueWatchHandler"]}}};ie.style=":host{display:block}.container-border{overflow-y:auto}.org-var-header{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1rem}";const ae=class{constructor(e){t(this,e),this.authentication=void 0,this.itemId="",this.locale=void 0,this.resourceFilePaths=[],this.resources=[],this._translations=void 0}get el(){return o(this)}itemIdWatchHandler(){const t=ft.getItemInfo(this.itemId);this.resourceFilePaths=t.resourceFilePaths,this.resources=t.resources.map((t=>t.substring(t.lastIndexOf("/")+1)))}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentWillLoad(){return this._getTranslations()}render(){const t=this._hasValidResources();return i(s,{key:"13f2759a882d2eca48bf9dda58e74caade76142b"},i("div",{key:"498ced2e29b8af9138a8aa9d77ec78e07e3c64de",class:"resource-item"},i("div",{key:"d76a967373a990906a67d88ea6466030c41401ff",class:"margin-bottom-1"},i("calcite-button",{key:"96cd2ee08adadef9e1b29db12c38d4748b0689c0",appearance:"solid",class:"resource-button",color:"blue",onClick:()=>this._addNewResource()},this._translations.addResource),i("calcite-button",{key:"49326139cad065995512d3e3568c7d8e7f5cef4f",appearance:"solid",color:"blue",disabled:!t,onClick:()=>this._downloadAll()},this._translations.downloadAll)),i("div",{key:"9c056d9ab7242ea10cbcf57eaabce4bd9777541e",class:"resources-container",style:{display:t?"inherit":"none"}},this._renderResourceList())))}_removedResources={};_renderResourceList(){return i("calcite-value-list",{multiple:!0},this.resourceFilePaths.reduce(((t,e)=>(e.type!==vt.Thumbnail&&t.push(this._renderResource(e)),t)),[]))}_renderResource(t){const e=t.updateType===mt.Remove;return i("calcite-value-list-item",{class:e?"disabled":"",label:t.folder?t.folder+"/"+t.filename:t.filename,nonInteractive:!0,value:t.url},i("calcite-action-group",{"expand-disabled":"true",layout:"horizontal",slot:"actions-end"},i("calcite-action",{disabled:e,icon:"download",label:this._translations.download,onClick:()=>this._download(t.url,t.filename),scale:"m",text:this._translations.download,title:this._translations.download}),i("calcite-action",{disabled:e,icon:"upload-to",label:this._translations.update,onClick:()=>this._upload(t),scale:"m",text:this._translations.update,title:this._translations.update}),i("calcite-action",{disabled:e,icon:"trash",label:this._translations.delete,onClick:()=>this._delete(t),scale:"m",text:this._translations.delete,title:this._translations.delete}),e?i("calcite-action",{icon:"reset",label:this._translations.reset,onClick:()=>this._reset(t.filename),scale:"m",text:this._translations.reset,title:this._translations.reset}):i("div",{class:"display-none"})))}_delete(t){t.updateType=mt.Remove,this.resourceFilePaths=[...this.resourceFilePaths],this._updateStore()}_reset(t){this.resourceFilePaths=this.resources.some((e=>e===t))?this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=mt.None),e))):this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=mt.Add),e))),this._updateStore()}_downloadAll(){this.resourceFilePaths.forEach((t=>{this._download(t.url,t.filename)}))}_download(t,e){t.startsWith("blob")?this.downloadFile(t,e):this.fetchAndDownload(`${t}?token=${this.authentication.token}`,e)}downloadFile(t,e){const i=document.createElement("a");i.href=t,i.download=e,i.target="_blank",i.click()}_hasValidResources(){return this.resourceFilePaths.some((t=>t.url.indexOf("_info_thumbnail")<0))}async fetchAndDownload(t,e){const i=await fetch(t),a=await i.blob(),o=URL.createObjectURL(a);this.downloadFile(o,e)}_upload(t){const e=document.createElement("input");e.classList.add("display-none"),e.onchange=this._updateResource.bind(this,t),e.type="file",e.click()}_addNewResource(){const t=document.createElement("input");t.classList.add("display-none"),t.onchange=this._add.bind(this),t.type="file",t.click()}_updateResource(t,e){const i=e.target.files;i&&i[0]&&(t.blob=i[0],t.updateType=mt.Update,this._updateStore())}_add(t){const e=t.target.files;if(e&&e[0]){const t=URL.createObjectURL(e[0]),i=e[0].name;this.resourceFilePaths.some((e=>e.filename===i&&e.url===t))||(this.resourceFilePaths=[...this.resourceFilePaths,{url:t,type:vt.Data,folder:void 0,filename:i,blob:e[0],updateType:mt.Add}],this._updateStore())}}_updateStore(){const t=ft.getItemInfo(this.itemId);t.resourceFilePaths=this.resourceFilePaths,ft.setItemInfo(t)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};ae.style=":host{display:block}.resource-item{padding:1rem}.resource-button{margin-inline-end:1rem}.resource-progress{padding-top:1rem}.resources-container{border:1px #808080 solid}.margin-bottom-1{margin-bottom:1rem}";const oe=class{get el(){return o(this)}itemIdWatchHandler(){this._initializing=!0,this.value=JSON.stringify("data"===this.instanceid?ft.getItemInfo(this.itemId).data:ft.getItemInfo(this.itemId).properties,null,2)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}constructor(e){t(this,e),this.instanceid="",this.itemId="",this.locale=void 0,this.organizationVariables="",this.solutionVariables="",this.varsOpen=!0,this._translations=void 0,this.value="",window.addEventListener("solutionEditorContentChanged",(t=>{if(this.itemId){const{id:e,contents:i}=t.detail,[a,o]=e.split("|");if(a==this.itemId&&o===this.instanceid){if(!this._initializing&&i.length>0){const t=ft.getItemInfo(a);"data"===o?t.data=JSON.parse(i):t.properties=JSON.parse(i),ft.setItemInfo(t)}this._initializing=!1}}}))}componentWillLoad(){return this._getTranslations()}render(){return i(s,{key:"3f853006c19509c8cf484d4420b3f687aaad5161"},i("div",{key:"f524e1ee3c8dc972779be0909372c11c26092dd0",class:"solution-data-container"},i("calcite-shell",{key:"56797702bc53b08051360975dc529c884eb7d294",class:"light var-container",dir:"ltr"},i("calcite-panel",{key:"6208ac7b63ab8b69bc29ad88abdb9bcdeaaa707a",class:"json-editor"},i("div",{key:"66e99550359b5665b4dd04f794d8108e4ee34284",class:"solution-data-child-container calcite-match-height"},i("json-editor",{key:"7a7f5afa5d424fb6099b7167f274ce211e791a56",class:"solution-data-editor-container",instanceid:this.itemId+"|"+this.instanceid,locale:this.locale,value:this.value}))),i("calcite-shell-panel",{key:"7cc8bac91bfc5be96018d005cc87be457278ed6d","height-scale":"l",position:"end",slot:"contextual-panel","width-scale":"xs"},i("div",{key:"4ce0c251d30d5735781394f5c213523867205886",class:this.varsOpen?"solution-data-child-container":"solution-data-child-container-collapsed"},i("calcite-button",{key:"814c8996b854102b022f7ac482498dd6aac36ec8",appearance:"transparent",class:"collapse-btn","icon-start":this.varsOpen?"chevrons-right":"chevrons-left",id:"collapse-vars",onClick:()=>this._toggleVars(),scale:"s",title:this.varsOpen?this._translations.collapse:this._translations.expand}),i("div",{key:"6b872cfc1c60870fb6262808f5d9f61cc35f0f44",class:this.varsOpen?"org-vars":"org-vars display-none",id:"orgVars"},i("solution-organization-variables",{key:"e8e9ee594b6dcb5ddaabd05c322fb33d568ac7b5",locale:this.locale,value:this.organizationVariables})),i("div",{key:"109d17a77a54a13818af6aa2a9beb92526100ea7",class:this.varsOpen?"sol-vars":"sol-vars display-none",id:"solVars"},i("solution-variables",{key:"46902ed69897ed01334def99817fedafbda2e8d5",locale:this.locale,value:this.solutionVariables})))))))}_initializing=!1;_toggleVars(){this.varsOpen=!this.varsOpen}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};oe.style=":host{display:flexbox}.solution-data-container{position:absolute;height:-moz-available;height:calc(100% - 48px);height:-webkit-fill-available;height:stretch;width:-moz-available;width:100%;width:-webkit-fill-available;width:stretch}.solution-data-child-container{display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}.solution-data-editor-container{height:100%}.solution-data-child-container-collapsed{display:flex;height:100%;flex-direction:column;overflow:auto;width:50px}.inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.json-editor{margin:1rem;width:auto;width:-webkit-fill-available -moz-available}.collapse-btn{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.org-vars{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.sol-vars{padding-top:0px;padding-bottom:0px;padding-left:1rem;padding-right:1rem;min-height:45%}.padding-1{padding:1rem}.light{background-color:#F4F4F4}";const se=class{constructor(i){t(this,i),this.solutionVariableSelected=e(this,"solutionVariableSelected",7),this.value="",this.locale=void 0,this._solutionVariables=[],this._translations=void 0}get el(){return o(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}valueWatchHandler(){this._solutionVariables=JSON.parse(this.value)}componentWillLoad(){return this._getTranslations()}render(){return i(s,{key:"a90cdfc9a32279cb07938fc57f9dd7e38d822f6d"},i("div",{key:"6826e3dd84034368f419ff759962a721a275dc9c"},i("h4",{key:"5ebdf456e8c4dc006b036dc182fa75218aac0e01",class:"org-var-header"},this._translations.solVariables)),i("div",{key:"06fc04c1e61dc1897989e3cc11df7b173f1fdb2a",class:"container-border"},i("calcite-tree",{key:"15500194129af7440ec05dc495b060fc18f22324",id:"variable-label"},this._renderHierarchy(this._solutionVariables))))}solutionVariableSelected;_renderHierarchy(t){return t.map((t=>t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:t=>this._toggleExpand(t)},i("solution-item-icon",{type:t.type}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this._renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.solutionVariableSelected.emit({itemId:t,value:e})}_toggleExpand(t){const e=t?.target?.closest("calcite-tree-item");e&&(e.expanded=!e.expanded)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],value:["valueWatchHandler"]}}};se.style=":host{display:block}.container-border{overflow-y:hidden}.org-var-header{margin-top:1rem;margin-bottom:1rem;margin-left:0px;margin-right:0px}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";export{zt as calcite_shell_panel,_t as calcite_tab,At as calcite_tab_nav,Ut as calcite_tab_title,Jt as calcite_tabs,Kt as calcite_value_list,Qt as calcite_value_list_item,Zt as json_editor,te as solution_item_details,ee as solution_item_sharing,ie as solution_organization_variables,ae as solution_resource_item,oe as solution_template_data,se as solution_variables}
|
47
|
+
const Xt="actions-end",Yt="actions-start";dt.deprecated("component",{name:"value-list-item",removalVersion:3,suggested:"list-item"});const Qt=class{constructor(i){t(this,i),this.calciteListItemChange=e(this,"calciteListItemChange",6),this.calciteListItemRemove=e(this,"calciteListItemRemove",7),this.calciteValueListItemDragHandleBlur=e(this,"calciteValueListItemDragHandleBlur",6),this.pickListItem=null,this.guid=`calcite-value-list-item-${L()}`,this.getPickListRef=t=>this.pickListItem=t,this.handleKeyDown=t=>{" "===t.key&&(this.handleActivated=!this.handleActivated)},this.handleBlur=()=>{this.handleActivated=!1,this.calciteValueListItemDragHandleBlur.emit({item:this.el,handle:this.handleEl})},this.handleSelectChange=t=>{this.selected=t.detail.selected},this.description=void 0,this.disabled=!1,this.deselectDisabled=!1,this.nonInteractive=!1,this.handleActivated=!1,this.icon=null,this.iconFlipRtl=!1,this.label=void 0,this.metadata=void 0,this.removable=!1,this.selected=!1,this.value=void 0}connectedCallback(){c(this)}disconnectedCallback(){r(this)}componentWillLoad(){R(this)}componentDidLoad(){$(this)}componentDidRender(){E(this)}async toggleSelected(t){this.pickListItem.toggleSelected(t)}async setFocus(){return await N(this),this.pickListItem?.setFocus()}calciteListItemChangeHandler(t){t.detail.item=this.el}renderActionsEnd(){const{el:t}=this;return y(t,Xt)?i("slot",{name:Xt,slot:bt.actionsEnd}):null}renderActionsStart(){const{el:t}=this;return y(t,Yt)?i("slot",{name:Yt,slot:bt.actionsStart}):null}renderHandle(){const{icon:t,iconFlipRtl:e}=this;if(t===pt.grip)return i("span",{class:{[ht.handle]:!0,[ht.handleActivated]:this.handleActivated},"data-js-handle":!0,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,ref:t=>this.handleEl=t,role:"button",tabindex:"0"},i("calcite-icon",{flipRtl:e,icon:"drag",scale:"s"}))}render(){return i(s,{key:"2fc2a1a70b75c2a812f14391915c06c852db8906",id:this.el.id||this.guid},i(A,{key:"7bcc26a8f85923865a318dbdf31954a62035b853",disabled:this.disabled},this.renderHandle(),i("calcite-pick-list-item",{key:"abdbbafe6d426da62e39584e85111811beae719b",description:this.description,deselectDisabled:this.deselectDisabled,disabled:this.disabled,label:this.label,metadata:this.metadata,nonInteractive:this.nonInteractive,onCalciteListItemChange:this.handleSelectChange,ref:this.getPickListRef,removable:this.removable,selected:this.selected,value:this.value},this.renderActionsStart(),this.renderActionsEnd())))}get el(){return o(this)}};Qt.style=":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{margin-block-end:1px;box-sizing:border-box;display:flex;background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size--1);color:var(--calcite-color-text-2);--tw-shadow:0 1px 0 var(--calcite-color-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transition:background-color var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}:host *{box-sizing:border-box}calcite-pick-list-item{position:relative;margin:0px;flex-grow:1;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([active]),:host([selected]){--tw-shadow:0 0 0 1px var(--calcite-color-brand);--tw-shadow-colored:0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.handle{display:flex;cursor:move;align-items:center;justify-content:center;border-style:none;background-color:transparent;padding-block:0px;padding-inline:0.25rem;color:var(--calcite-color-border-input);outline-color:transparent}.handle:hover{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1)}.handle:focus{outline:2px solid var(--calcite-ui-focus-color, 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 )}.handle--activated{background-color:var(--calcite-color-foreground-3);color:var(--calcite-color-text-1)}.handle calcite-icon{color:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}";const Zt=class{constructor(e){t(this,e),this.hasChanges=!1,this.hasErrors=!1,this.instanceid="",this.locale=void 0,this.value=""}get el(){return o(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentDidLoad(){const t=document.getElementById(`${this.instanceid}-container`);if(t){this._editor=monaco.editor.create(t,{value:this.value,language:"json",theme:"vs",minimap:{enabled:!1},automaticLayout:!0,scrollBeyondLastLine:!1}),this._currentModel=this._editor.getModel(),this._contentChanged=this._currentModel.onDidChangeContent(this._onEditorChange.bind(this));const e=monaco.editor.setModelMarkers,i=this;monaco.editor.setModelMarkers=function(t,a,o){t.id===i._currentModel.id&&(i._flagEditorHasErrors(o.length>0),i.hasErrors||(i._flagEditorHasChanges(i._currentModel?.canUndo()),i._currentModel?.canUndo()&&i._flagEditorContentChanged()),document.getElementById(`${i.instanceid}-errorFlag`).style.visibility=i.hasErrors?"visible":"hidden"),e.call(monaco.editor,t,a,o)},this._diffEditor=monaco.editor.createDiffEditor(document.getElementById(`${this.instanceid}-diff-container`),{automaticLayout:!0}),this._setDiffModel(),this._loaded=!0,this._toggleUndoRedo()}}async componentWillLoad(){this._initValueObserver(),await this._getTranslations()}render(){return i(s,{key:"ba7c8a397da913d86f5d294cdfbb5ec1b84d89de"},i("div",{key:"bc5c6d1ee443b2096cc44d0b66850d4ebe8462da",id:`${this.instanceid}-editor-container`,class:"editor-container padding-right"},i("div",{key:"dbaf682cba354ce7eef21b03a71832fd39911332",class:"editor-controls"},i("div",{key:"e454e1dd36aa620abf2ffb7877bebb9adc70ff15",class:"editor-buttons"},i("calcite-icon",{key:"1de67e151c6e65b004a431d89dc785ca286a8e11",id:`${this.instanceid}-errorFlag`,icon:"exclamation-mark-triangle",title:this._translations.errorFlag,scale:"s",class:"edit-error-flag"}),i("calcite-button",{key:"33de20955d29287a3ec981e7650562a036343e3a",id:`${this.instanceid}-undo`,color:"blue",appearance:"solid",title:this._translations.undo,onClick:()=>this._undo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"9bed02f1e8a367ad2ed764747f044a4ce27de52b",icon:"undo",scale:"s"})),i("calcite-button",{key:"07562443286c4eeec28577a7cff0401e8cea0ba8",id:`${this.instanceid}-redo`,color:"blue",appearance:"solid",title:this._translations.redo,onClick:()=>this._redo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"5f24902a66eae644d0d358a4826a98d45e905493",icon:"redo",scale:"s"})),i("calcite-button",{key:"02f4f3f8ab93e5f1146176ec3699e2a6d25ecbeb",id:`${this.instanceid}-diff`,color:"blue",appearance:"solid",title:this._translations.diff,onClick:()=>this._toggleEditor(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"0bcd20d28e9ec34f1736a2888d78bfcd9cb82a4d",icon:"compare",scale:"s"})),i("calcite-button",{key:"cf3a7672ebd3ebef00123096ec304456b8f102fc",id:`${this.instanceid}-search`,appearance:"outline",color:"blue",title:this._translations.search,onClick:()=>this._search(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"36aac5e89ebf593d8d1981d7b8f6267fbbadfd24",icon:"search",scale:"s"})),i("calcite-button",{key:"cc981ff7580acfa3a3395c4ce7a96b3022bbbb4b",id:`${this.instanceid}-reset`,color:"blue",appearance:"solid",disabled:!0,title:this._translations.cancelEdits,onClick:()=>this._reset(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"3c4fc1da749f4b4f64d814fcd58dc035634f6b1b",icon:"reset",scale:"s"})))),i("div",{key:"6c33ec4851d804dac7fd9762e3c8c7e416a27cf4",class:"edit-parent"},i("div",{key:"a6e9721127bbd43f9974af65e0899489370e1868",id:`${this.instanceid}-container`,class:"json-edit-container"}),i("div",{key:"c1d1ea305c0e451c24beddb8ac3f8e85a3fca088",id:`${this.instanceid}-diff-container`,class:"json-edit-container display-none"}))))}_cancelEditsBtnHandler;_contentChanged;_currentModel;_diffEditor;_editor;_loaded=!1;_searchBtnHandler;_translations;_useDiffEditor=!1;_valueObserver;async getEditorContents(){return new Promise(((t,e)=>{try{t(this._currentModel.getValue())}catch(t){e(t)}}))}async prepareForDeletion(){this._searchBtnHandler?.removeEventListener("click",this._search),this._cancelEditsBtnHandler?.removeEventListener("click",this._reset),this._valueObserver?.disconnect(),this._contentChanged?.dispose(),this._editor?.dispose()}async replaceCurrentSelection(t){const e=this._editor.getSelection();this._editor.executeEdits("",[{range:e,text:t}])}async reset(){return new Promise(((t,e)=>{try{this._reset(),t({success:!0})}catch(t){e(t)}}))}_disableButton(t){document.getElementById(t)?.setAttribute("disabled","")}_enableButton(t){document.getElementById(t)?.removeAttribute("disabled")}_flagEditorContentChanged(){window.dispatchEvent(new CustomEvent("solutionEditorContentChanged",{detail:{id:this.instanceid,contents:this._currentModel.getValue()},bubbles:!0,cancelable:!1,composed:!0}))}_flagEditorHasChanges(t){this.hasChanges!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasChanges",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasChanges=t)}_flagEditorHasErrors(t){this.hasErrors!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasErrors",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasErrors=t)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}_initValueObserver(){this._valueObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"value"===t.attributeName&&t.target[t.attributeName]!==t.oldValue&&this._loaded&&this._currentModel.setValue(this.value)}))})),this._valueObserver.observe(this.el,{attributes:!0,attributeOldValue:!0})}_onEditorChange(){this._toggleUndoRedo()}_redo(){this._currentModel?.canRedo()&&(this._currentModel.redo(),this._toggleUndoRedo())}_reset(){this._currentModel.setValue(this.value),this._toggleUndoRedo()}_search(){this._editor.trigger("toggleFind","actions.find")}_setDiffModel(){this._diffEditor&&this._diffEditor.setModel({original:monaco.editor.createModel(this.value,"json"),modified:this._editor.getModel()})}_toggleEditor(){this._useDiffEditor=!this._useDiffEditor;let t=document.getElementById(`${this.instanceid}-diff-container`),e=document.getElementById(`${this.instanceid}-container`);this._useDiffEditor?(this._setDiffModel(),t.classList.remove("display-none"),e.classList.add("display-none")):(t.classList.add("display-none"),e.classList.remove("display-none"))}_toggleUndoRedo(){this._currentModel?.canUndo()?this._enableButton(`${this.instanceid}-undo`):this._disableButton(`${this.instanceid}-undo`),this._currentModel?.canRedo()?this._enableButton(`${this.instanceid}-redo`):this._disableButton(`${this.instanceid}-redo`),this._currentModel?.canUndo()||this._currentModel?.canRedo()?this._enableButton(`${this.instanceid}-reset`):this._disableButton(`${this.instanceid}-reset`)}_undo(){this._currentModel?.canUndo()&&(this._currentModel.undo(),this._toggleUndoRedo())}static get assetsDirs(){return["assets"]}static get watchers(){return{locale:["localeWatchHandler"]}}};Zt.style=":host{display:block}.editor-container{position:relative;height:100%}.editor-controls{height:2.75rem;padding-right:0.5rem;background-color:#F4F4F4}.editor-buttons{float:right}html[dir=rtl] .editor-buttons{float:left}.edit-error-flag{padding-top:0.5rem;color:red;visibility:hidden}.edit-button{padding-inline-start:0.5rem}.editor-text{width:100%;overflow-y:auto;background-color:#FFFFFF}.edit-width{width:100%}.edit-parent{box-sizing:border-box;width:100%;height:calc(100% - 46px)}.json-edit-container{height:100%;width:100%;border:1px #808080 solid}.padding-right{padding-inline-end:0.125rem}.btn{margin-bottom:1rem;display:flex;align-content:center;height:25px;width:120px}.select-ctrl{margin-bottom:1rem}.all-edits{margin-top:4rem}.floating-title{font-size:2rem;z-index:100;position:absolute;left:0.5rem;pointer-events:none}.floating-title-button{pointer-events:auto}.json-editor-position1{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:100%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2a{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2b{position:absolute;right:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}";const te=class{constructor(e){t(this,e),this.itemId="",this.locale=void 0,this.itemDetails={accessInformation:"",description:"",licenseInfo:"",snippet:"",tags:[],title:""},this.itemEdit=void 0,this._translations=void 0,this.thumbnail=void 0,this.thumbnailContainer=void 0}get el(){return o(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}async componentWillRender(){return this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit&&(this.itemDetails=this.itemEdit.item,this.itemType=this.itemDetails.type),Promise.resolve()}render(){return i(s,{key:"91b7ce062e477c856e3a512e5247ac9fb3299fc9"},i("div",{key:"fa10231c42260d1117b14653359f531e0688a46c",class:"parent-container"},i("div",{key:"c6a3c70442de79c97f730c5c9a351f033a75e0f5",class:"inputBottomSeparation"},i("calcite-input",{key:"8b33b09b05bd3d81bde6e739288ef806083bfe9a",id:"item-title",value:this.itemDetails.title})),i("div",{key:"288c1856a396fd47b6df74d76da153a70832a548",class:"inputBottomSeparation"},i("input",{key:"16bedd351e0be19f7ef8b0f9e30ac8d54bf19512",accept:".jpg,.gif,.png,image/jpg,image/gif,image/png",class:"display-none",onChange:t=>this._updateThumbnail(t),ref:t=>this.browseForThumbnail=t,type:"file"}),i("button",{key:"e0f9adf5152b9b292e859667bacf4d154e563302",class:"font-size--3 btn-link inline-block trailer-quarter",onClick:()=>this._getThumbnail()},i("svg",{key:"99611f9c671193b9a833b76a6ed071bc8a61b18f",class:"icon-inline icon-inline--on-left",height:"16",viewBox:"0 0 16 16",width:"16"},i("path",{key:"c499a06b58b083384ad0ab7b053c266bdc6db252",d:"M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z"})),this._translations.editThumbnail),i("div",{key:"fa7b1a1c072901eb2abed7f9c756320e03b8d7de",class:"flex"},i("div",{key:"e5e982728dfcc569987db0f3bbd621fea819fc6c",class:"img-container",ref:t=>this.thumbnailContainer=t},i("img",{key:"e09073dc5598c3dac5a020830b44e013dc884f2b",class:"scale-down",height:"133",id:"item-thumbnail",ref:t=>this.thumbnail=t,width:"200"})),i("div",{key:"3023ad5fba278e0a9982d51c63cf052ffb7a4dc4",class:"snippet-count-container"},i("calcite-input",{key:"2b57abed7b2299b29e011363976290425457f194",id:"item-snippet",maxLength:250,type:"textarea",value:this.itemDetails.snippet}),i("label",{key:"b8af7f4e80bcc1722ba512f63941dc38dc8c3ae4",class:"font-size--3",id:"item-snippet-count",ref:t=>this.itemSnippetCount=t})))),i("calcite-label",{key:"d364ae177e5ac0b8356b63cd842f5ef8f4a10bb8"},this._translations.description,i("label",{key:"88655b88d2f5fbf3a000492c780110fc3a4d0634",id:"item-description-label"},i("calcite-input",{key:"5034fb4d2ccf7927bb200dadd0d543ca05bb4da2",id:"item-description",type:"textarea",value:this.itemDetails.description}))),i("calcite-label",{key:"00f30749424b6c07279e11ba171d4335af6b6443"},this._translations.tags,i("label",{key:"64564edcf7c4a55102d06ffd1c937fd275cc0733",id:"item-tags-label"},i("calcite-input",{key:"bc46622ffde1e9064e726594fd70c43c91fe36d7",id:"item-tags",value:(this.itemDetails.tags&&Array.isArray(this.itemDetails.tags)?this.itemDetails.tags:[this.itemDetails.tags]).join(",")}))),"Group"!==this.itemType?i("calcite-label",null,this._translations.credits,i("label",{id:"item-credits-label"},i("calcite-input",{id:"item-credits",value:this.itemDetails.accessInformation}))):null,"Group"!==this.itemType?i("calcite-label",null,i("label",{id:"item-terms-label"},this._translations.termsOfUse,i("calcite-input",{id:"item-terms",type:"textarea",value:this.itemDetails.licenseInfo}))):null))}componentDidRender(){this._loadThumb()}browseForThumbnail;itemType;itemSnippetCount;inputReceivedHandler(t){switch(t.target.id){case"item-title":this.itemDetails.title=t.target.value,this._updateStore();break;case"item-snippet":t.target.value.length>250&&(t.target.value=t.target.value.substring(0,250)),this.itemDetails.snippet=t.target.value,this._updateLengthLabel(this.itemDetails.snippet),this._updateStore();break;case"item-description":this.itemDetails.description=t.target.value,this._updateStore();break;case"item-tags":this.itemDetails.tags=t.target.value,this._updateStore();break;case"item-credits":this.itemDetails.accessInformation=t.target.value,this._updateStore();break;case"item-terms":this.itemDetails.licenseInfo=t.target.value,this._updateStore()}}_getThumbnail(){this.browseForThumbnail.click()}_loadThumb(){this.thumbnail&&this.itemEdit?.thumbnail?(this.thumbnail.src=URL.createObjectURL(this.itemEdit.thumbnail),this.thumbnailContainer.classList.remove("empty-box"),this.thumbnail.classList.remove("display-none")):(this.thumbnailContainer.classList.add("empty-box"),this.thumbnail.classList.add("display-none"))}_updateLengthLabel(t){this.itemSnippetCount.innerText=this._translations.snippetCountPattern.replace("{{n}}",t.length.toString())}_updateStore(){this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit.item=this.itemDetails,ft.setItemInfo(this.itemEdit)}_updateThumbnail(t){const e=t.target.files;e&&e[0]&&this.thumbnail&&(this.thumbnail.src=URL.createObjectURL(e[0]),this.itemEdit=ft.getItemInfo(this.itemId),this.itemEdit.thumbnail=e[0],ft.replaceItemThumbnail(this.itemEdit))}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"]}}};te.style=".inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.icon-inline--on-left,.icon-inline--on-right{display:inline;vertical-align:middle;margin-inline-end:0.375rem;fill:#0079c1}.scale-down{-o-object-fit:scale-down;object-fit:scale-down}.img-container{display:inline;margin-inline-end:1rem;max-width:363px}.summary-count-container{display:inline;flex-grow:1;margin-inline-start:0.75rem}.snippet-count-container{width:calc(100vw - 363px)}.parent-container{max-width:100%;padding:1rem}label{position:relative;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem;display:block;min-width:-moz-min-content;min-width:min-content}";const ee=class{constructor(e){t(this,e),this.groupId="",this.locale=void 0,this._translations=void 0,this.sharing=[]}get el(){return o(this)}itemIdWatchHandler(){const t=ft.getItemInfo(this.groupId);this.sharing=t.groupDetails}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}render(){return i(s,{key:"eca66b743e748d9f915c6d356ea84075ab21709a"},i("div",{key:"b0765e14cc9de5a81afa5d20bc41e7f78913a37e",class:"container-border"},i("calcite-label",{key:"36cbf3b48a2641bcb2107e61609c2ec6c9f18991"},this._translations.groupInfo),this._renderItems(this.sharing)))}async getShareInfo(){return this.sharing}_renderItems(t){return t&&t.length>0?t.map((t=>i("calcite-label",{layout:"inline"},i("calcite-switch",{checked:t.shareItem,id:t.id,name:"setting",onCalciteSwitchChange:t=>this._updateItem(t),scale:"m",value:"enabled"}),i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title)))):null}_updateItem(t){const e=t.target.id;this.sharing=this.sharing.map((i=>{if(i.id===e){i.shareItem=t.target.checked;const a=ft.getItemInfo(e);if(i.shareItem)a.groups?a.groups.indexOf(this.groupId)<0&&a.groups.push(this.groupId):a.groups=[this.groupId];else if(a.groups){const t=a.groups.indexOf(this.groupId);t>-1&&a.groups.splice(t,1)}ft.setItemInfo(a)}return i}))}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{groupId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};ee.style=":host{display:block}.container-border{padding:1rem}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const ie=class{constructor(i){t(this,i),this.organizationVariableSelected=e(this,"organizationVariableSelected",7),this.locale=void 0,this.value="",this._organizationVariables=[],this._translations=void 0}get el(){return o(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}valueWatchHandler(){this._organizationVariables=JSON.parse(this.value)}async componentWillLoad(){return this._getTranslations()}render(){return i(s,{key:"4d1a39b53287d445a1fc66cd5088a7bc60516ab6"},i("div",{key:"7a40ad712fe1af01e92701d128f65b0590aa15bc"},i("h4",{key:"7517fc56b5b0128ee102dc3f57e334501befe14f",class:"org-var-header"},this._translations.orgVariables)),i("div",{key:"d48cbc3ffb24ba54ded2b24c7c518ecf8114cd55",class:"container-border"},i("calcite-tree",{key:"383124c0ae3d646dc9ee857109051e7a151dbe62",id:"variable-label"},this._renderHierarchy(this._organizationVariables))))}organizationVariableSelected;_renderHierarchy(t){return t.map((t=>i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.organizationVariableSelected.emit({itemId:t,value:e})}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],value:["valueWatchHandler"]}}};ie.style=":host{display:block}.container-border{overflow-y:auto}.org-var-header{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1rem}";const ae=class{constructor(e){t(this,e),this.authentication=void 0,this.itemId="",this.locale=void 0,this.resourceFilePaths=[],this.resources=[],this._translations=void 0}get el(){return o(this)}itemIdWatchHandler(){const t=ft.getItemInfo(this.itemId);this.resourceFilePaths=t.resourceFilePaths,this.resources=t.resources.map((t=>t.substring(t.lastIndexOf("/")+1)))}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentWillLoad(){return this._getTranslations()}render(){const t=this._hasValidResources();return i(s,{key:"36017a54e5f8fafda593af2b727f1fbda80c7455"},i("div",{key:"eb9f53c9b4161c09e0b00d9a4d90a814d944819c",class:"resource-item"},i("div",{key:"504dfa5fb623ed27a0829f60ebbf5de17b6d467f",class:"margin-bottom-1"},i("calcite-button",{key:"e578443e1ef409917c5946c77e660c04d273cb6c",appearance:"solid",class:"resource-button",color:"blue",onClick:()=>this._addNewResource()},this._translations.addResource),i("calcite-button",{key:"e4c11326d7c5d96de1d0983eb0beb3cf726177c8",appearance:"solid",color:"blue",disabled:!t,onClick:()=>this._downloadAll()},this._translations.downloadAll)),i("div",{key:"3617bf40ac8b01d70b523642757a624c977ea491",class:"resources-container",style:{display:t?"inherit":"none"}},this._renderResourceList())))}_removedResources={};_renderResourceList(){return i("calcite-value-list",{multiple:!0},this.resourceFilePaths.reduce(((t,e)=>(e.type!==vt.Thumbnail&&t.push(this._renderResource(e)),t)),[]))}_renderResource(t){const e=t.updateType===mt.Remove;return i("calcite-value-list-item",{class:e?"disabled":"",label:t.folder?t.folder+"/"+t.filename:t.filename,nonInteractive:!0,value:t.url},i("calcite-action-group",{"expand-disabled":"true",layout:"horizontal",slot:"actions-end"},i("calcite-action",{disabled:e,icon:"download",label:this._translations.download,onClick:()=>this._download(t.url,t.filename),scale:"m",text:this._translations.download,title:this._translations.download}),i("calcite-action",{disabled:e,icon:"upload-to",label:this._translations.update,onClick:()=>this._upload(t),scale:"m",text:this._translations.update,title:this._translations.update}),i("calcite-action",{disabled:e,icon:"trash",label:this._translations.delete,onClick:()=>this._delete(t),scale:"m",text:this._translations.delete,title:this._translations.delete}),e?i("calcite-action",{icon:"reset",label:this._translations.reset,onClick:()=>this._reset(t.filename),scale:"m",text:this._translations.reset,title:this._translations.reset}):i("div",{class:"display-none"})))}_delete(t){t.updateType=mt.Remove,this.resourceFilePaths=[...this.resourceFilePaths],this._updateStore()}_reset(t){this.resourceFilePaths=this.resources.some((e=>e===t))?this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=mt.None),e))):this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=mt.Add),e))),this._updateStore()}_downloadAll(){this.resourceFilePaths.forEach((t=>{this._download(t.url,t.filename)}))}_download(t,e){t.startsWith("blob")?this.downloadFile(t,e):this.fetchAndDownload(`${t}?token=${this.authentication.token}`,e)}downloadFile(t,e){const i=document.createElement("a");i.href=t,i.download=e,i.target="_blank",i.click()}_hasValidResources(){return this.resourceFilePaths.some((t=>t.url.indexOf("_info_thumbnail")<0))}async fetchAndDownload(t,e){const i=await fetch(t),a=await i.blob(),o=URL.createObjectURL(a);this.downloadFile(o,e)}_upload(t){const e=document.createElement("input");e.classList.add("display-none"),e.onchange=this._updateResource.bind(this,t),e.type="file",e.click()}_addNewResource(){const t=document.createElement("input");t.classList.add("display-none"),t.onchange=this._add.bind(this),t.type="file",t.click()}_updateResource(t,e){const i=e.target.files;i&&i[0]&&(t.blob=i[0],t.updateType=mt.Update,this._updateStore())}_add(t){const e=t.target.files;if(e&&e[0]){const t=URL.createObjectURL(e[0]),i=e[0].name;this.resourceFilePaths.some((e=>e.filename===i&&e.url===t))||(this.resourceFilePaths=[...this.resourceFilePaths,{url:t,type:vt.Data,folder:void 0,filename:i,blob:e[0],updateType:mt.Add}],this._updateStore())}}_updateStore(){const t=ft.getItemInfo(this.itemId);t.resourceFilePaths=this.resourceFilePaths,ft.setItemInfo(t)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};ae.style=":host{display:block}.resource-item{padding:1rem}.resource-button{margin-inline-end:1rem}.resource-progress{padding-top:1rem}.resources-container{border:1px #808080 solid}.margin-bottom-1{margin-bottom:1rem}";const oe=class{get el(){return o(this)}itemIdWatchHandler(){this._initializing=!0,this.value=JSON.stringify("data"===this.instanceid?ft.getItemInfo(this.itemId).data:ft.getItemInfo(this.itemId).properties,null,2)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}constructor(e){t(this,e),this.instanceid="",this.itemId="",this.locale=void 0,this.organizationVariables="",this.solutionVariables="",this.varsOpen=!0,this._translations=void 0,this.value="",window.addEventListener("solutionEditorContentChanged",(t=>{if(this.itemId){const{id:e,contents:i}=t.detail,[a,o]=e.split("|");if(a==this.itemId&&o===this.instanceid){if(!this._initializing&&i.length>0){const t=ft.getItemInfo(a);"data"===o?t.data=JSON.parse(i):t.properties=JSON.parse(i),ft.setItemInfo(t)}this._initializing=!1}}}))}componentWillLoad(){return this._getTranslations()}render(){return i(s,{key:"db99cf57229d7d8b9fe6315e180d95de0b20fc8d"},i("div",{key:"83473f420d1417c85ebb4119be9f359cab878c54",class:"solution-data-container"},i("calcite-shell",{key:"013754ef962c2e5c112f6a8cc6c5d1b8e768078e",class:"light var-container",dir:"ltr"},i("calcite-panel",{key:"11ab2a07fe4af542d8cefc1c131246deef43dd9a",class:"json-editor"},i("div",{key:"ba0460977eb0375acaf5b11ce951986a08ece39b",class:"solution-data-child-container calcite-match-height"},i("json-editor",{key:"53251c1583aa7e8cf2a4e9a1f22e4c72430d3928",class:"solution-data-editor-container",instanceid:this.itemId+"|"+this.instanceid,locale:this.locale,value:this.value}))),i("calcite-shell-panel",{key:"30c47797a35ff7228c4318a5633aec57de05b8cf","height-scale":"l",position:"end",slot:"contextual-panel","width-scale":"xs"},i("div",{key:"028b16654835744f0735b880ca85a3d174963414",class:this.varsOpen?"solution-data-child-container":"solution-data-child-container-collapsed"},i("calcite-button",{key:"bb5049611e778b970454544851a625ccef47d23a",appearance:"transparent",class:"collapse-btn","icon-start":this.varsOpen?"chevrons-right":"chevrons-left",id:"collapse-vars",onClick:()=>this._toggleVars(),scale:"s",title:this.varsOpen?this._translations.collapse:this._translations.expand}),i("div",{key:"c2a30a7c27db181e0dfe0e201d9d3b2742247080",class:this.varsOpen?"org-vars":"org-vars display-none",id:"orgVars"},i("solution-organization-variables",{key:"178c4301c8558c4fe7114c8f6cf5bc0df10883a0",locale:this.locale,value:this.organizationVariables})),i("div",{key:"f85375bac946cff856b6915f340bf926498265ea",class:this.varsOpen?"sol-vars":"sol-vars display-none",id:"solVars"},i("solution-variables",{key:"166d0752746994bc4aebd4e41660f8a2d2c678ea",locale:this.locale,value:this.solutionVariables})))))))}_initializing=!1;_toggleVars(){this.varsOpen=!this.varsOpen}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};oe.style=":host{display:flexbox}.solution-data-container{position:absolute;height:-moz-available;height:calc(100% - 48px);height:-webkit-fill-available;height:stretch;width:-moz-available;width:100%;width:-webkit-fill-available;width:stretch}.solution-data-child-container{display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}.solution-data-editor-container{height:100%}.solution-data-child-container-collapsed{display:flex;height:100%;flex-direction:column;overflow:auto;width:50px}.inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.json-editor{margin:1rem;width:auto;width:-webkit-fill-available -moz-available}.collapse-btn{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.org-vars{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.sol-vars{padding-top:0px;padding-bottom:0px;padding-left:1rem;padding-right:1rem;min-height:45%}.padding-1{padding:1rem}.light{background-color:#F4F4F4}";const se=class{constructor(i){t(this,i),this.solutionVariableSelected=e(this,"solutionVariableSelected",7),this.value="",this.locale=void 0,this._solutionVariables=[],this._translations=void 0}get el(){return o(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}valueWatchHandler(){this._solutionVariables=JSON.parse(this.value)}componentWillLoad(){return this._getTranslations()}render(){return i(s,{key:"a9354a1d3b3d91b9b9522bec945726e106487b78"},i("div",{key:"d38d0151ba9f8421e3ec863ce90b234964cb7f21"},i("h4",{key:"3d10129c3327e803e38b4fc21976764f9ac91693",class:"org-var-header"},this._translations.solVariables)),i("div",{key:"8b79cef63c5b8f5f66b0e11a4b94021f6a025fc3",class:"container-border"},i("calcite-tree",{key:"7f69edec6e35a65e45b461d69e92d0e163563bee",id:"variable-label"},this._renderHierarchy(this._solutionVariables))))}solutionVariableSelected;_renderHierarchy(t){return t.map((t=>t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:t=>this._toggleExpand(t)},i("solution-item-icon",{type:t.type}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this._renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.solutionVariableSelected.emit({itemId:t,value:e})}_toggleExpand(t){const e=t?.target?.closest("calcite-tree-item");e&&(e.expanded=!e.expanded)}async _getTranslations(){const t=await ut(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],value:["valueWatchHandler"]}}};se.style=":host{display:block}.container-border{overflow-y:hidden}.org-var-header{margin-top:1rem;margin-bottom:1rem;margin-left:0px;margin-right:0px}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";export{zt as calcite_shell_panel,_t as calcite_tab,At as calcite_tab_nav,Ut as calcite_tab_title,Jt as calcite_tabs,Kt as calcite_value_list,Qt as calcite_value_list_item,Zt as json_editor,te as solution_item_details,ee as solution_item_sharing,ie as solution_organization_variables,ae as solution_resource_item,oe as solution_template_data,se as solution_variables}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as e,g as s,h as r,H as t}from"./p-4e6eb06e.js";const b=class{constructor(s){e(this,s)}get el(){return s(this)}render(){return r(t,{key:"fb0d98cfbbb4becfc168d715f6198a3923f58e03"},r("slot",{key:"60b3c4db7192cc50fb57056c172abf8fb0e048fd"}))}};b.style=":host{display:block}";export{b as share_item}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as e,c as t,g as i,h as a,H as s}from"./p-4e6eb06e.js";import{s as c}from"./p-c350eacb.js";import{g as l}from"./p-f4aadb3b.js";import{n}from"./p-5e71e72a.js";import{C as r,g as o}from"./p-80cb7c73.js";import"./p-dc9d4be3.js";import"./p-d0d020a5.js";import"./p-d4056c1c.js";import"./p-7530a02f.js";import"./p-9bb44f57.js";import"./p-0a24ad5f.js";const h=class{constructor(i){e(this,i),this.solutionItemSelected=t(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}get el(){return i(this)}valueWatchHandler(e,t){e&&e!==t&&Array.isArray(e)&&e.length>0&&this._treeItemSelected(e[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return a(s,{key:"98ca82042eb168779c0c373c9bf5136ae620ff70"},a("calcite-tree",{key:"c1c634c98e1a69c88c118a8f61036e04ea1b6b42"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(e){return e.map((e=>{const t=this.selectedItemId&&this.selectedItemId===e.id;return e.dependencies&&e.dependencies.length>0?a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title),a("calcite-tree",{slot:"children"},this.renderHierarchy(e.dependencies))):a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title))}))}solutionItemSelected;_treeItemSelected(e,t){const i=t?.target?.closest("calcite-tree-item");i&&(i.expanded=!i?.expanded),this.selectedItemId=e,this.solutionItemSelected.emit(e)}static get assetsDirs(){return["item-type-icons"]}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};h.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const d=class{constructor(t){e(this,t),this.authentication=void 0,this.itemId="",this.locale=void 0,this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}get el(){return i(this)}itemIdWatchHandler(){const e=c.getItemInfo(this.itemId);this.itemType=e.type}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}render(){return a(s,{key:"3fe864ad8d8bcf7bc276feafc60ce7e9fd7e803b"},a("div",{key:"90f327cc0736d8c9c13bf8b65d69e3835b4dae7b",class:"configuration-container"},a("div",{key:"10536f9927ba2b5745f1b5ae3b154a3aac902d47",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.groupDetailsTab),a("calcite-tab-title",null,this._translations.sharingTab)),a("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"share-tab"},a("solution-item-sharing",{"group-id":this.itemId,locale:this.locale})))}_showItemTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.itemDetailsTab),a("calcite-tab-title",null,this._translations.dataTab),a("calcite-tab-title",null,this._translations.propertiesTab),a("calcite-tab-title",null,this._translations.resourcesTab)),a("calcite-tab",{class:"config-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"data-tab"},a("solution-template-data",{instanceid:"data","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"props-tab"},a("solution-template-data",{instanceid:"properties","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"resources-tab"},a("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId,locale:this.locale})))}async _getTranslations(){const e=await l(this.el);this._translations=e[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};d.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const f="3857",b=class{constructor(i){e(this,i),this.featureServiceSpatialReferenceChange=t(this,"featureServiceSpatialReferenceChange",7),this.enableDefaultSpatialReferenceChange=t(this,"enableDefaultSpatialReferenceChange",7),this.enabledSpatialReferenceChange=t(this,"enabledSpatialReferenceChange",7),this.enabled=!1,this.enableDefault=!1,this.featureServices=[],this.locale=void 0,this._translations=void 0}get el(){return i(this)}enabledChanged(){this._handleSpatialRefParamChange()}enableDefaultChanged(){this._handleDefaultSpatialRefParamChange()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentWillLoad(){return this._updateUIFromStore(),this._getTranslations()}render(){return this._updateUIFromStore(),a(s,{key:"b8775ad1a6a18c0b32d020c02d6f9fe13f5d578a"},a("label",{key:"d10fa03d4d127579eed4fec2c6c907dc46166bdf",class:"switch-label"},a("calcite-switch",{key:"ce47d98234008f377d674851ce77c68ebaa4fd71",checked:this.enabled,class:"spatial-ref-switch",onCalciteSwitchChange:e=>this.enabled=e.target.checked,scale:"m"}),this._translations.enableSpatialReference),a("br",{key:"54dc5ccf3fec55650f62d8dbeb09071c8e88805c"}),a("div",{key:"03257e474d254e4d5a0dd10ac7ab6e8b88f85d54",class:"spatial-ref-component",id:"spatialRefDefn"},this._renderFeatureServicesList(this.featureServices)),a("label",{key:"fac415766affa3b1620ce6a5c3d5ef900b25944f",class:"switch-label spatial-ref-component"},a("calcite-switch",{key:"611b69b0895267702a69a70436033274d3d28892",checked:this.enableDefault,class:"spatial-ref-switch",disabled:!this.enabled,onCalciteSwitchChange:e=>this.enableDefault=e.target.checked,scale:"m"}),this._translations.enableDefaultSpatialReference))}featureServiceSpatialReferenceChange;enableDefaultSpatialReferenceChange;enabledSpatialReferenceChange;solutionStoreHasChanges(){this.featureServices=c.getStoreInfo("featureServices")}async _testAccess(e,t,i,a){switch(e){case"_parameterizeWkid":return Promise.resolve(this._parameterizeWkid(t));case"_unparameterizeWkid":return Promise.resolve(this._unparameterizeWkid(t))}return Promise.resolve(null)}_clearFeatureServiceDefaults(e){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((e=>e.checked=!1)),e.forEach((e=>this._updateEnabledServices({detail:{switched:!1}},e)))}_handleDefaultSpatialRefParamChange(){this._updateStore(),this.enableDefaultSpatialReferenceChange.emit({defaultWkid:this.enableDefault?f:""})}_handleSpatialRefParamChange(){this.enabled||(this.enableDefault=!1,this._clearFeatureServiceDefaults(this.featureServices)),this._updateStore(),this.enabledSpatialReferenceChange.emit({enabled:this.enabled})}_parameterizeWkid(e){return e?e.toString().startsWith(r)?e:`${r}${e}${o}`:e}_renderFeatureServicesList(e){const t=c.getStoreInfo("spatialReferenceInfo"),i=e.filter((e=>Object.keys(t.services).some((t=>t===e.id))));return i.length>0?a("div",null,a("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),a("ul",{class:"spatial-ref-services-list"},i.map((e=>a("li",{class:"spatial-ref-services-list-item"},a("label",{class:"switch-label"},a("calcite-switch",{checked:t.services[e.id],class:"spatial-ref-item-switch",disabled:!this.enabled,onCalciteSwitchChange:t=>this._updateEnabledServices(t,e),scale:"m"}),e.name)))))):null}_updateEnabledServices(e,t){const i=c.getStoreInfo("spatialReferenceInfo");i.services[t.id]=void 0!==e.detail?.switched?e.detail.switched:void 0===e.target?.checked||e.target.checked,c.setStoreInfo("spatialReferenceInfo",i),this._updateStore(),this.featureServiceSpatialReferenceChange.emit(t)}_unparameterizeWkid(e){return e&&e.toString().startsWith(r)?e.substring(r.length,e.length-o.length):e}_updateFeatureServices(e){e.enabled||Object.keys(e.services).forEach((t=>{e.services[t]=!1})),this.featureServices.forEach((t=>{t.enabled=e.services[t.id],t.wkid=t.enabled?this._parameterizeWkid(t.wkid):this._unparameterizeWkid(t.wkid)})),c.setStoreInfo("featureServices",this.featureServices)}_updateStore(){const e=c.getStoreInfo("spatialReferenceInfo");e.enabled=this.enabled,this.enabled&&this.enableDefault?e.default=f:e.hasOwnProperty("default")&&delete e.default,c.setStoreInfo("spatialReferenceInfo",e),this._updateFeatureServices(e)}_updateUIFromStore(){const e=c.getStoreInfo("spatialReferenceInfo");this.enabled=e.enabled,this.enableDefault=!!e.default,this.featureServices=c.getStoreInfo("featureServices")}async _getTranslations(){const e=await l(this.el);this._translations=e[0]}static get watchers(){return{enabled:["enabledChanged"],enableDefault:["enableDefaultChanged"],locale:["localeWatchHandler"]}}};b.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{font-size:0.875rem;line-height:1.25rem}.spatial-ref-services-list{margin-block-start:0.5em;margin-block-end:0.5em;list-style-type:none;padding-inline-start:2em}.spatial-ref-services-list-item{margin-top:0.25rem}";export{h as solution_contents,d as solution_item,b as solution_spatial_ref}
|
6
|
+
import{r as e,c as t,g as i,h as a,H as s}from"./p-4e6eb06e.js";import{s as c}from"./p-c350eacb.js";import{g as l}from"./p-f4aadb3b.js";import{n}from"./p-5e71e72a.js";import{C as r,g as o}from"./p-80cb7c73.js";import"./p-dc9d4be3.js";import"./p-d0d020a5.js";import"./p-d4056c1c.js";import"./p-7530a02f.js";import"./p-9bb44f57.js";import"./p-0a24ad5f.js";const h=class{constructor(i){e(this,i),this.solutionItemSelected=t(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}get el(){return i(this)}valueWatchHandler(e,t){e&&e!==t&&Array.isArray(e)&&e.length>0&&this._treeItemSelected(e[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return a(s,{key:"d91cfec3e955e635a3196043c935733a7f4c726d"},a("calcite-tree",{key:"6fcf281c5f61578b8d343893367ab1bd97315387"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(e){return e.map((e=>{const t=this.selectedItemId&&this.selectedItemId===e.id;return e.dependencies&&e.dependencies.length>0?a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title),a("calcite-tree",{slot:"children"},this.renderHierarchy(e.dependencies))):a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title))}))}solutionItemSelected;_treeItemSelected(e,t){const i=t?.target?.closest("calcite-tree-item");i&&(i.expanded=!i?.expanded),this.selectedItemId=e,this.solutionItemSelected.emit(e)}static get assetsDirs(){return["item-type-icons"]}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};h.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const d=class{constructor(t){e(this,t),this.authentication=void 0,this.itemId="",this.locale=void 0,this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}get el(){return i(this)}itemIdWatchHandler(){const e=c.getItemInfo(this.itemId);this.itemType=e.type}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}render(){return a(s,{key:"721f488604e2d9ad7a063d0776e11587baca4d3d"},a("div",{key:"32b1a71eddf54a139b62cc68b5acdd5e5cc53e7a",class:"configuration-container"},a("div",{key:"9064802d85a4f77faec0bbc6c17b303c7b9bdf16",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.groupDetailsTab),a("calcite-tab-title",null,this._translations.sharingTab)),a("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"share-tab"},a("solution-item-sharing",{"group-id":this.itemId,locale:this.locale})))}_showItemTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.itemDetailsTab),a("calcite-tab-title",null,this._translations.dataTab),a("calcite-tab-title",null,this._translations.propertiesTab),a("calcite-tab-title",null,this._translations.resourcesTab)),a("calcite-tab",{class:"config-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"data-tab"},a("solution-template-data",{instanceid:"data","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"props-tab"},a("solution-template-data",{instanceid:"properties","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"resources-tab"},a("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId,locale:this.locale})))}async _getTranslations(){const e=await l(this.el);this._translations=e[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};d.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const b="3857",p=class{constructor(i){e(this,i),this.featureServiceSpatialReferenceChange=t(this,"featureServiceSpatialReferenceChange",7),this.enableDefaultSpatialReferenceChange=t(this,"enableDefaultSpatialReferenceChange",7),this.enabledSpatialReferenceChange=t(this,"enabledSpatialReferenceChange",7),this.enabled=!1,this.enableDefault=!1,this.featureServices=[],this.locale=void 0,this._translations=void 0}get el(){return i(this)}enabledChanged(){this._handleSpatialRefParamChange()}enableDefaultChanged(){this._handleDefaultSpatialRefParamChange()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentWillLoad(){return this._updateUIFromStore(),this._getTranslations()}render(){return this._updateUIFromStore(),a(s,{key:"1badb0e90bbc64684ca6954c0d9122933ee894ce"},a("label",{key:"3977294c964c895b537c709efe7b822d32a50239",class:"switch-label"},a("calcite-switch",{key:"5e72cb2f635e584046cddcbd772a0fa5e729d6e8",checked:this.enabled,class:"spatial-ref-switch",onCalciteSwitchChange:e=>this.enabled=e.target.checked,scale:"m"}),this._translations.enableSpatialReference),a("br",{key:"c952c9e94b4e1bfd65a2c01b469bfc799bed669b"}),a("div",{key:"d4c63008954968f5e78e9383b27419b95a18b6be",class:"spatial-ref-component",id:"spatialRefDefn"},this._renderFeatureServicesList(this.featureServices)),a("label",{key:"f49057d234fbc45d821b4da5971542f32ad845b7",class:"switch-label spatial-ref-component"},a("calcite-switch",{key:"91754097e35a9218d6ce4412bc2d10ebc28e8518",checked:this.enableDefault,class:"spatial-ref-switch",disabled:!this.enabled,onCalciteSwitchChange:e=>this.enableDefault=e.target.checked,scale:"m"}),this._translations.enableDefaultSpatialReference))}featureServiceSpatialReferenceChange;enableDefaultSpatialReferenceChange;enabledSpatialReferenceChange;solutionStoreHasChanges(){this.featureServices=c.getStoreInfo("featureServices")}async _testAccess(e,t,i,a){switch(e){case"_parameterizeWkid":return Promise.resolve(this._parameterizeWkid(t));case"_unparameterizeWkid":return Promise.resolve(this._unparameterizeWkid(t))}return Promise.resolve(null)}_clearFeatureServiceDefaults(e){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((e=>e.checked=!1)),e.forEach((e=>this._updateEnabledServices({detail:{switched:!1}},e)))}_handleDefaultSpatialRefParamChange(){this._updateStore(),this.enableDefaultSpatialReferenceChange.emit({defaultWkid:this.enableDefault?b:""})}_handleSpatialRefParamChange(){this.enabled||(this.enableDefault=!1,this._clearFeatureServiceDefaults(this.featureServices)),this._updateStore(),this.enabledSpatialReferenceChange.emit({enabled:this.enabled})}_parameterizeWkid(e){return e?e.toString().startsWith(r)?e:`${r}${e}${o}`:e}_renderFeatureServicesList(e){const t=c.getStoreInfo("spatialReferenceInfo"),i=e.filter((e=>Object.keys(t.services).some((t=>t===e.id))));return i.length>0?a("div",null,a("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),a("ul",{class:"spatial-ref-services-list"},i.map((e=>a("li",{class:"spatial-ref-services-list-item"},a("label",{class:"switch-label"},a("calcite-switch",{checked:t.services[e.id],class:"spatial-ref-item-switch",disabled:!this.enabled,onCalciteSwitchChange:t=>this._updateEnabledServices(t,e),scale:"m"}),e.name)))))):null}_updateEnabledServices(e,t){const i=c.getStoreInfo("spatialReferenceInfo");i.services[t.id]=void 0!==e.detail?.switched?e.detail.switched:void 0===e.target?.checked||e.target.checked,c.setStoreInfo("spatialReferenceInfo",i),this._updateStore(),this.featureServiceSpatialReferenceChange.emit(t)}_unparameterizeWkid(e){return e&&e.toString().startsWith(r)?e.substring(r.length,e.length-o.length):e}_updateFeatureServices(e){e.enabled||Object.keys(e.services).forEach((t=>{e.services[t]=!1})),this.featureServices.forEach((t=>{t.enabled=e.services[t.id],t.wkid=t.enabled?this._parameterizeWkid(t.wkid):this._unparameterizeWkid(t.wkid)})),c.setStoreInfo("featureServices",this.featureServices)}_updateStore(){const e=c.getStoreInfo("spatialReferenceInfo");e.enabled=this.enabled,this.enabled&&this.enableDefault?e.default=b:e.hasOwnProperty("default")&&delete e.default,c.setStoreInfo("spatialReferenceInfo",e),this._updateFeatureServices(e)}_updateUIFromStore(){const e=c.getStoreInfo("spatialReferenceInfo");this.enabled=e.enabled,this.enableDefault=!!e.default,this.featureServices=c.getStoreInfo("featureServices")}async _getTranslations(){const e=await l(this.el);this._translations=e[0]}static get watchers(){return{enabled:["enabledChanged"],enableDefault:["enableDefaultChanged"],locale:["localeWatchHandler"]}}};p.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{font-size:0.875rem;line-height:1.25rem}.spatial-ref-services-list{margin-block-start:0.5em;margin-block-end:0.5em;list-style-type:none;padding-inline-start:2em}.spatial-ref-services-list-item{margin-top:0.25rem}";export{h as solution_contents,d as solution_item,p as solution_spatial_ref}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as e,g as a,h as s,H as i}from"./p-4e6eb06e.js";import{g as l}from"./p-f4aadb3b.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const c=class{constructor(a){t(this,a),this.editsComplete=e(this,"editsComplete",7),this.deleteDialogClose=e(this,"deleteDialogClose",7),this.ids=[],this.layer=void 0,this.locale=void 0,this.open=!1,this._isDeleting=!1,this._translations=void 0}get el(){return a(this)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}editsComplete;deleteDialogClose;async componentWillLoad(){await this._getTranslations()}render(){const t=1===this.ids.length?this._translations?.confirmSingle:this._translations?.confirmMultiple;return s(i,{key:"eafca7d4325c65ff21fbfeaa24ea14e95bc25a34"},s("calcite-modal",{key:"745e52d7b23318492914662cc769a1206baefd28","aria-labelledby":"modal-title",class:"delete-modal",kind:"danger",onCalciteModalClose:()=>this._close(),open:this.open,widthScale:"s"},s("div",{key:"363614f6eaf30c30c6c2ccde3875dfff5cd94088",class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations?.deleteFeature),s("div",{key:"b3b6f74495894589b7fd8be54265c4a69ffaa62e",slot:"content"},t),s("calcite-button",{key:"d325fcf12624bac39f56ec690f7e4e9660789891",appearance:"outline",kind:"danger",onClick:()=>this._close(),slot:"secondary",width:"full"},this._translations?.cancel),s("calcite-button",{key:"73a10546ad92065c949bfacca3eb3d508685030e",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._close(),this.editsComplete.emit("delete")}_close(){this.open=!1,this.deleteDialogClose.emit()}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"]}}};c.style=":host{display:block}.delete-modal{position:fixed}";export{c as delete_dialog}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/*!
|
2
|
+
* Copyright 2022 Esri
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
4
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
5
|
+
*/
|
6
|
+
import{r as t,c as i,g as e,h as s,H as o,F as h}from"./p-4e6eb06e.js";import{g as a}from"./p-f4aadb3b.js";import{E as l}from"./p-80cb7c73.js";import{g as n}from"./p-d572627c.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const d=class{constructor(e){t(this,e),this.showIntroductionWindow=i(this,"showIntroductionWindow",7),this.showCoverPage=i(this,"showCoverPage",7),this.appLayout=void 0,this.appProxies=void 0,this.basemapConfig=void 0,this.coverPageEnabled=void 0,this.customInfoText=void 0,this.defaultAppLayout=void 0,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.introductionWindowEnabled=!1,this.enableAutoRefresh=!1,this.enableBasemap=!0,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableHome=!0,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableZoom=!0,this.locale=void 0,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._deleteDialogOpen=!1,this._enableCreateFeatures=!0,this._hideFooter=!1,this._hideTable=!1,this._isMobile=!1,this._isPortraitMobile=!1,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._filterOpen=!1,this._showInformationHeader=!0,this._layerIds=void 0,this._isLoading=!0}get el(){return e(this)}_defaultAppLayoutHonored=!1;_defaultCenterHonored=!1;_defaultLevelHonored=!1;_deleteIds;_layerTable;_mapChange;_resizeObserver;_shouldSetMapView=!1;_layerExpressions;_filterList;_mapCard;_isMapViewOnLoad=!1;appLayoutWatchHandler(t,i){t!==i&&(this._setActiveLayout(t),"mapView"===this.appLayout&&this._layer?.isTable&&this._mapCard.updateLayer(),this._isMapViewOnLoad&&(this._layerTable.refresh(),this._isMapViewOnLoad=!1))}enableZoomWatchHandler(){this._initMapZoom()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}showIntroductionWindow;showCoverPage;async featureSelectionChange(t){this._numSelected=t.detail?.length}async popupClosed(){this._isPortraitMobile&&this.showHideMapPopupAndTable(!1)}async layoutChanged(t){this._layoutMode=t.detail}async mapChanged(t){this._mapChange=t.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async layerSelectionChange(t){const i=t.detail[0],e=await n(this._mapView,i);e&&await e.when((()=>{0===this._layerIds.length&&"mapView"===this.appLayout&&e.isTable&&(this.appLayout="splitView"),this._layer=e,this._initLayerExpressions(),this._isLoading=!1}))}async showDelete(t){this._deleteIds=t.detail.ids,this._deleteDialogOpen=!0}async idsFound(t){this._layerIds=t.detail.layerIds}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return s(o,{key:"8f8d68ca8cd5e170196639cda11b61d64a8e6050"},s("calcite-shell",{key:"351696228f10d637c4c033d857dc2e169d33bcb5",class:"position-relative"},s("calcite-panel",{key:"b77a1b4d4d15f466cf2650d86f084c150b8aaa86",class:"width-full height-full "+(this.popupHeaderColor&&"#FFFFFF"!==this.popupHeaderColor?"border-width-0":""),loading:this._isLoading},this._getBody(this._layoutMode,this._panelOpen,this._hideTable)),this._getFooter()),this._filterModal(),this._deleteModal())}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,this._mapChange&&await this._setMapView())}async componentDidLoad(){this._resizeObserver.observe(this.el),!this._defaultAppLayoutHonored&&this.defaultAppLayout?(this._defaultAppLayoutHonored=!0,this.appLayout=this.defaultAppLayout):this.appLayout||(this.appLayout="splitView"),this._isMapViewOnLoad="mapView"===this.appLayout,this._setActiveLayout(this.appLayout)}_getFooter(){const t=this._numSelected>0,i=this._layer?.editingEnabled&&this._layer?.capabilities?.operations?.supportsDelete;return this._isPortraitMobile&&t&&!this._hideFooter?s("div",{class:"width-100",slot:"footer"},s("div",{class:"display-flex padding-1-2"},s("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),i?s("delete-button",{class:"padding-inline-start-1 width-full",id:"solutions-delete",ids:this._layerTable.selectedIds,layer:this._layer,locale:this.locale}):void 0)):void 0}_setActiveLayout(t){"splitView"!==t||this._panelOpen||this._toggleLayout(),"mapView"===t?this._showMapInFullView():this._showMapInCardView()}_getDividerIcon(t,i){let e="";switch(t){case l.HORIZONTAL:e=i?"chevrons-up":"chevrons-down";break;case l.VERTICAL:case l.GRID:e=i?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(t,i,e){let s="";switch(t){case l.HORIZONTAL:s=(i&&!e?"height-1-2 display-grid":i&&e?"height-full":"height-0")+" width-full position-relative";break;case l.GRID:s="height-full position-relative "+(i?"width-1-3":"width-0");break;case l.VERTICAL:s="height-full position-relative "+(i?"width-1-2":"width-0")}return s}_getTableSizeClass(t,i){let e="";switch(t){case l.HORIZONTAL:e=(i?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=(i?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(i?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(t,i,e){const o="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return s("calcite-panel",{class:"width-full height-full position-absolute"},s("div",{class:"width-full height-full overflow-hidden "+(t===l.HORIZONTAL?"":"display-flex")},this._getMapAndCard(t,i,e),this._getTable(t,i,e)),this.coverPageEnabled&&s("div",{class:"floating-container",onClick:this.coverPageButtonClick.bind(this)},s("calcite-button",{appearance:"solid",class:`floating-button ${o}`,"icon-start":"content-minimal",kind:"neutral",label:"",round:!0,scale:"l","split-child":"primary",width:"auto"})),this.introductionWindowEnabled&&s("div",{class:"floating-container",onClick:this.infoButtonClick.bind(this)},s("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.showIntroductionWindow.emit()}coverPageButtonClick(){this.showCoverPage.emit()}_getMapAndCard(t,i,e){const o=this._getMapSizeClass(t,i,e);return s("div",{class:`${o} overflow-hidden z-index-1 ${!this._isPortraitMobile&&this._isMobile?"border-right":""}`},this._getMapNode(i),this._getPopupExpandNode())}_getMapNode(t){const i="mapView"===this.appLayout,e="tableView"===this.appLayout;return s("div",{class:(i||e?"position-absolute-0":this._layoutMode!==l.HORIZONTAL||this._isPortraitMobile&&!t?"adjusted-height-50":"")+" overflow-hidden",id:"card-mapView"},s("map-card",{appLayout:this.appLayout,appProxies:this.appProxies,basemapConfig:this.basemapConfig,class:"width-full",defaultLayerId:this.defaultWebmap&&this.defaultLayer?this.defaultLayer:"",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableShare:this.enableShare,enableSingleExpand:!0,hidden:!this._isPortraitMobile&&e,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",isMapLayout:i,isMobile:this._isMobile,locale:this.locale,mapInfo:this._mapInfo,mapInfos:this.mapInfos?.filter((t=>!1!==t.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",onToggleFilter:this._toggleFilter.bind(this),onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:t=>this._mapCard=t,selectedFeaturesIds:this._layerTable?.selectedIds,selectedLayer:this._layer,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"],zoomToScale:this.zoomToScale}))}_getPopupExpandNode(){const t=this._isPortraitMobile&&this._showInformationHeader?"display-none height-0":"";return s("div",{class:`${this.popupHeaderColor?"":this._isPortraitMobile?"calcite-mode-light":"calcite-mode-dark"} ${this._isMobile?"height-full":"height-full position-relative"} ${this._isPortraitMobile&&this._hideTable?"position-absolute-0 width-full height-full":this._isPortraitMobile?"display-none height-0":""} ${this.mapInfos?.length>1&&"tableView"===this.appLayout?"position-relative top-51":""} position-sticky`,style:{"--calcite-color-foreground-1":this.popupHeaderColor,"--calcite-color-foreground-2":this.popupHeaderHoverColor,"--calcite-color-text-3":this.popupHeaderTextColor,"--calcite-color-text-2":this.popupHeaderTextColor}},s("calcite-panel",null,!this._isPortraitMobile&&this._showInformationHeader||this._numSelected>0&&!this._isPortraitMobile?s("div",{class:`display-flex align-items-center ${t}`,slot:"header-content"},s("calcite-icon",{icon:"information",scale:"s"}),s("div",{class:"padding-inline-start-75"},this._translations.information)):s("div",null),this._getCardNode()))}_getCardNode(){const t="mapView"===this.appLayout,i="tableView"===this.appLayout;return s("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},s("card-manager",{class:(i&&this.mapInfos?.length>1?"adjusted-height-100-51":t||i?"height-full":this._numSelected>0&&!this._isMobile?"height-50":this._showInformationHeader?this._isPortraitMobile?"height-full":"height-50":"adjusted-height-50_25")+" width-full",customInfoText:this.customInfoText,enableCreateFeatures:this._enableCreateFeatures&&!this._isMobile,enableEditGeometry:this?._mapInfo?.enableEditGeometry,isMobile:this._isPortraitMobile,layer:this._layer,locale:this.locale,mapView:this?._mapView,onBackFromCreateWorkFlow:()=>{this._showInformationHeader=!0},onCreateWorkFlowStarted:()=>{this.appLayout=this._layer.isTable?"tableView":"mapView",this._showInformationHeader=!1},onFeatureOrRecordSubmitted:()=>{this._layerTable.refresh()},selectedFeaturesIds:this._layerTable?.selectedIds,selectingFeatureFromMap:"mapView"===this.appLayout,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(t,i,e){const o="mapView"===this.appLayout,h="tableView"===this.appLayout,a=e&&this._isPortraitMobile?"visibility-hidden":o?"display-none":"",n=o?"height-full width-full z-index-0":"display-none",d=this._getTableSizeClass(t,i),r=t===l.HORIZONTAL?"horizontal":"vertical",c=t===l.HORIZONTAL?"header":"panel-start",p=this.defaultWebmap&&this.defaultLayer,u=this.defaultGlobalId?this.defaultGlobalId?.indexOf(",")>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0,g=this.defaultOid?this.defaultOid?.indexOf(",")>-1?this.defaultOid.split(",").map((t=>parseInt(t,10))):[parseInt(this.defaultOid,10)]:void 0;return s("calcite-shell",{class:`${d} border-bottom`},this._isMobile?void 0:s("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:r,slot:c},this.getActions(t,i)),s("div",{class:`width-full height-full position-relative z-index-0 ${a}`},s("layer-table",{appLayout:this.appLayout,createFilterModal:!1,defaultGlobalId:p?u:void 0,defaultLayerId:p?this.defaultLayer:"",defaultOid:p&&!u?g:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this?._mapInfo?.enableInlineEdit,enableShare:this.enableShare,isMobile:this._isPortraitMobile,locale:this.locale,mapHidden:h,mapInfo:this._mapInfo,mapView:this?._mapView,onToggleFilter:this._toggleFilter.bind(this),onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:t=>this._layerTable=t,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected,zoomToScale:this.zoomToScale})),s("div",{class:n,id:"full-map-view"}))}getActions(t,i){const e=this._getDividerIcon(t,i),o=i?this._translations.close:this._translations.open,a="toggle-layout";return s(h,null,s("calcite-action",{active:"splitView"===this.appLayout,class:"toggle-node",icon:"browser",id:"browser-action",onClick:()=>{this.appLayout="splitView"},text:""}),s("calcite-tooltip",{placement:"right","reference-element":"browser-action"},s("span",null,this._translations.splitView)),s("calcite-action",{active:"tableView"===this.appLayout,class:"toggle-node",icon:"dock-left",id:"dock-left-action",onClick:()=>{this.appLayout="tableView"},text:""}),s("calcite-tooltip",{placement:"right","reference-element":"dock-left-action"},s("span",null,this._translations.tableView)),s("calcite-action",{active:"mapView"===this.appLayout,class:"toggle-node",disabled:0===this._layerIds?.length,icon:"browser-map",id:"browser-map-action",onClick:()=>{this.appLayout="mapView"},text:""}),s("calcite-tooltip",{placement:"right","reference-element":"browser-map-action"},s("span",null,this._translations.mapView)),s("calcite-action",{class:"toggle-node",icon:e,id:a,onClick:()=>this._toggleLayout(),slot:"actions-end",text:""}),s("calcite-tooltip",{placement:"bottom","reference-element":a},s("span",null,o)))}_deleteModal(){return s("delete-dialog",{id:"deleteDialogId",ids:this._deleteIds,layer:this._layer,locale:this.locale,onDeleteDialogClose:()=>this._deleteDialogOpen=!1,open:this._deleteDialogOpen})}_filterModal(){return s("calcite-modal",{"aria-labelledby":"modal-title",class:"modal",kind:"brand",onCalciteModalClose:()=>{this._closeFilter()},open:this._filterOpen,widthScale:"s"},s("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations?.filter?.replace("{{title}}",this._layer?.title)),s("div",{slot:"content"},s("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:async()=>this._closeFilter(),comboboxOverlayPositioning:"fixed",layerExpressions:this._layerExpressions,onFilterListReset:()=>{this._handleFilterListReset(),this._mapCard.resetFilter()},onFilterUpdate:async()=>{const t=this._filterList.filterCount>0;await(this._layerTable?.filterUpdate(t)),await this._mapCard.updateFilterState(t)},ref:t=>this._filterList=t,view:this._mapView,zoomBtn:!1})))}_initLayerExpressions(){const t=this._mapInfo?.filterConfig?.layerExpressions;this._layerExpressions=t?t.filter((t=>t.id===this._layer?.id)):[],this._filterList.layerExpressions=this._layerExpressions,this._layerExpressions.filter((t=>t.expressions.filter((t=>t.active)).length>0))}_toggleFilter(){this._filterOpen=!this._filterOpen}_handleFilterListReset(){this._layerTable.filterReset()}async _closeFilter(){this._filterOpen&&(this._filterOpen=!1,this._layerTable.closeFilter())}_onResize(){const t=this.el.offsetWidth<1024,i=!this._isMobile&&t;this._isMobile=t,i&&(this._panelOpen=!0),this._isMobile?(this.showHideMapPopupAndTable(!this._isMobile),this._isPortraitMobile=!!window.matchMedia("(orientation: portrait)").matches,this.appLayout="splitView"):this._isPortraitMobile=!1,this._layoutMode=this._isPortraitMobile?l.HORIZONTAL:l.GRID}_toggleLayout(){this._panelOpen=!this._panelOpen}_showMapInCardView(){if("mapView"!==this.appLayout){const t=document.getElementById("full-map-view")?.childNodes[0],i=document.getElementById("card-mapView");t&&i.appendChild(t)}}_showMapInFullView(){const t=document.getElementById("card-mapView")?.childNodes[0],i=document.getElementById("full-map-view");t&&i.appendChild(t)}showHideMapPopupAndTable(t){this._hideTable=t,this._hideFooter=t}_getMapInfo(t){let i;return this.mapInfos.some((e=>{if(e.id===t)return i=e,!0})),{...i}}async _setMapView(){this._mapInfo=this._getMapInfo(this._mapChange.id),this._enableCreateFeatures=this._mapInfo.enableCreateFeatures,this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1;const t=!this.defaultCenter||this._defaultCenterHonored?void 0:this.defaultCenter?.split(";").map((t=>parseFloat(t))),i=!this.defaultLevel||this._defaultLevelHonored?void 0:parseInt(this.defaultLevel,10);t&&i&&(await this._mapView.goTo({center:t,zoom:i}),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 t=await a(this.el);this._translations=t[0]}static get watchers(){return{appLayout:["appLayoutWatchHandler"],enableZoom:["enableZoomWatchHandler"],locale:["localeWatchHandler"]}}};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-right{border-right:2px 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}.position-absolute{position:absolute}.position-sticky{position:sticky}.height-50{height:50%}.top-51{top:51px}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-51{height:calc(100% - 51px)}.display-none{display:none !important}.adjusted-height-50_25{height:calc(50% + 25px)}.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}.z-index-0{z-index:0 !important}.z-index-1{z-index:1 !important}";export{d as crowdsource_manager}
|