@arcgis/core 5.2.0 → 5.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{67e533748435253aaba6.js → 0284f608d25c654fcc11.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{2d9a1f23ec6ce90723ac.js → 0d99bfb75dcb9fa29080.js} +1 -1
  4. package/assets/esri/core/workers/chunks/0fa29352f2ecf0c515e8.js +1 -0
  5. package/assets/esri/core/workers/chunks/10ad7b35b6800d40444e.js +1 -0
  6. package/assets/esri/core/workers/chunks/1132e28aaa5825b10b6e.js +1 -0
  7. package/assets/esri/core/workers/chunks/{10878932826ddb60fac4.js → 1fcc998421c7c16de2ca.js} +1 -1
  8. package/assets/esri/core/workers/chunks/21e1d423ee33f916547e.js +1 -0
  9. package/assets/esri/core/workers/chunks/251f706d226b1d47ba99.js +1 -0
  10. package/assets/esri/core/workers/chunks/{ba38231193919e093917.js → 2529f12fc16e98c014ca.js} +1 -1
  11. package/assets/esri/core/workers/chunks/2b4dd42920d37b1ff0a9.js +2 -0
  12. package/assets/esri/core/workers/chunks/2b804b5d7ce10f0f0cf0.js +1 -0
  13. package/assets/esri/core/workers/chunks/3537fe95b83a13b156cc.js +1 -0
  14. package/assets/esri/core/workers/chunks/36f31416132de434ec00.js +1 -0
  15. package/assets/esri/core/workers/chunks/3e29ab5ec136e669b633.js +1 -0
  16. package/assets/esri/core/workers/chunks/{36c780a9527c75b36725.js → 40d7e54529d13fdd2bf1.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{2cb209bc51a19487692d.js → 43aef67452fa6ff8d8f9.js} +2 -2
  18. package/assets/esri/core/workers/chunks/449a2dee17b54946f245.js +1 -0
  19. package/assets/esri/core/workers/chunks/{5d42f0898bf30ae940ea.js → 46071e59290bf06bb614.js} +1 -1
  20. package/assets/esri/core/workers/chunks/46d91cd99558304da0c7.js +1 -0
  21. package/assets/esri/core/workers/chunks/4cf72dcccf2be353a701.js +1 -0
  22. package/assets/esri/core/workers/chunks/{e3a742dc0c291b47ba56.js → 510c2eb78f5e12f77bbc.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{98d1efb6f2439c6344cf.js → 5b2d1c8763a1716677c0.js} +1 -1
  24. package/assets/esri/core/workers/chunks/5bf7de2e2faa55e53629.js +1 -0
  25. package/assets/esri/core/workers/chunks/{042614bf65b7d63025cb.js → 5f49233d5b67a9ad71d7.js} +1 -1
  26. package/assets/esri/core/workers/chunks/604433b02a165d187953.js +1 -0
  27. package/assets/esri/core/workers/chunks/61d36730564c5ac5edab.js +1 -0
  28. package/assets/esri/core/workers/chunks/{094eb9677cdebfaa9e1b.js → 648d5cdfc3e92be3db55.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{bc6fdd9faf8ed54be0cb.js → 6694e2b27fd6ddf44e21.js} +1 -1
  30. package/assets/esri/core/workers/chunks/70268d790c2f1cb83d43.js +1 -0
  31. package/assets/esri/core/workers/chunks/7b45ac83e279fe9516a5.js +1 -0
  32. package/assets/esri/core/workers/chunks/8102f0bf5707c3be3310.js +1 -0
  33. package/assets/esri/core/workers/chunks/{d56fdf5ce5ff53dc0e69.js → 84495695313b01832369.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{31640b41e0ecdff892fa.js → 85b63811ae7bcb6f74b6.js} +2 -2
  35. package/assets/esri/core/workers/chunks/{c4bbe4707e90b7cd0379.js → 8ac4a043a4f185db271f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/8d01dd92f5c897193ab5.js +1 -0
  37. package/assets/esri/core/workers/chunks/900c8569596609183f19.js +2 -0
  38. package/assets/esri/core/workers/chunks/{d1d6154b4af1c9cc497b.js → 934e1f2153e6fad6ed23.js} +1 -1
  39. package/assets/esri/core/workers/chunks/95c9c5677bbe7fd0420a.js +1 -0
  40. package/assets/esri/core/workers/chunks/{b70885deebc6106597ad.js → 983b85727e09c54bede0.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{d20dcd4ce4b0111d924f.js → 9bbc8e5d42921a8050bb.js} +1 -1
  42. package/assets/esri/core/workers/chunks/a07070de96e143a329a4.js +1 -0
  43. package/assets/esri/core/workers/chunks/a17fb26d6ac4895e51a3.js +2 -0
  44. package/assets/esri/core/workers/chunks/{0d52e1b6d38f2670658c.js → a6f74bd1a9c87b9836ca.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{a85cdafbaf1848bb924b.js → a846c94d49df8d4cd5be.js} +1 -1
  46. package/assets/esri/core/workers/chunks/aa4f12fcb9f4ed3dba18.js +1 -0
  47. package/assets/esri/core/workers/chunks/ac10c7d2c4829a150037.js +1 -0
  48. package/assets/esri/core/workers/chunks/{509a74e9334f31b931d4.js → b54ba2bd6b1b90dcc0cc.js} +1 -1
  49. package/assets/esri/core/workers/chunks/bde8f3b3ce5b1d3ee774.js +1 -0
  50. package/assets/esri/core/workers/chunks/c25ae83fd790f181bb42.js +1 -0
  51. package/assets/esri/core/workers/chunks/{dc51dcaa4e2f9a90f5bd.js → c2cbe0f5e8958cf18e58.js} +2 -2
  52. package/assets/esri/core/workers/chunks/c4c55d8a98ba3f51f63c.js +1 -0
  53. package/assets/esri/core/workers/chunks/c5bf19da62a3d31009fe.js +2 -0
  54. package/assets/esri/core/workers/chunks/{2226c20c38e20713bcb5.js.LICENSE.txt → c5bf19da62a3d31009fe.js.LICENSE.txt} +1 -1
  55. package/assets/esri/core/workers/chunks/{2a2a4650dd9b953d317c.js → c93343a91161c4e40c28.js} +1 -1
  56. package/assets/esri/core/workers/chunks/cb4c5544382eb8c4a87f.js +1 -0
  57. package/assets/esri/core/workers/chunks/{2d83ba260dd6bbe38206.js → d05665ddc8d31403aed3.js} +1 -1
  58. package/assets/esri/core/workers/chunks/d24dea0bdb17db07e2b3.js +1 -0
  59. package/assets/esri/core/workers/chunks/d3412518a7b518860fbb.js +1 -0
  60. package/assets/esri/core/workers/chunks/d4bc6d65dff5d0cc93ba.js +1 -0
  61. package/assets/esri/core/workers/chunks/{3048e74e6246324ce6fc.js → d5916500514a41a4758f.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{aea44253c80493ef5755.js → e7b168ba31142c00f765.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{a504a5e06cb89a620799.js → ec8b7476eac4718eb0ac.js} +1 -1
  64. package/assets/esri/core/workers/chunks/f497968055af459c5da4.js +1 -0
  65. package/assets/esri/core/workers/chunks/{d53cc574a21031436c45.js → f79494829a5b65b5b4c9.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{26261b21d1edf476ea49.js → f7ec3b7f2eccd9c4c2e5.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{20ee2f36f0fd0ae01e15.js → f88cbf9b1d1d7400c060.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{bf4d913e523eae2fda28.js → fa7b189e9b2cc8d4a77f.js} +1 -1
  69. package/assets/esri/core/workers/chunks/fcb4707c2e95099b9f30.js +1 -0
  70. package/assets/esri/core/workers/chunks/{735c1dffc3439bdba3cc.js → fd172c96d2b36032a1d9.js} +1 -1
  71. package/config.js +1 -1
  72. package/core/workers.d.ts +1 -0
  73. package/kernel.js +1 -1
  74. package/layers/CSVLayer.js +1 -1
  75. package/layers/SceneLayer.js +1 -1
  76. package/layers/graphics/sources/CSVSource.js +1 -1
  77. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  78. package/layers/graphics/sources/MemorySource.js +2 -2
  79. package/layers/graphics/sources/support/QueryTask.js +1 -1
  80. package/layers/graphics/sources/support/timeQueryUtils.js +2 -0
  81. package/layers/mixins/ArcGISImageService.js +1 -1
  82. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  83. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  84. package/layers/orientedImagery/transformations/utils.js +1 -1
  85. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  86. package/layers/support/TimeInformation.js +1 -1
  87. package/layers/support/timeInfoUtils.js +2 -0
  88. package/package.json +4 -4
  89. package/rest/query/executeAttributeBinsQuery.js +1 -1
  90. package/rest/query/executeForExtent.js +1 -1
  91. package/rest/query/executeForTopCount.js +1 -1
  92. package/rest/query/executeForTopExtents.js +1 -1
  93. package/rest/query/executeForTopIds.js +1 -1
  94. package/rest/query/executeTopFeaturesQuery.js +1 -1
  95. package/rest/query/operations/query.js +1 -1
  96. package/rest/query/operations/queryAttributeBins.js +1 -1
  97. package/rest/query/operations/queryTopFeatures.js +1 -1
  98. package/rest/support/timeUtils.js +1 -1
  99. package/support/timeUtils.js +1 -1
  100. package/symbols/TextSymbol.d.ts +0 -1
  101. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  102. package/views/3d/analysis/LineOfSight/LineOfSightConfiguration.js +1 -1
  103. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  104. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  105. package/views/3d/analysis/LineOfSight/LineOfSightManipulators.js +1 -1
  106. package/views/3d/environment/SunLighting.d.ts +10 -8
  107. package/views/3d/environment/VirtualLighting.d.ts +10 -8
  108. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  109. package/webscene/Environment.d.ts +1 -1
  110. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  111. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  112. package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
  113. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  114. package/widgets/BatchAttributeForm.js +1 -1
  115. package/widgets/FeatureForm.js +1 -1
  116. package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
  117. package/widgets/FeatureTable/RelationshipColumn.js +1 -1
  118. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  119. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  120. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  121. package/widgets/OrientedImageryViewer/utils.js +1 -1
  122. package/widgets/OrientedImageryViewer.js +2 -2
  123. package/assets/esri/core/workers/chunks/20a698709c3c11ff2c16.js +0 -1
  124. package/assets/esri/core/workers/chunks/2226c20c38e20713bcb5.js +0 -2
  125. package/assets/esri/core/workers/chunks/2a570ce6b99dac6ee996.js +0 -1
  126. package/assets/esri/core/workers/chunks/2b6684d057d9ad17ac13.js +0 -1
  127. package/assets/esri/core/workers/chunks/2e66c969bf4209c957b5.js +0 -2
  128. package/assets/esri/core/workers/chunks/377595b23379b0c8fe95.js +0 -1
  129. package/assets/esri/core/workers/chunks/379ef56f6b32494832a6.js +0 -1
  130. package/assets/esri/core/workers/chunks/38d852676677e5697864.js +0 -1
  131. package/assets/esri/core/workers/chunks/3c881b1adc8a5dea9a90.js +0 -1
  132. package/assets/esri/core/workers/chunks/4e6656a5f29e31902fca.js +0 -2
  133. package/assets/esri/core/workers/chunks/50e8943d2c0b96fab2c1.js +0 -1
  134. package/assets/esri/core/workers/chunks/5a9b7eb26f936f03d02e.js +0 -1
  135. package/assets/esri/core/workers/chunks/5f07f52bb8b7721f08d3.js +0 -1
  136. package/assets/esri/core/workers/chunks/60c79934799927114074.js +0 -1
  137. package/assets/esri/core/workers/chunks/63b5418a1c3fe0a97a86.js +0 -1
  138. package/assets/esri/core/workers/chunks/6ddc29a144640acb1192.js +0 -1
  139. package/assets/esri/core/workers/chunks/6f73e41e14817acfaead.js +0 -1
  140. package/assets/esri/core/workers/chunks/7dfbc31f3b56728485a4.js +0 -1
  141. package/assets/esri/core/workers/chunks/822f83d7c09ef0a9bbdf.js +0 -1
  142. package/assets/esri/core/workers/chunks/844eedda8f749972f707.js +0 -2
  143. package/assets/esri/core/workers/chunks/8b8118ab56cc808b5a71.js +0 -1
  144. package/assets/esri/core/workers/chunks/8d86b0cb0e004ad72040.js +0 -1
  145. package/assets/esri/core/workers/chunks/98760040f0c9d47c718d.js +0 -1
  146. package/assets/esri/core/workers/chunks/a2f0894218e665780a21.js +0 -1
  147. package/assets/esri/core/workers/chunks/a65951f1d5702cfd996e.js +0 -1
  148. package/assets/esri/core/workers/chunks/ab6506a3c16f8717fc00.js +0 -1
  149. package/assets/esri/core/workers/chunks/c45edd0a7d57263bb7d6.js +0 -1
  150. package/assets/esri/core/workers/chunks/c52466eb1f3c33ae1f5a.js +0 -1
  151. package/assets/esri/core/workers/chunks/c570b90995c65bbb2e14.js +0 -1
  152. package/assets/esri/core/workers/chunks/c576bef77e34920af188.js +0 -1
  153. package/assets/esri/core/workers/chunks/c80a3b039e510c118399.js +0 -1
  154. package/assets/esri/core/workers/chunks/c88a70f68c8ce8c30e9b.js +0 -1
  155. package/assets/esri/core/workers/chunks/cf1ec61eb2ad147bb931.js +0 -1
  156. package/assets/esri/core/workers/chunks/daae21cf77864f3293ef.js +0 -1
  157. package/assets/esri/core/workers/chunks/e9cdb0b0f074583edebd.js +0 -1
  158. package/assets/esri/core/workers/chunks/f5cc78291b53931b91e8.js +0 -1
  159. /package/assets/esri/core/workers/chunks/{844eedda8f749972f707.js.LICENSE.txt → 2b4dd42920d37b1ff0a9.js.LICENSE.txt} +0 -0
  160. /package/assets/esri/core/workers/chunks/{2cb209bc51a19487692d.js.LICENSE.txt → 43aef67452fa6ff8d8f9.js.LICENSE.txt} +0 -0
  161. /package/assets/esri/core/workers/chunks/{31640b41e0ecdff892fa.js.LICENSE.txt → 85b63811ae7bcb6f74b6.js.LICENSE.txt} +0 -0
  162. /package/assets/esri/core/workers/chunks/{4e6656a5f29e31902fca.js.LICENSE.txt → 900c8569596609183f19.js.LICENSE.txt} +0 -0
  163. /package/assets/esri/core/workers/chunks/{2e66c969bf4209c957b5.js.LICENSE.txt → a17fb26d6ac4895e51a3.js.LICENSE.txt} +0 -0
  164. /package/assets/esri/core/workers/chunks/{dc51dcaa4e2f9a90f5bd.js.LICENSE.txt → c2cbe0f5e8958cf18e58.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../intl.js";import{isSome as r}from"../core/arrayUtils.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import o from"../core/ReactiveMap.js";import{watch as s,whenOnce as c,initial as l}from"../core/reactiveUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import{isIntegerField as f}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as p,getSubtypesFromLayer as m}from"../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as h}from"../popup/support/featureUtils.js";import{isString as g}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{css as y}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as b,isGroupInput as x,isFieldInput as S,isRelationshipInput as C,isTextElementInput as w,flattenInputs as T,isInputInGroupInput as E,isFieldElementWithInputType as D,getErrorMessageForFieldInput as O,getIconForFeature as k,isNumberFieldInput as A,isInputInThisGroupInput as j,subtypeChangeShouldPrompt as M}from"./FeatureForm/featureFormUtils.js";import N from"./FeatureForm/FeatureFormViewModel.js";import P from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as F}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as I,getIntlOptionsForField as L,numberingSystem as R,prepareISOFieldValueForDateComponents as z,prepareUnixFieldValueForDateComponents as B,normalizeTimeOnlyString as V,getISOFieldValueFromDateComponents as H,getUnixFieldValueFromDateComponents as U}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as G,incrementHeadingLevel as K}from"./support/Heading.js";import{messageBundle as q,vmEvent as J,tsx as Y}from"./support/widget.js";import{setFocus as X}from"./support/widgetUtils.js";const Z=`data-field-name`;let Q=class extends _{constructor(e,t){super(e,t),this._associationsWidgetsMap=new o,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay=`all`,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new N,this.visibleElements=new P,this._onShowAllRelatedRecordsClick=e=>{let{feature:t,callbacks:n}=this;t&&n?.showAllRelatedRecords&&n.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,n)=>{let{feature:r,callbacks:i}=this,a=n;if(r&&i?.addRelatedRecord){if(p(n)&&e.activeCategory){let t=e.activeCategory.value,r=n.findSublayerForSubtypeCode(t);r&&h(r)&&(a=r)}i.addRelatedRecord({parentFeature:r,relatedLayer:a,relationshipId:t})}},e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{i(a.getLogger(this),`Feature Form`,`arcgis-feature-form`,{version:`5.0`})}),this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){this.addHandles([s(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),c(()=>!this.viewModel.updating).then(()=>{let e=this._getFocusableInput(`forward`);this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),s(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},l),s(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on(`submit`,e=>{if(e.invalid.length>0){let[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),s(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),s(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),s(()=>this.viewModel.inputs.filter(b),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(let t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return F({block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),combobox:()=>import(`@esri/calcite-components/dist/components/calcite-combobox`),"combobox-item":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item`),"combobox-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item-group`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),"input-date-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-date-picker`),"input-message":()=>import(`@esri/calcite-components/dist/components/calcite-input-message`),"input-number":()=>import(`@esri/calcite-components/dist/components/calcite-input-number`),"input-time-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-picker`),"input-time-zone":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-zone`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),"radio-button":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button`),"radio-button-group":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button-group`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),"text-area":()=>import(`@esri/calcite-components/dist/components/calcite-text-area`)})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){let{callbacks:e}=this;return!!(e&&(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){let{callbacks:e}=this;return!!(e?.viewAssociatedLayers&&e.viewAssociatedFeatures)}get _subtypes(){return m(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}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 icon(){return`form-field`}set icon(e){this._overrideIfSome(`icon`,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 callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=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 timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome(`showPrompt`,e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome(`clearPrompt`,e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){let{state:e}=this.viewModel;return Y(`div`,{class:this.classes(y.base,W.widget,W.panel)},e===`ready`?this._renderForm():null)}_renderForm(){return Y(`div`,null,Y(`form`,{class:y.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?Y(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){let{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return Y(`calcite-notice`,{class:y.disabledNotice,"data-testid":`read-only-notice`,icon:`read-only-non-editable`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},t.disabledForm))}_renderHeader(){let e=this.viewModel,{formTitle:t,formDescription:n}=e;if(!e.formHeaderVisible)return;let r=t!=null&&Y(G,{key:`title`,level:this.headingLevel},t),i=n!=null&&Y(`p`,{class:y.description,key:`description`},n);return Y(`div`,{class:y.formHeader},r,i)}_renderContent(){let{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(r).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){if(x(e))return this._renderGroup(e);if(S(e))return this._renderLabeledField(e);if(C(e))return this._renderRelationshipInput(e);if(w(e))return this._renderTextElementInput(e);if(b(e))return this._renderUtilityNetworkAssociationsElementInput(e)}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){let{feature:t,callbacks:n}=this;t&&n?.viewAssociatedFeatures&&n.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){let{feature:t,callbacks:n}=this;t&&n?.selectAssociatedFeature&&await n.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){let{feature:t,callbacks:n}=this;t&&n?.addAssociation&&n.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){let e=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js`)).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){let t=(await import(`./Feature/FeatureUtilityNetworkAssociations.js`)).default;return new t({onSelectAssociationType:({viewModel:t,listType:n})=>{t.activeAssociationType=n;let{feature:r,callbacks:i}=this;r&&i?.viewAssociatedLayers&&i.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return e==null?null:Y(`div`,{class:this.classes(y.description),id:t},e)}_renderGroup(e){let{formTemplate:t,headingLevel:n}=this,{description:r,id:i,inputs:a,label:o,open:s}=e,c=a.filter(e=>e.visible),l=this.viewModel.findField(this._focusedFieldName)?.group===e,u=this.groupDisplay===`sequential`;return Y(`calcite-block`,{afterCreate:this._afterGroupCreate,class:this.classes(y.group,u?y.groupSequential:null,l?y.groupActive:null),collapsible:!0,"data-group":e,description:r||void 0,expanded:s,heading:o??``,headingLevel:t?.title?K(n):n,id:i,key:i,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},c.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){let n=T(this.viewModel.inputs);e===`backward`&&n.reverse();let r;if(!t)r=0;else if(x(t)){let e=t.inputs.find(e=>e.visible);r=e?n.indexOf(e):0}else{let i;if(E(t)&&!t.group.open){let n=t.group.inputs.filter(S);i=e===`forward`?n[n.length-1]:n[0]}else i=t;r=n.indexOf(i)+1}for(let e=r;e<n.length;e++){let t=n[e];if(t.visible&&S(t)){if(this.disabled&&t.inputType&&(t.inputType===`switch`||t.inputType===`radio-buttons`))continue;return t}}return null}_renderLabeledField(e){let{dataType:n,feature:r,label:i,layer:a,required:o}=e,s={"aria-label":o?t(this.messages.requiredFieldLabel,{name:i}):i,class:y.label,key:`${a.id}-${r.uid}-${e.name}`},c=[Y(`div`,{class:y.labelTextContent,key:`labelTextContainer`},i,o?Y(`span`,{"aria-hidden":`true`,title:this.messagesCommon.required},`*`):void 0),n===`unsupported`?this._renderReadOnlyComponent(e):this._renderFieldInput(e),this._renderAuxiliaryText(e)];return Y(`calcite-label`,{...s},c)}_renderFieldInput(e){let{dataType:t,domain:n,inputType:r,name:i}=e,a=this.getCommonInputProps(e);if(n?.type===`coded-value`){let t=this.viewModel.getFieldValueOptionsForField(i,this.messages.empty);return r===`switch`&&!e.hasInvalidSwitchValue?this._renderSwitchComponent(e,a):r===`radio-buttons`?this._renderRadioButtonComponents(e,t.flat(),a):this._renderComboBoxComponent(e,t,a)}return r===`datetime-picker`||t===`date`?this._renderDateComponents(e,a):t===`number`?this._renderNumberComponent(e,a):this._renderStringComponent(e,a)}_renderStringComponent(e,t){return e.inputType===`text-area`?t.readOnly?Y(`calcite-text-area`,{...t,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):Y(`calcite-text-area`,{...t,resize:`vertical`,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):Y(`calcite-input`,{...t,loading:e.updating,type:`text`,onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){let n=f(e.field),r=n&&t.value!==``?Math.round(parseFloat(t.value)).toString():t.value;return Y(`calcite-input-number`,{...t,integer:n,loading:e.updating,step:n?1:`any`,type:`number`,value:r,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){let{field:n}=e;switch(n.type){case`date`:return this._renderDateFieldComponents(e,t);case`date-only`:return this._renderDateOnlyFieldComponent(e,t);case`time-only`:return this._renderTimeOnlyFieldComponent(e,t);case`timestamp-offset`:return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,I(n,t.value,{timeZone:this.timeZone,...L(n)}))}}_renderDateOnlyFieldComponent(e,t){let{range:n,valid:r,value:i}=e,{class:a,key:o,readOnly:s}=t,{rawMax:c,rawMin:l}=n;return Y(`calcite-input-date-picker`,{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!r,class:a,"data-date-part":`date`,"data-field-name":t[Z],key:`${o}-date-input`,max:g(c)?c:void 0,min:g(l)?l:void 0,numberingSystem:R,overlayPositioning:`fixed`,readOnly:s,topLayerDisabled:this.topLayerDisabled,value:i==null?void 0:`${i}`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){let{valid:n,value:r}=e,{class:i,key:a,readOnly:o}=t;return Y(`calcite-input-time-picker`,{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,class:i,"data-date-part":`time`,"data-field-name":t[Z],key:`${a}-time-input`,numberingSystem:R,overlayPositioning:`fixed`,readOnly:o,step:e.timeStep,value:r==null?void 0:`${r}`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){let{name:n,range:r,timeZone:i,valid:a,value:o}=e,{class:s,key:c,readOnly:l}=t,{rawMax:u,rawMin:d}=r,f={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!a,numberingSystem:R,overlayPositioning:`fixed`,readOnly:l,[Z]:n,onfocus:this._onComponentFocus},p=z(u,i),m=z(d,i),h=z(o,i);return Y(`div`,{class:y.dateInputContainer,key:`${c}-date-time-container`},Y(`calcite-input-date-picker`,{...f,class:s,"data-date-part":`date`,key:`${c}-date-input`,max:p?.date??void 0,min:m?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:h.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),Y(`calcite-input-time-picker`,{...f,class:s,"data-date-part":`time`,key:`${c}-time-input`,step:e.timeStep,value:h.time??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?Y(`calcite-input-time-zone`,{...f,class:s,"data-date-part":`timeZone`,disabled:l,key:`${c}-timezone-input`,value:h.timeZoneOffset??`0`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){let{includeTime:n,name:r,valid:i,value:a}=e,{class:o,key:s,max:c,min:l,readOnly:u}=t,{timeZone:d}=this,f={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,numberingSystem:R,overlayPositioning:`fixed`,readOnly:u,[Z]:r,onfocus:this._onComponentFocus},p=B(a,d),m=B(c,d),h=B(l,d);return Y(`div`,{class:y.dateInputContainer,key:`${s}-date-time-container`},Y(`calcite-input-date-picker`,{...f,class:o,"data-date-part":`date`,key:`${s}-date-input`,max:m?.date??void 0,min:h?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:p.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),n?Y(`calcite-input-time-picker`,{...f,class:o,"data-date-part":`time`,key:`${s}-time-input`,step:1,value:p.time??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){let n=this.getCommonInputProps(e);return Y(`calcite-input`,{...n,class:this.classes(y.fieldInput,y.inputDisabled),readOnly:!0,type:`text`,value:t==null?n.value:`${t}`})}_renderComboBoxComponent(e,t,n){let{value:r,name:i}=e,{viewModel:a,_inputsWithChanges:o}=this,s=a.editType===`INSERT`,c=o.has(i),l=r==null&&(!s||c),u=s&&e.showNoValueOptionEnabled&&!c?()=>{}:n.onblur;return Y(`calcite-combobox`,{...n,allowCustomValues:!1,clearDisabled:!0,overlayPositioning:`fixed`,selectionMode:`single`,topLayerDisabled:this.topLayerDisabled,onblur:u,onCalciteComboboxChange:({currentTarget:t})=>{l&&t.selectedItems.length===0?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&t.selectedItems.length===0?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){let{value:n,name:r}=e,{messages:i,messagesTemplates:a,viewModel:o,_inputsWithChanges:s}=this,[c,l,u]=t.map(e=>e.map(({name:e,value:t})=>Y(`calcite-combobox-item`,{heading:e,key:`#${t}`,selected:n===t,value:`${t}`}))),d=[];l.length>0&&d.push(Y(`calcite-combobox-item-group`,{key:`other`,label:a.other},l)),u.length>0&&d.push(Y(`calcite-combobox-item-group`,{key:`unsupported`,label:i.subtypes.unsupportedDomainGroupTitle},u)),d.length>0?d.unshift(Y(`calcite-combobox-item-group`,{key:`recommended`,label:i.recommended},c)):d.push(...c);let f=o.editType===`INSERT`,p=s.has(r),m=n==null&&(!f||p);return e.showNoValueOptionEnabled&&d.unshift(Y(`calcite-combobox-item`,{heading:e.showNoValueLabel||i.empty,key:`empty-option`,selected:m,value:``})),d}_renderRadioButtonComponents(e,t,n){let{value:r}=e,i=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,value:t,selected:t===r,props:n}));if(e.showNoValueOptionEnabled){let t=e.showNoValueLabel||this.messages.empty,a=r===``||r===null;i.unshift(this._renderRadioButtonComponent({key:`empty-option`,label:t,value:``,selected:a,props:n}))}return Y(`calcite-radio-button-group`,{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:y.inputRadioGroup,"data-field-name":n[Z],key:`${n.key}-radio-group`,layout:`vertical`,name:`${n.key}-${this.id}`,required:n.required},i)}_renderSwitchComponent(e,t){let{value:n}=e,r=D(e.element,`switch`)?n===e.element.input.onValue:!1;return Y(`calcite-switch`,{...t,checked:r,class:y.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,value:t,selected:n,label:r,props:i}){return Y(`calcite-label`,{class:y.inputRadioLabel,key:e,layout:`inline`},Y(`calcite-radio-button`,{...i,afterCreate:void 0,afterUpdate:void 0,checked:n,class:y.inputRadio,disabled:i.readOnly,value:t,onblur:()=>{this._focusedFieldName=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),r)}_renderAuxiliaryText(e){let t=e.name,n=this._inputsWithChanges.has(t)&&!e.submittable?O(e,this.messages,this.timeZone):this.viewModel.contingencyConstraintViolations.get(t)==null?e.valueExpressionExecutor!=null&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null:this.messages.validationErrors.valuesIncompatible;return n==null?this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?Y(`calcite-input-message`,{icon:!0,status:`idle`},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description):Y(`calcite-input-message`,{icon:!0,status:`invalid`},n)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;let n=this.messages;return Y(`calcite-list-item`,{description:t(n.totalCount,{count:e.featureCount}),key:`show-all-related-features`,label:n.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},Y(`calcite-icon`,{icon:`list`,scale:`s`,slot:`content-end`}))}_renderAddRelatedRecordButton(e){let{canAddRelatedFeature:t,relationshipId:n,relatedLayer:r,editable:i}=e,{messages:a,callbacks:o,disabled:s}=this,c=!i||s;if(t&&o?.addRelatedRecord&&r&&!c)return Y(`calcite-button`,{alignment:`center`,appearance:`outline-fill`,class:y.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:`plus`,key:`${n}-add-button`,round:!0,scale:`s`,width:`full`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,n,r)}},e.relatedLayerIsTable?a.addRecord:a.addFeature)}_renderRelatedRecordListItem(e,t,n){let{feature:r,description:i,title:a}=e,{feature:o,callbacks:s}=this,{highlightHelper:c}=this.viewModel,l=()=>{c?.removeAll(),s?.editRelatedRecord&&o&&s.editRelatedRecord({parentFeature:o,relationshipId:t,relatedFeature:r,readOnly:n})},u=c?()=>c.add(r):void 0,d=c?()=>c.remove(r):void 0;return Y(`calcite-list-item`,{bind:this,description:i,key:`${t}-${r.uid}`,label:a,value:a,onCalciteListItemSelect:l,onmouseenter:u,onmouseleave:d},Y(`calcite-icon`,{icon:k(r),slot:`content-start`}),Y(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;let{relationshipId:t,activeCategory:n}=e,r=n?null:this._renderDescriptionOrEmpty(e.description);return Y(`calcite-label`,{class:this.classes(y.label,y.relatedRecordsLabel),key:`relationship-${t}-container`},Y(`div`,null,this._renderRelatedRecordsHeaderContainer(e),r,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){if(e.featureCount>0)return this._renderRelatedRecordsList(e);if(e.activeCategory&&e.featureCount===0)return this._renderNoRelatedRecordsNotice();if(e.allCategories?.length)return this._renderCategoryList(e);if(e.loaded)return e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e)}_renderCategoryList(e){return Y(`calcite-list`,{displayMode:`flat`,label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){let{count:r,name:i,value:a}=t,o=n(r);return Y(`calcite-list-item`,{key:`${i}-${a}`,label:i,onCalciteListItemSelect:()=>this._selectCategory(e,t)},Y(`calcite-chip`,{label:o,scale:`s`,slot:`content-end`},o),Y(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;let n=this.messages;return Y(`calcite-list-item`,{description:t(n.totalCount,{count:e.allCategories?.length??0}),key:`show-all-categories`,label:n.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},Y(`calcite-icon`,{icon:`list`,scale:`s`,slot:`content-end`}))}_renderRelatedRecordsHeaderContainer(e){let t=e.updating||!e.loaded;return Y(`div`,{class:y.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},Y(`span`,null,e.label),t?Y(`calcite-loader`,{inline:!0,key:`loader`,label:this.messagesCommon?.loading,scale:`s`,type:`indeterminate`}):void 0)}_renderRelatedRecordsList(e){let{relationshipId:t,editable:n}=e,{disabled:r}=this,i=!n||r;return Y(`calcite-list`,{class:y.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,i)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){let{messages:n}=this,r=e.relatedLayerIsTable?n.noOriginKeyRecord:n.noOriginKeyFeature,i=e.relationship?.keyField,a=this.viewModel.findField(i),o=e.layer?.fieldsIndex.get(i),s=a?.label||o?.alias||i,c=t(r,{relatedLayerName:e.relatedLayer?.title,originKeyField:s});return Y(`calcite-notice`,{icon:`information`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},c))}_renderNoRelatedRecordsNotice(){return Y(`calcite-notice`,{icon:`information`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return Y(`div`,{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:y.listObserver,key:`feature-observer`})}_renderTextElementInput(e){return Y(`div`,{class:y.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){let{disabled:t}=this,{editable:n,hint:r,label:i,maxLength:a,minLength:o,name:s,range:{max:c,min:l},required:u,valid:d,value:f}=e,p=this._inputsWithChanges.has(s),m=!n||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":d?`false`:`true`,class:this.classes(y.fieldInput,m?y.inputDisabled:null),status:p&&!d?`invalid`:`idle`,key:s,label:i,max:c??void 0,min:l??void 0,maxLength:a>-1?a:void 0,minLength:o>-1?o:void 0,placeholder:r??void 0,readOnly:m,required:u,value:f==null?``:`${f}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Z]:s}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Z))}_afterDateComponentCreate(e){let t=this._getFieldInputFromHTMLElement(e),n=e.dataset.datePart,r=this._dateComponentMap.get(t.name);if(`valueAsDate`in e&&e.value!=null&&t.value!=null){let n=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case`date`:e.value=B(t.value,this.timeZone).date??``;break;case`timestamp-offset`:e.value=z(t.value,this.timeZone).date??``;break;default:e.value=`${t.value}`}n.unobserve(e)});n.observe(e)}if(r!=null)switch(n){case`date`:r.date=e;break;case`time`:r.time=e;break;case`timeZone`:r.timeZone=e}else this._dateComponentMap.set(t.name,{[n]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){let t=this._getFieldInputFromHTMLElement(e);A(t)&&e.value!=null&&`setNumberValue`in e&&e.setNumberValue({committing:!1,value:e.value,origin:`direct`}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){let t=e.selectedItem,n=e.querySelector(`calcite-radio-button`),r=t||n;r&&this._afterComponentCreateOrUpdate(r)}_afterComponentCreateOrUpdate(e){let{viewModel:t}=this,n=this._getFieldInputFromHTMLElement(e),r=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&r===n&&(this._attemptFocusOnNextRender=!1,E(n)&&(n.group.open=!0),X(e))}async _afterGroupCreate(e){let t=this.viewModel.findGroup(e.id),n=this.viewModel.findField(this._focusedFieldName);n&&t&&j(n,t)&&(!n.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){let t=e.target,n=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=n.name}_onComponentBlur(e){let t=e.target;this._focusedFieldName=null,`readOnly`in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){let{timeZone:t}=this,n=this._getFieldInputFromHTMLElement(e),r=n.field.type,{name:i,range:a}=n,o=this._dateComponentMap.get(i);if(!o)return;let s=this.viewModel.getValue(i),c=null;r===`date-only`?c=Array.isArray(e.value)?e.value[0]:e.value:r===`time-only`?(s=V(s),c=V(e.value)):c=r===`timestamp-offset`?e.value==null?null:H({dateComponent:o.date,timeComponent:o.time,timeZoneComponent:o.timeZone,oldValue:s,defaultTimeZone:t}):e.value==null?null:U({oldValue:s,dateComponent:o.date,timeComponent:o.time,timeZone:t,max:a.max,min:a.min}),c===null||!e.value?this._updateFieldValue(i,null):s!==c&&this._updateFieldValue(i,c)}_saveValueFromComponent(e){let t=this._getFieldInputFromHTMLElement(e),n=this._parseValue(e),r=t.value;!t.isSubtypeField||!M(this.layer,r,n)?this._updateFieldValue(t.name,n):!this._pendingSubtypeChoice&&n!==r&&(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,n))}async _handleSubtypeChoice(e,n){let{value:r,name:i}=e,{messages:a,viewModel:o,messagesCommon:s,_subtypes:c}=this;if(this._updateFieldValue(i,n),!c?.length)return;let l=c.find(e=>e.code===n),u=c.find(e=>e.code===r)?.name??`${r}`;if(!l)return;let d=Promise.withResolvers();o.pendingSubtypeChoice=d;let f=`update-fields`,p=[{label:a.subtypes.useDefaultValuesOption,value:`update-fields`},{label:a.subtypes.keepCurrentValuesOption,value:`keep-existing`}],m={context:`info`,title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:l.name}),radios:p,defaultRadioSelection:`update-fields`,onRadioSelection:e=>f=e,actions:{primary:{label:s.apply,action:()=>d.resolve(f),type:`positive`},secondary:{label:s.cancel,type:`neutral`,action:()=>d.resolve(`undo`)}},cancel:()=>d.reject()};try{switch(this.showPrompt(m),await d.promise){case`update-fields`:o.applySubtypeDefaults(l),this._validateContingenciesForNonNullFields();break;case`keep-existing`:this._validateContingenciesForNonNullFields();break;case`undo`:this._updateFieldValue(e.name,r)}}finally{o.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){let n=this._getFieldInputFromHTMLElement(t);e===`Enter`&&E(n)&&!n.group.open&&(n.group.open=!0)}_updateFieldValue(e,t){let n=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e),n!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){let e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>t!=null));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){let t=this._getFieldInputFromHTMLElement(e),n=e.value;return D(t.element,`switch`)?e.checked?t.element.input.onValue:t.element.input.offValue:n==null||n===``?null:t.dataType===`number`?n===`-0`||n===`-0.`||n===`-0,`?n:parseFloat(n):t.field.type===`date`?parseFloat(n):n}_ignoreDeselectionOfNoValueOption(e){let{firstChild:t,selectedItems:n}=e;n.length===0&&t&&`selected`in t?t.selected=!0:a.getLogger(this).warnOnce(`Failed to override user attempt to deselect 'No value' option.`)}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput(`forward`,t)?.name||null,this._attemptFocusOnNextRender=!0,this.groupDisplay===`sequential`&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){e.key===`Enter`&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);let e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){this.viewModel.activeRelationshipInput?.incrementPage()}_syncGroupInputStates(){if(this.groupDisplay!==`sequential`)return;let e=this.viewModel.allGroupInputs;if(!e.length)return;let t=e.filter(e=>e.open);t.length===0?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([u()],Q.prototype,`_listObserverNode`,void 0),e([u()],Q.prototype,`_relatedRecordsEnabled`,null),e([u()],Q.prototype,`_utilityNetworkAssociationsEnabled`,null),e([u()],Q.prototype,`_prompt`,void 0),e([u()],Q.prototype,`_subtypes`,null),e([u()],Q.prototype,`associationId`,null),e([u()],Q.prototype,`associatedLayer`,null),e([u()],Q.prototype,`disabled`,null),e([u()],Q.prototype,`feature`,null),e([u()],Q.prototype,`_featureFormUNAssociationList`,void 0),e([u()],Q.prototype,`formTemplate`,null),e([u()],Q.prototype,`groupDisplay`,void 0),e([u()],Q.prototype,`headingLevel`,void 0),e([u()],Q.prototype,`icon`,null),e([u()],Q.prototype,`label`,null),e([u()],Q.prototype,`layer`,null),e([u()],Q.prototype,`map`,null),e([u(),q(`esri/widgets/FeatureForm/t9n/FeatureForm`)],Q.prototype,`messages`,void 0),e([u(),q(`esri/t9n/common`)],Q.prototype,`messagesCommon`,void 0),e([u(),q(`esri/widgets/Feature/t9n/Feature`)],Q.prototype,`messagesFeature`,void 0),e([u(),q(`esri/widgets/FeatureTemplates/t9n/FeatureTemplates`)],Q.prototype,`messagesTemplates`,void 0),e([u()],Q.prototype,`callbacks`,null),e([u()],Q.prototype,`relationshipId`,null),e([u()],Q.prototype,`spatialReference`,null),e([u()],Q.prototype,`strict`,null),e([u()],Q.prototype,`timeZone`,null),e([u()],Q.prototype,`showPrompt`,null),e([u()],Q.prototype,`clearPrompt`,null),e([u({type:N}),J([`value-change`,`submit`])],Q.prototype,`viewModel`,void 0),e([u({type:P,nonNullable:!0})],Q.prototype,`visibleElements`,void 0),e([u()],Q.prototype,`test`,null),Q=e([d(`esri.widgets.FeatureForm`)],Q);const $=Q;export{$ as default};
2
+ import{__decorate as e}from"tslib";import{substitute as t,formatNumber as n}from"../intl.js";import{isSome as r}from"../core/arrayUtils.js";import{deprecateWidget as i}from"../core/deprecate.js";import a from"../core/Logger.js";import o from"../core/ReactiveMap.js";import{watch as s,whenOnce as c,initial as l}from"../core/reactiveUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import{isIntegerField as f}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as p,getSubtypesFromLayer as m}from"../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as h}from"../popup/support/featureUtils.js";import{isString as g}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{css as y}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as b,isGroupInput as x,isFieldInput as S,isRelationshipInput as C,isTextElementInput as w,flattenInputs as T,isInputInGroupInput as E,isFieldElementWithInputType as D,getErrorMessageForFieldInput as O,getIconForFeature as k,isNumberFieldInput as A,isInputInThisGroupInput as j,subtypeChangeShouldPrompt as M}from"./FeatureForm/featureFormUtils.js";import N from"./FeatureForm/FeatureFormViewModel.js";import P from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as F}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as I,getIntlOptionsForField as L,numberingSystem as R,prepareISOFieldValueForDateComponents as z,prepareUnixFieldValueForDateComponents as B,normalizeTimeOnlyString as V,getISOFieldValueFromDateComponents as H,getUnixFieldValueFromDateComponents as U}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as G,incrementHeadingLevel as K}from"./support/Heading.js";import{messageBundle as q,vmEvent as J,tsx as Y}from"./support/widget.js";import{setFocus as X}from"./support/widgetUtils.js";const Z=`data-field-name`;let Q=class extends _{constructor(e,t){super(e,t),this._associationsWidgetsMap=new o,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay=`all`,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new N,this.visibleElements=new P,this._onShowAllRelatedRecordsClick=e=>{let{feature:t,callbacks:n}=this;t&&n?.showAllRelatedRecords&&n.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,n)=>{let{feature:r,callbacks:i}=this,a=n;if(r&&i?.addRelatedRecord){if(p(n)&&e.activeCategory){let t=e.activeCategory.value,r=n.findSublayerForSubtypeCode(t);r&&h(r)&&(a=r)}i.addRelatedRecord({parentFeature:r,relatedLayer:a,relationshipId:t})}},e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{i(a.getLogger(this),`Feature Form`,`arcgis-feature-form`,{version:`5.0`})}),this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}normalizeCtorArgs(e={}){let{suppressDeprecationWarning:t,...n}=e;return n}initialize(){this.addHandles([s(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),c(()=>!this.viewModel.updating).then(()=>{let e=this._getFocusableInput(`forward`);this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),s(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},l),s(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on(`submit`,e=>{if(e.invalid.length>0){let[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),s(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),s(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),s(()=>this.viewModel.inputs.filter(b),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(let t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return F({block:()=>import(`@esri/calcite-components/dist/components/calcite-block`),button:()=>import(`@esri/calcite-components/dist/components/calcite-button`),chip:()=>import(`@esri/calcite-components/dist/components/calcite-chip`),combobox:()=>import(`@esri/calcite-components/dist/components/calcite-combobox`),"combobox-item":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item`),"combobox-item-group":()=>import(`@esri/calcite-components/dist/components/calcite-combobox-item-group`),icon:()=>import(`@esri/calcite-components/dist/components/calcite-icon`),input:()=>import(`@esri/calcite-components/dist/components/calcite-input`),"input-date-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-date-picker`),"input-message":()=>import(`@esri/calcite-components/dist/components/calcite-input-message`),"input-number":()=>import(`@esri/calcite-components/dist/components/calcite-input-number`),"input-time-picker":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-picker`),"input-time-zone":()=>import(`@esri/calcite-components/dist/components/calcite-input-time-zone`),label:()=>import(`@esri/calcite-components/dist/components/calcite-label`),list:()=>import(`@esri/calcite-components/dist/components/calcite-list`),"list-item":()=>import(`@esri/calcite-components/dist/components/calcite-list-item`),loader:()=>import(`@esri/calcite-components/dist/components/calcite-loader`),notice:()=>import(`@esri/calcite-components/dist/components/calcite-notice`),"radio-button":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button`),"radio-button-group":()=>import(`@esri/calcite-components/dist/components/calcite-radio-button-group`),switch:()=>import(`@esri/calcite-components/dist/components/calcite-switch`),"text-area":()=>import(`@esri/calcite-components/dist/components/calcite-text-area`)})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){let{callbacks:e}=this;return!!(e&&(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){let{callbacks:e}=this;return!!(e?.viewAssociatedLayers&&e.viewAssociatedFeatures)}get _subtypes(){return m(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}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 icon(){return`form-field`}set icon(e){this._overrideIfSome(`icon`,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 callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=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 timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome(`showPrompt`,e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome(`clearPrompt`,e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){let{state:e}=this.viewModel;return Y(`div`,{class:this.classes(y.base,W.widget,W.panel)},e===`ready`?this._renderForm():null)}_renderForm(){return Y(`div`,null,Y(`form`,{class:y.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?Y(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){let{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return Y(`calcite-notice`,{class:y.disabledNotice,"data-testid":`read-only-notice`,icon:`read-only-non-editable`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},t.disabledForm))}_renderHeader(){let e=this.viewModel,{formTitle:t,formDescription:n}=e;if(!e.formHeaderVisible)return;let r=t!=null&&Y(G,{key:`title`,level:this.headingLevel},t),i=n!=null&&Y(`p`,{class:y.description,key:`description`},n);return Y(`div`,{class:y.formHeader},r,i)}_renderContent(){let{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(r).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){if(x(e))return this._renderGroup(e);if(S(e))return this._renderLabeledField(e);if(C(e))return this._renderRelationshipInput(e);if(w(e))return this._renderTextElementInput(e);if(b(e))return this._renderUtilityNetworkAssociationsElementInput(e)}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){let{feature:t,callbacks:n}=this;t&&n?.viewAssociatedFeatures&&n.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){let{feature:t,callbacks:n}=this;t&&n?.selectAssociatedFeature&&await n.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){let{feature:t,callbacks:n}=this;t&&n?.addAssociation&&n.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){let e=(await import(`./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js`)).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){let t=(await import(`./Feature/FeatureUtilityNetworkAssociations.js`)).default;return new t({onSelectAssociationType:({viewModel:t,listType:n})=>{t.activeAssociationType=n;let{feature:r,callbacks:i}=this;r&&i?.viewAssociatedLayers&&i.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return e==null?null:Y(`div`,{class:this.classes(y.description),id:t},e)}_renderGroup(e){let{formTemplate:t,headingLevel:n}=this,{description:r,id:i,inputs:a,label:o,open:s}=e,c=a.filter(e=>e.visible),l=this.viewModel.findField(this._focusedFieldName)?.group===e,u=this.groupDisplay===`sequential`;return Y(`calcite-block`,{afterCreate:this._afterGroupCreate,class:this.classes(y.group,u?y.groupSequential:null,l?y.groupActive:null),"data-group":e,description:r||void 0,expandable:!0,expanded:s,heading:o??``,headingLevel:t?.title?K(n):n,id:i,key:i,onCalciteBlockCollapse:({currentTarget:t})=>{e.open=!1,this._onGroupToggle(t,e)},onCalciteBlockExpand:({currentTarget:t})=>{e.open=!0,this._onGroupToggle(t,e)}},c.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){let n=T(this.viewModel.inputs);e===`backward`&&n.reverse();let r;if(!t)r=0;else if(x(t)){let e=t.inputs.find(e=>e.visible);r=e?n.indexOf(e):0}else{let i;if(E(t)&&!t.group.open){let n=t.group.inputs.filter(S);i=e===`forward`?n[n.length-1]:n[0]}else i=t;r=n.indexOf(i)+1}for(let e=r;e<n.length;e++){let t=n[e];if(t.visible&&S(t)){if(this.disabled&&t.inputType&&(t.inputType===`switch`||t.inputType===`radio-buttons`))continue;return t}}return null}_renderLabeledField(e){let{dataType:n,feature:r,label:i,layer:a,required:o}=e,s={"aria-label":o?t(this.messages.requiredFieldLabel,{name:i}):i,class:y.label,key:`${a.id}-${r.uid}-${e.name}`},c=[Y(`div`,{class:y.labelTextContent,key:`labelTextContainer`},i,o?Y(`span`,{"aria-hidden":`true`,title:this.messagesCommon.required},`*`):void 0),n===`unsupported`?this._renderReadOnlyComponent(e):this._renderFieldInput(e),this._renderAuxiliaryText(e)];return Y(`calcite-label`,{...s},c)}_renderFieldInput(e){let{dataType:t,domain:n,inputType:r,name:i}=e,a=this.getCommonInputProps(e);if(n?.type===`coded-value`){let t=this.viewModel.getFieldValueOptionsForField(i,this.messages.empty);return r===`switch`&&!e.hasInvalidSwitchValue?this._renderSwitchComponent(e,a):r===`radio-buttons`?this._renderRadioButtonComponents(e,t.flat(),a):this._renderComboBoxComponent(e,t,a)}return r===`datetime-picker`||t===`date`?this._renderDateComponents(e,a):t===`number`?this._renderNumberComponent(e,a):this._renderStringComponent(e,a)}_renderStringComponent(e,t){return e.inputType===`text-area`?t.readOnly?Y(`calcite-text-area`,{...t,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):Y(`calcite-text-area`,{...t,resize:`vertical`,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):Y(`calcite-input`,{...t,loading:e.updating,type:`text`,onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){let n=f(e.field),r=n&&t.value!==``?Math.round(parseFloat(t.value)).toString():t.value;return Y(`calcite-input-number`,{...t,integer:n,loading:e.updating,step:n?1:`any`,type:`number`,value:r,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){let{field:n}=e;switch(n.type){case`date`:return this._renderDateFieldComponents(e,t);case`date-only`:return this._renderDateOnlyFieldComponent(e,t);case`time-only`:return this._renderTimeOnlyFieldComponent(e,t);case`timestamp-offset`:return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,I(n,t.value,{timeZone:this.timeZone,...L(n)}))}}_renderDateOnlyFieldComponent(e,t){let{range:n,valid:r,value:i}=e,{class:a,key:o,readOnly:s}=t,{rawMax:c,rawMin:l}=n;return Y(`calcite-input-date-picker`,{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!r,class:a,"data-date-part":`date`,"data-field-name":t[Z],key:`${o}-date-input`,max:g(c)?c:void 0,min:g(l)?l:void 0,numberingSystem:R,overlayPositioning:`fixed`,readOnly:s,topLayerDisabled:this.topLayerDisabled,value:i==null?void 0:`${i}`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){let{valid:n,value:r}=e,{class:i,key:a,readOnly:o}=t;return Y(`calcite-input-time-picker`,{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,class:i,"data-date-part":`time`,"data-field-name":t[Z],key:`${a}-time-input`,numberingSystem:R,overlayPositioning:`fixed`,readOnly:o,step:e.timeStep,value:r==null?void 0:`${r}`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){let{name:n,range:r,timeZone:i,valid:a,value:o}=e,{class:s,key:c,readOnly:l}=t,{rawMax:u,rawMin:d}=r,f={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!a,numberingSystem:R,overlayPositioning:`fixed`,readOnly:l,[Z]:n,onfocus:this._onComponentFocus},p=z(u,i),m=z(d,i),h=z(o,i);return Y(`div`,{class:y.dateInputContainer,key:`${c}-date-time-container`},Y(`calcite-input-date-picker`,{...f,class:s,"data-date-part":`date`,key:`${c}-date-input`,max:p?.date??void 0,min:m?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:h.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),Y(`calcite-input-time-picker`,{...f,class:s,"data-date-part":`time`,key:`${c}-time-input`,step:e.timeStep,value:h.time??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?Y(`calcite-input-time-zone`,{...f,class:s,"data-date-part":`timeZone`,disabled:l,key:`${c}-timezone-input`,value:h.timeZoneOffset??`0`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){let{includeTime:n,name:r,valid:i,value:a}=e,{class:o,key:s,max:c,min:l,readOnly:u}=t,{timeZone:d}=this,f={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,numberingSystem:R,overlayPositioning:`fixed`,readOnly:u,[Z]:r,onfocus:this._onComponentFocus},p=B(a,d),m=B(c,d),h=B(l,d);return Y(`div`,{class:y.dateInputContainer,key:`${s}-date-time-container`},Y(`calcite-input-date-picker`,{...f,class:o,"data-date-part":`date`,key:`${s}-date-input`,max:m?.date??void 0,min:h?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:p.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),n?Y(`calcite-input-time-picker`,{...f,class:o,"data-date-part":`time`,key:`${s}-time-input`,step:1,value:p.time??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){let n=this.getCommonInputProps(e);return Y(`calcite-input`,{...n,class:this.classes(y.fieldInput,y.inputDisabled),readOnly:!0,type:`text`,value:t==null?n.value:`${t}`})}_renderComboBoxComponent(e,t,n){let{value:r,name:i}=e,{viewModel:a,_inputsWithChanges:o}=this,s=a.editType===`INSERT`,c=o.has(i),l=r==null&&(!s||c),u=s&&e.showNoValueOptionEnabled&&!c?()=>{}:n.onblur;return Y(`calcite-combobox`,{...n,allowCustomValues:!1,clearDisabled:!0,overlayPositioning:`fixed`,selectionMode:`single`,topLayerDisabled:this.topLayerDisabled,onblur:u,onCalciteComboboxChange:({currentTarget:t})=>{l&&t.selectedItems.length===0?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&t.selectedItems.length===0?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){let{value:n,name:r}=e,{messages:i,messagesTemplates:a,viewModel:o,_inputsWithChanges:s}=this,[c,l,u]=t.map(e=>e.map(({name:e,value:t})=>Y(`calcite-combobox-item`,{heading:e,key:`#${t}`,selected:n===t,value:`${t}`}))),d=[];l.length>0&&d.push(Y(`calcite-combobox-item-group`,{key:`other`,label:a.other},l)),u.length>0&&d.push(Y(`calcite-combobox-item-group`,{key:`unsupported`,label:i.subtypes.unsupportedDomainGroupTitle},u)),d.length>0?d.unshift(Y(`calcite-combobox-item-group`,{key:`recommended`,label:i.recommended},c)):d.push(...c);let f=o.editType===`INSERT`,p=s.has(r),m=n==null&&(!f||p);return e.showNoValueOptionEnabled&&d.unshift(Y(`calcite-combobox-item`,{heading:e.showNoValueLabel||i.empty,key:`empty-option`,selected:m,value:``})),d}_renderRadioButtonComponents(e,t,n){let{value:r}=e,i=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,value:t,selected:t===r,props:n}));if(e.showNoValueOptionEnabled){let t=e.showNoValueLabel||this.messages.empty,a=r===``||r===null;i.unshift(this._renderRadioButtonComponent({key:`empty-option`,label:t,value:``,selected:a,props:n}))}return Y(`calcite-radio-button-group`,{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:y.inputRadioGroup,"data-field-name":n[Z],key:`${n.key}-radio-group`,layout:`vertical`,name:`${n.key}-${this.id}`,required:n.required},i)}_renderSwitchComponent(e,t){let{value:n}=e,r=D(e.element,`switch`)?n===e.element.input.onValue:!1;return Y(`calcite-switch`,{...t,checked:r,class:y.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,value:t,selected:n,label:r,props:i}){return Y(`calcite-label`,{class:y.inputRadioLabel,key:e,layout:`inline`},Y(`calcite-radio-button`,{...i,afterCreate:void 0,afterUpdate:void 0,checked:n,class:y.inputRadio,disabled:i.readOnly,value:t,onblur:()=>{this._focusedFieldName=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),r)}_renderAuxiliaryText(e){let t=e.name,n=this._inputsWithChanges.has(t)&&!e.submittable?O(e,this.messages,this.timeZone):this.viewModel.contingencyConstraintViolations.get(t)==null?e.valueExpressionExecutor!=null&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null:this.messages.validationErrors.valuesIncompatible;return n==null?this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?Y(`calcite-input-message`,{icon:!0,status:`idle`},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description):Y(`calcite-input-message`,{icon:!0,status:`invalid`},n)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;let n=this.messages;return Y(`calcite-list-item`,{description:t(n.totalCount,{count:e.featureCount}),key:`show-all-related-features`,label:n.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},Y(`calcite-icon`,{icon:`list`,scale:`s`,slot:`content-end`}))}_renderAddRelatedRecordButton(e){let{canAddRelatedFeature:t,relationshipId:n,relatedLayer:r,editable:i}=e,{messages:a,callbacks:o,disabled:s}=this,c=!i||s;if(t&&o?.addRelatedRecord&&r&&!c)return Y(`calcite-button`,{alignment:`center`,appearance:`outline-fill`,class:y.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:`plus`,key:`${n}-add-button`,round:!0,scale:`s`,width:`full`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,n,r)}},e.relatedLayerIsTable?a.addRecord:a.addFeature)}_renderRelatedRecordListItem(e,t,n){let{feature:r,description:i,title:a}=e,{feature:o,callbacks:s}=this,{highlightHelper:c}=this.viewModel,l=()=>{c?.removeAll(),s?.editRelatedRecord&&o&&s.editRelatedRecord({parentFeature:o,relationshipId:t,relatedFeature:r,readOnly:n})},u=c?()=>c.add(r):void 0,d=c?()=>c.remove(r):void 0;return Y(`calcite-list-item`,{bind:this,description:i,key:`${t}-${r.uid}`,label:a,value:a,onCalciteListItemSelect:l,onmouseenter:u,onmouseleave:d},Y(`calcite-icon`,{icon:k(r),slot:`content-start`}),Y(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;let{relationshipId:t,activeCategory:n}=e,r=n?null:this._renderDescriptionOrEmpty(e.description);return Y(`calcite-label`,{class:this.classes(y.label,y.relatedRecordsLabel),key:`relationship-${t}-container`},Y(`div`,null,this._renderRelatedRecordsHeaderContainer(e),r,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){if(e.featureCount>0)return this._renderRelatedRecordsList(e);if(e.activeCategory&&e.featureCount===0)return this._renderNoRelatedRecordsNotice();if(e.allCategories?.length)return this._renderCategoryList(e);if(e.loaded)return e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e)}_renderCategoryList(e){return Y(`calcite-list`,{displayMode:`flat`,label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){let{count:r,name:i,value:a}=t,o=n(r);return Y(`calcite-list-item`,{key:`${i}-${a}`,label:i,onCalciteListItemSelect:()=>this._selectCategory(e,t)},Y(`calcite-chip`,{label:o,scale:`s`,slot:`content-end`},o),Y(`calcite-icon`,{flipRtl:!0,icon:`chevron-right`,scale:`s`,slot:`content-end`}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;let n=this.messages;return Y(`calcite-list-item`,{description:t(n.totalCount,{count:e.allCategories?.length??0}),key:`show-all-categories`,label:n.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},Y(`calcite-icon`,{icon:`list`,scale:`s`,slot:`content-end`}))}_renderRelatedRecordsHeaderContainer(e){let t=e.updating||!e.loaded;return Y(`div`,{class:y.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},Y(`span`,null,e.label),t?Y(`calcite-loader`,{inline:!0,key:`loader`,label:this.messagesCommon?.loading,scale:`s`,type:`indeterminate`}):void 0)}_renderRelatedRecordsList(e){let{relationshipId:t,editable:n}=e,{disabled:r}=this,i=!n||r;return Y(`calcite-list`,{class:y.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,i)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){let{messages:n}=this,r=e.relatedLayerIsTable?n.noOriginKeyRecord:n.noOriginKeyFeature,i=e.relationship?.keyField,a=this.viewModel.findField(i),o=e.layer?.fieldsIndex.get(i),s=a?.label||o?.alias||i,c=t(r,{relatedLayerName:e.relatedLayer?.title,originKeyField:s});return Y(`calcite-notice`,{icon:`information`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},c))}_renderNoRelatedRecordsNotice(){return Y(`calcite-notice`,{icon:`information`,kind:`brand`,open:!0,scale:`s`,width:`full`},Y(`div`,{slot:`message`},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return Y(`div`,{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:y.listObserver,key:`feature-observer`})}_renderTextElementInput(e){return Y(`div`,{class:y.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){let{disabled:t}=this,{editable:n,hint:r,label:i,maxLength:a,minLength:o,name:s,range:{max:c,min:l},required:u,valid:d,value:f}=e,p=this._inputsWithChanges.has(s),m=!n||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":d?`false`:`true`,class:this.classes(y.fieldInput,m?y.inputDisabled:null),status:p&&!d?`invalid`:`idle`,key:s,label:i,max:c??void 0,min:l??void 0,maxLength:a>-1?a:void 0,minLength:o>-1?o:void 0,placeholder:r??void 0,readOnly:m,required:u,value:f==null?``:`${f}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Z]:s}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Z))}_afterDateComponentCreate(e){let t=this._getFieldInputFromHTMLElement(e),n=e.dataset.datePart,r=this._dateComponentMap.get(t.name);if(`valueAsDate`in e&&e.value!=null&&t.value!=null){let n=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case`date`:e.value=B(t.value,this.timeZone).date??``;break;case`timestamp-offset`:e.value=z(t.value,this.timeZone).date??``;break;default:e.value=`${t.value}`}n.unobserve(e)});n.observe(e)}if(r!=null)switch(n){case`date`:r.date=e;break;case`time`:r.time=e;break;case`timeZone`:r.timeZone=e}else this._dateComponentMap.set(t.name,{[n]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){let t=this._getFieldInputFromHTMLElement(e);A(t)&&e.value!=null&&`setNumberValue`in e&&e.setNumberValue({committing:!1,value:e.value,origin:`direct`}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){let t=e.selectedItem,n=e.querySelector(`calcite-radio-button`),r=t||n;r&&this._afterComponentCreateOrUpdate(r)}_afterComponentCreateOrUpdate(e){let{viewModel:t}=this,n=this._getFieldInputFromHTMLElement(e),r=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&r===n&&(this._attemptFocusOnNextRender=!1,E(n)&&(n.group.open=!0),X(e))}async _afterGroupCreate(e){let t=this.viewModel.findGroup(e.id),n=this.viewModel.findField(this._focusedFieldName);n&&t&&j(n,t)&&(!n.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){let t=e.target,n=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=n.name}_onComponentBlur(e){let t=e.target;this._focusedFieldName=null,`readOnly`in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){let{timeZone:t}=this,n=this._getFieldInputFromHTMLElement(e),r=n.field.type,{name:i,range:a}=n,o=this._dateComponentMap.get(i);if(!o)return;let s=this.viewModel.getValue(i),c=null;r===`date-only`?c=Array.isArray(e.value)?e.value[0]:e.value:r===`time-only`?(s=V(s),c=V(e.value)):c=r===`timestamp-offset`?e.value==null?null:H({dateComponent:o.date,timeComponent:o.time,timeZoneComponent:o.timeZone,oldValue:s,defaultTimeZone:t}):e.value==null?null:U({oldValue:s,dateComponent:o.date,timeComponent:o.time,timeZone:t,max:a.max,min:a.min}),c===null||!e.value?this._updateFieldValue(i,null):s!==c&&this._updateFieldValue(i,c)}_saveValueFromComponent(e){let t=this._getFieldInputFromHTMLElement(e),n=this._parseValue(e),r=t.value;!t.isSubtypeField||!M(this.layer,r,n)?this._updateFieldValue(t.name,n):!this._pendingSubtypeChoice&&n!==r&&(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,n))}async _handleSubtypeChoice(e,n){let{value:r,name:i}=e,{messages:a,viewModel:o,messagesCommon:s,_subtypes:c}=this;if(this._updateFieldValue(i,n),!c?.length)return;let l=c.find(e=>e.code===n),u=c.find(e=>e.code===r)?.name??`${r}`;if(!l)return;let d=Promise.withResolvers();o.pendingSubtypeChoice=d;let f=`update-fields`,p=[{label:a.subtypes.useDefaultValuesOption,value:`update-fields`},{label:a.subtypes.keepCurrentValuesOption,value:`keep-existing`}],m={context:`info`,title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:l.name}),radios:p,defaultRadioSelection:`update-fields`,onRadioSelection:e=>f=e,actions:{primary:{label:s.apply,action:()=>d.resolve(f),type:`positive`},secondary:{label:s.cancel,type:`neutral`,action:()=>d.resolve(`undo`)}},cancel:()=>d.reject()};try{switch(this.showPrompt(m),await d.promise){case`update-fields`:o.applySubtypeDefaults(l),this._validateContingenciesForNonNullFields();break;case`keep-existing`:this._validateContingenciesForNonNullFields();break;case`undo`:this._updateFieldValue(e.name,r)}}finally{o.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){let n=this._getFieldInputFromHTMLElement(t);e===`Enter`&&E(n)&&!n.group.open&&(n.group.open=!0)}_updateFieldValue(e,t){let n=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e),n!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){let e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>t!=null));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){let t=this._getFieldInputFromHTMLElement(e),n=e.value;return D(t.element,`switch`)?e.checked?t.element.input.onValue:t.element.input.offValue:n==null||n===``?null:t.dataType===`number`?n===`-0`||n===`-0.`||n===`-0,`?n:parseFloat(n):t.field.type===`date`?parseFloat(n):n}_ignoreDeselectionOfNoValueOption(e){let{firstChild:t,selectedItems:n}=e;n.length===0&&t&&`selected`in t?t.selected=!0:a.getLogger(this).warnOnce(`Failed to override user attempt to deselect 'No value' option.`)}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput(`forward`,t)?.name||null,this._attemptFocusOnNextRender=!0,this.groupDisplay===`sequential`&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){e.key===`Enter`&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);let e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){this.viewModel.activeRelationshipInput?.incrementPage()}_syncGroupInputStates(){if(this.groupDisplay!==`sequential`)return;let e=this.viewModel.allGroupInputs;if(!e.length)return;let t=e.filter(e=>e.open);t.length===0?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([u()],Q.prototype,`_listObserverNode`,void 0),e([u()],Q.prototype,`_relatedRecordsEnabled`,null),e([u()],Q.prototype,`_utilityNetworkAssociationsEnabled`,null),e([u()],Q.prototype,`_prompt`,void 0),e([u()],Q.prototype,`_subtypes`,null),e([u()],Q.prototype,`associationId`,null),e([u()],Q.prototype,`associatedLayer`,null),e([u()],Q.prototype,`disabled`,null),e([u()],Q.prototype,`feature`,null),e([u()],Q.prototype,`_featureFormUNAssociationList`,void 0),e([u()],Q.prototype,`formTemplate`,null),e([u()],Q.prototype,`groupDisplay`,void 0),e([u()],Q.prototype,`headingLevel`,void 0),e([u()],Q.prototype,`icon`,null),e([u()],Q.prototype,`label`,null),e([u()],Q.prototype,`layer`,null),e([u()],Q.prototype,`map`,null),e([u(),q(`esri/widgets/FeatureForm/t9n/FeatureForm`)],Q.prototype,`messages`,void 0),e([u(),q(`esri/t9n/common`)],Q.prototype,`messagesCommon`,void 0),e([u(),q(`esri/widgets/Feature/t9n/Feature`)],Q.prototype,`messagesFeature`,void 0),e([u(),q(`esri/widgets/FeatureTemplates/t9n/FeatureTemplates`)],Q.prototype,`messagesTemplates`,void 0),e([u()],Q.prototype,`callbacks`,null),e([u()],Q.prototype,`relationshipId`,null),e([u()],Q.prototype,`spatialReference`,null),e([u()],Q.prototype,`strict`,null),e([u()],Q.prototype,`timeZone`,null),e([u()],Q.prototype,`showPrompt`,null),e([u()],Q.prototype,`clearPrompt`,null),e([u({type:N}),J([`value-change`,`submit`])],Q.prototype,`viewModel`,void 0),e([u({type:P,nonNullable:!0})],Q.prototype,`visibleElements`,void 0),e([u()],Q.prototype,`test`,null),Q=e([d(`esri.widgets.FeatureForm`)],Q);const $=Q;export{$ as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/ReactiveMap.js";import{renderingSanitizer as n}from"../../core/sanitizerUtils.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{isSupportedImage as a,getCalciteIconForAttachment as o}from"../Attachments/support/attachmentUtils.js";import s from"./Grid/Column.js";import{css as c}from"./Grid/ColumnCSS.js";const l=`esri-attachments-column`,u={contentContainer:`${l}__content`,showAttachmentsButton:`${l}__button`};let d=class extends s{constructor(e){super(e),this._buttonElements=new t,this._thumbnailElements=new t,this.attachmentsViewEnabled=!0,this.cellValueFormatFunction=({root:e,rowData:t})=>{let{_showAttachmentsViewEnabled:n,formatFunction:r}=this,i=this.getCellValue(t);if(r&&t){let{index:n,item:{attachments:a,feature:o,relatedRecords:s}}=t;return r({attachments:a,column:this,feature:o,index:n,relatedRecords:s,value:i,virtualIndex:this.getVirtualRowIndex(e),field:void 0})}if(!t)return i;let{index:a,item:{attachments:o,objectId:s}}=t,c=`(${i})`;if(!this.thumbnailsEnabled&&!n)return i;let l=document.createElement(`span`);l.textContent=l.title=c;let d=null;if(this.thumbnailsEnabled&&(d=this._createOrSyncThumbnails(s,o??[])),this._showAttachmentsViewEnabled){let e=document.createElement(`div`);d&&e.appendChild(d),e.appendChild(l);let t=this._createOrSyncShowAttachmentsButton(s,a);return t.appendChild(e),t}let f=document.createElement(`div`);return f.classList.add(u.contentContainer),d&&f.appendChild(d),f.appendChild(l),f},this.icon=`attachment`,this.layer=null,this.onShowAttachments=null,this.sortable=!1,this.store=null,this.textAlign=`center`,this.thumbnailAppearance=`image`,this.thumbnailCount=8,this.thumbnailIconScale=`m`,this.thumbnailsEnabled=!0}get _showAttachmentsViewEnabled(){return!!(this.attachmentsViewEnabled&&this.onShowAttachments)}get _supportsResize(){return this.store.supportsResizeAttachments}get effectiveLabel(){return n.sanitize(this.label??(this.messages?.attachments||this.fieldName))}getCellValue(e){return e?.item?.attachments?.length??0}_createOrSyncThumbnails(e,t){let n=document.createElement(`div`),r=this._thumbnailElements.get(e);return r?.length&&r.length===t.length?r.forEach(e=>n.appendChild(e)):this._thumbnailElements.set(e,this._createThumbnailElements(t,n)),n}_createOrSyncShowAttachmentsButton(e,t){let n=this._buttonElements.get(e);if(n)return n.textContent=``,n.onclick=n=>this._onShowAttachmentsClick({index:t,objectId:e,event:n}),n;let r=this.createCalciteButton({alignment:`icon-end-space-between`,className:`${u.showAttachmentsButton} ${c.contentFull}`,iconEnd:`chevron-right`,iconFlipRtl:`both`,scale:this.thumbnailIconScale,textContent:``,title:this.messages?.viewAttachments,width:`full`,onclick:n=>this._onShowAttachmentsClick({index:t,objectId:e,event:n})});return this._buttonElements.set(e,r),r}_createThumbnailAnchor({name:e,url:t},n){let r=document.createElement(`a`);return r.href=`${t}`,r.download=e,r.rel=`noreferrer`,r.target=`_blank`,r.appendChild(n),r}_createThumbnailElements(e,t){let{thumbnailAppearance:n,thumbnailCount:r,thumbnailIconScale:i}=this,s=[],c=Math.min(r,e.length),l=!this.onShowAttachments,u=n===`image`&&this.store.supportsResizeAttachments;for(let n=0;n<c;n++){let r=e[n],{name:c,contentType:d}=r,f=a(d)&&u?this._createThumbnailImage(r):this.createCalciteIcon({icon:o(d),scale:i,textLabel:c}),p=l?this._createThumbnailAnchor(r,f):f;t&&t.appendChild(p),s.push(p)}return s}_createThumbnailImage(e){let{name:t,size:n,url:r}=e,i=document.createElement(`img`),a=`${r}${r?.includes(`?`)?`&`:`?`}${this._supportsResize?`w=24`:``}&fs=${n}`;return i.alt=this.messages?.attachmentThumbnail??t,i.src=a,i.title=t,i}_onShowAttachmentsClick({index:e,objectId:t,event:n}){n.preventDefault(),n.stopPropagation(),this.onShowAttachments?.({index:e,objectId:t})}};e([r()],d.prototype,`_showAttachmentsViewEnabled`,null),e([r()],d.prototype,`_buttonElements`,void 0),e([r()],d.prototype,`_supportsResize`,null),e([r()],d.prototype,`_thumbnailElements`,void 0),e([r()],d.prototype,`attachmentsViewEnabled`,void 0),e([r()],d.prototype,`cellValueFormatFunction`,void 0),e([r()],d.prototype,`effectiveLabel`,null),e([r()],d.prototype,`icon`,void 0),e([r()],d.prototype,`layer`,void 0),e([r()],d.prototype,`onShowAttachments`,void 0),e([r({readOnly:!0})],d.prototype,`sortable`,void 0),e([r()],d.prototype,`store`,void 0),e([r()],d.prototype,`textAlign`,void 0),e([r()],d.prototype,`thumbnailAppearance`,void 0),e([r()],d.prototype,`thumbnailCount`,void 0),e([r()],d.prototype,`thumbnailIconScale`,void 0),e([r()],d.prototype,`thumbnailsEnabled`,void 0),d=e([i(`esri.widgets.FeatureTable.AttachmentsColumn`)],d);const f=d;export{f as default};
2
+ import{__decorate as e}from"tslib";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";import n from"../../core/ReactiveMap.js";import{renderingSanitizer as r}from"../../core/sanitizerUtils.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{isSupportedImage as o,getCalciteIconForAttachment as s}from"../Attachments/support/attachmentUtils.js";import c from"./Grid/Column.js";import{css as l}from"./Grid/ColumnCSS.js";const u=`esri-attachments-column`,d={contentContainer:`${u}__content`,showAttachmentsButton:`${u}__button`};let f=class extends c{constructor(e){super(e),this._buttonElements=new n,this._thumbnailElements=new n,this.attachmentsViewEnabled=!0,this.cellValueFormatFunction=({root:e,rowData:t})=>{let{_showAttachmentsViewEnabled:n,formatFunction:r}=this,i=this.getCellValue(t);if(r&&t){let{index:n,item:{attachments:a,feature:o,relatedRecords:s}}=t;return r({attachments:a,column:this,feature:o,index:n,relatedRecords:s,value:i,virtualIndex:this.getVirtualRowIndex(e),field:void 0})}if(!t)return i;let{index:a,item:{attachments:o,objectId:s}}=t,c=`(${i})`;if(!this.thumbnailsEnabled&&!n)return i;let l=document.createElement(`span`);l.textContent=l.title=c;let u=null;if(this.thumbnailsEnabled&&(u=this._createOrSyncThumbnails(s,o??[])),this._showAttachmentsViewEnabled){let e=document.createElement(`div`);u&&e.appendChild(u),e.appendChild(l);let t=this._createOrSyncShowAttachmentsButton(s,a);return t.appendChild(e),t}let f=document.createElement(`div`);return f.classList.add(d.contentContainer),u&&f.appendChild(u),f.appendChild(l),f},this.icon=`attachment`,this.layer=null,this.onShowAttachments=null,this.sortable=!1,this.store=null,this.textAlign=`center`,this.thumbnailAppearance=`image`,this.thumbnailCount=8,this.thumbnailIconScale=`m`,this.thumbnailsEnabled=!0}get _showAttachmentsViewEnabled(){return!!(this.attachmentsViewEnabled&&this.onShowAttachments)}get _supportsResize(){return this.store.supportsResizeAttachments}get effectiveLabel(){return r.sanitize(this.label??(this.messages?.attachments||this.fieldName))}getCellValue(e){return e?.item?.attachments?.length??0}_createOrSyncThumbnails(e,n){let r=document.createElement(`div`),i=t(this._thumbnailElements,e,()=>new WeakMap),a=Math.min(this.thumbnailCount,n.length);return n.slice(0,a).forEach(e=>{let t=i.get(e);t?r.appendChild(t):this._createThumbnailElement(e,i,r)}),r}_createOrSyncShowAttachmentsButton(e,t){let n=this._buttonElements.get(e);if(n)return n.textContent=``,n.onclick=n=>this._onShowAttachmentsClick({index:t,objectId:e,event:n}),n;let r=this.createCalciteButton({alignment:`icon-end-space-between`,className:`${d.showAttachmentsButton} ${l.contentFull}`,iconEnd:`chevron-right`,iconFlipRtl:`both`,scale:this.thumbnailIconScale,textContent:``,title:this.messages?.viewAttachments,width:`full`,onclick:n=>this._onShowAttachmentsClick({index:t,objectId:e,event:n})});return this._buttonElements.set(e,r),r}_createThumbnailAnchor({name:e,url:t},n){let r=document.createElement(`a`);return r.href=`${t}`,r.download=e,r.rel=`noreferrer`,r.target=`_blank`,r.appendChild(n),r}_createThumbnailElement(e,t,n){let{thumbnailAppearance:r,thumbnailIconScale:i}=this,a=!this.onShowAttachments,c=r===`image`&&this.store.supportsResizeAttachments,{name:l,contentType:u}=e,d=o(u)&&c?this._createThumbnailImage(e):this.createCalciteIcon({icon:s(u),scale:i,textLabel:l}),f=a?this._createThumbnailAnchor(e,d):d;n&&n.appendChild(f),t.set(e,f)}_createThumbnailImage(e){let{name:t,size:n,url:r}=e,i=document.createElement(`img`),a=`${r}${r?.includes(`?`)?`&`:`?`}${this._supportsResize?`w=24`:``}&fs=${n}`;return i.alt=this.messages?.attachmentThumbnail??t,i.src=a,i.title=t,i}_onShowAttachmentsClick({index:e,objectId:t,event:n}){n.preventDefault(),n.stopPropagation(),this.onShowAttachments?.({index:e,objectId:t})}};e([i()],f.prototype,`_showAttachmentsViewEnabled`,null),e([i()],f.prototype,`_buttonElements`,void 0),e([i()],f.prototype,`_supportsResize`,null),e([i()],f.prototype,`_thumbnailElements`,void 0),e([i()],f.prototype,`attachmentsViewEnabled`,void 0),e([i()],f.prototype,`cellValueFormatFunction`,void 0),e([i()],f.prototype,`effectiveLabel`,null),e([i()],f.prototype,`icon`,void 0),e([i()],f.prototype,`layer`,void 0),e([i()],f.prototype,`onShowAttachments`,void 0),e([i({readOnly:!0})],f.prototype,`sortable`,void 0),e([i()],f.prototype,`store`,void 0),e([i()],f.prototype,`textAlign`,void 0),e([i()],f.prototype,`thumbnailAppearance`,void 0),e([i()],f.prototype,`thumbnailCount`,void 0),e([i()],f.prototype,`thumbnailIconScale`,void 0),e([i()],f.prototype,`thumbnailsEnabled`,void 0),f=e([a(`esri.widgets.FeatureTable.AttachmentsColumn`)],f);const p=f;export{p as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{substitute as r}from"../../intl/substitute.js";import i from"./Grid/Column.js";import{css as a}from"./Grid/ColumnCSS.js";import{isIFeatureTableSupportedLayerWithRelationships as o,findRelationship as s}from"./support/tableUtils.js";const c={showRecordsButton:`esri-column__show-related-records-button`};let l=class extends i{constructor(e){super(e),this.flexGrow=1,this.icon=`relationship-class`,this.layer=null,this.relatedLayer=null,this.relationshipId=null,this.renderFunction=({root:e,rowData:t})=>{if(!t)return;let n=t.item,{layer:i,relatedLayer:s}=this;if(!n?.feature||!o(i)||!o(s))return;let{messages:l}=this,{index:u}=t,{feature:d,objectId:f}=n,{collapsed:p,showRelatedTableCallback:m,relationshipId:h}=this,g=n.relatedRecords?.find(e=>e.relationshipId===h)?.count??0,_=!p&&m&&l?.recordsCount?r(l.recordsCount,{count:g}):`${g}`,v=e=>{e.preventDefault(),!p&&this.showRelatedTableCallback?.({feature:d,index:u,layer:i,objectId:f,relatedLayer:s,relationshipId:h})},y=p?void 0:`chevron-right`;if(e.firstChild){let t=e.firstChild;t.textContent=_,t.onclick=v,y&&(t.iconEnd=y);return}let b=this.createCalciteButton({className:`${c.showRecordsButton} ${a.contentFull}`,iconEnd:y,iconFlipRtl:`both`,scale:`m`,textContent:_,title:_,onclick:v});this.removeCellContent(e),e.appendChild(b)},this.resizable=!0,this.showRelatedTableCallback=null,this.textAlign=`center`,this.width=`200px`}get _relationshipLabel(){return this.label||this.originRelationship?.name||this.layer.title||``}get collapsed(){return this._get(`collapsed`)||!1}set collapsed(e){e?this.set({flexGrow:0,resizable:!1,width:`80px`}):this.set({flexGrow:1,resizable:!0,width:`200px`}),this._set(`collapsed`,e)}get effectiveLabel(){return this.collapsed?``:this._relationshipLabel}get iconNode(){let{icon:e}=this;return e?this.createCalciteIcon({icon:e,textLabel:this._relationshipLabel}):null}get originRelationship(){let e=this.relationshipId;return this.relatedLayer.relationships?.find(({id:t})=>t===e)}get relationship(){return s(this.layer,this.relationshipId)}};e([t()],l.prototype,`_relationshipLabel`,null),e([t()],l.prototype,`collapsed`,null),e([t()],l.prototype,`effectiveLabel`,null),e([t()],l.prototype,`flexGrow`,void 0),e([t()],l.prototype,`icon`,void 0),e([t()],l.prototype,`iconNode`,null),e([t()],l.prototype,`layer`,void 0),e([t()],l.prototype,`originRelationship`,null),e([t()],l.prototype,`relatedLayer`,void 0),e([t()],l.prototype,`relationship`,null),e([t()],l.prototype,`relationshipId`,void 0),e([t()],l.prototype,`renderFunction`,void 0),e([t()],l.prototype,`resizable`,void 0),e([t()],l.prototype,`showRelatedTableCallback`,void 0),e([t()],l.prototype,`textAlign`,void 0),e([t()],l.prototype,`width`,void 0),l=e([n(`esri.widgets.FeatureTable.RelationshipColumn`)],l);const u=l;export{u as default};
2
+ import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{substitute as r}from"../../intl/substitute.js";import i from"./Grid/Column.js";import{css as a}from"./Grid/ColumnCSS.js";import{isIFeatureTableSupportedLayerWithRelationships as o,findRelationship as s}from"./support/tableUtils.js";const c={showRecordsButton:`esri-column__show-related-records-button`};let l=class extends i{constructor(e){super(e),this.flexGrow=1,this.icon=`relationship-class`,this.layer=null,this.relatedLayer=null,this.relationshipId=null,this.renderFunction=({root:e,rowData:t})=>{if(!t)return;let n=t.item,{layer:i,relatedLayer:s}=this;if(!n?.feature||!o(i)||!o(s))return;let{messages:l}=this,{index:u}=t,{feature:d,objectId:f}=n,{collapsed:p,showRelatedTableCallback:m,relationshipId:h}=this,g=n.relatedRecords?.find(e=>e.relationshipId===h)?.count??0,_=!p&&m&&l?.recordsCount?r(l.recordsCount,{count:g}):`${g}`,v=e=>{e.preventDefault(),!p&&this.showRelatedTableCallback?.({feature:d,index:u,layer:i,objectId:f,relatedLayer:s,relationshipId:h})},y=p?void 0:`chevron-right`;if(e.firstChild){let t=e.firstChild;t.textContent=_,t.title=_,t.onclick=v,y&&(t.iconEnd=y);return}let b=this.createCalciteButton({className:`${c.showRecordsButton} ${a.contentFull}`,iconEnd:y,iconFlipRtl:`both`,scale:`m`,textContent:_,title:_,onclick:v});this.removeCellContent(e),e.appendChild(b)},this.resizable=!0,this.showRelatedTableCallback=null,this.textAlign=`center`,this.width=`200px`}get _relationshipLabel(){return this.label||this.originRelationship?.name||this.layer.title||``}get collapsed(){return this._get(`collapsed`)||!1}set collapsed(e){e?this.set({flexGrow:0,resizable:!1,width:`80px`}):this.set({flexGrow:1,resizable:!0,width:`200px`}),this._set(`collapsed`,e)}get effectiveLabel(){return this.collapsed?``:this._relationshipLabel}get iconNode(){let{icon:e}=this;return e?this.createCalciteIcon({icon:e,textLabel:this._relationshipLabel}):null}get originRelationship(){let e=this.relationshipId;return this.relatedLayer.relationships?.find(({id:t})=>t===e)}get relationship(){return s(this.layer,this.relationshipId)}};e([t()],l.prototype,`_relationshipLabel`,null),e([t()],l.prototype,`collapsed`,null),e([t()],l.prototype,`effectiveLabel`,null),e([t()],l.prototype,`flexGrow`,void 0),e([t()],l.prototype,`icon`,void 0),e([t()],l.prototype,`iconNode`,null),e([t()],l.prototype,`layer`,void 0),e([t()],l.prototype,`originRelationship`,null),e([t()],l.prototype,`relatedLayer`,void 0),e([t()],l.prototype,`relationship`,null),e([t()],l.prototype,`relationshipId`,void 0),e([t()],l.prototype,`renderFunction`,void 0),e([t()],l.prototype,`resizable`,void 0),e([t()],l.prototype,`showRelatedTableCallback`,void 0),e([t()],l.prototype,`textAlign`,void 0),e([t()],l.prototype,`width`,void 0),l=e([n(`esri.widgets.FeatureTable.RelationshipColumn`)],l);const u=l;export{u as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import a from"../../../geometry/Point.js";import{polygonCentroidPoint as o}from"../../../geometry/support/centroid.js";import s from"../../../layers/orientedImagery/core/ExposurePoint.js";import{createFeatureCoverage as c}from"../featureCoverage.js";import{NoSequenceFoundError as l,NoImageInSequenceError as u,InvalidDirectionError as d}from"./errors.js";import{queryNextLocationFeatures as f,queryAfterSequenceField as p,querySequenceFeaturesAroundPoint as m,queryOffsetSequenceFeatures as h}from"./queries.js";import{shouldQueryAndNavigateSequentially as g,shouldQueryAndNavigate as _}from"./utils.js";let v=class extends t{constructor(e){super(e),this._navigating=!1,this.viewModel=null}get currentNode(){return this.viewModel.currentNode}get layer(){return this.viewModel.layer}get navigating(){return this._navigating}get navigationNodes(){return this.viewModel.navigationNodes}async _queryAndHandleFeatureResponse(e,t,r,i,a){let{error:o,nextLocation:s,response:c}=await f(e,t,r,i,a);if(n(a),o)throw o;this.viewModel.selectedPoint=s,await this.viewModel.processFeatureResponse(c,s,{signal:a?.signal,loadBestImage:!1})}async afterNavigate(e,t,n){return await this.viewModel.selectBestFeature(t.id,n),t}async navigate(e,t){this._navigating=!0;try{let n;if(`direction`in t?n=await this.navigateInDirection(e,t):(`step`in t||`goTo`in t)&&(n=await this.navigateInSequence(e,t)),this._navigating=!1,!n)throw Error(`No next node found`);return await this.afterNavigate(e,n,t)}catch(e){throw this._navigating=!1,e}}async navigateBySkippingSteps(e,t){let{step:n}=t,{layer:r}=this,{layerFloorFilterClause:i,layerTimeExtent:d,preloadMediaSize:f}=this.viewModel;if(!r)throw Error(`Layer is not defined`);let h=e.attributes.sequenceOrder;if(!h)throw new l;let _=n>0?e.next:e.previous;if(!g(_))return _;let{response:v,error:y}=await p(r,h,n>0?`next`:`previous`,f,i??void 0,d,{signal:t.signal});if(y)throw Error(`Error querying sequence features`);let b=v?.features[0];if(!b)throw new u(n>0?`end`:`start`);let x=s.fromJSON({...b.toJSON(),layer:r}),{polygon:S}=c(x),C=a.fromJSON(o(S)),{response:w,error:T,nextLocation:E}=await m(r,C,i??void 0,d,{signal:t.signal});if(T)throw Error(`Error querying sequence features`);let D=new Set(w.features.map(e=>e.attributes.objectId));w.features=[...v.features.filter(e=>!D.has(e.attributes.objectId)),...w.features],this.viewModel.selectedPoint=E;let O=b.attributes.objectId;await this.viewModel.processFeatureResponse(w,E,{signal:t.signal,loadBestImage:!1});let k=this.viewModel.navigationNodes.toArray();k.sort((e,t)=>{let n=e.attributes.sequenceOrder,r=t.attributes.sequenceOrder;if(!n||!r)return 0;let i=n.length;for(let e=0;e<i;e++){let{value:t,sortOrder:i}=n[e],{value:a}=r[e];if(i===`desc`){if(t<a)return 1;if(t>a)return-1}else{if(t<a)return-1;if(t>a)return 1}}return 0});let A=k.length;for(let e=0;e<A;e++){let t=k[e];t.previous=e>0?k[e-1]:null,t.next=e<A-1?k[e+1]:null}return this.viewModel.selectedPoint=E,this.viewModel.navigationNodes.find(e=>e.id===O)}async navigateInDirection(e,t){let{viewModel:n}=this,{layer:r,layerFloorFilterClause:i,layerTimeExtent:a}=n,{direction:o,signal:s}=t,c=e?.[o];if(!c)throw new d(o);return _(c,o)&&await this._queryAndHandleFeatureResponse(r,c,i??void 0,a,{signal:s}),c}async navigateInSequence(e,t){return`step`in t?this.navigateBySkippingSteps(e,t):this.navigateTo(t)}async navigateTo(e){let{goTo:t}=e,{layer:n}=this,{layerFloorFilterClause:r,layerTimeExtent:i}=this.viewModel;if(!n)throw Error(`Layer is not defined`);let l=typeof t==`number`?t:1,u=this.viewModel.navigationNodes.find(e=>e.id===l);if(u)return u;let{response:d,error:f}=await h(n,l,1,t===`end`?`DESC`:`ASC`,r??void 0,i,{signal:e.signal});if(f)throw Error(`Error querying sequence features`);let p=d?.features[0];if(!p)throw Error(`No next node found`);let g=s.fromJSON({...p.toJSON(),layer:n}),{polygon:_}=c(g),v=a.fromJSON(o(_)),{response:y,error:b,nextLocation:x}=await m(n,v,r??void 0,i,{signal:e.signal});if(b)throw Error(`Error querying sequence features`);let S=[...y.features];S.push(p),y.features=S,this.viewModel.selectedPoint=x;let C=p.attributes.objectId;return await this.viewModel.processFeatureResponse(y,x,{signal:e.signal,loadBestImage:!1}),this.viewModel.selectedPoint=x,this.viewModel.navigationNodes.find(e=>e.id===C)}};e([r()],v.prototype,`_navigating`,void 0),e([r()],v.prototype,`currentNode`,null),e([r()],v.prototype,`layer`,null),e([r()],v.prototype,`navigating`,null),e([r()],v.prototype,`navigationNodes`,null),e([r({constructOnly:!0})],v.prototype,`viewModel`,void 0),v=e([i(`esri.widgets.OrientedImageryViewer.navigation.NavigationManager`)],v);export{v as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{throwIfAborted as n}from"../../../core/promiseUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import a from"../../../geometry/Point.js";import{polygonCentroidPoint as o}from"../../../geometry/support/centroid.js";import s from"../../../layers/orientedImagery/core/ExposurePoint.js";import{createFeatureCoverage as c}from"../featureCoverage.js";import{NoSequenceFoundError as l,NoImageInSequenceError as u,InvalidDirectionError as d}from"./errors.js";import{queryNextLocationFeatures as f,queryAfterSequenceField as p,querySequenceFeaturesAroundPoint as m,queryOffsetSequenceFeatures as h}from"./queries.js";import{shouldQueryAndNavigate as g}from"./utils.js";let _=class extends t{constructor(e){super(e),this._navigating=!1,this.viewModel=null}get currentNode(){return this.viewModel.currentNode}get layer(){return this.viewModel.layer}get navigating(){return this._navigating}get navigationNodes(){return this.viewModel.navigationNodes}async _queryAndHandleFeatureResponse(e,t,r,i,a){let{error:o,nextLocation:s,response:c}=await f(e,t,r,i,a);if(n(a),o)throw o;this.viewModel.selectedPoint=s,await this.viewModel.processFeatureResponse(c,s,{signal:a?.signal,loadBestImage:!1})}async afterNavigate(e,t,n){return await this.viewModel.selectBestFeature(t.id,n),t}async navigate(e,t){this._navigating=!0;try{let n;if(`direction`in t?n=await this.navigateInDirection(e,t):(`step`in t||`goTo`in t)&&(n=await this.navigateInSequence(e,t)),this._navigating=!1,!n)throw Error(`No next node found`);return await this.afterNavigate(e,n,t)}catch(e){throw this._navigating=!1,e}}async navigateBySkippingSteps(e,t){let{step:n}=t,{layer:r}=this,{layerFloorFilterClause:i,layerTimeExtent:d,preloadMediaSize:f}=this.viewModel;if(!r)throw Error(`Layer is not defined`);let h=e.attributes.sequenceOrder;if(!h)throw new l;let{response:g,error:_}=await p(r,h,n>0?`next`:`previous`,f,i??void 0,d,{signal:t.signal});if(_)throw Error(`Error querying sequence features`);let v=g?.features[0];if(!v)throw new u(n>0?`end`:`start`);let y=s.fromJSON({...v.toJSON(),layer:r}),{polygon:b}=c(y),x=a.fromJSON(o(b)),{response:S,error:C,nextLocation:w}=await m(r,x,i??void 0,d,{signal:t.signal});if(C)throw Error(`Error querying sequence features`);let T=new Set(S.features.map(e=>e.attributes.objectId));S.features=[...g.features.filter(e=>!T.has(e.attributes.objectId)),...S.features],this.viewModel.selectedPoint=w;let E=v.attributes.objectId;await this.viewModel.processFeatureResponse(S,w,{signal:t.signal,loadBestImage:!1});let D=this.viewModel.navigationNodes.toArray();D.sort((e,t)=>{let n=e.attributes.sequenceOrder,r=t.attributes.sequenceOrder;if(!n||!r)return 0;let i=n.length;for(let e=0;e<i;e++){let{value:t,sortOrder:i}=n[e],{value:a}=r[e];if(i===`desc`){if(t<a)return 1;if(t>a)return-1}else{if(t<a)return-1;if(t>a)return 1}}return 0});let O=D.length;for(let e=0;e<O;e++){let t=D[e];t.previous=e>0?D[e-1]:null,t.next=e<O-1?D[e+1]:null}return this.viewModel.selectedPoint=w,this.viewModel.navigationNodes.find(e=>e.id===E)}async navigateInDirection(e,t){let{viewModel:n}=this,{layer:r,layerFloorFilterClause:i,layerTimeExtent:a}=n,{direction:o,signal:s}=t,c=e?.[o];if(!c)throw new d(o);return g(c,o)&&await this._queryAndHandleFeatureResponse(r,c,i??void 0,a,{signal:s}),c}async navigateInSequence(e,t){return`step`in t?this.navigateBySkippingSteps(e,t):this.navigateTo(t)}async navigateTo(e){let{goTo:t}=e,{layer:n}=this,{layerFloorFilterClause:r,layerTimeExtent:i}=this.viewModel;if(!n)throw Error(`Layer is not defined`);let l=typeof t==`number`?t:1,u=this.viewModel.navigationNodes.find(e=>e.id===l);if(u)return u;let{response:d,error:f}=await h(n,l,1,t===`end`?`DESC`:`ASC`,r??void 0,i,{signal:e.signal});if(f)throw Error(`Error querying sequence features`);let p=d?.features[0];if(!p)throw Error(`No next node found`);let g=s.fromJSON({...p.toJSON(),layer:n}),{polygon:_}=c(g),v=a.fromJSON(o(_)),{response:y,error:b,nextLocation:x}=await m(n,v,r??void 0,i,{signal:e.signal});if(b)throw Error(`Error querying sequence features`);let S=[...y.features];S.push(p),y.features=S,this.viewModel.selectedPoint=x;let C=p.attributes.objectId;return await this.viewModel.processFeatureResponse(y,x,{signal:e.signal,loadBestImage:!1}),this.viewModel.selectedPoint=x,this.viewModel.navigationNodes.find(e=>e.id===C)}};e([r()],_.prototype,`_navigating`,void 0),e([r()],_.prototype,`currentNode`,null),e([r()],_.prototype,`layer`,null),e([r()],_.prototype,`navigating`,null),e([r()],_.prototype,`navigationNodes`,null),e([r({constructOnly:!0})],_.prototype,`viewModel`,void 0),_=e([i(`esri.widgets.OrientedImageryViewer.navigation.NavigationManager`)],_);export{_ as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{sqlAnd as e}from"../../../core/sql.js";import t from"../../../geometry/Point.js";import n from"../../../geometry/SpatialReference.js";import{polygonCentroidPoint as r}from"../../../geometry/support/centroid.js";import{searchImages as i}from"../../../layers/orientedImagery/queries.js";import{createFeatureCoverage as a}from"../featureCoverage.js";import{constructWhereClauseForSequenceFields as o}from"./utils.js";function s(e){return e.effectiveSequenceOrderField?.[0]?.fieldName??null}function c(e){let t=s(e);return t?`${t} IS NOT NULL`:null}async function l(e,n,o,s,c){let{polygon:l}=a(n.attributes),u=t.fromJSON(r(l));u.z=void 0;let d=_(e.definitionExpression,o),f,p;try{f=await i({layerInstanceOrURL:e,point:u,queryParams:{where:d,timeExtent:s}},c)}catch(e){p=e}return new h(u,f,p)}async function u(e,t,n,r,a){let o=e.effectiveSequenceOrderField?.map(({fieldName:e,sortOrder:t})=>`${e} ${t===`desc`?`DESC`:`ASC`}`),s=_(e.definitionExpression,n),c,l;try{c=await i({layerInstanceOrURL:e,point:t,queryParams:{where:s,orderByFields:o,returnGeometry:!0,outFields:[`*`],timeExtent:r}},a)}catch(e){l=e}return new h(t,c,l)}async function d(t,r,i,a=`ASC`,o,l,u){let d=s(t),f=_(t.definitionExpression,o,c(t)),p=typeof r==`number`?r-1:void 0;r===`string`&&d&&(f=e(f,`${d} = ${r}`));let h=t.createQuery();h.where=f,h.start=p,h.num=i,h.timeExtent=l,h.orderByFields=d?[`${d} ${a}`]:void 0,t.spatialReference.isGeographic&&(h.outSpatialReference=n.WebMercator);try{let e=await t.queryFeatures(h,u);return await g(e,t),new m(e)}catch(e){return new m(void 0,e)}}async function f(e,t,r,i=1,a,s,c){let l=e.effectiveSequenceOrderField?.map(({fieldName:e,sortOrder:t})=>`${e} ${t===`desc`?`DESC`:`ASC`}`),u=_(e.definitionExpression,a,o(t,r,e.fields)),d=e.createQuery();d.where=u,d.num=i,d.orderByFields=l,d.timeExtent=s,e.spatialReference.isGeographic&&(d.outSpatialReference=n.WebMercator);try{let t=await e.queryFeatures(d,c);return await g(t,e),new m(t)}catch(e){return new m(void 0,e)}}async function p(e,t,r,i,a){let o=Array.isArray(t)?t:[t],s=_(e.definitionExpression,r,`${e.objectIdField} IN (${o.join(`,`)})`),c=e.createQuery();c.where=s,c.returnZ=e.hasZ,e.spatialReference.isGeographic&&(c.outSpatialReference=n.WebMercator),i&&(c.timeExtent=i);try{let t=await e.queryFeatures(c,a);return await g(t,e),new m(t)}catch(e){return new m(void 0,e)}}class m{constructor(e,t){this.response=e,this.error=t}}class h{constructor(e,t,n){this.nextLocation=e,this.response=t,this.error=n}}async function g(e,t){let n=await import(`../../../layers/orientedImagery/core/ExposurePoint.js`).then(e=>e.default);e.features.forEach(e=>{let r=n.fromJSON({...e.toJSON(),layer:t});r&&(e.attributes=r)})}function _(...t){let n=`1=1`;return t.forEach(t=>{n=e(n,t)}),n}export{h as QueryNextLocationFeaturesResponse,m as QueryOrientedImageryFeaturesResponse,_ as mergeSQLstatements,f as queryAfterSequenceField,p as queryFeatureByObjectIds,l as queryNextLocationFeatures,d as queryOffsetSequenceFeatures,u as querySequenceFeaturesAroundPoint};
2
+ import{sqlAnd as e}from"../../../core/sql.js";import t from"../../../geometry/Point.js";import n from"../../../geometry/SpatialReference.js";import{polygonCentroidPoint as r}from"../../../geometry/support/centroid.js";import{searchImages as i}from"../../../layers/orientedImagery/queries.js";import{createFeatureCoverage as a}from"../featureCoverage.js";import{constructWhereClauseForSequenceFields as o}from"./utils.js";function s(e){return e.effectiveSequenceOrderField?.[0]?.fieldName??null}function c(e){let t=s(e);return t?`${t} IS NOT NULL`:null}async function l(e,n,o,s,c){let{polygon:l}=a(n.attributes),u=t.fromJSON(r(l));u.z=void 0;let d=_(e.definitionExpression,o),f,p;try{f=await i({layerInstanceOrURL:e,point:u,queryParams:{where:d,timeExtent:s}},c)}catch(e){p=e}return new h(u,f,p)}async function u(e,t,n,r,a){let o=e.effectiveSequenceOrderField?.map(({fieldName:e,sortOrder:t})=>`${e} ${t===`desc`?`DESC`:`ASC`}`),s=_(e.definitionExpression,n),c,l;try{c=await i({layerInstanceOrURL:e,point:t,queryParams:{where:s,orderByFields:o,returnGeometry:!0,outFields:[`*`],timeExtent:r}},a)}catch(e){l=e}return new h(t,c,l)}async function d(t,r,i,a=`ASC`,o,l,u){let d=s(t),f=_(t.definitionExpression,o,c(t)),p=typeof r==`number`?r-1:void 0;r===`string`&&d&&(f=e(f,`${d} = ${r}`));let h=t.createQuery();h.where=f,h.start=p,h.num=i,h.timeExtent=l,h.orderByFields=d?[`${d} ${a}`]:void 0,t.spatialReference.isGeographic&&(h.outSpatialReference=n.WebMercator);try{let e=await t.queryFeatures(h,u);return await g(e,t),new m(e)}catch(e){return new m(void 0,e)}}async function f(e,t,r,i=1,a,s,c){let l=e.effectiveSequenceOrderField?.map(({fieldName:e,sortOrder:t})=>{let n=t===`desc`;return`${e} ${(r===`previous`?!n:n)?`DESC`:`ASC`}`}),u=_(e.definitionExpression,a,o(t,r,e.fields)),d=e.createQuery();d.where=u,d.num=i,d.orderByFields=l,d.timeExtent=s,e.spatialReference.isGeographic&&(d.outSpatialReference=n.WebMercator);try{let t=await e.queryFeatures(d,c);return await g(t,e),new m(t)}catch(e){return new m(void 0,e)}}async function p(e,t,r,i,a){let o=Array.isArray(t)?t:[t],s=_(e.definitionExpression,r,`${e.objectIdField} IN (${o.join(`,`)})`),c=e.createQuery();c.where=s,c.returnZ=e.hasZ,e.spatialReference.isGeographic&&(c.outSpatialReference=n.WebMercator),i&&(c.timeExtent=i);try{let t=await e.queryFeatures(c,a);return await g(t,e),new m(t)}catch(e){return new m(void 0,e)}}class m{constructor(e,t){this.response=e,this.error=t}}class h{constructor(e,t,n){this.nextLocation=e,this.response=t,this.error=n}}async function g(e,t){let n=await import(`../../../layers/orientedImagery/core/ExposurePoint.js`).then(e=>e.default);e.features.forEach(e=>{let r=n.fromJSON({...e.toJSON(),layer:t});r&&(e.attributes=r)})}function _(...t){let n=`1=1`;return t.forEach(t=>{n=e(n,t)}),n}export{h as QueryNextLocationFeaturesResponse,m as QueryOrientedImageryFeaturesResponse,_ as mergeSQLstatements,f as queryAfterSequenceField,p as queryFeatureByObjectIds,l as queryNextLocationFeatures,d as queryOffsetSequenceFeatures,u as querySequenceFeaturesAroundPoint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{sqlLiteral as e}from"../../../core/sql.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import n from"../../../geometry/Extent.js";import{getWebMercatorScalingFactor as r}from"../../../layers/orientedImagery/transformations/utils.js";import{clockwiseDirections as i}from"../constants.js";function a(e,i){let{x:a,y:o,spatialReference:s}=e,c=r(o,s),l=t(s),u=i*c/l,d=a-u,f=a+u,p=o-u,m=o+u;return new n({xmin:d,xmax:f,ymin:p,ymax:m,spatialReference:e.spatialReference})}function o(e){return!e||e.previous===null||e.next===null}function s(e,t,n=1){if(e[t]==null)return!0;let r=e=>e?i.reduce((t,n)=>e[n]?t+1:t,0):0,a=new Set,o=[{node:e,depth:0}];for(;o.length;){let{node:e,depth:t}=o.shift();if(e&&!a.has(e)){if(a.add(e),r(e)<2)return!0;if(t<n)for(let n of i){let r=e[n];r&&!a.has(r)&&o.push({node:r,depth:t+1})}}}return!1}function c(e,t,n){if(!e)return`1=1`;switch(t){case`next`:return d(e,`next`,n);case`previous`:return d(e,`previous`,n);default:return`1=1`}}function l(e){return e!=null}function u(t,n,r){let i=r?.find(e=>e.name===t)?.type;return i===`date`||i===`string`?e(n,null,{type:i}):n}function d(e,t,n){return e.map((r,i)=>{let a=e.slice(0,i).map(e=>l(e?.value)?`(${e.fieldName} = ${u(e.fieldName,e.value,n)})`:null).filter(Boolean).join(` AND `),o=r.sortOrder===`asc`?t===`next`?`>`:`<`:t===`next`?`<`:`>`,s=[a,l(r?.value)?`(${r.fieldName} ${o} ${u(r.fieldName,r.value,n)})`:null].filter(Boolean);return s.length>1?`(${s.join(` AND `)})`:s.join(` AND `)}).filter(Boolean).join(` OR `)}export{c as constructWhereClauseForSequenceFields,a as createExtentAroundPoint,s as shouldQueryAndNavigate,o as shouldQueryAndNavigateSequentially};
2
+ import{sqlLiteral as e}from"../../../core/sql.js";import{getMetersPerUnitForSR as t}from"../../../core/units.js";import n from"../../../geometry/Extent.js";import{getWebMercatorScalingFactor as r}from"../../../layers/orientedImagery/transformations/utils.js";import{clockwiseDirections as i}from"../constants.js";function a(e,i){let{x:a,y:o,spatialReference:s}=e,c=r(o,s),l=t(s),u=i*c/l,d=a-u,f=a+u,p=o-u,m=o+u;return new n({xmin:d,xmax:f,ymin:p,ymax:m,spatialReference:e.spatialReference})}function o(e,t,n=1){if(e[t]==null)return!0;let r=e=>e?i.reduce((t,n)=>e[n]?t+1:t,0):0,a=new Set,o=[{node:e,depth:0}];for(;o.length;){let{node:e,depth:t}=o.shift();if(e&&!a.has(e)){if(a.add(e),r(e)<2)return!0;if(t<n)for(let n of i){let r=e[n];r&&!a.has(r)&&o.push({node:r,depth:t+1})}}}return!1}function s(e,t,n){if(!e)return`1=1`;switch(t){case`next`:return u(e,`next`,n);case`previous`:return u(e,`previous`,n);default:return`1=1`}}function c(e){return e!=null}function l(t,n,r){let i=r?.find(e=>e.name===t)?.type;return i===`date`||i===`string`?e(n,null,{type:i}):n}function u(e,t,n){return e.map((r,i)=>{let a=e.slice(0,i).map(e=>c(e?.value)?`(${e.fieldName} = ${l(e.fieldName,e.value,n)})`:null).filter(Boolean).join(` AND `),o=r.sortOrder===`asc`?t===`next`?`>`:`<`:t===`next`?`<`:`>`,s=[a,c(r?.value)?`(${r.fieldName} ${o} ${l(r.fieldName,r.value,n)})`:null].filter(Boolean);return s.length>1?`(${s.join(` AND `)})`:s.join(` AND `)}).filter(Boolean).join(` OR `)}export{s as constructWhereClauseForSequenceFields,a as createExtentAroundPoint,o as shouldQueryAndNavigate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../core/Logger.js";import{getMetersPerUnitOfSR as t}from"../../layers/orientedImagery/core/utils.js";import{sectorsRadii as n}from"./constants.js";import r from"./support/NonPanoramicMedia.js";import i from"../PanoramicViewer/support/PanoramicMedia.js";function a(e){return e?.type===`3d`}function o(e){return e?.declaredClass===`esri.Graphic`}function s(e){return/(tiff|tif|mrf)$/i.test(e??``)}function c(e){if(!e||!URL.canParse(e))return!1;let{pathname:t}=new URL(e);return/.*\.(tiff|tif|mrf|dm)$/i.test(t??``)}function l(e){if(!e||!URL.canParse(e))return!1;let{pathname:t}=new URL(e);return/.*\.(tiff|tif|mrf)$/i.test(t??``)}function u(e){return Math.abs(e)>=135?`WEST`:e<-45&&e>-135?`SOUTH`:e<=45?`EAST`:`NORTH`}function d(e,t){let r=e/t*n[2];return r<=n[0]?`NEAR`:r<=n[1]?``:`FAR`}const f=e=>t=>t.layer===e;function p(e){return e?.name===`NoAttachmentError`}const m=e=>`${e}:missing-property`,h=(e,t)=>`Property ${t} is missing in ${e}`,g=(t=`esri.widgets.OrientedImageryViewer`,n)=>{throw e.getLogger(t).error(n),n};function _(e,t){t&&e.forEach(e=>{e.elevationSample=t})}function v(e){return new i(e)}function y(e){return new r(e)}function b(e,t,n){return n?e.filter(({attributes:e})=>Math.abs((e.location.z??0)-(t.z??0))<n):e}function x(e,n=e.location){return e.elevation??(n.z??0)-e.cameraHeight/t(n.spatialReference)}function S(e){return!!e&&e.declaredClass===`esri.widgets.PanoramicViewer.support.PanoramicMedia`}function C(e){if(!S(e))return;let{horizonPitch:t,horizonRoll:n,horizonYaw:r}=e;return[t,n,r]}function w(e){return e?.datasetFormat===`TIFF`}export{_ as assignElevationSampleToFeatures,u as calculateDirection,d as calculateSegment,y as createNonPanoramicMedia,v as createPanoramicMedia,C as extractHorizonAnglesFromMedia,b as filterByZ,f as filterOILLayerView,x as getCameraGroundElevation,h as getMissingPropertyErrorMessage,m as getMissingPropertyErrorName,c as isDepthImage,o as isGraphic,p as isNoAttachmentError,S as isPanoramicMedia,a as isSceneView,l as isTifOrMrf,w as isTiffRaster,g as logAndThrow,s as validateTifOrMrfExtension};
2
+ import e from"../../core/Logger.js";import{getMetersPerUnitOfSR as t}from"../../layers/orientedImagery/core/utils.js";import{sectorsRadii as n}from"./constants.js";import r from"./support/NonPanoramicMedia.js";import i from"../PanoramicViewer/support/PanoramicMedia.js";function a(e){return e?.type===`3d`}function o(e){return e?.declaredClass===`esri.Graphic`}function s(e){return/(tiff|tif|mrf)$/i.test(e??``)}function c(e){if(!e||!URL.canParse(e))return!1;let{pathname:t}=new URL(e);return/.*\.(tiff|tif|mrf|dm)$/i.test(t??``)}function l(e){if(!e||!URL.canParse(e))return!1;let{pathname:t}=new URL(e);return/.*\.(tiff|tif|mrf)$/i.test(t??``)}function u(e){return Math.abs(e)>=135?`WEST`:e<-45&&e>-135?`SOUTH`:e<=45?`EAST`:`NORTH`}function d(e,t){let r=e/t*n[2];return r<=n[0]?`NEAR`:r<=n[1]?``:`FAR`}const f=e=>t=>t.layer===e;function p(e){return e?.name===`NoAttachmentError`}const m=e=>`${e}:missing-property`,h=(e,t)=>`Property ${t} is missing in ${e}`,g=(t=`esri.widgets.OrientedImageryViewer`,n)=>{throw e.getLogger(t).error(n),n};function _(e,t){t&&e.forEach(e=>{e.elevationSample=t})}function v(e){return new i(e)}function y(e){return new r(e)}function b(e,t,n){return n?e.filter(({attributes:e})=>Math.abs((e.location.z??0)-(t.z??0))<n):e}function x(e,n=e.location){return(n.z??0)-e.cameraHeight/t(n.spatialReference)}function S(e){return!!e&&e.declaredClass===`esri.widgets.PanoramicViewer.support.PanoramicMedia`}function C(e){if(!S(e))return;let{horizonPitch:t,horizonRoll:n,horizonYaw:r}=e;return[t,n,r]}function w(e){return e?.datasetFormat===`TIFF`}export{_ as assignElevationSampleToFeatures,u as calculateDirection,d as calculateSegment,y as createNonPanoramicMedia,v as createPanoramicMedia,C as extractHorizonAnglesFromMedia,b as filterByZ,f as filterOILLayerView,x as getCameraGroundElevation,h as getMissingPropertyErrorMessage,m as getMissingPropertyErrorName,c as isDepthImage,o as isGraphic,p as isNoAttachmentError,S as isPanoramicMedia,a as isSceneView,l as isTifOrMrf,w as isTiffRaster,g as logAndThrow,s as validateTifOrMrfExtension};