@arcgis/core 4.28.0-rc.2 → 4.28.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{0e354096ad8817971eed.js → 02d235849ba93541d7ad.js} +1 -1
  3. package/assets/esri/core/workers/chunks/0422c5160491fbcf01dc.js +1 -0
  4. package/assets/esri/core/workers/chunks/224e79f6c172da444e0a.js +1 -0
  5. package/assets/esri/core/workers/chunks/{ca3d5803cdf035d7389d.js → 30776102fbab294bfe7b.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{61dec8399919b278b636.js → 3ac9001b19a90faf5573.js} +1 -1
  7. package/assets/esri/core/workers/chunks/41081c921037e543a22f.js +1 -0
  8. package/assets/esri/core/workers/chunks/4564a7885d045a850887.js +1 -0
  9. package/assets/esri/core/workers/chunks/4adf3a8c6b49c381a633.js +1 -0
  10. package/assets/esri/core/workers/chunks/{2721aa6b6941b28b9758.js → 63c8bf00120a4e67f5b0.js} +1 -1
  11. package/assets/esri/core/workers/chunks/74951370a341f02d3714.js +1 -0
  12. package/assets/esri/core/workers/chunks/{fa6103e3d4e857b0035b.js → 78e2fa121760383b08ec.js} +9 -6
  13. package/assets/esri/core/workers/chunks/7b8377b3a9f78f9d3613.js +1 -0
  14. package/assets/esri/core/workers/chunks/{fd28400141a6751327ae.js → 7cf7f2b991a7cbdad2ce.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{1a723bb4a341f645e5fe.js → 83b8141f0c80e3448012.js} +1 -1
  16. package/assets/esri/core/workers/chunks/934c32c49bb9e21482fd.js +1 -0
  17. package/assets/esri/core/workers/chunks/969a82b674eda9f8720f.js +1 -0
  18. package/assets/esri/core/workers/chunks/a1e16c33f1843dbdce26.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d07235ce2765a25b9be4.js → a50ec5b647a160199cb2.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{77923afde29ae1ff10ca.js → b6e86e179f99b5cf8dff.js} +1 -1
  21. package/assets/esri/core/workers/chunks/c3ddf5dbc34f118002df.js +1 -0
  22. package/assets/esri/core/workers/chunks/{7b3d5f044c96e2c2af11.js → d191267d91a53db42956.js} +1 -1
  23. package/assets/esri/core/workers/chunks/ffa330a19a09679212fb.js +1 -0
  24. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +3 -9
  25. package/assets/esri/themes/base/widgets/_Legend.scss +1 -1
  26. package/assets/esri/themes/base/widgets/_TimeZoneLabel.scss +3 -3
  27. package/assets/esri/themes/dark/main.css +1 -1
  28. package/assets/esri/themes/light/main.css +1 -1
  29. package/assets/esri/themes/light/view.css +1 -1
  30. package/geometry/support/meshUtils/georeference.js +1 -1
  31. package/interfaces.d.ts +1254 -262
  32. package/kernel.js +1 -1
  33. package/layers/GroupLayer.js +1 -1
  34. package/layers/SceneLayer.js +1 -1
  35. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  36. package/layers/graphics/data/queryValidationUtils.js +1 -1
  37. package/layers/mixins/ArcGISMapService.js +1 -1
  38. package/layers/save/groupLayerUtils.js +1 -1
  39. package/layers/save/utils.js +1 -1
  40. package/layers/support/ImageElement.js +1 -1
  41. package/layers/support/Sublayer.js +1 -1
  42. package/layers/support/Subtype.d.ts +4 -0
  43. package/layers/support/Subtype.js +1 -1
  44. package/layers/support/imageryRendererUtils.js +1 -1
  45. package/networks/Network.js +1 -1
  46. package/package.json +1 -1
  47. package/portal/support/jsonContext.js +1 -1
  48. package/portal/support/layersLoader.js +1 -1
  49. package/rest/featureService/FeatureService.d.ts +4 -0
  50. package/rest/featureService/FeatureService.js +1 -1
  51. package/rest/featureService/utils.d.ts +4 -0
  52. package/rest/query/operations/query.js +1 -1
  53. package/support/basemapUtils.js +1 -1
  54. package/support/revision.js +1 -1
  55. package/versionManagement/VersionManagementService.d.ts +4 -0
  56. package/versionManagement/VersionManagementService.js +1 -1
  57. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  58. package/views/2d/engine/webgl/Overlay.js +1 -1
  59. package/views/2d/input/handlers/KeyPan.js +1 -1
  60. package/views/2d/interactive/editingTools/manipulations/DragManipulation.js +1 -1
  61. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  62. package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
  63. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  64. package/views/3d/layers/I3SMeshView3D.js +1 -1
  65. package/views/3d/layers/MediaLayerView3D.js +1 -1
  66. package/views/3d/layers/SceneLayerWorker.js +1 -1
  67. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  68. package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
  69. package/views/3d/layers/graphics/elevationAlignPointsInFeatures.js +1 -1
  70. package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
  71. package/views/3d/support/MemoryController.js +1 -1
  72. package/views/3d/support/PBFDecoder.js +1 -1
  73. package/views/3d/support/ResourceController.js +1 -1
  74. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  75. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  76. package/views/3d/webgl-engine/core/FBOPool.js +5 -0
  77. package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +9 -6
  78. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  79. package/views/3d/webgl-engine/lib/Camera.js +1 -1
  80. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  81. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  82. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  83. package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
  84. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  85. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  86. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  87. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +1 -1
  88. package/views/draw/DrawOperation.js +1 -1
  89. package/views/draw/support/Reshape.js +1 -1
  90. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  91. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  92. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  93. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  94. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  95. package/views/interactive/snapping/featureSources/snappingCandidateElevationAlignment.js +1 -1
  96. package/widgets/BasemapGallery.js +1 -1
  97. package/widgets/DirectionalPad.js +1 -1
  98. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  99. package/widgets/Editor/EditorViewModel.js +1 -1
  100. package/widgets/Editor/UpdateWorkflow.js +1 -1
  101. package/widgets/Editor/workflowUtils.js +1 -1
  102. package/widgets/FeatureForm.js +1 -1
  103. package/widgets/Features.js +1 -1
  104. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  105. package/widgets/OrientedImageryViewer.js +1 -1
  106. package/widgets/TimeSlider.js +1 -1
  107. package/widgets/TimeZoneLabel.js +1 -1
  108. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  109. package/widgets/UtilityNetworkTrace.js +1 -1
  110. package/assets/esri/core/workers/chunks/00da3c16741a9bc47f3a.js +0 -1
  111. package/assets/esri/core/workers/chunks/0e4646d14fa0775bf463.js +0 -1
  112. package/assets/esri/core/workers/chunks/4e0bf30da4281070e453.js +0 -1
  113. package/assets/esri/core/workers/chunks/51b8913dff24e693bd25.js +0 -1
  114. package/assets/esri/core/workers/chunks/5e907ec0ee1565b5fbbc.js +0 -1
  115. package/assets/esri/core/workers/chunks/7388fd97e7b1a2142744.js +0 -1
  116. package/assets/esri/core/workers/chunks/92d8f75e616afa5c761e.js +0 -1
  117. package/assets/esri/core/workers/chunks/a877a4826cd6a46ec99b.js +0 -1
  118. package/assets/esri/core/workers/chunks/b251d8a856dc8b9406e0.js +0 -1
  119. package/assets/esri/core/workers/chunks/d8c696da42f8f8919b83.js +0 -1
  120. package/assets/esri/core/workers/chunks/fac3e57784d7f37053af.js +0 -1
  121. package/assets/esri/core/workers/chunks/fc95b1a36ed68b851400.js +0 -1
  122. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +0 -4
  123. package/widgets/DirectionalPad.d.ts +0 -4
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[299,5935],{44543:(e,t,r)=>{r.d(t,{F:()=>f,M:()=>i});const i={Base64:0,Hex:1,String:2,Raw:3},s=8,n=(1<<s)-1;function o(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e){const t=[];for(let r=0,i=e.length*s;r<i;r+=s)t[r>>5]|=(e.charCodeAt(r/s)&n)<<r%32;return t}function l(e){const t=[];for(let r=0,i=32*e.length;r<i;r+=s)t.push(String.fromCharCode(e[r>>5]>>>r%32&n));return t.join("")}function d(e,t,r,i,s,n){return o(function(e,t){return e<<t|e>>>32-t}(o(o(t,e),o(i,n)),s),r)}function u(e,t,r,i,s,n,o){return d(t&r|~t&i,e,t,s,n,o)}function c(e,t,r,i,s,n,o){return d(t&i|r&~i,e,t,s,n,o)}function p(e,t,r,i,s,n,o){return d(t^r^i,e,t,s,n,o)}function y(e,t,r,i,s,n,o){return d(r^(t|~i),e,t,s,n,o)}function h(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let r=1732584193,i=-271733879,s=-1732584194,n=271733878;for(let t=0;t<e.length;t+=16){const a=r,l=i,d=s,h=n;r=u(r,i,s,n,e[t],7,-680876936),n=u(n,r,i,s,e[t+1],12,-389564586),s=u(s,n,r,i,e[t+2],17,606105819),i=u(i,s,n,r,e[t+3],22,-1044525330),r=u(r,i,s,n,e[t+4],7,-176418897),n=u(n,r,i,s,e[t+5],12,1200080426),s=u(s,n,r,i,e[t+6],17,-1473231341),i=u(i,s,n,r,e[t+7],22,-45705983),r=u(r,i,s,n,e[t+8],7,1770035416),n=u(n,r,i,s,e[t+9],12,-1958414417),s=u(s,n,r,i,e[t+10],17,-42063),i=u(i,s,n,r,e[t+11],22,-1990404162),r=u(r,i,s,n,e[t+12],7,1804603682),n=u(n,r,i,s,e[t+13],12,-40341101),s=u(s,n,r,i,e[t+14],17,-1502002290),i=u(i,s,n,r,e[t+15],22,1236535329),r=c(r,i,s,n,e[t+1],5,-165796510),n=c(n,r,i,s,e[t+6],9,-1069501632),s=c(s,n,r,i,e[t+11],14,643717713),i=c(i,s,n,r,e[t],20,-373897302),r=c(r,i,s,n,e[t+5],5,-701558691),n=c(n,r,i,s,e[t+10],9,38016083),s=c(s,n,r,i,e[t+15],14,-660478335),i=c(i,s,n,r,e[t+4],20,-405537848),r=c(r,i,s,n,e[t+9],5,568446438),n=c(n,r,i,s,e[t+14],9,-1019803690),s=c(s,n,r,i,e[t+3],14,-187363961),i=c(i,s,n,r,e[t+8],20,1163531501),r=c(r,i,s,n,e[t+13],5,-1444681467),n=c(n,r,i,s,e[t+2],9,-51403784),s=c(s,n,r,i,e[t+7],14,1735328473),i=c(i,s,n,r,e[t+12],20,-1926607734),r=p(r,i,s,n,e[t+5],4,-378558),n=p(n,r,i,s,e[t+8],11,-2022574463),s=p(s,n,r,i,e[t+11],16,1839030562),i=p(i,s,n,r,e[t+14],23,-35309556),r=p(r,i,s,n,e[t+1],4,-1530992060),n=p(n,r,i,s,e[t+4],11,1272893353),s=p(s,n,r,i,e[t+7],16,-155497632),i=p(i,s,n,r,e[t+10],23,-1094730640),r=p(r,i,s,n,e[t+13],4,681279174),n=p(n,r,i,s,e[t],11,-358537222),s=p(s,n,r,i,e[t+3],16,-722521979),i=p(i,s,n,r,e[t+6],23,76029189),r=p(r,i,s,n,e[t+9],4,-640364487),n=p(n,r,i,s,e[t+12],11,-421815835),s=p(s,n,r,i,e[t+15],16,530742520),i=p(i,s,n,r,e[t+2],23,-995338651),r=y(r,i,s,n,e[t],6,-198630844),n=y(n,r,i,s,e[t+7],10,1126891415),s=y(s,n,r,i,e[t+14],15,-1416354905),i=y(i,s,n,r,e[t+5],21,-57434055),r=y(r,i,s,n,e[t+12],6,1700485571),n=y(n,r,i,s,e[t+3],10,-1894986606),s=y(s,n,r,i,e[t+10],15,-1051523),i=y(i,s,n,r,e[t+1],21,-2054922799),r=y(r,i,s,n,e[t+8],6,1873313359),n=y(n,r,i,s,e[t+15],10,-30611744),s=y(s,n,r,i,e[t+6],15,-1560198380),i=y(i,s,n,r,e[t+13],21,1309151649),r=y(r,i,s,n,e[t+4],6,-145523070),n=y(n,r,i,s,e[t+11],10,-1120210379),s=y(s,n,r,i,e[t+2],15,718787259),i=y(i,s,n,r,e[t+9],21,-343485551),r=o(r,a),i=o(i,l),s=o(s,d),n=o(n,h)}return[r,i,s,n]}function f(e,t=i.Hex){const r=t||i.Base64,n=h(a(e),e.length*s);switch(r){case i.Raw:return n;case i.Hex:return function(e){const t="0123456789abcdef",r=[];for(let i=0,s=4*e.length;i<s;i++)r.push(t.charAt(e[i>>2]>>i%4*8+4&15)+t.charAt(e[i>>2]>>i%4*8&15));return r.join("")}(n);case i.String:return l(n);case i.Base64:return function(e){const t=[];for(let r=0,i=4*e.length;r<i;r+=3){const i=(e[r>>2]>>r%4*8&255)<<16|(e[r+1>>2]>>(r+1)%4*8&255)<<8|e[r+2>>2]>>(r+2)%4*8&255;for(let s=0;s<4;s++)8*r+6*s>32*e.length?t.push("="):t.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>6*(3-s)&63))}return t.join("")}(n)}}},28576:(e,t,r)=>{r.d(t,{B:()=>y});var i=r(20102),s=r(44543),n=r(81153),o=r(17452),a=r(41123),l=r(7628),d=r(31263),u=r(5600),c=r(66094),p=r(25929);function y(e){const t=e?.origins??[void 0];return(r,i)=>{const s=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const i=(0,l.Oe)(t,r);return{type:String,read:(e,t,r)=>{const s=(0,p.r)(e,t,r);return i.type===String?s:"function"==typeof i.type?new i.type({url:s}):void 0},write:{writer(t,s,a,l){if(!l?.resources)return"string"==typeof t?void(s[a]=(0,p.t)(t,l)):void(s[a]=t.write({},l));const u=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),y=(0,p.t)(u,{...l,verifyItemRelativeUrls:l?.verifyItemRelativeUrls?{writtenUrls:l.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},p.M.NO),g=i.type!==String&&(!(0,n.l)(this)||l?.origin&&this.originIdOf(r)>(0,d.M9)(l.origin)),b={object:this,propertyName:r,value:t,targetUrl:y,dest:s,targetPropertyName:a,context:l,params:e};l?.portalItem&&y&&!(0,o.YP)(y)?g&&e?.contentAddressed?h(b):g?function(e){const{context:t,targetUrl:r,params:i,value:s,dest:n,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),d=m(s,r,t),u=(0,c.B)(d),p=(0,o.Ml)(l.path),y=i?.compress??!1;u===p?(t.resources&&f({...e,resource:l,content:d,compress:y,updates:t.resources.toUpdate}),n[a]=r):h(e)}(b):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(b):l?.portalItem&&(null==y||null!=(0,p.i)(y)||(0,o.jc)(y)||g)?h(b):s[a]=y}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=p.a;return{read:e,write:t}}}}(e,r,i);for(const e of t){const t=(0,u.CJ)(r,e,i);for(const e in s)t[e]=s[e]}}}function h(e){const{targetUrl:t,params:r,value:n,context:l,dest:d,targetPropertyName:u}=e;if(!l.portalItem)return;const y=(0,p.p)(t),h=m(n,t,l);if(r?.contentAddressed&&"json"!==h.type)return void l.messages?.push(new i.Z("persistable:contentAddressingUnsupported",`Property "${u}" is trying to serializing a resource with content of type ${h.type} with content addressing. Content addressing is only supported for json resources.`,{content:h}));const g=r?.contentAddressed&&"json"===h.type?(0,s.F)(h.jsonString):y?.filename??(0,a.D)(),b=(0,o.v_)(r?.prefix??y?.prefix,g),w=`${b}.${(0,c.B)(h)}`;if(r?.contentAddressed&&l.resources&&"json"===h.type){const e=l.resources.toKeep.find((e=>e.resource.path===w))??l.resources.toAdd.find((e=>e.resource.path===w));if(e)return void(d[u]=e.resource.itemRelativeUrl)}const v=l.portalItem.resourceFromPath(w);(0,o.jc)(t)&&l.resources&&l.resources.pendingOperations.push((0,o.gi)(t).then((e=>{v.path=`${b}.${(0,c.B)({type:"blob",blob:e})}`,d[u]=v.itemRelativeUrl})).catch((()=>{})));const I=r?.compress??!1;l.resources&&f({...e,resource:v,content:h,compress:I,updates:l.resources.toAdd}),d[u]=v.itemRelativeUrl}function f({object:e,propertyName:t,updates:r,resource:i,content:s,compress:n}){r.push({resource:i,content:s,compress:n,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function m(e,t,r){return"string"==typeof e?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(r))}}},41123:(e,t,r)=>{r.d(t,{D:()=>s,z:()=>n});const i="randomUUID"in crypto;function s(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${s()}}`}},79235:(e,t,r)=>{r.d(t,{Z:()=>w});var i,s=r(43697),n=r(67676),o=r(35454),a=r(96674),l=r(67900),d=r(20941),u=r(5600),c=(r(75215),r(80442),r(71715)),p=r(52011),y=r(30556);const h=(0,o.w)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),f=h.jsonValues.slice();(0,n.e$)(f,"orthometric");const m=(0,o.w)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let g=i=class extends a.wq{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return h.write(e,t,r)}readHeightModel(e,t,r){return h.read(e)||(r?.messages&&r.messages.push(function(e,t){return new d.Z("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return m.read(e)||(r?.messages&&r.messages.push(b(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,l.$C)(e)||m.read(e)||(r?.messages&&r.messages.push(b(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new i({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const r=(0,l.cM)(t);return new i({heightModel:e.heightModel,heightUnit:r,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new i;return t.read(e,{origin:"web-scene"}),t}};function b(e,t){return new d.Z("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s._)([(0,u.Cb)({type:h.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:f,default:"ellipsoidal"}}}})],g.prototype,"heightModel",void 0),(0,s._)([(0,y.c)("web-scene","heightModel")],g.prototype,"writeHeightModel",null),(0,s._)([(0,c.r)(["web-scene","service"],"heightModel")],g.prototype,"readHeightModel",null),(0,s._)([(0,u.Cb)({type:m.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:m.jsonValues,write:m.write}}}})],g.prototype,"heightUnit",void 0),(0,s._)([(0,c.r)("web-scene","heightUnit")],g.prototype,"readHeightUnit",null),(0,s._)([(0,c.r)("service","heightUnit")],g.prototype,"readHeightUnitService",null),(0,s._)([(0,u.Cb)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],g.prototype,"vertCRS",void 0),(0,s._)([(0,c.r)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],g.prototype,"readVertCRS",null),g=i=(0,s._)([(0,p.j)("esri.geometry.HeightModelInfo")],g);const w=g},57476:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ge});var i=r(43697),s=r(38171),n=r(51773),o=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),a=r(3172),l=r(2368),d=r(46791),u=r(20102),c=r(92604),p=r(16453),y=r(95330),h=r(17445),f=r(17452),m=r(5600),g=(r(75215),r(67676),r(80442),r(1153)),b=r(71715),w=r(52011),v=r(31263),I=r(87085),_=r(54295),S=r(17287),F=r(66361),j=r(38009),C=r(16859),L=r(72965),x=r(37253),R=r(66677),O=r(71592),A=r(15506),E=r(21506),Z=r(45574),P=r(61960),M=r(85857),U=r(53518),q=r(99514),T=r(35671),N=r(51161),D=r(54306),V=r(30707),k=r(56765),G=r(87344),H=r(96674);let $=class extends H.wq{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,i._)([(0,m.Cb)({type:String,json:{read:!0,write:!0}})],$.prototype,"name",void 0),(0,i._)([(0,m.Cb)({type:String,json:{read:!0,write:!0}})],$.prototype,"field",void 0),(0,i._)([(0,m.Cb)({type:[Number],json:{read:!0,write:!0}})],$.prototype,"currentRangeExtent",void 0),(0,i._)([(0,m.Cb)({type:[Number],json:{read:!0,write:!0}})],$.prototype,"fullRangeExtent",void 0),(0,i._)([(0,m.Cb)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],$.prototype,"type",void 0),$=(0,i._)([(0,w.j)("esri.layers.support.RangeInfo")],$);var Q,J=r(22974),B=r(28576),z=r(20941),K=r(38913),W=r(73615);let Y=Q=class extends((0,H.eC)(d.Z.ofType(K.Z))){constructor(e){super(e)}clone(){return new Q(this.items.map((e=>e.clone())))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map((r=>{if(!t.equals(r.spatialReference)){if(!(0,W.canProjectWithoutEngine)(r.spatialReference,t))return e?.messages&&e.messages.push(new z.Z("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const i=new K.Z;(0,W.projectPolygon)(r,i,t),r=i}const i=r.toJSON(e);return delete i.spatialReference,i})).filter((e=>null!=e)):(e?.messages&&e.messages.push(new z.Z("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((t=>t.toJSON(e))))}static fromJSON(e,t){const r=new Q;return e.forEach((e=>r.add(K.Z.fromJSON(e,t)))),r}};Y=Q=(0,i._)([(0,w.j)("esri.layers.support.PolygonCollection")],Y);const X=Y;var ee,te=r(25929);let re=ee=class extends H.wq{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new X,this._geometriesSource=null}initialize(){this.addHandles((0,h.on)((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),h.Z_))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=X.fromJSON(e,r):this._geometriesSource={url:(0,te.f)(e,r),context:r}}async loadGeometries(e,t){if(null==this._geometriesSource)return;const{url:r,context:i}=this._geometriesSource,s=await(0,a.Z)(r,{responseType:"json",signal:t?.signal}),n=e.toJSON(),o=s.data.map((e=>({...e,spatialReference:n})));this.geometries=X.fromJSON(o,i),this._geometriesSource=null}clone(){const e=new ee({geometries:(0,J.d9)(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};(0,i._)([(0,m.Cb)({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],re.prototype,"spatialRelationship",void 0),(0,i._)([(0,m.Cb)({type:X,nonNullable:!0,json:{write:!0}}),(0,B.B)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],re.prototype,"geometries",void 0),(0,i._)([(0,b.r)(["web-scene","portal-item"],"geometries")],re.prototype,"readGeometries",null),re=ee=(0,i._)([(0,w.j)("esri.layers.support.SceneFilter")],re);const ie=re;var se=r(40555),ne=r(14165),oe=r(36405),ae=r(72245),le=r(32163),de=r(2358),ue=r(19833),ce=r(65242);const pe=new Set(["3DObject","Point"]),ye=(0,U.v)();let he=class extends((0,F.o1)((0,x.Vt)((0,S.Y)((0,j.q)((0,C.I)((0,L.M)((0,p.R)((0,_.V)((0,l.J)(I.Z)))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new d.Z,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new q.Z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:N.U4.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&(0,Z.sX)(this.associatedLayer)}get geometryType(){return me[this.profile]||"mesh"}set renderer(e){(0,T.YN)(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:A.C;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:n,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:a},data:{supportsZ:l,supportsM:d,isVersioned:u,supportsAttachment:c},operations:{supportsEditing:p,supportsAdd:y,supportsUpdate:h,supportsDelete:f,supportsQuery:m,supportsQueryAttachments:g,supportsAsyncConvert3D:b}}=e,w=e.operations.supportsChangeTracking,v=!!this.associatedLayer?.infoFor3D&&(0,ae.Rx)();return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:a,supportsRollbackOnFailure:s,supportsGeometryUpdate:v&&o,supportsUploadWithItemId:n},data:{supportsAttachment:c,supportsZ:l,supportsM:d,isVersioned:u},operations:{supportsQuery:m,supportsQueryAttachments:g,supportsEditing:p&&w,supportsAdd:v&&y&&w,supportsDelete:v&&f&&w,supportsUpdate:h&&w,supportsAsyncConvert3D:b}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&fe[r]?fe[r]:(c.Z.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y.r9),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await(0,se.y)(this,{origin:"service"},t),(0,T.YN)(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){c.Z.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ne.Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new u.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new u.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=(0,T.Lk)(this.fieldsIndex,await(0,ue.e7)(this,(0,ue.V5)(this)));return(0,de.xe)(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new u.Z("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new s.Z;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(c.Z.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,le.eZ)(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new u.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new u.Z("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new u.Z("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new u.Z("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const e of this.statisticsInfo)if(e.name===r.name){const r=(0,f.v_)(this.parsedUrl.path,e.href);return(0,a.Z)(r,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new u.Z("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(x.xp.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(x.xp.SAVE,e)}async applyEdits(e,t){const{applyEdits:i}=await r.e(1444).then(r.bind(r,14720));let s=t;await this.load();const n=this.associatedLayer;if(!n)throw new u.Z(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:o}=n,a=!!n.infoFor3D,l=s?.globalIdUsed??!0;if(a&&null==o)throw new u.Z(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(a&&!l)throw new u.Z(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return(0,R.M8)(n.url)&&a&&null!=e.deleteFeatures&&null!=o&&(s={...s,globalIdToObjectId:await(0,Z.HW)(n,e.deleteFeatures,o)}),i(this,n.source,e,s)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new u.Z(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!pe.has(e.layerType))throw new u.Z("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new u.Z("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new u.Z("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new u.Z("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new u.Z("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new u.Z("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=(0,g.vw)(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),n=this.associatedLayer.originIdOf(i);s<n&&(n===v.s3.SERVICE||n===v.s3.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],n)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.editingInfo?.lastEditDate,t=this.associatedLayer?.serverGens,r=this.associatedLayer?.getAtOrigin("fullExtent","service");(0,ae.Rx)()&&null!=this.associatedLayer?.infoFor3D&&r&&(0,R.M8)(this.associatedLayer?.url)&&e&&this.serviceUpdateTimeStamp?.lastUpdate!==e.getTime()&&(this.serviceUpdateTimeStamp||t?.minServerGen!==t?.serverGen)&&(0,g.vw)(this).setAtOrigin("fullExtent",r.clone(),v.s3.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await(0,O.w)(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,apiKey:this.apiKey,signal:e}),s=await G.T.FeatureLayer();this.associatedLayer=new s({url:t,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(e){(0,y.D_)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await(0,h.N1)((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?c.Z.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):c.Z.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&(0,oe.LR)(c.Z.getLogger(this),(0,oe.Wb)("Mesh scene layers","relative-to-scene",e)),(0,oe.LR)(c.Z.getLogger(this),(0,oe.kf)("Scene layers",e))}};(0,i._)([(0,m.Cb)({types:{key:"type",base:P.B,typeMap:{selection:M.Z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],he.prototype,"featureReduction",void 0),(0,i._)([(0,m.Cb)({type:[$],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],he.prototype,"rangeInfos",void 0),(0,i._)([(0,m.Cb)({json:{read:!1}})],he.prototype,"associatedLayer",void 0),(0,i._)([(0,m.Cb)({type:["show","hide"]})],he.prototype,"listMode",void 0),(0,i._)([(0,m.Cb)({type:["ArcGISSceneServiceLayer"]})],he.prototype,"operationalLayerType",void 0),(0,i._)([(0,m.Cb)({json:{read:!1},readOnly:!0})],he.prototype,"type",void 0),(0,i._)([(0,m.Cb)({...ye.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],he.prototype,"fields",void 0),(0,i._)([(0,m.Cb)()],he.prototype,"types",null),(0,i._)([(0,m.Cb)()],he.prototype,"typeIdField",null),(0,i._)([(0,m.Cb)()],he.prototype,"templates",null),(0,i._)([(0,m.Cb)()],he.prototype,"formTemplate",null),(0,i._)([(0,m.Cb)({readOnly:!0,clonable:!1})],he.prototype,"fieldsIndex",null),(0,i._)([(0,m.Cb)({type:k.Z,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],he.prototype,"floorInfo",void 0),(0,i._)([(0,m.Cb)(ye.outFields)],he.prototype,"outFields",void 0),(0,i._)([(0,m.Cb)({type:N.U4,readOnly:!0,json:{read:!1}})],he.prototype,"nodePages",void 0),(0,i._)([(0,b.r)("service","nodePages",["nodePages","pointNodePages"])],he.prototype,"readNodePages",null),(0,i._)([(0,m.Cb)({type:[N.QI],readOnly:!0})],he.prototype,"materialDefinitions",void 0),(0,i._)([(0,m.Cb)({type:[N.Yh],readOnly:!0})],he.prototype,"textureSetDefinitions",void 0),(0,i._)([(0,m.Cb)({type:[N.H3],readOnly:!0})],he.prototype,"geometryDefinitions",void 0),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"serviceUpdateTimeStamp",void 0),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"attributeStorageInfo",void 0),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"statisticsInfo",void 0),(0,i._)([(0,m.Cb)({type:d.Z.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],he.prototype,"excludeObjectIds",void 0),(0,i._)([(0,m.Cb)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],he.prototype,"definitionExpression",void 0),(0,i._)([(0,m.Cb)({type:ie,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],he.prototype,"filter",void 0),(0,i._)([(0,m.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],he.prototype,"path",void 0),(0,i._)([(0,m.Cb)(E.PV)],he.prototype,"elevationInfo",null),(0,i._)([(0,m.Cb)({readOnly:!0,json:{read:!1}})],he.prototype,"effectiveCapabilities",null),(0,i._)([(0,m.Cb)({readOnly:!0})],he.prototype,"effectiveEditingEnabled",null),(0,i._)([(0,m.Cb)({type:String})],he.prototype,"geometryType",null),(0,i._)([(0,m.Cb)(E.iR)],he.prototype,"labelsVisible",void 0),(0,i._)([(0,m.Cb)({type:[D.Z],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:V.r},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:V.r},write:!0}})],he.prototype,"labelingInfo",void 0),(0,i._)([(0,m.Cb)(E.rn)],he.prototype,"legendEnabled",void 0),(0,i._)([(0,m.Cb)({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?(0,ce.b)(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],he.prototype,"opacity",void 0),(0,i._)([(0,m.Cb)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],he.prototype,"priority",void 0),(0,i._)([(0,m.Cb)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],he.prototype,"semantic",void 0),(0,i._)([(0,m.Cb)({types:o.o,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],he.prototype,"renderer",null),(0,i._)([(0,m.Cb)({json:{read:!1}})],he.prototype,"cachedDrawingInfo",void 0),(0,i._)([(0,b.r)("service","cachedDrawingInfo")],he.prototype,"readCachedDrawingInfo",null),(0,i._)([(0,m.Cb)({readOnly:!0,json:{read:!1}})],he.prototype,"capabilities",null),(0,i._)([(0,m.Cb)({type:Boolean,json:{read:!1}})],he.prototype,"editingEnabled",null),(0,i._)([(0,m.Cb)({readOnly:!0,json:{write:!1,read:!1}})],he.prototype,"infoFor3D",null),(0,i._)([(0,m.Cb)({readOnly:!0,json:{write:!1,read:!1}})],he.prototype,"relationships",null),(0,i._)([(0,m.Cb)(E.C_)],he.prototype,"popupEnabled",void 0),(0,i._)([(0,m.Cb)({type:n.Z,json:{name:"popupInfo",write:!0}})],he.prototype,"popupTemplate",void 0),(0,i._)([(0,m.Cb)({readOnly:!0,json:{read:!1}})],he.prototype,"defaultPopupTemplate",null),(0,i._)([(0,m.Cb)({type:String,json:{read:!1}})],he.prototype,"objectIdField",void 0),(0,i._)([(0,b.r)("service","objectIdField",["objectIdField","fields"])],he.prototype,"readObjectIdField",null),(0,i._)([(0,m.Cb)({type:String,json:{read:!1}})],he.prototype,"globalIdField",void 0),(0,i._)([(0,b.r)("service","globalIdField",["globalIdField","fields"])],he.prototype,"readGlobalIdField",null),(0,i._)([(0,m.Cb)({readOnly:!0,type:String,json:{read:!1}})],he.prototype,"displayField",null),(0,i._)([(0,m.Cb)({type:String,json:{read:!1}})],he.prototype,"profile",void 0),(0,i._)([(0,b.r)("service","profile",["store.profile"])],he.prototype,"readProfile",null),(0,i._)([(0,m.Cb)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],he.prototype,"normalReferenceFrame",void 0),(0,i._)([(0,m.Cb)(E.YI)],he.prototype,"screenSizePerspectiveEnabled",void 0),(0,i._)([(0,m.Cb)({json:{read:!1,origins:{service:{read:!0}}}})],he.prototype,"serviceItemId",void 0),he=(0,i._)([(0,w.j)("esri.layers.SceneLayer")],he);const fe={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},me={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},ge=he},66361:(e,t,r)=>{r.d(t,{jF:()=>u,lQ:()=>y,o1:()=>m});var i=r(43697),s=r(32448),n=r(22974),o=r(95330),a=(r(92604),r(75215),r(20102),r(80442),r(52011)),l=r(18596);const d=new s.Z.EventEmitter;function u(e,t,r=null,i=!1){const s=(0,o.hh)();return i=null==t||i,d.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:r,mayReceiveServiceEdits:i,result:s.promise}),s}const c="esri.layers.mixins.EditBusLayer",p=Symbol(c);function y(e){return null!=e&&"object"==typeof e&&p in e}function h(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function f(e,t,r){const i=new URL(e).host,s=l.Jp.get(i),n=e=>!e||e===s;return n(t)&&n(r)||t===r}const m=e=>{var t;let r=class extends e{constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:r,gdbVersion:i,mayReceiveServiceEdits:s,result:o}=e,a=t===this.url,d=null!=r&&null!=this.layerId&&r===this.layerId,u=h(this),c=h(this)&&f(t,i,this.gdbVersion);if(!a||u&&!c||!d&&!s)return;const p=o.then((e=>{if(d&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,n.d9)(e)),e;const t=e.editedFeatures?.find((({layerId:e})=>e===this.layerId));if(t){const{adds:r,updates:i,deletes:s}=t.editedFeatures,o={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:r?r.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],deletedFeatures:s?s.map((({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],updatedFeatures:i?i.map((({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]}))):[],editedFeatures:(0,n.d9)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.d9)(e.historicMoment)};return this.emit("edits",o),o}return{edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,n.d9)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,n.d9)(e.historicMoment)}})).then((e=>("historicMoment"in this&&this.historicMoment!==e.historicMoment&&(0,l.JV)(t,i)&&(this.historicMoment=e.historicMoment),e)));this.emit("apply-edits",{result:p})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:r,moment:i}=e,s=t===this.url,n=h(this),o=h(this)&&f(t,r,this.gdbVersion),a=h(this)&&!f(t,this.gdbVersion,null);s&&n&&o&&a&&"historicMoment"in this&&this.historicMoment!==i&&(this.historicMoment=i)},this.when().then((()=>{this.addHandles(function(e){return d.on("apply-edits",new WeakRef(e))}(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(function(e){return d.on("update-moment",new WeakRef(e))}(this._updateMomentHandler))}),(()=>{}))}};return t=p,r=(0,i._)([(0,a.j)(c)],r),r}},72965:(e,t,r)=>{r.d(t,{M:()=>o});var i=r(43697),s=r(5600),n=(r(75215),r(67676),r(80442),r(52011));const o=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const e={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&function(e,t){e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale}(e,t.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===e.minScale&&r.maxScale===e.maxScale?r:e}};return(0,i._)([(0,s.Cb)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),(0,i._)([(0,s.Cb)({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),(0,i._)([(0,s.Cb)({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=(0,i._)([(0,n.j)("esri.layers.mixins.ScaleRangeLayer")],t),t}},61960:(e,t,r)=>{r.d(t,{B:()=>a});var i=r(43697),s=r(96674),n=r(5600),o=(r(75215),r(67676),r(80442),r(52011));let a=class extends s.wq{constructor(){super(...arguments),this.type=null}};(0,i._)([(0,n.Cb)({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],a.prototype,"type",void 0),a=(0,i._)([(0,o.j)("esri.layers.support.FeatureReduction")],a)},85857:(e,t,r)=>{r.d(t,{Z:()=>d});var i,s=r(43697),n=r(5600),o=(r(75215),r(67676),r(80442),r(52011)),a=r(61960);let l=i=class extends a.B{constructor(e){super(e),this.type="selection"}clone(){return new i}};(0,s._)([(0,n.Cb)({type:["selection"]})],l.prototype,"type",void 0),l=i=(0,s._)([(0,o.j)("esri.layers.support.FeatureReductionSelection")],l);const d=l},45574:(e,t,r)=>{r.d(t,{JD:()=>w,Jj:()=>_,sX:()=>N,Ob:()=>V,rP:()=>Z,FV:()=>F,nU:()=>T,Ci:()=>j,Fr:()=>b,HW:()=>G,gG:()=>E,uA:()=>k,SU:()=>C,KE:()=>R,VG:()=>x,tD:()=>L,kp:()=>O,C9:()=>A,rk:()=>P,kZ:()=>M,JY:()=>U,Y5:()=>I,uj:()=>S});var i=r(40330),s=r(9790),n=r(66643),o=r(20102),a=r(35454),l=r(42033),d=r(63213),u=r(14165);async function c(e,t,r){t=t.clone(),e.capabilities.query.supportsMaxRecordCountFactor&&(t.maxRecordCountFactor=p(e));const i=function(e){return p(e)*function(e){return e.capabilities.query.maxRecordCount||2e3}(e)}(e),s=e.capabilities.query.supportsPagination;t.start=0,t.num=i;let n=null;for(;;){const o=await e.source.queryFeaturesJSON(t,r);if(null==n?n=o:n.features=n.features.concat(o.features),n.exceededTransferLimit=o.exceededTransferLimit,!s||!o.exceededTransferLimit)break;t.start+=i}return n}function p(e){return e.capabilities.query.supportsMaxRecordCountFactor?u.Z.MAX_MAX_RECORD_COUNT_FACTOR:1}var y=r(84230),h=r(84382),f=r(81571),m=r(56545),g=r(75935);const b=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function w(e,t,r,i){const s=await q(e);if(await v(e,t,i),!s.addAttachment)throw new o.Z(i,"Layer source does not support addAttachment capability");return s.addAttachment(t,r)}function v(e,t,r){const{attributes:i}=t,{objectIdField:s}=e;return e.capabilities?.data?.supportsAttachment?t?i?s&&i[s]?Promise.resolve():Promise.reject(new o.Z(r,`feature is missing the identifying attribute ${s}`)):Promise.reject(new o.Z(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new o.Z(r,"A feature is required to add/delete/update attachments")):Promise.reject(new o.Z(r,"this layer doesn't support attachments"))}async function I(e,t,r,i,s){const n=await q(e);if(await v(e,t,s),!n.updateAttachment)throw new o.Z(s,"Layer source does not support updateAttachment capability");return n.updateAttachment(t,r,i)}async function _(e,t,i){const{applyEdits:s}=await r.e(4720).then(r.bind(r,14720)),n=await e.load(),{source:o,globalIdField:a}=n;let l=i;return("feature"===n.type?n.infoFor3D:null)&&null!=t.deleteFeatures&&null!=a&&(l={...l,globalIdToObjectId:await G(e,t.deleteFeatures,a)}),s(n,o,t,i)}async function S(e,t,i){const{uploadAssets:s}=await r.e(4720).then(r.bind(r,14720)),n=await e.load();return s(n,n.source,t,i)}async function F(e,t,r,i){const s=await q(e);if(await v(e,t,i),!s.deleteAttachments)throw new o.Z(i,"Layer source does not support deleteAttachments capability");return s.deleteAttachments(t,r)}async function j(e,t,r){const i=(await e.load({signal:t?.signal})).source;if(!i.fetchRecomputedExtents)throw new o.Z(r,"Layer source does not support fetchUpdates capability");return i.fetchRecomputedExtents(t)}async function C(e,t,r,i){t=m.Z.from(t),await e.load();const s=e.source,n=e.capabilities;if(!n?.data?.supportsAttachment)throw new o.Z(i,"this layer doesn't support attachments");const{attachmentTypes:a,objectIds:l,globalIds:d,num:u,size:c,start:p,where:y}=t;if(!n?.operations?.supportsQueryAttachments&&(a?.length>0||d?.length>0||c?.length>0||u||p||y))throw new o.Z(i,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t);if(!(l?.length||d?.length||y))throw new o.Z(i,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!s.queryAttachments)throw new o.Z(i,"Layer source does not support queryAttachments capability",t);return s.queryAttachments(t)}async function L(e,t,r,i){const s=await q(e);if(!s.queryObjectIds)throw new o.Z(i,"Layer source does not support queryObjectIds capability");return s.queryObjectIds(u.Z.from(t)??e.createQuery(),r)}async function x(e,t,r,i){const s=await q(e);if(!s.queryFeatureCount)throw new o.Z(i,"Layer source does not support queryFeatureCount capability");return s.queryFeatureCount(u.Z.from(t)??e.createQuery(),r)}async function R(e,t,r,i){const s=await q(e);if(!s.queryExtent)throw new o.Z(i,"Layer source does not support queryExtent capability");return s.queryExtent(u.Z.from(t)??e.createQuery(),r)}async function O(e,t,r,i){const s=await q(e);if(!s.queryRelatedFeatures)throw new o.Z(i,"Layer source does not support queryRelatedFeatures capability");return s.queryRelatedFeatures(g.default.from(t),r)}async function A(e,t,r,i){const s=await q(e);if(!s.queryRelatedFeaturesCount)throw new o.Z(i,"Layer source does not support queryRelatedFeaturesCount capability");return s.queryRelatedFeaturesCount(g.default.from(t),r)}async function E(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:i}=await t.refresh();if(null!=i&&(e.sourceJSON={...e.sourceJSON,...i},e.read(i,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await(0,l.E)(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function Z(e){const t=new u.Z,r=e.capabilities?.data,i=e.capabilities?.query;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,i&&(t.compactGeometryEnabled=i.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference),r&&(r.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),r.supportsM&&null!=e.returnM&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:s,timeExtent:n}=e;return t.timeExtent=null!=s&&null!=n?n.offset(-s.value,s.unit):n||null,t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null,t}function P(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const e of r)if("esriFieldTypeGlobalID"===e.type)return e.name}function M(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const e of r)if("esriFieldTypeOID"===e.type)return e.name}function U(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}async function q(e){return(await e.load()).source}async function T(e,t,r){const s=e.parsedUrl?.path;s&&e.authenticationTriggerEvent===t&&await async function(e,t){if(!i.id)return;if(i.id.findCredential(e))return;let r;try{const s=await(0,y.oP)(e,t);s&&(r=await i.id.checkSignInStatus(`${s}/sharing`))}catch(e){}if(r)try{const r=null!=t?t.signal:null;await i.id.getCredential(e,{signal:r})}catch(e){}}(s,r)}function N(e){return!e.sourceJSON?.isMultiServicesView&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const D=(0,d.d)({types:s.QT});function V(e,t){if(e.defaultSymbol)return e.types?.length?new f.Z({defaultSymbol:D(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map((e=>({id:e.id,symbol:D(e.symbol,e,t)})))}):new h.Z({symbol:D(e.defaultSymbol,e,t)})}function k(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function G(e,t,r){if(null==t)return null;const i=[],{objectIdField:s}=e;if(t.forEach((e=>{let t=null;if("attributes"in e){const{attributes:i}=e;t={globalId:i[r],objectId:null!=i[s]&&-1!==i[s]?i[s]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||i.push(t.globalId))})),0===i.length)return null;const o=e.createQuery();o.where=i.map((e=>`${r}='${e}'`)).join(" OR "),o.returnGeometry=!1,o.outFields=[s,r],o.cacheHint=!1;const a=await(0,n.mt)(c(e,o));if(!a.ok)return null;const l=new Map,d=a.value.features;for(const e of d){const t=e.attributes[r],i=e.attributes[s];null!=t&&null!=i&&-1!==i&&l.set(t,i)}return l}},53518:(e,t,r)=>{r.d(t,{v:()=>l});var i=r(80442),s=r(92604),n=r(1231),o=r(99514),a=r(35671);function l(){return{fields:{type:[n.Z],value:null,set:function(e){if(e&&(0,i.Z)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");s.Z.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return o.Z.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const r=this.fieldsIndex?.has(t);r||s.Z.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.Q0)(this.fieldsIndex,e)}}}}},66094:(e,t,r)=>{r.d(t,{B:()=>s});var i=r(17452);function s(e){return n[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,i.Ml)(e);return l[t]||o}(e.url)}(e)]||a}const n={},o="text/plain",a=n[o],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)n[l[e]]=e},40555:(e,t,r)=>{r.d(t,{y:()=>o});var i=r(66643),s=r(95330),n=r(20941);async function o(e,t,r){const o=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(o&&"unique-value"===o.type&&o.styleOrigin){const a=await(0,i.q6)(o.populateFromStyle());if((0,s.k_)(r),!1===a.ok){const r=a.error;t?.messages&&t.messages.push(new n.Z("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:t})),e.clear("renderer",t?.origin)}}}},75935:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var i,s=r(43697),n=(r(66577),r(96674)),o=r(22974),a=r(5600),l=r(75215),d=r(52011),u=r(30556),c=r(10158),p=r(82971);let y=i=class extends n.wq{constructor(e){super(e),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(e,t){t.historicMoment=e&&e.getTime()}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,this.start>0&&null==this.where&&(t.definitionExpression="1=1")}clone(){return new i((0,o.d9)({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};(0,s._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],y.prototype,"cacheHint",void 0),(0,s._)([(0,a.Cb)({type:c.n,json:{write:!0}})],y.prototype,"dynamicDataSource",void 0),(0,s._)([(0,a.Cb)({type:String,json:{write:!0}})],y.prototype,"gdbVersion",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{write:!0}})],y.prototype,"geometryPrecision",void 0),(0,s._)([(0,a.Cb)({type:Date})],y.prototype,"historicMoment",void 0),(0,s._)([(0,u.c)("historicMoment")],y.prototype,"_writeHistoricMoment",null),(0,s._)([(0,a.Cb)({type:Number,json:{write:!0}})],y.prototype,"maxAllowableOffset",void 0),(0,s._)([(0,a.Cb)({type:[Number],json:{write:!0}})],y.prototype,"objectIds",void 0),(0,s._)([(0,a.Cb)({type:[String],json:{write:!0}})],y.prototype,"orderByFields",void 0),(0,s._)([(0,a.Cb)({type:[String],json:{write:!0}})],y.prototype,"outFields",void 0),(0,s._)([(0,a.Cb)({type:p.Z,json:{read:{source:"outSR"},write:{target:"outSR"}}})],y.prototype,"outSpatialReference",void 0),(0,s._)([(0,a.Cb)({json:{write:!0}})],y.prototype,"relationshipId",void 0),(0,s._)([(0,a.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],y.prototype,"start",void 0),(0,s._)([(0,u.c)("start"),(0,u.c)("num")],y.prototype,"writeStart",null),(0,s._)([(0,a.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],y.prototype,"num",void 0),(0,s._)([(0,a.Cb)({json:{write:!0}})],y.prototype,"returnGeometry",void 0),(0,s._)([(0,a.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],y.prototype,"returnM",void 0),(0,s._)([(0,a.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],y.prototype,"returnZ",void 0),(0,s._)([(0,a.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],y.prototype,"where",void 0),y=i=(0,s._)([(0,d.j)("esri.rest.support.RelationshipQuery")],y),y.from=(0,l.se)(y);const h=y},18596:(e,t,r)=>{r.d(t,{JV:()=>a,Jp:()=>s,Px:()=>o,U8:()=>i});const i=(0,r(41123).z)(),s=new Map,n=new Map;async function o(e,t,s=!1){if(!e||!t)return!0;const o=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),a=n.get(o)?.entries();if(a)for(const[e,n]of a)if(n.name===t){const t=!n.stack?.hasForwardEdits();if(!t&&s){const[{deleteForwardEdits:t},{default:s}]=await Promise.all([r.e(1316).then(r.bind(r,51316)),r.e(4573).then(r.bind(r,84573))]);return t(o,e,new s({sessionId:i,moment:n.moment}))}return t}return!0}function a(e,t){if(!e)return!1;const r=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=n.get(r)?.entries();if(i)for(const[e,r]of i)if(r.name===t)return"edit"===r.lockType;return!1}new Map}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[664],{25929:(e,t,s)=>{s.d(t,{M:()=>f,a:()=>g,e:()=>c,f:()=>n,i:()=>h,p:()=>d,r:()=>o,t:()=>r,w:()=>a});var i=s(17452);function n(e,t){const s=t?.url?.path;if(e&&s&&(e=(0,i.hF)(e,s,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=(0,i.PF)(e,t.portalItem.itemUrl);null!=s&&u.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return p(e,t?.portal)}function r(e,t,s=f.YES){if(null==e)return e;!(0,i.YP)(e)&&t?.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let n=(0,i.hF)(e);if(t){const s=t.verifyItemRelativeUrls?.rootPath||t.url?.path;if(s){const r=p(s,t.portal),o=p(n,t.portal);n=(0,i.PF)(o,r,r),null!=n&&n!==o&&n!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(n)}}return n=c(n,t?.portal),(0,i.YP)(n)&&(n=(0,i.Fv)(n)),t?.resources&&t?.portalItem&&!(0,i.YP)(n)&&!(0,i.HK)(n)&&s===f.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(n),compress:!1}),n}function o(e,t,s){return n(e,s)}function a(e,t,s,i){const n=r(e,i);void 0!==n&&(t[s]=n)}const l=/\/items\/([^\/]+)\/resources\/(.*)/,u=/^\.\/resources\//;function h(e){const t=e?.match(l)??null;return t?.[1]??null}function d(e){const t=e?.match(l)??null;if(null==t)return null;const s=t[2],n=s.lastIndexOf("/");if(-1===n){const{path:e,extension:t}=(0,i.fZ)(s);return{prefix:null,filename:e,extension:t}}const{path:r,extension:o}=(0,i.fZ)(s.slice(n+1));return{prefix:s.slice(0,n),filename:r,extension:o}}function c(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?(0,i.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function p(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const s=`${t.urlKey}.${t.customBaseUrl}`,n=(0,i.TI)();return(0,i.D6)(n,`${n.scheme}://${s}`)?(0,i.Ie)(e,t.portalHostname,s):(0,i.Ie)(e,s,t.portalHostname)}var f,_;(_=f||(f={}))[_.YES=0]="YES",_[_.NO=1]="NO";const g=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return f},ensureMainOnlineDomain:c,fromJSON:n,itemIdFromResourceUrl:h,prefixAndFilenameFromResourceUrl:d,read:o,toJSON:r,write:a},Symbol.toStringTag,{value:"Module"}))},91303:(e,t,s)=>{var i;s.d(t,{Y:()=>i}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(i||(i={}))},24133:(e,t,s)=>{s.d(t,{Q:()=>o});var i=s(67676),n=s(44553),r=s(88764);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=d,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),v.prune(),b.prune(),I.prune(),C.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(m(e,s))for(v.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;m(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):v.push(r))}s=v.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!m(e,t))return!1;for(v.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(m(e,r)){if(t.leaf||g(e,r))return!0;v.push(n)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new w([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(I.clear(),C.clear();s||I.length>0;){if(s||(s=I.pop(),n=I.data[I.length-1],r=C.pop()??0,o=!0),s.leaf&&(t=(0,i.cq)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),I.push(s),this._condense(I),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(I.push(s),C.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(b.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else b.pushArray(s.children);s=b.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new w(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new F([]);o.height=i;const l=Math.ceil(n/r),u=l*Math.ceil(Math.sqrt(r));y(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);y(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=c(o),l=f(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);I.clear();const r=this._chooseSubtree(n,this._data,t,I);for(r.children.push(e),u(r,n);t>=0&&I.data[t].children.length>this._maxEntries;)this._split(I,t),t--;this._adjustParentBBoxes(n,I,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new w(o):new F(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new F([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),u=_(t,a),h=c(t)+c(a);u<i?(i=u,r=o,n=h<n?h:n):u===i&&h<n&&(n=h,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:d;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=p(r)+p(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=p(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=p(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.cq)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new w([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function d(e,t){return e.minY-t.minY}function c(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function _(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const v=new n.Z,b=new n.Z,I=new n.Z,C=new n.Z({deallocator:void 0});class E{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class x extends E{constructor(){super(...arguments),this.height=1,this.indexHint=new i.SO}}class w extends x{constructor(e){super(),this.children=e,this.leaf=!0}}class F extends x{constructor(e){super(),this.children=e,this.leaf=!1}}},19402:(e,t,s)=>{s.d(t,{R:()=>h});var i=s(43697),n=s(92036),r=s(50758),o=s(17445),a=s(1654),l=s(5600),u=s(52011);let h=class extends n.Z{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o.YP)}addWhen(e,t,s={}){return this._installWatch(e,t,s,o.gx)}addOnCollectionChange(e,t,{initial:s=!1,final:i=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.Z_),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:i?e=>t({added:[],removed:e.toArray()}):void 0})],n),(0,r.kB)((()=>this.removeHandles(n)))}addPromise(e){if(null==e)return e;const t=++this._handleId;this.addHandles((0,r.kB)((()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this.hasHandles(d)||this._set("updating",!1))})),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},i){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const o=i(e,t,s);return this.addHandles(o,n),(0,r.kB)((()=>this.removeHandles(n)))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),i=(0,o.YP)(e,s,{sync:!0,equals:()=>!1});return this.addHandles(i,t),i}_createSyncUpdatingCallback(){return()=>{this.removeHandles(d),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a.Os)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(d))})),d)}}};(0,i._)([(0,l.Cb)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,i._)([(0,u.j)("esri.core.support.UpdatingHandles")],h);const d=-42},37549:(e,t,s)=>{s.d(t,{H:()=>a});var i=s(80442),n=s(24133),r=s(24470);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.Q(9,(0,i.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.cS)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},28972:(e,t,s)=>{s.d(t,{Z:()=>x});var i=s(67676),n=s(20102),r=s(32448),o=s(92604),a=s(60437),l=s(24470),u=s(98732),h=s(37549),d=s(42712);function c(e,t){return e?t?4:3:t?3:2}function p(e,t,s,i,n){if(!t?.lengths.length)return null;const r="upperLeft"===n?.originPosition?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const o=e.coords,a=[],l=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:u,coords:h}=t,d=c(s,i);let p=0;for(const e of u){const t=f(l,h,p,e,s,i,r);t&&a.push(t),p+=e*d}if(a.sort(((e,t)=>{let i=r*e[2]-r*t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),a.length){let e=6*a[0][2];o[0]=a[0][0]/e,o[1]=a[0][1]/e,s&&(e=6*a[0][4],o[2]=0!==e?a[0][3]/e:0),(o[0]<l[0]||o[0]>l[1]||o[1]<l[2]||o[1]>l[3]||s&&(o[2]<l[4]||o[2]>l[5]))&&(o.length=0)}if(!o.length){const e=t.lengths[0]?_(h,0,u[0],s,i):null;if(!e)return null;o[0]=e[0],o[1]=e[1],s&&e.length>2&&(o[2]=e[2])}return e}function f(e,t,s,i,n,r,o=1){const a=c(n,r);let l=s,u=s+a,h=0,d=0,p=0,f=0,_=0;for(let s=0,r=i-1;s<r;s++,l+=a,u+=a){const s=t[l],i=t[l+1],r=t[l+2],o=t[u],a=t[u+1],c=t[u+2];let g=s*a-o*i;f+=g,h+=(s+o)*g,d+=(i+a)*g,n&&(g=s*c-o*r,p+=(r+c)*g,_+=g),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(f*o>0&&(f*=-1),_*o>0&&(_*=-1),!f)return null;const g=[h,d,.5*f];return n&&(g[3]=p,g[4]=.5*_),g}function _(e,t,s,i,n){const r=c(i,n);let o=t,a=t+r,l=0,u=0,h=0,d=0;for(let t=0,n=s-1;t<n;t++,o+=r,a+=r){const t=e[o],s=e[o+1],n=e[o+2],r=e[a],c=e[a+1],p=e[a+2],f=i?m(t,s,n,r,c,p):g(t,s,r,c);if(f)if(l+=f,i){const e=v(t,s,n,r,c,p);u+=f*e[0],h+=f*e[1],d+=f*e[2]}else{const e=y(t,s,r,c);u+=f*e[0],h+=f*e[1]}}return l>0?i?[u/l,h/l,d/l]:[u/l,h/l]:s>0?i?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function g(e,t,s,i){const n=s-e,r=i-t;return Math.sqrt(n*n+r*r)}function m(e,t,s,i,n,r){const o=i-e,a=n-t,l=r-s;return Math.sqrt(o*o+a*a+l*l)}function y(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function v(e,t,s,i,n,r){return[e+.5*(i-e),t+.5*(n-t),s+.5*(r-s)]}var b=s(70272),I=s(5428);const C={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new b.u_(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(null==e.centroid&&(e.centroid=p(new I.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)},E=(0,a.Ue)();class x{constructor(e){this.geometryInfo=e,this._boundsStore=new h.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.Z,this.featureAdapter=C}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,d.S2)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.pC)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.JR)(E,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.$)(null!=i?i:(0,l.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.$)((0,l.Ue)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},1231:(e,t,s)=>{s.d(t,{Z:()=>g});var i,n=s(43697),r=s(35454),o=s(96674),a=s(5600),l=s(75215),u=(s(67676),s(80442),s(36030)),h=s(71715),d=s(52011),c=s(72729),p=s(86719);const f=new r.X({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let _=i=class extends o.wq{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?.value??null}readValueType(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?f.fromJSON(s.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],_.prototype,"alias",void 0),(0,n._)([(0,a.Cb)({type:[String,Number],json:{write:{allowNull:!0}}})],_.prototype,"defaultValue",void 0),(0,n._)([(0,a.Cb)()],_.prototype,"description",void 0),(0,n._)([(0,h.r)("description")],_.prototype,"readDescription",null),(0,n._)([(0,a.Cb)({types:c.V5,json:{read:{reader:c.im},write:!0}})],_.prototype,"domain",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),(0,n._)([(0,a.Cb)({type:l.z8,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],_.prototype,"length",void 0),(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],_.prototype,"name",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),(0,n._)([(0,u.J)(p.v)],_.prototype,"type",void 0),(0,n._)([(0,a.Cb)()],_.prototype,"valueType",void 0),(0,n._)([(0,h.r)("valueType",["description"])],_.prototype,"readValueType",null),(0,n._)([(0,a.Cb)({type:Boolean,json:{read:!1}})],_.prototype,"visible",void 0),_=i=(0,n._)([(0,d.j)("esri.layers.support.Field")],_);const g=_},39450:(e,t,s)=>{s.d(t,{Z:()=>h});var i,n=s(43697),r=s(96674),o=s(5600),a=s(75215),l=(s(67676),s(80442),s(52011));let u=i=class extends r.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"cols",void 0),(0,n._)([(0,o.Cb)({type:a.z8,json:{write:!0}})],u.prototype,"level",void 0),(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],u.prototype,"levelValue",void 0),(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"origin",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{write:!0}})],u.prototype,"resolution",void 0),(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"rows",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{write:!0}})],u.prototype,"scale",void 0),u=i=(0,n._)([(0,l.j)("esri.layers.support.LOD")],u);const h=u},11145:(e,t,s)=>{s.d(t,{Z:()=>x});var i,n=s(43697),r=s(35454),o=s(96674),a=s(67900),l=s(5600),u=s(75215),h=(s(67676),s(80442),s(71715)),d=s(52011),c=s(30556),p=s(94139),f=s(82971),_=s(24470),g=s(8744),m=s(40488),y=s(39450),v=s(43077);const b=new r.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let I=i=class extends o.wq{static create(e={}){const{resolutionFactor:t=1,scales:s,size:n=256,spatialReference:r=f.Z.WebMercator,numLODs:o=24}=e;if(!(0,g.JY)(r)){const e=[];if(s)for(let t=0;t<s.length;t++){const i=s[t];e.push(new y.Z({level:t,scale:i,resolution:i}))}else{let t=5e-4;for(let s=o-1;s>=0;s--)e.unshift(new y.Z({level:s,scale:t,resolution:t})),t*=2}return new i({dpi:96,lods:e,origin:new p.Z(0,0,r),size:[n,n],spatialReference:r})}const l=(0,g.C5)(r),u=e.origin?new p.Z({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.Z(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),h=1/(39.37*(0,a.c9)(r)*96),d=[];if(s)for(let e=0;e<s.length;e++){const t=s[e],i=t*h;d.push(new y.Z({level:e,scale:t,resolution:i}))}else{let e=(0,g.sT)(r)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/t);d.push(new y.Z({level:0,scale:e,resolution:e*h}));for(let i=1;i<s;i++){const s=e/2**t,n=s*h;d.push(new y.Z({level:i,scale:s,resolution:n})),e=s}}return new i({dpi:96,lods:d,origin:u,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const s=(0,g.C5)(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return p.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const i=[],n=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach((e=>{i.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,n[e.level]=e}))),this._set("scales",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;i<s;i++){const s=t[i],n=t[i+1];if(s<=e)return i;if(n===e)return i+1;if(s>e&&n<e)return i+Math.log(s/e)/Math.log(s/n)}return i}snapScale(e,t=.95){const s=this.scaleToZoom(e);return s%Math.floor(s)>=t?this.zoomToScale(Math.ceil(s)):this.zoomToScale(Math.floor(s))}tileAt(e,t,s,i){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=s;else if((0,g.fS)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,i=s;else{const e=(0,m.iV)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,i=s}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return i||(i=new v.f(null,0,0,0,(0,_.Ue)())),i.level=e,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((r-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=i.ExtrapolateOptions.NONE){let s=this.lodAt(e.level);if(!s&&t===i.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return;const n=e.level-s.level,r=s.resolution*this.size[0]/2**n,o=s.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,_.Ue)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const s=this.lodAt(t.level);if(null==s)return null;const{resolution:i}=s,n=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return i.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const s=[],n=this.lods.length;for(let e=0;e<n;e++){const i=this.lods[e],n=i.resolution*t;s.push(new y.Z({level:i.level,scale:i.scale,resolution:n}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const i=e[s];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};var C,E;(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],I.prototype,"compressionQuality",void 0),(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],I.prototype,"dpi",void 0),(0,n._)([(0,l.Cb)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],I.prototype,"format",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],I.prototype,"isWrappable",null),(0,n._)([(0,l.Cb)({type:p.Z,json:{write:!0}})],I.prototype,"origin",void 0),(0,n._)([(0,h.r)("origin")],I.prototype,"readOrigin",null),(0,n._)([(0,l.Cb)({type:[y.Z],value:null,json:{write:!0}})],I.prototype,"lods",null),(0,n._)([(0,l.Cb)({readOnly:!0})],I.prototype,"scales",void 0),(0,n._)([(0,l.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],I.prototype,"size",void 0),(0,n._)([(0,h.r)("size",["rows","cols"])],I.prototype,"readSize",null),(0,n._)([(0,c.c)("size",{cols:{type:u.z8},rows:{type:u.z8}})],I.prototype,"writeSize",null),(0,n._)([(0,l.Cb)({type:f.Z,json:{write:!0}})],I.prototype,"spatialReference",void 0),I=i=(0,n._)([(0,d.j)("esri.layers.support.TileInfo")],I),C=I||(I={}),(E=C.ExtrapolateOptions||(C.ExtrapolateOptions={}))[E.NONE=0]="NONE",E[E.POWER_OF_TWO=1]="POWER_OF_TWO";const x=I},43077:(e,t,s)=>{s.d(t,{f:()=>i});class i{constructor(e,t,s,i,n=void 0){this.id=e,this.level=t,this.row=s,this.col=i,this.extent=n}}},66677:(e,t,s)=>{s.d(t,{B5:()=>h,DR:()=>c,G:()=>v,M8:()=>_,Nm:()=>g,Qc:()=>d,XG:()=>m,a7:()=>f,ld:()=>p,wH:()=>y});var i=s(17452),n=s(25929);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function h(e){return!!a.test(e)}function d(e){if(null==e)return null;const t=(0,i.mN)(e),s=t?.path.match(a)||t?.path.match(l);if(!s)return null;const[,n,o,u,h]=s,d=o.indexOf("/");return{title:p(-1!==d?o.slice(d+1):o),serverType:r[u.toLowerCase()],sublayer:null!=h&&""!==h?parseInt(h,10):null,url:{path:n}}}function c(e){const t=(0,i.mN)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function p(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function f(e,t){const s=[];if(e){const t=d(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=p(t);s.push(e)}if(2===s.length){if(s[0].toLowerCase().includes(s[1].toLowerCase()))return s[0];if(s[1].toLowerCase().includes(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function _(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),s=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&s}function g(e,t){return e?(0,i.Qj)((0,i.Hu)(e,t)):e}function m(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.Hu)(t,e.logger);const s=(0,i.mN)(t),n=d(s.path);let r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=c(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.Qj)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.v_)(r.url,s,e.layerId.toString()))}function v(e){if(!e)return!1;const t=e.toLowerCase(),s=t.includes("/services/"),i=t.includes("/mapserver/wmsserver"),n=t.includes("/imageserver/wmsserver"),r=t.includes("/wmsserver");return s&&(i||n||r)}},72729:(e,t,s)=>{s.d(t,{im:()=>x,V5:()=>E}),s(80442);var i,n=s(43697),r=s(22974),o=s(5600),a=(s(75215),s(36030)),l=s(52011),u=s(96674);s(67676);let h=i=class extends u.wq{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],h.prototype,"name",void 0),(0,n._)([(0,o.Cb)({type:[String,Number],json:{write:!0}})],h.prototype,"code",void 0),h=i=(0,n._)([(0,l.j)("esri.layers.support.CodedValue")],h);const d=new(s(35454).X)({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends u.wq{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,n._)([(0,a.J)(d)],c.prototype,"type",void 0),c=(0,n._)([(0,l.j)("esri.layers.support.Domain")],c);const p=c;var f;let _=f=class extends p{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const s=String(e);this.codedValues.some((e=>(String(e.code)===s&&(t=e.name),!!t)))}return t}clone(){return new f({codedValues:(0,r.d9)(this.codedValues),name:this.name})}};(0,n._)([(0,o.Cb)({type:[h],json:{write:!0}})],_.prototype,"codedValues",void 0),(0,n._)([(0,a.J)({codedValue:"coded-value"})],_.prototype,"type",void 0),_=f=(0,n._)([(0,l.j)("esri.layers.support.CodedValueDomain")],_);const g=_;var m;s(92604),s(20102);let y=m=class extends p{constructor(e){super(e),this.type="inherited"}clone(){return new m}};(0,n._)([(0,a.J)({inherited:"inherited"})],y.prototype,"type",void 0),y=m=(0,n._)([(0,l.j)("esri.layers.support.InheritedDomain")],y);const v=y;var b;let I=b=class extends p{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new b({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n._)([(0,o.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,s){t[s]=[this.minValue||0,e]}}}})],I.prototype,"maxValue",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,s){t[s]=[e,this.maxValue||0]}}}})],I.prototype,"minValue",void 0),(0,n._)([(0,a.J)({range:"range"})],I.prototype,"type",void 0),I=b=(0,n._)([(0,l.j)("esri.layers.support.RangeDomain")],I);const C=I,E={key:"type",base:p,typeMap:{range:I,"coded-value":g,inherited:v}};function x(e){if(!e?.type)return null;switch(e.type){case"range":return C.fromJSON(e);case"codedValue":return g.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},99282:(e,t,s)=>{s.d(t,{a:()=>r});var i=s(67900),n=s(68441);const r={unknown:1,inches:(0,i.En)(1,"meters","inches"),feet:(0,i.En)(1,"meters","feet"),"us-feet":(0,i.En)(1,"meters","us-feet"),yards:(0,i.En)(1,"meters","yards"),miles:(0,i.En)(1,"meters","miles"),"nautical-miles":(0,i.En)(1,"meters","nautical-miles"),millimeters:(0,i.En)(1,"meters","millimeters"),centimeters:(0,i.En)(1,"meters","centimeters"),decimeters:(0,i.En)(1,"meters","decimeters"),meters:(0,i.En)(1,"meters","meters"),kilometers:(0,i.En)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.ty)(1,"meters",n.sv.radius)}},28694:(e,t,s)=>{s.d(t,{p:()=>n});var i=s(69285);function n(e,t,s){if(!s?.features||!s.hasZ)return;const n=(0,i.k)(s.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of s.features)n(e.geometry)}},86787:(e,t,s)=>{s.d(t,{Z:()=>b});var i,n=s(43697),r=s(35454),o=s(96674),a=s(70586),l=s(5600),u=(s(75215),s(67676),s(80442),s(71715)),h=s(52011),d=s(30556),c=s(35671);let p=i=class extends o.wq{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,c.io)(e,t,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"expression",void 0),(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"title",void 0),p=i=(0,n._)([(0,h.j)("esri.layers.support.FeatureExpressionInfo")],p);const f=p;var _,g=s(12541);const m=(0,r.w)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new r.X({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=_=class extends o.wq{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,s,i){t[s]=e.write({},i),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new _({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a._W)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n._)([(0,l.Cb)({type:f,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,n._)([(0,u.r)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,n._)([(0,d.c)("featureExpressionInfo",{featureExpressionInfo:{type:f},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,n._)([(0,l.Cb)({type:m.apiValues,nonNullable:!0,json:{type:m.jsonValues,read:m.read,write:{writer:m.write,isRequired:!0}}})],v.prototype,"mode",null),(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,n._)([(0,l.Cb)({type:g.f9,json:{type:String,read:y.read,write:y.write}})],v.prototype,"unit",null),v=_=(0,n._)([(0,h.j)("esri.layers.support.ElevationInfo")],v);const b=v},12541:(e,t,s)=>{s.d(t,{Z7:()=>n,f9:()=>r});var i=s(99282);function n(e){return 1/(i.a[e]||1)}const r=function(){const e=Object.keys(i.a);return e.sort(),e}()},65967:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ie});var i=s(43697),n=(s(66577),s(32448)),r=s(95330),o=s(17445),a=s(5600),l=(s(75215),s(67676)),u=(s(80442),s(52011)),h=s(19402),d=s(82971),c=s(28972),p=s(3489),f=s(11145),_=s(14165),g=s(86787),m=s(13867),y=s(30175),v=s(67900),b=s(12541);function I(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:s,spatialReference:i}=t;return new E(e,s,i)}return new C}class C{async alignCandidates(e,t){return e}notifyElevationSourceChange(){}}class E{constructor(e,t,s){this._elevationInfo=e,this._alignPointsInFeatures=t,this.spatialReference=s,this._alignmentsCache=new m.z(1024),this._cacheVersion=0,this._metersPerVerticalUnit=(0,v._R)(s)}async alignCandidates(e,t){const s=this._elevationInfo;return null==s||"absolute-height"!==s.mode||s.featureExpressionInfo?this._alignComputedElevationCandidates(e,t):(this._alignAbsoluteElevationCandidates(e,s),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t){const{offset:s,unit:i}=t;if(null==s)return;const n=s*((0,b.Z7)(i??"meters")/this._metersPerVerticalUnit);for(const t of e)switch(t.type){case"edge":t.start.z+=n,t.end.z+=n;continue;case"vertex":t.target.z+=n;continue}}async _alignComputedElevationCandidates(e,t){const s=new Map;for(const t of e)(0,y.s1)(s,t.objectId,F).push(t);const[i,n,o]=this._prepareQuery(s),a=await this._alignPointsInFeatures(i,t);if((0,r.k_)(t),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t);this._applyCacheAndResponse(i,a,n);const{drapedObjectIds:l,failedObjectIds:u}=a,h=[];for(const t of e){const{objectId:e}=t;l.has(e)&&"edge"===t.type&&(t.draped=!0),u.has(e)||h.push(t)}return h}_prepareQuery(e){const t=[],s=[];for(const[i,n]of e){const e=[];for(const t of n)this._addToQueriesOrCachedResult(i,t.target,e,s),"edge"===t.type&&(this._addToQueriesOrCachedResult(i,t.start,e,s),this._addToQueriesOrCachedResult(i,t.end,e,s));0!==e.length&&t.push({objectId:i,points:e})}return[t,s,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const n=w(e,t),r=this._alignmentsCache.get(n);null==r?s.push(t):i.push(new x(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e){if(i.has(n)){r+=a.length;continue}const e=!s.has(n);for(const s of a){const i=w(n,s),a=t[r++];s.z=a,e&&o.put(i,a,1)}}}}class x{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function w(e,{x:t,y:s,z:i}){return`${e}-${t}-${s}-${i??0}}`}function F(){return[]}class S{filter(e,t){return t}notifyElevationSourceChange(){}}class T{filter(e,t){const{point:s,distance:i}=e,{z:n}=s;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(i),o=this._updateCandidatesTo3D(t,s,r).filter(O);return o.sort(M),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":R(i,t,s);continue;case"vertex":N(i,t,s);continue}return e}}function O(e){return e.distance<=1}function B(e=!1){return e?new T:new S}function R(e,t,{x:s,y:i,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,s,i){const n=i.x-s.x,r=i.y-s.y,o=i.z-s.z,a=n*n+r*r+o*o,l=(t.x-s.x)*n+(t.y-s.y)*r+o*(t.z-s.z),u=Math.min(1,Math.max(0,l/a)),h=s.x+n*u,d=s.y+r*u,c=s.z+o*u;e.x=h,e.y=d,e.z=c}(a,t,r,o);const l=(t.x-a.x)/s,u=(t.y-a.y)/i,h=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+u*u+h*h)}function N(e,t,{x:s,y:i,z:n}){const{target:r}=e,o=(t.x-r.x)/s,a=(t.y-r.y)/i,l=(t.z-r.z)/n,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function M(e,t){return e.distance-t.distance}var A=s(22974),P=s(19153);function j(e=!1,t){return e?new z(t):new H}class H{async fetch(){return[]}notifySymbologyChange(){}}class z{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new m.z(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const s=[],i=[],n=this._candidatesCache;for(const t of e){const e=V(t),r=n.get(e);if(r)for(const e of r)i.push((0,A.d9)(e));else s.push(t),n.put(e,[],1)}if(0===s.length)return i;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(s,t);if((0,r.k_)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],i=V(s[l[e]]),r=n.get(i);r.push(t),n.put(i,r,r.length),u.push((0,A.d9)(t))}return i.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function V(e){switch(e.type){case"vertex":{const{objectId:t,target:s}=e,i=`${t}-vertex-${s.x}-${s.y}-${s.z??0}`;return(0,P.hP)(i).toString()}case"edge":{const{objectId:t,start:s,end:i}=e,n=`${t}-edge-${s.x}-${s.y}-${s.z??0}-to-${i.x}-${i.y}-${i.z??0}`;return(0,P.hP)(n).toString()}default:return""}}var k=s(92036);let U=class extends k.Z{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(e,t){this._pending.push({promise:e,callback:t}),1===this._pending.length&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const e=this._pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this._pending.shift(),this._process()}))}};(0,i._)([(0,a.Cb)()],U.prototype,"updating",void 0),U=(0,i._)([(0,u.j)("esri.core.AsyncSequence")],U);var D,Y=s(66643),Z=s(50758),X=s(92604),q=s(75517),L=s(6570),J=s(24470),G=s(98732),$=s(66677),W=s(78760),Q=s(34599);class K{constructor(e,t){this.data=e,this.resolution=t,this.state={type:D.CREATED},this.alive=!0}process(e){switch(this.state.type){case D.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case D.FETCH_COUNT:break;case D.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case D.FETCH_FEATURES:break;case D.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case D.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case D.CREATED:case D.FETCH_COUNT:return 0;case D.FETCHED_COUNT:return this.state.featureCount;case D.FETCH_FEATURES:return this.state.previous.featureCount;case D.FETCHED_FEATURES:return this.state.features.length;case D.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case D.CREATED:return"created";case D.FETCH_COUNT:return"fetch-count";case D.FETCHED_COUNT:return"fetched-count";case D.FETCH_FEATURES:return"fetch-features";case D.FETCHED_FEATURES:return"fetched-features";case D.DONE:return"done"}}_gotoFetchCount(e,t){return{type:D.FETCH_COUNT,previous:e,task:(0,Y.vr)((async e=>{const s=await(0,Y.mt)(t.fetchCount(this,e));this.state.type===D.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:D.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:D.FETCH_FEATURES,previous:e,task:(0,Y.vr)((async s=>{const i=await(0,Y.mt)(t.fetchFeatures(this,e.featureCount,s));this.state.type===D.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,i.ok?i.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:D.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:D.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:D.CREATED},e.type){case D.CREATED:case D.FETCHED_COUNT:case D.FETCHED_FEATURES:case D.DONE:break;case D.FETCH_COUNT:case D.FETCH_FEATURES:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,J.oJ)(e,ee),(0,J.kK)(this.data.extent,ee))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(D||(D={}));const ee=(0,J.Ue)();let te=class extends k.Z{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=(0,q.G0)(e,this._mandatoryOutFields);(0,q.fS)(s,t)||(this._set("outFields",s),(0,q.ik)(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.R,this._pendingEdits=new U,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,l.fS)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),o.Z_),this.addHandles((0,o.gx)((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this._pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,$.M8)(this.url))return;const e=(0,Y.vr)((async e=>{try{const t=await(0,Q.Vr)(this.url,new _.Z({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=L.Z.fromJSON(t.data?.extent)}catch(e){(0,r.r9)(e),X.Z.getLogger(this).warn("Failed to fetch data extent",e)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles((0,Z.kB)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:s}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<ne}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const s=this.tileSize*t;return e*(re/(s*s))<oe}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this._pendingTiles)s.state.type<D.FETCHED_COUNT&&this._updatingHandles.addPromise(s.process(e)),s.state.type<=D.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new K(e,t);return this._pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ie,signal:t})}async _fetchFeatures(e,t,s){let i=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,i,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,s);l&&(i+=a.num),r+=u.length;for(const e of u)n.push(e);if(o=t-r,!l||!h||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let i=null;if(this.store.featureStore.forEach((n=>{e===n.attributes[t]&&(i=n.objectId??n.attributes[s])})),null==i)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.qp)(this.url,e,new W.J({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,G.lM)(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.JT)(this.url,e,s,{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,G.h_)(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,i=(0,q.G0)((0,q.e5)(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new _.Z({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?(0,J.HH)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return null!=s&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?_.Z.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||n)&&r?r:o||se);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"url",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"objectIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"globalIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"capabilities",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"spatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"store",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"_minimumVerticesPerFeature",null),(0,i._)([(0,a.Cb)()],te.prototype,"_mandatoryOutFields",null),(0,i._)([(0,a.Cb)()],te.prototype,"outFields",null),(0,i._)([(0,a.Cb)()],te.prototype,"suspended",void 0),(0,i._)([(0,a.Cb)()],te.prototype,"filter",null),(0,i._)([(0,a.Cb)()],te.prototype,"customParameters",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"_configuration",null),(0,i._)([(0,a.Cb)()],te.prototype,"tileInfo",null),(0,i._)([(0,a.Cb)()],te.prototype,"tileSize",null),(0,i._)([(0,a.Cb)()],te.prototype,"tilesOfInterest",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"availability",void 0),(0,i._)([(0,a.Cb)()],te.prototype,"hasZ",null),te=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],te);const se=2e3,ie=6e5,ne=1e6,re=25,oe=1;var ae=s(43090),le=s(91303),ue=s(37549),he=s(43077);class de{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(null!=t&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,i]of this._store){if(this._byteSize<=e)break;this.delete(s),t(i)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let ce=class extends k.Z{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*le.Y.MEGABYTES,this._tileBounds=new ue.H,this._tiles=new de,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,J.Ue)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const s=this.featureStore.upsertMany(t),i=s.map((e=>new Set(Object.keys(e.attributes)))).reduce(((e,t)=>(0,q.jV)(e,t)),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map((e=>e.objectId))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if(null==e)return 0;const t=(0,ae.do)(e.lengths,4);return 32+(0,ae.do)(e.coords,8)+t}(e.geometry)+(0,ae.f2)(e.attributes)}(t)),0)}(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const n=e.id;this._tiles.set(n,new pe(e,t,s,i)),this._tileBounds.set(n,e.extent),this._tileFeatureCounts.set(n,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===ye.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){const i=(await t(e,s)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of i){const t=(0,G.$)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,(t=>{const s=this._tiles.get(t);this.featureStore.add(e);const i=e.objectId;s.objectIds.has(i)||(s.objectIds.add(i),this._referenceFeature(i),this._tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0),s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,J.kK)((0,J.oJ)(this.extent,this._tmpBoundingRect),e.extent))return new _e(e);const i=this.getAttributesForTile(e.id);if((0,q.ik)(s,i))return new _e(e);const n=this._createTileTree(e,this.tileInfo);return this._simplify(n,t,null,0,1),this._collectMissingTiles(e,n,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Q.hH)(t,s,i);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const s=new fe(e.level,e.row,e.col);return t.updateTileInfo(s,f.Z.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(i=>{const n=this._tiles.get(i)?.data;n&&this._tilesAreRelated(e,n)&&this._populateChildren(s,n,t,this._tileFeatureCounts.get(n.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,n=s?t:e,r=1<<n.level-i.level;return Math.floor(n.row/r)===i.row&&Math.floor(n.col/r)===i.col}_populateChildren(e,t,s,i){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,s,i);else{const n=new fe(e.level+1,r,o);s.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=n,this._populateChildren(n,t,s,i)}}_simplify(e,t,s,i,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=s&&(s.children[i]=null),r);const o=n/2,a=o*o;let l=0;for(let s=0;s<e.children.length;s++){const i=e.children[s];l+=null!=i?this._simplify(i,t,e,s,o):a}return 0===l?this._mergeChildren(e):1-l/r<me&&(this._purge(e),null!=s&&(s.children[i]=null),l=r),l}_mergeChildren(e){const t=new Set;let s,i=0;this._forEachLeaf(e,(e=>{const n=this._tiles.get(e.id);if(n){s=s?(0,q.jV)(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const e of n.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const n=new ge(s,e,this.extent);return this._collectMissingTilesRecurse(t,n,1,i),n.info}_collectMissingTilesRecurse(e,t,s,i){const n=this.getAttributesForTile(e.id),r=n&&!(0,q.ik)(i,n);if(r&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let s=0;s<e.children.length;s++){const n=e.children[s];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),o):this._collectMissingTilesRecurse(n,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?ye.ADDED:ye.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),ye.REMOVED):(t>0&&this._refCounts.set(e,t),ye.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this._refCounts.keys()).map((e=>`${e}:${this._refCounts.get(e)}`))}}};(0,i._)([(0,a.Cb)({constructOnly:!0})],ce.prototype,"featureStore",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"tileInfo",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"extent",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"maximumByteSize",void 0),ce=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],ce);class pe{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}}class fe{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class _e{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,J.SO)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class ge{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new _e(t),null!=s&&(this._extent=(0,J.oJ)(s))}addMissing(e,t,s,i){const n=new he.f(null,e,t,s);this._tileInfo.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),null==n.extent||null!=this._extent&&!(0,J.kK)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:i}),this.info.coveredArea-=(0,J.SO)(n.extent))}}const me=.18751;var ye;!function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"}(ye||(ye={}));var ve=s(33955);let be=class extends n.Z.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.hh)(),this._elevationAligner=I(),this._elevationFilter=B(),this._symbologyCandidatesFetcher=j(),this._updatingHandles=new h.R,this._editsUpdatingHandles=new h.R,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const s={points:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return(0,r.k_)(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return(0,r.k_)(t),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:n}=e.serviceInfo,{hasZ:r}=e,a=d.Z.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new c.Z({...e.serviceInfo,hasZ:r,hasM:!1}),this._queryEngine=new p.q({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:r,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new te({store:new ce({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:d.Z.fromJSON(e.serviceInfo.spatialReference)});const l="3d"===e.configuration.viewType;return this._elevationAligner=I(l,{elevationInfo:null!=e.elevationInfo?g.Z.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures,spatialReference:a}),this._elevationFilter=B(l),this.addHandles([(0,o.YP)((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),o.Z_),(0,o.YP)((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),Ce}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.suspended=e,Ce}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.outFields=new Set(e??[]),Ce}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.k_)(t);const s=function(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:n,timeExtent:r,objectIds:o}=e.filter,a={geometry:e.filter.geometry?(0,ve.im)(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:r,objectIds:o,where:n??"1=1"};return{...e,query:a}}(e),i=t?.signal,n=await this._queryEngine.executeQueryForSnapping(s,i);(0,r.k_)(i);const o=await this._elevationAligner.alignCandidates(n.candidates,i);(0,r.k_)(i);const a=await this._symbologyCandidatesFetcher.fetch(o,i);(0,r.k_)(i);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(s,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?f.Z.fromJSON(e.tileInfo):null,Ce}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.refresh(),Ce}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),await(0,o.N1)((()=>!this.updatingExcludingEdits),t),(0,r.k_)(t),Ce}async getDebugInfo(e,t){return(0,r.k_)(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t);const s=(0,r.hh)();return this._pendingApplyEdits.set(e.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),Ce}async endApplyEdits(e,t){const s=this._pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,r.k_)(t),Ce}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),Ce}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),Ce}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=j(e,this._getSymbologyCandidates),Ce}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?_.Z.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,i._)([(0,a.Cb)({readOnly:!0})],be.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],be.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)()],be.prototype,"_isInitializing",void 0),be=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],be);const Ie=be,Ce={result:{}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[664],{25929:(e,t,s)=>{s.d(t,{M:()=>f,a:()=>g,e:()=>c,f:()=>n,i:()=>h,p:()=>d,r:()=>o,t:()=>r,w:()=>a});var i=s(17452);function n(e,t){const s=t?.url?.path;if(e&&s&&(e=(0,i.hF)(e,s,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=(0,i.PF)(e,t.portalItem.itemUrl);null!=s&&u.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return p(e,t?.portal)}function r(e,t,s=f.YES){if(null==e)return e;!(0,i.YP)(e)&&t?.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let n=(0,i.hF)(e);if(t){const s=t.verifyItemRelativeUrls?.rootPath||t.url?.path;if(s){const r=p(s,t.portal),o=p(n,t.portal);n=(0,i.PF)(o,r,r),null!=n&&n!==o&&n!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(n)}}return n=c(n,t?.portal),(0,i.YP)(n)&&(n=(0,i.Fv)(n)),t?.resources&&t?.portalItem&&!(0,i.YP)(n)&&!(0,i.HK)(n)&&s===f.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(n),compress:!1}),n}function o(e,t,s){return n(e,s)}function a(e,t,s,i){const n=r(e,i);void 0!==n&&(t[s]=n)}const l=/\/items\/([^\/]+)\/resources\/(.*)/,u=/^\.\/resources\//;function h(e){const t=e?.match(l)??null;return t?.[1]??null}function d(e){const t=e?.match(l)??null;if(null==t)return null;const s=t[2],n=s.lastIndexOf("/");if(-1===n){const{path:e,extension:t}=(0,i.fZ)(s);return{prefix:null,filename:e,extension:t}}const{path:r,extension:o}=(0,i.fZ)(s.slice(n+1));return{prefix:s.slice(0,n),filename:r,extension:o}}function c(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?(0,i.Ie)(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function p(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const s=`${t.urlKey}.${t.customBaseUrl}`,n=(0,i.TI)();return(0,i.D6)(n,`${n.scheme}://${s}`)?(0,i.Ie)(e,t.portalHostname,s):(0,i.Ie)(e,s,t.portalHostname)}var f,_;(_=f||(f={}))[_.YES=0]="YES",_[_.NO=1]="NO";const g=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return f},ensureMainOnlineDomain:c,fromJSON:n,itemIdFromResourceUrl:h,prefixAndFilenameFromResourceUrl:d,read:o,toJSON:r,write:a},Symbol.toStringTag,{value:"Module"}))},91303:(e,t,s)=>{var i;s.d(t,{Y:()=>i}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(i||(i={}))},24133:(e,t,s)=>{s.d(t,{Q:()=>o});var i=s(67676),n=s(44553),r=s(88764);class o{constructor(e=9,t){this._compareMinX=h,this._compareMinY=d,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),v.prune(),b.prune(),I.prune(),C.prune()}all(e){this._all(this._data,e)}search(e,t){let s=this._data;const i=this._toBBox;if(m(e,s))for(v.clear();s;){for(let n=0,r=s.children.length;n<r;n++){const r=s.children[n],o=s.leaf?i(r):r;m(e,o)&&(s.leaf?t(r):g(e,o)?this._all(r,t):v.push(r))}s=v.pop()}}collides(e){let t=this._data;const s=this._toBBox;if(!m(e,t))return!1;for(v.clear();t;){for(let i=0,n=t.children.length;i<n;i++){const n=t.children[i],r=t.leaf?s(n):n;if(m(e,r)){if(t.leaf||g(e,r))return!0;v.push(n)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,s=e.length;t<s;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new w([]),this}remove(e){if(!e)return this;let t,s=this._data,n=null,r=0,o=!1;const a=this._toBBox(e);for(I.clear(),C.clear();s||I.length>0;){if(s||(s=I.pop(),n=I.data[I.length-1],r=C.pop()??0,o=!0),s.leaf&&(t=(0,i.cq)(s.children,e,s.children.length,s.indexHint),-1!==t))return s.children.splice(t,1),I.push(s),this._condense(I),this;o||s.leaf||!g(s,a)?n?(r++,s=n.children[r],o=!1):s=null:(I.push(s),C.push(r),r=0,n=s,s=s.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_all(e,t){let s=e;for(b.clear();s;){if(!0===s.leaf)for(const e of s.children)t(e);else b.pushArray(s.children);s=b.pop()??null}}_build(e,t,s,i){const n=s-t+1;let r=this._maxEntries;if(n<=r){const i=new w(e.slice(t,s+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(i-1)));const o=new F([]);o.height=i;const l=Math.ceil(n/r),u=l*Math.ceil(Math.sqrt(r));y(e,t,s,u,this._compareMinX);for(let n=t;n<=s;n+=u){const t=Math.min(n+u-1,s);y(e,n,t,l,this._compareMinY);for(let s=n;s<=t;s+=l){const n=Math.min(s+l-1,t);o.children.push(this._build(e,s,n,i-1))}}return a(o,this._toBBox),o}_chooseSubtree(e,t,s,i){for(;i.push(t),!0!==t.leaf&&i.length-1!==s;){let s,i=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=c(o),l=f(e,o)-a;l<n?(n=l,i=a<i?a:i,s=o):l===n&&a<i&&(i=a,s=o)}t=s||t.children[0]}return t}_insert(e,t,s){const i=this._toBBox,n=s?e:i(e);I.clear();const r=this._chooseSubtree(n,this._data,t,I);for(r.children.push(e),u(r,n);t>=0&&I.data[t].children.length>this._maxEntries;)this._split(I,t),t--;this._adjustParentBBoxes(n,I,t)}_split(e,t){const s=e.data[t],i=s.children.length,n=this._minEntries;this._chooseSplitAxis(s,n,i);const r=this._chooseSplitIndex(s,n,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const o=s.children.splice(r,s.children.length-r),l=s.leaf?new w(o):new F(o);l.height=s.height,a(s,this._toBBox),a(l,this._toBBox),t?e.data[t-1].children.push(l):this._splitRoot(s,l)}_splitRoot(e,t){this._data=new F([e,t]),this._data.height=e.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(e,t,s){let i,n,r;i=n=1/0;for(let o=t;o<=s-t;o++){const t=l(e,0,o,this._toBBox),a=l(e,o,s,this._toBBox),u=_(t,a),h=c(t)+c(a);u<i?(i=u,r=o,n=h<n?h:n):u===i&&h<n&&(n=h,r=o)}return r}_chooseSplitAxis(e,t,s){const i=e.leaf?this._compareMinX:h,n=e.leaf?this._compareMinY:d;this._allDistMargin(e,t,s,i)<this._allDistMargin(e,t,s,n)&&e.children.sort(i)}_allDistMargin(e,t,s,i){e.children.sort(i);const n=this._toBBox,r=l(e,0,t,n),o=l(e,s-t,s,n);let a=p(r)+p(o);for(let i=t;i<s-t;i++){const t=e.children[i];u(r,e.leaf?n(t):t),a+=p(r)}for(let i=s-t-1;i>=t;i--){const t=e.children[i];u(o,e.leaf?n(t):t),a+=p(o)}return a}_adjustParentBBoxes(e,t,s){for(let i=s;i>=0;i--)u(t.data[i],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const s=e.data[t];if(0===s.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,i.cq)(r,s,r.length,n.indexHint),1)}else this.clear();else a(s,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){l(e,0,e.children.length,t,e)}function l(e,t,s,i,n){n||(n=new w([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<s;o++)r=e.children[o],u(n,e.leaf?i(r):r);return n}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function d(e,t){return e.minY-t.minY}function c(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function _(e,t){const s=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-s)*Math.max(0,r-i)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function m(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function y(e,t,s,i,n){const o=[t,s];for(;o.length;){const t=o.pop(),s=o.pop();if(t-s<=i)continue;const a=s+Math.ceil((t-s)/i/2)*i;(0,r.q)(e,a,s,t,n),o.push(s,a,a,t)}}const v=new n.Z,b=new n.Z,I=new n.Z,C=new n.Z({deallocator:void 0});class E{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class x extends E{constructor(){super(...arguments),this.height=1,this.indexHint=new i.SO}}class w extends x{constructor(e){super(),this.children=e,this.leaf=!0}}class F extends x{constructor(e){super(),this.children=e,this.leaf=!1}}},19402:(e,t,s)=>{s.d(t,{R:()=>h});var i=s(43697),n=s(92036),r=s(50758),o=s(17445),a=s(1654),l=s(5600),u=s(52011);let h=class extends n.Z{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o.YP)}addWhen(e,t,s={}){return this._installWatch(e,t,s,o.gx)}addOnCollectionChange(e,t,{initial:s=!1,final:i=!1}={}){const n=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.Z_),(0,o.on)(e,"change",t,{onListenerAdd:s?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:i?e=>t({added:[],removed:e.toArray()}):void 0})],n),(0,r.kB)((()=>this.removeHandles(n)))}addPromise(e){if(null==e)return e;const t=++this._handleId;this.addHandles((0,r.kB)((()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this.hasHandles(d)||this._set("updating",!1))})),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},i){const n=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,n);const o=i(e,t,s);return this.addHandles(o,n),(0,r.kB)((()=>this.removeHandles(n)))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),i=(0,o.YP)(e,s,{sync:!0,equals:()=>!1});return this.addHandles(i,t),i}_createSyncUpdatingCallback(){return()=>{this.removeHandles(d),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a.Os)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(d))})),d)}}};(0,i._)([(0,l.Cb)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,i._)([(0,u.j)("esri.core.support.UpdatingHandles")],h);const d=-42},37549:(e,t,s)=>{s.d(t,{H:()=>a});var i=s(80442),n=s(24133),r=s(24470);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.Q(9,(0,i.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((s,i)=>{e[t++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.cS)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,s){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,s)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},28972:(e,t,s)=>{s.d(t,{Z:()=>x});var i=s(67676),n=s(20102),r=s(32448),o=s(92604),a=s(60437),l=s(24470),u=s(98732),h=s(37549),d=s(42712);function c(e,t){return e?t?4:3:t?3:2}function p(e,t,s,i,n){if(!t?.lengths.length)return null;const r="upperLeft"===n?.originPosition?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const o=e.coords,a=[],l=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:u,coords:h}=t,d=c(s,i);let p=0;for(const e of u){const t=f(l,h,p,e,s,i,r);t&&a.push(t),p+=e*d}if(a.sort(((e,t)=>{let i=r*e[2]-r*t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),a.length){let e=6*a[0][2];o[0]=a[0][0]/e,o[1]=a[0][1]/e,s&&(e=6*a[0][4],o[2]=0!==e?a[0][3]/e:0),(o[0]<l[0]||o[0]>l[1]||o[1]<l[2]||o[1]>l[3]||s&&(o[2]<l[4]||o[2]>l[5]))&&(o.length=0)}if(!o.length){const e=t.lengths[0]?_(h,0,u[0],s,i):null;if(!e)return null;o[0]=e[0],o[1]=e[1],s&&e.length>2&&(o[2]=e[2])}return e}function f(e,t,s,i,n,r,o=1){const a=c(n,r);let l=s,u=s+a,h=0,d=0,p=0,f=0,_=0;for(let s=0,r=i-1;s<r;s++,l+=a,u+=a){const s=t[l],i=t[l+1],r=t[l+2],o=t[u],a=t[u+1],c=t[u+2];let g=s*a-o*i;f+=g,h+=(s+o)*g,d+=(i+a)*g,n&&(g=s*c-o*r,p+=(r+c)*g,_+=g),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(f*o>0&&(f*=-1),_*o>0&&(_*=-1),!f)return null;const g=[h,d,.5*f];return n&&(g[3]=p,g[4]=.5*_),g}function _(e,t,s,i,n){const r=c(i,n);let o=t,a=t+r,l=0,u=0,h=0,d=0;for(let t=0,n=s-1;t<n;t++,o+=r,a+=r){const t=e[o],s=e[o+1],n=e[o+2],r=e[a],c=e[a+1],p=e[a+2],f=i?m(t,s,n,r,c,p):g(t,s,r,c);if(f)if(l+=f,i){const e=v(t,s,n,r,c,p);u+=f*e[0],h+=f*e[1],d+=f*e[2]}else{const e=y(t,s,r,c);u+=f*e[0],h+=f*e[1]}}return l>0?i?[u/l,h/l,d/l]:[u/l,h/l]:s>0?i?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function g(e,t,s,i){const n=s-e,r=i-t;return Math.sqrt(n*n+r*r)}function m(e,t,s,i,n,r){const o=i-e,a=n-t,l=r-s;return Math.sqrt(o*o+a*a+l*l)}function y(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function v(e,t,s,i,n,r){return[e+.5*(i-e),t+.5*(n-t),s+.5*(r-s)]}var b=s(70272),I=s(5428);const C={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new b.u_(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(null==e.centroid&&(e.centroid=p(new I.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)},E=(0,a.Ue)();class x{constructor(e){this.geometryInfo=e,this._boundsStore=new h.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new r.Z,this.featureAdapter=C}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{null!=t.geometry&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,s,i,n]=this.fullBounds;return{xmin:t,ymin:s,xmax:i,ymax:n,spatialReference:(0,d.S2)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map((e=>this._upsert(e)));return this._emitChanged(),t.filter(i.pC)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.JR)(E,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let i;if(this._markedIds.add(t),s?(e.displayId=s.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=(0,u.$)(null!=i?i:(0,l.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),null!=i&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_upsert(e){const t=e?.objectId;if(null==t)return o.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.Z("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:i,attributes:r}=e;for(const e in r)s.attributes[e]=r[e];return i&&(s.geometry=i,this._boundsStore.set(t,(0,u.$)((0,l.Ue)(),i,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}},1231:(e,t,s)=>{s.d(t,{Z:()=>g});var i,n=s(43697),r=s(35454),o=s(96674),a=s(5600),l=s(75215),u=(s(67676),s(80442),s(36030)),h=s(71715),d=s(52011),c=s(72729),p=s(86719);const f=new r.X({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let _=i=class extends o.wq{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?.value??null}readValueType(e,{description:t}){let s=null;try{s=t?JSON.parse(t):null}catch(e){}return s?f.fromJSON(s.fieldValueType):null}clone(){return new i({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],_.prototype,"alias",void 0),(0,n._)([(0,a.Cb)({type:[String,Number],json:{write:{allowNull:!0}}})],_.prototype,"defaultValue",void 0),(0,n._)([(0,a.Cb)()],_.prototype,"description",void 0),(0,n._)([(0,h.r)("description")],_.prototype,"readDescription",null),(0,n._)([(0,a.Cb)({types:c.V5,json:{read:{reader:c.im},write:!0}})],_.prototype,"domain",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),(0,n._)([(0,a.Cb)({type:l.z8,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],_.prototype,"length",void 0),(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],_.prototype,"name",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),(0,n._)([(0,u.J)(p.v)],_.prototype,"type",void 0),(0,n._)([(0,a.Cb)()],_.prototype,"valueType",void 0),(0,n._)([(0,h.r)("valueType",["description"])],_.prototype,"readValueType",null),(0,n._)([(0,a.Cb)({type:Boolean,json:{read:!1}})],_.prototype,"visible",void 0),_=i=(0,n._)([(0,d.j)("esri.layers.support.Field")],_);const g=_},39450:(e,t,s)=>{s.d(t,{Z:()=>h});var i,n=s(43697),r=s(96674),o=s(5600),a=s(75215),l=(s(67676),s(80442),s(52011));let u=i=class extends r.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new i({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"cols",void 0),(0,n._)([(0,o.Cb)({type:a.z8,json:{write:!0}})],u.prototype,"level",void 0),(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],u.prototype,"levelValue",void 0),(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"origin",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{write:!0}})],u.prototype,"resolution",void 0),(0,n._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"rows",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{write:!0}})],u.prototype,"scale",void 0),u=i=(0,n._)([(0,l.j)("esri.layers.support.LOD")],u);const h=u},11145:(e,t,s)=>{s.d(t,{Z:()=>x});var i,n=s(43697),r=s(35454),o=s(96674),a=s(67900),l=s(5600),u=s(75215),h=(s(67676),s(80442),s(71715)),d=s(52011),c=s(30556),p=s(94139),f=s(82971),_=s(24470),g=s(8744),m=s(40488),y=s(39450),v=s(43077);const b=new r.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let I=i=class extends o.wq{static create(e={}){const{resolutionFactor:t=1,scales:s,size:n=256,spatialReference:r=f.Z.WebMercator,numLODs:o=24}=e;if(!(0,g.JY)(r)){const e=[];if(s)for(let t=0;t<s.length;t++){const i=s[t];e.push(new y.Z({level:t,scale:i,resolution:i}))}else{let t=5e-4;for(let s=o-1;s>=0;s--)e.unshift(new y.Z({level:s,scale:t,resolution:t})),t*=2}return new i({dpi:96,lods:e,origin:new p.Z(0,0,r),size:[n,n],spatialReference:r})}const l=(0,g.C5)(r),u=e.origin?new p.Z({x:e.origin.x,y:e.origin.y,spatialReference:r}):new p.Z(l?{x:l.origin[0],y:l.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),h=1/(39.37*(0,a.c9)(r)*96),d=[];if(s)for(let e=0;e<s.length;e++){const t=s[e],i=t*h;d.push(new y.Z({level:e,scale:t,resolution:i}))}else{let e=(0,g.sT)(r)?512/n*591657527.5917094:256/n*591657527.591555;const s=Math.ceil(o/t);d.push(new y.Z({level:0,scale:e,resolution:e*h}));for(let i=1;i<s;i++){const s=e/2**t,n=s*h;d.push(new y.Z({level:i,scale:s,resolution:n})),e=s}}return new i({dpi:96,lods:d,origin:u,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const s=(0,g.C5)(e);return e.isWrappable&&!!s&&Math.abs(s.origin[0]-t.x)<=s.dx}return!1}readOrigin(e,t){return p.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,s=0;const i=[],n=this._levelToLOD={};e&&(t=-1/0,s=1/0,e.forEach((e=>{i.push(e.scale),t=e.scale>t?e.scale:t,s=e.scale<s?e.scale:s,n[e.level]=e}))),this._set("scales",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;i<s;i++){const s=t[i],n=t[i+1];if(s<=e)return i;if(n===e)return i+1;if(s>e&&n<e)return i+Math.log(s/e)/Math.log(s/n)}return i}snapScale(e,t=.95){const s=this.scaleToZoom(e);return s%Math.floor(s)>=t?this.zoomToScale(Math.ceil(s)):this.zoomToScale(Math.floor(s))}tileAt(e,t,s,i){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=s;else if((0,g.fS)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,i=s;else{const e=(0,m.iV)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,i=s}const a=n.resolution*this.size[0],l=n.resolution*this.size[1];return i||(i=new v.f(null,0,0,0,(0,_.Ue)())),i.level=e,i.row=Math.floor((this.origin.y-o)/l+.001),i.col=Math.floor((r-this.origin.x)/a+.001),this.updateTileInfo(i),i}updateTileInfo(e,t=i.ExtrapolateOptions.NONE){let s=this.lodAt(e.level);if(!s&&t===i.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(s=t)}if(!s)return;const n=e.level-s.level,r=s.resolution*this.size[0]/2**n,o=s.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,_.Ue)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const s=this.lodAt(t.level);if(null==s)return null;const{resolution:i}=s,n=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return i.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const s=[],n=this.lods.length;for(let e=0;e<n;e++){const i=this.lods[e],n=i.resolution*t;s.push(new y.Z({level:i.level,scale:i.scale,resolution:n}))}return new i({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;s<e.length;s++){const i=e[s];this._upsampleLevels[i.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/i.resolution:0},t=i}}};var C,E;(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],I.prototype,"compressionQuality",void 0),(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],I.prototype,"dpi",void 0),(0,n._)([(0,l.Cb)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],I.prototype,"format",void 0),(0,n._)([(0,l.Cb)({readOnly:!0})],I.prototype,"isWrappable",null),(0,n._)([(0,l.Cb)({type:p.Z,json:{write:!0}})],I.prototype,"origin",void 0),(0,n._)([(0,h.r)("origin")],I.prototype,"readOrigin",null),(0,n._)([(0,l.Cb)({type:[y.Z],value:null,json:{write:!0}})],I.prototype,"lods",null),(0,n._)([(0,l.Cb)({readOnly:!0})],I.prototype,"scales",void 0),(0,n._)([(0,l.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],I.prototype,"size",void 0),(0,n._)([(0,h.r)("size",["rows","cols"])],I.prototype,"readSize",null),(0,n._)([(0,c.c)("size",{cols:{type:u.z8},rows:{type:u.z8}})],I.prototype,"writeSize",null),(0,n._)([(0,l.Cb)({type:f.Z,json:{write:!0}})],I.prototype,"spatialReference",void 0),I=i=(0,n._)([(0,d.j)("esri.layers.support.TileInfo")],I),C=I||(I={}),(E=C.ExtrapolateOptions||(C.ExtrapolateOptions={}))[E.NONE=0]="NONE",E[E.POWER_OF_TWO=1]="POWER_OF_TWO";const x=I},43077:(e,t,s)=>{s.d(t,{f:()=>i});class i{constructor(e,t,s,i,n=void 0){this.id=e,this.level=t,this.row=s,this.col=i,this.extent=n}}},66677:(e,t,s)=>{s.d(t,{B5:()=>h,DR:()=>c,G:()=>v,M8:()=>_,Nm:()=>g,Qc:()=>d,XG:()=>m,a7:()=>f,ld:()=>p,wH:()=>y});var i=s(17452),n=s(25929);const r={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},o=Object.values(r),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),l=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${o.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),u=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function h(e){return!!a.test(e)}function d(e){if(null==e)return null;const t=(0,i.mN)(e),s=t?.path.match(a)||t?.path.match(l);if(!s)return null;const[,n,o,u,h]=s,d=o.indexOf("/");return{title:p(-1!==d?o.slice(d+1):o),serverType:r[u.toLowerCase()],sublayer:null!=h&&""!==h?parseInt(h,10):null,url:{path:n}}}function c(e){const t=(0,i.mN)(e).path.match(u);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function p(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function f(e,t){const s=[];if(e){const t=d(e);null!=t&&t.title&&s.push(t.title)}if(t){const e=p(t);s.push(e)}if(2===s.length){if(s[0].toLowerCase().includes(s[1].toLowerCase()))return s[0];if(s[1].toLowerCase().includes(s[0].toLowerCase()))return s[1]}return s.join(" - ")}function _(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),s=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&s}function g(e,t){return e?(0,i.Qj)((0,i.Hu)(e,t)):e}function m(e){let{url:t}=e;if(!t)return{url:t};t=(0,i.Hu)(t,e.logger);const s=(0,i.mN)(t),n=d(s.path);let r;if(null!=n)null!=n.sublayer&&null==e.layer.layerId&&(r=n.sublayer),t=n.url.path;else if(e.nonStandardUrlAllowed){const e=c(s.path);null!=e&&(t=e.serviceUrl,r=e.sublayerId)}return{url:(0,i.Qj)(t),layerId:r}}function y(e,t,s,r,o){(0,n.w)(t,r,"url",o),r.url&&null!=e.layerId&&(r.url=(0,i.v_)(r.url,s,e.layerId.toString()))}function v(e){if(!e)return!1;const t=e.toLowerCase(),s=t.includes("/services/"),i=t.includes("/mapserver/wmsserver"),n=t.includes("/imageserver/wmsserver"),r=t.includes("/wmsserver");return s&&(i||n||r)}},72729:(e,t,s)=>{s.d(t,{im:()=>x,V5:()=>E}),s(80442);var i,n=s(43697),r=s(22974),o=s(5600),a=(s(75215),s(36030)),l=s(52011),u=s(96674);s(67676);let h=i=class extends u.wq{constructor(e){super(e),this.name=null,this.code=null}clone(){return new i({name:this.name,code:this.code})}};(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],h.prototype,"name",void 0),(0,n._)([(0,o.Cb)({type:[String,Number],json:{write:!0}})],h.prototype,"code",void 0),h=i=(0,n._)([(0,l.j)("esri.layers.support.CodedValue")],h);const d=new(s(35454).X)({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends u.wq{constructor(e){super(e),this.name=null,this.type=null}};(0,n._)([(0,o.Cb)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,n._)([(0,a.J)(d)],c.prototype,"type",void 0),c=(0,n._)([(0,l.j)("esri.layers.support.Domain")],c);const p=c;var f;let _=f=class extends p{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const s=String(e);this.codedValues.some((e=>(String(e.code)===s&&(t=e.name),!!t)))}return t}clone(){return new f({codedValues:(0,r.d9)(this.codedValues),name:this.name})}};(0,n._)([(0,o.Cb)({type:[h],json:{write:!0}})],_.prototype,"codedValues",void 0),(0,n._)([(0,a.J)({codedValue:"coded-value"})],_.prototype,"type",void 0),_=f=(0,n._)([(0,l.j)("esri.layers.support.CodedValueDomain")],_);const g=_;var m;s(92604),s(20102);let y=m=class extends p{constructor(e){super(e),this.type="inherited"}clone(){return new m}};(0,n._)([(0,a.J)({inherited:"inherited"})],y.prototype,"type",void 0),y=m=(0,n._)([(0,l.j)("esri.layers.support.InheritedDomain")],y);const v=y;var b;let I=b=class extends p{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new b({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,n._)([(0,o.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,s){t[s]=[this.minValue||0,e]}}}})],I.prototype,"maxValue",void 0),(0,n._)([(0,o.Cb)({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,s){t[s]=[e,this.maxValue||0]}}}})],I.prototype,"minValue",void 0),(0,n._)([(0,a.J)({range:"range"})],I.prototype,"type",void 0),I=b=(0,n._)([(0,l.j)("esri.layers.support.RangeDomain")],I);const C=I,E={key:"type",base:p,typeMap:{range:I,"coded-value":g,inherited:v}};function x(e){if(!e?.type)return null;switch(e.type){case"range":return C.fromJSON(e);case"codedValue":return g.fromJSON(e);case"inherited":return v.fromJSON(e)}return null}},99282:(e,t,s)=>{s.d(t,{a:()=>r});var i=s(67900),n=s(68441);const r={unknown:1,inches:(0,i.En)(1,"meters","inches"),feet:(0,i.En)(1,"meters","feet"),"us-feet":(0,i.En)(1,"meters","us-feet"),yards:(0,i.En)(1,"meters","yards"),miles:(0,i.En)(1,"meters","miles"),"nautical-miles":(0,i.En)(1,"meters","nautical-miles"),millimeters:(0,i.En)(1,"meters","millimeters"),centimeters:(0,i.En)(1,"meters","centimeters"),decimeters:(0,i.En)(1,"meters","decimeters"),meters:(0,i.En)(1,"meters","meters"),kilometers:(0,i.En)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.ty)(1,"meters",n.sv.radius)}},28694:(e,t,s)=>{s.d(t,{p:()=>n});var i=s(69285);function n(e,t,s){if(!s?.features||!s.hasZ)return;const n=(0,i.k)(s.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of s.features)n(e.geometry)}},86787:(e,t,s)=>{s.d(t,{Z:()=>b});var i,n=s(43697),r=s(35454),o=s(96674),a=s(70586),l=s(5600),u=(s(75215),s(67676),s(80442),s(71715)),h=s(52011),d=s(30556),c=s(35671);let p=i=class extends o.wq{constructor(e){super(e)}async collectRequiredFields(e,t){return(0,c.io)(e,t,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"expression",void 0),(0,n._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"title",void 0),p=i=(0,n._)([(0,h.j)("esri.layers.support.FeatureExpressionInfo")],p);const f=p;var _,g=s(12541);const m=(0,r.w)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new r.X({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=_=class extends o.wq{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,s,i){t[s]=e.write({},i),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new _({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,a._W)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,n._)([(0,l.Cb)({type:f,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,n._)([(0,u.r)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,n._)([(0,d.c)("featureExpressionInfo",{featureExpressionInfo:{type:f},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,n._)([(0,l.Cb)({type:m.apiValues,nonNullable:!0,json:{type:m.jsonValues,read:m.read,write:{writer:m.write,isRequired:!0}}})],v.prototype,"mode",null),(0,n._)([(0,l.Cb)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,n._)([(0,l.Cb)({type:g.f9,json:{type:String,read:y.read,write:y.write}})],v.prototype,"unit",null),v=_=(0,n._)([(0,h.j)("esri.layers.support.ElevationInfo")],v);const b=v},12541:(e,t,s)=>{s.d(t,{Z7:()=>n,f9:()=>r});var i=s(99282);function n(e){return 1/(i.a[e]||1)}const r=function(){const e=Object.keys(i.a);return e.sort(),e}()},65967:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ie});var i=s(43697),n=(s(66577),s(32448)),r=s(95330),o=s(17445),a=s(5600),l=(s(75215),s(67676)),u=(s(80442),s(52011)),h=s(19402),d=s(82971),c=s(28972),p=s(3489),f=s(11145),_=s(14165),g=s(86787),m=s(13867),y=s(30175),v=s(67900),b=s(12541);function I(e=!1,t){if(e){const{elevationInfo:e,alignPointsInFeatures:s}=t;return new E(e,s)}return new C}class C{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}}class E{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new m.z(1024),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return null==i||"absolute-height"!==i.mode||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(this._alignAbsoluteElevationCandidates(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t,s){const{offset:i,unit:n}=s;if(null==i)return;const r=(0,v._R)(t),o=i*((0,b.Z7)(n??"meters")/r);for(const t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o;continue;case"vertex":t.target.z+=o;continue}}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const t of e)(0,y.s1)(i,t.objectId,F).push(t);const[n,o,a]=this._prepareQuery(i,t),l=await this._alignPointsInFeatures(n,s);if((0,r.k_)(s),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(n,l,o);const{drapedObjectIds:u,failedObjectIds:h}=l,d=[];for(const t of e){const{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||d.push(t)}return d}_prepareQuery(e,t){const s=[],i=[];for(const[t,n]of e){const e=[];for(const s of n)this._addToQueriesOrCachedResult(t,s.target,e,i),"edge"===s.type&&(this._addToQueriesOrCachedResult(t,s.start,e,i),this._addToQueriesOrCachedResult(t,s.end,e,i));0!==e.length&&s.push({objectId:t,points:e})}return[{spatialReference:t,pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const n=w(e,t),r=this._alignmentsCache.get(n);null==r?s.push(t):i.push(new x(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},n){for(const e of n)e.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:n,points:a}of e.pointsInFeatures){if(i.has(n)){r+=a.length;continue}const e=!s.has(n);for(const s of a){const i=w(n,s),a=t[r++];s.z=a,e&&o.put(i,a,1)}}}}class x{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function w(e,{x:t,y:s,z:i,spatialReference:n}){return`${e}-${t}-${s}-${i??0}}-wkid:${n?.wkid}`}function F(){return[]}class S{filter(e,t){return t}notifyElevationSourceChange(){}}class T{filter(e,t){const{point:s,distance:i}=e,{z:n}=s;if(null==n)return t;if(0===t.length)return t;const r=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(i),o=this._updateCandidatesTo3D(t,s,r).filter(O);return o.sort(M),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":R(i,t,s);continue;case"vertex":N(i,t,s);continue}return e}}function O(e){return e.distance<=1}function B(e=!1){return e?new T:new S}function R(e,t,{x:s,y:i,z:n}){const{start:r,end:o,target:a}=e;e.draped||function(e,t,s,i){const n=i.x-s.x,r=i.y-s.y,o=i.z-s.z,a=n*n+r*r+o*o,l=(t.x-s.x)*n+(t.y-s.y)*r+o*(t.z-s.z),u=Math.min(1,Math.max(0,l/a)),h=s.x+n*u,d=s.y+r*u,c=s.z+o*u;e.x=h,e.y=d,e.z=c}(a,t,r,o);const l=(t.x-a.x)/s,u=(t.y-a.y)/i,h=(t.z-a.z)/n;e.distance=Math.sqrt(l*l+u*u+h*h)}function N(e,t,{x:s,y:i,z:n}){const{target:r}=e,o=(t.x-r.x)/s,a=(t.y-r.y)/i,l=(t.z-r.z)/n,u=Math.sqrt(o*o+a*a+l*l);e.distance=u}function M(e,t){return e.distance-t.distance}var A=s(22974),P=s(19153);function j(e=!1,t){return e?new z(t):new H}class H{async fetch(){return[]}notifySymbologyChange(){}}class z{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new m.z(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];const s=[],i=[],n=this._candidatesCache;for(const t of e){const e=k(t),r=n.get(e);if(r)for(const e of r)i.push((0,A.d9)(e));else s.push(t),n.put(e,[],1)}if(0===s.length)return i;const o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(s,t);if((0,r.k_)(t),o!==this._cacheVersion)return this.fetch(e,t);const u=[],{length:h}=a;for(let e=0;e<h;++e){const t=a[e],i=k(s[l[e]]),r=n.get(i);r.push(t),n.put(i,r,r.length),u.push((0,A.d9)(t))}return i.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function k(e){switch(e.type){case"vertex":{const{objectId:t,target:s}=e,i=`${t}-vertex-${s.x}-${s.y}-${s.z??0}`;return(0,P.hP)(i).toString()}case"edge":{const{objectId:t,start:s,end:i}=e,n=`${t}-edge-${s.x}-${s.y}-${s.z??0}-to-${i.x}-${i.y}-${i.z??0}`;return(0,P.hP)(n).toString()}default:return""}}var D=s(92036);let V=class extends D.Z{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(e,t){this._pending.push({promise:e,callback:t}),1===this._pending.length&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const e=this._pending[0];e.promise.then((t=>e.callback(t))).catch((()=>{})).then((()=>{this._pending.shift(),this._process()}))}};(0,i._)([(0,a.Cb)()],V.prototype,"updating",void 0),V=(0,i._)([(0,u.j)("esri.core.AsyncSequence")],V);var U,Z=s(66643),Y=s(50758),q=s(92604),X=s(75517),L=s(6570),G=s(24470),J=s(98732),$=s(66677),W=s(78760),Q=s(34599);class K{constructor(e,t){this.data=e,this.resolution=t,this.state={type:U.CREATED},this.alive=!0}process(e){switch(this.state.type){case U.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case U.FETCH_COUNT:break;case U.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case U.FETCH_FEATURES:break;case U.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case U.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case U.CREATED:case U.FETCH_COUNT:return 0;case U.FETCHED_COUNT:return this.state.featureCount;case U.FETCH_FEATURES:return this.state.previous.featureCount;case U.FETCHED_FEATURES:return this.state.features.length;case U.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case U.CREATED:return"created";case U.FETCH_COUNT:return"fetch-count";case U.FETCHED_COUNT:return"fetched-count";case U.FETCH_FEATURES:return"fetch-features";case U.FETCHED_FEATURES:return"fetched-features";case U.DONE:return"done"}}_gotoFetchCount(e,t){return{type:U.FETCH_COUNT,previous:e,task:(0,Z.vr)((async e=>{const s=await(0,Z.mt)(t.fetchCount(this,e));this.state.type===U.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,s.ok?s.value:1/0))}))}}_gotoFetchedCount(e,t){return{type:U.FETCHED_COUNT,featureCount:t,previous:e}}_gotoFetchFeatures(e,t){return{type:U.FETCH_FEATURES,previous:e,task:(0,Z.vr)((async s=>{const i=await(0,Z.mt)(t.fetchFeatures(this,e.featureCount,s));this.state.type===U.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,i.ok?i.value:[]))}))}}_gotoFetchedFeatures(e,t){return{type:U.FETCHED_FEATURES,previous:e,features:t}}_goToDone(e,t){return t.finish(this,e.features),{type:U.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:U.CREATED},e.type){case U.CREATED:case U.FETCHED_COUNT:case U.FETCHED_FEATURES:case U.DONE:break;case U.FETCH_COUNT:case U.FETCH_FEATURES:e.task.abort()}}intersects(e){return null==e||!this.data.extent||((0,G.oJ)(e,ee),(0,G.kK)(this.data.extent,ee))}}!function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"}(U||(U={}));const ee=(0,G.Ue)();let te=class extends D.Z{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=(0,X.G0)(e,this._mandatoryOutFields);(0,X.fS)(s,t)||(this._set("outFields",s),(0,X.ik)(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(null!=e&&null!=t&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new h.R,this._pendingEdits=new V,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add((()=>this._configuration),(()=>this.refresh())),this._updatingHandles.add((()=>this.tilesOfInterest),((e,t)=>{(0,l.fS)(e,t,(({id:e},{id:t})=>e===t))||this._process()}),o.Z_),this.addHandles((0,o.gx)((()=>!this.suspended),(()=>this._process())))}destroy(){this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach((e=>this._deletePendingTile(e))),this._process()}applyEdits(e){this._pendingEdits.push(e,(async e=>{if(0===e.addedFeatures.length&&0===e.updatedFeatures.length&&0===e.deletedFeatures.length)return;for(const[,e]of this._pendingTiles)e.reset();const t={...e,deletedFeatures:e.deletedFeatures.map((({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t)))};await this._updatingHandles.addPromise(this.store.processEdits(t,((e,t)=>this._queryFeaturesById(e,t)),this._pendingEditsAbortController.signal)),this._processPendingTiles()}))}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,$.M8)(this.url))return;const e=(0,Z.vr)((async e=>{try{const t=await(0,Q.Vr)(this.url,new _.Z({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=L.Z.fromJSON(t.data?.extent)}catch(e){(0,r.r9)(e),q.Z.getLogger(this).warn("Failed to fetch data extent",e)}}));this._updatingHandles.addPromise(e.promise.then((()=>this._process()))),this.addHandles((0,Y.kB)((()=>e.abort())))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map((e=>e.debugInfo)),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,e]of this._pendingTiles)e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(const{data:t,resolution:s}of e.missingTiles){const e=this._pendingTiles.get(t.id);e?(e.resolution=s,e.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,((e,t)=>this._verifyTileComplexity(e,t)),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const[,e]of this._pendingTiles)e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,s)=>this._fetchFeatures(e,t,s),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const[,t]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<ne}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;const s=this.tileSize*t;return e*(re/(s*s))<oe}_ensureFetchAllCounts(e){let t=!0;for(const[,s]of this._pendingTiles)s.state.type<U.FETCHED_COUNT&&this._updatingHandles.addPromise(s.process(e)),s.state.type<=U.FETCH_COUNT&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.data,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){const e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){const s=new K(e,t);return this._pendingTiles.set(e.id,s),s}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.data.id)}async _fetchCount(e,t){return this.store.fetchCount(e.data,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ie,signal:t})}async _fetchFeatures(e,t,s){let i=0;const n=[];let r=0,o=t;for(;;){const a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,i,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,s);l&&(i+=a.num),r+=u.length;for(const e of u)n.push(e);if(o=t-r,!l||!h||o<=0)return n}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){const t=this.globalIdField,s=this.objectIdField;if(null==t)throw new Error("Expected globalIdField to be defined");let i=null;if(this.store.featureStore.forEach((n=>{e===n.attributes[t]&&(i=n.objectId??n.attributes[s])})),null==i)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.qp)(this.url,e,new W.J({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.lM)(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await(0,Q.JT)(this.url,e,s,{query:this._configuration.customParameters,timeout:ie,signal:t});return(0,J.h_)(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=null!=e?.data?this.store.getAttributesForTile(e?.data?.id):null,i=(0,X.G0)((0,X.e5)(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new _.Z({returnZ:this.hasZ,returnM:!1,geometry:null!=this.tileInfo&&null!=e?(0,G.HH)(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return null!=s&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:n,tileMaxRecordCount:r,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?_.Z.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||n)&&r?r:o||se);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/u)),e.num=Math.min(s,e.maxRecordCountFactor*u)):e.num=Math.min(s,u),!0}};(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"url",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"objectIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"globalIdField",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"capabilities",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"sourceSpatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"spatialReference",void 0),(0,i._)([(0,a.Cb)({constructOnly:!0})],te.prototype,"store",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"_minimumVerticesPerFeature",null),(0,i._)([(0,a.Cb)()],te.prototype,"_mandatoryOutFields",null),(0,i._)([(0,a.Cb)()],te.prototype,"outFields",null),(0,i._)([(0,a.Cb)()],te.prototype,"suspended",void 0),(0,i._)([(0,a.Cb)()],te.prototype,"filter",null),(0,i._)([(0,a.Cb)()],te.prototype,"customParameters",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"_configuration",null),(0,i._)([(0,a.Cb)()],te.prototype,"tileInfo",null),(0,i._)([(0,a.Cb)()],te.prototype,"tileSize",null),(0,i._)([(0,a.Cb)()],te.prototype,"tilesOfInterest",void 0),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)({readOnly:!0})],te.prototype,"availability",void 0),(0,i._)([(0,a.Cb)()],te.prototype,"hasZ",null),te=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],te);const se=2e3,ie=6e5,ne=1e6,re=25,oe=1;var ae=s(43090),le=s(91303),ue=s(37549),he=s(43077);class de{constructor(){this._store=new Map,this._byteSize=0}set(e,t){this.delete(e),this._store.set(e,t),this._byteSize+=t.byteSize}delete(e){const t=this._store.get(e);return!!this._store.delete(e)&&(null!=t&&(this._byteSize-=t.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,t){for(const[s,i]of this._store){if(this._byteSize<=e)break;this.delete(s),t(i)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const t=this._store.get(e);t&&(this._store.delete(e),this._store.set(e,t))}}let ce=class extends D.Z{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*le.Y.MEGABYTES,this._tileBounds=new ue.H,this._tiles=new de,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,G.Ue)()}add(e,t){for(const e of t)this._referenceFeature(e.objectId);const s=this.featureStore.upsertMany(t),i=s.map((e=>new Set(Object.keys(e.attributes)))).reduce(((e,t)=>(0,X.jV)(e,t)),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map((e=>e.objectId))),function(e){return e.reduce(((e,t)=>e+function(e){return 32+function(e){if(null==e)return 0;const t=(0,ae.do)(e.lengths,4);return 32+(0,ae.do)(e.coords,8)+t}(e.geometry)+(0,ae.f2)(e.attributes)}(t)),0)}(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,(e=>this._removeTileStorage(e)))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const n=e.id;this._tiles.set(n,new pe(e,t,s,i)),this._tileBounds.set(n,e.extent),this._tileFeatureCounts.set(n,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const s of e.objectIds)this._unreferenceFeature(s)===ye.REMOVED&&t.push(s);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){const i=(await t(e,s)).features,{hasZ:n,hasM:r}=this.featureStore;for(const e of i){const t=(0,J.$)(this._tmpBoundingRect,e.geometry,n,r);null!=t&&this._tileBounds.forEachInBounds(t,(t=>{const s=this._tiles.get(t);this.featureStore.add(e);const i=e.objectId;s.objectIds.has(i)||(s.objectIds.add(i),this._referenceFeature(i),this._tileFeatureCounts.set(s.data.id,s.objectIds.size))}))}}process(e,t=(()=>!0),s){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,G.kK)((0,G.oJ)(this.extent,this._tmpBoundingRect),e.extent))return new _e(e);const i=this.getAttributesForTile(e.id);if((0,X.ik)(s,i))return new _e(e);const n=this._createTileTree(e,this.tileInfo);return this._simplify(n,t,null,0,1),this._collectMissingTiles(e,n,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map((({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0})))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const n=this._tileFeatureCounts.get(e.id);if(null!=n)return n;const r=await(0,Q.hH)(t,s,i);return this._tileFeatureCounts.set(e.id,r.data.count),r.data.count}_createTileTree(e,t){const s=new fe(e.level,e.row,e.col);return t.updateTileInfo(s,f.Z.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,(i=>{const n=this._tiles.get(i)?.data;n&&this._tilesAreRelated(e,n)&&this._populateChildren(s,n,t,this._tileFeatureCounts.get(n.id)||0)})),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level<t.level,i=s?e:t,n=s?t:e,r=1<<n.level-i.level;return Math.floor(n.row/r)===i.row&&Math.floor(n.col/r)===i.col}_populateChildren(e,t,s,i){const n=t.level-e.level-1;if(n<0)return void(e.isLeaf=!0);const r=t.row>>n,o=t.col>>n,a=e.row<<1,l=o-(e.col<<1)+(r-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,s,i);else{const n=new fe(e.level+1,r,o);s.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=n,this._populateChildren(n,t,s,i)}}_simplify(e,t,s,i,n){const r=n*n;if(e.isLeaf)return t(this.getFeatureCount(e),n)?0:(this._remove(e),null!=s&&(s.children[i]=null),r);const o=n/2,a=o*o;let l=0;for(let s=0;s<e.children.length;s++){const i=e.children[s];l+=null!=i?this._simplify(i,t,e,s,o):a}return 0===l?this._mergeChildren(e):1-l/r<me&&(this._purge(e),null!=s&&(s.children[i]=null),l=r),l}_mergeChildren(e){const t=new Set;let s,i=0;this._forEachLeaf(e,(e=>{const n=this._tiles.get(e.id);if(n){s=s?(0,X.jV)(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const e of n.objectIds)t.has(e)||(t.add(e),this._referenceFeature(e));this._remove(e)}})),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)null!=s&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){const s=e.children[t];this._purge(s),e.children[t]=null}}_collectMissingTiles(e,t,s,i){const n=new ge(s,e,this.extent);return this._collectMissingTilesRecurse(t,n,1,i),n.info}_collectMissingTilesRecurse(e,t,s,i){const n=this.getAttributesForTile(e.id),r=n&&!(0,X.ik)(i,n);if(r&&t.addMissing(e.level,e.row,e.col,s),e.isLeaf)return;if(!e.hasChildren)return void(r||t.addMissing(e.level,e.row,e.col,s));const o=s/2;for(let s=0;s<e.children.length;s++){const n=e.children[s];null==n?t.addMissing(e.level+1,(e.row<<1)+((2&s)>>1),(e.col<<1)+(1&s),o):this._collectMissingTilesRecurse(n,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?ye.ADDED:ye.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),ye.REMOVED):(t>0&&this._refCounts.set(e,t),ye.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map((e=>`${e.data.id}:[${Array.from(e.objectIds)}]`)),featureReferences:Array.from(this._refCounts.keys()).map((e=>`${e}:${this._refCounts.get(e)}`))}}};(0,i._)([(0,a.Cb)({constructOnly:!0})],ce.prototype,"featureStore",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"tileInfo",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"extent",void 0),(0,i._)([(0,a.Cb)()],ce.prototype,"maximumByteSize",void 0),ce=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],ce);class pe{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}}class fe{constructor(e,t,s){this.level=e,this.row=t,this.col=s,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class _e{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,G.SO)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class ge{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new _e(t),null!=s&&(this._extent=(0,G.oJ)(s))}addMissing(e,t,s,i){const n=new he.f(null,e,t,s);this._tileInfo.updateTileInfo(n,f.Z.ExtrapolateOptions.POWER_OF_TWO),null==n.extent||null!=this._extent&&!(0,G.kK)(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:i}),this.info.coveredArea-=(0,G.SO)(n.extent))}}const me=.18751;var ye;!function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"}(ye||(ye={}));var ve=s(33955);let be=class extends n.Z.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=(0,r.hh)(),this._elevationAligner=I(),this._elevationFilter=B(),this._symbologyCandidatesFetcher=j(),this._updatingHandles=new h.R,this._editsUpdatingHandles=new h.R,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return(0,r.k_)(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return(0,r.k_)(t),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:n}=e.serviceInfo,{hasZ:r}=e,a=d.Z.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new c.Z({...e.serviceInfo,hasZ:r,hasM:!1}),this._queryEngine=new p.q({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:n,hasZ:r,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new te({store:new ce({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:d.Z.fromJSON(e.serviceInfo.spatialReference)});const l="3d"===e.configuration.viewType;return this._elevationAligner=I(l,{elevationInfo:null!=e.elevationInfo?g.Z.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=B(l),this.addHandles([(0,o.YP)((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),o.Z_),(0,o.YP)((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),Ce}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.suspended=e,Ce}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.outFields=new Set(e??[]),Ce}async fetchCandidates(e,t){await this._whenSetup.promise,(0,r.k_)(t);const s=function(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:n,timeExtent:r,objectIds:o}=e.filter,a={geometry:e.filter.geometry?(0,ve.im)(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:r,objectIds:o,where:n??"1=1"};return{...e,query:a}}(e),i=t?.signal,n=await this._queryEngine.executeQueryForSnapping(s,i);(0,r.k_)(i);const o=await this._elevationAligner.alignCandidates(n.candidates,e.point.spatialReference??d.Z.WGS84,i);(0,r.k_)(i);const a=await this._symbologyCandidatesFetcher.fetch(o,i);(0,r.k_)(i);const l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(s,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?f.Z.fromJSON(e.tileInfo):null,Ce}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),this._featureFetcher.refresh(),Ce}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t),await(0,o.N1)((()=>!this.updatingExcludingEdits),t),(0,r.k_)(t),Ce}async getDebugInfo(e,t){return(0,r.k_)(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),(0,r.k_)(t);const s=(0,r.hh)();return this._pendingApplyEdits.set(e.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),Ce}async endApplyEdits(e,t){const s=this._pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),(0,r.k_)(t),Ce}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),Ce}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),Ce}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=j(e,this._getSymbologyCandidates),Ce}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?_.Z.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,i._)([(0,a.Cb)({readOnly:!0})],be.prototype,"updating",null),(0,i._)([(0,a.Cb)({readOnly:!0})],be.prototype,"updatingExcludingEdits",null),(0,i._)([(0,a.Cb)()],be.prototype,"_isInitializing",void 0),be=(0,i._)([(0,u.j)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],be);const Ie=be,Ce={result:{}}}}]);