@arcgis/core 4.24.0 → 4.24.1

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 (59) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{aa14e999e03ccb770455.js → dd51b8f77fd9472c2e54.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{6a02a75e935af0fc2b2b.js → de5c5c216a804becdaf6.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{e5c8584ae764892c324d.js → ed1bb19480397d388fe9.js} +1 -1
  5. package/assets/esri/themes/base/widgets/_SnappingControls.scss +4 -0
  6. package/assets/esri/themes/dark/main.css +1 -1
  7. package/assets/esri/themes/light/main.css +1 -1
  8. package/assets/esri/themes/light/view.css +1 -1
  9. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ar.json +1 -1
  10. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bg.json +1 -1
  11. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bs.json +1 -1
  12. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ca.json +1 -1
  13. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_cs.json +1 -1
  14. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_da.json +1 -1
  15. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_de.json +1 -1
  16. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_el.json +1 -1
  17. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_es.json +1 -1
  18. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_et.json +1 -1
  19. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fi.json +1 -1
  20. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fr.json +1 -1
  21. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_he.json +1 -1
  22. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hr.json +1 -1
  23. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hu.json +1 -1
  24. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_id.json +1 -1
  25. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_it.json +1 -1
  26. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ja.json +1 -1
  27. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ko.json +1 -1
  28. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lt.json +1 -1
  29. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lv.json +1 -1
  30. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nb.json +1 -1
  31. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nl.json +1 -1
  32. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pl.json +1 -1
  33. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-BR.json +1 -1
  34. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-PT.json +1 -1
  35. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ro.json +1 -1
  36. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ru.json +1 -1
  37. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sk.json +1 -1
  38. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sl.json +1 -1
  39. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sr.json +1 -1
  40. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sv.json +1 -1
  41. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_th.json +1 -1
  42. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_tr.json +1 -1
  43. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_uk.json +1 -1
  44. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_vi.json +1 -1
  45. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-CN.json +1 -1
  46. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-HK.json +1 -1
  47. package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-TW.json +1 -1
  48. package/config.js +1 -1
  49. package/package.json +1 -1
  50. package/support/revision.js +1 -1
  51. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  52. package/views/3d/terrain/TileCompositor.js +1 -1
  53. package/views/webgl/context-util.js +1 -1
  54. package/widgets/Editor/UpdateWorkflow.js +1 -1
  55. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  56. package/widgets/FeatureForm/InputField.js +1 -1
  57. package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
  58. package/widgets/support/SnappingControls/SnappingLayerListViewModel.js +1 -1
  59. package/widgets/support/SnappingControls/SnappingListItem.js +1 -1
@@ -1 +1 @@
1
- {"widgetLabel":"تبديل خريطة الأساس","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"تبديل خريطة الأساس","incompatibleSpatialReference":"تحتوي خريطة الأساس هذه على إسناد مكاني غير متوافق"}
@@ -1 +1 @@
1
- {"widgetLabel":"Превключване на базова карта","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Превключване на базова карта","incompatibleSpatialReference":"Тази базова карта има несъвместима пространствена препратка"}
@@ -1 +1 @@
1
- {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"Ova kartografska podloga sadrži nekompatibilnu prostornu referencu"}
@@ -1 +1 @@
1
- {"widgetLabel":"Activa o desactiva el mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Activa o desactiva el mapa base","incompatibleSpatialReference":"Aquest mapa de base té una referència espacial no compatible"}
@@ -1 +1 @@
1
- {"widgetLabel":"Přepnout podkladovou mapu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Přepnout podkladovou mapu","incompatibleSpatialReference":"Podkladová mapa nemá kompatibilní souřadnicový systém."}
@@ -1 +1 @@
1
- {"widgetLabel":"Skift baggrundskort","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Skift baggrundskort","incompatibleSpatialReference":"Dette baggrundskortet har en inkompatibel spatial reference"}
@@ -1 +1 @@
1
- {"widgetLabel":"Grundkarte wechseln","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Grundkarte wechseln","incompatibleSpatialReference":"Diese Grundkarte weist einen nicht kompatiblen Raumbezug auf."}
@@ -1 +1 @@
1
- {"widgetLabel":"Εναλλαγή υποβάθρου","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Εναλλαγή υποβάθρου","incompatibleSpatialReference":"Αυτός ο βασικός χάρτης έχει μια μη συμβατή χωρική αναφορά"}
@@ -1 +1 @@
1
- {"widgetLabel":"Cambiar el mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Cambiar el mapa base","incompatibleSpatialReference":"Este mapa base tiene una referencia espacial incompatible"}
@@ -1 +1 @@
1
- {"widgetLabel":"Vaheta aluskaarti","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Vaheta aluskaarti","incompatibleSpatialReference":"Aluskaardil on ühildumatu koordinaatsüsteem"}
@@ -1 +1 @@
1
- {"widgetLabel":"Vaihda taustakarttaa","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Vaihda taustakarttaa","incompatibleSpatialReference":"Tässä taustakartassa on yhteensopimaton koordinaatistotieto"}
@@ -1 +1 @@
1
- {"widgetLabel":"Basculer le fond de carte","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Basculer le fond de carte","incompatibleSpatialReference":"Ce fond de carte possède une référence spatiale incompatible"}
@@ -1 +1 @@
1
- {"widgetLabel":"הדלק או כבה מפת בסיס","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"הדלק או כבה מפת בסיס","incompatibleSpatialReference":"למפת בסיס זו יש ייחוס מרחבי לא תואם"}
@@ -1 +1 @@
1
- {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Prebaci kartografsku podlogu","incompatibleSpatialReference":"Ova kartografska podloga sadrži nekompatibilnu prostornu referencu"}
@@ -1 +1 @@
1
- {"widgetLabel":"Alaptérkép átváltása","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Alaptérkép átváltása","incompatibleSpatialReference":"Ez az alaptérkép egy nem kompatibilis térbeli referenciával rendelkezik"}
@@ -1 +1 @@
1
- {"widgetLabel":"Nyalakan/Matikan peta dasar","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Nyalakan/Matikan peta dasar","incompatibleSpatialReference":"Peta dasar ini memiliki referensi spasial yang tidak kompatibel"}
@@ -1 +1 @@
1
- {"widgetLabel":"Attiva/disattiva mappa di base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Attiva/disattiva mappa di base","incompatibleSpatialReference":"Questa mappa di base ha un riferimento spaziale incompatibile"}
@@ -1 +1 @@
1
- {"widgetLabel":"ベースマップの切り替え","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"ベースマップの切り替え","incompatibleSpatialReference":"このベースマップの空間参照は互換性がありません"}
@@ -1 +1 @@
1
- {"widgetLabel":"베이스맵 토글","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"베이스맵 토글","incompatibleSpatialReference":"이 베이스맵에 호환되지 않는 공간 기준 체계가 있습니다."}
@@ -1 +1 @@
1
- {"widgetLabel":"Perjungti pagrindo žemėlapį","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Perjungti pagrindo žemėlapį","incompatibleSpatialReference":"Šis pagrindo žemėlapis turi nesuderinamą erdvinę nuorodą"}
@@ -1 +1 @@
1
- {"widgetLabel":"Pārslēgt pamatkarti","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Pārslēgt pamatkarti","incompatibleSpatialReference":"Šai pamatkartei ir nesaderīga telpiskā atskaite"}
@@ -1 +1 @@
1
- {"widgetLabel":"Veksle mellom bakgrunnskart","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Veksle mellom bakgrunnskart","incompatibleSpatialReference":"Dette bakgrunnskartet har en inkompatibel romlig referanse"}
@@ -1 +1 @@
1
- {"widgetLabel":"Basiskaart in- en uitschakelen","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Basiskaart in- en uitschakelen","incompatibleSpatialReference":"Deze basiskaart heeft een incompatibele ruimtelijke referentie"}
@@ -1 +1 @@
1
- {"widgetLabel":"Przełącz mapę bazową","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Przełącz mapę bazową","incompatibleSpatialReference":"Ta mapa bazowa ma niezgodne odniesienie przestrzenne"}
@@ -1 +1 @@
1
- {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"Este mapa base tem uma referência espacial incompatível"}
@@ -1 +1 @@
1
- {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Alternar mapa base","incompatibleSpatialReference":"Este mapa base contém uma referência espacial incompatível"}
@@ -1 +1 @@
1
- {"widgetLabel":"Comutare hartă fundal","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Comutare hartă fundal","incompatibleSpatialReference":"Această hartă de fundal are o referință spațială incompatibilă"}
@@ -1 +1 @@
1
- {"widgetLabel":"Переключить базовую карту","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Переключить базовую карту","incompatibleSpatialReference":"Пространственная привязка данной базовой карты несовместима."}
@@ -1 +1 @@
1
- {"widgetLabel":"Prepnúť podkladovú mapu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Prepnúť podkladovú mapu","incompatibleSpatialReference":"Táto podkladová mapa má nekompatibilný priestorový referenčný systém"}
@@ -1 +1 @@
1
- {"widgetLabel":"Preklopi temeljno karto","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Preklopi temeljno karto","incompatibleSpatialReference":"Ta temeljna karta ima nezdružljiv koordinatni sistem"}
@@ -1 +1 @@
1
- {"widgetLabel":"Uklj./isklj. pozadinsku mapu","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Uklj./isklj. pozadinsku mapu","incompatibleSpatialReference":"Ova pozadinska mapa ima nekompatibilnu prostornu referencu"}
@@ -1 +1 @@
1
- {"widgetLabel":"Växla baskarta","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Växla baskarta","incompatibleSpatialReference":"Den här baskartan har en inkompatibel spatial referens"}
@@ -1 +1 @@
1
- {"widgetLabel":"ปุ่มสำหรับเปิดปิดแผนที่ฐาน","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"ปุ่มสำหรับเปิดปิดแผนที่ฐาน","incompatibleSpatialReference":"แผนที่ฐานนี้มีการอ้างอิงเชิงพื้นที่ที่ไม่สามารถใช้งานร่วมกันได้"}
@@ -1 +1 @@
1
- {"widgetLabel":"Altlık haritayı aç/kapat","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Altlık haritayı aç/kapat","incompatibleSpatialReference":"Bu altlık haritada uyumsuz bir mekânsal referans var"}
@@ -1 +1 @@
1
- {"widgetLabel":"Перемикнути базову карту","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Перемикнути базову карту","incompatibleSpatialReference":"Ця базова карта має несумісну просторову прив'язку"}
@@ -1 +1 @@
1
- {"widgetLabel":"Chuyển đổi bản đồ nền","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"Chuyển đổi bản đồ nền","incompatibleSpatialReference":"Bản đồ nền này có tham chiếu không gian không tương thích"}
@@ -1 +1 @@
1
- {"widgetLabel":"切换底图","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"切换底图","incompatibleSpatialReference":"此底图具有不兼容的空间参考"}
@@ -1 +1 @@
1
- {"widgetLabel":"切換底圖","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"切換底圖","incompatibleSpatialReference":"此底圖具有不相容的空間參考"}
@@ -1 +1 @@
1
- {"widgetLabel":"切換底圖","incompatibleSpatialReference":"This basemap has an incompatible spatial reference"}
1
+ {"widgetLabel":"切換底圖","incompatibleSpatialReference":"此底圖具有不相容的空間參考"}
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const r={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(r,globalThis.esriConfig,!0),delete r.has),!r.assetsPath){const e="4.24.0";r.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}r.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(r,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),r.request.corsEnabledServers=[],r.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{r as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const r={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(r,globalThis.esriConfig,!0),delete r.has),!r.assetsPath){const e="4.24.1";r.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}r.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(r,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),r.request.corsEnabledServers=[],r.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0};export{r as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.24.0",
3
+ "version": "4.24.1",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS API for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- const e="20220622",a="5920122e73c5174847b703e4af6a3170e28edfa6";export{e as buildDate,a as commitHash};
5
+ const b="20220623",c="8e53b079c0bc89b3df424a4c52ba69e6403a5507";export{b as buildDate,c as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as t}from"../../../../core/maybe.js";import{t as s}from"../../../../chunks/common.js";import{h as i,d as r,r as e,c as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as n}from"../../../../chunks/vec2f64.js";import{s as h}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import c from"./VertexStream.js";import{stencil as d}from"./shaders/StencilPrograms.js";import{StencilOperation as p,CompareFunction as _}from"../../../webgl/enums.js";import{createProgram as u}from"../../../webgl/ProgramTemplate.js";const l=n(-.5,-.5);class f{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,s){const{context:i}=t;return!!this._updateGeometry(t,s)&&(this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(p.KEEP,p.KEEP,p.REPLACE),i.setStencilFunction(_.ALWAYS,1,255),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(t){if(this._initialized)return;const s=u(t,d);s&&(this._program=s,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:d}=n,p=Math.round(c[0]*m),_=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const u=s(d),f=Math.abs(Math.cos(u)),g=Math.abs(Math.sin(u)),x=Math.round(p*f+_*g),b=Math.round(n.worldScreenWidth);if(x<=b)return!1;const j=p*g+_*f,E=b*m,M=(a.left-a.right)*m/p,w=(a.bottom-a.top)*m/_;h(this._worldDimensionsPx,E,j,1),h(this._pxToNdc,2/p,-2/_,1),h(this._centerNdc,M,w,1);const P=this._mat3;return i(P,this._centerNdc),r(P,P,this._pxToNdc),0!==d&&e(P,P,u),r(P,P,this._worldDimensionsPx),o(P,P,l),!0}}export{f as WorldExtentClipRenderer};
5
+ import{disposeMaybe as t}from"../../../../core/maybe.js";import{t as s}from"../../../../chunks/common.js";import{h as i,d as r,r as e,c as o}from"../../../../chunks/mat3.js";import{c as a}from"../../../../chunks/mat3f32.js";import{f as n}from"../../../../chunks/vec2f64.js";import{s as h}from"../../../../chunks/vec3.js";import{c as m}from"../../../../chunks/vec3f64.js";import c from"./VertexStream.js";import{stencil as d}from"./shaders/StencilPrograms.js";import{StencilOperation as p,CompareFunction as _}from"../../../webgl/enums.js";import{createProgram as l}from"../../../webgl/ProgramTemplate.js";const u=n(-.5,-.5);class f{constructor(){this._centerNdc=m(),this._pxToNdc=m(),this._worldDimensionsPx=m(),this._mat3=a(),this._initialized=!1}dispose(){this._program=t(this._program),this._quad=t(this._quad)}render(t,s){const{context:i}=t;return!!this._updateGeometry(t,s)&&(this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(p.KEEP,p.KEEP,p.REPLACE),i.setStencilFunction(_.ALWAYS,1,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.draw(),this._quad.unbind(),!0)}_initialize(t){if(this._initialized)return;const s=l(t,d);s&&(this._program=s,this._quad=new c(t,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(t,a){const{state:n,pixelRatio:m}=t,{size:c,rotation:d}=n,p=Math.round(c[0]*m),_=Math.round(c[1]*m);if(!n.spatialReference.isWrappable)return!1;const l=s(d),f=Math.abs(Math.cos(l)),b=Math.abs(Math.sin(l)),g=Math.round(p*f+_*b),x=Math.round(n.worldScreenWidth);if(g<=x)return!1;const j=p*b+_*f,E=x*m,M=(a.left-a.right)*m/p,w=(a.bottom-a.top)*m/_;h(this._worldDimensionsPx,E,j,1),h(this._pxToNdc,2/p,-2/_,1),h(this._centerNdc,M,w,1);const P=this._mat3;return i(P,this._centerNdc),r(P,P,this._pxToNdc),0!==d&&e(P,P,l),r(P,P,this._worldDimensionsPx),o(P,P,u),!0}}export{f as WorldExtentClipRenderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{disposeMaybe as e,releaseMaybe as r,isNone as t,isSome as i}from"../../../core/maybe.js";import{Z as o}from"../../../chunks/vec2f64.js";import{RasterColorizerStretchType as s}from"../../2d/engine/imagery/enums.js";import{VectorTileRendererHelper3D as l}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechniqueConfiguration as n,BlendLayersTechnique as a}from"./BlendLayersTechnique.js";import{LayerClass as h}from"./LayerClass.js";import{RasterColorizerTechniqueConfiguration as u,RasterColorizerTechnique as c}from"./RasterColorizerTechnique.js";import{FBOPool as _}from"./support/FBOPool.js";import{LayerBlendMode as d}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{TileBlendInput as b}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{B as f,a as p}from"../../../chunks/BlendLayers.glsl.js";import{BindParameters as T}from"../webgl-engine/lib/BindParameters.js";import{Pos2Tex as m}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as y}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as g,ClearBufferBit as B,TextureType as C}from"../../webgl/enums.js";import{Texture as x}from"../../webgl/Texture.js";import{vertexCount as O}from"../../webgl/Util.js";class F{constructor(e,r){this._rctx=e,this._techniqueRepository=r,this._fboPools=[],this._doubleBufferFbo=[],this._vectorTileHelper=new l,this._bindParameters=new T(null,null,null),this._blendLayersTechniqueConfig=new n,this._poolToWrite=0,this._vaoQuad=y(this._rctx,m),this._fboPools.push(new _(this._rctx)),this._fboPools.push(new _(this._rctx))}dispose(){this._fboPools.forEach((e=>{e.clear(),e=null})),this._fboPools=null,this._doubleBufferFbo.forEach((r=>e(r))),this._vaoQuad=e(this._vaoQuad),this._vectorTileHelper=e(this._vectorTileHelper),this._backgroundTechnique=r(this._backgroundTechnique),this._applyOpacityTechnique=r(this._applyOpacityTechnique),this._blendLayersTechnique=r(this._blendLayersTechnique)}_getBlendLayersTechnique(e,r,t,i=!1){return this._blendLayersTechniqueConfig.output=r,this._blendLayersTechniqueConfig.blendMode=e,this._blendLayersTechniqueConfig.baseOpacityMode=t?r===f.Composite?p.OnBaseLayer:p.OnBackground:p.One,this._blendLayersTechniqueConfig.premultipliedSource=i,this._blendLayersTechnique=this._techniqueRepository.releaseAndAcquire(a,this._blendLayersTechniqueConfig,this._blendLayersTechnique),this._blendLayersTechnique}drawBackground(e,r){const t=this._getBlendLayersTechnique(d.Normal,r,!1),i=this._rctx.bindTechnique(t,e,this._bindParameters);this._render(i)}_render(e){this._rctx.bindVAO(this._vaoQuad),e.assertCompatibleVertexAttributeLocations(this._vaoQuad),this._rctx.drawArrays(g.TRIANGLE_STRIP,0,O(this._vaoQuad,"geometry"))}drawRasterData(e,r,i=!1){if(t(r.texture))return;const o=r.baseOpacity<1;r.blendMode!==d.Normal||o||i?(r.fboTexture=this._currentFBO.colorTexture,this._switchPool(this._currentFBO.width)):r.fboTexture=null;const s=this._getBlendLayersTechnique(r.blendMode,e,o,i),l=this._rctx.bindTechnique(s,r,this._bindParameters);this._render(l)}drawImageryTileData(e,r,t){const i=e.sourceLayerInfo.data;if(!i.source)return;e.tile.surface.layerViewByIndex(e.layerIndex,h.MAP).ensureSymbolizerParameters(i);const o=t.baseOpacity<1;t.blendMode!==d.Normal||o?(t.fboTexture=this._currentFBO.colorTexture,this._switchPool(this._currentFBO.width)):t.fboTexture=null;const s=this._getRasterColorizerTechnique(i,r,t.blendMode,o),l=this._rctx.bindTechnique(s);if(!i.bind(this._rctx))return;i.opacity=t.opacity;const n=i.getUniforms();n.scale=e.scale,n.offset=e.offset,n.backgroundColor=t.backgroundColor,n.fboTexture=t.fboTexture,n.baseOpacity=t.baseOpacity,s.bindPass(n,null),this._render(l)}_getRasterColorizerTechnique(e,r,i,o){const l=e.symbolizerParameters,n=["stretch","lut","hillshade"].indexOf(l.type);return t(this._rasterColorizerConfig)&&(this._rasterColorizerConfig=new u,this._rctx.gl.getExtension("WEBGL_color_buffer_float"),this._rctx.gl.getExtension("OES_texture_float")),this._rasterColorizerConfig.tileBlendInput=r===f.ColorComposite?b.ColorComposite:r===f.GridComposite?b.GridComposite:b.LayerOnly,this._rasterColorizerConfig.blendMode=i,this._rasterColorizerConfig.baseOpacityMode=o?r===f.Composite?p.OnBaseLayer:p.OnBackground:p.One,this._rasterColorizerConfig.colorizerType=n,this._rasterColorizerConfig.applyColormap=!!l.colormap,this._rasterColorizerConfig.stretchType=e.hasStretchTypeNone()?s.Noop:s.PerBand,this._rasterColorizerTechnique=this._techniqueRepository.releaseAndAcquire(c,this._rasterColorizerConfig,this._rasterColorizerTechnique),this._rasterColorizerTechnique}drawVectorData(e,r,t,s,l,n,a){const u=this._rctx,c=r.sourceLayerInfo.data,_=r.tile.surface.layerViewByIndex(r.layerIndex,h.MAP),b=e.baseOpacity<1||e.opacity<1||e.blendMode!==d.Normal||a!==f.Composite;let p;return this._getBlendLayersTechnique(e.blendMode,a,e.baseOpacity<1,b).bindPipelineState(u),b?(p=this._acquire(l),u.bindFramebuffer(p),u.setClearColor(0,0,0,0),u.clearSafe(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT)):n&&u.clearSafe(B.DEPTH_BUFFER_BIT),this._vectorTileHelper.render(u,r.sourceLod,c,_.painter,_.layer.styleRepository,_.schemaHelper,Math.round(1/r.scale),r.offset,s,t),!i(p)||(u.bindFramebuffer(this._currentFBO),e.texture=p.colorTexture,e.offset=o,e.scale=1,this.drawRasterData(a,e,b),p.release(),n)}copyFBOToTexture(e){const r=this._rctx,t=r.bindTexture(e.texture,x.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;r.gl.copyTexImage2D(C.TEXTURE_2D,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),r.bindTexture(t,x.TEXTURE_UNIT_FOR_UPDATES)}_initFBO(e,r){this._rctx.bindFramebuffer(e),this._rctx.setViewport(0,0,r,r),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.clearSafe(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT)}_acquire(e){return this._fboPools[this._poolToWrite].acquire(e)}bindPool(e,r){this._poolToWrite=e,null==this._doubleBufferFbo[e]&&(this._doubleBufferFbo[e]=this._acquire(r),this._initFBO(this._doubleBufferFbo[e],r))}_switchPool(e){this._releaseCurrentFBO(),this._doubleBufferFbo[this._poolToWrite]=null,this._poolToWrite=0===this._poolToWrite?1:0,this.bindPool(this._poolToWrite,e)}get _currentFBO(){return this._doubleBufferFbo[this._poolToWrite]}_releaseCurrentFBO(){this._doubleBufferFbo[this._poolToWrite].release(),this._doubleBufferFbo[this._poolToWrite]=null}releasePool(){this._rctx.bindFramebuffer(null),this._releaseCurrentFBO()}cleanupFBOPool(e,r){e===this._lastPixelRatio&&r===this._lastNumLayers||(this._fboPools.forEach((e=>e.clear())),this._lastPixelRatio=e,this._lastNumLayers=r)}}export{F as TileCompositor};
5
+ import e from"../../../core/Logger.js";import{disposeMaybe as r,releaseMaybe as t,isNone as i,isSome as o}from"../../../core/maybe.js";import{Z as s}from"../../../chunks/vec2f64.js";import{RasterColorizerStretchType as n}from"../../2d/engine/imagery/enums.js";import{VectorTileRendererHelper3D as l}from"../../2d/engine/vectorTiles/VectorTileRendererHelper3D.js";import{BlendLayersTechniqueConfiguration as a,BlendLayersTechnique as h}from"./BlendLayersTechnique.js";import{LayerClass as c}from"./LayerClass.js";import{RasterColorizerTechniqueConfiguration as u,RasterColorizerTechnique as _}from"./RasterColorizerTechnique.js";import{FBOPool as d}from"./support/FBOPool.js";import{LayerBlendMode as b}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{TileBlendInput as f}from"../webgl-engine/core/shaderLibrary/terrain/TileBlendInput.js";import{B as p,a as T}from"../../../chunks/BlendLayers.glsl.js";import{BindParameters as m}from"../webgl-engine/lib/BindParameters.js";import{Pos2Tex as y}from"../webgl-engine/lib/DefaultVertexBufferLayouts.js";import{createQuadVAO as g}from"../webgl-engine/lib/glUtil3D.js";import{PrimitiveType as B,ClearBufferBit as C,TextureType as x}from"../../webgl/enums.js";import{Texture as O}from"../../webgl/Texture.js";import{vertexCount as F}from"../../webgl/Util.js";const q=e.getLogger("esri.views.3d.terrain");class L{constructor(e,r){this._rctx=e,this._techniqueRepository=r,this._fboPools=[],this._doubleBufferFbo=[],this._vectorTileHelper=new l,this._bindParameters=new m(null,null,null),this._blendLayersTechniqueConfig=new a,this._poolToWrite=0,this._vaoQuad=g(this._rctx,y),this._fboPools.push(new d(this._rctx)),this._fboPools.push(new d(this._rctx))}dispose(){this._fboPools.forEach((e=>{e.clear(),e=null})),this._fboPools=null,this._doubleBufferFbo.forEach((e=>r(e))),this._vaoQuad=r(this._vaoQuad),this._vectorTileHelper=r(this._vectorTileHelper),this._backgroundTechnique=t(this._backgroundTechnique),this._applyOpacityTechnique=t(this._applyOpacityTechnique),this._blendLayersTechnique=t(this._blendLayersTechnique)}_getBlendLayersTechnique(e,r,t,i=!1){return this._blendLayersTechniqueConfig.output=r,this._blendLayersTechniqueConfig.blendMode=e,this._blendLayersTechniqueConfig.baseOpacityMode=t?r===p.Composite?T.OnBaseLayer:T.OnBackground:T.One,this._blendLayersTechniqueConfig.premultipliedSource=i,this._blendLayersTechnique=this._techniqueRepository.releaseAndAcquire(h,this._blendLayersTechniqueConfig,this._blendLayersTechnique),this._blendLayersTechnique}drawBackground(e,r){const t=this._getBlendLayersTechnique(b.Normal,r,!1),i=this._rctx.bindTechnique(t,e,this._bindParameters);this._render(i)}_render(e){this._rctx.bindVAO(this._vaoQuad),e.assertCompatibleVertexAttributeLocations(this._vaoQuad),this._rctx.drawArrays(B.TRIANGLE_STRIP,0,F(this._vaoQuad,"geometry"))}drawRasterData(e,r,t=!1){if(i(r.texture))return;const o=r.baseOpacity<1;r.blendMode!==b.Normal||o||t?(r.fboTexture=this._currentFBO.colorTexture,this._switchPool(this._currentFBO.width)):r.fboTexture=null;const s=this._getBlendLayersTechnique(r.blendMode,e,o,t),n=this._rctx.bindTechnique(s,r,this._bindParameters);this._render(n)}drawImageryTileData(e,r,t){const i=e.sourceLayerInfo.data;if(!i.source)return;e.tile.surface.layerViewByIndex(e.layerIndex,c.MAP).ensureSymbolizerParameters(i);const o=t.baseOpacity<1;t.blendMode!==b.Normal||o?(t.fboTexture=this._currentFBO.colorTexture,this._switchPool(this._currentFBO.width)):t.fboTexture=null;const s=this._getRasterColorizerTechnique(i,r,t.blendMode,o),n=this._rctx.bindTechnique(s);if(!i.bind(this._rctx))return;i.opacity=t.opacity;const l=i.getUniforms();l.scale=e.scale,l.offset=e.offset,l.backgroundColor=t.backgroundColor,l.fboTexture=t.fboTexture,l.baseOpacity=t.baseOpacity,s.bindPass(l,null),this._render(n)}_getRasterColorizerTechnique(e,r,t,o){const s=e.symbolizerParameters,l=["stretch","lut","hillshade"].indexOf(s.type);return i(this._rasterColorizerConfig)&&(this._rasterColorizerConfig=new u,this._rctx.gl.getExtension("WEBGL_color_buffer_float"),this._rctx.gl.getExtension("OES_texture_float")),this._rasterColorizerConfig.tileBlendInput=r===p.ColorComposite?f.ColorComposite:r===p.GridComposite?f.GridComposite:f.LayerOnly,this._rasterColorizerConfig.blendMode=t,this._rasterColorizerConfig.baseOpacityMode=o?r===p.Composite?T.OnBaseLayer:T.OnBackground:T.One,this._rasterColorizerConfig.colorizerType=l,this._rasterColorizerConfig.applyColormap=!!s.colormap,this._rasterColorizerConfig.stretchType=e.hasStretchTypeNone()?n.Noop:n.PerBand,this._rasterColorizerTechnique=this._techniqueRepository.releaseAndAcquire(_,this._rasterColorizerConfig,this._rasterColorizerTechnique),this._rasterColorizerTechnique}drawVectorData(e,r,t,i,n,l,a){const h=this._rctx,u=r.sourceLayerInfo.data,_=r.tile.surface.layerViewByIndex(r.layerIndex,c.MAP),d=e.baseOpacity<1||e.opacity<1||e.blendMode!==b.Normal||a!==p.Composite;let f;this._getBlendLayersTechnique(e.blendMode,a,e.baseOpacity<1,d).bindPipelineState(h),d?(f=this._acquire(n),h.bindFramebuffer(f),h.setClearColor(0,0,0,0),h.clearSafe(C.COLOR_BUFFER_BIT|C.DEPTH_BUFFER_BIT)):l&&h.clearSafe(C.DEPTH_BUFFER_BIT);try{this._vectorTileHelper.render(h,r.sourceLod,u,_.painter,_.layer.styleRepository,_.schemaHelper,Math.round(1/r.scale),r.offset,i,t)}catch(T){q.warnOnce("A render call containing vector tiles did not resolve correctly.",T)}return!o(f)||(h.bindFramebuffer(this._currentFBO),e.texture=f.colorTexture,e.offset=s,e.scale=1,this.drawRasterData(a,e,d),f.release(),l)}copyFBOToTexture(e){const r=this._rctx,t=r.bindTexture(e.texture,O.TEXTURE_UNIT_FOR_UPDATES),i=e.descriptor;r.gl.copyTexImage2D(x.TEXTURE_2D,0,i.pixelFormat,0,0,i.width,i.height,0),e.generateMipmap(),r.bindTexture(t,O.TEXTURE_UNIT_FOR_UPDATES)}_initFBO(e,r){this._rctx.bindFramebuffer(e),this._rctx.setViewport(0,0,r,r),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.clearSafe(C.COLOR_BUFFER_BIT|C.DEPTH_BUFFER_BIT)}_acquire(e){return this._fboPools[this._poolToWrite].acquire(e)}bindPool(e,r){this._poolToWrite=e,null==this._doubleBufferFbo[e]&&(this._doubleBufferFbo[e]=this._acquire(r),this._initFBO(this._doubleBufferFbo[e],r))}_switchPool(e){this._releaseCurrentFBO(),this._doubleBufferFbo[this._poolToWrite]=null,this._poolToWrite=0===this._poolToWrite?1:0,this.bindPool(this._poolToWrite,e)}get _currentFBO(){return this._doubleBufferFbo[this._poolToWrite]}_releaseCurrentFBO(){this._doubleBufferFbo[this._poolToWrite].release(),this._doubleBufferFbo[this._poolToWrite]=null}releasePool(){this._rctx.bindFramebuffer(null),this._releaseCurrentFBO()}cleanupFBOPool(e,r){e===this._lastPixelRatio&&r===this._lastNumLayers||(this._fboPools.forEach((e=>e.clear())),this._lastPixelRatio=e,this._lastNumLayers=r)}}export{L as TileCompositor};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/has.js";import{isSome as t,isNone as r}from"../../core/maybe.js";var o;function n(e,r,o={}){const n=i(e);for(;n.length>1;){const e=l(r,n.shift(),o);if(t(e))return e}return c(r,n.shift(),o)}function i(t){const r=e("esri-force-webgl");if(r===o.WEBGL1||r===o.WEBGL2)return[r];switch(t){case"2d":case"3d":return[o.WEBGL2,o.WEBGL1]}}function c(e,t,o={}){if(!window.WebGLRenderingContext)return s(e,a),null;const n=l(e,t,o);return r(n)&&s(e,u),n}function l(e,t,r={}){const n=t===o.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let i=null;for(const o of n){try{i=e.getContext(o,r)}catch(c){}if(i)break}return i}function s(e,t){const r=e.parentNode;r&&(r.innerHTML='<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">'+t+"</div></div></td></tr></table>")}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(o||(o={}));const a='This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>',u='It doesn\'t appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>';export{o as ContextType,l as createContext,n as createContextOrErrorHTML,i as getContextTypes};
5
+ import e from"../../core/has.js";import{isSome as t,isNone as r}from"../../core/maybe.js";var o;function n(e,r,o={}){const n=i(e);for(;n.length>1;){const e=l(r,n.shift(),o);if(t(e))return e}return c(r,n.shift(),o)}function i(t){const r=e("esri-force-webgl");if(r===o.WEBGL1||r===o.WEBGL2)return[r];switch(t){case"2d":return e("mac")?[o.WEBGL1,o.WEBGL2]:[o.WEBGL2,o.WEBGL1];case"3d":return[o.WEBGL2,o.WEBGL1]}}function c(e,t,o={}){if(!window.WebGLRenderingContext)return a(e,s),null;const n=l(e,t,o);return r(n)&&a(e,u),n}function l(e,t,r={}){const n=t===o.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let i=null;for(const o of n){try{i=e.getContext(o,r)}catch(c){}if(i)break}return i}function a(e,t){const r=e.parentNode;r&&(r.innerHTML='<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">'+t+"</div></div></td></tr></table>")}!function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"}(o||(o={}));const s='This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>',u='It doesn\'t appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>';export{o as ContextType,l as createContext,n as createContextOrErrorHTML,i as getContextTypes};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{makeHandle as t}from"../../core/handleUtils.js";import{isSome as i}from"../../core/maybe.js";import{onAbort as a,createAbortError as s,throwIfAborted as o,isAborted as r}from"../../core/promiseUtils.js";import{watch as d}from"../../core/reactiveUtils.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/set.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{highlightsSupported as l}from"../../views/support/layerViewUtils.js";import{Edits as c}from"./Edits.js";import u from"./UpdateWorkflowData.js";import m from"./Workflow.js";import{createWorkflowSteps as w,fetchCandidates as h,fetchFullFeature as f,findLayerInfo as p,getVisualVariableAttributes as g,setUpGeometryUpdate as v}from"./workflowUtils.js";var y;const M="candidate-highlight";let b=y=class extends m{constructor(e){super(e),this.type="update"}static create(e,t,i){const a=new y({data:new u({edits:new c,viewModel:e}),onCommit:async e=>{const t=e.edits.feature,a=t.sourceLayer,s=t.clone();if(!e.edits.attributesModified){const{objectIdField:e}=a;s.attributes={[e]:t.getAttribute(e)}}e.edits.geometryModified||(s.geometry=null),await i(a,{updateFeatures:[s]})}});return a._set("steps",this._createWorkflowSteps(a,t)),a}highlight(e){const{data:{viewModel:{view:t}}}=this,i=e&&t.allLayerViews.items.find((({layer:t})=>t===e.layer));l(i)&&this.handles.add(i.highlight(e),M)}unhighlight(){this.handles.remove(M)}static _createWorkflowSteps(e,n="awaiting-feature-to-update"){const{data:l,handles:c}=e,u=new Map;return w(["awaiting-feature-to-update","awaiting-update-feature-candidate","editing-existing-feature","adding-attachment","editing-attachment"],n,{"awaiting-feature-to-update":()=>({id:"awaiting-feature-to-update",async setUp(){const{spinnerViewModel:e,view:t}=l.viewModel;let i=null;c.add({remove(){i&&(i.abort(),i=null)}},this.id),l.edits.feature=null;const r=t.on("immediate-click",(r=>{e.location=r.mapPoint,e.visible=!0,i&&i.abort();const{editableItems:d}=l.viewModel;i=new AbortController,new Promise(((e,o)=>{a(i.signal,(()=>o(s()))),e(h(d,t,r,i.signal))})).then((e=>{if(o(i),l.candidates=e.reduce(((e,t)=>t.error?e:[...e,...t.value]),[]),l.viewModel.spinnerViewModel.visible=1===l.candidates.length,0!==l.candidates.length)if(1===l.candidates.length){const e=l.candidates[0];l.edits.feature=e,l.viewModel.activeWorkflow.go("editing-existing-feature").catch((()=>{})).then((()=>l.viewModel.spinnerViewModel.visible=!1))}else l.viewModel.activeWorkflow.next()}))}));t.focus(),c.add(r,this.id)},async tearDown(){c.remove(this.id)}}),"awaiting-update-feature-candidate":()=>({id:"awaiting-update-feature-candidate",async setUp(){const{edits:t}=l;t.feature=null,c.add(d((()=>t.feature),(t=>{e.unhighlight(),e.highlight(t)})),this.id)},async tearDown(){e.unhighlight(),c.remove(this.id)}}),"editing-existing-feature":()=>({id:"editing-existing-feature",async setUp(){if(c.has("editing-existing-feature"))return;const a=l.edits.feature,s=l.viewModel;l.editableItem=s.editableItems.find((e=>e.layer===a.layer));const o=new AbortController;c.add({remove:()=>o.abort()},this.id);const n=s.view.whenLayerView(a.layer),m=f(a,s.view,o.signal),w=await n,h=await m;if(r(o))return;l.edits.updateGeometry(h.geometry),l.edits.updateAttributes(h.attributes),l.edits.trackChanges(),s.attachmentsViewModel.set({graphic:h,mode:"view"});const y=h.sourceLayer,M=p(s.layerInfos,y)?.formTemplate,b=s.view.spatialReference;s.featureFormViewModel.set({feature:h,formTemplate:M,spatialReference:b});const V="createInteractiveEditSession"in w?w.createInteractiveEditSession(a):null,j=[s.featureFormViewModel.on("value-change",(e=>{l.edits.updateAttributes(s.featureFormViewModel.getValues()),h.attributes=l.edits.feature.attributes,V&&V.setAttribute(e.fieldName,e.value)})),d((()=>s.attachmentsViewModel.mode),(e=>{"add"===e&&l.viewModel.activeWorkflow.go("adding-attachment"),"edit"===e&&l.viewModel.activeWorkflow.go("editing-attachment")}))];V&&(j.push(t((()=>V.rollback()))),c.add(t((()=>V.commit())),e._handleKeys.afterCommit));const{supportsGeometryUpdate:k}=y.capabilities.editing;if(k){s.sketchViewModel.allowDeleteKey=!1;const t=g(h),{interactive:a,visual:o}=await v(h,t,s.sketchViewModel,s.view,(({geometry:e,attributes:a})=>{if(i(t.rotation)){const{field:e}=t.rotation;s.featureFormViewModel.setValue(e,a[e])}if(i(t.size)){const{field:e}=t.size;s.featureFormViewModel.setValue(e,a[e])}l.edits.updateAttributes(a),l.edits.updateGeometry(e)}),u);j.push(a,o),c.add(a,e._handleKeys.beforeCommit),c.add(o,e._handleKeys.afterCommit)}else e.highlight(h);c.add(j,this.id)},async tearDown({cancelled:t}){t&&(e.unhighlight(),c.remove(this.id))}}),"adding-attachment":()=>({id:"adding-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){l.viewModel.attachmentsViewModel.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){l.viewModel.attachmentsViewModel.mode="view"}})})}};b=y=e([n("esri.widgets.Editor.UpdateWorkflow")],b);const V=b;export{V as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{makeHandle as t}from"../../core/handleUtils.js";import{isSome as i}from"../../core/maybe.js";import{onAbort as a,createAbortError as o,throwIfAborted as s,isAborted as r}from"../../core/promiseUtils.js";import{watch as d}from"../../core/reactiveUtils.js";import"../../core/Logger.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/set.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{highlightsSupported as l}from"../../views/support/layerViewUtils.js";import{Edits as c}from"./Edits.js";import u from"./UpdateWorkflowData.js";import m from"./Workflow.js";import{createWorkflowSteps as w,fetchCandidates as h,fetchFullFeature as f,findLayerInfo as p,getVisualVariableAttributes as g,setUpGeometryUpdate as v}from"./workflowUtils.js";var y;const M="candidate-highlight";let b=y=class extends m{constructor(e){super(e),this.type="update"}static create(e,t,i){const a=new y({data:new u({edits:new c,viewModel:e}),onCommit:async e=>{const t=e.edits.feature,a=t.sourceLayer,o=t.clone();if(!e.edits.attributesModified){const{objectIdField:e}=a;o.attributes={[e]:t.getAttribute(e)}}e.edits.geometryModified||(o.geometry=null),await i(a,{updateFeatures:[o]})}});return a._set("steps",this._createWorkflowSteps(a,t)),a}highlight(e){const{data:{viewModel:{view:t}}}=this,i=e&&t.allLayerViews.items.find((({layer:t})=>t===e.layer));l(i)&&this.handles.add(i.highlight(e),M)}unhighlight(){this.handles.remove(M)}static _createWorkflowSteps(e,n="awaiting-feature-to-update"){const{data:l,handles:c}=e,u=new Map;return w(["awaiting-feature-to-update","awaiting-update-feature-candidate","editing-existing-feature","adding-attachment","editing-attachment"],n,{"awaiting-feature-to-update":()=>({id:"awaiting-feature-to-update",async setUp(){const{spinnerViewModel:e,view:t}=l.viewModel;let i=null;c.add({remove(){i&&(i.abort(),i=null)}},this.id),l.edits.feature=null;const r=t.on("immediate-click",(r=>{e.location=r.mapPoint,e.visible=!0,i&&i.abort();const{editableItems:d}=l.viewModel;i=new AbortController,new Promise(((e,s)=>{a(i.signal,(()=>s(o()))),e(h(d,t,r,i.signal))})).then((e=>{if(s(i),l.candidates=e.reduce(((e,t)=>t.error?e:[...e,...t.value]),[]),l.viewModel.spinnerViewModel.visible=1===l.candidates.length,0!==l.candidates.length)if(1===l.candidates.length){const e=l.candidates[0];l.edits.feature=e,l.viewModel.activeWorkflow.go("editing-existing-feature").catch((()=>{})).then((()=>l.viewModel.spinnerViewModel.visible=!1))}else l.viewModel.activeWorkflow.next()}))}));t.focus(),c.add(r,this.id)},async tearDown(){c.remove(this.id)}}),"awaiting-update-feature-candidate":()=>({id:"awaiting-update-feature-candidate",async setUp(){const{edits:t}=l;t.feature=null,c.add(d((()=>t.feature),(t=>{e.unhighlight(),e.highlight(t)})),this.id)},async tearDown(){e.unhighlight(),c.remove(this.id)}}),"editing-existing-feature":()=>({id:"editing-existing-feature",async setUp(){if(c.has("editing-existing-feature"))return;const a=l.edits.feature,o=l.viewModel;l.editableItem=o.editableItems.find((e=>e.layer===a.layer));const s=new AbortController;c.add({remove:()=>s.abort()},this.id);const n=o.view.whenLayerView(a.layer),m=f(a,o.view,s.signal),w=await n,h=await m;if(r(s))return;l.edits.updateGeometry(h.geometry),l.edits.updateAttributes(h.attributes),l.edits.trackChanges(),o.attachmentsViewModel.set({graphic:h,mode:"view"});const y=h.sourceLayer,M=p(o.layerInfos,y)?.formTemplate,b=o.view.spatialReference;o.featureFormViewModel.set({feature:h,formTemplate:M,spatialReference:b});const V="createInteractiveEditSession"in w?w.createInteractiveEditSession(a):null,j=[o.featureFormViewModel.on("value-change",(e=>{l.edits.updateAttributes(o.featureFormViewModel.getValues()),h.attributes=l.edits.feature.attributes,V&&V.setAttribute(e.fieldName,e.value)})),d((()=>o.attachmentsViewModel.mode),(e=>{"add"===e&&l.viewModel.activeWorkflow.go("adding-attachment"),"edit"===e&&l.viewModel.activeWorkflow.go("editing-attachment")}))];V&&(j.push(t((()=>V.rollback()))),c.add(t((()=>V.commit())),e._handleKeys.afterCommit));const{supportsGeometryUpdate:k}=y.capabilities.editing;if(k){o.sketchViewModel.allowDeleteKey=!1;const t=g(h),{interactive:a,visual:s}=await v(h,t,o.sketchViewModel,o.view,(({geometry:e,attributes:a})=>{if(i(t.rotation)){const{field:e}=t.rotation;o.featureFormViewModel.setValue(e,a[e])}if(i(t.size)){const{field:e}=t.size;o.featureFormViewModel.setValue(e,a[e])}l.edits.updateAttributes(a),l.edits.updateGeometry(e),o.featureFormViewModel.feature.geometry=e}),u);j.push(a,s),c.add(a,e._handleKeys.beforeCommit),c.add(s,e._handleKeys.afterCommit)}else e.highlight(h);c.add(j,this.id)},async tearDown({cancelled:t}){t&&(e.unhighlight(),c.remove(this.id))}}),"adding-attachment":()=>({id:"adding-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){l.viewModel.attachmentsViewModel.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){l.viewModel.attachmentsViewModel.mode="view"}})})}};b=y=e([n("esri.widgets.Editor.UpdateWorkflow")],b);const V=b;export{V as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import{makeHandle as s}from"../../core/handleUtils.js";import o from"../../core/Logger.js";import{destroyMaybe as r,isNone as a,isSome as l}from"../../core/maybe.js";import{EsriPromiseMixin as u}from"../../core/Promise.js";import{watch as c}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import h from"../../form/FormTemplate.js";import f from"../../layers/support/ContingentValue.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{loadArcade as g}from"../../support/arcadeOnDemand.js";import y from"./InputField.js";import _ from"./InputFieldGroup.js";import{onLocaleChange as F}from"../../intl/locale.js";import{fetchMessageBundle as C}from"../../intl/messages.js";const v=new t({attributes:{}}),b="esri.widgets.FeatureForm.FeatureFormViewModel",E=o.getLogger(b),V=["editable","required","value","visibility"],x="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",j="#JSAPI_CONTINGENT_VALUE_ANY_HASH",w="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let I=class extends(n(u(i.EventedAccessor))){constructor(e){super(e),this._arcade=null,this._compiledExpressionLookup=new Map,this._expressionLookup=new Map,this._expressionInvalidationCallbacks=new Set,this._contingentValuesCache=null,this._featureClone=v.clone(),this._initialFeature=v.clone(),this._arcadeGeometryOperationsEnabled=!1,this._inputFieldCache=[],this.contingencyConstraintViolations=new Map,this.messages=null,this.strict=!1}initialize(){const e=async()=>this.messages=await C("esri/widgets/FeatureForm/t9n/FeatureForm");e();const t=c((()=>this.layer),(e=>{"feature"===e?.type&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(e).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0});this.handles.add([F(e),t])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=r(this._contingentValuesCache)}get allInputFields(){return this.inputFields.reduce(((e,t)=>T(t)?[...e,...t.inputFields]:[...e,t]),[])}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():v.clone(),this._initialFeature=this._featureClone.clone(),this.contingencyConstraintViolations.clear(),this._clearInputFieldCache(),this._set("feature",e)}get fieldsWithContingentValues(){if(a(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){null!=e?this._override("formTemplate",e):this._clearOverride("formTemplate")}get inputFields(){const{_arcade:e,_featureClone:t,_initialFeature:i,_inputFieldCache:n,formTemplate:s,messages:o,layer:r,state:a,spatialReference:u}=this;if("ready"!==a)return[];const c={arcade:e,feature:t,initialFeature:i,layer:r,messages:o,expressionTrackingProvider:{registerExpression:this._registerExpression.bind(this)},spatialReference:u},p=l(s)&&s.elements.length>0?this._updateInputFieldsFromElements(n,s.elements,c):this._updateInputFieldsFromLayerFields(n,r?.fields,c);return this._inputFieldCache=p,p}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){e?this._override("layer",e):this._clearOverride("layer")}get spatialReference(){return this.layer?.spatialReference||null}set spatialReference(e){void 0===e?this._clearOverride("spatialReference"):this._override("spatialReference",e)}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){const{_featureClone:t,layer:i}=this,n=!!i?.getField(e);return t.getAttribute(e)??(n?null:void 0)}setValue(e,t){const{_featureClone:i,strict:n}=this,s=this.findField(e);t=""===t?null:t,s&&i.getAttribute(e)!==t&&(s.value=t,n&&!s.valid||this._afterValueChange(s))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),i=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[s,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(s),i.push(s));this.emit("submit",{valid:[...t],invalid:i,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:i}=this,n=new Map;if(this.contingencyConstraintViolations=n,a(i))return[];const{invalid:s,incomplete:o}=i.validateContingencyConstraints(e),r=[...s,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)n.set(e,a);return r}_emitChangeEvent({name:e,valid:t,value:i}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:i,valid:t})}_updateInputFieldsFromElements(e,t,i){const n=new Map;for(const o of e)if(T(o)){A(n,o.groupElement,o);for(const e of o.inputFields)A(n,e.fieldElement,e)}else A(n,o.fieldElement,o);const s=this._updateInputFieldsRecursive(n,t.filter(this._isSupportedElement),i);for(const[o,r]of n.entries())n.delete(o),r.destroy();return s}_updateInputFieldsRecursive(e,t,i,n=null){const s=[];for(const o of t){const t=e.has(o),r=t?e.get(o):k(o)?this._makeInputFieldGroupFromGroupElement(o,i):this._makeInputFieldFromFieldElement(o,i,n);if(s.push(r),t)if(e.delete(o),T(r)){const{arcade:e,feature:t,expressionTrackingProvider:n,spatialReference:s}=i;r.set({arcade:e,feature:t,expressionTrackingProvider:n,spatialReference:s})}else r.set(i);if(k(o)){const t=o.elements.filter((e=>this._isSupportedElement(e)));r.inputFields=this._updateInputFieldsRecursive(e,t,i,r)}}return s}_updateInputFieldsFromLayerFields(e,t,i){if(!Array.isArray(t))return E.warn(b,"No attribute fields found."),[];const n=new Map;for(const c of e)if(T(c)){for(const e of c.inputFields)e.destroy();c.inputFields.length=0,c.destroy()}else n.set(c.field,c);const s=[],{feature:o,initialFeature:r,layer:a,messages:l,spatialReference:u}=i;for(const c of t){const e=n.get(c)??new y({field:c,feature:o,initialFeature:r,layer:a,messages:l,spatialReference:u,value:o.getAttribute(c.name)});e.set({fieldElement:null,requiredFunction:null,visibilityFunction:null,valueFunction:null,editableFunction:null}),s.push(e),n.delete(c)}for(const[c,p]of n.entries())n.delete(c),p.destroy();return s}_makeInputFieldFromFieldElement(e,t,i=null){const{arcade:n,expressionTrackingProvider:o,feature:r,initialFeature:a,layer:u,messages:p,spatialReference:d}=t,h=new y({fieldElement:e,field:this._layerFieldsByName.get(e.fieldName),requiredFunction:this._getCompiledExpression(e.requiredExpression),visibilityFunction:this._getCompiledExpression(e.visibilityExpression),valueFunction:this._getCompiledExpression(e.valueExpression),editableFunction:this._getCompiledExpression(e.editableExpression),group:i,arcade:n,expressionTrackingProvider:o,feature:r,initialFeature:a,layer:u,messages:p,spatialReference:d,value:r.getAttribute(e.fieldName)}),f=`watch-expression-field-${h.id}`,m=c((()=>h.fieldElement),(e=>{this.handles.remove(f),l(e)&&this.handles.add(V.map((t=>c((()=>e[`${t}Expression`]),(async e=>{e&&""!==e&&(h[`${t}Function`]=await this._getOrMakeCompiledExpression(e),h.arcade=this._arcade)}),{initial:!0,sync:!0}))),f)}),{initial:!0,sync:!0}),g=s((()=>this.handles.remove(f))),_=c((()=>h.value),(()=>this._afterValueChange(h)));return h.own([m,g,_]),h}_makeInputFieldGroupFromGroupElement(e,t){const{arcade:i,feature:n,expressionTrackingProvider:s,spatialReference:o}=t,r=new _({groupElement:e,visibilityFunction:this._getCompiledExpression(e.visibilityExpression),inputFields:[],arcade:i,feature:n,expressionTrackingProvider:s,spatialReference:o});return r.own(c((()=>r.groupElement),(e=>l(e)&&e.own(c((()=>e.visibilityExpression),(async e=>{e&&""!==e&&(r.visibilityFunction=await this._getOrMakeCompiledExpression(e),r.arcade=this._arcade)}),{initial:!0}))),{initial:!0})),r}_clearInputFieldCache(){for(const e of this._inputFieldCache)e.destroy();this._inputFieldCache=[]}_afterValueChange(e){const{name:t,value:i}=e;if(this.get("layer.typeIdField")===t&&"types"in this.layer){const e=new Set;this.layer.types.forEach((t=>Object.keys(t.domains).forEach((t=>e.add(t))))),e.forEach((e=>{const t=this.findField(e);t&&t.notifyChange("domain")}))}this._featureClone.setAttribute(t,i);for(const n of this._expressionInvalidationCallbacks)n();this._emitChangeEvent(e)}_registerExpression(e){const{_expressionInvalidationCallbacks:t}=this;return t.add(e),s((()=>t.delete(e)))}_getCompiledExpression(e){return this._compiledExpressionLookup.get(this._expressionLookup.get(e))}async _getOrMakeCompiledExpression(e){{if(a(e)||""===e)return null;const t=this._expressionLookup.get(e)??this._addToExpressionLookup(e);if(this._compiledExpressionLookup.has(t))return this._compiledExpressionLookup.get(t);this._arcade||(this._arcade=await g());const i=this._arcade.arcadeUtils;return!this._arcadeGeometryOperationsEnabled&&i.hasGeometryOperations(t)&&(await i.enableGeometryOperations(),this._arcadeGeometryOperationsEnabled=!0),this._addToCompiledExpressionLookup(t)}}_addToCompiledExpressionLookup(e){const{_arcade:{arcadeUtils:t},_compiledExpressionLookup:i}=this,n=t.createFunction(e);return i.set(e,n),n}_addToExpressionLookup(e){const{_expressionLookup:t,formTemplate:i}=this,n=(l(i)&&l(i.expressionInfos)?Object.values(i.expressionInfos).find((t=>t.name===e)):null)?.expression??e;return t.set(e,n),e!==n&&t.set(n,n),n}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(E.warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(a(e))return[];const t="typeIdField"in this.layer?this.layer.typeIdField:null,i=t?this.getValue(t):null,n=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:s}=r,o=[];for(const n of e)n.isRetired||l(n.subtype)&&n.subtype.code!==i||o.push({values:n.values});o.length>0&&n.push({name:s,fields:t,contingencies:o})}const[s,o]=this._generateJoinPlan(n);return[...s.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,i=[],n=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const s=t.get(e),o=l,r=[s.name,o.name].sort().join("|");if(n.has(r))continue;i.push([s,o]),n.add(r),t.set(e,o)}else t.set(e,l);const s=new Set(i.flat()),o=new Set(e);for(const l of s)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(i.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of i){const e=a.get(l),t=a.get(u);if(e===t)continue;const i=r.get(e),n=r.get(t);for(const s of n)i.add(s),a.set(s,e);r.delete(t)}return[[...r.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),i=t.shift();let n=t.shift(),s=this._generateJoinKey(i.fields,n.fields),o=new Set([...i.fields,...n.fields]),r=new Map;for(const a of i.contingencies){const[e]=this._hashContingency(a,s.codedValueFields,!0);r.has(e)?r.get(e).push(a):r.set(e,[a])}for(;t.length>0;){const e=new Map,i=t.shift(),l=this._generateJoinKey(o,i.fields);for(const t of n.contingencies){const[i,n]=this._hashContingency(t,s.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(r,i):r.get(i);if(r.has(j)&&o.push(...this._findMatchingContingenciesContainingAny(t,r.get(j),s.codedValueFields)),!a(o))for(const r of o){const i=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,s.rangeFields):this._joinContingencies(r,t);if(a(i))break;const[n]=this._hashContingency(i,l.codedValueFields,!0);e.has(n)?e.get(n).push(i):e.set(n,[i])}}r=e,n=i,s=l,o=new Set([...o,...n.fields])}const u=[];for(const c of n.contingencies){const[e,t]=this._hashContingency(c,s.codedValueFields),i=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(j)&&i.push(...this._findMatchingContingenciesContainingAny(c,r.get(j),s.codedValueFields)),!a(i))for(const n of i){const e=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,c,s.rangeFields):this._joinContingencies(n,c);l(e)&&u.push(e)}}return u}_joinContingencies(e,t){const i={values:{...e.values,...t.values}};for(const[n,s]of Object.entries(i.values))"any"===s.objectType&&l(e.values[n])&&(i.values[n]=e.values[n]);return i}_joinContingenciesWithRangeDomains(e,t,i){const n=this._joinContingencies(e,t);for(const s of i){const i=e.values[s],o=t.values[s],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:c,bothAreAny:p,leftIsRange:d,rightIsRange:h}=this._compareObjectTypes(i.objectType,o.objectType);if(l||p)continue;if(r&&c||a&&u){n.values[s]=new f({objectType:"null"});continue}if(r&&h||a&&d)return null;u?(i.minValue=-1/0,i.maxValue=1/0):c&&(o.minValue=-1/0,o.maxValue=1/0);const m=Math.max(i.minValue,o.minValue),g=Math.min(i.maxValue,o.maxValue);if(m>g)return null;n.values[s]=new f({objectType:"range",minValue:m,maxValue:g})}return n}_findMatchingContingenciesContainingAny(e,t,i){return t.filter((t=>i.every((i=>{const n=t.values[i],s=e.values[i];return"any"===n.objectType||"any"===s.objectType||n.codedValue?.code===s.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const i=RegExp(`${t}$`),n=[];for(const[s,o]of e){if(s===j)break;i.test(s)&&n.push(...o)}return n}_generateJoinKey(e,t){const i=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,s=i.size<n.size?i:n,o=s===i?n:i,r=new Set,l=new Set;for(const u of s)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(a(e))continue;switch(e.type){case"coded-value":r.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...r],rangeFields:[...l]}}_hashContingency(e,t,i=!1){if(t.length<1)return[x,!1];const n=[];let s=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(i)return[j,!0];s=!0,n.push(`${o}:.*`)}else"null"===t.objectType?n.push(`${o}:${w}`):n.push(`${o}:${t.codedValue?.code}`)}return[n.sort().join("&"),s]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([p({readOnly:!0})],I.prototype,"allInputFields",null),e([p()],I.prototype,"_layerFieldsByName",null),e([p()],I.prototype,"_inputFieldCache",void 0),e([p()],I.prototype,"contingencyConstraintViolations",void 0),e([p()],I.prototype,"feature",null),e([p()],I.prototype,"fieldsWithContingentValues",null),e([p({type:h})],I.prototype,"formTemplate",null),e([p({readOnly:!0})],I.prototype,"inputFields",null),e([p()],I.prototype,"joinedContingentValues",null),e([p()],I.prototype,"layer",null),e([p()],I.prototype,"messages",void 0),e([p()],I.prototype,"spatialReference",null),e([p()],I.prototype,"state",null),e([p()],I.prototype,"strict",void 0),e([p()],I.prototype,"submittable",null),e([p()],I.prototype,"valid",null),e([p()],I.prototype,"getValues",null),e([p()],I.prototype,"submit",null),I=e([d(b)],I);const T=e=>!!e.inputFields,k=e=>"group"===e.type,A=(e,t,i)=>{l(t)&&e.set(t,i)},M=I;export{M as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as n}from"../../core/HandleOwner.js";import{makeHandle as s}from"../../core/handleUtils.js";import o from"../../core/Logger.js";import{destroyMaybe as r,isNone as a,isSome as l}from"../../core/maybe.js";import{EsriPromiseMixin as u}from"../../core/Promise.js";import{watch as c}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import h from"../../form/FormTemplate.js";import f from"../../layers/support/ContingentValue.js";import m from"../../layers/support/LayerContingentValuesCache.js";import{loadArcade as g}from"../../support/arcadeOnDemand.js";import y from"./InputField.js";import _ from"./InputFieldGroup.js";import{onLocaleChange as F}from"../../intl/locale.js";import{fetchMessageBundle as C}from"../../intl/messages.js";const v=new t({attributes:{}}),b="esri.widgets.FeatureForm.FeatureFormViewModel",E=o.getLogger(b),V=["editable","required","value","visibility"],x="#JSAPI_CONTINGENT_VALUE_EMPTY_HASH",j="#JSAPI_CONTINGENT_VALUE_ANY_HASH",w="#JSAPI_CONTINGENT_VALUE_NULL_HASH";let I=class extends(n(u(i.EventedAccessor))){constructor(e){super(e),this._arcade=null,this._compiledExpressionLookup=new Map,this._expressionLookup=new Map,this._expressionInvalidationCallbacks=new Set,this._contingentValuesCache=null,this._featureClone=v.clone(),this._initialFeature=v.clone(),this._arcadeGeometryOperationsEnabled=!1,this._inputFieldCache=[],this.contingencyConstraintViolations=new Map,this.messages=null,this.strict=!1}initialize(){const e=async()=>this.messages=await C("esri/widgets/FeatureForm/t9n/FeatureForm");e();const t=c((()=>this.layer),(e=>{"feature"===e?.type&&this.addResolvingPromise(m.createLoadedLayerContingentValuesCache(e).then((e=>{this._contingentValuesCache=e,this.notifyChange("fieldsWithContingentValues")})))}),{initial:!0}),i=c((()=>this.feature?.geometry),(e=>{this._featureClone.geometry=e;for(const t of this._expressionInvalidationCallbacks)t()}));this.handles.add([F(e),t,i])}destroy(){this.feature=null,this.layer=null,this._contingentValuesCache=r(this._contingentValuesCache)}get allInputFields(){return this.inputFields.reduce(((e,t)=>T(t)?[...e,...t.inputFields]:[...e,t]),[])}get _layerFieldsByName(){return new Map(this.layer.fields.map((e=>[e.name,e])))}get feature(){return this._get("feature")}set feature(e){this._featureClone=e?e.clone():v.clone(),this._initialFeature=this._featureClone.clone(),this.contingencyConstraintViolations.clear(),this._clearInputFieldCache(),this._set("feature",e)}get fieldsWithContingentValues(){if(a(this._contingentValuesCache))return new Set;const e=this._contingentValuesCache.fieldGroups.flatMap((e=>e.fields));return new Set(e)}get formTemplate(){return this.layer&&"formTemplate"in this.layer?this.layer.formTemplate:null}set formTemplate(e){null!=e?this._override("formTemplate",e):this._clearOverride("formTemplate")}get inputFields(){const{_arcade:e,_featureClone:t,_initialFeature:i,_inputFieldCache:n,formTemplate:s,messages:o,layer:r,state:a,spatialReference:u}=this;if("ready"!==a)return[];const c={arcade:e,feature:t,initialFeature:i,layer:r,messages:o,expressionTrackingProvider:{registerExpression:this._registerExpression.bind(this)},spatialReference:u},p=l(s)&&s.elements.length>0?this._updateInputFieldsFromElements(n,s.elements,c):this._updateInputFieldsFromLayerFields(n,r?.fields,c);return this._inputFieldCache=p,p}get joinedContingentValues(){return this._joinContingentValues()}get layer(){return this.feature?.sourceLayer&&"applyEdits"in this.feature.sourceLayer?this.feature.sourceLayer:null}set layer(e){e?this._override("layer",e):this._clearOverride("layer")}get spatialReference(){return this.layer?.spatialReference||null}set spatialReference(e){void 0===e?this._clearOverride("spatialReference"):this._override("spatialReference",e)}get state(){return this.messages&&this.get("layer.loaded")?"ready":"disabled"}get submittable(){return!!this.valid||this.allInputFields.filter((e=>!e.valid)).every((({submittable:e})=>e))}get valid(){const e=this.allInputFields;return e.length>0&&e.every((({valid:e})=>e))}findField(e){return this.allInputFields.find((t=>t.name===e))}getValue(e){const{_featureClone:t,layer:i}=this,n=!!i?.getField(e);return t.getAttribute(e)??(n?null:void 0)}setValue(e,t){const{_featureClone:i,strict:n}=this,s=this.findField(e);t=""===t?null:t,s&&i.getAttribute(e)!==t&&(s.value=t,n&&!s.valid||this._afterValueChange(s))}getValues(){return{...this._featureClone.attributes}}submit(){const e=this.allInputFields,t=new Set(e.filter((e=>e.valid)).map((({name:e})=>e))),i=e.filter((e=>!e.valid)).map((({name:e})=>e)),n=this.getValues();if(this.validateContingencyConstraints(n,{includeIncompleteViolations:!0}).length>0)for(const[s,o]of this.contingencyConstraintViolations.entries())"error"===o.type&&(t.delete(s),i.push(s));this.emit("submit",{valid:[...t],invalid:i,values:n})}validateContingencyConstraints(e,t){const{_contingentValuesCache:i}=this,n=new Map;if(this.contingencyConstraintViolations=n,a(i))return[];const{invalid:s,incomplete:o}=i.validateContingencyConstraints(e),r=[...s,...t?.includeIncompleteViolations?o:[]];for(const a of r)for(const e of a.fieldGroup.fields)n.set(e,a);return r}_emitChangeEvent({name:e,valid:t,value:i}){this.emit("value-change",{layer:this.layer,feature:this.feature,fieldName:e,value:i,valid:t})}_updateInputFieldsFromElements(e,t,i){const n=new Map;for(const o of e)if(T(o)){A(n,o.groupElement,o);for(const e of o.inputFields)A(n,e.fieldElement,e)}else A(n,o.fieldElement,o);const s=this._updateInputFieldsRecursive(n,t.filter(this._isSupportedElement),i);for(const[o,r]of n.entries())n.delete(o),r.destroy();return s}_updateInputFieldsRecursive(e,t,i,n=null){const s=[];for(const o of t){const t=e.has(o),r=t?e.get(o):k(o)?this._makeInputFieldGroupFromGroupElement(o,i):this._makeInputFieldFromFieldElement(o,i,n);if(s.push(r),t)if(e.delete(o),T(r)){const{arcade:e,feature:t,expressionTrackingProvider:n,spatialReference:s}=i;r.set({arcade:e,feature:t,expressionTrackingProvider:n,spatialReference:s})}else r.set(i);if(k(o)){const t=o.elements.filter((e=>this._isSupportedElement(e)));r.inputFields=this._updateInputFieldsRecursive(e,t,i,r)}}return s}_updateInputFieldsFromLayerFields(e,t,i){if(!Array.isArray(t))return E.warn(b,"No attribute fields found."),[];const n=new Map;for(const c of e)if(T(c)){for(const e of c.inputFields)e.destroy();c.inputFields.length=0,c.destroy()}else n.set(c.field,c);const s=[],{feature:o,initialFeature:r,layer:a,messages:l,spatialReference:u}=i;for(const c of t){const e=n.get(c)??new y({field:c,feature:o,initialFeature:r,layer:a,messages:l,spatialReference:u,value:o.getAttribute(c.name)});e.set({fieldElement:null,requiredFunction:null,visibilityFunction:null,valueFunction:null,editableFunction:null}),s.push(e),n.delete(c)}for(const[c,p]of n.entries())n.delete(c),p.destroy();return s}_makeInputFieldFromFieldElement(e,t,i=null){const{arcade:n,expressionTrackingProvider:o,feature:r,initialFeature:a,layer:u,messages:p,spatialReference:d}=t,h=new y({fieldElement:e,field:this._layerFieldsByName.get(e.fieldName),requiredFunction:this._getCompiledExpression(e.requiredExpression),visibilityFunction:this._getCompiledExpression(e.visibilityExpression),valueFunction:this._getCompiledExpression(e.valueExpression),editableFunction:this._getCompiledExpression(e.editableExpression),group:i,arcade:n,expressionTrackingProvider:o,feature:r,initialFeature:a,layer:u,messages:p,spatialReference:d,value:r.getAttribute(e.fieldName)}),f=`watch-expression-field-${h.id}`,m=c((()=>h.fieldElement),(e=>{this.handles.remove(f),l(e)&&this.handles.add(V.map((t=>c((()=>e[`${t}Expression`]),(async e=>{e&&""!==e&&(h[`${t}Function`]=await this._getOrMakeCompiledExpression(e),h.arcade=this._arcade)}),{initial:!0,sync:!0}))),f)}),{initial:!0,sync:!0}),g=s((()=>this.handles.remove(f))),_=c((()=>h.value),(()=>this._afterValueChange(h)));return h.own([m,g,_]),h}_makeInputFieldGroupFromGroupElement(e,t){const{arcade:i,feature:n,expressionTrackingProvider:s,spatialReference:o}=t,r=new _({groupElement:e,visibilityFunction:this._getCompiledExpression(e.visibilityExpression),inputFields:[],arcade:i,feature:n,expressionTrackingProvider:s,spatialReference:o});return r.own(c((()=>r.groupElement),(e=>l(e)&&e.own(c((()=>e.visibilityExpression),(async e=>{e&&""!==e&&(r.visibilityFunction=await this._getOrMakeCompiledExpression(e),r.arcade=this._arcade)}),{initial:!0}))),{initial:!0})),r}_clearInputFieldCache(){for(const e of this._inputFieldCache)e.destroy();this._inputFieldCache=[]}_afterValueChange(e){const{name:t,value:i}=e;if(this.get("layer.typeIdField")===t&&"types"in this.layer){const e=new Set;this.layer.types.forEach((t=>Object.keys(t.domains).forEach((t=>e.add(t))))),e.forEach((e=>{const t=this.findField(e);t&&t.notifyChange("domain")}))}this._featureClone.setAttribute(t,i);for(const n of this._expressionInvalidationCallbacks)n();this._emitChangeEvent(e)}_registerExpression(e){const{_expressionInvalidationCallbacks:t}=this;return t.add(e),s((()=>t.delete(e)))}_getCompiledExpression(e){return this._compiledExpressionLookup.get(this._expressionLookup.get(e))}async _getOrMakeCompiledExpression(e){{if(a(e)||""===e)return null;const t=this._expressionLookup.get(e)??this._addToExpressionLookup(e);if(this._compiledExpressionLookup.has(t))return this._compiledExpressionLookup.get(t);this._arcade||(this._arcade=await g());const i=this._arcade.arcadeUtils;return!this._arcadeGeometryOperationsEnabled&&i.hasGeometryOperations(t)&&(await i.enableGeometryOperations(),this._arcadeGeometryOperationsEnabled=!0),this._addToCompiledExpressionLookup(t)}}_addToCompiledExpressionLookup(e){const{_arcade:{arcadeUtils:t},_compiledExpressionLookup:i}=this,n=t.createFunction(e);return i.set(e,n),n}_addToExpressionLookup(e){const{_expressionLookup:t,formTemplate:i}=this,n=(l(i)&&l(i.expressionInfos)?Object.values(i.expressionInfos).find((t=>t.name===e)):null)?.expression??e;return t.set(e,n),e!==n&&t.set(n,n),n}_isSupportedElement(e){return"field"===e.type||"group"===e.type||(E.warn("form-info::unsupported-element-type","Only element types 'field' and 'group' are supported",`Element ${e.label} has unsupported type '${e.type}'`),!1)}_joinContingentValues(){const e=this._contingentValuesCache;if(a(e))return[];const t="typeIdField"in this.layer?this.layer.typeIdField:null,i=t?this.getValue(t):null,n=[];for(const r of e.fieldGroups){const{contingencies:e,fields:t,name:s}=r,o=[];for(const n of e)n.isRetired||l(n.subtype)&&n.subtype.code!==i||o.push({values:n.values});o.length>0&&n.push({name:s,fields:t,contingencies:o})}const[s,o]=this._generateJoinPlan(n);return[...s.flatMap((e=>this._joinFieldGroupContingencies(e))),...o.flatMap((e=>e.contingencies))]}_generateJoinPlan(e){const t=new Map,i=[],n=new Set;for(const l of e)for(const e of l.fields)if(t.has(e)){const s=t.get(e),o=l,r=[s.name,o.name].sort().join("|");if(n.has(r))continue;i.push([s,o]),n.add(r),t.set(e,o)}else t.set(e,l);const s=new Set(i.flat()),o=new Set(e);for(const l of s)o.delete(l);const r=new Map,a=new Map;for(const l of new Set(i.flat())){const e=Symbol(l.name);r.set(e,new Set([l])),a.set(l,e)}for(const[l,u]of i){const e=a.get(l),t=a.get(u);if(e===t)continue;const i=r.get(e),n=r.get(t);for(const s of n)i.add(s),a.set(s,e);r.delete(t)}return[[...r.values()].map((e=>[...e])),[...o]]}_joinFieldGroupContingencies(e){const t=e.slice(),i=t.shift();let n=t.shift(),s=this._generateJoinKey(i.fields,n.fields),o=new Set([...i.fields,...n.fields]),r=new Map;for(const a of i.contingencies){const[e]=this._hashContingency(a,s.codedValueFields,!0);r.has(e)?r.get(e).push(a):r.set(e,[a])}for(;t.length>0;){const e=new Map,i=t.shift(),l=this._generateJoinKey(o,i.fields);for(const t of n.contingencies){const[i,n]=this._hashContingency(t,s.codedValueFields),o=n?this._findMatchingContingenciesWithAnyHashMask(r,i):r.get(i);if(r.has(j)&&o.push(...this._findMatchingContingenciesContainingAny(t,r.get(j),s.codedValueFields)),!a(o))for(const r of o){const i=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(r,t,s.rangeFields):this._joinContingencies(r,t);if(a(i))break;const[n]=this._hashContingency(i,l.codedValueFields,!0);e.has(n)?e.get(n).push(i):e.set(n,[i])}}r=e,n=i,s=l,o=new Set([...o,...n.fields])}const u=[];for(const c of n.contingencies){const[e,t]=this._hashContingency(c,s.codedValueFields),i=t?this._findMatchingContingenciesWithAnyHashMask(r,e):r.get(e);if(r.has(j)&&i.push(...this._findMatchingContingenciesContainingAny(c,r.get(j),s.codedValueFields)),!a(i))for(const n of i){const e=s.rangeFields.length>0?this._joinContingenciesWithRangeDomains(n,c,s.rangeFields):this._joinContingencies(n,c);l(e)&&u.push(e)}}return u}_joinContingencies(e,t){const i={values:{...e.values,...t.values}};for(const[n,s]of Object.entries(i.values))"any"===s.objectType&&l(e.values[n])&&(i.values[n]=e.values[n]);return i}_joinContingenciesWithRangeDomains(e,t,i){const n=this._joinContingencies(e,t);for(const s of i){const i=e.values[s],o=t.values[s],{leftIsNull:r,rightIsNull:a,bothAreNull:l,leftIsAny:u,rightIsAny:c,bothAreAny:p,leftIsRange:d,rightIsRange:h}=this._compareObjectTypes(i.objectType,o.objectType);if(l||p)continue;if(r&&c||a&&u){n.values[s]=new f({objectType:"null"});continue}if(r&&h||a&&d)return null;u?(i.minValue=-1/0,i.maxValue=1/0):c&&(o.minValue=-1/0,o.maxValue=1/0);const m=Math.max(i.minValue,o.minValue),g=Math.min(i.maxValue,o.maxValue);if(m>g)return null;n.values[s]=new f({objectType:"range",minValue:m,maxValue:g})}return n}_findMatchingContingenciesContainingAny(e,t,i){return t.filter((t=>i.every((i=>{const n=t.values[i],s=e.values[i];return"any"===n.objectType||"any"===s.objectType||n.codedValue?.code===s.codedValue?.code}))))}_findMatchingContingenciesWithAnyHashMask(e,t){const i=RegExp(`${t}$`),n=[];for(const[s,o]of e){if(s===j)break;i.test(s)&&n.push(...o)}return n}_generateJoinKey(e,t){const i=Array.isArray(e)?new Set(e):e,n=Array.isArray(t)?new Set(t):t,s=i.size<n.size?i:n,o=s===i?n:i,r=new Set,l=new Set;for(const u of s)if(o.has(u)){const e=this.layer.getFieldDomain(u,{feature:this.feature});if(a(e))continue;switch(e.type){case"coded-value":r.add(u);break;case"range":l.add(u)}}return{codedValueFields:[...r],rangeFields:[...l]}}_hashContingency(e,t,i=!1){if(t.length<1)return[x,!1];const n=[];let s=!1;for(const o of t){const t=e.values[o];if("any"===t.objectType){if(i)return[j,!0];s=!0,n.push(`${o}:.*`)}else"null"===t.objectType?n.push(`${o}:${w}`):n.push(`${o}:${t.codedValue?.code}`)}return[n.sort().join("&"),s]}_compareObjectTypes(e,t){return{leftIsNull:"null"===e,rightIsNull:"null"===t,bothAreNull:"null"===e&&"null"===t,leftIsAny:"any"===e,rightIsAny:"any"===t,bothAreAny:"any"===e&&"any"===t,leftIsRange:"range"===e,rightIsRange:"range"===t}}};e([p({readOnly:!0})],I.prototype,"allInputFields",null),e([p()],I.prototype,"_layerFieldsByName",null),e([p()],I.prototype,"_inputFieldCache",void 0),e([p()],I.prototype,"contingencyConstraintViolations",void 0),e([p()],I.prototype,"feature",null),e([p()],I.prototype,"fieldsWithContingentValues",null),e([p({type:h})],I.prototype,"formTemplate",null),e([p({readOnly:!0})],I.prototype,"inputFields",null),e([p()],I.prototype,"joinedContingentValues",null),e([p()],I.prototype,"layer",null),e([p()],I.prototype,"messages",void 0),e([p()],I.prototype,"spatialReference",null),e([p()],I.prototype,"state",null),e([p()],I.prototype,"strict",void 0),e([p()],I.prototype,"submittable",null),e([p()],I.prototype,"valid",null),e([p()],I.prototype,"getValues",null),e([p()],I.prototype,"submit",null),I=e([d(b)],I);const T=e=>!!e.inputFields,k=e=>"group"===e.type,A=(e,t,i)=>{l(t)&&e.set(t,i)},M=I;export{M as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Accessor.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import{makeHandle as r}from"../../core/handleUtils.js";import{isSome as s,isNone as n,get as o}from"../../core/maybe.js";import{watch as l,syncAndInitial as a}from"../../core/reactiveUtils.js";import{generateUID as u}from"../../core/uid.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import c from"../../layers/support/CodedValueDomain.js";import"../../layers/support/Domain.js";import"../../layers/support/InheritedDomain.js";import"../../layers/support/RangeDomain.js";import{validateDomainValue as h,DomainValidationError as m,getDomainRange as y}from"../../layers/support/domainUtils.js";import{isNumericField as f,isStringField as g,isDateField as v,TypeValidationError as E,validateFieldValue as x,getFeatureEditFields as b,getFeatureGeometryFields as _,NumericRangeValidationError as F,getFieldRange as T}from"../../layers/support/fieldUtils.js";import{substitute as V}from"../../intl/substitute.js";var U,O;!function(e){e.Text="text",e.Number="number",e.Date="date",e.Unsupported="unsupported"}(U||(U={})),function(e){e.TOO_SHORT="length-validation-error::too-short"}(O||(O={}));const R={type:"number"},j={type:"number",intlOptions:{notation:"scientific"}},A={type:"date",intlOptions:{day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}};function D(e){return e>=1e7||e<=-1e7}const w=["editable","required","value","visibility"];let N=class extends(i(t)){constructor(e){super(e),this._storedValue=null,this._expressionTrackingHandles=new Map,this.arcade=null,this.editableFunction=null,this.id=u().toString(),this.requiredFunction=null,this.expressionTrackingProvider={registerExpression:()=>r()},this.valueFunction=null,this.visibilityFunction=null,this.feature=null,this.field=null,this.fieldElement=null,this.layer=null,this.description=null,this.inputType=null,this.error=null,this.group=null,this.hint=null,this.messages=null,this.name=null}initialize(){const e=e=>"value"!==e,t=w.filter(e);this.own(t.map((e=>l((()=>this.get(`${e}Function`)),(t=>{s(t)?this._registerExpressionWithTrackingProvider(e):this._unregisterExpressionWithTrackingProvider(e)}),a))))}get _configAllowsEdits(){const{fieldElement:e,layer:t,name:i}=this;if(s(e))return e.editableExpression?this.evaluatedEditableExpression:!1!==e.editable;return("subtype-group"!==t?.type?t?.popupTemplate?.fieldInfos?.find((({fieldName:e})=>e===i)):null)?.isEditable??!0}get _layerFieldAllowsEdits(){const{field:e,layer:t}=this;return t?.capabilities.operations.supportsEditing&&e?.editable}get isUsingValueExpression(){return this._shouldUseValueExpression()}get evaluatedEditableExpression(){const{editableFunction:e,spatialReference:t}=this;if(n(e))return null;const{arcade:i}=this,r=i.arcadeUtils.getViewInfo({spatialReference:t});return i.arcadeUtils.executeFunction(e,i.arcadeUtils.createExecContext(this.feature,r))}get evaluatedRequiredExpression(){const{requiredFunction:e,spatialReference:t}=this;if(n(e))return null;const{arcade:i}=this,r=i.arcadeUtils.getViewInfo({spatialReference:t});return i.arcadeUtils.executeFunction(e,i.arcadeUtils.createExecContext(this.feature,r))}get evaluatedVisibilityExpression(){const{visibilityFunction:e,spatialReference:t}=this;if(n(e))return null;const{arcade:i}=this,r=i.arcadeUtils.getViewInfo({spatialReference:t});return i.arcadeUtils.executeFunction(e,i.arcadeUtils.createExecContext(this.feature,r))}get evaluatedValueExpression(){const{valueFunction:e,spatialReference:t}=this;if(n(e))return null;const{arcade:i}=this,r=i.arcadeUtils.getViewInfo({spatialReference:t});return i.arcadeUtils.executeFunction(e,i.arcadeUtils.createExecContext(this.feature,r))}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get domain(){const{typeIdField:e}=this.layer,t=e===this.name,i=this.field?.domain;if(t&&!i){const{layer:e}=this,t="subtype-group"===e.type?e.sublayers.map((({subtypeCode:e,title:t})=>({id:e,name:t}))):e.types.map((({id:e,name:t})=>({code:e,name:t})));return new c({name:"__internal-type-based-coded-value-domain__",codedValues:t})}const{feature:r}=this,n=e&&this.layer.getFieldDomain(this.name,{feature:r})||i,l=o(this.fieldElement,"domain");return s(l)&&this._isDomainCompatible(l)?l:n}get editable(){return!!this._layerFieldAllowsEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get errorMessage(){return this._toErrorMessage()}get includeTime(){const{fieldElement:e}=this,t=s(e)&&"datetime-picker"===e.input?.type?e.input.includeTime:void 0;return void 0===t||t}get label(){return s(this.fieldElement)&&this.fieldElement.label||this.field.alias||this.field.name}get maxLength(){const e=-1;if(this.type===U.Date)return e;const{field:t,fieldElement:i}=this,r=t?.length,n=s(i)&&k(i.input)?i.input.maxLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:r}get minLength(){const e=-1;if(this.type===U.Date)return e;const{field:t,fieldElement:i}=this,r=t?.length,n=s(i)&&k(i.input)?i.input.minLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:e}get required(){return!!this.editable&&(!1===this.field?.nullable||(this.evaluatedRequiredExpression??!1))}get spatialReference(){return this.layer?.spatialReference||null}set spatialReference(e){void 0===e?this._clearOverride("spatialReference"):this._override("spatialReference",e)}get submittable(){const{field:e,required:t,valid:i,value:r}=this;return(!t||!n(r))&&(!!i||this.initialFeature.getAttribute(e.name)===r)}get type(){const{field:e}=this;return f(e)?U.Number:g(e)?U.Text:v(e)?U.Date:U.Unsupported}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){return this._shouldUseValueExpression()?this.evaluatedValueExpression:this.get("_storedValue")}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e)}get visible(){return!this._isEditorField()&&(s(this.fieldElement)?this.evaluatedVisibilityExpression??!0:this._isVisibleByDefault())}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&g(t)||"number"===i&&f(t))return!0}return!!("range"===e?.type&&f(t)||v(t))}_validate(){const{domain:e,field:t,initialFeature:i,minLength:r,required:s,type:n,valid:o,value:l}=this,a=s&&null===l,u=void 0!==o;return!a&&i.getAttribute(t.name)===l&&u?null:a?E.INVALID_TYPE:"text"===n&&r>-1&&"string"==typeof l&&l.length<r?O.TOO_SHORT:e?null!==l||s?h(e,l):null:x(t,l)}_isVisibleByDefault(){const e=this.field?.type;return"oid"!==e&&"global-id"!==e&&!this._isGeometryField()}_isEditorField(){return b(this.layer).includes(this.name)}_isGeometryField(){return _(this.layer).includes(this.name)}_shouldUseValueExpression(){const e=this._layerFieldAllowsEdits&&!this._configAllowsEdits&&s(this.valueFunction);return e?this._registerExpressionWithTrackingProvider("value"):this._unregisterExpressionWithTrackingProvider("value"),e}_toErrorMessage(){const{domain:e,field:t,messages:i,minLength:r,value:s,required:n,type:o}=this,l=this.error;if(n&&null===s)return i.validationErrors.cannotBeNull;if(l===m.VALUE_OUT_OF_RANGE||l===F.OUT_OF_RANGE){const r=y(e)||T(t);return V(i.validationErrors.outsideRange,r,{format:{max:"date"===o?A:D(r.max)?j:R,min:"date"===o?A:D(r.min)?j:R}})}return l===m.INVALID_CODED_VALUE?i.validationErrors.invalidCodedValue:l===E.INVALID_TYPE?i.validationErrors.invalidType:l===O.TOO_SHORT?V(i.validationErrors.tooShort,{min:r}):null}_registerExpressionWithTrackingProvider(e){const{_expressionTrackingHandles:t}=this;if(t.has(e))return;const i=`evaluated${C(e)}Expression`,r=this.expressionTrackingProvider.registerExpression((()=>this.notifyChange(i)));t.set(e,r)}_unregisterExpressionWithTrackingProvider(e){const{_expressionTrackingHandles:t}=this,i=t.get(e);i&&(i.remove(),t.delete(e))}};function k(e){return!!e&&"maxLength"in e}e([p()],N.prototype,"_storedValue",void 0),e([p()],N.prototype,"_configAllowsEdits",null),e([p()],N.prototype,"_layerFieldAllowsEdits",null),e([p()],N.prototype,"arcade",void 0),e([p()],N.prototype,"editableFunction",void 0),e([p()],N.prototype,"requiredFunction",void 0),e([p()],N.prototype,"expressionTrackingProvider",void 0),e([p()],N.prototype,"valueFunction",void 0),e([p()],N.prototype,"isUsingValueExpression",null),e([p()],N.prototype,"visibilityFunction",void 0),e([p()],N.prototype,"evaluatedEditableExpression",null),e([p()],N.prototype,"evaluatedRequiredExpression",null),e([p()],N.prototype,"evaluatedVisibilityExpression",null),e([p()],N.prototype,"evaluatedValueExpression",null),e([p()],N.prototype,"feature",void 0),e([p()],N.prototype,"field",void 0),e([p()],N.prototype,"fieldElement",void 0),e([p()],N.prototype,"initialFeature",null),e([p()],N.prototype,"layer",void 0),e([p({aliasOf:"fieldElement.description"})],N.prototype,"description",void 0),e([p()],N.prototype,"domain",null),e([p()],N.prototype,"editable",null),e([p({aliasOf:"fieldElement.input.type"})],N.prototype,"inputType",void 0),e([p({readOnly:!0})],N.prototype,"error",void 0),e([p({dependsOn:["error","messages","value"]})],N.prototype,"errorMessage",null),e([p()],N.prototype,"group",void 0),e([p({aliasOf:"fieldElement.hint"})],N.prototype,"hint",void 0),e([p()],N.prototype,"includeTime",null),e([p()],N.prototype,"label",null),e([p()],N.prototype,"maxLength",null),e([p()],N.prototype,"minLength",null),e([p()],N.prototype,"messages",void 0),e([p({aliasOf:"field.name"})],N.prototype,"name",void 0),e([p()],N.prototype,"required",null),e([p()],N.prototype,"spatialReference",null),e([p()],N.prototype,"submittable",null),e([p()],N.prototype,"type",null),e([p()],N.prototype,"valid",null),e([p({value:null})],N.prototype,"value",null),e([p()],N.prototype,"visible",null),N=e([d("esri.widgets.FeatureForm.InputField")],N);const C=e=>e.charAt(0).toUpperCase()+e.slice(1),I=N;export{I as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import t from"../../core/Accessor.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import{makeHandle as r}from"../../core/handleUtils.js";import{isSome as s,isNone as n,get as o}from"../../core/maybe.js";import{watch as l,syncAndInitial as a}from"../../core/reactiveUtils.js";import{generateUID as u}from"../../core/uid.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import c from"../../layers/support/CodedValueDomain.js";import"../../layers/support/Domain.js";import"../../layers/support/InheritedDomain.js";import"../../layers/support/RangeDomain.js";import{validateDomainValue as h,DomainValidationError as m,getDomainRange as f}from"../../layers/support/domainUtils.js";import{isNumericField as y,isStringField as g,isDateField as v,TypeValidationError as E,validateFieldValue as x,getFeatureEditFields as b,getFeatureGeometryFields as _,NumericRangeValidationError as F,getFieldRange as T}from"../../layers/support/fieldUtils.js";import{substitute as V}from"../../intl/substitute.js";var U,O;!function(e){e.Text="text",e.Number="number",e.Date="date",e.Unsupported="unsupported"}(U||(U={})),function(e){e.TOO_SHORT="length-validation-error::too-short"}(O||(O={}));const R={type:"number"},j={type:"number",intlOptions:{notation:"scientific"}},D={type:"date",intlOptions:{day:"2-digit",month:"2-digit",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}};function A(e){return e>=1e7||e<=-1e7}const w=["editable","required","value","visibility"];let N=class extends(i(t)){constructor(e){super(e),this._storedValue=null,this._expressionTrackingHandles=new Map,this.arcade=null,this.editableFunction=null,this.id=u().toString(),this.requiredFunction=null,this.expressionTrackingProvider={registerExpression:()=>r()},this.valueFunction=null,this.visibilityFunction=null,this.feature=null,this.field=null,this.fieldElement=null,this.layer=null,this.description=null,this.inputType=null,this.error=null,this.group=null,this.hint=null,this.messages=null,this.name=null}initialize(){const e=e=>"value"!==e,t=w.filter(e);this.own(t.map((e=>l((()=>this.get(`${e}Function`)),(t=>{s(t)?this._registerExpressionWithTrackingProvider(e):this._unregisterExpressionWithTrackingProvider(e)}),a))))}get _configAllowsEdits(){const{fieldElement:e,layer:t,name:i}=this;if(s(e))return e.editableExpression?this.evaluatedEditableExpression:!1!==e.editable;return("subtype-group"!==t?.type?t?.popupTemplate?.fieldInfos?.find((({fieldName:e})=>e===i)):null)?.isEditable??!0}get _layerFieldAllowsEdits(){const{field:e,layer:t}=this;return t?.capabilities.operations.supportsEditing&&e?.editable}get isUsingValueExpression(){return this._shouldUseValueExpression()}get evaluatedEditableExpression(){const{editableFunction:e,spatialReference:t}=this;if(n(e))return null;const{arcade:i}=this,r=i.arcadeUtils.getViewInfo({spatialReference:t});return i.arcadeUtils.executeFunction(e,i.arcadeUtils.createExecContext(this.feature,r))}get evaluatedRequiredExpression(){const{requiredFunction:e,spatialReference:t}=this;if(n(e))return null;const{arcade:i}=this,r=i.arcadeUtils.getViewInfo({spatialReference:t});return i.arcadeUtils.executeFunction(e,i.arcadeUtils.createExecContext(this.feature,r))}get evaluatedVisibilityExpression(){const{visibilityFunction:e,spatialReference:t}=this;if(n(e))return null;const{arcade:i}=this,r=i.arcadeUtils.getViewInfo({spatialReference:t});return i.arcadeUtils.executeFunction(e,i.arcadeUtils.createExecContext(this.feature,r))}get evaluatedValueExpression(){const{valueFunction:e,spatialReference:t}=this;if(n(e))return null;const{arcade:i}=this,r=i.arcadeUtils.getViewInfo({spatialReference:t});return i.arcadeUtils.executeFunction(e,i.arcadeUtils.createExecContext(this.feature,r))}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get domain(){const{typeIdField:e}=this.layer,t=e===this.name,i=this.field?.domain;if(t&&!i){const{layer:e}=this,t="subtype-group"===e.type?e.sublayers.map((({subtypeCode:e,title:t})=>({id:e,name:t}))):e.types.map((({id:e,name:t})=>({code:e,name:t})));return new c({name:"__internal-type-based-coded-value-domain__",codedValues:t})}const{feature:r}=this,n=e&&this.layer.getFieldDomain(this.name,{feature:r})||i,l=o(this.fieldElement,"domain");return s(l)&&this._isDomainCompatible(l)?l:n}get editable(){return!!this._layerFieldAllowsEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get errorMessage(){return this._toErrorMessage()}get includeTime(){const{fieldElement:e}=this,t=s(e)&&"datetime-picker"===e.input?.type?e.input.includeTime:void 0;return void 0===t||t}get label(){return s(this.fieldElement)&&this.fieldElement.label||this.field.alias||this.field.name}get maxLength(){const e=-1;if(this.type===U.Date)return e;const{field:t,fieldElement:i}=this,r=t?.length,n=s(i)&&k(i.input)?i.input.maxLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:r}get minLength(){const e=-1;if(this.type===U.Date)return e;const{field:t,fieldElement:i}=this,r=t?.length,n=s(i)&&k(i.input)?i.input.minLength:NaN;return!isNaN(n)&&n>=e&&(r===e||n<=r)?n:e}get required(){return!!this.editable&&(!1===this.field?.nullable||(this.evaluatedRequiredExpression??!1))}get spatialReference(){return this.layer?.spatialReference||null}set spatialReference(e){void 0===e?this._clearOverride("spatialReference"):this._override("spatialReference",e)}get submittable(){const{field:e,required:t,valid:i,value:r}=this;return(!t||!n(r))&&(!!i||this.initialFeature.getAttribute(e.name)===r)}get type(){const{field:e}=this;return y(e)?U.Number:g(e)?U.Text:v(e)?U.Date:U.Unsupported}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){if(this._shouldUseValueExpression()){const e=this.evaluatedValueExpression;return this.type===U.Date&&e instanceof Date?e.getTime():s(e)&&"object"==typeof e?e.toString():e}return this.get("_storedValue")}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e)}get visible(){return!this._isEditorField()&&(s(this.fieldElement)?this.evaluatedVisibilityExpression??!0:this._isVisibleByDefault())}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&g(t)||"number"===i&&y(t))return!0}return!!("range"===e?.type&&y(t)||v(t))}_validate(){const{domain:e,field:t,initialFeature:i,minLength:r,required:s,type:n,valid:o,value:l}=this,a=s&&null===l,u=void 0!==o;return!a&&i.getAttribute(t.name)===l&&u?null:a?E.INVALID_TYPE:"text"===n&&r>-1&&"string"==typeof l&&l.length<r?O.TOO_SHORT:e?null!==l||s?h(e,l):null:x(t,l)}_isVisibleByDefault(){const e=this.field?.type;return"oid"!==e&&"global-id"!==e&&!this._isGeometryField()}_isEditorField(){return b(this.layer).includes(this.name)}_isGeometryField(){return _(this.layer).includes(this.name)}_shouldUseValueExpression(){const e=this._layerFieldAllowsEdits&&!this._configAllowsEdits&&s(this.valueFunction);return e?this._registerExpressionWithTrackingProvider("value"):this._unregisterExpressionWithTrackingProvider("value"),e}_toErrorMessage(){const{domain:e,field:t,messages:i,minLength:r,value:s,required:n,type:o}=this,l=this.error;if(n&&null===s)return i.validationErrors.cannotBeNull;if(l===m.VALUE_OUT_OF_RANGE||l===F.OUT_OF_RANGE){const r=f(e)||T(t);return V(i.validationErrors.outsideRange,r,{format:{max:"date"===o?D:A(r.max)?j:R,min:"date"===o?D:A(r.min)?j:R}})}return l===m.INVALID_CODED_VALUE?i.validationErrors.invalidCodedValue:l===E.INVALID_TYPE?i.validationErrors.invalidType:l===O.TOO_SHORT?V(i.validationErrors.tooShort,{min:r}):null}_registerExpressionWithTrackingProvider(e){const{_expressionTrackingHandles:t}=this;if(t.has(e))return;const i=`evaluated${C(e)}Expression`,r=this.expressionTrackingProvider.registerExpression((()=>this.notifyChange(i)));t.set(e,r)}_unregisterExpressionWithTrackingProvider(e){const{_expressionTrackingHandles:t}=this,i=t.get(e);i&&(i.remove(),t.delete(e))}};function k(e){return!!e&&"maxLength"in e}e([p()],N.prototype,"_storedValue",void 0),e([p()],N.prototype,"_configAllowsEdits",null),e([p()],N.prototype,"_layerFieldAllowsEdits",null),e([p()],N.prototype,"arcade",void 0),e([p()],N.prototype,"editableFunction",void 0),e([p()],N.prototype,"requiredFunction",void 0),e([p()],N.prototype,"expressionTrackingProvider",void 0),e([p()],N.prototype,"valueFunction",void 0),e([p()],N.prototype,"isUsingValueExpression",null),e([p()],N.prototype,"visibilityFunction",void 0),e([p()],N.prototype,"evaluatedEditableExpression",null),e([p()],N.prototype,"evaluatedRequiredExpression",null),e([p()],N.prototype,"evaluatedVisibilityExpression",null),e([p()],N.prototype,"evaluatedValueExpression",null),e([p()],N.prototype,"feature",void 0),e([p()],N.prototype,"field",void 0),e([p()],N.prototype,"fieldElement",void 0),e([p()],N.prototype,"initialFeature",null),e([p()],N.prototype,"layer",void 0),e([p({aliasOf:"fieldElement.description"})],N.prototype,"description",void 0),e([p()],N.prototype,"domain",null),e([p()],N.prototype,"editable",null),e([p({aliasOf:"fieldElement.input.type"})],N.prototype,"inputType",void 0),e([p({readOnly:!0})],N.prototype,"error",void 0),e([p({dependsOn:["error","messages","value"]})],N.prototype,"errorMessage",null),e([p()],N.prototype,"group",void 0),e([p({aliasOf:"fieldElement.hint"})],N.prototype,"hint",void 0),e([p()],N.prototype,"includeTime",null),e([p()],N.prototype,"label",null),e([p()],N.prototype,"maxLength",null),e([p()],N.prototype,"minLength",null),e([p()],N.prototype,"messages",void 0),e([p({aliasOf:"field.name"})],N.prototype,"name",void 0),e([p()],N.prototype,"required",null),e([p()],N.prototype,"spatialReference",null),e([p()],N.prototype,"submittable",null),e([p()],N.prototype,"type",null),e([p()],N.prototype,"valid",null),e([p({value:null})],N.prototype,"value",null),e([p()],N.prototype,"visible",null),N=e([d("esri.widgets.FeatureForm.InputField")],N);const C=e=>e.charAt(0).toUpperCase()+e.slice(1),I=N;export{I as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import o from"../../../core/Error.js";import{HandleOwnerMixin as i}from"../../../core/HandleOwner.js";import{watch as s,initial as t}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{canDisplayLayer as l}from"../../LayerList/support/layerListUtils.js";import{SnappingLayerListViewModel as c}from"./SnappingLayerListViewModel.js";const d="esri.widgets.support.SnappingControls.SnappingControlsViewModel";let u=class extends(i(r)){constructor(e){super(e),this.layerListViewModel=new c,this.snappingOptions=null,this.view=null}initialize(){this.handles.add([s((()=>({viewModel:this.layerListViewModel,view:this.view})),(({viewModel:e,view:r})=>{e.view=r}),t),s((()=>({viewModel:this.layerListViewModel,sources:this.snappingOptions?.featureSources})),(({viewModel:e,sources:r})=>{e.featureSnappingSources=r}),t)])}get state(){return this.get("snappingOptions")?"ready":"disabled"}enableSnappingForLayer(e){(this._findSnappingSourceForLayer(e)??this._makeSnappingSourceForLayer(e)).enabled=!0}disableSnappingForLayer(e){const r=this._findSnappingSourceForLayer(e);r&&(r.enabled=!1)}updateEnabledFeatureSources(e){for(const r of this.snappingOptions.featureSources)l(r.layer)&&(r.enabled=e.includes(r.layer.id))}_findSnappingSourceForLayer(e){return this.snappingOptions.featureSources.find((r=>r.layer.id===e))}_makeSnappingSourceForLayer(e){const{layer:r}=this.layerListViewModel.operationalItemsFlat.find((r=>r.layer.id===e));if(!r)throw new o("snapping-controls:layer-not-found",`cannot enable snapping for layer with id ${e} because no such layer was found in the view`);const i=new p({layer:r});this.snappingOptions.featureSources.add(i);const s=this.layerListViewModel.operationalItemsFlat.find((r=>r.layer.id===e));return s&&(s.featureSource=i),i}};e([n({constructOnly:!0})],u.prototype,"layerListViewModel",void 0),e([n({constructOnly:!0})],u.prototype,"snappingOptions",void 0),e([n()],u.prototype,"state",null),e([n({constructOnly:!0})],u.prototype,"view",void 0),u=e([a(d)],u);const y=u;export{y as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import o from"../../../core/Error.js";import{HandleOwnerMixin as s}from"../../../core/HandleOwner.js";import{watch as i,initial as t}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{canDisplayLayer as l}from"../../LayerList/support/layerListUtils.js";import{SnappingLayerListViewModel as c}from"./SnappingLayerListViewModel.js";const u="esri.widgets.support.SnappingControls.SnappingControlsViewModel";let d=class extends(s(r)){constructor(e){super(e),this.layerListViewModel=new c,this.snappingOptions=null,this.view=null}initialize(){this.handles.add([i((()=>({viewModel:this.layerListViewModel,view:this.view})),(({viewModel:e,view:r})=>{e.view=r}),t),i((()=>({viewModel:this.layerListViewModel,sources:this.snappingOptions?.featureSources})),(({viewModel:e,sources:r})=>{e.featureSnappingSources=r}),t)])}get state(){return this.get("snappingOptions")?"ready":"disabled"}enableSnappingForLayer(e){(this._findSnappingSourceForLayer(e)??this._makeSnappingSourceForLayer(e)).enabled=!0}disableSnappingForLayer(e){const r=this._findSnappingSourceForLayer(e);r&&(r.enabled=!1)}updateEnabledFeatureSources(e){for(const r of this.snappingOptions.featureSources)l(r.layer)&&(r.enabled=e.includes(r.layer.id))}_findSnappingSourceForLayer(e){return this.snappingOptions.featureSources.find((r=>r.layer.id===e))}_makeSnappingSourceForLayer(e){const{layer:r}=this.layerListViewModel.operationalItemsFlat.find((r=>r.layer.id===e));if(!r)throw new o("snapping-controls:layer-not-found",`cannot enable snapping for layer with id ${e} because no such layer was found in the view`);const s=new p({layer:r});return this.snappingOptions.featureSources.add(s),s}};e([n({constructOnly:!0})],d.prototype,"layerListViewModel",void 0),e([n({constructOnly:!0})],d.prototype,"snappingOptions",void 0),e([n()],d.prototype,"state",null),e([n({constructOnly:!0})],d.prototype,"view",void 0),d=e([a(u)],d);const y=d;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Collection.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../LayerList/LayerListViewModel.js";import{isValidSnappingLayer as i}from"./snappingLayerListUtils.js";import{SnappingListItem as p}from"./SnappingListItem.js";let a=class extends o{constructor(){super(...arguments),this.featureSnappingSources=new t}get operationalItemsFlat(){return this.operationalItems.flatten((e=>e.children))}_compileList(){const e=this.get("view.map.layers");if(!e)return;const t=e.filter(i);this._watchLayersListMode(t);const r=this._getViewableLayers(t);r&&r.length?(this._createNewItems(r),this._removeItems(r),this._sortItems(r)):this._removeAllItems()}_createListItem(e){const{featureSnappingSources:t,view:r}=this,s=t.find((t=>t.layer===e));return new p({layer:e,view:r,featureSource:s})}};e([r()],a.prototype,"featureSnappingSources",void 0),e([r()],a.prototype,"operationalItems",void 0),a=e([s("esri.widgets.support.SnappingControls.SnappingLayerListViewModel")],a);export{a as SnappingLayerListViewModel};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Collection.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../../LayerList/LayerListViewModel.js";import{isValidSnappingLayer as i}from"./snappingLayerListUtils.js";import{SnappingListItem as p}from"./SnappingListItem.js";let a=class extends o{constructor(){super(...arguments),this.featureSnappingSources=new t}get operationalItemsFlat(){return this.operationalItems.flatten((e=>e.children))}_compileList(){const e=this.get("view.map.layers");if(!e)return;const t=e.filter(i);this._watchLayersListMode(t);const r=this._getViewableLayers(t);r&&r.length?(this._createNewItems(r),this._removeItems(r),this._sortItems(r)):this._removeAllItems()}_createListItem(e){return new p({layer:e,view:this.view,getFeatureSnappingSources:()=>this.featureSnappingSources})}};e([r()],a.prototype,"featureSnappingSources",void 0),e([r()],a.prototype,"operationalItems",void 0),a=e([s("esri.widgets.support.SnappingControls.SnappingLayerListViewModel")],a);export{a as SnappingLayerListViewModel};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../../../chunks/tslib.es6.js";import e from"../../../core/Collection.js";import{isSome as t}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../LayerList/ListItem.js";import{canDisplayLayer as p}from"../../LayerList/support/layerListUtils.js";import{isValidSnappingLayer as a}from"./snappingLayerListUtils.js";var n;let l=n=class extends i{constructor(){super(...arguments),this.children=new e,this.featureSource=null}get enabled(){return!!t(this.featureSource)&&this.featureSource.enabled}_initializeChildLayers(r){const e=r.filter(a);super._initializeChildLayers(e)}_makeChildren(r){return r.map((r=>p(r)?new n({layer:r,parent:this,view:this.view}):null)).reverse()}};r([o()],l.prototype,"children",void 0),r([o()],l.prototype,"enabled",null),r([o()],l.prototype,"featureSource",void 0),r([o()],l.prototype,"parent",void 0),l=n=r([s("esri.widgets.support.SnappingControls.SnappingListItem")],l);export{l as SnappingListItem};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../core/Collection.js";import{isSome as t}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../LayerList/ListItem.js";import{canDisplayLayer as p}from"../../LayerList/support/layerListUtils.js";import{isValidSnappingLayer as a}from"./snappingLayerListUtils.js";var n;let c=n=class extends i{constructor(e){super(e),this.children=new r}get enabled(){return!!t(this.featureSource)&&this.featureSource.enabled}get featureSource(){const{layer:e,getFeatureSnappingSources:r}=this;return r().find((r=>r.layer===e))}_initializeChildLayers(e){const r=e.filter(a);super._initializeChildLayers(r)}_makeChildren(e){return e.map((e=>p(e)?new n({layer:e,parent:this,view:this.view,getFeatureSnappingSources:this.getFeatureSnappingSources}):null)).reverse()}};e([o()],c.prototype,"children",void 0),e([o()],c.prototype,"enabled",null),e([o({constructOnly:!0})],c.prototype,"getFeatureSnappingSources",void 0),e([o()],c.prototype,"featureSource",null),e([o()],c.prototype,"parent",void 0),c=n=e([s("esri.widgets.support.SnappingControls.SnappingListItem")],c);export{c as SnappingListItem};