@arcgis/core 4.27.0-rc.2 → 4.27.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{a8565d1c676f3bfbcebb.js → 002fe1ec63ea33e6972d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0610691a0c0d9fbbd6d2.js → 013de5c2955801b329b3.js} +1 -1
- package/assets/esri/core/workers/chunks/07163dcbb871f927a580.js +1 -0
- package/assets/esri/core/workers/chunks/0e46687004392c493c06.js +1 -0
- package/assets/esri/core/workers/chunks/0e65e00173b66c7fec2e.js +1 -0
- package/assets/esri/core/workers/chunks/1aa8dd317ecd3c41e0ea.js +1 -0
- package/assets/esri/core/workers/chunks/21328f3dd26abe84a10d.js +1 -0
- package/assets/esri/core/workers/chunks/28c67c98039503b62e6e.js +1 -0
- package/assets/esri/core/workers/chunks/{da57eba2fe25495ea217.js → 2faa8f08f2fdaac3f4af.js} +1 -1
- package/assets/esri/core/workers/chunks/{0407bf97ad621c89a734.js → 3160af63b860b52db389.js} +1 -1
- package/assets/esri/core/workers/chunks/3767b9e7660873b018c2.js +1 -0
- package/assets/esri/core/workers/chunks/39ae4b9b766f674bc6f2.js +1 -0
- package/assets/esri/core/workers/chunks/45629ff775e77234b227.js +1 -0
- package/assets/esri/core/workers/chunks/4a4f14a3d8da270059c4.js +1 -0
- package/assets/esri/core/workers/chunks/{3e239bfad611985e50fb.js → 50f910797c17c3028521.js} +1 -1
- package/assets/esri/core/workers/chunks/642c5a93c0a454bdd115.js +1 -0
- package/assets/esri/core/workers/chunks/{14145959a3dab1437818.js → 6627f1bc9ee6b620e3aa.js} +1 -1
- package/assets/esri/core/workers/chunks/{170bdbdb4e21bf91a17f.js → 6eaa7a51efde2dd4a5a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{2bdc63395c7466ce1641.js → 7053c2f5a958d4c8629b.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c35c663528f710e8c78.js → 79cb672c85ea29e8484a.js} +1 -1
- package/assets/esri/core/workers/chunks/82939ead43848a13f765.js +1 -0
- package/assets/esri/core/workers/chunks/89001ee8d3f69fa03cc1.js +1 -0
- package/assets/esri/core/workers/chunks/8b6b963230df56850580.js +1 -0
- package/assets/esri/core/workers/chunks/9472184ef1432fc55d6b.js +1 -0
- package/assets/esri/core/workers/chunks/a6ddf80eb324c35076e1.js +1 -0
- package/assets/esri/core/workers/chunks/a80a6267d88246ede5d3.js +1 -0
- package/assets/esri/core/workers/chunks/{f505ebd4bd3bfb6c790d.js → b6a55fdfe16795ebf02c.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9e1fde9f6b2b4f10c0.js +1 -0
- package/assets/esri/core/workers/chunks/cfa3b2b1e184681e9af4.js +1 -0
- package/assets/esri/core/workers/chunks/{1f69fb9687de9ebfcf90.js → d4ba894a2583f3930a4f.js} +1 -1
- package/assets/esri/core/workers/chunks/d5dfd3d693d5e393a542.js +1 -0
- package/assets/esri/core/workers/chunks/{74fd2059ddda9083cbcc.js → dc6c97a43d642eeaf477.js} +1 -1
- package/assets/esri/core/workers/chunks/{2154d395f405be3cd3ba.js → eca0c3d57b3a1e3a14ee.js} +1 -1
- package/assets/esri/core/workers/chunks/f36697f6aac782007d1a.js +1 -0
- package/assets/esri/core/workers/chunks/f52054f27619a98b7bb7.js +1 -0
- package/assets/esri/core/workers/chunks/fb7fe307a583b6a22218.js +1 -0
- package/assets/esri/core/workers/chunks/fbd3c78ee8e2219a6c7a.js +1 -0
- package/assets/esri/core/workers/chunks/ff42585e1b1d0c5497af.js +1 -0
- package/assets/esri/images/portal/livestreamvideolayer16.png +0 -0
- package/assets/esri/images/portal/{mediaservice16.png → videolayer16.png} +0 -0
- package/assets/esri/themes/base/widgets/_FeatureForm.scss +19 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/geometry/support/DoubleArray.js +1 -1
- package/interfaces.d.ts +84 -0
- package/kernel.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/support/editableLayers.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/request.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -2
- package/webmap/initialViewPropertiesUtils.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/CreateWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflowData.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm/css.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.d.ts +4 -0
- package/widgets/UtilityNetworkValidateTopology.d.ts +4 -0
- package/widgets/support/geolocationUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0fcb8d408696075338e2.js +0 -1
- package/assets/esri/core/workers/chunks/16e459b16bdd6e1a821b.js +0 -1
- package/assets/esri/core/workers/chunks/1b8074269800b384ecf6.js +0 -1
- package/assets/esri/core/workers/chunks/2b55295590b4a0503749.js +0 -1
- package/assets/esri/core/workers/chunks/3ba2fcb9110230f8790c.js +0 -1
- package/assets/esri/core/workers/chunks/5576858f56314afcb4d5.js +0 -1
- package/assets/esri/core/workers/chunks/5706edf45402dff279a6.js +0 -1
- package/assets/esri/core/workers/chunks/659b7bad7281c0e2aed3.js +0 -1
- package/assets/esri/core/workers/chunks/6cd248d065f6d1616294.js +0 -1
- package/assets/esri/core/workers/chunks/9326120c750799eb2d28.js +0 -1
- package/assets/esri/core/workers/chunks/99e0cec47e3ef72c1de4.js +0 -1
- package/assets/esri/core/workers/chunks/9c0e1e87790424f42d7e.js +0 -1
- package/assets/esri/core/workers/chunks/9e66af3b1c70cf25fb32.js +0 -1
- package/assets/esri/core/workers/chunks/a1c31bb8c12831539328.js +0 -1
- package/assets/esri/core/workers/chunks/b0cda39b53ecd6c44cd0.js +0 -1
- package/assets/esri/core/workers/chunks/c08e03165043df67c11b.js +0 -1
- package/assets/esri/core/workers/chunks/c26148d4bfab3b3dfab2.js +0 -1
- package/assets/esri/core/workers/chunks/d6b6bb8aecc85d2a3f6b.js +0 -1
- package/assets/esri/core/workers/chunks/eeaf8010e38b65a101ac.js +0 -1
- package/assets/esri/core/workers/chunks/f235392c56063fbf89c6.js +0 -1
- package/assets/esri/core/workers/chunks/fdd0d3616c97e408b104.js +0 -1
package/widgets/FeatureForm.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{deprecatedProperty as l}from"../core/deprecate.js";import s from"../core/Logger.js";import{watch as a}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import o from"./Widget.js";import{CSS as d}from"./FeatureForm/css.js";import{isGroupInput as u,isFieldInput as c,isRelationshipInput as p,isInputInGroupInput as m,isFieldElementWithInputType as h,formatDateFieldValue as v,getErrorMessageForFieldInput as _,getIconForFeature as b,isNumberFieldInput as g}from"./FeatureForm/featureFormUtils.js";import f from"./FeatureForm/FeatureFormViewModel.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{Heading as F,incrementHeadingLevel as y}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as w}from"./support/decorators/messageBundle.js";import{vmEvent as R}from"./support/decorators/vmEvent.js";import{tsx as C}from"./support/jsxFactory.js";import{DateTime as V}from"luxon";import{substitute as M}from"../intl/substitute.js";import{getLocale as D}from"../intl/locale.js";const O="TT",k="data-field-name",T="latn",x=e=>"valueAsDate"in e,N="esri.widgets.FeatureForm",L=s.getLogger(N);let j=class extends o{constructor(e,t){super(e,t),this._dateFieldInputMap=new Map,this._activeInputName="",this._activeNumberFieldEdit=null,this._fieldFocusNeeded=!1,this._fieldToInitialIncompatibleDomainValue=new Map,this._switchFieldsWithInitialIncompatibleValue=new Set,this._userUpdatedFieldInputNames=new Set,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesTemplates=null,this.viewModel=new f,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,relatedRecordCallbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=e=>{const{feature:t,relatedRecordCallbacks:i}=this;t&&i?.addRelatedRecord&&i.addRelatedRecord({parentFeature:t,relationshipId:e})},this._handleInputInput=e=>{this._commitInputValue(e.currentTarget)},this._handleFormKeyDown=this._handleFormKeyDown.bind(this),this._handleInputBlur=this._handleInputBlur.bind(this),this._handleInputFocus=this._handleInputFocus.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this),this._handleInputKeyDown=this._handleInputKeyDown.bind(this),this._handleOptionChange=this._handleOptionChange.bind(this),this._handleGroupClick=this._handleGroupClick.bind(this),this._handleSubmit=this._handleSubmit.bind(this),this._afterInputCreateOrUpdate=this._afterInputCreateOrUpdate.bind(this),this._afterDateInputCreateOrUpdate=this._afterDateInputCreateOrUpdate.bind(this)}initialize(){this.addHandles([a((()=>this.feature),(()=>{const e=this._getFocusableInput("forward");this._activeInputName=e?.name||"",this._userUpdatedFieldInputNames.clear(),this._fieldToInitialIncompatibleDomainValue.clear(),this._switchFieldsWithInitialIncompatibleValue.clear(),this._dateFieldInputMap.clear(),this._fieldFocusNeeded=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._userUpdatedFieldInputNames.add(e))),this._activeInputName=t,this._fieldFocusNeeded=!0,this.scheduleRender()}})),a((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange()))])}loadDependencies(){return I({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox.js"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker.js"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message.js"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker.js"),label:()=>import("@esri/calcite-components/dist/components/calcite-label.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const e=this.relatedRecordCallbacks;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get relatedRecordCallbacks(){return this.viewModel.relatedRecordCallbacks}set relatedRecordCallbacks(e){this.viewModel.relatedRecordCallbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get view(){return l(L,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view}set view(e){l(L,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view=e}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return C("div",{class:this.classes(d.base,d.widget,d.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return C("form",{class:d.form,novalidate:!0,onsubmit:this._handleSubmit,onkeydown:this._handleFormKeyDown},this._renderHeader(),this._renderInputs())}_renderHeader(){const e=this.viewModel;if(!e.formHeaderVisible)return;const t=null!=e.formTitle&&C(F,{key:"title",level:this.headingLevel},e.formTitle),i=null!=e.formDescription&&C("p",{class:d.description,key:"description"},e.formDescription);return C("div",{class:d.formHeader},t,i)}_renderInputs(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderActiveRelationshipInput(e.activeRelationshipInput):e.inputs.filter(t).filter((e=>e.visible)).map(((e,t)=>u(e)?this._renderGroup(e,t):c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0))}_renderActiveRelationshipInput(e){return this._renderRelationshipInput(e)}_renderDescriptionOrEmpty(e,t){return null==e?null:C("div",{class:this.classes(d.description),id:t},e)}_renderGroup(e,t){const{formTemplate:i,disabled:l}=this,{description:s,inputs:a,label:n,state:r}=e,o=a.filter((e=>e.visible)),u=this.viewModel.findField(this._activeInputName),m=!(!u||u.group!==e),h=`${this.id}_group_${t}`,v=`${this.id}_group-label_${t}`,_=`${this.id}_group-description_${t}`,b=this._renderDescriptionOrEmpty(s,_),g="sequential"===this.groupDisplay,f=g?m:"expanded"===r,I=f?d.collapseIcon:d.expandIcon;return C("fieldset",{"aria-expanded":f.toString(),"aria-labelledby":v,"aria-describedby":s?_:"",class:this.classes(d.group,g?d.groupSequential:null,f?null:d.groupCollapsed,m?d.groupActive:null,l?d.inputDisabled:null),disabled:l,"data-group":e,id:h,key:t,onclick:this._handleGroupClick},C("button",{role:g?"presentation":void 0,class:d.groupHeader,type:"button",tabIndex:g?-1:0},C("div",{class:d.groupTitle},C(F,{class:d.groupLabel,id:v,level:null!=i&&i.title?y(this.headingLevel):this.headingLevel},n),b),g?null:C("span",{class:this.classes(I,d.groupToggleIcon)})),o.map((e=>c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0)))}_getFocusableInput(e,t){const i=this.viewModel.allFieldInputs,l="forward"===e?i:i.slice().reverse();let s;if(!t||p(t))s=0;else if(u(t)){const e=t.inputs.find(c);s=e?l.indexOf(e):0}else{let i;if(m(t)&&"collapsed"===t.group.state){const l=t.group.inputs.filter(c);i="forward"===e?l[l.length-1]:l[0]}else i=t;s=l.indexOf(i)+1}for(let a=s;a<l.length;a++){const e=l[a];if(e.visible&&c(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:l,layer:s}=e;return C("label",{key:`${s.id}-${i.uid}-${e.name}`,class:d.label},[l,"unsupported"!==t?this._renderFieldInput(e):this._renderUnsupportedField(e),this._renderAuxiliaryText(e)])}_renderFieldInput(e){const{dataType:t,domain:i,name:l,updating:s,value:a}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){if(h(e.element,"switch")){const{element:t}=e;if(!(this._switchFieldsWithInitialIncompatibleValue.has(l)||null==a||t.input.onValue!==a&&t.input.offValue!==a))return this._renderSwitchFieldInput(e,n);this._switchFieldsWithInitialIncompatibleValue.add(l)}return"radio-buttons"===e.inputType?this._renderRadioButtonsFieldInput(e,i.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),n):this._renderSelectFieldInput(e,this._getFieldValueOptions(l,i),n)}if("datetime-picker"===e.inputType||"date"===t)return this._renderDateFieldInput(e,n);const r="number"===t?C("input",{type:"number",...n,value:null!=this._activeNumberFieldEdit&&this._activeNumberFieldEdit.fieldName===e.name?this._activeNumberFieldEdit.value:`${n.value}`}):"text-area"===e.inputType?C("textarea",{...n}):C("input",{type:"text",...n});return s?C("div",{key:`${n.key}-input-updating-wrapper`,class:d.fieldInputWrapper},r,C("div",{class:d.fieldInputLoader},C("calcite-progress",{type:"indeterminate"}))):r}_renderDateFieldInput(e,t){const{dateDataType:i,includeTime:l,label:s,name:a,valid:n,value:r}=e,{readOnly:o,required:u}=t;if("string"===i)return this._renderUnsupportedField(e,v(e.field,t.value));const{date:c,time:p}=this._formatValueForDateInputs(r),m=null!=t.max?this._formatValueForDateInputs(t.max):void 0,h=null!=t.min?this._formatValueForDateInputs(t.min):void 0,_=m?.date??void 0,b=h?.date??void 0,g={afterCreate:this._afterDateInputCreate,afterUpdate:this._afterDateInputCreateOrUpdate,"aria-invalid":!n,label:s,numberingSystem:T,overlayPositioning:"fixed",readOnly:o,required:u,tabIndex:0,[k]:a};return C("div",{key:`${t.key}-date-time-container`,class:d.dateInputContainer},C("calcite-input-date-picker",{bind:this,...g,class:this.classes(t.class,d.inputDate),"data-date-part":"date",key:`${t.key}-date-input`,valueAsDate:c??void 0,maxAsDate:_,minAsDate:b,onCalciteInputDatePickerChange:e=>this._commitDateChanges(e.target),onblur:e=>this._commitDateChanges(e.target,!0)}),l?C("calcite-input-time-picker",{bind:this,...g,class:this.classes(t.class,d.inputTime),"data-date-part":"time",key:`${t.key}-time-input`,value:p??void 0,step:1,onCalciteInputTimePickerChange:e=>this._commitDateChanges(e.target),onfocus:e=>{e.target.calciteTimePickerEl&&(e.target.calciteTimePickerEl.showSecond=!0)},onblur:e=>this._commitDateChanges(e.target,!0)}):null)}_renderUnsupportedField(e,t){const i=this.getCommonInputProps(e);return C("input",{afterCreate:i.afterCreate,afterUpdate:i.afterUpdate,class:this.classes(d.input,d.fieldInput,d.inputDisabled),onfocus:i.onfocus,readOnly:!0,tabIndex:i.tabIndex,type:"text",value:null!=t?`${t}`:i.value,[k]:i[k]})}_renderSelectFieldInput(e,t,i){const{element:l,required:s,value:a}=e,{messages:n,messagesTemplates:r}=this,o=t.map((e=>e.map((e=>C("calcite-combobox-item",{value:`${e.value}`,textLabel:e.name,key:`#${e.value}`,selected:a===e.value}))))),[d,u]=o;this._registerIncompatibleValue(a,t.flat(),e,(e=>{u.unshift(C("calcite-combobox-item",{value:`${e}`,textLabel:`${e}`,key:"incompatible-option",readOnly:!0}))}));const c=u.length>0?[C("calcite-combobox-item-group",{key:"recommended",label:n.recommended},d),C("calcite-combobox-item-group",{key:"other",label:r.other},u)]:d,p=null==l,m=h(l,"combo-box"),v=p||m&&l.input?.showNoValueOption;if(!s&&v){const e="",t=m&&l.input.noValueOptionLabel||n.empty;c.unshift(C("calcite-combobox-item",{value:e,textLabel:n.empty,key:"empty-option"},t))}return C("calcite-combobox",{...i,selectionMode:"single",disabled:i.readOnly,allowCustomValues:!1,onCalciteComboboxChange:e=>this._handleOptionChange(e.target)},c)}_registerIncompatibleValue(e,t,i,l){const s=this._fieldToInitialIncompatibleDomainValue,a=s.has(i.name);(a||null!=e&&""!==e&&!t.some((t=>t.value===e)))&&(a||s.set(i.name,e),l?.(e))}_renderRadioButtonsFieldInput(e,t,i){const{element:l,name:s,required:a,value:n}=e,r=t.map((e=>this._renderRadioButton({key:e.name,label:e.name,name:s,value:e.value,selected:e.value===n,props:i})));this._registerIncompatibleValue(n,t,e);const o=null==l,u=h(l,"radio-buttons"),c=o||u&&l.input?.showNoValueOption;if(!a&&c){const e="",t=u&&l.input.noValueOptionLabel||this.messages.empty,a=n===e||null===n;r.unshift(this._renderRadioButton({key:"empty-option",label:t,name:s,value:e,selected:a,props:i}))}return C("div",{key:`${i.key}-radio`,class:d.inputRadioGroup},r)}_renderSwitchFieldInput(e,t){const{value:i}=e,l=!!h(e.element,"switch")&&i===e.element.input.onValue;return C("calcite-switch",{...t,class:d.inputSwitch,onCalciteSwitchChange:e=>this._commitInputValue(e.target),checked:l,disabled:t.readOnly})}_renderRadioButton({key:e,name:t,value:i,selected:l,label:s,props:a}){return C("label",{key:e,class:d.inputRadioLabel},C("input",{...a,class:d.inputRadio,name:t,type:"radio",value:i,checked:l,disabled:a.readOnly,onchange:e=>this._commitInputValue(e.target)}),s)}_renderAuxiliaryText(e){const t=this._userUpdatedFieldInputNames.has(e.name)&&!e.valid?_(e,this.messages):null!=this.viewModel.contingencyConstraintViolations.get(e.name)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=t?C("calcite-input-message",{status:"invalid",icon:!0},t):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){const{featureCount:t,relationshipId:i,showAllActionVisible:l}=e,{relatedRecordCallbacks:s}=this;if(!l||!s?.showAllRelatedRecords)return;const a=this.messages;return C("calcite-list-item",{description:M(a.totalCount,{count:t}),label:a.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(i)},C("calcite-icon",{slot:"content-end",scale:"s",icon:"list"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i}=e,{relatedRecordCallbacks:l}=this;if(t&&l?.addRelatedRecord)return C("calcite-button",{alignment:"center",appearance:"outline-fill",class:d.centeredButton,iconStart:"plus",key:`${i}-add-button`,round:!0,scale:"s",width:"half",onclick:()=>this._onAddRelatedRecordsClick(i)},this.messages.addRecord)}_renderRelatedRecordListItem(e,t){const{feature:i,description:l,title:s}=e,{feature:a,relatedRecordCallbacks:n}=this,r=()=>{n?.editRelatedRecord&&a&&n.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:i})};return C("calcite-list-item",{bind:this,description:l,label:s,key:`${t}-${i.uid}`,value:s,onclick:r},C("calcite-icon",{slot:"content-start",scale:"m",icon:b(i)}),C("calcite-icon",{slot:"content-end",scale:"s",icon:"chevron-right"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{relationshipId:t,relatedFeatureInfos:i,showAllEnabled:l}=e,s=l?null:e.label,a=l?null:this._renderDescriptionOrEmpty(e.description),n=i.map((e=>this._renderRelatedRecordListItem(e,t)));return C("div",{class:d.label,key:`${s}-${t}`},C("calcite-label",null,s,a,C("calcite-list",{loading:e.updating,class:d.relatedRecordList},n,this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())),this._renderAddRelatedRecordButton(e))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return C("div",{key:"feature-observer",class:d.listObserver,bind:this,afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved})}getCommonInputProps(e){const{disabled:t,groupDisplay:i}=this,{dataType:l,editable:s,group:a,hint:n,label:r,maxLength:o,minLength:u,name:c,required:p,valid:m,value:h}=e,v=this._userUpdatedFieldInputNames.has(c),_=!s||t,b="all"===i&&null!=a&&"collapsed"===a.state;return{afterCreate:this._afterInputCreateOrUpdate,afterUpdate:this._afterInputCreateOrUpdate,"aria-invalid":m?"false":"true",class:this.classes(d.input,d.fieldInput,_?d.inputDisabled:null,v&&!m?d.inputInvalid:null),key:c,label:r,minlength:u>-1?`${u}`:"",maxlength:o>-1?`${o}`:"",...e.range,readOnly:_,value:null==h?"":`${h}`,[k]:c,onfocus:this._handleInputFocus,oninput:this._handleInputInput,onblur:this._handleInputBlur,onkeydown:this._handleInputKeyDown,onmousedown:"number"===l?this._handleNumberInputMouseDown:void 0,placeholder:"number"===l||"text"===l?n??void 0:"",required:p,tabIndex:b?-1:0}}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),l=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(l.length>0){const e=new Set(l.map((e=>e.value)));return[l,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const s of this.viewModel.allFieldInputs){const{name:i,value:l}=s;null!=l&&i!==e&&this.viewModel.fieldsWithContingentValues.has(i)&&(t[i]=l)}const i=this.viewModel.joinedContingentValues.slice(),l=new Map;for(const s of i){const i=s.values[e];if(null==i||"code"!==i.objectType&&"null"!==i.objectType)continue;const{code:a,name:n}=i.codedValue&&"null"!==i.objectType?i.codedValue:{code:"",name:this.messages.empty};if(l.has(a))continue;Object.entries(t).every((([e,t])=>!s.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,s.values[e])))&&l.set(a,{name:n,value:a})}return[...l.values()]}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(k))}async _afterDateInputCreate(e){!x(e)&&null!=e.value&&"setValue"in e&&e.setValue({value:e.value,origin:"external"}),this._afterDateInputCreateOrUpdate(e)}_afterDateInputCreateOrUpdate(e){const{name:t}=this._getFieldInputFromHTMLElement(e),i=this._dateFieldInputMap.get(t),l=x(e);null!=i?l?i.date=e:i.time=e:this._dateFieldInputMap.set(t,{[l?"date":"time"]:e}),this._afterInputCreateOrUpdate(e)}_afterInputCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),l=t.findField(this._activeInputName),s=this._fieldToInitialIncompatibleDomainValue.get(i.name)===i.value;this._fieldFocusNeeded&&l===i&&("radio-buttons"!==i.inputType||s||e.checked)&&(this._fieldFocusNeeded=!1,m(i)&&(i.group.state="expanded"),e.focus())}_handleInputFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._activeInputName=i.name,g(i)&&(this._activeNumberFieldEdit={fieldName:i.name,input:t,value:t.value})}_handleInputBlur(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);"number"===i.dataType&&null!=this._activeNumberFieldEdit&&(this._activeNumberFieldEdit.input.value=`${i.value}`,this._activeNumberFieldEdit=null),this._commitInputValue(t),this.scheduleRender()}_commitDateChanges(e,t=!1){const{name:i}=this._getFieldInputFromHTMLElement(e);if(!this._dateFieldInputMap.has(i))return;const l=this._dateFieldInputMap.get(i);if(!l||!l.date)return;const s=this._getFieldValueFromDateInput(e),a=this._getFieldValueFromDateInputs(l.date,l.time);this.viewModel.getValue(i)!==a&&(null!==s&&null!==a?this._updateFieldValue(i,a):t&&this._updateFieldValue(i,null))}_commitInputValue(e){const t=this._getFieldInputFromHTMLElement(e);null!=this._activeNumberFieldEdit&&g(t)&&(this._activeNumberFieldEdit.value=e.value),this._updateFieldValue(t.name,this._parseValue(e))}_handleInputKeyDown(e){const{key:t,altKey:i,ctrlKey:l,metaKey:s}=e,a=this._getFieldInputFromHTMLElement(e.target);if("Enter"===t)m(a)&&"collapsed"===a.group.state&&(a.group.state="expanded");else{const{type:n}=a.field,r="single"===n||"double"===n;if(("integer"===n||"small-integer"===n||r)&&(!i&&!l&&!s)&&1===t.length){const i=Number(t),l=["-","+"],s=["e","."],a=r?[...l,...s]:l;isNaN(i)&&!a.includes(t)&&e.preventDefault()}}}_updateFieldValue(e,t){if(this.viewModel.setValue(e,t),this._userUpdatedFieldInputNames.add(e),this.viewModel.fieldsWithContingentValues.has(e)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;if(h(t.element,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.element.input.onValue:t.element.input.offValue;if("radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked)return t.value;const{dataType:l}=t;return"number"===l?i?parseFloat(i):null:i}_handleOptionChange(e){this._commitInputValue(e),this.scheduleRender()}_handleGroupClick(e){const t=e.currentTarget["data-group"],i="expanded"===t.state,l="sequential"===this.groupDisplay,s=`.${d.groupHeader}`;if(!(i&&!e.target.closest(s))){if(this._activeInputName=this._getFocusableInput("forward",t)?.name||"",l){const l=e.target.closest(s);if(i&&!l)return;this.viewModel.inputs.forEach((e=>{u(e)&&e!==t&&(e.state="collapsed")}))}t.state=i?"collapsed":"expanded",this._fieldFocusNeeded=l,this.scheduleRender()}}_handleSubmit(e){e.preventDefault()}_handleFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_getDefaultLocaleOptions(){return{locale:D(),numberingSystem:T}}_getFieldValueFromDateInputs(e,t){const i=this._getDateTimeFromInput(e),l=this._getDateTimeFromInput(t);if(!i&&!l)return null;const s=this._getFieldInputFromHTMLElement(e).range,a=Date.now(),n=null!=s.max&&s.max<a?s.max:a,r=V.fromMillis(n,this._getDefaultLocaleOptions()),o=i||r,{year:d,month:u,day:c}=o,{hour:p,minute:m,second:h}=l||r,v=o.set({year:d,month:u,day:c,hour:p,minute:m,second:h});return v.isValid?v.toMillis():null}_getDateTimeFromInput(e){if(!e)return null;let t=null;if(x(e)){const i=e.valueAsDate;if(!i||Array.isArray(i))return null;t=V.fromJSDate(i)}else{if(!e.value)return null;t=V.fromFormat(e.value,O,this._getDefaultLocaleOptions())}return t??null}_getFieldValueFromDateInput(e){return this._dateTimeToFieldValue(this._getDateTimeFromInput(e))}_dateTimeToFieldValue(e){return e?.isValid?e.toMillis():null}_dateTimeFromFieldValue(e){return null===e?null:V.fromMillis(e,this._getDefaultLocaleOptions())}_formatValueForDateInputs(e){if(null==e||isNaN(e))return{date:null,time:null};const t=this._dateTimeFromFieldValue(e);return t?{date:t.toJSDate(),time:t.toFormat(O,this._getDefaultLocaleOptions())}:{date:null,time:null}}_valueIsValidContingentValue(e,t){switch(t.objectType){case"any":return!0;case"null":return null==e;case"code":return e===t.codedValue?.code;case"range":return null!=e&&null!=t.minValue&&null!=t.maxValue&&+e>=t.minValue&&+e<=t.maxValue;default:return i(t.objectType),!1}}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}async _onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;if(!e)return;const{showAllEnabled:t,updating:i}=e;this._listObserverNode&&!i&&t&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}};e([n()],j.prototype,"_listObserverNode",void 0),e([n()],j.prototype,"_relatedRecordsEnabled",null),e([n()],j.prototype,"disabled",null),e([n()],j.prototype,"feature",null),e([n()],j.prototype,"formTemplate",null),e([n()],j.prototype,"groupDisplay",void 0),e([n()],j.prototype,"headingLevel",void 0),e([n()],j.prototype,"label",null),e([n()],j.prototype,"layer",null),e([n()],j.prototype,"map",null),e([n(),w("esri/widgets/FeatureForm/t9n/FeatureForm")],j.prototype,"messages",void 0),e([n(),w("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],j.prototype,"messagesTemplates",void 0),e([n()],j.prototype,"relatedRecordCallbacks",null),e([n()],j.prototype,"relationshipId",null),e([n()],j.prototype,"spatialReference",null),e([n()],j.prototype,"strict",null),e([n()],j.prototype,"view",null),e([n(),R(["value-change","submit"])],j.prototype,"viewModel",void 0),j=e([r(N)],j);const E=j;export{E as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{neverReached as i}from"../core/compilerUtils.js";import{deprecatedProperty as s}from"../core/deprecate.js";import a from"../core/Logger.js";import{watch as l}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{subclass as r}from"../core/accessorSupport/decorators/subclass.js";import o from"./Widget.js";import{CSS as d}from"./FeatureForm/css.js";import{isGroupInput as u,isFieldInput as c,isRelationshipInput as p,isInputInGroupInput as m,isFieldElementWithInputType as h,formatDateFieldValue as v,getErrorMessageForFieldInput as _,getIconForFeature as b,isNumberFieldInput as g}from"./FeatureForm/featureFormUtils.js";import f from"./FeatureForm/FeatureFormViewModel.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{Heading as F,incrementHeadingLevel as y}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as w}from"./support/decorators/messageBundle.js";import{vmEvent as R}from"./support/decorators/vmEvent.js";import{tsx as C}from"./support/jsxFactory.js";import{DateTime as M}from"luxon";import{substitute as V}from"../intl/substitute.js";import{getLocale as D}from"../intl/locale.js";const k="TT",O="data-field-name",T="latn",x=e=>"valueAsDate"in e,N="esri.widgets.FeatureForm",L=a.getLogger(N);let j=class extends o{constructor(e,t){super(e,t),this._dateFieldInputMap=new Map,this._activeInputName="",this._activeNumberFieldEdit=null,this._fieldFocusNeeded=!1,this._fieldToInitialIncompatibleDomainValue=new Map,this._switchFieldsWithInitialIncompatibleValue=new Set,this._userUpdatedFieldInputNames=new Set,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new f,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,relatedRecordCallbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t)=>{const{feature:i,relatedRecordCallbacks:s}=this;i&&s?.addRelatedRecord&&s.addRelatedRecord({parentFeature:i,relatedLayer:t,relationshipId:e})},this._handleInputInput=e=>{this._commitInputValue(e.currentTarget)},this._handleFormKeyDown=this._handleFormKeyDown.bind(this),this._handleInputBlur=this._handleInputBlur.bind(this),this._handleInputFocus=this._handleInputFocus.bind(this),this._handleNumberInputMouseDown=this._handleNumberInputMouseDown.bind(this),this._handleInputKeyDown=this._handleInputKeyDown.bind(this),this._handleOptionChange=this._handleOptionChange.bind(this),this._handleGroupClick=this._handleGroupClick.bind(this),this._handleSubmit=this._handleSubmit.bind(this),this._afterInputCreateOrUpdate=this._afterInputCreateOrUpdate.bind(this),this._afterDateInputCreateOrUpdate=this._afterDateInputCreateOrUpdate.bind(this)}initialize(){this.addHandles([l((()=>this.feature),(()=>{const e=this._getFocusableInput("forward");this._activeInputName=e?.name||"",this._userUpdatedFieldInputNames.clear(),this._fieldToInitialIncompatibleDomainValue.clear(),this._switchFieldsWithInitialIncompatibleValue.clear(),this._dateFieldInputMap.clear(),this._fieldFocusNeeded=!0})),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._userUpdatedFieldInputNames.add(e))),this._activeInputName=t,this._fieldFocusNeeded=!0,this.scheduleRender()}})),l((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange()))])}loadDependencies(){return I({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox.js"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item.js"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker.js"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message.js"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker.js"),list:()=>import("@esri/calcite-components/dist/components/calcite-list.js"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item.js"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader.js"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice.js"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress.js"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch.js")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const e=this.relatedRecordCallbacks;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get relatedRecordCallbacks(){return this.viewModel.relatedRecordCallbacks}set relatedRecordCallbacks(e){this.viewModel.relatedRecordCallbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get view(){return s(L,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view}set view(e){s(L,"view",{replacement:"Use FeatureForm.map instead.",version:"4.27"}),this.viewModel.view=e}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return C("div",{class:this.classes(d.base,d.widget,d.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return C("form",{class:d.form,novalidate:!0,onsubmit:this._handleSubmit,onkeydown:this._handleFormKeyDown},this._renderHeader(),this._renderInputs())}_renderHeader(){const e=this.viewModel;if(!e.formHeaderVisible)return;const t=null!=e.formTitle&&C(F,{key:"title",level:this.headingLevel},e.formTitle),i=null!=e.formDescription&&C("p",{class:d.description,key:"description"},e.formDescription);return C("div",{class:d.formHeader},t,i)}_renderInputs(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderActiveRelationshipInput(e.activeRelationshipInput):e.inputs.filter(t).filter((e=>e.visible)).map(((e,t)=>u(e)?this._renderGroup(e,t):c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0))}_renderActiveRelationshipInput(e){return this._renderRelationshipInput(e)}_renderDescriptionOrEmpty(e,t){return null==e?null:C("div",{class:this.classes(d.description),id:t},e)}_renderGroup(e,t){const{formTemplate:i,disabled:s}=this,{description:a,inputs:l,label:n,state:r}=e,o=l.filter((e=>e.visible)),u=this.viewModel.findField(this._activeInputName),m=!(!u||u.group!==e),h=`${this.id}_group_${t}`,v=`${this.id}_group-label_${t}`,_=`${this.id}_group-description_${t}`,b=this._renderDescriptionOrEmpty(a,_),g="sequential"===this.groupDisplay,f=g?m:"expanded"===r,I=f?d.collapseIcon:d.expandIcon;return C("fieldset",{"aria-expanded":f.toString(),"aria-labelledby":v,"aria-describedby":a?_:"",class:this.classes(d.group,g?d.groupSequential:null,f?null:d.groupCollapsed,m?d.groupActive:null,s?d.inputDisabled:null),disabled:s,"data-group":e,id:h,key:t,onclick:this._handleGroupClick},C("button",{role:g?"presentation":void 0,class:d.groupHeader,type:"button",tabIndex:g?-1:0},C("div",{class:d.groupTitle},C(F,{class:d.groupLabel,id:v,level:null!=i&&i.title?y(this.headingLevel):this.headingLevel},n),b),g?null:C("span",{class:this.classes(I,d.groupToggleIcon)})),o.map((e=>c(e)?this._renderLabeledField(e):p(e)?this._renderRelationshipInput(e):void 0)))}_getFocusableInput(e,t){const i=this.viewModel.allFieldInputs,s="forward"===e?i:i.slice().reverse();let a;if(!t||p(t))a=0;else if(u(t)){const e=t.inputs.find(c);a=e?s.indexOf(e):0}else{let i;if(m(t)&&"collapsed"===t.group.state){const s=t.group.inputs.filter(c);i="forward"===e?s[s.length-1]:s[0]}else i=t;a=s.indexOf(i)+1}for(let l=a;l<s.length;l++){const e=s[l];if(e.visible&&c(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:s,layer:a}=e;return C("label",{key:`${a.id}-${i.uid}-${e.name}`,class:d.label},[s,"unsupported"!==t?this._renderFieldInput(e):this._renderUnsupportedField(e),this._renderAuxiliaryText(e)])}_renderFieldInput(e){const{dataType:t,domain:i,name:s,updating:a,value:l}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){if(h(e.element,"switch")){const{element:t}=e;if(!(this._switchFieldsWithInitialIncompatibleValue.has(s)||null==l||t.input.onValue!==l&&t.input.offValue!==l))return this._renderSwitchFieldInput(e,n);this._switchFieldsWithInitialIncompatibleValue.add(s)}return"radio-buttons"===e.inputType?this._renderRadioButtonsFieldInput(e,i.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),n):this._renderSelectFieldInput(e,this._getFieldValueOptions(s,i),n)}if("datetime-picker"===e.inputType||"date"===t)return this._renderDateFieldInput(e,n);const r="number"===t?C("input",{type:"number",...n,value:null!=this._activeNumberFieldEdit&&this._activeNumberFieldEdit.fieldName===e.name?this._activeNumberFieldEdit.value:`${n.value}`}):"text-area"===e.inputType?C("textarea",{...n}):C("input",{type:"text",...n});return a?C("div",{key:`${n.key}-input-updating-wrapper`,class:d.fieldInputWrapper},r,C("div",{class:d.fieldInputLoader},C("calcite-progress",{type:"indeterminate"}))):r}_renderDateFieldInput(e,t){const{dateDataType:i,includeTime:s,label:a,name:l,valid:n,value:r}=e,{readOnly:o,required:u}=t;if("string"===i)return this._renderUnsupportedField(e,v(e.field,t.value));const{date:c,time:p}=this._formatValueForDateInputs(r),m=null!=t.max?this._formatValueForDateInputs(t.max):void 0,h=null!=t.min?this._formatValueForDateInputs(t.min):void 0,_=m?.date??void 0,b=h?.date??void 0,g={afterCreate:this._afterDateInputCreate,afterUpdate:this._afterDateInputCreateOrUpdate,"aria-invalid":!n,label:a,numberingSystem:T,overlayPositioning:"fixed",readOnly:o,required:u,tabIndex:0,[O]:l};return C("div",{key:`${t.key}-date-time-container`,class:d.dateInputContainer},C("calcite-input-date-picker",{bind:this,...g,class:this.classes(t.class,d.inputDate),"data-date-part":"date",key:`${t.key}-date-input`,valueAsDate:c??void 0,maxAsDate:_,minAsDate:b,onCalciteInputDatePickerChange:e=>this._commitDateChanges(e.target),onblur:e=>this._commitDateChanges(e.target,!0)}),s?C("calcite-input-time-picker",{bind:this,...g,class:this.classes(t.class,d.inputTime),"data-date-part":"time",key:`${t.key}-time-input`,value:p??void 0,step:1,onCalciteInputTimePickerChange:e=>this._commitDateChanges(e.target),onfocus:e=>{e.target.calciteTimePickerEl&&(e.target.calciteTimePickerEl.showSecond=!0)},onblur:e=>this._commitDateChanges(e.target,!0)}):null)}_renderUnsupportedField(e,t){const i=this.getCommonInputProps(e);return C("input",{afterCreate:i.afterCreate,afterUpdate:i.afterUpdate,class:this.classes(d.input,d.fieldInput,d.inputDisabled),onfocus:i.onfocus,readOnly:!0,tabIndex:i.tabIndex,type:"text",value:null!=t?`${t}`:i.value,[O]:i[O]})}_renderSelectFieldInput(e,t,i){const{element:s,required:a,value:l}=e,{messages:n,messagesTemplates:r}=this,o=t.map((e=>e.map((e=>C("calcite-combobox-item",{value:`${e.value}`,textLabel:e.name,key:`#${e.value}`,selected:l===e.value}))))),[d,u]=o;this._registerIncompatibleValue(l,t.flat(),e,(e=>{u.unshift(C("calcite-combobox-item",{value:`${e}`,textLabel:`${e}`,key:"incompatible-option",readOnly:!0}))}));const c=u.length>0?[C("calcite-combobox-item-group",{key:"recommended",label:n.recommended},d),C("calcite-combobox-item-group",{key:"other",label:r.other},u)]:d,p=null==s,m=h(s,"combo-box"),v=p||m&&s.input?.showNoValueOption;if(!a&&v){const e="",t=m&&s.input.noValueOptionLabel||n.empty;c.unshift(C("calcite-combobox-item",{value:e,textLabel:n.empty,key:"empty-option"},t))}return C("calcite-combobox",{...i,selectionMode:"single",disabled:i.readOnly,allowCustomValues:!1,onCalciteComboboxChange:e=>this._handleOptionChange(e.target)},c)}_registerIncompatibleValue(e,t,i,s){const a=this._fieldToInitialIncompatibleDomainValue,l=a.has(i.name);(l||null!=e&&""!==e&&!t.some((t=>t.value===e)))&&(l||a.set(i.name,e),s?.(e))}_renderRadioButtonsFieldInput(e,t,i){const{element:s,name:a,required:l,value:n}=e,r=t.map((e=>this._renderRadioButton({key:e.name,label:e.name,name:a,value:e.value,selected:e.value===n,props:i})));this._registerIncompatibleValue(n,t,e);const o=null==s,u=h(s,"radio-buttons"),c=o||u&&s.input?.showNoValueOption;if(!l&&c){const e="",t=u&&s.input.noValueOptionLabel||this.messages.empty,l=n===e||null===n;r.unshift(this._renderRadioButton({key:"empty-option",label:t,name:a,value:e,selected:l,props:i}))}return C("div",{key:`${i.key}-radio`,class:d.inputRadioGroup},r)}_renderSwitchFieldInput(e,t){const{value:i}=e,s=!!h(e.element,"switch")&&i===e.element.input.onValue;return C("calcite-switch",{...t,class:d.inputSwitch,onCalciteSwitchChange:e=>this._commitInputValue(e.target),checked:s,disabled:t.readOnly})}_renderRadioButton({key:e,name:t,value:i,selected:s,label:a,props:l}){return C("label",{key:e,class:d.inputRadioLabel},C("input",{...l,class:d.inputRadio,name:t,type:"radio",value:i,checked:s,disabled:l.readOnly,onchange:e=>this._commitInputValue(e.target)}),a)}_renderAuxiliaryText(e){const t=this._userUpdatedFieldInputNames.has(e.name)&&!e.valid?_(e,this.messages):null!=this.viewModel.contingencyConstraintViolations.get(e.name)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=t?C("calcite-input-message",{status:"invalid",icon:!0},t):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){const{featureCount:t,relationshipId:i,showAllActionVisible:s}=e,{relatedRecordCallbacks:a}=this;if(!s||!a?.showAllRelatedRecords)return;const l=this.messages;return C("calcite-list-item",{description:V(l.totalCount,{count:t}),label:l.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(i)},C("calcite-icon",{slot:"content-end",scale:"s",icon:"list"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:s}=e,{relatedRecordCallbacks:a}=this;if(t&&a?.addRelatedRecord&&s)return C("calcite-button",{alignment:"center",appearance:"outline-fill",class:d.centeredButton,disabled:e.updating,iconStart:"plus",key:`${i}-add-button`,round:!0,scale:"s",width:"half",onclick:()=>this._onAddRelatedRecordsClick(i,s)},this.messages.addRecord)}_renderRelatedRecordListItem(e,t){const{feature:i,description:s,title:a}=e,{feature:l,relatedRecordCallbacks:n}=this,r=()=>{n?.editRelatedRecord&&l&&n.editRelatedRecord({parentFeature:l,relationshipId:t,relatedFeature:i})};return C("calcite-list-item",{bind:this,description:s,label:a,key:`${t}-${i.uid}`,value:a,onclick:r},C("calcite-icon",{slot:"content-start",scale:"m",icon:b(i)}),C("calcite-icon",{slot:"content-end",scale:"s",icon:"chevron-right"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{relationshipId:t,relatedFeatureInfos:i,showAllEnabled:s}=e,a=s?null:this._renderDescriptionOrEmpty(e.description),l=i.length?this._renderRelatedRecordsList(e):e.loaded?this._renderNoRelatedRecordsNotice():void 0;return C("label",{class:this.classes(d.label,d.relationshipLabel),key:`relationship-${t}-container`},C("div",null,this._renderRelatedRecordsHeaderContainer(e),a,l),this._renderAddRelatedRecordButton(e))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return C("div",{class:d.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},C("span",null,e.label),t?C("calcite-loader",{label:this.messagesCommon?.loading,inline:!0,key:"loader",scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t}=e;return C("calcite-list",{class:d.relatedRecordsList},e.relatedFeatureInfos.map((e=>this._renderRelatedRecordListItem(e,t))),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoRelatedRecordsNotice(){return C("calcite-notice",{open:!0,scale:"s",kind:"brand",icon:"information",width:"full"},C("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return C("div",{key:"feature-observer",class:d.listObserver,bind:this,afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved})}getCommonInputProps(e){const{disabled:t,groupDisplay:i}=this,{dataType:s,editable:a,group:l,hint:n,label:r,maxLength:o,minLength:u,name:c,required:p,valid:m,value:h}=e,v=this._userUpdatedFieldInputNames.has(c),_=!a||t,b="all"===i&&null!=l&&"collapsed"===l.state;return{afterCreate:this._afterInputCreateOrUpdate,afterUpdate:this._afterInputCreateOrUpdate,"aria-invalid":m?"false":"true",class:this.classes(d.input,d.fieldInput,_?d.inputDisabled:null,v&&!m?d.inputInvalid:null),key:c,label:r,minlength:u>-1?`${u}`:"",maxlength:o>-1?`${o}`:"",...e.range,readOnly:_,value:null==h?"":`${h}`,[O]:c,onfocus:this._handleInputFocus,oninput:this._handleInputInput,onblur:this._handleInputBlur,onkeydown:this._handleInputKeyDown,onmousedown:"number"===s?this._handleNumberInputMouseDown:void 0,placeholder:"number"===s||"text"===s?n??void 0:"",required:p,tabIndex:b?-1:0}}_handleNumberInputMouseDown({target:e}){e.focus(),this.scheduleRender()}_getFieldValueOptions(e,t){const i=t.codedValues.map((({code:e,name:t})=>({value:e,name:t}))),s=this.viewModel.fieldsWithContingentValues.has(e)?this._getContingentValueOptions(e):[];if(s.length>0){const e=new Set(s.map((e=>e.value)));return[s,i.filter((t=>!e.has(t.value)))]}return[i,[]]}_getContingentValueOptions(e){const t={};for(const a of this.viewModel.allFieldInputs){const{name:i,value:s}=a;null!=s&&i!==e&&this.viewModel.fieldsWithContingentValues.has(i)&&(t[i]=s)}const i=this.viewModel.joinedContingentValues.slice(),s=new Map;for(const a of i){const i=a.values[e];if(null==i||"code"!==i.objectType&&"null"!==i.objectType)continue;const{code:l,name:n}=i.codedValue&&"null"!==i.objectType?i.codedValue:{code:"",name:this.messages.empty};if(s.has(l))continue;Object.entries(t).every((([e,t])=>!a.values.hasOwnProperty(e)||this._valueIsValidContingentValue(t,a.values[e])))&&s.set(l,{name:n,value:l})}return[...s.values()]}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(O))}async _afterDateInputCreate(e){this._afterDateInputCreateOrUpdate(e)}_afterDateInputCreateOrUpdate(e){const{name:t}=this._getFieldInputFromHTMLElement(e),i=this._dateFieldInputMap.get(t),s=x(e);null!=i?s?i.date=e:i.time=e:this._dateFieldInputMap.set(t,{[s?"date":"time"]:e}),this._afterInputCreateOrUpdate(e)}_afterInputCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),s=t.findField(this._activeInputName),a=this._fieldToInitialIncompatibleDomainValue.get(i.name)===i.value;this._fieldFocusNeeded&&s===i&&("radio-buttons"!==i.inputType||a||e.checked)&&(this._fieldFocusNeeded=!1,m(i)&&(i.group.state="expanded"),e.focus())}_handleInputFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._activeInputName=i.name,g(i)&&(this._activeNumberFieldEdit={fieldName:i.name,input:t,value:t.value})}_handleInputBlur(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);"number"===i.dataType&&null!=this._activeNumberFieldEdit&&(this._activeNumberFieldEdit.input.value=`${i.value}`,this._activeNumberFieldEdit=null),this._commitInputValue(t),this.scheduleRender()}_commitDateChanges(e,t=!1){const{name:i}=this._getFieldInputFromHTMLElement(e);if(!this._dateFieldInputMap.has(i))return;const s=this._dateFieldInputMap.get(i);if(!s||!s.date)return;const a=this._getFieldValueFromDateInput(e),l=this._getFieldValueFromDateInputs(s.date,s.time);this.viewModel.getValue(i)!==l&&(null!==a&&null!==l?this._updateFieldValue(i,l):t&&this._updateFieldValue(i,null))}_commitInputValue(e){const t=this._getFieldInputFromHTMLElement(e);null!=this._activeNumberFieldEdit&&g(t)&&(this._activeNumberFieldEdit.value=e.value),this._updateFieldValue(t.name,this._parseValue(e))}_handleInputKeyDown(e){const{key:t,altKey:i,ctrlKey:s,metaKey:a}=e,l=this._getFieldInputFromHTMLElement(e.target);if("Enter"===t)m(l)&&"collapsed"===l.group.state&&(l.group.state="expanded");else{const{type:n}=l.field,r="single"===n||"double"===n;if(("integer"===n||"small-integer"===n||r)&&(!i&&!s&&!a)&&1===t.length){const i=Number(t),s=["-","+"],a=["e","."],l=r?[...s,...a]:s;isNaN(i)&&!l.includes(t)&&e.preventDefault()}}}_updateFieldValue(e,t){if(this.viewModel.setValue(e,t),this._userUpdatedFieldInputNames.add(e),this.viewModel.fieldsWithContingentValues.has(e)){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;if(h(t.element,"switch")&&"CALCITE-COMBOBOX"!==e.tagName)return e.checked?t.element.input.onValue:t.element.input.offValue;if("radio-buttons"===t.inputType&&"radio"===e.type&&!e.checked)return t.value;const{dataType:s}=t;return"number"===s?i?parseFloat(i):null:i}_handleOptionChange(e){this._commitInputValue(e),this.scheduleRender()}_handleGroupClick(e){const t=e.currentTarget["data-group"],i="expanded"===t.state,s="sequential"===this.groupDisplay,a=`.${d.groupHeader}`;if(!(i&&!e.target.closest(a))){if(this._activeInputName=this._getFocusableInput("forward",t)?.name||"",s){const s=e.target.closest(a);if(i&&!s)return;this.viewModel.inputs.forEach((e=>{u(e)&&e!==t&&(e.state="collapsed")}))}t.state=i?"collapsed":"expanded",this._fieldFocusNeeded=s,this.scheduleRender()}}_handleSubmit(e){e.preventDefault()}_handleFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_getDefaultLocaleOptions(){return{locale:D(),numberingSystem:T}}_getFieldValueFromDateInputs(e,t){const i=this._getDateTimeFromInput(e),s=this._getDateTimeFromInput(t);if(!i&&!s)return null;const a=this._getFieldInputFromHTMLElement(e).range,l=Date.now(),n=null!=a.max&&a.max<l?a.max:l,r=M.fromMillis(n,this._getDefaultLocaleOptions()),o=i||r,{year:d,month:u,day:c}=o,{hour:p,minute:m,second:h}=s||r,v=o.set({year:d,month:u,day:c,hour:p,minute:m,second:h});return v.isValid?v.toMillis():null}_getDateTimeFromInput(e){if(!e)return null;let t=null;if(x(e)){const i=e.valueAsDate;if(!i||Array.isArray(i))return null;t=M.fromJSDate(i)}else{if(!e.value)return null;t=M.fromFormat(e.value,k,this._getDefaultLocaleOptions())}return t??null}_getFieldValueFromDateInput(e){return this._dateTimeToFieldValue(this._getDateTimeFromInput(e))}_dateTimeToFieldValue(e){return e?.isValid?e.toMillis():null}_dateTimeFromFieldValue(e){return null===e?null:M.fromMillis(e,this._getDefaultLocaleOptions())}_formatValueForDateInputs(e){if(null==e||isNaN(e))return{date:null,time:null};const t=this._dateTimeFromFieldValue(e);return t?{date:t.toJSDate(),time:t.toFormat(k,this._getDefaultLocaleOptions())}:{date:null,time:null}}_valueIsValidContingentValue(e,t){switch(t.objectType){case"any":return!0;case"null":return null==e;case"code":return e===t.codedValue?.code;case"range":return null!=e&&null!=t.minValue&&null!=t.maxValue&&+e>=t.minValue&&+e<=t.maxValue;default:return i(t.objectType),!1}}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}async _onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;if(!e)return;const{showAllEnabled:t,updating:i}=e;this._listObserverNode&&!i&&t&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}};e([n()],j.prototype,"_listObserverNode",void 0),e([n()],j.prototype,"_relatedRecordsEnabled",null),e([n()],j.prototype,"disabled",null),e([n()],j.prototype,"feature",null),e([n()],j.prototype,"formTemplate",null),e([n()],j.prototype,"groupDisplay",void 0),e([n()],j.prototype,"headingLevel",void 0),e([n()],j.prototype,"label",null),e([n()],j.prototype,"layer",null),e([n()],j.prototype,"map",null),e([n(),w("esri/widgets/FeatureForm/t9n/FeatureForm")],j.prototype,"messages",void 0),e([n(),w("esri/t9n/common")],j.prototype,"messagesCommon",void 0),e([n(),w("esri/widgets/Feature/t9n/Feature")],j.prototype,"messagesFeature",void 0),e([n(),w("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],j.prototype,"messagesTemplates",void 0),e([n()],j.prototype,"relatedRecordCallbacks",null),e([n()],j.prototype,"relationshipId",null),e([n()],j.prototype,"spatialReference",null),e([n()],j.prototype,"strict",null),e([n()],j.prototype,"view",null),e([n(),R(["value-change","submit"])],j.prototype,"viewModel",void 0),j=e([r(N)],j);const E=j;export{E as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{HandleOwnerMixin as r}from"../../core/HandleOwner.js";import s from"../../core/ObjectPool.js";import{when as o}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{getEffectiveLayerCapabilities as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Evented.js";import{HandleOwnerMixin as r}from"../../core/HandleOwner.js";import s from"../../core/ObjectPool.js";import{when as o}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{isTable as i,getEffectiveLayerCapabilities as n}from"../../layers/support/layerUtils.js";import p from"./TemplateItem.js";import u from"./TemplateItemGroup.js";var m;const y=({layer:e})=>({key:e,label:e.title??""}),c=({layer:e})=>({key:e.geometryType,label:e.geometryType??""});let h=m=class extends(r(t.EventedAccessor)){constructor(e){super(e),this._itemPool=new s(p),this._groupPool=new s(u),this.filterFunction=null,this.selectedItem=null}initialize(){this._get("groupBy")||(this.groupBy="layer")}set groupBy(e){if(this._set("groupBy",e),"function"!=typeof e)switch(e){case"layer":this._groupByFunction=y;break;case"geometry":this._groupByFunction=c;break;default:this._groupByFunction=null}else this._groupByFunction=t=>this._ensureGroupByObject(e(t))}set layers(e){const t="layers";if(this.handles.remove(t),e){const r=()=>this.notifyChange("state");this.handles.add(e.map((e=>o((()=>e.loadStatus),r))),t)}this._set("layers",e)}get layers(){return this._get("layers")}get state(){const{layers:e}=this;return e&&0!==e.length?e.some((e=>"loading"===e.loadStatus||"not-loaded"===e.loadStatus))?"loading":"ready":"disabled"}get _featureTemplatesByLayer(){if(!this.layers)return new Map;const e=[];for(const t of this.layers)if("subtype-group"===t.type)for(const r of t.sublayers){const t=f(r);e.push([r,t])}else i(t)||e.push([t,f(t)]);return new Map(e)}get numberOfFeatureTemplates(){return Array.from(this._featureTemplatesByLayer.values()).reduce(((e,t)=>e+t.length),0)}get items(){if(0===this.numberOfFeatureTemplates)return this._releasePreviousItems(),[];const e=this._featureTemplatesByLayer,t=[],r=null!=this.filterFunction?this.filterFunction:m._nullFilterFunction;for(const[l,a]of e)if(l.loaded||"subtype-sublayer"===l.type&&l.parent?.loaded){const e=n(l)?.operations;if(e?.supportsEditing&&e?.supportsAdd)for(const s of a)t.push({layer:l,template:s,matchesFilter:r({label:s.name})})}if(null==this._groupByFunction){const e=t.filter((({matchesFilter:e})=>e)).map((({template:e,layer:t})=>this._createItem(e,t)));return this._releasePreviousItems(),e}const s=new Map;for(const l of t){const{template:e,layer:t}=l,r=this._groupByFunction({template:e,layer:t}),{key:o,label:a}=null!=r.key?r:m.nullGroupBy;s.has(o)||s.set(o,{label:a,templateItemInfos:[]}),s.get(o)?.templateItemInfos.push(l)}const o=[];for(const l of s.values()){const{label:e,templateItemInfos:t}=l,s=t.filter((({matchesFilter:e})=>e)),a=r({label:e})?t:t.length>0?s:[];if(a.length>0){const t=a.map((({template:e,layer:t})=>this._createItem(e,t)));o.push(this._createGroup(e,t))}}return 1===o.length&&o[0].label===m.nullGroupBy.label?(this._releasePreviousItems(),o[0].items):(this._releasePreviousItems(),o)}refresh(){this.notifyChange("items")}select(e,{emit:t=!0}={}){const r=this.selectedItem,s=e?.clone()||null;this._set("selectedItem",s),t&&this.emit("select",{item:s,oldItem:r,template:s?.template??null})}_createItem(e,t){const r=this._itemPool.acquire();return r.set({template:e,layer:t}),r}_createGroup(e,t){const r=this._groupPool.acquire();return r.set("label",e),r.items=t,r}_releasePreviousItems(){this._destroyItems(this._get("items"))}_destroyItems(e){if(!e)return;e[0]instanceof p?e.forEach((e=>this._destroyItem(e))):e.forEach((e=>this._destroyGroup(e)))}_destroyGroup(e){e.items.forEach((e=>this._destroyItem(e))),e.items.length=0,this._groupPool.release(e)}_destroyItem(e){e.layer=null,e.template=null,this._itemPool.release(e)}_ensureGroupByObject(e){return"string"==typeof e?{key:e,label:e}:e}};h.nullGroupBy={key:Symbol(),label:"Other"},h._nullFilterFunction=e=>!0,e([l()],h.prototype,"_groupByFunction",void 0),e([l()],h.prototype,"filterFunction",void 0),e([l()],h.prototype,"groupBy",null),e([l()],h.prototype,"layers",null),e([l()],h.prototype,"state",null),e([l({readOnly:!0})],h.prototype,"_featureTemplatesByLayer",null),e([l({readOnly:!0})],h.prototype,"numberOfFeatureTemplates",null),e([l({readOnly:!0})],h.prototype,"items",null),e([l({readOnly:!0})],h.prototype,"selectedItem",void 0),h=m=e([a("esri.widgets.FeatureTemplates.FeatureTemplatesViewModel")],h);const f=e=>[..."templates"in e&&Array.isArray(e.templates)?e.templates:[],..."types"in e&&Array.isArray(e.types)?e.types.flatMap((e=>e.templates)):[]],d=h;export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.27/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../config.js";import t from"../../core/Error.js";import has from"../../core/has.js";import
|
|
5
|
+
import e from"../../config.js";import t from"../../core/Error.js";import has from"../../core/has.js";import o from"../../core/Logger.js";import r from"../../geometry/Point.js";import{geographicToWebMercator as i}from"../../geometry/support/webMercatorUtils.js";import n from"../../portal/Portal.js";import{project as c}from"../../rest/geometryService/project.js";import s from"../../rest/support/ProjectParameters.js";const u=o.getLogger("esri.widgets.support.geolocationUtils"),a={maximumAge:0,timeout:15e3,enableHighAccuracy:!0};function m(){const e=has("esri-geolocation");return e||u.warn("geolocation-unsupported","Geolocation unsupported."),e}function l(){const e=window.isSecureContext;return e||u.warn("insecure-context","Geolocation requires a secure origin."),e}function g(){return m()&&l()}function p(e){const o=15e3;return e||(e=a),new Promise(((r,i)=>{setTimeout((()=>i(new t("geolocation:timeout","getting the current geolocation position timed out"))),o),navigator.geolocation.getCurrentPosition(r,i,e??void 0)}))}let d;function f(e,o){if(d)return d(e,o);const{position:r,view:i}=e,n=v(r),c=n?.coords;if(!c)throw new t("geometry-service:no-coords","Geolocation has no coordinates");return h(y(c),i,o)}function w(e){d=e}function v(e){const t=e&&e.coords||{},o={accuracy:t.accuracy,altitude:t.altitude,altitudeAccuracy:t.altitudeAccuracy,heading:t.heading,latitude:t.latitude,longitude:t.longitude,speed:t.speed};return e?{coords:o,timestamp:e.timestamp}:e}function y({longitude:e,latitude:t,altitude:o}){return new r({longitude:e,latitude:t,z:o||void 0,spatialReference:{wkid:4326}})}function h(e,o,r){if(!o)return Promise.resolve(e);const n=o.spatialReference;return n.isWGS84?Promise.resolve(e):n.isWebMercator?Promise.resolve(i(e)):j(r).then((o=>{if(!o)throw new t("geometry-service:missing-url","Geometry service URL is missing");const i=new s({geometries:[e],outSpatialReference:n});return c(o,i,r).then((e=>e[0]))}))}function j(t){if(e.geometryServiceUrl)return Promise.resolve(e.geometryServiceUrl);const o=n.getDefault();return o.load(t).catch((()=>{})).then((()=>o.get("helperServices.geometry.url")))}export{p as getCurrentPosition,w as overridePositionToPoint,f as positionToPoint,g as supported};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4547],{52138:(t,e,n)=>{n.d(e,{A:()=>M,a:()=>a,d:()=>f,e:()=>P,f:()=>E,g:()=>h,h:()=>A,i:()=>i,j:()=>C,k:()=>c,m:()=>l,s:()=>s,t:()=>u,w:()=>_,y:()=>N,z:()=>O});var r=n(65617),o=n(46851);function s(t,e,n,r,o,s,i,u,a,l,_,c,P,E,f,M,S){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=i,t[6]=u,t[7]=a,t[8]=l,t[9]=_,t[10]=c,t[11]=P,t[12]=E,t[13]=f,t[14]=M,t[15]=S,t}function i(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function u(t,e){if(t===e){const n=e[1],r=e[2],o=e[3],s=e[6],i=e[7],u=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=s,t[11]=e[14],t[12]=o,t[13]=i,t[14]=u}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function a(t,e){const n=e[0],r=e[1],o=e[2],s=e[3],i=e[4],u=e[5],a=e[6],l=e[7],_=e[8],c=e[9],P=e[10],E=e[11],f=e[12],M=e[13],S=e[14],p=e[15],h=n*u-r*i,R=n*a-o*i,A=n*l-s*i,C=r*a-o*u,O=r*l-s*u,N=o*l-s*a,T=_*M-c*f,g=_*S-P*f,d=_*p-E*f,L=c*S-P*M,G=c*p-E*M,y=P*p-E*S;let m=h*y-R*G+A*L+C*d-O*g+N*T;return m?(m=1/m,t[0]=(u*y-a*G+l*L)*m,t[1]=(o*G-r*y-s*L)*m,t[2]=(M*N-S*O+p*C)*m,t[3]=(P*O-c*N-E*C)*m,t[4]=(a*d-i*y-l*g)*m,t[5]=(n*y-o*d+s*g)*m,t[6]=(S*A-f*N-p*R)*m,t[7]=(_*N-P*A+E*R)*m,t[8]=(i*G-u*d+l*T)*m,t[9]=(r*d-n*G-s*T)*m,t[10]=(f*O-M*A+p*h)*m,t[11]=(c*A-_*O-E*h)*m,t[12]=(u*g-i*L-a*T)*m,t[13]=(n*L-r*g+o*T)*m,t[14]=(M*R-f*C-S*h)*m,t[15]=(_*C-c*R+P*h)*m,t):null}function l(t,e,n){const r=e[0],o=e[1],s=e[2],i=e[3],u=e[4],a=e[5],l=e[6],_=e[7],c=e[8],P=e[9],E=e[10],f=e[11],M=e[12],S=e[13],p=e[14],h=e[15];let R=n[0],A=n[1],C=n[2],O=n[3];return t[0]=R*r+A*u+C*c+O*M,t[1]=R*o+A*a+C*P+O*S,t[2]=R*s+A*l+C*E+O*p,t[3]=R*i+A*_+C*f+O*h,R=n[4],A=n[5],C=n[6],O=n[7],t[4]=R*r+A*u+C*c+O*M,t[5]=R*o+A*a+C*P+O*S,t[6]=R*s+A*l+C*E+O*p,t[7]=R*i+A*_+C*f+O*h,R=n[8],A=n[9],C=n[10],O=n[11],t[8]=R*r+A*u+C*c+O*M,t[9]=R*o+A*a+C*P+O*S,t[10]=R*s+A*l+C*E+O*p,t[11]=R*i+A*_+C*f+O*h,R=n[12],A=n[13],C=n[14],O=n[15],t[12]=R*r+A*u+C*c+O*M,t[13]=R*o+A*a+C*P+O*S,t[14]=R*s+A*l+C*E+O*p,t[15]=R*i+A*_+C*f+O*h,t}function _(t,e,n){const r=n[0],o=n[1],s=n[2];if(e===t)t[12]=e[0]*r+e[4]*o+e[8]*s+e[12],t[13]=e[1]*r+e[5]*o+e[9]*s+e[13],t[14]=e[2]*r+e[6]*o+e[10]*s+e[14],t[15]=e[3]*r+e[7]*o+e[11]*s+e[15];else{const n=e[0],i=e[1],u=e[2],a=e[3],l=e[4],_=e[5],c=e[6],P=e[7],E=e[8],f=e[9],M=e[10],S=e[11];t[0]=n,t[1]=i,t[2]=u,t[3]=a,t[4]=l,t[5]=_,t[6]=c,t[7]=P,t[8]=E,t[9]=f,t[10]=M,t[11]=S,t[12]=n*r+l*o+E*s+e[12],t[13]=i*r+_*o+f*s+e[13],t[14]=u*r+c*o+M*s+e[14],t[15]=a*r+P*o+S*s+e[15]}return t}function c(t,e,n){const r=n[0],o=n[1],s=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function P(t,e,n,r){let s,i,u,a,l,_,c,P,E,f,M,S,p,h,R,A,C,O,N,T,g,d,L,G,y=r[0],m=r[1],I=r[2],F=Math.sqrt(y*y+m*m+I*I);return F<(0,o.g)()?null:(F=1/F,y*=F,m*=F,I*=F,s=Math.sin(n),i=Math.cos(n),u=1-i,a=e[0],l=e[1],_=e[2],c=e[3],P=e[4],E=e[5],f=e[6],M=e[7],S=e[8],p=e[9],h=e[10],R=e[11],A=y*y*u+i,C=m*y*u+I*s,O=I*y*u-m*s,N=y*m*u-I*s,T=m*m*u+i,g=I*m*u+y*s,d=y*I*u+m*s,L=m*I*u-y*s,G=I*I*u+i,t[0]=a*A+P*C+S*O,t[1]=l*A+E*C+p*O,t[2]=_*A+f*C+h*O,t[3]=c*A+M*C+R*O,t[4]=a*N+P*T+S*g,t[5]=l*N+E*T+p*g,t[6]=_*N+f*T+h*g,t[7]=c*N+M*T+R*g,t[8]=a*d+P*L+S*G,t[9]=l*d+E*L+p*G,t[10]=_*d+f*L+h*G,t[11]=c*d+M*L+R*G,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function E(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function f(t,e,n){if(0===e)return i(t);let r,s,u,a=n[0],l=n[1],_=n[2],c=Math.sqrt(a*a+l*l+_*_);return c<(0,o.g)()?null:(c=1/c,a*=c,l*=c,_*=c,r=Math.sin(e),s=Math.cos(e),u=1-s,t[0]=a*a*u+s,t[1]=l*a*u+_*r,t[2]=_*a*u-l*r,t[3]=0,t[4]=a*l*u-_*r,t[5]=l*l*u+s,t[6]=_*l*u+a*r,t[7]=0,t[8]=a*_*u+l*r,t[9]=l*_*u-a*r,t[10]=_*_*u+s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function M(t,e){const n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function S(t,e,n){const r=e[0],o=e[1],s=e[2],i=e[3],u=r+r,a=o+o,l=s+s,_=r*u,c=r*a,P=r*l,E=o*a,f=o*l,M=s*l,S=i*u,p=i*a,h=i*l;return t[0]=1-(E+M),t[1]=c+h,t[2]=P-p,t[3]=0,t[4]=c-h,t[5]=1-(_+M),t[6]=f+S,t[7]=0,t[8]=P+p,t[9]=f-S,t[10]=1-(_+E),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}const p=(0,r.c)();function h(t,e,n,r){const o=e[0],s=e[1],i=e[2],u=e[3],a=o+o,l=s+s,_=i+i,c=o*a,P=o*l,E=o*_,f=s*l,M=s*_,S=i*_,p=u*a,h=u*l,R=u*_,A=r[0],C=r[1],O=r[2];return t[0]=(1-(f+S))*A,t[1]=(P+R)*A,t[2]=(E-h)*A,t[3]=0,t[4]=(P-R)*C,t[5]=(1-(c+S))*C,t[6]=(M+p)*C,t[7]=0,t[8]=(E+h)*O,t[9]=(M-p)*O,t[10]=(1-(c+f))*O,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function R(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function A(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function C(t,e){if(t===e)return!0;const n=t[0],r=t[1],s=t[2],i=t[3],u=t[4],a=t[5],l=t[6],_=t[7],c=t[8],P=t[9],E=t[10],f=t[11],M=t[12],S=t[13],p=t[14],h=t[15],R=e[0],A=e[1],C=e[2],O=e[3],N=e[4],T=e[5],g=e[6],d=e[7],L=e[8],G=e[9],y=e[10],m=e[11],I=e[12],F=e[13],W=e[14],w=e[15],b=(0,o.g)();return Math.abs(n-R)<=b*Math.max(1,Math.abs(n),Math.abs(R))&&Math.abs(r-A)<=b*Math.max(1,Math.abs(r),Math.abs(A))&&Math.abs(s-C)<=b*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(i-O)<=b*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(u-N)<=b*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(a-T)<=b*Math.max(1,Math.abs(a),Math.abs(T))&&Math.abs(l-g)<=b*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(_-d)<=b*Math.max(1,Math.abs(_),Math.abs(d))&&Math.abs(c-L)<=b*Math.max(1,Math.abs(c),Math.abs(L))&&Math.abs(P-G)<=b*Math.max(1,Math.abs(P),Math.abs(G))&&Math.abs(E-y)<=b*Math.max(1,Math.abs(E),Math.abs(y))&&Math.abs(f-m)<=b*Math.max(1,Math.abs(f),Math.abs(m))&&Math.abs(M-I)<=b*Math.max(1,Math.abs(M),Math.abs(I))&&Math.abs(S-F)<=b*Math.max(1,Math.abs(S),Math.abs(F))&&Math.abs(p-W)<=b*Math.max(1,Math.abs(p),Math.abs(W))&&Math.abs(h-w)<=b*Math.max(1,Math.abs(h),Math.abs(w))}function O(t){const e=(0,o.g)(),n=t[0],r=t[1],s=t[2],i=t[4],u=t[5],a=t[6],l=t[8],_=t[9],c=t[10];return Math.abs(1-(n*n+i*i+l*l))<=e&&Math.abs(1-(r*r+u*u+_*_))<=e&&Math.abs(1-(s*s+a*a+c*c))<=e}function N(t){return 1===t[0]&&0===t[1]&&0===t[2]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[8]&&0===t[9]&&1===t[10]}const T=l,g=R;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},adjoint:function(t,e){const n=e[0],r=e[1],o=e[2],s=e[3],i=e[4],u=e[5],a=e[6],l=e[7],_=e[8],c=e[9],P=e[10],E=e[11],f=e[12],M=e[13],S=e[14],p=e[15];return t[0]=u*(P*p-E*S)-c*(a*p-l*S)+M*(a*E-l*P),t[1]=-(r*(P*p-E*S)-c*(o*p-s*S)+M*(o*E-s*P)),t[2]=r*(a*p-l*S)-u*(o*p-s*S)+M*(o*l-s*a),t[3]=-(r*(a*E-l*P)-u*(o*E-s*P)+c*(o*l-s*a)),t[4]=-(i*(P*p-E*S)-_*(a*p-l*S)+f*(a*E-l*P)),t[5]=n*(P*p-E*S)-_*(o*p-s*S)+f*(o*E-s*P),t[6]=-(n*(a*p-l*S)-i*(o*p-s*S)+f*(o*l-s*a)),t[7]=n*(a*E-l*P)-i*(o*E-s*P)+_*(o*l-s*a),t[8]=i*(c*p-E*M)-_*(u*p-l*M)+f*(u*E-l*c),t[9]=-(n*(c*p-E*M)-_*(r*p-s*M)+f*(r*E-s*c)),t[10]=n*(u*p-l*M)-i*(r*p-s*M)+f*(r*l-s*u),t[11]=-(n*(u*E-l*c)-i*(r*E-s*c)+_*(r*l-s*u)),t[12]=-(i*(c*S-P*M)-_*(u*S-a*M)+f*(u*P-a*c)),t[13]=n*(c*S-P*M)-_*(r*S-o*M)+f*(r*P-o*c),t[14]=-(n*(u*S-a*M)-i*(r*S-o*M)+f*(r*a-o*u)),t[15]=n*(u*P-a*c)-i*(r*P-o*c)+_*(r*a-o*u),t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},determinant:function(t){const e=t[0],n=t[1],r=t[2],o=t[3],s=t[4],i=t[5],u=t[6],a=t[7],l=t[8],_=t[9],c=t[10],P=t[11],E=t[12],f=t[13],M=t[14],S=t[15];return(e*i-n*s)*(c*S-P*M)-(e*u-r*s)*(_*S-P*f)+(e*a-o*s)*(_*M-c*f)+(n*u-r*i)*(l*S-P*E)-(n*a-o*i)*(l*M-c*E)+(r*a-o*u)*(l*f-_*E)},equals:C,exactEquals:A,frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2+t[9]**2+t[10]**2+t[11]**2+t[12]**2+t[13]**2+t[14]**2+t[15]**2)},fromQuat:function(t,e){const n=e[0],r=e[1],o=e[2],s=e[3],i=n+n,u=r+r,a=o+o,l=n*i,_=r*i,c=r*u,P=o*i,E=o*u,f=o*a,M=s*i,S=s*u,p=s*a;return t[0]=1-c-f,t[1]=_+p,t[2]=P-S,t[3]=0,t[4]=_-p,t[5]=1-l-f,t[6]=E+M,t[7]=0,t[8]=P+S,t[9]=E-M,t[10]=1-l-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromQuat2:function(t,e){const n=p,r=-e[0],o=-e[1],s=-e[2],i=e[3],u=e[4],a=e[5],l=e[6],_=e[7],c=r*r+o*o+s*s+i*i;return c>0?(n[0]=2*(u*i+_*r+a*s-l*o)/c,n[1]=2*(a*i+_*o+l*r-u*s)/c,n[2]=2*(l*i+_*s+u*o-a*r)/c):(n[0]=2*(u*i+_*r+a*s-l*o),n[1]=2*(a*i+_*o+l*r-u*s),n[2]=2*(l*i+_*s+u*o-a*r)),S(t,e,n),t},fromRotation:f,fromRotationTranslation:S,fromRotationTranslationScale:h,fromRotationTranslationScaleOrigin:function(t,e,n,r,o){const s=e[0],i=e[1],u=e[2],a=e[3],l=s+s,_=i+i,c=u+u,P=s*l,E=s*_,f=s*c,M=i*_,S=i*c,p=u*c,h=a*l,R=a*_,A=a*c,C=r[0],O=r[1],N=r[2],T=o[0],g=o[1],d=o[2],L=(1-(M+p))*C,G=(E+A)*C,y=(f-R)*C,m=(E-A)*O,I=(1-(P+p))*O,F=(S+h)*O,W=(f+R)*N,w=(S-h)*N,b=(1-(P+M))*N;return t[0]=L,t[1]=G,t[2]=y,t[3]=0,t[4]=m,t[5]=I,t[6]=F,t[7]=0,t[8]=W,t[9]=w,t[10]=b,t[11]=0,t[12]=n[0]+T-(L*T+m*g+W*d),t[13]=n[1]+g-(G*T+I*g+w*d),t[14]=n[2]+d-(y*T+F*g+b*d),t[15]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromTranslation:E,fromXRotation:M,fromYRotation:function(t,e){const n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){const n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},frustum:function(t,e,n,r,o,s,i){const u=1/(n-e),a=1/(o-r),l=1/(s-i);return t[0]=2*s*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*a,t[6]=0,t[7]=0,t[8]=(n+e)*u,t[9]=(o+r)*a,t[10]=(i+s)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*s*2*l,t[15]=0,t},getRotation:function(t,e){const n=e[0]+e[5]+e[10];let r=0;return n>0?(r=2*Math.sqrt(n+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t},getScaling:function(t,e){const n=e[0],r=e[1],o=e[2],s=e[4],i=e[5],u=e[6],a=e[8],l=e[9],_=e[10];return t[0]=Math.sqrt(n*n+r*r+o*o),t[1]=Math.sqrt(s*s+i*i+u*u),t[2]=Math.sqrt(a*a+l*l+_*_),t},getTranslation:function(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t},hasIdentityRotation:N,identity:i,invert:a,invertOrIdentity:function(t,e){return a(t,e)||i(t),t},isOrthoNormal:O,lookAt:function(t,e,n,r){const s=e[0],u=e[1],a=e[2];let l=s-n[0],_=u-n[1],c=a-n[2];const P=(0,o.g)();if(Math.abs(l)<P&&Math.abs(_)<P&&Math.abs(c)<P)return void i(t);let E=1/Math.sqrt(l*l+_*_+c*c);l*=E,_*=E,c*=E;const f=r[0],M=r[1],S=r[2];let p=M*c-S*_,h=S*l-f*c,R=f*_-M*l;E=Math.sqrt(p*p+h*h+R*R),E?(E=1/E,p*=E,h*=E,R*=E):(p=0,h=0,R=0);let A=_*R-c*h,C=c*p-l*R,O=l*h-_*p;E=Math.sqrt(A*A+C*C+O*O),E?(E=1/E,A*=E,C*=E,O*=E):(A=0,C=0,O=0),t[0]=p,t[1]=A,t[2]=l,t[3]=0,t[4]=h,t[5]=C,t[6]=_,t[7]=0,t[8]=R,t[9]=O,t[10]=c,t[11]=0,t[12]=-(p*s+h*u+R*a),t[13]=-(A*s+C*u+O*a),t[14]=-(l*s+_*u+c*a),t[15]=1},mul:T,multiply:l,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},ortho:function(t,e,n,r,o,s,i){const u=1/(e-n),a=1/(r-o),l=1/(s-i);return t[0]=-2*u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*u,t[13]=(o+r)*a,t[14]=(i+s)*l,t[15]=1,t},perspective:function(t,e,n,r,o){const s=1/Math.tan(e/2);let i;return t[0]=s/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=o&&o!==1/0?(i=1/(r-o),t[10]=(o+r)*i,t[14]=2*o*r*i):(t[10]=-1,t[14]=-2*r),t},perspectiveFromFieldOfView:function(t,e,n,r){const o=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),i=Math.tan(e.leftDegrees*Math.PI/180),u=Math.tan(e.rightDegrees*Math.PI/180),a=2/(i+u),l=2/(o+s);return t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(i-u)*a*.5,t[9]=(o-s)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},rotate:P,rotateX:function(t,e,n){const r=Math.sin(n),o=Math.cos(n),s=e[4],i=e[5],u=e[6],a=e[7],l=e[8],_=e[9],c=e[10],P=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*o+l*r,t[5]=i*o+_*r,t[6]=u*o+c*r,t[7]=a*o+P*r,t[8]=l*o-s*r,t[9]=_*o-i*r,t[10]=c*o-u*r,t[11]=P*o-a*r,t},rotateY:function(t,e,n){const r=Math.sin(n),o=Math.cos(n),s=e[0],i=e[1],u=e[2],a=e[3],l=e[8],_=e[9],c=e[10],P=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o-l*r,t[1]=i*o-_*r,t[2]=u*o-c*r,t[3]=a*o-P*r,t[8]=s*r+l*o,t[9]=i*r+_*o,t[10]=u*r+c*o,t[11]=a*r+P*o,t},rotateZ:function(t,e,n){const r=Math.sin(n),o=Math.cos(n),s=e[0],i=e[1],u=e[2],a=e[3],l=e[4],_=e[5],c=e[6],P=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o+l*r,t[1]=i*o+_*r,t[2]=u*o+c*r,t[3]=a*o+P*r,t[4]=l*o-s*r,t[5]=_*o-i*r,t[6]=c*o-u*r,t[7]=P*o-a*r,t},scale:c,set:s,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:g,subtract:R,targetTo:function(t,e,n,r){const o=e[0],s=e[1],i=e[2],u=r[0],a=r[1],l=r[2];let _=o-n[0],c=s-n[1],P=i-n[2],E=_*_+c*c+P*P;E>0&&(E=1/Math.sqrt(E),_*=E,c*=E,P*=E);let f=a*P-l*c,M=l*_-u*P,S=u*c-a*_;return E=f*f+M*M+S*S,E>0&&(E=1/Math.sqrt(E),f*=E,M*=E,S*=E),t[0]=f,t[1]=M,t[2]=S,t[3]=0,t[4]=c*S-P*M,t[5]=P*f-_*S,t[6]=_*M-c*f,t[7]=0,t[8]=_,t[9]=c,t[10]=P,t[11]=0,t[12]=o,t[13]=s,t[14]=i,t[15]=1,t},translate:_,transpose:u},Symbol.toStringTag,{value:"Module"}))},83305:(t,e,n)=>{n.d(e,{e:()=>c,f:()=>_,g:()=>l,h:()=>S,i:()=>u,j:()=>C,l:()=>a,p:()=>G});var r=n(99880),o=n(80442);let s,i=null;function u(){return!!i}function a(){return s||(s=n.e(6774).then(n.bind(n,66774)).then((t=>t.p)).then((({default:t})=>t({locateFile:t=>(0,r.V)(`esri/geometry/support/${t}`)}))).then((t=>{N(t)})),s)}var l,_,c,P;!function(t){function e(t,e,n){i.ensureCache.prepare();const r=d(n),o=n===r,s=i.ensureFloat64(r),u=i._pe_geog_to_proj(i.getPointer(t),e,s);return u&&L(n,e,s,o),u}function n(t,e,n){return r(t,e,n,0)}function r(t,e,n,r){i.ensureCache.prepare();const o=d(n),s=n===o,u=i.ensureFloat64(o),a=i._pe_proj_to_geog_center(i.getPointer(t),e,u,r);return a&&L(n,e,u,s),a}t.geogToProj=e,t.projGeog=function(t,r,o,s){switch(s){case _.PE_TRANSFORM_P_TO_G:return n(t,r,o);case _.PE_TRANSFORM_G_TO_P:return e(t,r,o)}return 0},t.projToGeog=n,t.projToGeogCenter=r}(l||(l={})),(P=_||(_={})).init=function(){P.PE_BUFFER_MAX=i.PeDefs.prototype.PE_BUFFER_MAX,P.PE_NAME_MAX=i.PeDefs.prototype.PE_NAME_MAX,P.PE_MGRS_MAX=i.PeDefs.prototype.PE_MGRS_MAX,P.PE_USNG_MAX=i.PeDefs.prototype.PE_USNG_MAX,P.PE_DD_MAX=i.PeDefs.prototype.PE_DD_MAX,P.PE_DDM_MAX=i.PeDefs.prototype.PE_DDM_MAX,P.PE_DMS_MAX=i.PeDefs.prototype.PE_DMS_MAX,P.PE_UTM_MAX=i.PeDefs.prototype.PE_UTM_MAX,P.PE_PARM_MAX=i.PeDefs.prototype.PE_PARM_MAX,P.PE_TYPE_NONE=i.PeDefs.prototype.PE_TYPE_NONE,P.PE_TYPE_GEOGCS=i.PeDefs.prototype.PE_TYPE_GEOGCS,P.PE_TYPE_PROJCS=i.PeDefs.prototype.PE_TYPE_PROJCS,P.PE_TYPE_GEOGTRAN=i.PeDefs.prototype.PE_TYPE_GEOGTRAN,P.PE_TYPE_COORDSYS=i.PeDefs.prototype.PE_TYPE_COORDSYS,P.PE_TYPE_UNIT=i.PeDefs.prototype.PE_TYPE_UNIT,P.PE_TYPE_LINUNIT=i.PeDefs.prototype.PE_TYPE_LINUNIT,P.PE_STR_OPTS_NONE=i.PeDefs.prototype.PE_STR_OPTS_NONE,P.PE_STR_AUTH_NONE=i.PeDefs.prototype.PE_STR_AUTH_NONE,P.PE_STR_AUTH_TOP=i.PeDefs.prototype.PE_STR_AUTH_TOP,P.PE_STR_NAME_CANON=i.PeDefs.prototype.PE_STR_NAME_CANON,P.PE_PARM_X0=i.PeDefs.prototype.PE_PARM_X0,P.PE_PARM_ND=i.PeDefs.prototype.PE_PARM_ND,P.PE_TRANSFORM_1_TO_2=i.PeDefs.prototype.PE_TRANSFORM_1_TO_2,P.PE_TRANSFORM_2_TO_1=i.PeDefs.prototype.PE_TRANSFORM_2_TO_1,P.PE_TRANSFORM_P_TO_G=i.PeDefs.prototype.PE_TRANSFORM_P_TO_G,P.PE_TRANSFORM_G_TO_P=i.PeDefs.prototype.PE_TRANSFORM_G_TO_P,P.PE_HORIZON_RECT=i.PeDefs.prototype.PE_HORIZON_RECT,P.PE_HORIZON_POLY=i.PeDefs.prototype.PE_HORIZON_POLY,P.PE_HORIZON_LINE=i.PeDefs.prototype.PE_HORIZON_LINE,P.PE_HORIZON_DELTA=i.PeDefs.prototype.PE_HORIZON_DELTA},function(t){const e={},n={},r=t=>{if(t){const e=t.getType();switch(e){case _.PE_TYPE_GEOGCS:t=i.castObject(t,i.PeGeogcs);break;case _.PE_TYPE_PROJCS:t=i.castObject(t,i.PeProjcs);break;case _.PE_TYPE_GEOGTRAN:t=i.castObject(t,i.PeGeogtran);break;default:e&_.PE_TYPE_UNIT&&(t=i.castObject(t,i.PeUnit))}}return t};function o(t,n){let o=null,s=e[t];if(s||(s={},e[t]=s),s.hasOwnProperty(String(n)))o=s[n];else{const e=i.PeFactory.prototype.factoryByType(t,n);i.compare(e,i.NULL)||(o=e,s[n]=o)}return o=r(o),o}t.initialize=function(){i.PeFactory.prototype.initialize(null)},t.coordsys=function(t){return o(_.PE_TYPE_COORDSYS,t)},t.factoryByType=o,t.fromString=function(t,e){let o=null,s=n[t];if(s||(s={},n[t]=s),s.hasOwnProperty(e))o=s[e];else{const n=i.PeFactory.prototype.fromString(t,e);i.compare(n,i.NULL)||(o=n,s[e]=o)}return o=r(o),o},t.geogcs=function(t){return o(_.PE_TYPE_GEOGCS,t)},t.geogtran=function(t){return o(_.PE_TYPE_GEOGTRAN,t)},t.getCode=function(t){return i.PeFactory.prototype.getCode(t)},t.projcs=function(t){return o(_.PE_TYPE_PROJCS,t)},t.unit=function(t){return o(_.PE_TYPE_UNIT,t)}}(c||(c={}));let E=null;var f,M,S,p,h,R,A,C,O;function N(t){function e(t,e,n){t[e]=n(t[e])}i=t,_.init(),f.init(),h.init(),A.init(),C.init(),E=class extends i.PeGCSExtent{destroy(){i.destroy(this)}};const n=[i.PeDatum,i.PeGeogcs,i.PeGeogtran,i.PeObject,i.PeParameter,i.PePrimem,i.PeProjcs,i.PeSpheroid,i.PeUnit];for(const t of n)e(t.prototype,"getName",(t=>function(){return t.call(this,new Array(_.PE_NAME_MAX))}));for(const t of[i.PeGeogtran,i.PeProjcs])e(t.prototype,"getParameters",(t=>function(){const e=new Array(_.PE_PARM_MAX);let n=t.call(this);for(let t=0;t<e.length;t++){const r=i.getValue(n,"*");e[t]=r?i.wrapPointer(r,i.PeParameter):null,n+=Int32Array.BYTES_PER_ELEMENT}return e}));e(i.PeHorizon.prototype,"getCoord",(t=>function(){const e=this.getSize();if(!e)return null;const n=[];return L(n,e,t.call(this)),n})),e(i.PeGTlistExtendedEntry.prototype,"getEntries",(t=>{const e=i._pe_getPeGTlistExtendedGTsSize();return function(){let n=null;const r=t.call(this);if(!i.compare(r,i.NULL)){n=[r];const t=this.getSteps();if(t>1){const o=i.getPointer(r);for(let r=1;r<t;r++)n.push(i.wrapPointer(o+e*r,i.PeGTlistExtendedGTs))}}return n}}));const r=i._pe_getPeHorizonSize(),o=t=>function(){let e=this._cache;if(e||(e=new Map,this._cache=e),e.has(t))return e.get(t);let n=null;const o=t.call(this);if(!i.compare(o,i.NULL)){n=[o];const t=o.getNump();if(t>1){const e=i.getPointer(o);for(let o=1;o<t;o++)n.push(i.wrapPointer(e+r*o,i.PeHorizon))}}return e.set(t,n),n};e(i.PeProjcs.prototype,"horizonGcsGenerate",o),e(i.PeProjcs.prototype,"horizonPcsGenerate",o),i.PeObject.prototype.toString=function(t=_.PE_STR_OPTS_NONE){i.ensureCache.prepare();const e=i.getPointer(this),n=i.ensureInt8(new Array(_.PE_BUFFER_MAX));return i.UTF8ToString(i._pe_object_to_string_ext(e,t,n))}}function T(t){if(!t)return;const e=i.getClass(t);if(!e)return;const n=i.getCache(e);if(!n)return;const r=i.getPointer(t);r&&delete n[r]}function g(t,e){const n=[],r=new Array(e);for(let e=0;e<t;e++)n.push(i.ensureInt8(r));return n}function d(t){let e;return Array.isArray(t[0])?(e=[],t.forEach((t=>{e.push(t[0],t[1])}))):e=t,e}function L(t,e,n,r=!1){if(r)for(let r=0;r<2*e;r++)t[r]=i.getValue(n+r*Float64Array.BYTES_PER_ELEMENT,"double");else{const r=0===t.length;for(let o=0;o<e;o++)r&&(t[o]=new Array(2)),t[o][0]=i.getValue(n,"double"),t[o][1]=i.getValue(n+Float64Array.BYTES_PER_ELEMENT,"double"),n+=2*Float64Array.BYTES_PER_ELEMENT}}!function(t){let e;t.init=function(){t.PE_GTLIST_OPTS_COMMON=i.PeGTlistExtended.prototype.PE_GTLIST_OPTS_COMMON,e=i._pe_getPeGTlistExtendedEntrySize()},t.getGTlist=function(t,n,r,o,s,u){let a=null;const l=new i.PeInteger(u);try{const _=i.PeGTlistExtended.prototype.getGTlist(t,n,r,o,s,l);if((u=l.val)&&(a=[_],u>1)){const t=i.getPointer(_);for(let n=1;n<u;n++)a.push(i.wrapPointer(t+e*n,i.PeGTlistExtendedEntry))}}finally{i.destroy(l)}return a}}(f||(f={})),function(t){t.destroy=function(t){if(t&&t.length){for(const e of t)T(e),e.getEntries().forEach((t=>{T(t);const e=t.getGeogtran();T(e),e.getParameters().forEach(T),[e.getGeogcs1(),e.getGeogcs2()].forEach((t=>{T(t);const e=t.getDatum();T(e),T(e.getSpheroid()),T(t.getPrimem()),T(t.getUnit())}))}));i.PeGTlistExtendedEntry.prototype.Delete(t[0])}}}(M||(M={})),function(t){t.geogToGeog=function(t,e,n,r,o){i.ensureCache.prepare();const s=d(n),u=n===s,a=i.ensureFloat64(s);let l=0;r&&(l=i.ensureFloat64(r));const _=i._pe_geog_to_geog(i.getPointer(t),e,a,l,o);return _&&L(n,e,a,u),_}}(S||(S={})),function(t){const e=(t,e,n,r,o,s)=>{let u,a;switch(i.ensureCache.prepare(),t){case"dd":u=i._pe_geog_to_dd,a=_.PE_DD_MAX;break;case"ddm":u=i._pe_geog_to_ddm,a=_.PE_DDM_MAX;break;case"dms":u=i._pe_geog_to_dms,a=_.PE_DMS_MAX}let l=0;e&&(l=i.getPointer(e));const c=d(r),P=i.ensureFloat64(c),E=g(n,a),f=u(l,n,P,o,i.ensureInt32(E));if(f)for(let t=0;t<n;t++)s[t]=i.UTF8ToString(E[t]);return f},n=(t,e,n,r,o)=>{let s;switch(i.ensureCache.prepare(),t){case"dd":s=i._pe_dd_to_geog;break;case"ddm":s=i._pe_ddm_to_geog;break;case"dms":s=i._pe_dms_to_geog}let u=0;e&&(u=i.getPointer(e));const a=r.map((t=>i.ensureString(t))),l=i.ensureInt32(a),_=i.ensureFloat64(new Array(2*n)),c=s(u,n,l,_);return c&&L(o,n,_),c};t.geogToDms=function(t,n,r,o,s){return e("dms",t,n,r,o,s)},t.dmsToGeog=function(t,e,r,o){return n("dms",t,e,r,o)},t.geogToDdm=function(t,n,r,o,s){return e("ddm",t,n,r,o,s)},t.ddmToGeog=function(t,e,r,o){return n("ddm",t,e,r,o)},t.geogToDd=function(t,n,r,o,s){return e("dd",t,n,r,o,s)},t.ddToGeog=function(t,e,r,o){return n("dd",t,e,r,o)}}(p||(p={})),function(t){t.init=function(){t.PE_MGRS_STYLE_NEW=i.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,t.PE_MGRS_STYLE_OLD=i.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,t.PE_MGRS_STYLE_AUTO=i.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,t.PE_MGRS_180_ZONE_1_PLUS=i.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,t.PE_MGRS_ADD_SPACES=i.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES},t.geogToMgrsExtended=function(t,e,n,r,o,s,u){i.ensureCache.prepare();let a=0;t&&(a=i.getPointer(t));const l=d(n),c=i.ensureFloat64(l),P=g(e,_.PE_MGRS_MAX),E=i.ensureInt32(P),f=i._pe_geog_to_mgrs_extended(a,e,c,r,o,s,E);if(f)for(let t=0;t<e;t++)u[t]=i.UTF8ToString(P[t]);return f},t.mgrsToGeogExtended=function(t,e,n,r,o){i.ensureCache.prepare();let s=0;t&&(s=i.getPointer(t));const u=n.map((t=>i.ensureString(t))),a=i.ensureInt32(u),l=i.ensureFloat64(new Array(2*e)),_=i._pe_mgrs_to_geog_extended(s,e,a,r,l);return _&&L(o,e,l),_}}(h||(h={})),function(t){t.geogToUsng=function(t,e,n,r,o,s,u){i.ensureCache.prepare();let a=0;t&&(a=i.getPointer(t));const l=d(n),c=i.ensureFloat64(l),P=g(e,_.PE_MGRS_MAX),E=i.ensureInt32(P),f=i._pe_geog_to_usng(a,e,c,r,o,s,E);if(f)for(let t=0;t<e;t++)u[t]=i.UTF8ToString(P[t]);return f},t.usngToGeog=function(t,e,n,r){i.ensureCache.prepare();let o=0;t&&(o=i.getPointer(t));const s=n.map((t=>i.ensureString(t))),u=i.ensureInt32(s),a=i.ensureFloat64(new Array(2*e)),l=i._pe_usng_to_geog(o,e,u,a);return l&&L(r,e,a),l}}(R||(R={})),function(t){t.init=function(){t.PE_UTM_OPTS_NONE=i.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,t.PE_UTM_OPTS_ADD_SPACES=i.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,t.PE_UTM_OPTS_NS=i.PeNotationUtm.prototype.PE_UTM_OPTS_NS},t.geogToUtm=function(t,e,n,r,o){i.ensureCache.prepare();let s=0;t&&(s=i.getPointer(t));const u=d(n),a=i.ensureFloat64(u),l=g(e,_.PE_UTM_MAX),c=i.ensureInt32(l),P=i._pe_geog_to_utm(s,e,a,r,c);if(P)for(let t=0;t<e;t++)o[t]=i.UTF8ToString(l[t]);return P},t.utmToGeog=function(t,e,n,r,o){i.ensureCache.prepare();let s=0;t&&(s=i.getPointer(t));const u=n.map((t=>i.ensureString(t))),a=i.ensureInt32(u),l=i.ensureFloat64(new Array(2*e)),_=i._pe_utm_to_geog(s,e,a,r,l);return _&&L(o,e,l),_}}(A||(A={})),function(t){const e=new Map;t.init=function(){t.PE_PCSINFO_OPTION_NONE=i.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,t.PE_PCSINFO_OPTION_DOMAIN=i.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,t.PE_POLE_OUTSIDE_BOUNDARY=i.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,t.PE_POLE_POINT=i.PePCSInfo.prototype.PE_POLE_POINT},t.generate=function(n,r=t.PE_PCSINFO_OPTION_DOMAIN){let o=null,s=null;return e.has(n)&&(s=e.get(n),s[r]&&(o=s[r])),o||(o=i.PePCSInfo.prototype.generate(n,r),s||(s=[],e.set(n,s)),s[r]=o),o}}(C||(C={})),function(t){t.versionString=function(){return i.PeVersion.prototype.version_string()}}(O||(O={}));const G=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return l},get PeDefs(){return _},get PeFactory(){return c},get PeGCSExtent(){return E},get PeGTTransformations(){return S},get PeGTlistExtended(){return f},get PeGTlistExtendedEntry(){return M},get PeNotationDms(){return p},get PeNotationMgrs(){return h},get PeNotationUsng(){return R},get PeNotationUtm(){return A},get PePCSInfo(){return C},get PeVersion(){return O},_init:N,get _pe(){return i},isLoaded:u,isSupported:function(){return!!(0,o.Z)("esri-wasm")},load:a},Symbol.toStringTag,{value:"Module"}))},44547:(t,e,n)=>{n.d(e,{Up:()=>k,Bm:()=>K,iQ:()=>v,kR:()=>I,zD:()=>F,iV:()=>W,CM:()=>Z,oj:()=>w,dz:()=>b,JY:()=>D,KC:()=>B,Wt:()=>x});var r=n(20102),o=n(22021),s=n(95330),i=n(67900),u=n(58971),a=n(10661),l=n(52138),_=(n(17896),n(65617)),c=n(2109),P=n(6570),E=n(65091),f=n(83305),M=n(94139),S=n(38913),p=n(58901),h=(n(24470),n(68441));Math.PI;const R=h.sv.radius,A=h.sv.eccentricitySquared,C={a1:R*A,a2:R*A*R*A,a3:R*A*A/2,a4:R*A*R*A*2.5,a5:R*A+R*A*A/2,a6:1-A};h.sv.radius,h.sv.flattening,h.Z1.radius,h.Z1.flattening,h.yr.radius,h.yr.flattening,h.yr.radius;var O=n(18571),N=n(8744),T=n(56726),g=n(69285);let d=null,L=null,G=null,y={};const m=new a.s;function I(){return!!d&&(0,f.i)()}function F(t){return null==G&&(G=Promise.all([(0,f.l)(),Promise.all([n.e(5837),n.e(5732)]).then(n.bind(n,45837)).then((t=>t.g)),n.e(819).then(n.bind(n,80819))])),G.then((([,e,{hydratedAdapter:n}])=>{(0,s.k_)(t),L=n,d=e.default,d._enableProjection(f.p),m.notify()}))}function W(t,e,n=null,r=null){return Array.isArray(t)?0===t.length?[]:w(L,t,t[0].spatialReference,e,n,r):w(L,[t],t.spatialReference,e,n,r)[0]}function w(t,e,n,r,o=null,s=null){if(null==n||null==r)return e;if(k(n,r,o))return e.map((t=>function(t,e,n){return t?"x"in t?function(t,e,n,r,o){gt[0]=t.x,gt[1]=t.y;const s=t.z;return gt[2]=void 0!==s?s:o,Z(gt,e,0,gt,r,0,1)?(n.x=gt[0],n.y=gt[1],n.spatialReference=r,void 0===s?(n.z=void 0,n.hasZ=!1):(n.z=gt[2],n.hasZ=!0),void 0===t.m?(n.m=void 0,n.hasM=!1):(n.m=t.m,n.hasM=!0),n):null}(t,e,new M.Z,n,0):"xmin"in t?function(t,e,n,r,o){const{xmin:s,ymin:i,xmax:u,ymax:a,hasZ:l,hasM:_}=t;return j(s,i,l?t.zmin:o,e,gt,r)?(n.xmin=gt[0],n.ymin=gt[1],l&&(n.zmin=gt[2]),j(u,a,l?t.zmax:o,e,gt,r)?(n.xmax=gt[0],n.ymax=gt[1],l&&(n.zmax=gt[2]),_&&(n.mmin=t.mmin,n.mmax=t.mmax),n.spatialReference=r,n):null):null}(t,e,new P.Z,n,0):"rings"in t?Y(t,e,new S.Z,n,0):"paths"in t?function(t,e,n,r,o){const{paths:s,hasZ:i,hasM:u}=t,a=[];return z(s,i??!1,u??!1,e,a,r,o)?(n.paths=a,n.spatialReference=r,n.hasZ=i,n.hasM=u,n):null}(t,e,new p.Z,n,0):"points"in t?function(t,e,n,r,o){const{points:s,hasZ:i,hasM:u}=t,a=[],l=s.length,_=[];for(const t of s)_.push(t[0],t[1],i?t[2]:o);if(!Z(_,e,0,_,r,0,l))return null;for(let t=0;t<l;++t){const e=3*t,n=_[e],r=_[e+1];i&&u?a.push([n,r,_[e+2],s[t][3]]):i?a.push([n,r,_[e+2]]):u?a.push([n,r,s[t][2]]):a.push([n,r])}return n.points=a,n.spatialReference=r,n.hasZ=i,n.hasM=u,n}(t,e,new E.Z,n,0):null:null}(t,n,r)));if(null==o){const t=O.Z.cacheKey(n,r);void 0!==y[t]?o=y[t]:(null==(o=function(t,e,n=null){if(null==t||null==e)return null;if(null==d||null==L)throw new U;const r=d._getTransformation(L,t,e,n,n?.spatialReference);return null!==r?O.Z.fromGE(r):null}(n,r,void 0))&&(o=new O.Z),y[t]=o)}if(null==d||null==t)throw new U;return null!=s?d._project(t,e,n,r,o,s):d._project(t,e,n,r,o)}function b(t,e){const n=D([t],e);return null!=n.pending?{pending:n.pending,geometry:null}:null!=n.geometries?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function D(t,e){if(!I())for(const n of t)if(null!=n&&!(0,N.fS)(n.spatialReference,e)&&(0,N.JY)(n.spatialReference)&&(0,N.JY)(e)&&!k(n.spatialReference,e))return(0,u.it)(m),{pending:F(),geometries:null};return{pending:null,geometries:t.map((t=>null==t?null:(0,N.fS)(t.spatialReference,e)?t:(0,N.JY)(t.spatialReference)&&(0,N.JY)(e)?function(t,e){try{const n=W(t,e);if(null==n)return null;"xmin"in t&&"xmin"in n&&(n.zmin=t.zmin,n.zmax=t.zmax);const r=(0,g.k)(n.type,t.spatialReference,e);return null!=r&&r(n),n}catch(t){if(!(t instanceof U))throw t;return null}}(t,e):null))}}class U extends r.Z{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var H;function k(t,e,n){return!n&&(!!(0,N.fS)(t,e)||(0,N.JY)(t)&&(0,N.JY)(e)&&!!Mt(t,e,Rt))}async function v(t,e,n,r){if(I())return(0,s.Yn)(r);if(Array.isArray(t)){for(const{source:e,dest:n,geographicTransformation:o}of t)if(!k(e,n,o))return F(r)}else if(!k(t,e,n))return F(r);return(0,s.Yn)(r)}function x(t,e,n=e.spatialReference,r=0){return null!=t.spatialReference&&null!=n&&null!=Y(t,t.spatialReference,e,n,r)}function Y(t,e,n,r,o){const{rings:s,hasZ:i,hasM:u}=t,a=[];return z(s,i??!1,u??!1,e,a,r,o)?(n.rings=a,n.spatialReference=r,n.hasZ=i,n.hasM=u,n):null}function B(t,e,n,r=0){gt[0]=t.x,gt[1]=t.y;const o=t.z;return gt[2]=void 0!==o?o:r,Z(gt,t.spatialReference,0,e,n,0,1)}function j(t,e,n,r,o,s){return Ot[0]=t,Ot[1]=e,Ot[2]=n,Z(Ot,r,0,o,s,0,1)}function Z(t,e,n,r,o,s,i=1){const u=Mt(e,o,Rt);if(null==u)return!1;if(u===V){if(t===r&&n===s)return!0;const e=n+3*i;for(let o=n,i=s;o<e;o++,i++)r[i]=t[o];return!0}const a=n+3*i;for(let e=n,o=s;e<a;e+=3,o+=3)u(t,e,r,o);return!0}function z(t,e,n,r,o,s,i=0){const u=new Array;for(const n of t)for(const t of n)u.push(t[0],t[1],e?t[2]:i);if(!Z(u,r,0,u,s,0,u.length/3))return!1;let a=0;o.length=0;for(const r of t){const t=new Array;for(const o of r)e&&n?t.push([u[a++],u[a++],u[a++],o[3]]):e?t.push([u[a++],u[a++],u[a++]]):n?(t.push([u[a++],u[a++],o[2]]),a++):(t.push([u[a++],u[a++]]),a++);o.push(t)}return!0}function K(t,e,n,r){if(null==t||null==r)return!1;const o=J(t,pt),s=J(r,ht);if(o===s&&!X(s)&&(o!==H.UNKNOWN||(0,N.fS)(t,r)))return(0,l.f)(n,e),!0;if(X(s)){const t=ft[o][H.LON_LAT],r=ft[H.LON_LAT][s];return null!=t&&null!=r&&(t(e,0,Nt,0),r(Nt,0,Tt,0),q(At*Nt[0],At*Nt[1],n),n[12]=Tt[0],n[13]=Tt[1],n[14]=Tt[2],!0)}if((s===H.WEB_MERCATOR||s===H.PLATE_CARREE)&&(o===H.WGS84||o===H.CGCS2000&&s===H.PLATE_CARREE||o===H.SPHERICAL_ECEF||o===H.WEB_MERCATOR)){const t=ft[o][H.LON_LAT],r=ft[H.LON_LAT][s];return null!=t&&null!=r&&(t(e,0,Nt,0),r(Nt,0,Tt,0),o===H.SPHERICAL_ECEF?function(t,e,n){q(t,e,n),(0,l.t)(n,n)}(At*Nt[0],At*Nt[1],n):(0,l.i)(n),n[12]=Tt[0],n[13]=Tt[1],n[14]=Tt[2],!0)}return!1}function X(t){return t===H.SPHERICAL_ECEF||t===H.SPHERICAL_MARS_PCPF||t===H.SPHERICAL_MOON_PCPF}function q(t,e,n){const r=Math.sin(t),o=Math.cos(t),s=Math.sin(e),i=Math.cos(e),u=n;return u[0]=-r,u[4]=-s*o,u[8]=i*o,u[12]=0,u[1]=o,u[5]=-s*r,u[9]=i*r,u[13]=0,u[2]=0,u[6]=i,u[10]=s,u[14]=0,u[3]=0,u[7]=0,u[11]=0,u[15]=1,u}function J(t,e){return t?e.spatialReference===t?e.spatialReferenceId:(e.spatialReference=t,"metersPerUnit"in e&&(e.metersPerUnit=(0,i.c9)(t,1)),t.wkt===c.kU.wkt?e.spatialReferenceId=H.SPHERICAL_ECEF:(0,N.oR)(t)?e.spatialReferenceId=H.WGS84:(0,N.sS)(t)?e.spatialReferenceId=H.WEB_MERCATOR:(0,N.QM)(t)?e.spatialReferenceId=H.PLATE_CARREE:t.wkt===c.pn.wkt?e.spatialReferenceId=H.WGS84_ECEF:t.wkid===T.W.CGCS2000?e.spatialReferenceId=H.CGCS2000:t.wkt===c.JL.wkt?e.spatialReferenceId=H.SPHERICAL_MARS_PCPF:t.wkt===c.mM.wkt?e.spatialReferenceId=H.SPHERICAL_MOON_PCPF:(0,N.BZ)(t)?e.spatialReferenceId=H.GCSMARS2000:(0,N.V2)(t)?e.spatialReferenceId=H.GCSMOON2000:e.spatialReferenceId=H.UNKNOWN):H.UNKNOWN}function V(t,e,n,r){t!==n&&(n[r++]=t[e++],n[r++]=t[e++],n[r]=t[e])}function Q(t,e,n,r){n[r++]=Ct*(t[e++]/h.sv.radius),n[r++]=Ct*(Math.PI/2-2*Math.atan(Math.exp(-t[e++]/h.sv.radius))),n[r]=t[e]}function $(t,e,n,r){!function(t,e,n,r,s){const i=.4999999*Math.PI,u=(0,o.uZ)(At*t[e+1],-i,i),a=Math.sin(u);n[r++]=At*t[e]*s.radius,n[r++]=s.halfSemiMajorAxis*Math.log((1+a)/(1-a)),n[r]=t[e+2]}(t,e,n,r,h.sv)}!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",t[t.WGS84=2]="WGS84",t[t.WEB_MERCATOR=3]="WEB_MERCATOR",t[t.WGS84_ECEF=4]="WGS84_ECEF",t[t.CGCS2000=5]="CGCS2000",t[t.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",t[t.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",t[t.GCSMARS2000=8]="GCSMARS2000",t[t.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",t[t.GCSMOON2000=10]="GCSMOON2000",t[t.LON_LAT=11]="LON_LAT",t[t.PLATE_CARREE=12]="PLATE_CARREE"}(H||(H={}));const tt=h.sv.radius*Math.PI/180,et=180/(h.sv.radius*Math.PI);function nt(t,e,n,r){n[r]=t[e]*tt,n[r+1]=t[e+1]*tt,n[r+2]=t[e+2]}function rt(t,e,n,r){n[r]=t[e]*et,n[r+1]=t[e+1]*et,n[r+2]=t[e+2]}function ot(t,e,n,r,o){const s=o+t[e+2],i=At*t[e+1],u=At*t[e],a=Math.cos(i);n[r++]=Math.cos(u)*a*s,n[r++]=Math.sin(u)*a*s,n[r]=Math.sin(i)*s}function st(t,e,n,r){ot(t,e,n,r,h.Z1.radius)}function it(t,e,n,r){ot(t,e,n,r,h.yr.radius)}function ut(t,e,n,r){ot(t,e,n,r,h.sv.radius)}function at(t,e,n,r,s){const i=t[e],u=t[e+1],a=t[e+2],l=Math.sqrt(i*i+u*u+a*a),_=(0,o.Kt)(a/(0===l?1:l)),c=Math.atan2(u,i);n[r++]=Ct*c,n[r++]=Ct*_,n[r]=l-s}function lt(t,e,n,r){at(t,e,n,r,h.Z1.radius)}function _t(t,e,n,r){at(t,e,n,r,h.yr.radius)}function ct(t,e,n,r){at(t,e,n,r,h.sv.radius)}function Pt(t,e,n,r){!function(t,e,n,r,o){const s=At*t[e],i=At*t[e+1],u=t[e+2],a=Math.sin(i),l=Math.cos(i),_=o.radius/Math.sqrt(1-o.eccentricitySquared*a*a);n[r++]=(_+u)*l*Math.cos(s),n[r++]=(_+u)*l*Math.sin(s),n[r++]=(_*(1-o.eccentricitySquared)+u)*a}(t,e,n,r,h.sv)}function Et(t,e,n,r){const o=C,s=t[e],i=t[e+1],u=t[e+2];let a,l,_,c,P,E,f,M,S,p,R,A,O,N,T,g,d,L,G,y,m;a=Math.abs(u),l=s*s+i*i,_=Math.sqrt(l),c=l+u*u,P=Math.sqrt(c),y=Math.atan2(i,s),E=u*u/c,f=l/c,N=o.a2/P,T=o.a3-o.a4/P,f>.3?(M=a/P*(1+f*(o.a1+N+E*T)/P),G=Math.asin(M),p=M*M,S=Math.sqrt(1-p)):(S=_/P*(1-E*(o.a5-N-f*T)/P),G=Math.acos(S),p=1-S*S,M=Math.sqrt(p)),R=1-h.sv.eccentricitySquared*p,A=h.sv.radius/Math.sqrt(R),O=o.a6*A,N=_-A*S,T=a-O*M,d=S*N+M*T,g=S*T-M*N,L=g/(O/R+d),G+=L,m=d+g*L/2,u<0&&(G=-G),n[r++]=Ct*y,n[r++]=Ct*G,n[r]=m}const ft={[H.WGS84]:{[H.CGCS2000]:null,[H.GCSMARS2000]:null,[H.GCSMOON2000]:null,[H.LON_LAT]:V,[H.WGS84_COMPARABLE_LON_LAT]:V,[H.SPHERICAL_ECEF]:ut,[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:$,[H.PLATE_CARREE]:nt,[H.WGS84]:V,[H.WGS84_ECEF]:Pt},[H.CGCS2000]:{[H.CGCS2000]:V,[H.GCSMARS2000]:null,[H.GCSMOON2000]:null,[H.LON_LAT]:V,[H.WGS84_COMPARABLE_LON_LAT]:V,[H.SPHERICAL_ECEF]:ut,[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:null,[H.PLATE_CARREE]:nt,[H.WGS84]:null,[H.WGS84_ECEF]:Pt},[H.GCSMARS2000]:{[H.CGCS2000]:null,[H.GCSMARS2000]:V,[H.GCSMOON2000]:null,[H.LON_LAT]:V,[H.WGS84_COMPARABLE_LON_LAT]:null,[H.SPHERICAL_ECEF]:null,[H.SPHERICAL_MARS_PCPF]:it,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:null,[H.PLATE_CARREE]:null,[H.WGS84]:null,[H.WGS84_ECEF]:null},[H.GCSMOON2000]:{[H.CGCS2000]:null,[H.GCSMARS2000]:null,[H.GCSMOON2000]:V,[H.LON_LAT]:V,[H.WGS84_COMPARABLE_LON_LAT]:null,[H.SPHERICAL_ECEF]:null,[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:st,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:null,[H.PLATE_CARREE]:null,[H.WGS84]:null,[H.WGS84_ECEF]:null},[H.WEB_MERCATOR]:{[H.CGCS2000]:null,[H.GCSMARS2000]:null,[H.GCSMOON2000]:null,[H.LON_LAT]:Q,[H.WGS84_COMPARABLE_LON_LAT]:Q,[H.SPHERICAL_ECEF]:function(t,e,n,r){Q(t,e,n,r),ut(n,r,n,r)},[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:V,[H.PLATE_CARREE]:function(t,e,n,r){Q(t,e,n,r),nt(n,r,n,r)},[H.WGS84]:Q,[H.WGS84_ECEF]:function(t,e,n,r){Q(t,e,n,r),Pt(n,r,n,r)}},[H.WGS84_ECEF]:{[H.CGCS2000]:Et,[H.GCSMARS2000]:null,[H.GCSMOON2000]:null,[H.LON_LAT]:Et,[H.WGS84_COMPARABLE_LON_LAT]:Et,[H.SPHERICAL_ECEF]:function(t,e,n,r){Et(t,e,n,r),ut(n,r,n,r)},[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:function(t,e,n,r){Et(t,e,n,r),$(n,r,n,r)},[H.PLATE_CARREE]:function(t,e,n,r){Et(t,e,n,r),nt(n,r,n,r)},[H.WGS84]:Et,[H.WGS84_ECEF]:V},[H.SPHERICAL_ECEF]:{[H.CGCS2000]:ct,[H.GCSMARS2000]:null,[H.GCSMOON2000]:null,[H.LON_LAT]:ct,[H.WGS84_COMPARABLE_LON_LAT]:ct,[H.SPHERICAL_ECEF]:V,[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:function(t,e,n,r){ct(t,e,n,r),$(n,r,n,r)},[H.PLATE_CARREE]:function(t,e,n,r){ct(t,e,n,r),nt(n,r,n,r)},[H.WGS84]:ct,[H.WGS84_ECEF]:function(t,e,n,r){ct(t,e,n,r),Pt(n,r,n,r)}},[H.SPHERICAL_MARS_PCPF]:{[H.CGCS2000]:null,[H.GCSMARS2000]:_t,[H.GCSMOON2000]:null,[H.LON_LAT]:_t,[H.WGS84_COMPARABLE_LON_LAT]:null,[H.SPHERICAL_ECEF]:null,[H.SPHERICAL_MARS_PCPF]:V,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:null,[H.PLATE_CARREE]:null,[H.WGS84]:null,[H.WGS84_ECEF]:null},[H.SPHERICAL_MOON_PCPF]:{[H.CGCS2000]:null,[H.GCSMARS2000]:null,[H.GCSMOON2000]:lt,[H.LON_LAT]:lt,[H.WGS84_COMPARABLE_LON_LAT]:null,[H.SPHERICAL_ECEF]:null,[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:V,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:null,[H.PLATE_CARREE]:null,[H.WGS84]:null,[H.WGS84_ECEF]:null},[H.UNKNOWN]:{[H.CGCS2000]:null,[H.GCSMARS2000]:null,[H.GCSMOON2000]:null,[H.LON_LAT]:null,[H.WGS84_COMPARABLE_LON_LAT]:null,[H.SPHERICAL_ECEF]:null,[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:V,[H.WEB_MERCATOR]:null,[H.PLATE_CARREE]:null,[H.WGS84]:null,[H.WGS84_ECEF]:null},[H.LON_LAT]:{[H.CGCS2000]:V,[H.GCSMARS2000]:V,[H.GCSMOON2000]:V,[H.LON_LAT]:V,[H.WGS84_COMPARABLE_LON_LAT]:V,[H.SPHERICAL_ECEF]:ut,[H.SPHERICAL_MARS_PCPF]:it,[H.SPHERICAL_MOON_PCPF]:st,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:$,[H.PLATE_CARREE]:nt,[H.WGS84]:V,[H.WGS84_ECEF]:Pt},[H.WGS84_COMPARABLE_LON_LAT]:{[H.CGCS2000]:null,[H.GCSMARS2000]:null,[H.GCSMOON2000]:null,[H.LON_LAT]:V,[H.WGS84_COMPARABLE_LON_LAT]:V,[H.SPHERICAL_ECEF]:ut,[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:null,[H.PLATE_CARREE]:nt,[H.WGS84]:V,[H.WGS84_ECEF]:Pt},[H.PLATE_CARREE]:{[H.CGCS2000]:rt,[H.GCSMARS2000]:null,[H.GCSMOON2000]:null,[H.LON_LAT]:rt,[H.WGS84_COMPARABLE_LON_LAT]:rt,[H.SPHERICAL_ECEF]:function(t,e,n,r){rt(t,e,n,r),ut(n,r,n,r)},[H.SPHERICAL_MARS_PCPF]:null,[H.SPHERICAL_MOON_PCPF]:null,[H.UNKNOWN]:null,[H.WEB_MERCATOR]:function(t,e,n,r){rt(t,e,n,r),$(n,r,n,r)},[H.PLATE_CARREE]:V,[H.WGS84]:rt,[H.WGS84_ECEF]:function(t,e,n,r){rt(t,e,n,r),Pt(n,r,n,r)}}};function Mt(t,e,n=St()){return null==t||null==e?null:function(t,e,n){if(null==t||null==e||n.source.spatialReference===t&&n.dest.spatialReference===e)return n;const r=J(t,n.source),o=J(e,n.dest);return r===H.UNKNOWN&&o===H.UNKNOWN?(0,N.fS)(t,e)?n.projector=V:n.projector=null:n.projector=ft[r][o],n}(t,e,n).projector}function St(){return{source:{spatialReference:null,spatialReferenceId:H.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:H.UNKNOWN,metersPerUnit:1},projector:V}}const pt={spatialReference:null,spatialReferenceId:H.UNKNOWN},ht={spatialReference:null,spatialReferenceId:H.UNKNOWN},Rt=St(),At=(St(),(0,o.Vl)(1)),Ct=(0,o.BV)(1),Ot=(0,_.c)(),Nt=(0,_.c)(),Tt=(0,_.c)(),gt=(0,_.c)();(0,_.c)()},18571:(t,e,n)=>{n.d(e,{Z:()=>s});let r=0;class o{static fromGE(t){const e=new o;return e._wkt=t.wkt,e._wkid=t.wkid,e._isInverse=t.isInverse,e}constructor(t){this.uid=r++,t?(this._wkt=null!=t.wkt?t.wkt:null,this._wkid=null!=t.wkid?t.wkid:-1,this._isInverse=null!=t.isInverse&&!0===t.isInverse):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}get wkt(){return this._wkt}set wkt(t){this._wkt=t,this.uid=r++}get wkid(){return this._wkid}set wkid(t){this._wkid=t,this.uid=r++}get isInverse(){return this._isInverse}set isInverse(t){this._isInverse=t,this.uid=r++}getInverse(){const t=new o;return t._wkt=this.wkt,t._wkid=this._wkid,t._isInverse=!this.isInverse,t}}class s{static cacheKey(t,e){return[void 0!==t.wkid&&null!==t.wkid?t.wkid.toString():"-1",void 0!==t.wkt&&null!==t.wkt?t.wkt.toString():"",void 0!==e.wkid&&null!==e.wkid?e.wkid.toString():"-1",void 0!==e.wkt&&null!==e.wkt?e.wkt.toString():""].join(",")}static fromGE(t){const e=new s;let n="";for(const r of t.steps){const t=o.fromGE(r);e.steps.push(t),n+=t.uid.toString()+","}return e._cachedProjection={},e._gtlistentry=null,e._chain=n,e}constructor(t){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,t&&t.steps)for(const e of t.steps)e instanceof o?this.steps.push(e):this.steps.push(new o({wkid:e.wkid,wkt:e.wkt,isInverse:e.isInverse}))}getInverse(){const t=new s;t.steps=[];for(let e=this.steps.length-1;e>=0;e--){const n=this.steps[e];t.steps.push(n.getInverse())}return t}getGTListEntry(){let t="";for(const e of this.steps)t+=e.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,e,n){this._cachedProjection[s.cacheKey(t,e)]=n}getCachedGeTransformation(t,e){let n="";for(const t of this.steps)n+=t.uid.toString()+",";n!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=n);const r=this._cachedProjection[s.cacheKey(t,e)];return void 0===r?null:r}}},69285:(t,e,n)=>{n.d(e,{k:()=>s});var r=n(67900),o=n(8744);function s(t,e,n){if(null==e||null==n||n.vcsWkid||(0,o.fS)(e,n))return null;const s=(0,r._R)(e)/(0,r._R)(n);if(1===s)return null;switch(t){case"point":case"esriGeometryPoint":return t=>function(t,e){t&&null!=t.z&&(t.z*=e)}(t,s);case"polyline":case"esriGeometryPolyline":return t=>function(t,e){if(t)for(const n of t.paths)for(const t of n)t.length>2&&(t[2]*=e)}(t,s);case"polygon":case"esriGeometryPolygon":return t=>function(t,e){if(t)for(const n of t.rings)for(const t of n)t.length>2&&(t[2]*=e)}(t,s);case"multipoint":case"esriGeometryMultipoint":return t=>function(t,e){if(t)for(const n of t.points)n.length>2&&(n[2]*=e)}(t,s);case"extent":case"esriGeometryEnvelope":return t=>function(t,e){t&&null!=t.zmin&&null!=t.zmax&&(t.zmin*=e,t.zmax*=e)}(t,s);default:return null}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5235],{15235:(e,t,i)=>{i.r(t),i.d(t,{default:()=>O});var r=i(43697),o=i(99880),a=i(40330),s=i(20102),n=i(96674),l=i(22974),p=i(83379),c=i(70586),d=i(81271),u=i(5600),h=i(75215),m=i(71715),g=i(52011),y=i(6570),b=i(48522),v=i(92036),w=i(92604),f=i(90578);i(67676),i(80442);let k=class extends v.Z{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){null!=e&&(0,d.YP)(e)?w.Z.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const i=this.cdnUrl;if(null==i)throw new s.Z("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(i,{responseType:e,query:{token:this.portalItem.apiKey},signal:t?.signal})}async update(e,t){const{addOrUpdateResource:r}=await i.e(7873).then(i.bind(i,97873));return r(this,"update",e,t)}hasPath(){return null!=this.path}_normalizePath(e,t){return null==e?e:(e=e.replace(/^\/+/,""),null!=t&&(0,d.YP)(e)&&(e=(0,d.PF)(e,t.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};(0,r._)([(0,u.Cb)()],k.prototype,"portalItem",void 0),(0,r._)([(0,u.Cb)({type:String,value:null})],k.prototype,"path",null),(0,r._)([(0,f.p)("path")],k.prototype,"_castPath",null),(0,r._)([(0,u.Cb)({type:String,readOnly:!0})],k.prototype,"url",null),(0,r._)([(0,u.Cb)({type:String,readOnly:!0})],k.prototype,"cdnUrl",null),(0,r._)([(0,u.Cb)({type:String,readOnly:!0})],k.prototype,"itemRelativeUrl",null),k=(0,r._)([(0,g.j)("esri.portal.PortalItemResource")],k);const C=k;let S=class extends v.Z{constructor(e){super(e),this.created=null,this.rating=null}};(0,r._)([(0,u.Cb)()],S.prototype,"created",void 0),(0,r._)([(0,u.Cb)()],S.prototype,"rating",void 0),S=(0,r._)([(0,g.j)("esri.portal.PortalRating")],S);const _=S;var I;const x=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),U=new Set(["KML","GeoJson","CSV"]);let R=I=class extends((0,n.eC)(p.Z)){static from(e){return(0,h.TJ)(I,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return"Feature Service"===e||"Feature Collection"===e?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":"Image Service"===e?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":"Scene Service"===e?i="Scene Layer":"Video Service"===e?i="Video Layer":"Scene Package"===e?i="Scene Layer Package":"Stream Service"===e?i="Feature Layer":"Geoprocessing Service"===e?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":"Geocoding Service"===e?i="Locator":"Geoenrichment Service"===e?i="GeoEnrichment Service":"Microsoft Powerpoint"===e?i="Microsoft PowerPoint":"GeoJson"===e?i="GeoJSON":"Globe Service"===e?i="Globe Layer":"Vector Tile Service"===e?i="Tile Layer":"netCDF"===e?i="NetCDF":"Map Service"===e?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replaceAll(/(add in)/gi,"Add-In"):"datastore catalog service"===e?i="Big Data File Share":"Compact Tile Package"===e?i="Tile Package (tpkx)":"OGCFeatureServer"===e?i="OGC Feature Layer":"web mapping application"===e&&t.includes("configurableApp")?i="Instant App":"Insights Page"===e&&(i="Insights Report"),i}readExtent(e){return e&&e.length?new y.Z(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",t=this.typeKeywords||[];let i,r=!1,a=!1,s=!1,n=!1,l=!1,p=!1;return e.indexOf("service")>0||"feature collection"===e||"kml"===e||"wms"===e||"wmts"===e||"wfs"===e?(r=t.includes("Hosted Service"),"feature service"===e||"feature collection"===e||"kml"===e||"wfs"===e?(a=t.includes("Table"),s=t.includes("Route Layer"),n=t.includes("Markup"),l=t.includes("Spatiotemporal"),p=t.includes("UtilityNetwork"),i=l&&a?"spatiotemporaltable":a?"table":s?"routelayer":n?"markup":l?"spatiotemporal":r?"featureshosted":p?"utilitynetwork":"features"):i="map service"===e||"wms"===e||"wmts"===e?r||t.includes("Tiled")||"wmts"===e?"maptiles":"mapimages":"scene service"===e?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":"image service"===e?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":"stream service"===e?"streamlayer":"video service"===e?"mediaservice":"vector tile service"===e?"vectortile":"datastore catalog service"===e?"datastorecollection":"geocoding service"===e?"geocodeservice":"geoprocessing service"===e?t.includes("Web Tool")?"tool":"layers":"geodata service"===e?"geodataservice":"layers"):i="web map"===e||"cityengine web scene"===e?"maps":"web scene"===e?t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":"web mapping application"===e&&t.includes("configurableApp")?"instantapps":"web mapping application"===e||"mobile application"===e||"application"===e||"operation view"===e||"desktop application"===e?"apps":"map document"===e||"map package"===e||"published map"===e||"scene document"===e||"globe document"===e||"basemap package"===e||"mobile basemap package"===e||"mobile map package"===e||"project package"===e||"project template"===e||"pro map"===e||"layout"===e||"layer"===e&&t.includes("ArcGIS Pro")||"explorer map"===e&&t.indexOf("Explorer Document")?"mapsgray":"service definition"===e||"csv"===e||"shapefile"===e||"cad drawing"===e||"geojson"===e||"netcdf"===e||"administrative report"===e?"datafiles":"explorer add in"===e||"desktop add in"===e||"windows viewer add in"===e||"windows viewer configuration"===e?"appsgray":"360 vr experience"===e?"360vr":"arcgis pro add in"===e||"arcgis pro configuration"===e?"addindesktop":"rule package"===e||"file geodatabase"===e||"sqlite geodatabase"===e||"csv collection"===e||"kml collection"===e||"windows mobile package"===e||"map template"===e||"desktop application template"===e||"gml"===e||"arcpad package"===e||"code sample"===e||"form"===e||"document link"===e||"earth configuration"===e||"operations dashboard add in"===e||"rules package"===e||"image"===e||"workflow manager package"===e||"explorer map"===e&&t.includes("Explorer Mapping Application")||t.includes("Document")?"datafilesgray":"network analysis service"===e||"geoprocessing service"===e||"geodata service"===e||"geometry service"===e||"geoprocessing package"===e||"locator package"===e||"geoprocessing sample"===e||"workflow manager service"===e?"toolsgray":"layer"===e||"layer package"===e||"explorer layer"===e?"layersgray":"scene package"===e?"scenepackage":"mobile scene package"===e?"mobilescenepackage":"tile package"===e||"compact tile package"===e?"tilepackage":"task file"===e?"taskfile":"report template"===e?"report-template":"statistical data collection"===e?"statisticaldatacollection":"insights workbook"===e?"workbook":"insights model"===e?"insightsmodel":"insights page"===e?"insightspage":"insights theme"===e?"insightstheme":"hub initiative"===e?"hubinitiative":"hubpage"===e?"hubpage":"hub event"===e?"hubevent":"hub site application"===e?"hubsite":"hub project"===e?"hubproject":"relational database connection"===e?"relationaldatabaseconnection":"big data file share"===e?"datastorecollection":"image collection"===e?"imagecollection":"style"===e?"style":"desktop style"===e?"desktopstyle":"dashboard"===e?"dashboard":"raster function template"===e?"rasterprocessingtemplate":"vector tile package"===e?"vectortilepackage":"ortho mapping project"===e?"orthomappingproject":"ortho mapping template"===e?"orthomappingtemplate":"solution"===e?"solutions":"geopackage"===e?"geopackage":"deep learning package"===e?"deeplearningpackage":"real time analytic"===e?"realtimeanalytics":"big data analytic"===e?"bigdataanalytics":"feed"===e?"feed":"excalibur imagery project"===e?"excaliburimageryproject":"notebook"===e?"notebook":"storymap"===e?"storymap":"survey123 add in"===e?"survey123addin":"mission"===e?"mission":"mission report"===e?"missionreport":"quickcapture project"===e?"quickcaptureproject":"pro report"===e?"proreport":"pro report template"===e?"proreporttemplate":"urban model"===e?"urbanmodel":"web experience"===e?"experiencebuilder":"web experience template"===e?"webexperiencetemplate":"experience builder widget"===e?"experiencebuilderwidget":"experience builder widget package"===e?"experiencebuilderwidgetpackage":"workflow"===e?"workflow":"insights script"===e?"insightsscript":"kernel gateway connection"===e?"kernelgatewayconnection":"hub initiative template"===e?"hubinitiativetemplate":"storymap theme"===e?"storymaptheme":"knowledge graph"===e?"knowledgegraph":"native application"===e?"nativeapp":"native application installer"===e?"nativeappinstaller":"link chart"===e?"linkchart":"investigation"===e?"investigation":"ogcfeatureserver"===e?"features":"pro project"===e?"proproject":"insights workbook package"===e?"insightsworkbookpackage":"apache parquet"===e?"apacheparquet":"notebook code snippets"===e||"notebook code snippet library"===e?"notebookcodesnippets":"suitability model"===e?"suitabilitymodel":"esri classifier definition"===e?"classifierdefinition":"esri classification schema"===e?"classificationschema":"insights data engineering workbook"===e?"dataengineeringworkbook":"insights data engineering model"===e?"dataengineeringmodel":"deep learning studio project"===e?"deeplearningproject":"discussion"===e?"discussion":"allsource project"===e?"allsourceproject":"api key"===e?"apikey":"data pipeline"===e?"datapipelines":"maps",i?(0,o.V)("esri/images/portal/"+i+"16.png"):null}get isLayer(){return null!=this.type&&x.has(this.type)}get itemCdnUrl(){let e=this.itemUrl;return e&&a.id&&!a.id.findCredential(e)&&(e=a.id._normalizeAGOLorgDomain(e),e=e.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),e=e.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),e=e.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),e}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){const t=this.portal??(this.portal=b.Z.getDefault()),i=t.load(e).then((()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:null!=e?e.signal:null,query:{token:this.apiKey}}):{})).then((e=>{this.sourceJSON=e,this.read(e)}));return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof _&&(e=e.rating),null==e||isNaN(e)||"number"!=typeof e||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new _({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:(0,l.d9)(this.applicationProxies),avgRating:this.avgRating,categories:(0,l.d9)(this.categories),created:(0,l.d9)(this.created),culture:this.culture,description:this.description,extent:(0,l.d9)(this.extent),groupCategories:(0,l.d9)(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:(0,l.d9)(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:(0,l.d9)(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:(0,l.d9)(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:(0,l.d9)(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new I({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await(0,c.s3)(this.portal).request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return(0,c.s3)(this.portal).request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await(0,c.s3)(this.portal).request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return null!=t.rating?(t.created=new Date(t.created),new _(t)):null}fetchRelatedItems(e,t){return(0,c.s3)(this.portal).requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},I)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return(0,c.s3)(this.portal).request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then((e=>(this.sourceJSON=e,this.read(e),this)))}update(e){return this.id?this.load().then((()=>(0,c.s3)(this.portal).signIn())).then((()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const e in i.query)null===i.query[e]&&(i.query[e]="");return i.query.clearEmptyFields=!0,null!=t&&("string"==typeof t?i.query.text=t:"object"==typeof t&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then((()=>this.reload()))})):Promise.reject(new s.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new s.Z("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:i}=this;await(0,c.s3)(t).signIn();const{copyResources:r,folder:o,tags:a,title:n}=e||{},l={method:"post",query:{copyPrivateResources:"all"===r,folder:"string"==typeof o?o:o?.id,includeResources:!!r,tags:a?.join(","),title:n}},{itemId:p}=await t.request(`${i}/copy`,l);return new I({id:p,portal:t})}updateThumbnail(e){return this.id?this.load().then((()=>this.portal.signIn())).then((()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if("string"==typeof t)(0,d.HK)(t)?r.query={data:t}:r.query={url:(0,d.hF)(t)},null!=i&&(r.query.filename=i);else{const e=new FormData;null!=i?e.append("file",t,i):e.append("file",t),r.body=e}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then((()=>this.reload()))})):Promise.reject(new s.Z("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:r}=await i.e(7873).then(i.bind(i,97873));return r(this,e,t)}async addResource(e,t,r){const{addOrUpdateResource:o}=await i.e(7873).then(i.bind(i,97873));return e.portalItem=this,o(e,"add",t,r)}async removeResource(e,t){const{removeResource:r}=await i.e(7873).then(i.bind(i,97873));if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new s.Z("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await i.e(7873).then(i.bind(i,97873));return t(this,e)}resourceFromPath(e){return new C({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:(0,l.d9)(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:(0,l.d9)(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:(0,l.d9)(this.typeKeywords),url:this.url};return(0,l.yd)(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new I({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)"tags"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"typeKeywords"===t&&null!==e[t]&&(e[t]=e[t].join(", ")),"extent"===t&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};(0,r._)([(0,u.Cb)({type:["private","shared","org","public"]})],R.prototype,"access",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"accessInformation",void 0),(0,r._)([(0,u.Cb)({type:String})],R.prototype,"apiKey",void 0),(0,r._)([(0,u.Cb)({json:{read:{source:"appProxies"}}})],R.prototype,"applicationProxies",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"avgRating",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"categories",void 0),(0,r._)([(0,u.Cb)({type:Date})],R.prototype,"created",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"culture",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"description",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],R.prototype,"displayName",null),(0,r._)([(0,u.Cb)({type:y.Z})],R.prototype,"extent",void 0),(0,r._)([(0,m.r)("extent")],R.prototype,"readExtent",null),(0,r._)([(0,u.Cb)()],R.prototype,"groupCategories",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],R.prototype,"iconUrl",null),(0,r._)([(0,u.Cb)()],R.prototype,"id",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],R.prototype,"isLayer",null),(0,r._)([(0,u.Cb)({type:Boolean,readOnly:!0})],R.prototype,"isOrgItem",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"itemControl",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],R.prototype,"itemPageUrl",null),(0,r._)([(0,u.Cb)({readOnly:!0})],R.prototype,"itemUrl",null),(0,r._)([(0,u.Cb)()],R.prototype,"licenseInfo",void 0),(0,r._)([(0,u.Cb)({type:Date})],R.prototype,"modified",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"name",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"numComments",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"numRatings",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"numViews",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"owner",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"ownerFolder",void 0),(0,r._)([(0,u.Cb)({type:b.Z})],R.prototype,"portal",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"screenshots",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"size",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"snippet",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"sourceJSON",void 0),(0,r._)([(0,u.Cb)({type:String})],R.prototype,"sourceUrl",void 0),(0,r._)([(0,u.Cb)({type:String})],R.prototype,"spatialReference",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"tags",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"thumbnail",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],R.prototype,"thumbnailUrl",null),(0,r._)([(0,u.Cb)()],R.prototype,"title",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"type",void 0),(0,r._)([(0,u.Cb)()],R.prototype,"typeKeywords",void 0),(0,r._)([(0,u.Cb)({type:String,json:{read(e,t){if(U.has(t.type)){const t=this.portal?.restUrl;e||=t&&this.id?`${t}/content/items/${this.id}/data`:null}return e}}})],R.prototype,"url",void 0),(0,r._)([(0,u.Cb)({readOnly:!0})],R.prototype,"userItemUrl",null),R=I=(0,r._)([(0,g.j)("esri.portal.PortalItem")],R);const O=R}}]);
|