@arcgis/core 4.34.0-next.32 → 4.34.0-next.34

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 (88) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{c6edf028dd04d47d7580.js → 087ae1e3e767f0e678e5.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{341507901f3858559c82.js → 125fdea50620d4db2678.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{971b16677b66c16fb6b9.js → 20aed6e1d9b6bf06a398.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{fb71e533995c54cd806f.js → 319fe6a02ec630a827ea.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{1aa6719be3afbdc7c880.js → 3cd1ab26396052f17832.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{359c282fd67148fda5fa.js → 3d5954478864a975e65e.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{2fdf457786d2d5d7414f.js → 3eb792863a789b97ec58.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{89999baefa341bd3329c.js → 4193691ca076948f4f90.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{057df92b981c9b311d68.js → 43fba9d6be5971ec20a9.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{74f3bc6c6b82de49d6ee.js → 4ac6bf9ff1cfbde87c7b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{0b3a200b97d790d08248.js → 4b9003ddfe61dc3729f4.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{5192f38682f1f9be7da0.js → 549e073fe276363a9896.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{50b0d96e1a5ccffeb803.js → 64fab4e1e28c06c83403.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{d3cb21cdc5b9483dd1f4.js → 69ae235423f0b1bdfcb4.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{3323646096474740fed5.js → 6c72e2c09ed62cb2fd79.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{63cb3dcd359e96733b1b.js → 6ce2f86b9b1d2f2b8675.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{0fc620d6d0c4ac282d72.js → 700c641347853b1034d9.js} +1 -1
  19. package/assets/esri/core/workers/chunks/752eabfbed7b8b65cf3f.js +1 -0
  20. package/assets/esri/core/workers/chunks/{3a0da512562ba492609d.js → 827bebb4bcdde23adc91.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{9152d62c55d3396763bd.js → 8be81e1530b952c97936.js} +1 -1
  22. package/assets/esri/core/workers/chunks/90a0c1c5c851cc9b6d6d.js +1 -0
  23. package/assets/esri/core/workers/chunks/9a54c96b48e94d816881.js +1 -0
  24. package/assets/esri/core/workers/chunks/{c18167a0790241f80bf7.js → a6767d75e718f2e1e714.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{b1ef40ef898a8c7f43a2.js → acb95ae6203f708d71b4.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{22f38cad0213f2112394.js → b1982490762972ae023d.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{bc0f5477b4491ab48b3a.js → b28855db6a30d4d4f348.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{6ccd6171d3c572883034.js → b877142a275188a16e17.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{1c3578d5e956a4587973.js → c30adbead0ba4722acf9.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{0260b33daf48fc207880.js → c9b11c7170c99f9e0e93.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{58393ab52d0b8f718241.js → d3fd11da3a823e148957.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{41d36b87e3dfc01be38d.js → d7b3e81cc313fd0a33b0.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{1e20e43d1dc5273708c7.js → e1472dbf0795d737d6f8.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{300a5257969d3835ceeb.js → f19426eb53d8430ded51.js} +1 -1
  35. package/assets/esri/core/workers/chunks/f3358b19af0f03f16543.js +1 -0
  36. package/assets/esri/core/workers/chunks/{1b5923dfd70d464dfb25.js → f4c38a9c01c29b5a6244.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{c854c3bb4440fd942c12.js → f6c1854f36b029fa6c37.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{039979cbf35a241ed0a4.js → fdc8300b6374ef2b8b3e.js} +1 -1
  39. package/chunks/Distance2DCalculator-CXhBP-8I.js +1 -1
  40. package/chunks/OperatorCrosses.js +1 -1
  41. package/chunks/OperatorGeodesicBuffer.js +1 -1
  42. package/chunks/OperatorIntersects.js +1 -1
  43. package/chunks/OperatorOverlaps.js +1 -1
  44. package/chunks/OperatorProximity.js +1 -1
  45. package/chunks/OperatorShapePreservingLength.js +1 -1
  46. package/chunks/OperatorShapePreservingProject.js +1 -1
  47. package/chunks/OperatorTouches.js +1 -1
  48. package/chunks/OperatorWithin.js +1 -1
  49. package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
  50. package/chunks/UnitFactory.js +1 -1
  51. package/chunks/equalsOperator.js +1 -1
  52. package/config.js +1 -1
  53. package/core/Clonable.js +1 -1
  54. package/geometry/operators/gx/operatorDifference.js +1 -1
  55. package/geometry/operators/gx/operatorIntersection.js +1 -1
  56. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  57. package/kernel.js +1 -1
  58. package/package.json +3 -3
  59. package/support/revision.js +1 -1
  60. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  61. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  62. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  63. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  64. package/views/2d/layers/TileLayerView2D.js +1 -1
  65. package/views/3d/analysis/Slice/SliceController.js +1 -1
  66. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  67. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  68. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  69. package/views/3d/layers/FlowSubView3D.js +1 -1
  70. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  71. package/views/3d/layers/GraphicsView3D.js +1 -1
  72. package/views/3d/layers/I3SMeshView3D.js +1 -1
  73. package/views/3d/layers/MediaLayerView3D.js +1 -1
  74. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  75. package/views/3d/layers/RouteLayerView3D.js +1 -1
  76. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  77. package/views/3d/support/flow/geometryUtils.js +1 -1
  78. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  79. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  80. package/views/support/Scheduler.js +1 -1
  81. package/views/support/highlightOptionsUtils.js +1 -1
  82. package/views/webgl/FramebufferObject.js +1 -1
  83. package/views/webgl/RenderbufferDescriptor.js +1 -1
  84. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  85. package/assets/esri/core/workers/chunks/0fe32bdf2055bcd1e928.js +0 -1
  86. package/assets/esri/core/workers/chunks/23eae849ee0ca7b3fd81.js +0 -1
  87. package/assets/esri/core/workers/chunks/99e3f7b3ea0bfe9b8d34.js +0 -1
  88. package/assets/esri/core/workers/chunks/c50c2f014e8567870686.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5804,6742],{4146:(e,t,r)=>{r.d(t,{A:()=>w});var i=r(31635),s=r(78888),n=r(49186),o=r(65529),l=r(4902),a=r(92474),u=r(53966),d=r(74887),p=r(84952),c=r(10107),h=(r(44208),r(87811),r(40608)),y=r(5443),g=r(16930),f=r(92602),m=r(64272);let v=0,w=class extends(o.A.EventedMixin(l.A.IdentifiableMixin(a.A))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.A(-180,-90,180,90,g.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+v++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(7982).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await r.e(5613).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",s=r?.portal?.url||f.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,d.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get effectiveVisible(){let e=this.visible;const t=this.parent;return e&&t&&"effectiveVisible"in t&&(e&&=t.effectiveVisible),e}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,p.An)(this.url)}createLayerView(e,t){return Promise.reject(new n.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new n.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,c.MZ)({type:String})],w.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],w.prototype,"effectiveVisible",null),(0,i.Cg)([(0,c.MZ)({type:y.A})],w.prototype,"fullExtent",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],w.prototype,"hasAttributionData",null),(0,i.Cg)([(0,c.MZ)({type:String,clonable:!1})],w.prototype,"id",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:["show","hide","hide-children"]})],w.prototype,"listMode",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],w.prototype,"opacity",void 0),(0,i.Cg)([(0,c.MZ)({clonable:!1})],w.prototype,"parent",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,i.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],w.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean})],w.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean})],w.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,c.MZ)({type:g.A})],w.prototype,"spatialReference",void 0),(0,i.Cg)([(0,c.MZ)({type:String})],w.prototype,"title",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],w.prototype,"type",void 0),(0,i.Cg)([(0,c.MZ)()],w.prototype,"url",void 0),(0,i.Cg)([(0,c.MZ)({type:m.T})],w.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"visible",void 0),w=(0,i.Cg)([(0,h.$)("esri.layers.Layer")],w)},8303:(e,t,r)=>{r.d(t,{A:()=>S});var i=r(31635),s=r(92602),n=r(70333),o=r(78888),l=r(60999),a=r(49186),u=r(53966),d=r(97768),p=r(74887),c=r(84952),h=r(10107),y=(r(44208),r(87811),r(36005)),g=r(40608),f=r(43937),m=r(77548),v=r(20655),w=r(80812),b=r(41318),C=r(10407);const S=e=>{const t=e;let S=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,d.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new w.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,p.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!n.id?.findCredential(this.url),s=e===r.id;if(s&&r.portal.user)return this._getUserPrivileges(r,i);let o,l;if(s)o=r.portal.url;else try{o=await(0,m.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!o||!(0,c.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;l=await(n.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,u=!1,d=!1;if(!l)return{features:{edit:a,fullEdit:u},content:{updateItem:d}};try{if(s?await r.reload():(r=new w.default({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:d}}}_getUserPrivileges(e,t){const r=(0,C.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const r=A.credential===t?A.user:await this._fetchEditingUser(e);return A.credential=t,A.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=n.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=v.A.getDefault();if(s&&s.loaded&&(0,c.S8)(s.restUrl)===(0,c.S8)(i))return s.user;const a=`${i}/community/self`,u=null!=e?e.signal:null,d=await(0,l.Ke)((0,o.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return d.ok?b.A.fromJSON(d.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&i&&!(0,c.ut)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i.Cg)([(0,h.MZ)({type:w.default})],S.prototype,"portalItem",null),(0,i.Cg)([(0,y.w)("web-document","portalItem",["itemId"])],S.prototype,"readPortalItem",null),(0,i.Cg)([(0,f.K)("web-document","portalItem",{itemId:{type:String}})],S.prototype,"writePortalItem",null),(0,i.Cg)([(0,h.MZ)({clonable:!1})],S.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],S.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],S.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],S.prototype,"userHasUpdateItemPrivileges",void 0),S=(0,i.Cg)([(0,g.$)("esri.layers.mixins.PortalLayer")],S),S},A={credential:null,user:null}},13069:(e,t,r)=>{r.d(t,{AG:()=>l,lk:()=>s,vD:()=>o,yS:()=>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().toUpperCase()}}`}function o(){return`{${s()}}`}function l(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},15804:(e,t,r)=>{r.d(t,{addOrUpdateResources:()=>l,bg:()=>c,cL:()=>p,fetchResources:()=>o,removeAllResources:()=>u,removeResource:()=>a});var i=r(78888),s=r(49186),n=r(84952);async function o(e,t={},r){await e.load(r);const i=(0,n.fj)(e.itemUrl,"resources"),{start:s=1,num:o=10,sortOrder:l="asc",sortField:a="resource"}=t,u={query:{start:s,num:o,sortOrder:l,sortField:a,token:e.apiKey},signal:r?.signal},d=await e.portal.request(i,u);return{total:d.total,nextStart:d.nextStart,resources:d.resources.map(({created:t,size:r,resource:i})=>({created:new Date(t),size:r,resource:e.resourceFromPath(i)}))}}async function l(e,t,r,i){const o=new Map;for(const{resource:e,content:i,compress:n,access:l}of t){if(!e.hasPath())throw new s.A(`portal-item-resource-${r}:invalid-path`,"Resource does not have a valid path");const[t,a]=d(e.path),u=`${t}/${n??""}/${l??""}`;o.has(u)||o.set(u,{prefix:t,compress:n,access:l,files:[]}),o.get(u).files.push({fileName:a,content:i})}await e.load(i);const l=(0,n.fj)(e.userItemUrl,"add"===r?"addResources":"updateResources");for(const{prefix:t,compress:r,access:s,files:n}of o.values()){const o=25;for(let a=0;a<n.length;a+=o){const u=n.slice(a,a+o),d=new FormData;t&&"."!==t&&d.append("resourcesPrefix",t),r&&d.append("compress","true"),s&&d.append("access",s);let p=0;for(const{fileName:e,content:t}of u)d.append("file"+ ++p,t,e);d.append("f","json"),await e.portal.request(l,{method:"post",body:d,signal:i?.signal})}}}async function a(e,t,r){if(!t.hasPath())throw new s.A("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const i=(0,n.fj)(e.userItemUrl,"removeResources");await e.portal.request(i,{method:"post",query:{resource:t.path},signal:r?.signal}),t.portalItem=null}async function u(e,t){await e.load(t);const r=(0,n.fj)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function d(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}async function p(e){return"blob"===e.type?e.blob:"json"===e.type?new Blob([e.jsonString],{type:"application/json"}):(await(0,i.A)(e.url,{responseType:"blob"})).data}function c(e,t){if(!e.hasPath())return null;const[r,,i]=function(e){const[t,r]=function(e){const t=(0,n.Zo)(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[i,s]=d(t);return[i,s,r]}(e.path);return e.portalItem.resourceFromPath((0,n.fj)(r,t+i))}},17036:(e,t,r)=>{r.d(t,{p:()=>a});var i=r(44208),s=r(53966),n=r(20437),o=r(95466),l=r(30524);function a(){return{fields:{type:[n.A],value:null,set:function(e){if(e&&(0,i.A)("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.A.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.A.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.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,l.DB)(this.fieldsIndex,e)}}}}},18768:(e,t,r)=>{r.d(t,{b:()=>a});var i=r(31635),s=r(53966),n=r(10107),o=(r(44208),r(87811),r(40608)),l=r(60694);const a=e=>{const t=e;let r=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Jf)(e,s.A.getLogger(this)))}};return(0,i.Cg)([(0,n.MZ)()],r.prototype,"title",null),(0,i.Cg)([(0,n.MZ)({type:String})],r.prototype,"url",null),r=(0,i.Cg)([(0,o.$)("esri.layers.mixins.ArcGISService")],r),r}},20061:(e,t,r)=>{r.d(t,{A:()=>y});var i,s=r(31635),n=r(69540),o=r(66552),l=r(25482),a=r(10107),u=r(56507),d=(r(44208),r(87811),r(93223)),p=r(40608);const c=(0,o.O)()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let h=i=class extends(n.A.ClonableMixin(l.A)){static from(e){return(0,u.PZ)(i,e)}constructor(e){super(e),this.title=null,this.order=null}};(0,s.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"title",void 0),(0,s.Cg)([(0,d.e)(c)],h.prototype,"order",void 0),h=i=(0,s.Cg)([(0,p.$)("esri.renderers.support.RendererLegendOptions")],h);const y=h},24212:(e,t,r)=>{function i(e,t){return function(e,t){return t?.mode?t.mode:function(e){return e?a:u}(e).mode}(null==e||(e.hasZ??!1),t)}function s(e,t,r){return r&&r.mode!==t?`${e} only support ${t} elevation mode`:null}function n(e,t,r){return r?.mode===t?`${e} do not support ${t} elevation mode`:null}function o(e,t){return null!=t?.featureExpressionInfo&&"0"!==t.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function l(e,t){t&&e.warn(".elevationInfo=",t)}r.d(t,{$7:()=>n,B:()=>s,XF:()=>l,tW:()=>o,w7:()=>i}),r(83047),r(16271);const a={mode:"absolute-height",offset:0},u={mode:"on-the-ground",offset:null}},25036:(e,t,r)=>{r.d(t,{j:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=e=>{const t=e;let r=class extends t{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.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"minScale",void 0),(0,i.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"maxScale",void 0),(0,i.Cg)([(0,s.MZ)({readOnly:!0})],r.prototype,"effectiveScaleRange",null),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.ScaleRangeLayer")],r),r}},26121:(e,t,r)=>{r.d(t,{ci:()=>o,dL:()=>s});var i=r(49186);async function s(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}r(77548);const n=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function o(e,t,r){let s=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new i.A(e,t,r));if(e.blockedRelativeUrls&&(s=s.concat(e.blockedRelativeUrls.map(e=>new i.A("url:unsupported",`Relative url '${e}' is not supported`)))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:i}=r;e&&(s=s.filter(({name:e})=>!(n.has(e)||t.includes(e)))),i&&(s=s.filter(e=>"web-document-write:property-required"!==e.name))}if(s.length>0)throw new i.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:s})}},30291:(e,t,r)=>{r.d(t,{tn:()=>u});var i=r(13874),s=r(30524),n=r(89893),o=(r(84424),r(80737),r(96808),r(66159)),l=(r(67336),r(92094),r(23721),r(47582),r(41227)),a=r(68780);function u({displayField:e,editFieldsInfo:t,fields:r,objectIdField:a,title:u},h){if(!r)return null;const g=function(e,t){const r=t?.visibleFieldNames;return function({fields:e,ignoreFieldTypes:t,sortDisabled:r}){const i=e;return t&&(e=e.filter(e=>!t.includes(e.type))),e===i&&(e=e.slice()),!0!==r&&e.sort(p),e}({fields:e.fields??[],ignoreFieldTypes:t?.ignoreFieldTypes||y,sortDisabled:t?.sortDisabled}).map(t=>new l.A({fieldName:t.name,isEditable:(0,s.R$)(t,e),label:t.alias,format:c(t),visible:d(t,{...e,visibleFieldNames:r})}))}({editFieldsInfo:t,fields:r,objectIdField:a},h);if(!g.length)return null;const f=function(e){const t=(0,s.mB)(e),{titleBase:r}=e;return t?`${r}: {${t.trim()}}`:r??""}({titleBase:u,fields:r,displayField:e}),m=[new o.A,new n.A];return new i.A({title:f,content:m,fieldInfos:g})}const d=(e,t)=>t.visibleFieldNames?t.visibleFieldNames.has(e.name):(0,s.Bz)(e,t);function p(e,t){return"oid"===e.type?-1:"oid"===t.type?1:h(e)?-1:h(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function c(e){switch(e.type){case"small-integer":case"integer":case"single":return new a.A({digitSeparator:!0,places:0});case"double":return new a.A({digitSeparator:!0,places:2});case"string":return(0,s.JL)(e.name)?new a.A({digitSeparator:!0,places:0}):void 0;default:return}}function h(e){if("name"===(e.name&&e.name.toLowerCase()))return!0;const t=e.alias?.toLowerCase();return"name"===t}const y=["geometry","blob","raster","guid","xml"]},46130:(e,t,r)=>{r.d(t,{v:()=>s});var i=r(76553);function s(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,i.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},48425:(e,t,r)=>{r.d(t,{A:()=>m});var i,s=r(31635),n=r(4718),o=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),u=r(51857),d=r(20061),p=r(68197),c=r(25482),h=r(56507);let y=i=class extends c.A{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new i({description:this.description,label:this.label,values:(0,n.o8)(this.values),color:(0,n.o8)(this.color)})}};(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"description",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"label",void 0),(0,s.Cg)([(0,o.MZ)({type:[String],json:{write:{isRequired:!0}}})],y.prototype,"values",void 0),(0,s.Cg)([(0,o.MZ)({type:p.A,json:{type:[h.jz],write:{isRequired:!0}}})],y.prototype,"color",void 0),y=i=(0,s.Cg)([(0,a.$)("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],y);const g=y;var f;let m=f=class extends u.A{constructor(e){super(e),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new f({...this.cloneProperties(),field:(0,n.o8)(this.field),fieldTransformType:(0,n.o8)(this.fieldTransformType),colorUniqueValueInfos:(0,n.o8)(this.colorUniqueValueInfos),legendOptions:(0,n.o8)(this.legendOptions)})}};(0,s.Cg)([(0,l.e)({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],m.prototype,"type",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:{isRequired:!0}},type:String})],m.prototype,"field",void 0),(0,s.Cg)([(0,o.MZ)({type:u.A.fieldTransformTypeKebabDict.apiValues,json:{type:u.A.fieldTransformTypeKebabDict.jsonValues,read:u.A.fieldTransformTypeKebabDict.read,write:u.A.fieldTransformTypeKebabDict.write}})],m.prototype,"fieldTransformType",void 0),(0,s.Cg)([(0,o.MZ)({type:[g],json:{write:{isRequired:!0}}})],m.prototype,"colorUniqueValueInfos",void 0),(0,s.Cg)([(0,o.MZ)({type:d.A,json:{write:!0}})],m.prototype,"legendOptions",void 0),m=f=(0,s.Cg)([(0,a.$)("esri.renderers.PointCloudUniqueValueRenderer")],m)},51857:(e,t,r)=>{r.d(t,{A:()=>A});var i,s=r(31635),n=r(66552),o=r(25482),l=r(4718),a=r(10107),u=(r(44208),r(53966),r(40608));r(87811);let d=i=class extends o.A{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new i({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};(0,s.Cg)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],d.prototype,"field",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],d.prototype,"minValue",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],d.prototype,"maxValue",void 0),d=i=(0,s.Cg)([(0,u.$)("esri.renderers.support.pointCloud.ColorModulation")],d);const p=d,c=new n.J({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let h=class extends o.A{};(0,s.Cg)([(0,a.MZ)({type:c.apiValues,readOnly:!0,nonNullable:!0,json:{type:c.jsonValues,read:!1,write:{writer:c.write,isRequired:!0}}})],h.prototype,"type",void 0),h=(0,s.Cg)([(0,u.$)("esri.renderers.support.pointCloud.PointSizeAlgorithm")],h);const y=h;var g,f=r(93223);let m=g=class extends y{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};(0,s.Cg)([(0,f.e)({pointCloudFixedSizeAlgorithm:"fixed-size"})],m.prototype,"type",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],m.prototype,"size",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"useRealWorldSymbolSizes",void 0),m=g=(0,s.Cg)([(0,u.$)("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],m);const v=m;var w;let b=w=class extends y{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new w({scaleFactor:this.scaleFactor})}};(0,s.Cg)([(0,f.e)({pointCloudSplatAlgorithm:"splat"})],b.prototype,"type",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,value:1,nonNullable:!0,json:{write:{isRequired:!0}}})],b.prototype,"scaleFactor",void 0),b=w=(0,s.Cg)([(0,u.$)("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],b);const C={key:"type",base:y,typeMap:{"fixed-size":v,splat:b}},S=(0,n.O)()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let A=class extends o.A{constructor(e){super(e),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:(0,l.o8)(this.pointSizeAlgorithm),colorModulation:(0,l.o8)(this.colorModulation),pointsPerInch:(0,l.o8)(this.pointsPerInch)}}};(0,s.Cg)([(0,a.MZ)({type:S.apiValues,readOnly:!0,nonNullable:!0,json:{type:S.jsonValues,read:!1,write:{writer:S.write,isRequired:!0}}})],A.prototype,"type",void 0),(0,s.Cg)([(0,a.MZ)({types:C,json:{write:!0}})],A.prototype,"pointSizeAlgorithm",void 0),(0,s.Cg)([(0,a.MZ)({type:p,json:{write:!0}})],A.prototype,"colorModulation",void 0),(0,s.Cg)([(0,a.MZ)({json:{write:!0},nonNullable:!0,type:Number})],A.prototype,"pointsPerInch",void 0),A=(0,s.Cg)([(0,u.$)("esri.renderers.PointCloudRenderer")],A),(A||(A={})).fieldTransformTypeKebabDict=new n.J({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})},52136:(e,t,r)=>{r.d(t,{p:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=e=>{const t=e;let r=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i.Cg)([(0,s.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.APIKeyMixin")],r),r}},54239:(e,t,r)=>{r.d(t,{A:()=>m});var i,s=r(31635),n=r(4576),o=r(66552),l=r(25482),a=r(83047),u=r(67076),d=r(10107),p=(r(44208),r(53966),r(36005)),c=r(40608),h=r(43937);const y=(0,o.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),g=y.jsonValues.slice();(0,n.Xy)(g,"orthometric");const f=(0,o.O)()({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 m=i=class extends l.A{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return y.write(e,t,r)}readHeightModel(e,t,r){return y.read(e)||(r?.messages&&r.messages.push(function(e,t){return new u.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return f.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,a.LA)(e)||f.read(e)||(r?.messages&&r.messages.push(v(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,a.k1)(t);return new i({heightModel:e.heightModel,heightUnit:r??void 0,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 v(e,t){return new u.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s.Cg)([(0,d.MZ)({type:y.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g,default:"ellipsoidal",write:{isRequired:!0}}}}})],m.prototype,"heightModel",void 0),(0,s.Cg)([(0,h.K)("web-scene","heightModel")],m.prototype,"writeHeightModel",null),(0,s.Cg)([(0,p.w)(["web-scene","service"],"heightModel")],m.prototype,"readHeightModel",null),(0,s.Cg)([(0,d.MZ)({type:f.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:f.jsonValues,write:{writer:f.write,isRequired:!0}}}}})],m.prototype,"heightUnit",void 0),(0,s.Cg)([(0,p.w)("web-scene","heightUnit")],m.prototype,"readHeightUnit",null),(0,s.Cg)([(0,p.w)("service","heightUnit")],m.prototype,"readHeightUnitService",null),(0,s.Cg)([(0,d.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],m.prototype,"vertCRS",void 0),(0,s.Cg)([(0,p.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],m.prototype,"readVertCRS",null),m=i=(0,s.Cg)([(0,c.$)("esri.geometry.HeightModelInfo")],m)},58947:(e,t,r)=>{r.d(t,{w:()=>M});var i=r(31635),s=r(78888),n=r(49186),o=r(53966),l=r(74887),a=r(10107),u=(r(44208),r(87811),r(36005)),d=r(40608),p=r(46130),c=r(5443),h=r(54239),y=r(16930),g=r(60694),f=r(10873),m=r(83898),v=r(73179);var w=r(20655),b=r(80812),C=r(88788),S=r(91682),A=r(26121);const M=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=(0,l.sg)(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return x(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=null==e.spatialReference?{...e,spatialReference:x(t)}:e;return c.A.fromJSON(i,r)}const i=t.store,s=x(t);return null==s||null==i?.extent||!Array.isArray(i.extent)||i.extent.some(e=>e<I)?null:new c.A({xmin:i.extent[0],ymin:i.extent[1],xmax:i.extent[2],ymax:i.extent[3],spatialReference:s})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,i=null!=r.version?r.version.toString():"";return this.parseVersionString(i)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?(0,g.yG)(this.url,t.name):t.name;let i=t.name;if(!i&&this.url){const e=(0,g.qg)(this.url);null!=e&&(i=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(i=r+" - "+i),(0,g.cr)(i)}get parsedUrl(){return(0,v.h)(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,m.F)(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,o.A.getLogger(this),t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,r=e.rootPage?.nodes?.[t];if(null==r?.obb?.center||null==r.obb.halfSize)throw new n.A("sceneservice:invalid-node-page","Invalid node page.");if(r.obb.center[0]<I||null==this.fullExtent||this.fullExtent.hasZ)return;const i=r.obb.halfSize,s=r.obb.center[2],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);this.fullExtent.zmin=s-o,this.fullExtent.zmax=s+o}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<I)return;const r=t[2],i=t[3],{fullExtent:s}=this;s&&(s.zmin=r-i,s.zmax=r+i)}}async _fetchService(e){if(null==this.url)throw new n.A("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,s.A)(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,s.A)(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});t.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const i=t.data;this.read(i,this._getServiceContext()),this.validateLayer(i)}async _fetchVoxelServiceLayer(e){const t=(await(0,s.A)(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const r={...O,...t};let i=b.default.from(e);if(!i)throw new n.A("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");i.id&&(i=i.clone(),i.id=null);const s=i.portal||w.A.getDefault();await this._ensureLoadBeforeSave(),i.type=R,i.portal=s;const o=(0,C.m)(i,"portal-item",!0),l={layers:[this.write({},o)]};return await Promise.all(o.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(l,o,r),this.url&&(i.url=this.url),i.title||(i.title=this.title),T(i,r,1),await s.signIn(),await s.user.addItem({item:i,folder:r?.folder,data:l}),await(0,S.r)(this.resourceReferences,o),this.portalItem=i,(0,p.v)(o),o.portalItem=i,i}async _save(e){const t={...O,...e};if(!this.portalItem)throw new n.A("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==R)throw new n.A("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${R}"`);await this._ensureLoadBeforeSave();const r=(0,C.m)(this.portalItem,"portal-item",!0),i={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,r,t),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),T(this.portalItem,t,0),await(0,S.S)(this.portalItem,i,this.resourceReferences,r),(0,p.v)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,r){const i=r?.validationOptions;(0,A.ci)(t,{errorName:"sceneservice:save"},{ignoreUnsupported:i?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const s=i?.enabled,l=null;if(s&&l){const t=(await l()).validate(e,r.portalItemLayerType);if(!t.length)return;const s=`Layer item did not validate:\n${t.join("\n")}`;if(o.A.getLogger(this).error(`_validateAgainstJSONSchema(): ${s}`),"throw"===i.failPolicy){const e=t.map(e=>new n.A("sceneservice:schema-validation",e));throw new n.A("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return(0,i.Cg)([(0,a.MZ)(f.id)],r.prototype,"id",void 0),(0,i.Cg)([(0,a.MZ)({type:y.A})],r.prototype,"spatialReference",void 0),(0,i.Cg)([(0,u.w)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readSpatialReference",null),(0,i.Cg)([(0,a.MZ)({type:c.A})],r.prototype,"fullExtent",void 0),(0,i.Cg)([(0,u.w)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readFullExtent",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0,type:h.A})],r.prototype,"heightModelInfo",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],r.prototype,"minScale",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],r.prototype,"maxScale",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],r.prototype,"version",void 0),(0,i.Cg)([(0,u.w)("version",["store.version"])],r.prototype,"readVersion",null),(0,i.Cg)([(0,a.MZ)({type:String,json:{read:{source:"copyrightText"}}})],r.prototype,"copyright",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{read:!1}})],r.prototype,"sublayerTitleMode",void 0),(0,i.Cg)([(0,a.MZ)({type:String})],r.prototype,"title",void 0),(0,i.Cg)([(0,u.w)("portal-item","title")],r.prototype,"readTitlePortalItem",null),(0,i.Cg)([(0,u.w)("service","title",["name"])],r.prototype,"readTitleService",null),(0,i.Cg)([(0,a.MZ)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],r.prototype,"layerId",void 0),(0,i.Cg)([(0,a.MZ)((0,v.b)({separator:"layers"}))],r.prototype,"url",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],r.prototype,"parsedUrl",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],r.prototype,"store",void 0),(0,i.Cg)([(0,a.MZ)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],r.prototype,"rootNode",void 0),r=(0,i.Cg)([(0,d.$)("esri.layers.mixins.SceneService")],r),r},I=-1e38;function x(e){if(null!=e.spatialReference)return y.A.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,i=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=i?new y.A(i):null}function T(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const i=t.getTypeKeywords();for(const t of i)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const R="Scene Service",O={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}}},63531:(e,t,r)=>{r.d(t,{A:()=>m});var i,s=r(31635),n=r(4718),o=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),u=r(51857),d=r(20061),p=r(68197),c=r(25482),h=r(56507);let y=i=class extends c.A{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new i({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:(0,n.o8)(this.color)})}};(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"description",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"label",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue",isRequired:!0}}})],y.prototype,"minValue",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue",isRequired:!0}}})],y.prototype,"maxValue",void 0),(0,s.Cg)([(0,o.MZ)({type:p.A,json:{type:[h.jz],write:{isRequired:!0}}})],y.prototype,"color",void 0),y=i=(0,s.Cg)([(0,a.$)("esri.renderers.support.pointCloud.ColorClassBreakInfo")],y);const g=y;var f;let m=f=class extends u.A{constructor(e){super(e),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new f({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:(0,n.o8)(this.colorClassBreakInfos),legendOptions:(0,n.o8)(this.legendOptions)})}};(0,s.Cg)([(0,l.e)({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],m.prototype,"type",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:{isRequired:!0}},type:String})],m.prototype,"field",void 0),(0,s.Cg)([(0,o.MZ)({type:d.A,json:{write:!0}})],m.prototype,"legendOptions",void 0),(0,s.Cg)([(0,o.MZ)({type:u.A.fieldTransformTypeKebabDict.apiValues,json:{type:u.A.fieldTransformTypeKebabDict.jsonValues,read:u.A.fieldTransformTypeKebabDict.read,write:u.A.fieldTransformTypeKebabDict.write}})],m.prototype,"fieldTransformType",void 0),(0,s.Cg)([(0,o.MZ)({type:[g],json:{write:{isRequired:!0}}})],m.prototype,"colorClassBreakInfos",void 0),m=f=(0,s.Cg)([(0,a.$)("esri.renderers.PointCloudClassBreaksRenderer")],m)},64272:(e,t,r)=>{r.d(t,{T:()=>c});var i,s=r(31635),n=r(25482),o=r(88930),l=r(10107),a=(r(44208),r(53966),r(87811),r(36005)),u=r(40608),d=r(43937),p=r(98623);let c=class extends n.A{static{i=this}static get allTime(){return h}static get empty(){return y}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===i&&r===s}expandTo(e,t=p.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.lL)(r,e,t));let s=this.end;if(s){const r=(0,o.lL)(s,e,t);s=s.getTime()===r.getTime()?r:(0,o.S1)(r,1,e,t)}return new i({start:r,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,l;return s>=t&&s<=r?o=s:t>=s&&t<=n&&(o=t),r>=s&&r<=n?l=r:n>=t&&n<=r&&(l=n),null==o||null==l||isNaN(o)||isNaN(l)?i.empty:new i({start:o===-1/0?null:new Date(o),end:l===1/0?null:new Date(l)})}offset(e,t,r=p.qU){if(this.isEmpty||this.isAllTime)return this.clone();const s=new i,{start:n,end:l}=this;return null!=n&&(s.start=(0,o.S1)(n,e,t,r)),null!=l&&(s.end=(0,o.S1)(l,e,t,r)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return h.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,s.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"end",void 0),(0,s.Cg)([(0,a.w)("end")],c.prototype,"readEnd",null),(0,s.Cg)([(0,d.K)("end")],c.prototype,"writeEnd",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],c.prototype,"isAllTime",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],c.prototype,"isEmpty",null),(0,s.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"start",void 0),(0,s.Cg)([(0,a.w)("start")],c.prototype,"readStart",null),(0,s.Cg)([(0,d.K)("start")],c.prototype,"writeStart",null),c=i=(0,s.Cg)([(0,u.$)("esri.time.TimeExtent")],c);const h=new c,y=new c({start:void 0,end:void 0})},68197:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(40876),s=r(34727),n=r(56507);function o(e){return(0,s.qE)((0,n.Vr)(e),0,255)}function l(e,t){const r=e.toString(16).padStart(2,"0");return t?r.slice(0,1):r}class a{static blendColors(e,t,r,i=new a){return i.r=Math.round(e.r+(t.r-e.r)*r),i.g=Math.round(e.g+(t.g-e.g)*r),i.b=Math.round(e.b+(t.b-e.b)*r),i.a=e.a+(t.a-e.a)*r,i._sanitize()}static fromRgb(e,t){const r=(0,i.lT)(e);return r?a.fromArray(r,t):null}static fromHex(e,t=new a){const r=(0,i.oW)(e);return r?a.fromArray(r,t):null}static fromArray(e,t=new a){return t._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(t.a)&&(t.a=1),t._sanitize()}static fromString(e,t){const r=(0,i.Eq)(e);return r?a.fromArray(r,t):null}static fromJSON(e){return null!=e?new a([e[0],e[1],e[2],(e[3]??255)/255]):void 0}static toUnitRGB(e){return null!=e?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return null!=e?[e.r/255,e.g/255,e.b/255,null!=e.a?e.a:1]:null}constructor(e){this.r=255,this.g=255,this.b=255,this.a=1,e&&this.setColor(e)}get isBright(){return.299*this.r+.587*this.g+.114*this.b>=127}setColor(e){return"string"==typeof e?a.fromString(e,this):Array.isArray(e)?a.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof a||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(e){const t=e?.capitalize??!1,r=e?.digits??6,i=3===r||4===r,s=4===r||8===r,n=`#${l(this.r,i)}${l(this.g,i)}${l(this.b,i)}${s?l(Math.round(255*this.a),i):""}`;return t?n.toUpperCase():n}toCss(e=!1){const t=this.r+", "+this.g+", "+this.b;return e?`rgba(${t}, ${this.a})`:`rgb(${t})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=0){const t=o(this.r),r=o(this.g),i=o(this.b);return 0===e||1!==this.a?[t,r,i,o(255*this.a)]:[t,r,i]}clone(){return new a(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return null!=e&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=(0,i.c1)(this.r),this.g=(0,i.c1)(this.g),this.b=(0,i.c1)(this.b),this.a=(0,i.G1)(this.a),this}_set(e,t,r,i){this.r=e,this.g=t,this.b=r,this.a=i}}a.prototype.declaredClass="esri.Color"},69208:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.CustomParametersMixin")],r),r}},69540:(e,t,r)=>{r.d(t,{A:()=>p});var i=r(31635),s=r(69622),n=(r(44208),r(4718)),o=(r(53966),r(97768)),l=r(88620),a=r(40608);const u=e=>{const t=e;let r=class extends t{clone(e){const t=(0,l.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const r=t.metadata,i=t.store,s={},a=new Map;for(const t in r){const o=r[t],l=i?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==l&&0!==l&&5!==l&&4!==l)continue;const d=this[t];let p=null;p="function"==typeof u?u(d,e):"reference"===u?d:(0,n.TU)(d,e),null!=d&&null==p||(0===l?a.set(t,p):s[t]=p)}const u=new(0,Object.getPrototypeOf(this).constructor)(s);if(a.size){const e=(0,l.oY)(u)?.store;if(e)for(const[t,r]of a)e.set(t,r,0)}return u}};return r=(0,i.Cg)([(0,a.$)("esri.core.Clonable")],r),r};let d=class extends(u(s.A)){};d=(0,i.Cg)([(0,a.$)("esri.core.Clonable")],d),(d||(d={})).ClonableMixin=u;const p=d},69846:(e,t,r)=>{r.d(t,{A:()=>c});var i,s=r(31635),n=r(4718),o=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),u=r(51857),d=r(20061),p=r(72500);let c=i=class extends u.A{constructor(e){super(e),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new i({...this.cloneProperties(),field:(0,n.o8)(this.field),fieldTransformType:(0,n.o8)(this.fieldTransformType),stops:(0,n.o8)(this.stops),legendOptions:(0,n.o8)(this.legendOptions)})}};(0,s.Cg)([(0,l.e)({pointCloudStretchRenderer:"point-cloud-stretch"})],c.prototype,"type",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:{isRequired:!0}},type:String})],c.prototype,"field",void 0),(0,s.Cg)([(0,o.MZ)({type:d.A,json:{write:!0}})],c.prototype,"legendOptions",void 0),(0,s.Cg)([(0,o.MZ)({type:u.A.fieldTransformTypeKebabDict.apiValues,json:{type:u.A.fieldTransformTypeKebabDict.jsonValues,read:u.A.fieldTransformTypeKebabDict.read,write:u.A.fieldTransformTypeKebabDict.write}})],c.prototype,"fieldTransformType",void 0),(0,s.Cg)([(0,o.MZ)({type:[p.A],json:{write:{isRequired:!0}}})],c.prototype,"stops",void 0),c=i=(0,s.Cg)([(0,a.$)("esri.renderers.PointCloudStretchRenderer")],c)},72500:(e,t,r)=>{r.d(t,{A:()=>c});var i,s=r(31635),n=r(68197),o=r(25482),l=r(10107),a=r(56507),u=(r(44208),r(87811),r(40608)),d=r(43937);let p=i=class extends o.A{constructor(e){super(e),this.color=null,this.label=null,this.value=null}writeValue(e,t,r){t[r]=e??0}clone(){return new i({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};(0,s.Cg)([(0,l.MZ)({type:n.A,json:{type:[a.jz],write:{isRequired:!0}}})],p.prototype,"color",void 0),(0,s.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"label",void 0),(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],p.prototype,"value",void 0),(0,s.Cg)([(0,d.K)("value")],p.prototype,"writeValue",null),p=i=(0,s.Cg)([(0,u.$)("esri.renderers.visualVariables.support.ColorStop")],p);const c=p},73179:(e,t,r)=>{r.d(t,{b:()=>a,h:()=>u});var i=r(4718),s=r(53966),n=r(84952),o=r(60694),l=r(10873);function a(e){const{nonStandardUrlAllowed:t=!1,separator:r}=e??{},n=(0,i.o8)(l.OZ),a=n.json?.write;return"object"==typeof a&&a&&(a.writer=function(e,t,i,s){(0,o.LS)(this,e,r,t,s)}),{...n,set:function(e){if(null==e)return void this._set("url",e);const r=(0,o.HZ)({layer:this,url:e,nonStandardUrlAllowed:t,logger:s.A.getLogger(this)});this._set("url",r.url),null!=r.layerId&&this._set("layerId",r.layerId)}}}function u(e,t){const{separator:r}=t??{},i=(0,n.An)(e.url);return null!=i&&(null!=e.dynamicDataSource?i.path=(0,n.fj)(i.path,"dynamicLayer"):null!=e.layerId&&(i.path=(0,n.fj)(i.path,r??"",e.layerId.toString()))),i}},76553:(e,t,r)=>{function i(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>i})},76742:(e,t,r)=>{r.r(t),r.d(t,{default:()=>te});var i=r(31635),s=r(13874),n=r(78888),o=r(49186),l=r(4718),a=r(53966),u=r(92071),d=r(93637),p=r(74887),c=r(84952),h=r(10107),y=(r(44208),r(36005)),g=r(40608),f=r(43937),m=r(4146),v=r(52136),w=r(18768),b=r(69208),C=r(16131),S=r(8303),A=r(25036),M=r(58947),I=r(56507),x=r(93223),T=r(25482);r(87811);let R=class extends T.A{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};(0,i.Cg)([(0,h.MZ)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],R.prototype,"field",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0,nonNullable:!0,json:{read:!1,write:{isRequired:!0}}})],R.prototype,"type",void 0),R=(0,i.Cg)([(0,g.$)("esri.layers.pointCloudFilters.PointCloudFilter")],R);const O=R;var _;let F=_=class extends O{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new _({field:this.field,requiredClearBits:(0,l.o8)(this.requiredClearBits),requiredSetBits:(0,l.o8)(this.requiredSetBits)})}};(0,i.Cg)([(0,h.MZ)({type:[I.jz],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],F.prototype,"requiredClearBits",void 0),(0,i.Cg)([(0,h.MZ)({type:[I.jz],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],F.prototype,"requiredSetBits",void 0),(0,i.Cg)([(0,x.e)({pointCloudBitfieldFilter:"bitfield"})],F.prototype,"type",void 0),F=_=(0,i.Cg)([(0,g.$)("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],F);const Z=F;var P;let j=P=class extends O{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new P({field:this.field,includedReturns:(0,l.o8)(this.includedReturns)})}};(0,i.Cg)([(0,h.MZ)({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"includedReturns",void 0),(0,i.Cg)([(0,x.e)({pointCloudReturnFilter:"return"})],j.prototype,"type",void 0),j=P=(0,i.Cg)([(0,g.$)("esri.layers.pointCloudFilters.PointCloudReturnFilter")],j);const N=j;var U;let E=U=class extends O{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new U({field:this.field,mode:this.mode,values:(0,l.o8)(this.values)})}};(0,i.Cg)([(0,h.MZ)({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],E.prototype,"mode",void 0),(0,i.Cg)([(0,x.e)({pointCloudValueFilter:"value"})],E.prototype,"type",void 0),(0,i.Cg)([(0,h.MZ)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],E.prototype,"values",void 0),E=U=(0,i.Cg)([(0,g.$)("esri.layers.pointCloudFilters.PointCloudValueFilter")],E);const $={key:"type",base:O,typeMap:{value:E,bitfield:Z,return:N}};var q,L=r(10873),V=r(20437),B=r(17036),D=r(93705),k=r(63531),z=r(51857);let K=q=class extends z.A{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new q({...this.cloneProperties(),field:(0,l.o8)(this.field)})}};(0,i.Cg)([(0,x.e)({pointCloudRGBRenderer:"point-cloud-rgb"})],K.prototype,"type",void 0),(0,i.Cg)([(0,h.MZ)({type:String,json:{write:{isRequired:!0}}})],K.prototype,"field",void 0),K=q=(0,i.Cg)([(0,g.$)("esri.renderers.PointCloudRGBRenderer")],K);const H=K;var J=r(69846),G=r(48425);const W={key:"type",base:z.A,typeMap:{"point-cloud-class-breaks":k.A,"point-cloud-rgb":H,"point-cloud-stretch":J.A,"point-cloud-unique-value":G.A},errorContext:"renderer"};var Y=r(24212),Q=r(30291);const X=(0,B.p)();let ee=class extends((0,M.w)((0,w.b)((0,C.q)((0,S.A)((0,A.j)((0,u.P)((0,b.d)((0,v.p)(m.A))))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t?.domain?t.domain:null}readServiceFields(e,t,r){return Array.isArray(e)?e.map(e=>{const t=new V.A;return"FieldTypeInteger"===e.type&&((e=(0,l.o8)(e)).type="esriFieldTypeInteger"),t.read(e,r),t}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(e=>new V.A({name:e.name,type:"ELEVATION"===e.name?"double":"integer"})):null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}writeRenderer(e,t,r,i){(0,d.sM)("layerDefinition.drawingInfo.renderer",e.write({},i),t)}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(p.QP).then(()=>this._fetchService(t));return this.addResolvingPromise(r),Promise.resolve(this)}createPopupTemplate(e){const t=(0,Q.tn)(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){const t=this.fieldsIndex.get("RETURNS");if(!t)return;const r=e.fieldInfos?.find(e=>e.fieldName===t.name);if(!r)return;const i=new D.A({name:"pcl-returns-decoded",title:t.alias||t.name,expression:`\n var returnValue = $feature.${t.name};\n return (returnValue % 16) + " / " + Floor(returnValue / 16);\n `});e.expressionInfos=[...e.expressionInfos||[],i],r.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){const t=this.fieldsIndex.get("RGB");if(!t)return;const r=e.fieldInfos?.find(e=>e.fieldName===t.name);if(!r)return;const i=new D.A({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:`\n var rgb = $feature.${t.name};\n var red = Floor(rgb / 65536, 0);\n var green = Floor((rgb - (red * 65536)) / 256,0);\n var blue = rgb - (red * 65536) - (green * 256);\n\n return "rgb(" + red + "," + green + "," + blue + ")";\n `});e.expressionInfos=[...e.expressionInfos||[],i],r.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,t){if(await this.load(t),!this.attributeStorageInfo)throw new o.A("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new o.A("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const e of this.attributeStorageInfo)if(e.name===r.name){const r=(0,c.fj)(this.parsedUrl?.path??"",`./statistics/${e.key}`);return(0,n.A)(r,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(e=>e.data)}throw new o.A("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"PointCloud"!==e.layerType)throw new o.A("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o.A("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 o.A("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return null!=this.attributeStorageInfo&&this.attributeStorageInfo.some(t=>t.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(e){(0,Y.XF)(a.A.getLogger(this),(0,Y.B)("Point cloud layers","absolute-height",e)),(0,Y.XF)(a.A.getLogger(this),(0,Y.tW)("Point cloud layers",e))}};(0,i.Cg)([(0,h.MZ)({type:["PointCloudLayer"]})],ee.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,h.MZ)(L.M6)],ee.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],ee.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],ee.prototype,"defaultPopupTemplate",null),(0,i.Cg)([(0,h.MZ)({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],ee.prototype,"opacity",void 0),(0,i.Cg)([(0,h.MZ)({type:["show","hide"]})],ee.prototype,"listMode",void 0),(0,i.Cg)([(0,h.MZ)({types:[$],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],ee.prototype,"filters",void 0),(0,i.Cg)([(0,h.MZ)({type:[V.A]})],ee.prototype,"fields",void 0),(0,i.Cg)([(0,h.MZ)(X.fieldsIndex)],ee.prototype,"fieldsIndex",void 0),(0,i.Cg)([(0,y.w)("service","fields",["fields","attributeStorageInfo"])],ee.prototype,"readServiceFields",null),(0,i.Cg)([(0,h.MZ)(X.outFields)],ee.prototype,"outFields",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],ee.prototype,"attributeStorageInfo",void 0),(0,i.Cg)([(0,h.MZ)(L.Yj)],ee.prototype,"elevationInfo",null),(0,i.Cg)([(0,h.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],ee.prototype,"path",void 0),(0,i.Cg)([(0,h.MZ)(L.fV)],ee.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,h.MZ)({types:W,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:W},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],ee.prototype,"renderer",void 0),(0,i.Cg)([(0,f.K)("renderer")],ee.prototype,"writeRenderer",null),(0,i.Cg)([(0,h.MZ)({json:{read:!1},readOnly:!0})],ee.prototype,"type",void 0),ee=(0,i.Cg)([(0,g.$)("esri.layers.PointCloudLayer")],ee);const te=ee},83898:(e,t,r)=>{r.d(t,{F:()=>n});var i=r(78888),s=r(49186);async function n(e,t,r,n,o,l,a){let u=null;if(null!=r){const t=`${e}/nodepages/`,s=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,i.A)(s,{query:{f:"json",...n,token:o},responseType:"json",signal:a})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){null!=l&&l.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",s,e),u=e}}if(!t)return null;const d=t?.split("/").pop(),p=`${e}/nodes/`,c=p+d;try{return{type:"node",rootNode:(await(0,i.A)(c,{query:{f:"json",...n,token:o},responseType:"json",signal:a})).data,urlPrefix:p}}catch(e){throw new s.A("sceneservice:root-node-missing","Root node missing.",{pageError:u,nodeError:e,url:c})}}},88788:(e,t,r)=>{r.d(t,{m:()=>o,v:()=>n});var i=r(84952),s=r(20655);function n(e,t){return{...l(e,t),readResourcePaths:[]}}function o(e,t,r){const s=(0,i.An)(e.itemUrl);return{...l(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:s?{rootPath:s.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function l(e,t){return{origin:t,url:(0,i.An)(e.itemUrl),portal:e.portal||s.A.getDefault(),portalItem:e}}},91682:(e,t,r)=>{r.d(t,{S:()=>a,r:()=>l});var i=r(49186),s=r(74887),n=r(13069),o=r(15804);async function l(e,t,r){const i=await u(e,t,r);await d(i,t,r)}async function a(e,t,r,i,s){const n=await u(r,i,s);await e.update({data:t}),await d(n,i,s)}async function u(e,t,l){if(!t?.resources)return;const a=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const u=new Set(t.resources.toKeep.map(e=>e.resource.path)),d=new Set,p=[];u.forEach(t=>{a.delete(t),e.paths.push(t)});const c=[],h=[],y=[];for(const r of t.resources.toUpdate)if(a.delete(r.resource.path),u.has(r.resource.path)||d.has(r.resource.path)){const{resource:t,content:i,finish:s}=r,l=(0,o.bg)(t,(0,n.lk)());e.paths.push(l.path),c.push({resource:l,content:await(0,o.cL)(i),compress:r.compress}),s&&y.push(()=>s(l))}else{e.paths.push(r.resource.path),h.push({resource:r.resource,content:await(0,o.cL)(r.content),compress:r.compress});const t=r.finish;t&&y.push(()=>t(r.resource)),d.add(r.resource.path)}for(const r of t.resources.toAdd)if(e.paths.push(r.resource.path),a.has(r.resource.path))a.delete(r.resource.path);else{c.push({resource:r.resource,content:await(0,o.cL)(r.content),compress:r.compress});const e=r.finish;e&&y.push(()=>e(r.resource))}if(c.length||h.length){const{addOrUpdateResources:e}=await Promise.resolve().then(r.bind(r,15804));await e(t.portalItem,c,"add",l),await e(t.portalItem,h,"update",l)}if(y.forEach(e=>e()),0===p.length)return a;const g=await(0,s.Ol)(p);if((0,s.Te)(l),g.length>0)throw new i.A("save:resources","Failed to save one or more resources",{errors:g});return a}async function d(e,t,r){if(!e||!t.portalItem)return;const i=[];for(const s of e){const e=t.portalItem.resourceFromPath(s);i.push(e.portalItem.removeResource(e,r))}await(0,s.Lx)(i)}},92071:(e,t,r)=>{r.d(t,{P:()=>w,L:()=>b});var i=r(31635),s=r(69622),n=r(76953),o=r(4718),l=r(35666);class a{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(l.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new a,r=this._originStores[0];r&&r.forEach((e,r)=>{t.set(r,(0,o.o8)(e),0)});for(let r=2;r<l.AU;r++){const i=this._originStores[r];i&&i.forEach((i,s)=>{e&&e.has(s)||t.set(s,(0,o.o8)(i),r)})}return t}get(e,t){const r=void 0===t?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=7){let i=this._originStores[r];if(i||(i=new Map,this._originStores[r]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const i=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),i!==t}return!1}delete(e,t=7){const r=this._originStores[t];if(!r)return;const i=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const t=this._originStores[r];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const r=void 0===t?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],i=r?.get(e),s=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),s!==i}originOf(e){return this._propertyOriginMap.get(e)||0}isAtOrigin(e,t){return this.has(e,t)&&this.originOf(e)===t}isBelowOrigin(e,t){return!this.has(e)||this.originOf(e)<t}forEach(e){this._values.forEach(e)}}var u=r(45917),d=r(88620),p=r(40608);const c=e=>{const t=e;let r=class extends t{constructor(...e){super(...e);const t=(0,d.oY)(this),r=t.store,i=new a;t.store=i,(0,n.k)(t,r,i)}read(e,t){(0,u.L)(this,e,t)}getAtOrigin(e,t){const r=h(this),i=(0,l.aB)(t);if("string"==typeof e)return r.get(e,i);const s={};return e.forEach(e=>{s[e]=r.get(e,i)}),s}originOf(e){return(0,l.OL)(this.originIdOf(e))}originIdOf(e){return h(this).originOf(e)}revert(e,t){const r=h(this),i=(0,l.aB)(t),s=(0,d.oY)(this);let n;n="string"==typeof e?"*"===e?r.keys(i):[e]:e,n.forEach(e=>{s.invalidate(e),r.revert(e,i),s.commit(e)})}};return r=(0,i.Cg)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],r),r};function h(e){return(0,d.oY)(e).store}let y=class extends(c(s.A)){};y=(0,i.Cg)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],y);var g=r(16649),f=r(49422);const m=e=>{const t=e;let r=class extends t{constructor(...e){super(...e)}clear(e,t="user"){(0,d.oY)(this).clearOrigin(e,(0,l.aB)(t))}write(e,t){return(0,f.M)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,d.oY)(this).setAtOrigin(e,t,(0,l.aB)(r))}removeOrigin(e){const t=v(this),r=(0,l.aB)(e),i=t.keys(r);for(const e of i)t.originOf(e)===r&&t.set(e,t.get(e,r),7)}updateOrigin(e,t){const r=v(this),i=(0,l.aB)(t),s=(0,g.Jt)(this,e);for(let t=i+1;t<l.AU;++t)r.delete(e,t);r.set(e,s,i)}toJSON(e){return this.write({},e)}};return r=(0,i.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],r),r.prototype.toJSON.isDefaultToJSON=!0,r};function v(e){return(0,d.oY)(e).store}const w=e=>{const t=m(c(e));let r=class extends t{constructor(...e){super(...e)}};return r=(0,i.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport")],r),r};let b=class extends(w(s.A)){};b=(0,i.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport")],b)},95466:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(49186),s=r(53966),n=r(91869),o=r(3330),l=r(12195),a=r(30524),u=r(98623),d=r(56400),p=r(96285);const c=new Map;class h{static fromJSON(e){return new h(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new h(e.fields??[],m(e))}static fromLayerJSON(e){return new h(e.fields??[],m(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const r=[];for(const e of this.fields){const t=e?.name,i=g(t);if(t&&i){const s=y(t);this._fieldsMap.set(t,e),this._fieldsMap.set(s,e),this._normalizedFieldsMap.set(i,e),r.push(`${s}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,a.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,a.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,a.te)(e)||(0,a.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}r.sort(),this.uid=r.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,a.te)(e)||(0,a.Xz)(e)||e.nullable||void 0!==(0,a.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(y(e))??this._normalizedFieldsMap.get(g(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new i.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):f.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?o.GB.instance:t===u.n$?p.mQ.utcInstance:(0,n.tE)(c,t,()=>p.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,a.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,l.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function y(e){return e.trim().toLowerCase()}function g(e){return(0,a.rS)(e)?.toLowerCase()??""}const f=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function m(e){const t=new Map;if(!e.fields)return t;const r=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:s}=e,n=(i?"startField"in i?i.startField:i.startTimeField:"")??"",o=(i?"endField"in i?i.endField:i.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,d.ZS)(e.dateFieldsTimeReference):null,a=s?function(e){return"timeZone"in e}(s)?s.timeZone??l:s.dateFieldsTimeReference?(0,d.ZS)(s.dateFieldsTimeReference):l??u.n$:null,p=i?function(e){return"timeZone"in e}(i)?i.timeZone??l:i.timeReference?(0,d.ZS)(i.timeReference):l:null,c=new Map([[y(s?.creationDateField??""),a],[y(s?.editDateField??""),a],[y(n),p],[y(o),p]]);for(const{name:i,type:s}of e.fields)if(f.has(s))t.set(i,u.L5);else if("date"!==s&&"esriFieldTypeDate"!==s)t.set(i,null);else if(r)t.set(i,u.L5);else{const e=c.get(y(i??""))??l;t.set(i,e)}return t}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5804,6742],{4146:(e,t,r)=>{r.d(t,{A:()=>w});var i=r(31635),s=r(78888),n=r(49186),o=r(65529),l=r(4902),a=r(92474),u=r(53966),d=r(74887),p=r(84952),c=r(10107),h=(r(44208),r(87811),r(40608)),y=r(5443),g=r(16930),f=r(92602),m=r(64272);let v=0,w=class extends(o.A.EventedMixin(l.A.IdentifiableMixin(a.A))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.A(-180,-90,180,90,g.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+v++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(7982).then(r.bind(r,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await r.e(5613).then(r.bind(r,45613));try{return await i(t)}catch(e){const r=t?.portalItem,i=r?.id||"unset",s=r?.portal?.url||f.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,d.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get effectiveVisible(){let e=this.visible;const t=this.parent;return e&&t&&"effectiveVisible"in t&&(e&&=t.effectiveVisible),e}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,p.An)(this.url)}createLayerView(e,t){return Promise.reject(new n.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new n.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,c.MZ)({type:String})],w.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],w.prototype,"effectiveVisible",null),(0,i.Cg)([(0,c.MZ)({type:y.A})],w.prototype,"fullExtent",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],w.prototype,"hasAttributionData",null),(0,i.Cg)([(0,c.MZ)({type:String,clonable:!1})],w.prototype,"id",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:["show","hide","hide-children"]})],w.prototype,"listMode",void 0),(0,i.Cg)([(0,c.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],w.prototype,"opacity",void 0),(0,i.Cg)([(0,c.MZ)({clonable:!1})],w.prototype,"parent",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,i.Cg)([(0,c.MZ)({type:Boolean,readOnly:!0})],w.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean})],w.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean})],w.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,c.MZ)({type:g.A})],w.prototype,"spatialReference",void 0),(0,i.Cg)([(0,c.MZ)({type:String})],w.prototype,"title",void 0),(0,i.Cg)([(0,c.MZ)({readOnly:!0,json:{read:!1}})],w.prototype,"type",void 0),(0,i.Cg)([(0,c.MZ)()],w.prototype,"url",void 0),(0,i.Cg)([(0,c.MZ)({type:m.T})],w.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"visible",void 0),w=(0,i.Cg)([(0,h.$)("esri.layers.Layer")],w)},8303:(e,t,r)=>{r.d(t,{A:()=>S});var i=r(31635),s=r(92602),n=r(70333),o=r(78888),l=r(60999),a=r(49186),u=r(53966),d=r(97768),p=r(74887),c=r(84952),h=r(10107),y=(r(44208),r(87811),r(36005)),g=r(40608),f=r(43937),m=r(77548),v=r(20655),w=r(80812),b=r(41318),C=r(10407);const S=e=>{const t=e;let S=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,d.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new w.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,p.Te)(t),await i({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,p.zf)(e)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,p.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,p.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!n.id?.findCredential(this.url),s=e===r.id;if(s&&r.portal.user)return this._getUserPrivileges(r,i);let o,l;if(s)o=r.portal.url;else try{o=await(0,m.wI)(this.url,t)}catch(e){(0,p.QP)(e)}if(!o||!(0,c.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;l=await(n.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,p.QP)(e)}const a=!0,u=!1,d=!1;if(!l)return{features:{edit:a,fullEdit:u},content:{updateItem:d}};try{if(s?await r.reload():(r=new w.default({id:e,portal:{url:o}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){(0,p.QP)(e)}return{features:{edit:a,fullEdit:u},content:{updateItem:d}}}_getUserPrivileges(e,t){const r=(0,C.It)(e);return t&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,p.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const r=A.credential===t?A.user:await this._fetchEditingUser(e);return A.credential=t,A.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=n.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=v.A.getDefault();if(s&&s.loaded&&(0,c.S8)(s.restUrl)===(0,c.S8)(i))return s.user;const a=`${i}/community/self`,u=null!=e?e.signal:null,d=await(0,l.Ke)((0,o.A)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return d.ok?b.A.fromJSON(d.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&i&&!(0,c.ut)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i.Cg)([(0,h.MZ)({type:w.default})],S.prototype,"portalItem",null),(0,i.Cg)([(0,y.w)("web-document","portalItem",["itemId"])],S.prototype,"readPortalItem",null),(0,i.Cg)([(0,f.K)("web-document","portalItem",{itemId:{type:String}})],S.prototype,"writePortalItem",null),(0,i.Cg)([(0,h.MZ)({clonable:!1})],S.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],S.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],S.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,readOnly:!0})],S.prototype,"userHasUpdateItemPrivileges",void 0),S=(0,i.Cg)([(0,g.$)("esri.layers.mixins.PortalLayer")],S),S},A={credential:null,user:null}},13069:(e,t,r)=>{r.d(t,{AG:()=>l,lk:()=>s,vD:()=>o,yS:()=>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().toUpperCase()}}`}function o(){return`{${s()}}`}function l(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},15804:(e,t,r)=>{r.d(t,{addOrUpdateResources:()=>l,bg:()=>c,cL:()=>p,fetchResources:()=>o,removeAllResources:()=>u,removeResource:()=>a});var i=r(78888),s=r(49186),n=r(84952);async function o(e,t={},r){await e.load(r);const i=(0,n.fj)(e.itemUrl,"resources"),{start:s=1,num:o=10,sortOrder:l="asc",sortField:a="resource"}=t,u={query:{start:s,num:o,sortOrder:l,sortField:a,token:e.apiKey},signal:r?.signal},d=await e.portal.request(i,u);return{total:d.total,nextStart:d.nextStart,resources:d.resources.map(({created:t,size:r,resource:i})=>({created:new Date(t),size:r,resource:e.resourceFromPath(i)}))}}async function l(e,t,r,i){const o=new Map;for(const{resource:e,content:i,compress:n,access:l}of t){if(!e.hasPath())throw new s.A(`portal-item-resource-${r}:invalid-path`,"Resource does not have a valid path");const[t,a]=d(e.path),u=`${t}/${n??""}/${l??""}`;o.has(u)||o.set(u,{prefix:t,compress:n,access:l,files:[]}),o.get(u).files.push({fileName:a,content:i})}await e.load(i);const l=(0,n.fj)(e.userItemUrl,"add"===r?"addResources":"updateResources");for(const{prefix:t,compress:r,access:s,files:n}of o.values()){const o=25;for(let a=0;a<n.length;a+=o){const u=n.slice(a,a+o),d=new FormData;t&&"."!==t&&d.append("resourcesPrefix",t),r&&d.append("compress","true"),s&&d.append("access",s);let p=0;for(const{fileName:e,content:t}of u)d.append("file"+ ++p,t,e);d.append("f","json"),await e.portal.request(l,{method:"post",body:d,signal:i?.signal})}}}async function a(e,t,r){if(!t.hasPath())throw new s.A("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const i=(0,n.fj)(e.userItemUrl,"removeResources");await e.portal.request(i,{method:"post",query:{resource:t.path},signal:r?.signal}),t.portalItem=null}async function u(e,t){await e.load(t);const r=(0,n.fj)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function d(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}async function p(e){return"blob"===e.type?e.blob:"json"===e.type?new Blob([e.jsonString],{type:"application/json"}):(await(0,i.A)(e.url,{responseType:"blob"})).data}function c(e,t){if(!e.hasPath())return null;const[r,,i]=function(e){const[t,r]=function(e){const t=(0,n.Zo)(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[i,s]=d(t);return[i,s,r]}(e.path);return e.portalItem.resourceFromPath((0,n.fj)(r,t+i))}},17036:(e,t,r)=>{r.d(t,{p:()=>a});var i=r(44208),s=r(53966),n=r(20437),o=r(95466),l=r(30524);function a(){return{fields:{type:[n.A],value:null,set:function(e){if(e&&(0,i.A)("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.A.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.A.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.A.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,l.DB)(this.fieldsIndex,e)}}}}},18768:(e,t,r)=>{r.d(t,{b:()=>a});var i=r(31635),s=r(53966),n=r(10107),o=(r(44208),r(87811),r(40608)),l=r(60694);const a=e=>{const t=e;let r=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Jf)(e,s.A.getLogger(this)))}};return(0,i.Cg)([(0,n.MZ)()],r.prototype,"title",null),(0,i.Cg)([(0,n.MZ)({type:String})],r.prototype,"url",null),r=(0,i.Cg)([(0,o.$)("esri.layers.mixins.ArcGISService")],r),r}},20061:(e,t,r)=>{r.d(t,{A:()=>y});var i,s=r(31635),n=r(69540),o=r(66552),l=r(25482),a=r(10107),u=r(56507),d=(r(44208),r(87811),r(93223)),p=r(40608);const c=(0,o.O)()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let h=i=class extends(n.A.ClonableMixin(l.A)){static from(e){return(0,u.PZ)(i,e)}constructor(e){super(e),this.title=null,this.order=null}};(0,s.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"title",void 0),(0,s.Cg)([(0,d.e)(c)],h.prototype,"order",void 0),h=i=(0,s.Cg)([(0,p.$)("esri.renderers.support.RendererLegendOptions")],h);const y=h},24212:(e,t,r)=>{function i(e,t){return function(e,t){return t?.mode?t.mode:function(e){return e?a:u}(e).mode}(null==e||(e.hasZ??!1),t)}function s(e,t,r){return r&&r.mode!==t?`${e} only support ${t} elevation mode`:null}function n(e,t,r){return r?.mode===t?`${e} do not support ${t} elevation mode`:null}function o(e,t){return null!=t?.featureExpressionInfo&&"0"!==t.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function l(e,t){t&&e.warn(".elevationInfo=",t)}r.d(t,{$7:()=>n,B:()=>s,XF:()=>l,tW:()=>o,w7:()=>i}),r(83047),r(16271);const a={mode:"absolute-height",offset:0},u={mode:"on-the-ground",offset:null}},25036:(e,t,r)=>{r.d(t,{j:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=e=>{const t=e;let r=class extends t{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.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"minScale",void 0),(0,i.Cg)([(0,s.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"maxScale",void 0),(0,i.Cg)([(0,s.MZ)({readOnly:!0})],r.prototype,"effectiveScaleRange",null),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.ScaleRangeLayer")],r),r}},26121:(e,t,r)=>{r.d(t,{ci:()=>o,dL:()=>s});var i=r(49186);async function s(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}r(77548);const n=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function o(e,t,r){let s=(e.messages??[]).filter(({type:e})=>"error"===e).map(({name:e,message:t,details:r})=>new i.A(e,t,r));if(e.blockedRelativeUrls&&(s=s.concat(e.blockedRelativeUrls.map(e=>new i.A("url:unsupported",`Relative url '${e}' is not supported`)))),r){const{ignoreUnsupported:e,supplementalUnsupportedErrors:t=[],requiredPropertyChecksDisabled:i}=r;e&&(s=s.filter(({name:e})=>!(n.has(e)||t.includes(e)))),i&&(s=s.filter(e=>"web-document-write:property-required"!==e.name))}if(s.length>0)throw new i.A(t.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:s})}},30291:(e,t,r)=>{r.d(t,{tn:()=>u});var i=r(13874),s=r(30524),n=r(89893),o=(r(84424),r(80737),r(96808),r(66159)),l=(r(67336),r(92094),r(23721),r(47582),r(41227)),a=r(68780);function u({displayField:e,editFieldsInfo:t,fields:r,objectIdField:a,title:u},h){if(!r)return null;const g=function(e,t){const r=t?.visibleFieldNames;return function({fields:e,ignoreFieldTypes:t,sortDisabled:r}){const i=e;return t&&(e=e.filter(e=>!t.includes(e.type))),e===i&&(e=e.slice()),!0!==r&&e.sort(p),e}({fields:e.fields??[],ignoreFieldTypes:t?.ignoreFieldTypes||y,sortDisabled:t?.sortDisabled}).map(t=>new l.A({fieldName:t.name,isEditable:(0,s.R$)(t,e),label:t.alias,format:c(t),visible:d(t,{...e,visibleFieldNames:r})}))}({editFieldsInfo:t,fields:r,objectIdField:a},h);if(!g.length)return null;const f=function(e){const t=(0,s.mB)(e),{titleBase:r}=e;return t?`${r}: {${t.trim()}}`:r??""}({titleBase:u,fields:r,displayField:e}),m=[new o.A,new n.A];return new i.A({title:f,content:m,fieldInfos:g})}const d=(e,t)=>t.visibleFieldNames?t.visibleFieldNames.has(e.name):(0,s.Bz)(e,t);function p(e,t){return"oid"===e.type?-1:"oid"===t.type?1:h(e)?-1:h(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function c(e){switch(e.type){case"small-integer":case"integer":case"single":return new a.A({digitSeparator:!0,places:0});case"double":return new a.A({digitSeparator:!0,places:2});case"string":return(0,s.JL)(e.name)?new a.A({digitSeparator:!0,places:0}):void 0;default:return}}function h(e){if("name"===(e.name&&e.name.toLowerCase()))return!0;const t=e.alias?.toLowerCase();return"name"===t}const y=["geometry","blob","raster","guid","xml"]},46130:(e,t,r)=>{r.d(t,{v:()=>s});var i=r(76553);function s(e){e?.writtenProperties&&e.writtenProperties.forEach(({target:e,propName:t,newOrigin:r})=>{(0,i.H)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)})}},48425:(e,t,r)=>{r.d(t,{A:()=>m});var i,s=r(31635),n=r(4718),o=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),u=r(51857),d=r(20061),p=r(68197),c=r(25482),h=r(56507);let y=i=class extends c.A{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new i({description:this.description,label:this.label,values:(0,n.o8)(this.values),color:(0,n.o8)(this.color)})}};(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"description",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"label",void 0),(0,s.Cg)([(0,o.MZ)({type:[String],json:{write:{isRequired:!0}}})],y.prototype,"values",void 0),(0,s.Cg)([(0,o.MZ)({type:p.A,json:{type:[h.jz],write:{isRequired:!0}}})],y.prototype,"color",void 0),y=i=(0,s.Cg)([(0,a.$)("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],y);const g=y;var f;let m=f=class extends u.A{constructor(e){super(e),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new f({...this.cloneProperties(),field:(0,n.o8)(this.field),fieldTransformType:(0,n.o8)(this.fieldTransformType),colorUniqueValueInfos:(0,n.o8)(this.colorUniqueValueInfos),legendOptions:(0,n.o8)(this.legendOptions)})}};(0,s.Cg)([(0,l.e)({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],m.prototype,"type",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:{isRequired:!0}},type:String})],m.prototype,"field",void 0),(0,s.Cg)([(0,o.MZ)({type:u.A.fieldTransformTypeKebabDict.apiValues,json:{type:u.A.fieldTransformTypeKebabDict.jsonValues,read:u.A.fieldTransformTypeKebabDict.read,write:u.A.fieldTransformTypeKebabDict.write}})],m.prototype,"fieldTransformType",void 0),(0,s.Cg)([(0,o.MZ)({type:[g],json:{write:{isRequired:!0}}})],m.prototype,"colorUniqueValueInfos",void 0),(0,s.Cg)([(0,o.MZ)({type:d.A,json:{write:!0}})],m.prototype,"legendOptions",void 0),m=f=(0,s.Cg)([(0,a.$)("esri.renderers.PointCloudUniqueValueRenderer")],m)},51857:(e,t,r)=>{r.d(t,{A:()=>A});var i,s=r(31635),n=r(66552),o=r(25482),l=r(4718),a=r(10107),u=(r(44208),r(53966),r(40608));r(87811);let d=i=class extends o.A{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new i({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};(0,s.Cg)([(0,a.MZ)({type:String,json:{write:{isRequired:!0}}})],d.prototype,"field",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],d.prototype,"minValue",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],d.prototype,"maxValue",void 0),d=i=(0,s.Cg)([(0,u.$)("esri.renderers.support.pointCloud.ColorModulation")],d);const p=d,c=new n.J({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let h=class extends o.A{};(0,s.Cg)([(0,a.MZ)({type:c.apiValues,readOnly:!0,nonNullable:!0,json:{type:c.jsonValues,read:!1,write:{writer:c.write,isRequired:!0}}})],h.prototype,"type",void 0),h=(0,s.Cg)([(0,u.$)("esri.renderers.support.pointCloud.PointSizeAlgorithm")],h);const y=h;var g,f=r(93223);let m=g=class extends y{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};(0,s.Cg)([(0,f.e)({pointCloudFixedSizeAlgorithm:"fixed-size"})],m.prototype,"type",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],m.prototype,"size",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],m.prototype,"useRealWorldSymbolSizes",void 0),m=g=(0,s.Cg)([(0,u.$)("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],m);const v=m;var w;let b=w=class extends y{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new w({scaleFactor:this.scaleFactor})}};(0,s.Cg)([(0,f.e)({pointCloudSplatAlgorithm:"splat"})],b.prototype,"type",void 0),(0,s.Cg)([(0,a.MZ)({type:Number,value:1,nonNullable:!0,json:{write:{isRequired:!0}}})],b.prototype,"scaleFactor",void 0),b=w=(0,s.Cg)([(0,u.$)("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],b);const C={key:"type",base:y,typeMap:{"fixed-size":v,splat:b}},S=(0,n.O)()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let A=class extends o.A{constructor(e){super(e),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:(0,l.o8)(this.pointSizeAlgorithm),colorModulation:(0,l.o8)(this.colorModulation),pointsPerInch:(0,l.o8)(this.pointsPerInch)}}};(0,s.Cg)([(0,a.MZ)({type:S.apiValues,readOnly:!0,nonNullable:!0,json:{type:S.jsonValues,read:!1,write:{writer:S.write,isRequired:!0}}})],A.prototype,"type",void 0),(0,s.Cg)([(0,a.MZ)({types:C,json:{write:!0}})],A.prototype,"pointSizeAlgorithm",void 0),(0,s.Cg)([(0,a.MZ)({type:p,json:{write:!0}})],A.prototype,"colorModulation",void 0),(0,s.Cg)([(0,a.MZ)({json:{write:!0},nonNullable:!0,type:Number})],A.prototype,"pointsPerInch",void 0),A=(0,s.Cg)([(0,u.$)("esri.renderers.PointCloudRenderer")],A),(A||(A={})).fieldTransformTypeKebabDict=new n.J({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})},52136:(e,t,r)=>{r.d(t,{p:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=e=>{const t=e;let r=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i.Cg)([(0,s.MZ)({type:String})],r.prototype,"apiKey",null),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.APIKeyMixin")],r),r}},54239:(e,t,r)=>{r.d(t,{A:()=>m});var i,s=r(31635),n=r(4576),o=r(66552),l=r(25482),a=r(83047),u=r(67076),d=r(10107),p=(r(44208),r(53966),r(36005)),c=r(40608),h=r(43937);const y=(0,o.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),g=y.jsonValues.slice();(0,n.Xy)(g,"orthometric");const f=(0,o.O)()({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 m=i=class extends l.A{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return y.write(e,t,r)}readHeightModel(e,t,r){return y.read(e)||(r?.messages&&r.messages.push(function(e,t){return new u.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:r})),null)}readHeightUnit(e,t,r){return f.read(e)||(r?.messages&&r.messages.push(v(e,{context:r})),null)}readHeightUnitService(e,t,r){return(0,a.LA)(e)||f.read(e)||(r?.messages&&r.messages.push(v(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,a.k1)(t);return new i({heightModel:e.heightModel,heightUnit:r??void 0,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 v(e,t){return new u.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s.Cg)([(0,d.MZ)({type:y.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g,default:"ellipsoidal",write:{isRequired:!0}}}}})],m.prototype,"heightModel",void 0),(0,s.Cg)([(0,h.K)("web-scene","heightModel")],m.prototype,"writeHeightModel",null),(0,s.Cg)([(0,p.w)(["web-scene","service"],"heightModel")],m.prototype,"readHeightModel",null),(0,s.Cg)([(0,d.MZ)({type:f.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:f.jsonValues,write:{writer:f.write,isRequired:!0}}}}})],m.prototype,"heightUnit",void 0),(0,s.Cg)([(0,p.w)("web-scene","heightUnit")],m.prototype,"readHeightUnit",null),(0,s.Cg)([(0,p.w)("service","heightUnit")],m.prototype,"readHeightUnitService",null),(0,s.Cg)([(0,d.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],m.prototype,"vertCRS",void 0),(0,s.Cg)([(0,p.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],m.prototype,"readVertCRS",null),m=i=(0,s.Cg)([(0,c.$)("esri.geometry.HeightModelInfo")],m)},58947:(e,t,r)=>{r.d(t,{w:()=>M});var i=r(31635),s=r(78888),n=r(49186),o=r(53966),l=r(74887),a=r(10107),u=(r(44208),r(87811),r(36005)),d=r(40608),p=r(46130),c=r(5443),h=r(54239),y=r(16930),g=r(60694),f=r(10873),m=r(83898),v=r(73179);var w=r(20655),b=r(80812),C=r(88788),S=r(91682),A=r(26121);const M=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.url=null,this.indexInfo=null,this._debouncedSaveOperations=(0,l.sg)(async(e,t,r)=>{switch(e){case 0:return this._save(t);case 1:return this._saveAs(r,t)}})}readSpatialReference(e,t){return x(t)}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=null==e.spatialReference?{...e,spatialReference:x(t)}:e;return c.A.fromJSON(i,r)}const i=t.store,s=x(t);return null==s||null==i?.extent||!Array.isArray(i.extent)||i.extent.some(e=>e<I)?null:new c.A({xmin:i.extent[0],ymin:i.extent[1],xmax:i.extent[2],ymax:i.extent[3],spatialReference:s})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,i=null!=r.version?r.version.toString():"";return this.parseVersionString(i)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return this.url?(0,g.yG)(this.url,t.name):t.name;let i=t.name;if(!i&&this.url){const e=(0,g.qg)(this.url);null!=e&&(i=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(i=r+" - "+i),(0,g.cr)(i)}get parsedUrl(){return(0,v.h)(this,{separator:"layers"})}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,m.F)(this.parsedUrl?.path??"",this.rootNode,e,this.customParameters,this.apiKey,o.A.getLogger(this),t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,r=e.rootPage?.nodes?.[t];if(null==r?.obb?.center||null==r.obb.halfSize)throw new n.A("sceneservice:invalid-node-page","Invalid node page.");if(r.obb.center[0]<I||null==this.fullExtent||this.fullExtent.hasZ)return;const i=r.obb.halfSize,s=r.obb.center[2],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2]);this.fullExtent.zmin=s-o,this.fullExtent.zmax=s+o}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<I)return;const r=t[2],i=t[3],{fullExtent:s}=this;s&&(s.zmin=r-i,s.zmax=r+i)}}async _fetchService(e){if(null==this.url)throw new n.A("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,s.A)(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,s.A)(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});t.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const i=t.data;this.read(i,this._getServiceContext()),this.validateLayer(i)}async _fetchVoxelServiceLayer(e){const t=(await(0,s.A)(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}async _saveAs(e,t){const r={...O,...t};let i=b.default.from(e);if(!i)throw new n.A("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");i.id&&(i=i.clone(),i.id=null);const s=i.portal||w.A.getDefault();await this._ensureLoadBeforeSave(),i.type=R,i.portal=s;const o=(0,C.m)(i,"portal-item",!0),l={layers:[this.write({},o)]};return await Promise.all(o.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(l,o,r),this.url&&(i.url=this.url),i.title||(i.title=this.title),T(i,r,1),await s.signIn(),await s.user.addItem({item:i,folder:r?.folder,data:l}),await(0,S.r)(this.resourceReferences,o),this.portalItem=i,(0,p.v)(o),o.portalItem=i,i}async _save(e){const t={...O,...e};if(!this.portalItem)throw new n.A("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==R)throw new n.A("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${R}"`);await this._ensureLoadBeforeSave();const r=(0,C.m)(this.portalItem,"portal-item",!0),i={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(i,r,t),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),T(this.portalItem,t,0),await(0,S.S)(this.portalItem,i,this.resourceReferences,r),(0,p.v)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,r){const i=r?.validationOptions;(0,A.ci)(t,{errorName:"sceneservice:save"},{ignoreUnsupported:i?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const s=i?.enabled,l=null;if(s&&l){const t=(await l()).validate(e,r.portalItemLayerType);if(!t.length)return;const s=`Layer item did not validate:\n${t.join("\n")}`;if(o.A.getLogger(this).error(`_validateAgainstJSONSchema(): ${s}`),"throw"===i.failPolicy){const e=t.map(e=>new n.A("sceneservice:schema-validation",e));throw new n.A("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:e})}}}};return(0,i.Cg)([(0,a.MZ)(f.id)],r.prototype,"id",void 0),(0,i.Cg)([(0,a.MZ)({type:y.A})],r.prototype,"spatialReference",void 0),(0,i.Cg)([(0,u.w)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readSpatialReference",null),(0,i.Cg)([(0,a.MZ)({type:c.A})],r.prototype,"fullExtent",void 0),(0,i.Cg)([(0,u.w)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],r.prototype,"readFullExtent",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0,type:h.A})],r.prototype,"heightModelInfo",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],r.prototype,"minScale",void 0),(0,i.Cg)([(0,a.MZ)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],r.prototype,"maxScale",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],r.prototype,"version",void 0),(0,i.Cg)([(0,u.w)("version",["store.version"])],r.prototype,"readVersion",null),(0,i.Cg)([(0,a.MZ)({type:String,json:{read:{source:"copyrightText"}}})],r.prototype,"copyright",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{read:!1}})],r.prototype,"sublayerTitleMode",void 0),(0,i.Cg)([(0,a.MZ)({type:String})],r.prototype,"title",void 0),(0,i.Cg)([(0,u.w)("portal-item","title")],r.prototype,"readTitlePortalItem",null),(0,i.Cg)([(0,u.w)("service","title",["name"])],r.prototype,"readTitleService",null),(0,i.Cg)([(0,a.MZ)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],r.prototype,"layerId",void 0),(0,i.Cg)([(0,a.MZ)((0,v.b)({separator:"layers"}))],r.prototype,"url",void 0),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],r.prototype,"parsedUrl",null),(0,i.Cg)([(0,a.MZ)({readOnly:!0})],r.prototype,"store",void 0),(0,i.Cg)([(0,a.MZ)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],r.prototype,"rootNode",void 0),r=(0,i.Cg)([(0,d.$)("esri.layers.mixins.SceneService")],r),r},I=-1e38;function x(e){if(null!=e.spatialReference)return y.A.fromJSON(e.spatialReference);const t=e.store,r=t.indexCRS||t.geographicCRS,i=r&&parseInt(r.slice(r.lastIndexOf("/")+1),10);return null!=i?new y.A(i):null}function T(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const i=t.getTypeKeywords();for(const t of i)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t),1===r&&(e.typeKeywords=e.typeKeywords.filter(e=>"Hosted Service"!==e)))}const R="Scene Service",O={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}}},63531:(e,t,r)=>{r.d(t,{A:()=>m});var i,s=r(31635),n=r(4718),o=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),u=r(51857),d=r(20061),p=r(68197),c=r(25482),h=r(56507);let y=i=class extends c.A{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new i({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:(0,n.o8)(this.color)})}};(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"description",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"label",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue",isRequired:!0}}})],y.prototype,"minValue",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue",isRequired:!0}}})],y.prototype,"maxValue",void 0),(0,s.Cg)([(0,o.MZ)({type:p.A,json:{type:[h.jz],write:{isRequired:!0}}})],y.prototype,"color",void 0),y=i=(0,s.Cg)([(0,a.$)("esri.renderers.support.pointCloud.ColorClassBreakInfo")],y);const g=y;var f;let m=f=class extends u.A{constructor(e){super(e),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new f({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:(0,n.o8)(this.colorClassBreakInfos),legendOptions:(0,n.o8)(this.legendOptions)})}};(0,s.Cg)([(0,l.e)({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],m.prototype,"type",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:{isRequired:!0}},type:String})],m.prototype,"field",void 0),(0,s.Cg)([(0,o.MZ)({type:d.A,json:{write:!0}})],m.prototype,"legendOptions",void 0),(0,s.Cg)([(0,o.MZ)({type:u.A.fieldTransformTypeKebabDict.apiValues,json:{type:u.A.fieldTransformTypeKebabDict.jsonValues,read:u.A.fieldTransformTypeKebabDict.read,write:u.A.fieldTransformTypeKebabDict.write}})],m.prototype,"fieldTransformType",void 0),(0,s.Cg)([(0,o.MZ)({type:[g],json:{write:{isRequired:!0}}})],m.prototype,"colorClassBreakInfos",void 0),m=f=(0,s.Cg)([(0,a.$)("esri.renderers.PointCloudClassBreaksRenderer")],m)},64272:(e,t,r)=>{r.d(t,{T:()=>c});var i,s=r(31635),n=r(25482),o=r(88930),l=r(10107),a=(r(44208),r(53966),r(87811),r(36005)),u=r(40608),d=r(43937),p=r(98623);let c=class extends n.A{static{i=this}static get allTime(){return h}static get empty(){return y}static fromArray(e){return new i({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===i&&r===s}expandTo(e,t=p.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.lL)(r,e,t));let s=this.end;if(s){const r=(0,o.lL)(s,e,t);s=s.getTime()===r.getTime()?r:(0,o.S1)(r,1,e,t)}return new i({start:r,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return i.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let o,l;return s>=t&&s<=r?o=s:t>=s&&t<=n&&(o=t),r>=s&&r<=n?l=r:n>=t&&n<=r&&(l=n),null==o||null==l||isNaN(o)||isNaN(l)?i.empty:new i({start:o===-1/0?null:new Date(o),end:l===1/0?null:new Date(l)})}offset(e,t,r=p.qU){if(this.isEmpty||this.isAllTime)return this.clone();const s=new i,{start:n,end:l}=this;return null!=n&&(s.start=(0,o.S1)(n,e,t,r)),null!=l&&(s.end=(0,o.S1)(l,e,t,r)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return h.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new i({start:t,end:r})}};(0,s.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"end",void 0),(0,s.Cg)([(0,a.w)("end")],c.prototype,"readEnd",null),(0,s.Cg)([(0,d.K)("end")],c.prototype,"writeEnd",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],c.prototype,"isAllTime",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],c.prototype,"isEmpty",null),(0,s.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],c.prototype,"start",void 0),(0,s.Cg)([(0,a.w)("start")],c.prototype,"readStart",null),(0,s.Cg)([(0,d.K)("start")],c.prototype,"writeStart",null),c=i=(0,s.Cg)([(0,u.$)("esri.time.TimeExtent")],c);const h=new c,y=new c({start:void 0,end:void 0})},68197:(e,t,r)=>{r.d(t,{A:()=>a});var i=r(40876),s=r(34727),n=r(56507);function o(e){return(0,s.qE)((0,n.Vr)(e),0,255)}function l(e,t){const r=e.toString(16).padStart(2,"0");return t?r.slice(0,1):r}class a{static blendColors(e,t,r,i=new a){return i.r=Math.round(e.r+(t.r-e.r)*r),i.g=Math.round(e.g+(t.g-e.g)*r),i.b=Math.round(e.b+(t.b-e.b)*r),i.a=e.a+(t.a-e.a)*r,i._sanitize()}static fromRgb(e,t){const r=(0,i.lT)(e);return r?a.fromArray(r,t):null}static fromHex(e,t=new a){const r=(0,i.oW)(e);return r?a.fromArray(r,t):null}static fromArray(e,t=new a){return t._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(t.a)&&(t.a=1),t._sanitize()}static fromString(e,t){const r=(0,i.Eq)(e);return r?a.fromArray(r,t):null}static fromJSON(e){return null!=e?new a([e[0],e[1],e[2],(e[3]??255)/255]):void 0}static toUnitRGB(e){return null!=e?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return null!=e?[e.r/255,e.g/255,e.b/255,null!=e.a?e.a:1]:null}constructor(e){this.r=255,this.g=255,this.b=255,this.a=1,e&&this.setColor(e)}get isBright(){return.299*this.r+.587*this.g+.114*this.b>=127}setColor(e){return"string"==typeof e?a.fromString(e,this):Array.isArray(e)?a.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof a||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(e){const t=e?.capitalize??!1,r=e?.digits??6,i=3===r||4===r,s=4===r||8===r,n=`#${l(this.r,i)}${l(this.g,i)}${l(this.b,i)}${s?l(Math.round(255*this.a),i):""}`;return t?n.toUpperCase():n}toCss(e=!1){const t=this.r+", "+this.g+", "+this.b;return e?`rgba(${t}, ${this.a})`:`rgb(${t})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=0){const t=o(this.r),r=o(this.g),i=o(this.b);return 0===e||1!==this.a?[t,r,i,o(255*this.a)]:[t,r,i]}clone(){return new a(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return null!=e&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=(0,i.c1)(this.r),this.g=(0,i.c1)(this.g),this.b=(0,i.c1)(this.b),this.a=(0,i.G1)(this.a),this}_set(e,t,r,i){this.r=e,this.g=t,this.b=r,this.a=i}}a.prototype.declaredClass="esri.Color"},69208:(e,t,r)=>{r.d(t,{d:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.CustomParametersMixin")],r),r}},69540:(e,t,r)=>{r.d(t,{A:()=>p});var i=r(31635),s=r(69622),n=(r(44208),r(4718)),o=(r(53966),r(97768)),l=r(88620),a=r(40608);const u=e=>{const t=e;let r=class extends t{clone(e){const t=(0,l.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");const r=t.metadata,i=t.store,s={},a=new Map;for(const t in r){const o=r[t],l=i?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==l&&0!==l&&5!==l&&4!==l)continue;const d=this[t];let p=null;if("function"==typeof u)p=u(d,e);else if("reference"===u)p=d;else if(p=(0,n.TU)(d,e),null!=d&&null==p)continue;0===l?a.set(t,p):s[t]=p}const u=new(0,Object.getPrototypeOf(this).constructor)(s);if(a.size){const e=(0,l.oY)(u)?.store;if(e)for(const[t,r]of a)e.set(t,r,0)}return u}};return r=(0,i.Cg)([(0,a.$)("esri.core.Clonable")],r),r};let d=class extends(u(s.A)){};d=(0,i.Cg)([(0,a.$)("esri.core.Clonable")],d),(d||(d={})).ClonableMixin=u;const p=d},69846:(e,t,r)=>{r.d(t,{A:()=>c});var i,s=r(31635),n=r(4718),o=r(10107),l=(r(44208),r(53966),r(93223)),a=r(40608),u=r(51857),d=r(20061),p=r(72500);let c=i=class extends u.A{constructor(e){super(e),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new i({...this.cloneProperties(),field:(0,n.o8)(this.field),fieldTransformType:(0,n.o8)(this.fieldTransformType),stops:(0,n.o8)(this.stops),legendOptions:(0,n.o8)(this.legendOptions)})}};(0,s.Cg)([(0,l.e)({pointCloudStretchRenderer:"point-cloud-stretch"})],c.prototype,"type",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:{isRequired:!0}},type:String})],c.prototype,"field",void 0),(0,s.Cg)([(0,o.MZ)({type:d.A,json:{write:!0}})],c.prototype,"legendOptions",void 0),(0,s.Cg)([(0,o.MZ)({type:u.A.fieldTransformTypeKebabDict.apiValues,json:{type:u.A.fieldTransformTypeKebabDict.jsonValues,read:u.A.fieldTransformTypeKebabDict.read,write:u.A.fieldTransformTypeKebabDict.write}})],c.prototype,"fieldTransformType",void 0),(0,s.Cg)([(0,o.MZ)({type:[p.A],json:{write:{isRequired:!0}}})],c.prototype,"stops",void 0),c=i=(0,s.Cg)([(0,a.$)("esri.renderers.PointCloudStretchRenderer")],c)},72500:(e,t,r)=>{r.d(t,{A:()=>c});var i,s=r(31635),n=r(68197),o=r(25482),l=r(10107),a=r(56507),u=(r(44208),r(87811),r(40608)),d=r(43937);let p=i=class extends o.A{constructor(e){super(e),this.color=null,this.label=null,this.value=null}writeValue(e,t,r){t[r]=e??0}clone(){return new i({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};(0,s.Cg)([(0,l.MZ)({type:n.A,json:{type:[a.jz],write:{isRequired:!0}}})],p.prototype,"color",void 0),(0,s.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"label",void 0),(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],p.prototype,"value",void 0),(0,s.Cg)([(0,d.K)("value")],p.prototype,"writeValue",null),p=i=(0,s.Cg)([(0,u.$)("esri.renderers.visualVariables.support.ColorStop")],p);const c=p},73179:(e,t,r)=>{r.d(t,{b:()=>a,h:()=>u});var i=r(4718),s=r(53966),n=r(84952),o=r(60694),l=r(10873);function a(e){const{nonStandardUrlAllowed:t=!1,separator:r}=e??{},n=(0,i.o8)(l.OZ),a=n.json?.write;return"object"==typeof a&&a&&(a.writer=function(e,t,i,s){(0,o.LS)(this,e,r,t,s)}),{...n,set:function(e){if(null==e)return void this._set("url",e);const r=(0,o.HZ)({layer:this,url:e,nonStandardUrlAllowed:t,logger:s.A.getLogger(this)});this._set("url",r.url),null!=r.layerId&&this._set("layerId",r.layerId)}}}function u(e,t){const{separator:r}=t??{},i=(0,n.An)(e.url);return null!=i&&(null!=e.dynamicDataSource?i.path=(0,n.fj)(i.path,"dynamicLayer"):null!=e.layerId&&(i.path=(0,n.fj)(i.path,r??"",e.layerId.toString()))),i}},76553:(e,t,r)=>{function i(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>i})},76742:(e,t,r)=>{r.r(t),r.d(t,{default:()=>te});var i=r(31635),s=r(13874),n=r(78888),o=r(49186),l=r(4718),a=r(53966),u=r(92071),d=r(93637),p=r(74887),c=r(84952),h=r(10107),y=(r(44208),r(36005)),g=r(40608),f=r(43937),m=r(4146),v=r(52136),w=r(18768),b=r(69208),C=r(16131),S=r(8303),A=r(25036),M=r(58947),I=r(56507),x=r(93223),T=r(25482);r(87811);let R=class extends T.A{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};(0,i.Cg)([(0,h.MZ)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],R.prototype,"field",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0,nonNullable:!0,json:{read:!1,write:{isRequired:!0}}})],R.prototype,"type",void 0),R=(0,i.Cg)([(0,g.$)("esri.layers.pointCloudFilters.PointCloudFilter")],R);const O=R;var _;let F=_=class extends O{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new _({field:this.field,requiredClearBits:(0,l.o8)(this.requiredClearBits),requiredSetBits:(0,l.o8)(this.requiredSetBits)})}};(0,i.Cg)([(0,h.MZ)({type:[I.jz],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],F.prototype,"requiredClearBits",void 0),(0,i.Cg)([(0,h.MZ)({type:[I.jz],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],F.prototype,"requiredSetBits",void 0),(0,i.Cg)([(0,x.e)({pointCloudBitfieldFilter:"bitfield"})],F.prototype,"type",void 0),F=_=(0,i.Cg)([(0,g.$)("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],F);const Z=F;var P;let j=P=class extends O{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new P({field:this.field,includedReturns:(0,l.o8)(this.includedReturns)})}};(0,i.Cg)([(0,h.MZ)({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"includedReturns",void 0),(0,i.Cg)([(0,x.e)({pointCloudReturnFilter:"return"})],j.prototype,"type",void 0),j=P=(0,i.Cg)([(0,g.$)("esri.layers.pointCloudFilters.PointCloudReturnFilter")],j);const N=j;var U;let E=U=class extends O{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new U({field:this.field,mode:this.mode,values:(0,l.o8)(this.values)})}};(0,i.Cg)([(0,h.MZ)({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],E.prototype,"mode",void 0),(0,i.Cg)([(0,x.e)({pointCloudValueFilter:"value"})],E.prototype,"type",void 0),(0,i.Cg)([(0,h.MZ)({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],E.prototype,"values",void 0),E=U=(0,i.Cg)([(0,g.$)("esri.layers.pointCloudFilters.PointCloudValueFilter")],E);const $={key:"type",base:O,typeMap:{value:E,bitfield:Z,return:N}};var q,L=r(10873),V=r(20437),B=r(17036),D=r(93705),k=r(63531),z=r(51857);let K=q=class extends z.A{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new q({...this.cloneProperties(),field:(0,l.o8)(this.field)})}};(0,i.Cg)([(0,x.e)({pointCloudRGBRenderer:"point-cloud-rgb"})],K.prototype,"type",void 0),(0,i.Cg)([(0,h.MZ)({type:String,json:{write:{isRequired:!0}}})],K.prototype,"field",void 0),K=q=(0,i.Cg)([(0,g.$)("esri.renderers.PointCloudRGBRenderer")],K);const H=K;var J=r(69846),G=r(48425);const W={key:"type",base:z.A,typeMap:{"point-cloud-class-breaks":k.A,"point-cloud-rgb":H,"point-cloud-stretch":J.A,"point-cloud-unique-value":G.A},errorContext:"renderer"};var Y=r(24212),Q=r(30291);const X=(0,B.p)();let ee=class extends((0,M.w)((0,w.b)((0,C.q)((0,S.A)((0,A.j)((0,u.P)((0,b.d)((0,v.p)(m.A))))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t?.domain?t.domain:null}readServiceFields(e,t,r){return Array.isArray(e)?e.map(e=>{const t=new V.A;return"FieldTypeInteger"===e.type&&((e=(0,l.o8)(e)).type="esriFieldTypeInteger"),t.read(e,r),t}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(e=>new V.A({name:e.name,type:"ELEVATION"===e.name?"double":"integer"})):null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}writeRenderer(e,t,r,i){(0,d.sM)("layerDefinition.drawingInfo.renderer",e.write({},i),t)}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(p.QP).then(()=>this._fetchService(t));return this.addResolvingPromise(r),Promise.resolve(this)}createPopupTemplate(e){const t=(0,Q.tn)(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){const t=this.fieldsIndex.get("RETURNS");if(!t)return;const r=e.fieldInfos?.find(e=>e.fieldName===t.name);if(!r)return;const i=new D.A({name:"pcl-returns-decoded",title:t.alias||t.name,expression:`\n var returnValue = $feature.${t.name};\n return (returnValue % 16) + " / " + Floor(returnValue / 16);\n `});e.expressionInfos=[...e.expressionInfos||[],i],r.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){const t=this.fieldsIndex.get("RGB");if(!t)return;const r=e.fieldInfos?.find(e=>e.fieldName===t.name);if(!r)return;const i=new D.A({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:`\n var rgb = $feature.${t.name};\n var red = Floor(rgb / 65536, 0);\n var green = Floor((rgb - (red * 65536)) / 256,0);\n var blue = rgb - (red * 65536) - (green * 256);\n\n return "rgb(" + red + "," + green + "," + blue + ")";\n `});e.expressionInfos=[...e.expressionInfos||[],i],r.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,t){if(await this.load(t),!this.attributeStorageInfo)throw new o.A("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new o.A("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const e of this.attributeStorageInfo)if(e.name===r.name){const r=(0,c.fj)(this.parsedUrl?.path??"",`./statistics/${e.key}`);return(0,n.A)(r,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(e=>e.data)}throw new o.A("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"PointCloud"!==e.layerType)throw new o.A("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o.A("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 o.A("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return null!=this.attributeStorageInfo&&this.attributeStorageInfo.some(t=>t.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(e){(0,Y.XF)(a.A.getLogger(this),(0,Y.B)("Point cloud layers","absolute-height",e)),(0,Y.XF)(a.A.getLogger(this),(0,Y.tW)("Point cloud layers",e))}};(0,i.Cg)([(0,h.MZ)({type:["PointCloudLayer"]})],ee.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,h.MZ)(L.M6)],ee.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,h.MZ)({type:s.A,json:{name:"popupInfo",write:!0}})],ee.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],ee.prototype,"defaultPopupTemplate",null),(0,i.Cg)([(0,h.MZ)({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],ee.prototype,"opacity",void 0),(0,i.Cg)([(0,h.MZ)({type:["show","hide"]})],ee.prototype,"listMode",void 0),(0,i.Cg)([(0,h.MZ)({types:[$],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],ee.prototype,"filters",void 0),(0,i.Cg)([(0,h.MZ)({type:[V.A]})],ee.prototype,"fields",void 0),(0,i.Cg)([(0,h.MZ)(X.fieldsIndex)],ee.prototype,"fieldsIndex",void 0),(0,i.Cg)([(0,y.w)("service","fields",["fields","attributeStorageInfo"])],ee.prototype,"readServiceFields",null),(0,i.Cg)([(0,h.MZ)(X.outFields)],ee.prototype,"outFields",void 0),(0,i.Cg)([(0,h.MZ)({readOnly:!0})],ee.prototype,"attributeStorageInfo",void 0),(0,i.Cg)([(0,h.MZ)(L.Yj)],ee.prototype,"elevationInfo",null),(0,i.Cg)([(0,h.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],ee.prototype,"path",void 0),(0,i.Cg)([(0,h.MZ)(L.fV)],ee.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,h.MZ)({types:W,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:W},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],ee.prototype,"renderer",void 0),(0,i.Cg)([(0,f.K)("renderer")],ee.prototype,"writeRenderer",null),(0,i.Cg)([(0,h.MZ)({json:{read:!1},readOnly:!0})],ee.prototype,"type",void 0),ee=(0,i.Cg)([(0,g.$)("esri.layers.PointCloudLayer")],ee);const te=ee},83898:(e,t,r)=>{r.d(t,{F:()=>n});var i=r(78888),s=r(49186);async function n(e,t,r,n,o,l,a){let u=null;if(null!=r){const t=`${e}/nodepages/`,s=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,i.A)(s,{query:{f:"json",...n,token:o},responseType:"json",signal:a})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){null!=l&&l.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",s,e),u=e}}if(!t)return null;const d=t?.split("/").pop(),p=`${e}/nodes/`,c=p+d;try{return{type:"node",rootNode:(await(0,i.A)(c,{query:{f:"json",...n,token:o},responseType:"json",signal:a})).data,urlPrefix:p}}catch(e){throw new s.A("sceneservice:root-node-missing","Root node missing.",{pageError:u,nodeError:e,url:c})}}},88788:(e,t,r)=>{r.d(t,{m:()=>o,v:()=>n});var i=r(84952),s=r(20655);function n(e,t){return{...l(e,t),readResourcePaths:[]}}function o(e,t,r){const s=(0,i.An)(e.itemUrl);return{...l(e,t),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:s?{rootPath:s.path,writtenUrls:[]}:null,resources:r?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function l(e,t){return{origin:t,url:(0,i.An)(e.itemUrl),portal:e.portal||s.A.getDefault(),portalItem:e}}},91682:(e,t,r)=>{r.d(t,{S:()=>a,r:()=>l});var i=r(49186),s=r(74887),n=r(13069),o=r(15804);async function l(e,t,r){const i=await u(e,t,r);await d(i,t,r)}async function a(e,t,r,i,s){const n=await u(r,i,s);await e.update({data:t}),await d(n,i,s)}async function u(e,t,l){if(!t?.resources)return;const a=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const u=new Set(t.resources.toKeep.map(e=>e.resource.path)),d=new Set,p=[];u.forEach(t=>{a.delete(t),e.paths.push(t)});const c=[],h=[],y=[];for(const r of t.resources.toUpdate)if(a.delete(r.resource.path),u.has(r.resource.path)||d.has(r.resource.path)){const{resource:t,content:i,finish:s}=r,l=(0,o.bg)(t,(0,n.lk)());e.paths.push(l.path),c.push({resource:l,content:await(0,o.cL)(i),compress:r.compress}),s&&y.push(()=>s(l))}else{e.paths.push(r.resource.path),h.push({resource:r.resource,content:await(0,o.cL)(r.content),compress:r.compress});const t=r.finish;t&&y.push(()=>t(r.resource)),d.add(r.resource.path)}for(const r of t.resources.toAdd)if(e.paths.push(r.resource.path),a.has(r.resource.path))a.delete(r.resource.path);else{c.push({resource:r.resource,content:await(0,o.cL)(r.content),compress:r.compress});const e=r.finish;e&&y.push(()=>e(r.resource))}if(c.length||h.length){const{addOrUpdateResources:e}=await Promise.resolve().then(r.bind(r,15804));await e(t.portalItem,c,"add",l),await e(t.portalItem,h,"update",l)}if(y.forEach(e=>e()),0===p.length)return a;const g=await(0,s.Ol)(p);if((0,s.Te)(l),g.length>0)throw new i.A("save:resources","Failed to save one or more resources",{errors:g});return a}async function d(e,t,r){if(!e||!t.portalItem)return;const i=[];for(const s of e){const e=t.portalItem.resourceFromPath(s);i.push(e.portalItem.removeResource(e,r))}await(0,s.Lx)(i)}},92071:(e,t,r)=>{r.d(t,{P:()=>w,L:()=>b});var i=r(31635),s=r(69622),n=r(76953),o=r(4718),l=r(35666);class a{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(l.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new a,r=this._originStores[0];r&&r.forEach((e,r)=>{t.set(r,(0,o.o8)(e),0)});for(let r=2;r<l.AU;r++){const i=this._originStores[r];i&&i.forEach((i,s)=>{e&&e.has(s)||t.set(s,(0,o.o8)(i),r)})}return t}get(e,t){const r=void 0===t?this._values:this._originStores[t];return r?r.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,r=7){let i=this._originStores[r];if(i||(i=new Map,this._originStores[r]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const i=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),i!==t}return!1}delete(e,t=7){const r=this._originStores[t];if(!r)return;const i=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const t=this._originStores[r];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const r=void 0===t?this._values:this._originStores[t];return!!r&&r.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const r=this._originStores[t],i=r?.get(e),s=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),s!==i}originOf(e){return this._propertyOriginMap.get(e)||0}isAtOrigin(e,t){return this.has(e,t)&&this.originOf(e)===t}isBelowOrigin(e,t){return!this.has(e)||this.originOf(e)<t}forEach(e){this._values.forEach(e)}}var u=r(45917),d=r(88620),p=r(40608);const c=e=>{const t=e;let r=class extends t{constructor(...e){super(...e);const t=(0,d.oY)(this),r=t.store,i=new a;t.store=i,(0,n.k)(t,r,i)}read(e,t){(0,u.L)(this,e,t)}getAtOrigin(e,t){const r=h(this),i=(0,l.aB)(t);if("string"==typeof e)return r.get(e,i);const s={};return e.forEach(e=>{s[e]=r.get(e,i)}),s}originOf(e){return(0,l.OL)(this.originIdOf(e))}originIdOf(e){return h(this).originOf(e)}revert(e,t){const r=h(this),i=(0,l.aB)(t),s=(0,d.oY)(this);let n;n="string"==typeof e?"*"===e?r.keys(i):[e]:e,n.forEach(e=>{s.invalidate(e),r.revert(e,i),s.commit(e)})}};return r=(0,i.Cg)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],r),r};function h(e){return(0,d.oY)(e).store}let y=class extends(c(s.A)){};y=(0,i.Cg)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],y);var g=r(16649),f=r(49422);const m=e=>{const t=e;let r=class extends t{constructor(...e){super(...e)}clear(e,t="user"){(0,d.oY)(this).clearOrigin(e,(0,l.aB)(t))}write(e,t){return(0,f.M)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,d.oY)(this).setAtOrigin(e,t,(0,l.aB)(r))}removeOrigin(e){const t=v(this),r=(0,l.aB)(e),i=t.keys(r);for(const e of i)t.originOf(e)===r&&t.set(e,t.get(e,r),7)}updateOrigin(e,t){const r=v(this),i=(0,l.aB)(t),s=(0,g.Jt)(this,e);for(let t=i+1;t<l.AU;++t)r.delete(e,t);r.set(e,s,i)}toJSON(e){return this.write({},e)}};return r=(0,i.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],r),r.prototype.toJSON.isDefaultToJSON=!0,r};function v(e){return(0,d.oY)(e).store}const w=e=>{const t=m(c(e));let r=class extends t{constructor(...e){super(...e)}};return r=(0,i.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport")],r),r};let b=class extends(w(s.A)){};b=(0,i.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport")],b)},95466:(e,t,r)=>{r.d(t,{A:()=>h});var i=r(49186),s=r(53966),n=r(91869),o=r(3330),l=r(12195),a=r(30524),u=r(98623),d=r(56400),p=r(96285);const c=new Map;class h{static fromJSON(e){return new h(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new h(e.fields??[],m(e))}static fromLayerJSON(e){return new h(e.fields??[],m(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const r=[];for(const e of this.fields){const t=e?.name,i=g(t);if(t&&i){const s=y(t);this._fieldsMap.set(t,e),this._fieldsMap.set(s,e),this._normalizedFieldsMap.set(i,e),r.push(`${s}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,a.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,a.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,a.te)(e)||(0,a.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}r.sort(),this.uid=r.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,a.te)(e)||(0,a.Xz)(e)||e.nullable||void 0!==(0,a.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(y(e))??this._normalizedFieldsMap.get(g(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new i.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):f.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?o.GB.instance:t===u.n$?p.mQ.utcInstance:(0,n.tE)(c,t,()=>p.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,a.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,l.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function y(e){return e.trim().toLowerCase()}function g(e){return(0,a.rS)(e)?.toLowerCase()??""}const f=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function m(e){const t=new Map;if(!e.fields)return t;const r=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:s}=e,n=(i?"startField"in i?i.startField:i.startTimeField:"")??"",o=(i?"endField"in i?i.endField:i.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,d.ZS)(e.dateFieldsTimeReference):null,a=s?function(e){return"timeZone"in e}(s)?s.timeZone??l:s.dateFieldsTimeReference?(0,d.ZS)(s.dateFieldsTimeReference):l??u.n$:null,p=i?function(e){return"timeZone"in e}(i)?i.timeZone??l:i.timeReference?(0,d.ZS)(i.timeReference):l:null,c=new Map([[y(s?.creationDateField??""),a],[y(s?.editDateField??""),a],[y(n),p],[y(o),p]]);for(const{name:i,type:s}of e.fields)if(f.has(s))t.set(i,u.L5);else if("date"!==s&&"esriFieldTypeDate"!==s)t.set(i,null);else if(r)t.set(i,u.L5);else{const e=c.get(y(i??""))??l;t.set(i,e)}return t}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7444],{1364:(e,t,s)=>{s.d(t,{c:()=>i});var n=s(55537);function i(e,t){const s=e.getGeometryType();return s===n.G.enumPoint?e:(0,n.h)(s)?function(e){if(function(e){for(let t=0,s=e.getPathCount();t<s;t++){const s=e.getPathSize(t);if(0===s)return!1;if(1===s){if(0===e.getSegmentCountPath(t))return!1;if(e.getSegmentType(e.getPathStart(t))===n.G.enumLine)return!1;if(!e.isClosedPath(t))return!1}}return!0}(e))return e;const t=e.createInstance();for(let s=0,i=e.getPathCount();s<i;s++){const i=e.getPathSize(s);if(0!==i){if(1===i){if(0===e.getSegmentCountPath(s))continue;if(e.getSegmentType(e.getPathStart(s))===n.G.enumLine)continue;if(!e.isClosedPath(s))continue}t.addPath(e,s,!0)}}return t}(e):s===n.G.enumMultiPoint||s===n.G.enumEnvelope?e:s===n.G.enumMultipatch?((0,n.t)("not implemented for multipatch"),e):e}},37444:(e,t,s)=>{s.r(t),s.d(t,{OperatorGeodesicBuffer:()=>T});var n=s(76061),i=s(55537),r=s(79187),o=s(39117),m=s(31635),a=s(88885),h=s(95213),c=s(11878),u=s(83661),l=s(31139),_=s(1364),f=s(5247);class d{constructor(e){this.m_sr=null,this.m_gcs=null,this.m_transform=null,this.m_a=0,this.m_eSquared=0,this.m_rpu=0,this.m_radTolerance=0,this.m_q90=0,this.m_gcs90=0,this.m_gcs180=0,this.m_gcs360=0,this.m_gcs60=0,this.m_ellipticToGeodesicMaxRatio=0,this.m_curveType=0,this.m_bShapePreserving=!1,this.m_distance=0,this.m_absDistance=0,this.m_convergenceOffset=0,this.m_cornerStep=0,this.m_segmentStep=0,this.m_progressTracker=e}bufferPolygon(e){const t=new a.a,s=new I(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new I(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new G(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new a.a;if(this.bufferPoint2D(t,!1,s)){const e=(0,h.b)(null,s,!0);s=(0,o.a3)(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new o.O).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=(0,o.r)((0,o.ao)());let m=new o.ap,a=(new o.W).executeMany(m,i,this.m_progressTracker,2);const l=(0,u.d)(6,!1),_=(0,u.m)(r.Envelope2D,6);this.initializeGrid(l,_);const f=[null,null,null,null,null,null],d=[null,null,null,null,null,null],g=[null,null,null,null,null,null];let p,P,x;for(;null!==(p=s.next());){if(P=s.getGnomonic(),P!==n){if(null!==n){let t=a.next();if(m=null,a=null,null!=t){const s=(0,h.b)(i,t,!0),r=(0,h.e)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}}null!==P&&(m=new o.ap,a=(new o.W).executeMany(m,i,this.m_progressTracker,2)),n=P}if(s.isRunningInGnomonic()){if(P.project(p),s.needsSimplify()){const e=(0,h.b)(null,p,!0);p=(0,o.a3)(p,e,!0,!0,-1,this.m_progressTracker,0,!1)}m.tick(v(p)),a.tock()}else this.putInGridCursors(e,p,i,!0,l,_,f,d,g)}let b=!1;for(let e=0;e<6;e++)if(null!=g[e]){b=!0;break}if(b){let t=!1;const r=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,l,_,f,d,g):(this.processInGrid(e,n,!1,l,_,f,r),t=!0)}}const u=new o.ap,p=(new o.W).executeMany(u,this.m_gcs,this.m_progressTracker,2);if(null!==a){let t=a.next();m=null,a=null;const s=(0,h.b)(i,t,!0),r=(0,h.e)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}for(let e=0;e<6;e++)if(null!=g[e]){let s=g[e].next();g[e]=null,d[e]=null,t&&null!==r[e]&&(s=(new o.T).execute(r[e],s,i,this.m_progressTracker));const n=(0,h.b)(i,s,!0),m=(0,h.e)(n);s=f[e].unproject(s,m,this.m_progressTracker),s=(new o.L).execute(s,this.m_gcs,!0,this.m_progressTracker),u.tick(v(s)),p.tock()}x=p.next()}else{let t,r=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),P.project(e);const n=(0,h.b)(null,e,!0);e=(0,o.a3)(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(m.tick(v(e)),a.tock()):(t=e,r=!0)}}let u=a.next();m=null,a=null,r&&(u=(new o.T).execute(t,u,i,this.m_progressTracker));const l=(0,h.b)(i,u,!0),_=(0,h.e)(l);x=n.unproject(u,_,this.m_progressTracker),x=(new o.L).execute(x,this.m_gcs,!0,this.m_progressTracker)}return x=(new o.O).foldInto360RangeGeodetic(x,this.m_gcs,2),x}putInGridCursors(e,t,s,n,i,r,m,a,h){const c=[null,null,null,null,null,null];this.processInGrid(e,t,n,i,r,m,c);for(let e=0;e<6;e++)null!==c[e]&&(null===a[e]&&(a[e]=new o.ap,h[e]=(new o.W).executeMany(a[e],s,this.m_progressTracker,2)),a[e].tick(v(c[e])),h[e].tock())}processInGrid(e,t,s,n,i,r,m){const a=.01,c=this.insertGeodeticPointsAlongGrid(t,i,a);for(let e=0;e<6;e++){if(n[e])continue;const _=i[e].clone();_.inflateCoords(a,a);const f=(0,h.f)(t,_),d=(0,h.c)(null,f,!1).total();let g=(0,l.c)(c,_,d,Number.NaN,this.m_progressTracker);if(null!==g&&!g.isEmpty()){if(g===c&&(g=g.clone()),null===r[e]){const t=new u.P;e<3?t.setCoords(0,1):t.setCoords(0,-1);const s=new u.P;s.setAdd(i[e].getCenter(),t),r[e]=C(this.m_gcs,s)}r[e].project(g);const t=(0,h.b)(null,g,!0);g=(0,o.a3)(g,t,s,!0,-1,this.m_progressTracker,0,!1),m[e]=g}}}insertGeodeticPointsAlongGrid(e,t,s){const n=r.Envelope2D.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=(0,o.aq)(this.m_gcs,n,e,!0,this.m_progressTracker),m=new a.E,h=m.addGeometry(i);return(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[0].xmax+s),(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[1].xmax+s),(0,o.ar)(m,h,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&((0,o.ar)(m,h,this.m_gcs,0,2,!0,t[0].xmax-s),(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[1].xmax-s),(0,o.ar)(m,h,this.m_gcs,0,2,!1,t[1].ymin-s)),m.getGeometry(h)}initializeGrid(e,t){for(let t=0;t<6;t++)e[t]=!1;t[0].setCoords({xmin:-this.m_gcs180,ymin:0,xmax:-this.m_gcs60,ymax:this.m_gcs90}),t[1].setCoords({xmin:-this.m_gcs60,ymin:0,xmax:this.m_gcs60,ymax:this.m_gcs90}),t[2].setCoords({xmin:this.m_gcs60,ymin:0,xmax:this.m_gcs180,ymax:this.m_gcs90}),t[3].setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:-this.m_gcs60,ymax:0}),t[4].setCoords({xmin:-this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs60,ymax:0}),t[5].setCoords({xmin:this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:0})}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t,s,n,i,r){const m=e[0],a=e.at(-1),h=m.y<a.y?m.y:a.y,c=m.y>a.y?m.y:a.y,l=o.ai.q(this.m_a,this.m_eSquared,h),_=o.ai.q(this.m_a,this.m_eSquared,c);if(this.m_q90-(l+t+this.m_absDistance)>.001&&this.m_q90+(_-t-this.m_absDistance)>.001)return!1;const f=s-u.o,d=n+u.o,g=f-Math.PI,b=f+Math.PI,y=d+Math.PI,S=[Number.NaN],w=[Number.NaN],C=[Number.NaN],v=[Number.NaN];let D=!1;if(x(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,f,g,a,d,S,w),x(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,y,d,m,g,C,v),(d<S[0]&&S[0]<y||d<w[0]&&w[0]<y)&&(D=!0),D||(g<C[0]&&C[0]<f||g<v[0]&&v[0]<f)&&(D=!0),!D&&i)return!1;const I=[];for(let t=e.length-1;t>=0;t--)I.push(e[t]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let G=0;G=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,f,d,i,G,r),G=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,d,y,this.m_cornerStep,i,G,r,S[0],w[0]),G=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,I,y,b,i,G,r),G=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,g,f,this.m_cornerStep,i,G,r,C[0],v[0]);let T=!1;return i||(T=this.checkAndPrepForPole(r)),D||T}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0),P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,e,-this.m_cornerStep,2*Math.PI,this.m_cornerStep,t,0,s);let n=!1;return t||(n=this.checkAndPrepForPole(s)),n}checkAndPrepForPole(e){const t=this.checkAndPrepForPoleTouch(e),s=this.checkAndPrepForPoleWrap(e);return t||s}checkAndPrepForPoleTouch(e){const t=new r.Envelope2D;return e.queryEnvelope(t),!(!(0,o.as)(t.ymax,this.m_gcs90)&&!(0,o.as)(t.ymin,-this.m_gcs90)||(this.prepPoleTouch(e),0))}checkAndPrepForPoleWrap(e){const t=e.getXY(0),s=e.getXY(e.getPointCount()-1);return Math.abs(t.x-s.x)>this.m_gcs180?(this.prepSinglePoleWrap(e),!0):this.checkAndPrepForDoublePoleWrap(e)}checkAndPrepForDoublePoleWrap(e){return e.calculateArea2D()<0&&(this.prepDoublePoleWrap(e),!0)}prepPoleTouch(e){const t=new a.a;t.insertPath2D(-1,null,0,0,!0);const s=e.getPathStart(0),n=e.getPathEnd(0),i=n-s;let r=-1;for(r=s;r<n;r++){const t=e.getXY(r),s=(0,o.as)(t.y,this.m_gcs90),n=(0,o.as)(t.y,-this.m_gcs90);if(!s&&!n)break}let m=r,h=!1,c=Number.NaN;do{const n=e.getXY(m),r=(0,o.as)(n.y,this.m_gcs90),a=(0,o.as)(n.y,-this.m_gcs90),l=s+(m+1-s)%i;if(r||a){let s=u.P.construct(c,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(l),r=(0,o.as)(i.y,this.m_gcs90),m=(0,o.as)(i.y,-this.m_gcs90);r||m||(s=u.P.construct(i.x,n.y),h?t.setXY(t.getPointCount()-1,s):t.insertPoint2D(0,-1,s)),h=!0}else t.insertPoint2D(0,-1,n),c=n.x,h=!1;m=l}while(m!==r);e.setEmpty(),e.add(t,!1)}prepSinglePoleWrap(e){const t=new a.a,s=new a.a,n=new c.T,i=e.getXY(e.getPathStart(0)),m=e.getXY(e.getPathEnd(0)-1),_=this.m_gcs360,f=this.m_gcs180,d=new r.Envelope2D;d.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const g=new r.Envelope2D;e.queryEnvelope(g);const p=Math.ceil(g.width()/_);let P,x;i.x>m.x?(P=-_,x=this.m_gcs90):(P=_,x=-this.m_gcs90),n.setShiftCoords(P,0),t.addPath(e,0,!0),s.add(t,!1);const b=new h.P;for(let e=0;e<p;e++)s.applyTransformation(n),s.getPointByVal(0,b),t.lineToPoint(b),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const y=t.getXY(0),S=t.getXY(t.getPointCount()-1);y.y=x,S.y=x,t.lineTo(S);const w=new u.P;for(w.setCoordsPoint2D(S),w.x-=.5*P;Math.abs(w.x-y.x)>f;)t.lineTo(w),w.x-=.5*P;t.lineTo(y);const C=d.getCenterX(),v=new r.Envelope2D;t.queryEnvelope(v);let D=0;const I=v.getCenter().x;I-C>f?D=-Math.ceil((I-C-f)/_):C-I>f&&(D=Math.ceil((C-I-f)/_)),0!==D&&(n.setShiftCoords(D*_,0),t.applyTransformation(n));const G=new a.E,T=G.addGeometry(t);(0,o.ar)(G,T,this.m_gcs,0,2,!0,d.xmin),(0,o.ar)(G,T,this.m_gcs,0,2,!0,d.xmax);const k=G.getGeometry(T),M=(0,h.f)(k,d);M.inflateCoords(0,1);const E=(0,h.c)(null,M,!0).total(),N=(0,l.c)(k,d,E,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(N,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new r.Envelope2D;n.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const i=n.getCenter().x,m=new r.Envelope2D;e.queryPathEnvelope(0,m);let _,f=0,d=m.getCenter().x;if(d-i>s?f=-Math.ceil((d-i-s)/t):i-d>s&&(f=Math.ceil((i-d-s)/t)),0!==f){const s=new c.T;s.setShiftCoords(f*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,m),d=m.getCenter().x}const g=new r.Envelope2D;n.containsExclusiveEnvelope(m)?(_=!1,g.setCoords({env2D:n})):(_=!0,g.setCoords({env2D:n}),g.xmin-=t,g.xmax+=t);let p=e.createInstance();p.addPathPoint2D(null,0,!0);const P=new u.P;if(P.setCoords(g.xmin,g.ymin),p.insertPoint2D(0,-1,P),P.setCoords(g.xmin,g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(.5*(g.xmin+g.xmax),g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(g.xmax,g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(g.xmax,g.ymin),p.insertPoint2D(0,-1,P),P.setCoords(.5*(g.xmin+g.xmax),g.ymin),p.insertPoint2D(0,-1,P),_){p.addPath(e,0,!0);const s=new c.T;d<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),p.addPath(e,0,!0);const r=new a.E,m=r.addGeometry(p);(0,o.ar)(r,m,this.m_gcs,0,2,!0,n.xmin),(0,o.ar)(r,m,this.m_gcs,0,2,!0,n.xmax),p=r.getGeometry(m);const u=(0,h.f)(p,n);u.inflateCoords(0,1);const _=(0,h.c)(null,u,!0).total();p=(0,l.c)(p,n,_,Number.NaN,this.m_progressTracker)}else p.addPath(e,0,!0);e.setEmpty(),e.add(p,!1)}setMinCornerStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P;s.setCoords(0,10*this.m_rpu);const n=0;let i=45*this.m_rpu;const r=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),a=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),h=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),c=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),l=new u.P,_=new u.P,f=new u.P,d=new u.P;for(o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,n,r.at(0),r.at(1)),l.setCoords(r.at(0).val,r.at(1).val),o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const r=.5*(n+i);o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,r,h.at(0),h.at(1)),f.setCoords(h.at(0).val,h.at(1).val);const u=(0,m.mS)(e,new o.a7,!1),g=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,u,g,null,2),o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,l.x,l.y,.5*u.val,g.val,c.at(0),c.at(1),2),d.setCoords(c.at(0).val,c.at(1).val);const p=(0,m.mS)(e,new o.a7,!1);if(o.a8.geodeticDistance(this.m_a,this.m_eSquared,f.x,f.y,d.x,d.y,p,null,null,2),p.val<=this.m_convergenceOffset)break;i*=.9,o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}const g=i-n,p=2*Math.PI/Math.ceil(2*Math.PI/g);this.m_cornerStep=p}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}setMinSegmentStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P,n=new u.P;s.setCoords(0,10*this.m_rpu),n.setCoords(10*this.m_rpu,10*this.m_rpu);const i=(0,m.mS)(e,new o.a7,!1),r=(0,m.mS)(e,new o.a7,!1),a=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,a,i,r,this.m_curveType);const h=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),c=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),l=new u.P,_=(0,m.mS)(e,new o.a7,!1),f=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),d=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),g=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),p=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),P=new u.P,x=new u.P,b=new u.P,y=new u.P,S=0;let w=1;const C=i.val,v=r.val,D=C-.5*Math.PI,I=v+.5*Math.PI,G=a.val;for(o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,D,f.at(0),f.at(1)),P.setCoords(f.at(0).val,f.at(1).val),o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,I,d.at(0),d.at(1)),x.setCoords(d.at(0).val,d.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const i=.5*(S+w);o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,i*G,C,h.at(0),h.at(1),this.m_curveType),l.setCoords(h.at(0).val,h.at(1).val),o.a8.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,l.x,l.y,null,null,_,this.m_curveType);const r=_.val+.5*Math.PI;o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,l.x,l.y,t,r,g.at(0),g.at(1)),b.setCoords(g.at(0).val,g.at(1).val);const a=(0,m.mS)(e,new o.a7,!1),u=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,P.x,P.y,x.x,x.y,a,u,null,2),o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,P.x,P.y,.5*a.val,u.val,p.at(0),p.at(1),2),y.setCoords(p.at(0).val,p.at(1).val);const f=(0,m.mS)(e,new o.a7,!1);if(o.a8.geodeticDistance(this.m_a,this.m_eSquared,b.x,b.y,y.x,y.y,f,null,null,2),f.val<=this.m_convergenceOffset)break;{const e={stack:[],error:void 0,hasError:!1};try{w*=.9,o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,w*G,C,c.at(0),c.at(1),this.m_curveType),n.setCoords(c.at(0).val,c.at(1).val);const i=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,null,null,i,this.m_curveType);const r=i.val+.5*Math.PI;o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,r,d.at(0),d.at(1)),x.setCoords(d.at(0).val,d.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}let T=w*G;T>1e5&&(T=1e5),this.m_segmentStep=T}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}setConvergenceOffset(){let e;e=this.m_absDistance>5e4?100:this.m_absDistance>1e4?10:1,this.m_absDistance/e<500&&(e=this.m_absDistance/500),e<.01&&(e=.01),this.m_convergenceOffset=e}}function g(e,t,s,n,m,c,l){if(e.isEmpty())return new a.a({vd:e.getDescription()});let _=e;if((0,i.m)(_)){const e=10*t.getTolerance(0);_=(new f.O).execute(_,0,e,0,l,12e3)}const g=new d(l);g.m_sr=t,g.m_gcs=t.getGCS(),g.m_transform=(0,o.g)(t,g.m_gcs,null);const p=(0,o.F)();g.m_gcs.querySpheroidData(p);const P=new r.Envelope2D;_.queryEnvelope(P),g.m_a=p.majorSemiAxis,g.m_eSquared=p.e2,g.m_rpu=g.m_gcs.getUnit().getUnitToBaseFactor(),g.m_gcs90=.5*Math.PI/g.m_rpu,g.m_gcs180=Math.PI/g.m_rpu,g.m_gcs360=2*Math.PI/g.m_rpu,g.m_gcs60=g.m_gcs360/6,g.m_q90=o.ai.q90(g.m_a,g.m_eSquared),g.m_ellipticToGeodesicMaxRatio=.5*g.m_a*Math.PI/g.m_q90;const x=g.m_gcs.getTolerance(0);g.m_radTolerance=x*g.m_rpu,4===s?(g.m_curveType=2,g.m_bShapePreserving=!0):(g.m_curveType=s,g.m_bShapePreserving=!1),g.m_distance=n,g.m_absDistance=Math.abs(n),Number.isNaN(m)||m<=0?g.setConvergenceOffset():g.m_convergenceOffset=Math.max(m,.001),g.m_convergenceOffset/=c;let b,y=_.getGeometryType();if((0,i.f)(y)){const e=new a.P({vd:_.getDescription()});e.addSegment(_,!0),b=e,y=i.G.enumPolyline}else if(y===i.G.enumEnvelope){const e=_,t=new r.Envelope2D;e.queryEnvelope(t);const s=(0,h.e)((0,h.c)(g.m_sr,P,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new h.P({vd:_.getDescription()});e.getCenter(t),b=t,y=i.G.enumPoint}else{const t=new a.P({vd:_.getDescription()});t.addEnvelope(e,!1),b=t,y=i.G.enumPolyline}else{const t=new a.a({vd:_.getDescription()});t.addEnvelope(e,!1),b=t,y=i.G.enumPolygon}}else b=_;if(g.setMinCornerStep(),(0,i.e)(y)||g.setMinSegmentStep(),g.m_absDistance<=.5*g.m_convergenceOffset)return y!==i.G.enumPolygon?new a.a({vd:b.getDescription()}):g.m_bShapePreserving?b:(0,o.ak)(b,g.m_sr,g.m_curveType,g.m_segmentStep,-1,l);if(g.m_distance<0&&y!==i.G.enumPolygon)return new a.a({vd:b.getDescription()});if(g.m_bShapePreserving&&(0,i.h)(y)){const e=(0,o.ak)(b,t,4,Number.NaN,g.m_convergenceOffset,l);b=(new o.O).execute(e,g.m_transform,l)}else b=(new o.O).execute(b,g.m_transform,l);if(b=(0,o.af)(b,g.m_gcs),b.isEmpty())return new a.a({vd:b.getDescription()});!g.m_bShapePreserving&&(0,i.h)(y)&&(b=(0,o.an)(g.m_rpu,b)),b=function(e,t){const s=e.getGeometryType();let n;if(n=(0,i.h)(s)?e.getPathCount():s===i.G.enumMultiPoint?e.getPointCount():1,1===n)return e;const o=[],m=[];for(let a=0;a<n;a++){o.push(a);const n=new u.P;if((0,i.h)(s)){const t=new r.Envelope2D;e.queryPathEnvelope(a,t),n.assign(t.getCenter())}else n.assign(e.getXY(a));const h=t.toGeohash(n);m.push(h)}o.sort((e,t)=>m[e]<m[t]?-1:m[e]>m[t]?1:0);const a=e.createInstance();for(let t=0;t<n;t++){const n=o[t];(0,i.h)(s)?a.addPath(e,n,!0):a.addPoints(e,n,n+1)}return a}(b,g.m_gcs);let S=new a.a;switch(y){case i.G.enumPolygon:S=g.bufferPolygon(b);break;case i.G.enumPolyline:S=g.bufferPolyline(b);break;case i.G.enumMultiPoint:S=g.bufferMultiPoint(b);break;case i.G.enumPoint:S=g.bufferPoint(b);break;default:(0,i.n)("")}const w=(new o.O).execute(S,g.m_transform.getInverse(),l);return w.mergeVertexDescription(b.getDescription()),w}function p(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const d=new u.P;d.setNAN(),c||_.getPointCount()>0&&(d.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),d.scale(s));const g=(0,m.mS)(f,new o.a7,!1),p=(0,m.mS)(f,new u.S(new o.a7,new o.a7),!1),P=new u.P,x=new u.P,y=r.at(-1),S=1/s;for(let s=0;s<r.length;s++){const m=r[s];let u;0===s?u=a:s===r.length-1?u=h:(o.a8.geodeticDistance(e,t,y.x,y.y,m.x,m.y,null,null,g,i),u=g.val-.5*Math.PI),o.a8.geodesicCoordinate(e,t,m.x,m.y,n,u,p.at(0),p.at(1)),c?x.setCoords(p.at(0).val,p.at(1).val):(P.setCoords(p.at(0).val,p.at(1).val),l=b(m.x,P.x,d.x,l),x.setCoords(l+P.x,P.y),d.setCoordsPoint2D(x)),x.scale(S),_.insertPoint2D(0,-1,x)}return l}catch(e){f.error=e,f.hasError=!0}finally{(0,m.hk)(f)}}function P(e,t,s,n,i,r,a,h,c,l,_,f=Number.NaN,d=Number.NaN){const g={stack:[],error:void 0,hasError:!1};try{if(a-r<h)return l;const p=(0,m.mS)(g,new u.S(new o.a7,new o.a7),!1),P=new u.P,x=new u.P,y=new u.P;x.setNAN(),c||_.getPointCount()>0&&(x.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),x.scale(s));let S=Math.ceil(r/h),w=S++*h;w===r&&(w=S++*h);let C=r;const v=1/s;for(;w<a+h&&(C<f&&f<w?(w=f,S--):C<d&&d<w&&(w=d,S--),!(w>=a));)o.a8.geodesicCoordinate(e,t,i.x,i.y,n,w,p.at(0),p.at(1)),c?y.setCoords(p.at(0).val,p.at(1).val):(P.setCoords(p.at(0).val,p.at(1).val),l=b(i.x,P.x,x.x,l),y.setCoords(l+P.x,P.y),x.setCoordsPoint2D(y)),y.scale(v),_.insertPoint2D(0,-1,y),C=w,w=S++*h;return l}catch(e){g.error=e,g.hasError=!0}finally{(0,m.hk)(g)}}function x(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const s=new u.P,d=new u.P,g=(0,m.mS)(f,new u.S(new o.a7,new o.a7),!1);o.a8.geodesicCoordinate(e,t,i.x,i.y,n,r,g.at(0),g.at(1)),s.setCoords(g.at(0).val,g.at(1).val),o.a8.geodesicCoordinate(e,t,i.x,i.y,n,a,g.at(0),g.at(1)),d.setCoords(g.at(0).val,g.at(1).val);const p=(0,m.mS)(f,new o.a7,!1);for(o.a8.geodeticDistance(e,t,h.x,h.y,s.x,s.y,null,p,null,0),l[0]=p.val,o.a8.geodeticDistance(e,t,h.x,h.y,d.x,d.y,null,p,null,0),_[0]=p.val;l[0]<=_[0];)l[0]+=u.p;for(;l[0]>_[0];)l[0]-=u.p;for(;l[0]>=c;)l[0]-=u.p,_[0]-=u.p;for(;l[0]<c;)l[0]+=u.p,_[0]+=u.p}catch(e){f.error=e,f.hasError=!0}finally{(0,m.hk)(f)}}function b(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=u.p;for(;e-(n+t)>Math.PI;)n+=u.p;return n}return n+t-s>Math.PI?n-=u.p:s-(n+t)>Math.PI&&(n+=u.p),n}function y(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=s[0],c=s.at(-1),u=(0,m.mS)(a,new o.a7,!1),l=(0,m.mS)(a,new o.a7,!1),_=(0,m.mS)(a,new o.a7,!1);o.a8.greatEllipticDistance(e,t,i.x,i.y,h.x,h.y,u,null,null),o.a8.greatEllipticDistance(e,t,i.x,i.y,c.x,c.y,l,null,null),o.a8.greatEllipticDistance(e,t,h.x,h.y,c.x,c.y,_,null,null);let f=Math.min(u.val,l.val)+_.val,d=f+n;if(d<r)return!0;const g=(0,m.mS)(a,new o.a7,!1);f=Math.max(u.val,l.val);for(let n=1;n<s.length-1;n++){const r=s[n];o.a8.greatEllipticDistance(e,t,i.x,i.y,r.x,r.y,g,null,null),g.val>f&&(f=g.val)}return d=f+n,d<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.hk)(a)}}function S(e,t,s,n,i,r,m,a){let h;if(n.length%2==0){const e=n.length>>1,t=n[e],s=n[e-1];h=u.P.lerp(t,s,.5)}else h=n[n.length-1>>1].clone();const c=h.clone(),l=(0,o.at)(e,t,c,75/180*Math.PI);return!!y(e,t,n,i,c,l)&&(null!==r&&(r.setCoordsPoint2D(h),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(c),null!==a&&(a[0]=l),!0)}function w(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=(0,m.mS)(a,new o.a7,!1);return o.a8.greatEllipticDistance(e,t,i.x,i.y,s.x,s.y,h,null,null),h.val+n<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.hk)(a)}}function C(e,t){return new o.ay(e,t)}function v(e){return(0,h.h)(e,0)||(0,h.s)(e,0),e}class D{constructor(e){this.m_bRunningInGnomonic=!1,this.m_bNeedsSimplify=!1,this.m_gnomonic=null,this.m_gnomonicCenterRad=new u.P,this.m_minGnomonicRadius=Number.NaN,this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class I extends D{constructor(e,t,s){super(e.m_progressTracker),this.m_segIter=null,this.m_bNextSegmentCannotJoin=!1,this.m_currentDensifiedDelta=[0],this.m_currentBufferedDelta=0,this.m_lastAzimuth=0,this.m_startAzimuth=[0],this.m_endAzimuth=[0],this.m_numWinds=0,this.m_debugCounter=0,this.m_bufferHelper=new a.a,this.m_densifiedPoints=[],this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new r.Envelope2D;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),m=i.clone();m.scale(this.m_bufferer.m_rpu),this.m_gnomonic=C(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=m.clone(),this.m_minGnomonicRadius=(0,o.at)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,m,75/180*Math.PI)}next(){let e;if(this.m_bNextSegmentCannotJoin)return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e;if(null===this.m_segIter){if(this.m_segIter=this.m_multiPath.getImpl().querySegmentIterator(),!this.m_segIter.nextPath())return null;null!==this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}if(!this.m_segIter.hasNextSegment()){if(!this.m_segIter.nextPath())return null;null!=this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}let t=null;this.m_currentBufferedDelta=0,this.m_currentDensifiedDelta=[0],this.m_numWinds=0,this.m_lastAzimuth=Number.NaN,this.m_bNextSegmentCannotJoin=!1,this.m_densifiedPoints.length=0;let s=0;const n=new u.P,i=new u.P;for(;this.m_segIter.hasNextSegment()&&this.m_numWinds<16;){const e=this.m_segIter.nextSegment();if(n.setCoordsPoint2D(e.getStartXY()),i.setCoordsPoint2D(e.getEndXY()),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),(0,o.au)(n,i))n.x=i.x;else if((0,o.av)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.av)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.au)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0;const r=(0,o.aw)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,n,i,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta);if(0===s)this.m_bRunningInGnomonic=this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(this.m_densifiedPoints));else if(this.m_bRunningInGnomonic){if(!this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}else if(S(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_densifiedPoints,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,null,null,null)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}if(0===r||(0,o.ax)(n,i)?(this.m_bufferHelper.setEmpty(),this.m_bufferer.bufferPoint2D(n,this.m_bRunningInGnomonic,this.m_bufferHelper),this.m_bNextSegmentCannotJoin=!0):(this.m_bufferHelper.setEmpty(),this.m_bNextSegmentCannotJoin=this.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(r,this.m_bufferHelper)),this.m_bNextSegmentCannotJoin){this.m_segIter.previousSegment(),this.m_segIter.hasPreviousSegment()?(this.m_segIter.previousSegment(),this.m_segIter.nextSegment()):this.m_segIter.resetToFirstSegment(),null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0);break}null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0),null===t&&(t=new a.a,t.addPathPoint2D(null,0,!0)),this.addJoinAndBufferLeftSide(t),s++}if(this.m_currentDensifiedDelta=[0],s>0){const e=this.m_segIter.getStartPointIndex(),r=this.m_segIter.getPathIndex();for(;s>0;){if(this.m_segIter.previousSegment(),n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getEndPointIndex())),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic)if((0,o.au)(n,i))n.x=i.x;else if((0,o.av)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.av)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.au)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0,(0,o.aw)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,i,n,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta),this.addJoinAndBufferLeftSide(t),s--}return n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),n.scale(this.m_bufferer.m_rpu),this.m_currentBufferedDelta=P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,n,this.m_lastAzimuth+.5*Math.PI,this.m_lastAzimuth+1.5*Math.PI,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,t),this.m_segIter.resetToVertex(e,r),this.m_segIter.nextSegment(),t}return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e}isSegmentBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&y(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return S(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=C(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t){return this.m_bufferer.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(this.m_densifiedPoints,e,this.m_startAzimuth[0],this.m_endAzimuth[0],this.m_bRunningInGnomonic,t)}addJoinAndBufferLeftSide(e){const t=this.m_densifiedPoints[0];let s=Number.NaN,n=this.m_startAzimuth[0]-u.o;const i=this.m_endAzimuth[0]+u.o;let r=!1;if(!Number.isNaN(this.m_lastAzimuth)){this.m_lastAzimuth>=this.m_startAzimuth[0]?(s=this.m_lastAzimuth+u.o,n=s+Math.PI-(this.m_lastAzimuth-this.m_startAzimuth[0])):(s=this.m_lastAzimuth+u.o,n=s+Math.PI-(u.p-(this.m_startAzimuth[0]-this.m_lastAzimuth))),r=!(this.m_lastAzimuth>=this.m_startAzimuth[0]&&this.m_lastAzimuth-this.m_startAzimuth[0]<=Math.PI||this.m_lastAzimuth<this.m_startAzimuth[0]&&this.m_startAzimuth[0]-this.m_lastAzimuth>=Math.PI);let i=!1;if(Math.abs(n-s)<=.5*this.m_bufferer.m_cornerStep&&(r||(i=!0)),i){if(e.removePointFromPath(0,e.getPointCount()-1),!this.m_bRunningInGnomonic){const t=new u.P;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=u.p:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=u.p)}n=.5*(n+s)}else if(r){const s=new u.P;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_densifiedPoints[0],s,n,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e)}this.m_startAzimuth[0]!==this.m_lastAzimuth&&this.m_numWinds++,p(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_bufferer.m_curveType,this.m_densifiedPoints,n,i,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e),this.m_lastAzimuth=this.m_endAzimuth[0]}}class G extends D{constructor(e,t){super(e.m_progressTracker),this.m_pointIndex=-1,this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new r.Envelope2D;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=C(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=(0,o.at)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,i,75/180*Math.PI)}next(){if(this.m_bNeedsSimplify=!1,++this.m_pointIndex===this.m_multiPoint.getPointCount())return null;const e=this.m_multiPoint.getXY(this.m_pointIndex);e.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic=this.isPointBufferInCurrentGnomonic(e),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(e));const t=new a.a,s=this.m_bufferer.bufferPoint2D(e,this.m_bRunningInGnomonic,t);return this.m_bNeedsSimplify=s,t}isPointBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&w(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return function(e,t,s,n,i,r,m,a){const h=(0,o.at)(e,t,n,75/180*Math.PI);return!!w(e,t,n,i,n,h)&&(null!==r&&(r.setCoordsPoint2D(n),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(n),null!==a&&(a[0]=h),!0)}(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=C(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}}class T{getOperatorType(){return 10110}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n,i,r,m,a){if(m){const m=new k(e,t,s,n,i,!1,r,a);return(new o.W).executeMany(m,t,a)}return new k(e,t,s,n,i,!1,r,a)}execute(e,t,s,r,o,m,a){const h=new n.S([e]),c=[r],u=this.executeMany(h,t,s,c,o,!1,m,a).next();return u||(0,i.d)("geodesic buffer null output"),u}}class k extends n.G{constructor(e,t,s,n,o,m,a,h){super(),this.m_currentUnionEnvelope2D=new r.Envelope2D,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=h,m&&(0,i.t)(""),t||(0,i.a)(""),0===t.getCoordinateSystemType()&&(0,i.a)(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=s,this.m_distances=n,this.m_convergenceOffset=o,this.m_bOutlineOnly=m,this.m_bUnion=a}next(){let e;for(;e=this.m_inputGeoms.next();)return(0,i.c)(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.geodesicBuffer(e,this.m_distances[this.m_dindex]);return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodesicBuffer(e,t){return function(e,t,s,n,r,o){n<Number.MAX_VALUE&&n>-Number.MAX_VALUE||(0,i.a)("Geodesic_bufferer.buffer - bad distance"),(0,i.c)(e);const m=(0,_.c)(e),a=m.getGeometryType();if((0,i.i)(a)){const e=m.getPointCount(),h=8e6;if(Math.abs(n)>h&&(e>50||a!==i.G.enumMultiPoint&&4===s&&e>2)){let e=m;const i=n>0?1:-1,a=7e6;let c=n,u=1;do{u++,c=(Math.abs(c)-a)*i}while(Math.abs(c)>h);c=n;for(let n=0;n<u-1;n++)e=g(e,t,s,a*i,r,u,o),c=(Math.abs(c)-a)*i;return e=g(e,t,s,c,r,u,o),e}}return g(m,t,s,n,r,1,o)}(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7444],{1364:(e,t,s)=>{s.d(t,{c:()=>i});var n=s(55537);function i(e,t){const s=e.getGeometryType();return s===n.G.enumPoint?e:(0,n.h)(s)?function(e){if(function(e){for(let t=0,s=e.getPathCount();t<s;t++){const s=e.getPathSize(t);if(0===s)return!1;if(1===s){if(0===e.getSegmentCountPath(t))return!1;if(e.getSegmentType(e.getPathStart(t))===n.G.enumLine)return!1;if(!e.isClosedPath(t))return!1}}return!0}(e))return e;const t=e.createInstance();for(let s=0,i=e.getPathCount();s<i;s++){const i=e.getPathSize(s);if(0!==i){if(1===i){if(0===e.getSegmentCountPath(s))continue;if(e.getSegmentType(e.getPathStart(s))===n.G.enumLine)continue;if(!e.isClosedPath(s))continue}t.addPath(e,s,!0)}}return t}(e):s===n.G.enumMultiPoint||s===n.G.enumEnvelope?e:s===n.G.enumMultipatch?((0,n.t)("not implemented for multipatch"),e):e}},37444:(e,t,s)=>{s.r(t),s.d(t,{OperatorGeodesicBuffer:()=>T});var n=s(76061),i=s(55537),r=s(79187),o=s(39117),m=s(31635),a=s(88885),h=s(95213),c=s(11878),u=s(83661),l=s(31139),_=s(1364),f=s(5247);class d{constructor(e){this.m_sr=null,this.m_gcs=null,this.m_transform=null,this.m_a=0,this.m_eSquared=0,this.m_rpu=0,this.m_radTolerance=0,this.m_q90=0,this.m_gcs90=0,this.m_gcs180=0,this.m_gcs360=0,this.m_gcs60=0,this.m_ellipticToGeodesicMaxRatio=0,this.m_curveType=0,this.m_bShapePreserving=!1,this.m_distance=0,this.m_absDistance=0,this.m_convergenceOffset=0,this.m_cornerStep=0,this.m_segmentStep=0,this.m_progressTracker=e}bufferPolygon(e){const t=new a.a,s=new I(this,e,t);return this.processGnomonicBufferPiecesCursor(!0,s)}bufferPolyline(e){const t=new I(this,e,null);return this.processGnomonicBufferPiecesCursor(!0,t)}bufferMultiPoint(e){const t=new G(this,e);return this.processGnomonicBufferPiecesCursor(!1,t)}bufferPoint(e){const t=e.getXY();t.scale(this.m_rpu);let s=new a.a;if(this.bufferPoint2D(t,!1,s)){const e=(0,h.b)(null,s,!0);s=(0,o.a3)(s,e,!0,!0,-1,this.m_progressTracker,0,!1)}return s=(new o.O).foldInto360RangeGeodetic(s,this.m_gcs,2),s}processGnomonicBufferPiecesCursor(e,t){const s=t;let n=s.getGnomonic();const i=(0,o.r)((0,o.ao)());let m=new o.ap,a=(new o.W).executeMany(m,i,this.m_progressTracker,2);const l=(0,u.d)(6,!1),_=(0,u.m)(r.Envelope2D,6);this.initializeGrid(l,_);const f=[null,null,null,null,null,null],d=[null,null,null,null,null,null],g=[null,null,null,null,null,null];let p,P,x;for(;null!==(p=s.next());){if(P=s.getGnomonic(),P!==n){if(null!==n){let t=a.next();if(m=null,a=null,null!=t){const s=(0,h.b)(i,t,!0),r=(0,h.e)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}}null!==P&&(m=new o.ap,a=(new o.W).executeMany(m,i,this.m_progressTracker,2)),n=P}if(s.isRunningInGnomonic()){if(P.project(p),s.needsSimplify()){const e=(0,h.b)(null,p,!0);p=(0,o.a3)(p,e,!0,!0,-1,this.m_progressTracker,0,!1)}m.tick(v(p)),a.tock()}else this.putInGridCursors(e,p,i,!0,l,_,f,d,g)}let b=!1;for(let e=0;e<6;e++)if(null!=g[e]){b=!0;break}if(b){let t=!1;const r=[null,null,null,null,null,null];if(e){const n=s.m_densified;if(s.m_densified=null,null!==n){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),n.applyTransformation(s),this.m_distance>0?this.putInGridCursors(e,n,i,!1,l,_,f,d,g):(this.processInGrid(e,n,!1,l,_,f,r),t=!0)}}const u=new o.ap,p=(new o.W).executeMany(u,this.m_gcs,this.m_progressTracker,2);if(null!==a){let t=a.next();m=null,a=null;const s=(0,h.b)(i,t,!0),r=(0,h.e)(s);t=n.unproject(t,r,this.m_progressTracker),this.putInGridCursors(e,t,i,!0,l,_,f,d,g)}for(let e=0;e<6;e++)if(null!=g[e]){let s=g[e].next();g[e]=null,d[e]=null,t&&null!==r[e]&&(s=(new o.V).execute(r[e],s,i,this.m_progressTracker));const n=(0,h.b)(i,s,!0),m=(0,h.e)(n);s=f[e].unproject(s,m,this.m_progressTracker),s=(new o.L).execute(s,this.m_gcs,!0,this.m_progressTracker),u.tick(v(s)),p.tock()}x=p.next()}else{let t,r=!1;if(e){let e=s.m_densified;if(s.m_densified=null,null!==e){const s=new c.T;s.scale(1/this.m_rpu,1/this.m_rpu),e.applyTransformation(s),P.project(e);const n=(0,h.b)(null,e,!0);e=(0,o.a3)(e,n,!1,!0,-1,this.m_progressTracker,0,!1),this.m_distance>0?(m.tick(v(e)),a.tock()):(t=e,r=!0)}}let u=a.next();m=null,a=null,r&&(u=(new o.V).execute(t,u,i,this.m_progressTracker));const l=(0,h.b)(i,u,!0),_=(0,h.e)(l);x=n.unproject(u,_,this.m_progressTracker),x=(new o.L).execute(x,this.m_gcs,!0,this.m_progressTracker)}return x=(new o.O).foldInto360RangeGeodetic(x,this.m_gcs,2),x}putInGridCursors(e,t,s,n,i,r,m,a,h){const c=[null,null,null,null,null,null];this.processInGrid(e,t,n,i,r,m,c);for(let e=0;e<6;e++)null!==c[e]&&(null===a[e]&&(a[e]=new o.ap,h[e]=(new o.W).executeMany(a[e],s,this.m_progressTracker,2)),a[e].tick(v(c[e])),h[e].tock())}processInGrid(e,t,s,n,i,r,m){const a=.01,c=this.insertGeodeticPointsAlongGrid(t,i,a);for(let e=0;e<6;e++){if(n[e])continue;const _=i[e].clone();_.inflateCoords(a,a);const f=(0,h.f)(t,_),d=(0,h.c)(null,f,!1).total();let g=(0,l.c)(c,_,d,Number.NaN,this.m_progressTracker);if(null!==g&&!g.isEmpty()){if(g===c&&(g=g.clone()),null===r[e]){const t=new u.P;e<3?t.setCoords(0,1):t.setCoords(0,-1);const s=new u.P;s.setAdd(i[e].getCenter(),t),r[e]=C(this.m_gcs,s)}r[e].project(g);const t=(0,h.b)(null,g,!0);g=(0,o.a3)(g,t,s,!0,-1,this.m_progressTracker,0,!1),m[e]=g}}}insertGeodeticPointsAlongGrid(e,t,s){const n=r.Envelope2D.construct(t[3].xmin,t[3].ymin,t[2].xmax,t[2].ymax),i=(0,o.aq)(this.m_gcs,n,e,!0,this.m_progressTracker),m=new a.E,h=m.addGeometry(i);return(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[0].xmax+s),(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[1].xmax+s),(0,o.ar)(m,h,this.m_gcs,0,2,!1,t[1].ymin+s),0!==s&&((0,o.ar)(m,h,this.m_gcs,0,2,!0,t[0].xmax-s),(0,o.ar)(m,h,this.m_gcs,0,2,!0,t[1].xmax-s),(0,o.ar)(m,h,this.m_gcs,0,2,!1,t[1].ymin-s)),m.getGeometry(h)}initializeGrid(e,t){for(let t=0;t<6;t++)e[t]=!1;t[0].setCoords({xmin:-this.m_gcs180,ymin:0,xmax:-this.m_gcs60,ymax:this.m_gcs90}),t[1].setCoords({xmin:-this.m_gcs60,ymin:0,xmax:this.m_gcs60,ymax:this.m_gcs90}),t[2].setCoords({xmin:this.m_gcs60,ymin:0,xmax:this.m_gcs180,ymax:this.m_gcs90}),t[3].setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:-this.m_gcs60,ymax:0}),t[4].setCoords({xmin:-this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs60,ymax:0}),t[5].setCoords({xmin:this.m_gcs60,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:0})}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t,s,n,i,r){const m=e[0],a=e.at(-1),h=m.y<a.y?m.y:a.y,c=m.y>a.y?m.y:a.y,l=o.ai.q(this.m_a,this.m_eSquared,h),_=o.ai.q(this.m_a,this.m_eSquared,c);if(this.m_q90-(l+t+this.m_absDistance)>.001&&this.m_q90+(_-t-this.m_absDistance)>.001)return!1;const f=s-u.o,d=n+u.o,g=f-Math.PI,b=f+Math.PI,y=d+Math.PI,S=[Number.NaN],w=[Number.NaN],C=[Number.NaN],v=[Number.NaN];let D=!1;if(x(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,f,g,a,d,S,w),x(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,y,d,m,g,C,v),(d<S[0]&&S[0]<y||d<w[0]&&w[0]<y)&&(D=!0),D||(g<C[0]&&C[0]<f||g<v[0]&&v[0]<f)&&(D=!0),!D&&i)return!1;const I=[];for(let t=e.length-1;t>=0;t--)I.push(e[t]);r.setEmpty(),r.addPathPoint2D(null,0,!0);let G=0;G=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,e,f,d,i,G,r),G=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,a,d,y,this.m_cornerStep,i,G,r,S[0],w[0]),G=p(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,this.m_curveType,I,y,b,i,G,r),G=P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,m,g,f,this.m_cornerStep,i,G,r,C[0],v[0]);let T=!1;return i||(T=this.checkAndPrepForPole(r)),D||T}bufferPoint2D(e,t,s){s.setEmpty(),s.addPathPoint2D(null,0,!0),P(this.m_a,this.m_eSquared,this.m_rpu,this.m_absDistance,e,-this.m_cornerStep,2*Math.PI,this.m_cornerStep,t,0,s);let n=!1;return t||(n=this.checkAndPrepForPole(s)),n}checkAndPrepForPole(e){const t=this.checkAndPrepForPoleTouch(e),s=this.checkAndPrepForPoleWrap(e);return t||s}checkAndPrepForPoleTouch(e){const t=new r.Envelope2D;return e.queryEnvelope(t),!(!(0,o.as)(t.ymax,this.m_gcs90)&&!(0,o.as)(t.ymin,-this.m_gcs90)||(this.prepPoleTouch(e),0))}checkAndPrepForPoleWrap(e){const t=e.getXY(0),s=e.getXY(e.getPointCount()-1);return Math.abs(t.x-s.x)>this.m_gcs180?(this.prepSinglePoleWrap(e),!0):this.checkAndPrepForDoublePoleWrap(e)}checkAndPrepForDoublePoleWrap(e){return e.calculateArea2D()<0&&(this.prepDoublePoleWrap(e),!0)}prepPoleTouch(e){const t=new a.a;t.insertPath2D(-1,null,0,0,!0);const s=e.getPathStart(0),n=e.getPathEnd(0),i=n-s;let r=-1;for(r=s;r<n;r++){const t=e.getXY(r),s=(0,o.as)(t.y,this.m_gcs90),n=(0,o.as)(t.y,-this.m_gcs90);if(!s&&!n)break}let m=r,h=!1,c=Number.NaN;do{const n=e.getXY(m),r=(0,o.as)(n.y,this.m_gcs90),a=(0,o.as)(n.y,-this.m_gcs90),l=s+(m+1-s)%i;if(r||a){let s=u.P.construct(c,n.y);t.insertPoint2D(0,-1,s);const i=e.getXY(l),r=(0,o.as)(i.y,this.m_gcs90),m=(0,o.as)(i.y,-this.m_gcs90);r||m||(s=u.P.construct(i.x,n.y),h?t.setXY(t.getPointCount()-1,s):t.insertPoint2D(0,-1,s)),h=!0}else t.insertPoint2D(0,-1,n),c=n.x,h=!1;m=l}while(m!==r);e.setEmpty(),e.add(t,!1)}prepSinglePoleWrap(e){const t=new a.a,s=new a.a,n=new c.T,i=e.getXY(e.getPathStart(0)),m=e.getXY(e.getPathEnd(0)-1),_=this.m_gcs360,f=this.m_gcs180,d=new r.Envelope2D;d.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const g=new r.Envelope2D;e.queryEnvelope(g);const p=Math.ceil(g.width()/_);let P,x;i.x>m.x?(P=-_,x=this.m_gcs90):(P=_,x=-this.m_gcs90),n.setShiftCoords(P,0),t.addPath(e,0,!0),s.add(t,!1);const b=new h.P;for(let e=0;e<p;e++)s.applyTransformation(n),s.getPointByVal(0,b),t.lineToPoint(b),t.addSegmentsFromPath(s,0,0,s.getSegmentCount()-1,!1);const y=t.getXY(0),S=t.getXY(t.getPointCount()-1);y.y=x,S.y=x,t.lineTo(S);const w=new u.P;for(w.setCoordsPoint2D(S),w.x-=.5*P;Math.abs(w.x-y.x)>f;)t.lineTo(w),w.x-=.5*P;t.lineTo(y);const C=d.getCenterX(),v=new r.Envelope2D;t.queryEnvelope(v);let D=0;const I=v.getCenter().x;I-C>f?D=-Math.ceil((I-C-f)/_):C-I>f&&(D=Math.ceil((C-I-f)/_)),0!==D&&(n.setShiftCoords(D*_,0),t.applyTransformation(n));const G=new a.E,T=G.addGeometry(t);(0,o.ar)(G,T,this.m_gcs,0,2,!0,d.xmin),(0,o.ar)(G,T,this.m_gcs,0,2,!0,d.xmax);const k=G.getGeometry(T),M=(0,h.f)(k,d);M.inflateCoords(0,1);const E=(0,h.c)(null,M,!0).total(),N=(0,l.c)(k,d,E,Number.NaN,this.m_progressTracker);e.setEmpty(),e.add(N,!1)}prepDoublePoleWrap(e){const t=this.m_gcs360,s=this.m_gcs180,n=new r.Envelope2D;n.setCoords({xmin:-this.m_gcs180,ymin:-this.m_gcs90,xmax:this.m_gcs180,ymax:this.m_gcs90});const i=n.getCenter().x,m=new r.Envelope2D;e.queryPathEnvelope(0,m);let _,f=0,d=m.getCenter().x;if(d-i>s?f=-Math.ceil((d-i-s)/t):i-d>s&&(f=Math.ceil((i-d-s)/t)),0!==f){const s=new c.T;s.setShiftCoords(f*t,0),e.getImpl().applyTransformationToPath(s,0),e.queryPathEnvelope(0,m),d=m.getCenter().x}const g=new r.Envelope2D;n.containsExclusiveEnvelope(m)?(_=!1,g.setCoords({env2D:n})):(_=!0,g.setCoords({env2D:n}),g.xmin-=t,g.xmax+=t);let p=e.createInstance();p.addPathPoint2D(null,0,!0);const P=new u.P;if(P.setCoords(g.xmin,g.ymin),p.insertPoint2D(0,-1,P),P.setCoords(g.xmin,g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(.5*(g.xmin+g.xmax),g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(g.xmax,g.ymax),p.insertPoint2D(0,-1,P),P.setCoords(g.xmax,g.ymin),p.insertPoint2D(0,-1,P),P.setCoords(.5*(g.xmin+g.xmax),g.ymin),p.insertPoint2D(0,-1,P),_){p.addPath(e,0,!0);const s=new c.T;d<i?s.setShiftCoords(t,0):s.setShiftCoords(-t,0),e.getImpl().applyTransformationToPath(s,0),p.addPath(e,0,!0);const r=new a.E,m=r.addGeometry(p);(0,o.ar)(r,m,this.m_gcs,0,2,!0,n.xmin),(0,o.ar)(r,m,this.m_gcs,0,2,!0,n.xmax),p=r.getGeometry(m);const u=(0,h.f)(p,n);u.inflateCoords(0,1);const _=(0,h.c)(null,u,!0).total();p=(0,l.c)(p,n,_,Number.NaN,this.m_progressTracker)}else p.addPath(e,0,!0);e.setEmpty(),e.add(p,!1)}setMinCornerStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P;s.setCoords(0,10*this.m_rpu);const n=0;let i=45*this.m_rpu;const r=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),a=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),h=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),c=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),l=new u.P,_=new u.P,f=new u.P,d=new u.P;for(o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,n,r.at(0),r.at(1)),l.setCoords(r.at(0).val,r.at(1).val),o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const r=.5*(n+i);o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,r,h.at(0),h.at(1)),f.setCoords(h.at(0).val,h.at(1).val);const u=(0,m.mS)(e,new o.a7,!1),g=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,l.x,l.y,_.x,_.y,u,g,null,2),o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,l.x,l.y,.5*u.val,g.val,c.at(0),c.at(1),2),d.setCoords(c.at(0).val,c.at(1).val);const p=(0,m.mS)(e,new o.a7,!1);if(o.a8.geodeticDistance(this.m_a,this.m_eSquared,f.x,f.y,d.x,d.y,p,null,null,2),p.val<=this.m_convergenceOffset)break;i*=.9,o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,i,a.at(0),a.at(1)),_.setCoords(a.at(0).val,a.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}const g=i-n,p=2*Math.PI/Math.ceil(2*Math.PI/g);this.m_cornerStep=p}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}setMinSegmentStep(){const e={stack:[],error:void 0,hasError:!1};try{let t=Math.min(Math.PI*this.m_a-this.m_absDistance,this.m_absDistance);t=Math.min(t,.125*this.m_a*Math.PI);const s=new u.P,n=new u.P;s.setCoords(0,10*this.m_rpu),n.setCoords(10*this.m_rpu,10*this.m_rpu);const i=(0,m.mS)(e,new o.a7,!1),r=(0,m.mS)(e,new o.a7,!1),a=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,a,i,r,this.m_curveType);const h=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),c=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),l=new u.P,_=(0,m.mS)(e,new o.a7,!1),f=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),d=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),g=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),p=(0,m.mS)(e,new u.S(new o.a7,new o.a7),!1),P=new u.P,x=new u.P,b=new u.P,y=new u.P,S=0;let w=1;const C=i.val,v=r.val,D=C-.5*Math.PI,I=v+.5*Math.PI,G=a.val;for(o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,s.x,s.y,t,D,f.at(0),f.at(1)),P.setCoords(f.at(0).val,f.at(1).val),o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,I,d.at(0),d.at(1)),x.setCoords(d.at(0).val,d.at(1).val);;){const e={stack:[],error:void 0,hasError:!1};try{const i=.5*(S+w);o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,i*G,C,h.at(0),h.at(1),this.m_curveType),l.setCoords(h.at(0).val,h.at(1).val),o.a8.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,l.x,l.y,null,null,_,this.m_curveType);const r=_.val+.5*Math.PI;o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,l.x,l.y,t,r,g.at(0),g.at(1)),b.setCoords(g.at(0).val,g.at(1).val);const a=(0,m.mS)(e,new o.a7,!1),u=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,P.x,P.y,x.x,x.y,a,u,null,2),o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,P.x,P.y,.5*a.val,u.val,p.at(0),p.at(1),2),y.setCoords(p.at(0).val,p.at(1).val);const f=(0,m.mS)(e,new o.a7,!1);if(o.a8.geodeticDistance(this.m_a,this.m_eSquared,b.x,b.y,y.x,y.y,f,null,null,2),f.val<=this.m_convergenceOffset)break;{const e={stack:[],error:void 0,hasError:!1};try{w*=.9,o.a8.geodeticCoordinate(this.m_a,this.m_eSquared,s.x,s.y,w*G,C,c.at(0),c.at(1),this.m_curveType),n.setCoords(c.at(0).val,c.at(1).val);const i=(0,m.mS)(e,new o.a7,!1);o.a8.geodeticDistance(this.m_a,this.m_eSquared,s.x,s.y,n.x,n.y,null,null,i,this.m_curveType);const r=i.val+.5*Math.PI;o.a8.geodesicCoordinate(this.m_a,this.m_eSquared,n.x,n.y,t,r,d.at(0),d.at(1)),x.setCoords(d.at(0).val,d.at(1).val)}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}let T=w*G;T>1e5&&(T=1e5),this.m_segmentStep=T}catch(t){e.error=t,e.hasError=!0}finally{(0,m.hk)(e)}}setConvergenceOffset(){let e;e=this.m_absDistance>5e4?100:this.m_absDistance>1e4?10:1,this.m_absDistance/e<500&&(e=this.m_absDistance/500),e<.01&&(e=.01),this.m_convergenceOffset=e}}function g(e,t,s,n,m,c,l){if(e.isEmpty())return new a.a({vd:e.getDescription()});let _=e;if((0,i.m)(_)){const e=10*t.getTolerance(0);_=(new f.O).execute(_,0,e,0,l,12e3)}const g=new d(l);g.m_sr=t,g.m_gcs=t.getGCS(),g.m_transform=(0,o.g)(t,g.m_gcs,null);const p=(0,o.F)();g.m_gcs.querySpheroidData(p);const P=new r.Envelope2D;_.queryEnvelope(P),g.m_a=p.majorSemiAxis,g.m_eSquared=p.e2,g.m_rpu=g.m_gcs.getUnit().getUnitToBaseFactor(),g.m_gcs90=.5*Math.PI/g.m_rpu,g.m_gcs180=Math.PI/g.m_rpu,g.m_gcs360=2*Math.PI/g.m_rpu,g.m_gcs60=g.m_gcs360/6,g.m_q90=o.ai.q90(g.m_a,g.m_eSquared),g.m_ellipticToGeodesicMaxRatio=.5*g.m_a*Math.PI/g.m_q90;const x=g.m_gcs.getTolerance(0);g.m_radTolerance=x*g.m_rpu,4===s?(g.m_curveType=2,g.m_bShapePreserving=!0):(g.m_curveType=s,g.m_bShapePreserving=!1),g.m_distance=n,g.m_absDistance=Math.abs(n),Number.isNaN(m)||m<=0?g.setConvergenceOffset():g.m_convergenceOffset=Math.max(m,.001),g.m_convergenceOffset/=c;let b,y=_.getGeometryType();if((0,i.f)(y)){const e=new a.P({vd:_.getDescription()});e.addSegment(_,!0),b=e,y=i.G.enumPolyline}else if(y===i.G.enumEnvelope){const e=_,t=new r.Envelope2D;e.queryEnvelope(t);const s=(0,h.e)((0,h.c)(g.m_sr,P,!0));if(t.minDimension()<=s)if(0===t.maxDimension()){const t=new h.P({vd:_.getDescription()});e.getCenter(t),b=t,y=i.G.enumPoint}else{const t=new a.P({vd:_.getDescription()});t.addEnvelope(e,!1),b=t,y=i.G.enumPolyline}else{const t=new a.a({vd:_.getDescription()});t.addEnvelope(e,!1),b=t,y=i.G.enumPolygon}}else b=_;if(g.setMinCornerStep(),(0,i.e)(y)||g.setMinSegmentStep(),g.m_absDistance<=.5*g.m_convergenceOffset)return y!==i.G.enumPolygon?new a.a({vd:b.getDescription()}):g.m_bShapePreserving?b:(0,o.ak)(b,g.m_sr,g.m_curveType,g.m_segmentStep,-1,l);if(g.m_distance<0&&y!==i.G.enumPolygon)return new a.a({vd:b.getDescription()});if(g.m_bShapePreserving&&(0,i.h)(y)){const e=(0,o.ak)(b,t,4,Number.NaN,g.m_convergenceOffset,l);b=(new o.O).execute(e,g.m_transform,l)}else b=(new o.O).execute(b,g.m_transform,l);if(b=(0,o.af)(b,g.m_gcs),b.isEmpty())return new a.a({vd:b.getDescription()});!g.m_bShapePreserving&&(0,i.h)(y)&&(b=(0,o.an)(g.m_rpu,b)),b=function(e,t){const s=e.getGeometryType();let n;if(n=(0,i.h)(s)?e.getPathCount():s===i.G.enumMultiPoint?e.getPointCount():1,1===n)return e;const o=[],m=[];for(let a=0;a<n;a++){o.push(a);const n=new u.P;if((0,i.h)(s)){const t=new r.Envelope2D;e.queryPathEnvelope(a,t),n.assign(t.getCenter())}else n.assign(e.getXY(a));const h=t.toGeohash(n);m.push(h)}o.sort((e,t)=>m[e]<m[t]?-1:m[e]>m[t]?1:0);const a=e.createInstance();for(let t=0;t<n;t++){const n=o[t];(0,i.h)(s)?a.addPath(e,n,!0):a.addPoints(e,n,n+1)}return a}(b,g.m_gcs);let S=new a.a;switch(y){case i.G.enumPolygon:S=g.bufferPolygon(b);break;case i.G.enumPolyline:S=g.bufferPolyline(b);break;case i.G.enumMultiPoint:S=g.bufferMultiPoint(b);break;case i.G.enumPoint:S=g.bufferPoint(b);break;default:(0,i.n)("")}const w=(new o.O).execute(S,g.m_transform.getInverse(),l);return w.mergeVertexDescription(b.getDescription()),w}function p(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const d=new u.P;d.setNAN(),c||_.getPointCount()>0&&(d.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),d.scale(s));const g=(0,m.mS)(f,new o.a7,!1),p=(0,m.mS)(f,new u.S(new o.a7,new o.a7),!1),P=new u.P,x=new u.P,y=r.at(-1),S=1/s;for(let s=0;s<r.length;s++){const m=r[s];let u;0===s?u=a:s===r.length-1?u=h:(o.a8.geodeticDistance(e,t,y.x,y.y,m.x,m.y,null,null,g,i),u=g.val-.5*Math.PI),o.a8.geodesicCoordinate(e,t,m.x,m.y,n,u,p.at(0),p.at(1)),c?x.setCoords(p.at(0).val,p.at(1).val):(P.setCoords(p.at(0).val,p.at(1).val),l=b(m.x,P.x,d.x,l),x.setCoords(l+P.x,P.y),d.setCoordsPoint2D(x)),x.scale(S),_.insertPoint2D(0,-1,x)}return l}catch(e){f.error=e,f.hasError=!0}finally{(0,m.hk)(f)}}function P(e,t,s,n,i,r,a,h,c,l,_,f=Number.NaN,d=Number.NaN){const g={stack:[],error:void 0,hasError:!1};try{if(a-r<h)return l;const p=(0,m.mS)(g,new u.S(new o.a7,new o.a7),!1),P=new u.P,x=new u.P,y=new u.P;x.setNAN(),c||_.getPointCount()>0&&(x.setCoordsPoint2D(_.getXY(_.getPointCount()-1)),x.scale(s));let S=Math.ceil(r/h),w=S++*h;w===r&&(w=S++*h);let C=r;const v=1/s;for(;w<a+h&&(C<f&&f<w?(w=f,S--):C<d&&d<w&&(w=d,S--),!(w>=a));)o.a8.geodesicCoordinate(e,t,i.x,i.y,n,w,p.at(0),p.at(1)),c?y.setCoords(p.at(0).val,p.at(1).val):(P.setCoords(p.at(0).val,p.at(1).val),l=b(i.x,P.x,x.x,l),y.setCoords(l+P.x,P.y),x.setCoordsPoint2D(y)),y.scale(v),_.insertPoint2D(0,-1,y),C=w,w=S++*h;return l}catch(e){g.error=e,g.hasError=!0}finally{(0,m.hk)(g)}}function x(e,t,s,n,i,r,a,h,c,l,_){const f={stack:[],error:void 0,hasError:!1};try{const s=new u.P,d=new u.P,g=(0,m.mS)(f,new u.S(new o.a7,new o.a7),!1);o.a8.geodesicCoordinate(e,t,i.x,i.y,n,r,g.at(0),g.at(1)),s.setCoords(g.at(0).val,g.at(1).val),o.a8.geodesicCoordinate(e,t,i.x,i.y,n,a,g.at(0),g.at(1)),d.setCoords(g.at(0).val,g.at(1).val);const p=(0,m.mS)(f,new o.a7,!1);for(o.a8.geodeticDistance(e,t,h.x,h.y,s.x,s.y,null,p,null,0),l[0]=p.val,o.a8.geodeticDistance(e,t,h.x,h.y,d.x,d.y,null,p,null,0),_[0]=p.val;l[0]<=_[0];)l[0]+=u.p;for(;l[0]>_[0];)l[0]-=u.p;for(;l[0]>=c;)l[0]-=u.p,_[0]-=u.p;for(;l[0]<c;)l[0]+=u.p,_[0]+=u.p}catch(e){f.error=e,f.hasError=!0}finally{(0,m.hk)(f)}}function b(e,t,s,n){if(Number.isNaN(s)){for(;n+t-e>Math.PI;)n-=u.p;for(;e-(n+t)>Math.PI;)n+=u.p;return n}return n+t-s>Math.PI?n-=u.p:s-(n+t)>Math.PI&&(n+=u.p),n}function y(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=s[0],c=s.at(-1),u=(0,m.mS)(a,new o.a7,!1),l=(0,m.mS)(a,new o.a7,!1),_=(0,m.mS)(a,new o.a7,!1);o.a8.greatEllipticDistance(e,t,i.x,i.y,h.x,h.y,u,null,null),o.a8.greatEllipticDistance(e,t,i.x,i.y,c.x,c.y,l,null,null),o.a8.greatEllipticDistance(e,t,h.x,h.y,c.x,c.y,_,null,null);let f=Math.min(u.val,l.val)+_.val,d=f+n;if(d<r)return!0;const g=(0,m.mS)(a,new o.a7,!1);f=Math.max(u.val,l.val);for(let n=1;n<s.length-1;n++){const r=s[n];o.a8.greatEllipticDistance(e,t,i.x,i.y,r.x,r.y,g,null,null),g.val>f&&(f=g.val)}return d=f+n,d<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.hk)(a)}}function S(e,t,s,n,i,r,m,a){let h;if(n.length%2==0){const e=n.length>>1,t=n[e],s=n[e-1];h=u.P.lerp(t,s,.5)}else h=n[n.length-1>>1].clone();const c=h.clone(),l=(0,o.at)(e,t,c,75/180*Math.PI);return!!y(e,t,n,i,c,l)&&(null!==r&&(r.setCoordsPoint2D(h),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(c),null!==a&&(a[0]=l),!0)}function w(e,t,s,n,i,r){const a={stack:[],error:void 0,hasError:!1};try{if(n>=r)return!1;const h=(0,m.mS)(a,new o.a7,!1);return o.a8.greatEllipticDistance(e,t,i.x,i.y,s.x,s.y,h,null,null),h.val+n<r}catch(e){a.error=e,a.hasError=!0}finally{(0,m.hk)(a)}}function C(e,t){return new o.ay(e,t)}function v(e){return(0,h.h)(e,0)||(0,h.s)(e,0),e}class D{constructor(e){this.m_bRunningInGnomonic=!1,this.m_bNeedsSimplify=!1,this.m_gnomonic=null,this.m_gnomonicCenterRad=new u.P,this.m_minGnomonicRadius=Number.NaN,this.m_progressTracker=e}isRunningInGnomonic(){return this.m_bRunningInGnomonic}needsSimplify(){return this.m_bNeedsSimplify}getGnomonic(){return this.m_gnomonic}}class I extends D{constructor(e,t,s){super(e.m_progressTracker),this.m_segIter=null,this.m_bNextSegmentCannotJoin=!1,this.m_currentDensifiedDelta=[0],this.m_currentBufferedDelta=0,this.m_lastAzimuth=0,this.m_startAzimuth=[0],this.m_endAzimuth=[0],this.m_numWinds=0,this.m_debugCounter=0,this.m_bufferHelper=new a.a,this.m_densifiedPoints=[],this.m_bufferer=e,this.m_multiPath=t,this.m_densified=s,this.m_bNeedsSimplify=!0;const n=new r.Envelope2D;this.m_multiPath.queryEnvelope(n);const i=n.getCenter(),m=i.clone();m.scale(this.m_bufferer.m_rpu),this.m_gnomonic=C(this.m_bufferer.m_gcs,i),this.m_gnomonicCenterRad=m.clone(),this.m_minGnomonicRadius=(0,o.at)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,m,75/180*Math.PI)}next(){let e;if(this.m_bNextSegmentCannotJoin)return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e;if(null===this.m_segIter){if(this.m_segIter=this.m_multiPath.getImpl().querySegmentIterator(),!this.m_segIter.nextPath())return null;null!==this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}if(!this.m_segIter.hasNextSegment()){if(!this.m_segIter.nextPath())return null;null!=this.m_densified&&this.m_densified.addPathPoint2D(null,0,!0)}let t=null;this.m_currentBufferedDelta=0,this.m_currentDensifiedDelta=[0],this.m_numWinds=0,this.m_lastAzimuth=Number.NaN,this.m_bNextSegmentCannotJoin=!1,this.m_densifiedPoints.length=0;let s=0;const n=new u.P,i=new u.P;for(;this.m_segIter.hasNextSegment()&&this.m_numWinds<16;){const e=this.m_segIter.nextSegment();if(n.setCoordsPoint2D(e.getStartXY()),i.setCoordsPoint2D(e.getEndXY()),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),(0,o.au)(n,i))n.x=i.x;else if((0,o.av)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.av)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.au)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0;const r=(0,o.aw)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,n,i,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta);if(0===s)this.m_bRunningInGnomonic=this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(this.m_densifiedPoints));else if(this.m_bRunningInGnomonic){if(!this.isSegmentBufferInCurrentGnomonic(this.m_densifiedPoints)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}}else if(S(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_densifiedPoints,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,null,null,null)){this.m_segIter.previousSegment(),this.m_segIter.previousSegment(),this.m_segIter.nextSegment();break}if(0===r||(0,o.ax)(n,i)?(this.m_bufferHelper.setEmpty(),this.m_bufferer.bufferPoint2D(n,this.m_bRunningInGnomonic,this.m_bufferHelper),this.m_bNextSegmentCannotJoin=!0):(this.m_bufferHelper.setEmpty(),this.m_bNextSegmentCannotJoin=this.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(r,this.m_bufferHelper)),this.m_bNextSegmentCannotJoin){this.m_segIter.previousSegment(),this.m_segIter.hasPreviousSegment()?(this.m_segIter.previousSegment(),this.m_segIter.nextSegment()):this.m_segIter.resetToFirstSegment(),null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0);break}null!=this.m_densified&&this.m_densified.insertPointsFromPoints(this.m_densified.getPathCount()-1,-1,this.m_densifiedPoints,0,this.m_densifiedPoints.length-1,!0),null===t&&(t=new a.a,t.addPathPoint2D(null,0,!0)),this.addJoinAndBufferLeftSide(t),s++}if(this.m_currentDensifiedDelta=[0],s>0){const e=this.m_segIter.getStartPointIndex(),r=this.m_segIter.getPathIndex();for(;s>0;){if(this.m_segIter.previousSegment(),n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),i.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getEndPointIndex())),n.scale(this.m_bufferer.m_rpu),i.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic)if((0,o.au)(n,i))n.x=i.x;else if((0,o.av)(n,i))i.x=n.x;else{let e=-1,t=-1;const s=this.m_segIter.getPathIndex(),r=this.m_multiPath.getPathStart(s),m=this.m_multiPath.getPathEnd(s);if(e=this.m_segIter.getStartPointIndex()-1,t=this.m_segIter.getEndPointIndex()+1,e<r&&(e=this.m_multiPath.isClosedPath(s)?m-1:-1),t>m-1&&(t=this.m_multiPath.isClosedPath(s)?r:-1),-1!==e){const t=this.m_multiPath.getXY(e);t.scale(this.m_bufferer.m_rpu),(0,o.av)(t,n)&&(n.x=t.x)}if(-1!==t){const e=this.m_multiPath.getXY(t);e.scale(this.m_bufferer.m_rpu),(0,o.au)(i,e)&&(i.x=e.x)}}this.m_densifiedPoints.length=0,(0,o.aw)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_curveType,i,n,this.m_bufferer.m_segmentStep,Number.NaN,this.m_bufferer.m_radTolerance,this.m_startAzimuth,this.m_endAzimuth,this.m_densifiedPoints,this.m_currentDensifiedDelta),this.addJoinAndBufferLeftSide(t),s--}return n.setCoordsPoint2D(this.m_multiPath.getXY(this.m_segIter.getStartPointIndex())),n.scale(this.m_bufferer.m_rpu),this.m_currentBufferedDelta=P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,n,this.m_lastAzimuth+.5*Math.PI,this.m_lastAzimuth+1.5*Math.PI,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,t),this.m_segIter.resetToVertex(e,r),this.m_segIter.nextSegment(),t}return this.m_bNextSegmentCannotJoin=!1,this.m_segIter.nextSegment(),e=this.m_bufferHelper.clone(),e}isSegmentBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&y(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return S(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=C(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(e,t){return this.m_bufferer.checkAndPrepSegmentForCrossingAzimuthsOrPoleWrap(this.m_densifiedPoints,e,this.m_startAzimuth[0],this.m_endAzimuth[0],this.m_bRunningInGnomonic,t)}addJoinAndBufferLeftSide(e){const t=this.m_densifiedPoints[0];let s=Number.NaN,n=this.m_startAzimuth[0]-u.o;const i=this.m_endAzimuth[0]+u.o;let r=!1;if(!Number.isNaN(this.m_lastAzimuth)){this.m_lastAzimuth>=this.m_startAzimuth[0]?(s=this.m_lastAzimuth+u.o,n=s+Math.PI-(this.m_lastAzimuth-this.m_startAzimuth[0])):(s=this.m_lastAzimuth+u.o,n=s+Math.PI-(u.p-(this.m_startAzimuth[0]-this.m_lastAzimuth))),r=!(this.m_lastAzimuth>=this.m_startAzimuth[0]&&this.m_lastAzimuth-this.m_startAzimuth[0]<=Math.PI||this.m_lastAzimuth<this.m_startAzimuth[0]&&this.m_startAzimuth[0]-this.m_lastAzimuth>=Math.PI);let i=!1;if(Math.abs(n-s)<=.5*this.m_bufferer.m_cornerStep&&(r||(i=!0)),i){if(e.removePointFromPath(0,e.getPointCount()-1),!this.m_bRunningInGnomonic){const t=new u.P;t.setCoordsPoint2D(e.getXY(e.getPointCount()-1)),t.scale(this.m_bufferer.m_rpu),t.x-this.m_currentBufferedDelta<-Math.PI?this.m_currentBufferedDelta-=u.p:t.x-this.m_currentBufferedDelta>Math.PI&&(this.m_currentBufferedDelta+=u.p)}n=.5*(n+s)}else if(r){const s=new u.P;s.setCoordsPoint2D(t),s.scale(1/this.m_bufferer.m_rpu),e.insertPoint2D(0,-1,s)}else P(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_densifiedPoints[0],s,n,this.m_bufferer.m_cornerStep,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e)}this.m_startAzimuth[0]!==this.m_lastAzimuth&&this.m_numWinds++,p(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,this.m_bufferer.m_absDistance,this.m_bufferer.m_curveType,this.m_densifiedPoints,n,i,this.m_bRunningInGnomonic,this.m_currentBufferedDelta,e),this.m_lastAzimuth=this.m_endAzimuth[0]}}class G extends D{constructor(e,t){super(e.m_progressTracker),this.m_pointIndex=-1,this.m_bufferer=e,this.m_multiPoint=t,this.m_bNeedsSimplify=!1;const s=new r.Envelope2D;this.m_multiPoint.queryEnvelope(s);const n=s.getCenter(),i=n.clone();i.scale(this.m_bufferer.m_rpu),this.m_gnomonic=C(this.m_bufferer.m_gcs,n),this.m_gnomonicCenterRad=i.clone(),this.m_minGnomonicRadius=(0,o.at)(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,i,75/180*Math.PI)}next(){if(this.m_bNeedsSimplify=!1,++this.m_pointIndex===this.m_multiPoint.getPointCount())return null;const e=this.m_multiPoint.getXY(this.m_pointIndex);e.scale(this.m_bufferer.m_rpu),this.m_bRunningInGnomonic=this.isPointBufferInCurrentGnomonic(e),this.m_bRunningInGnomonic||(this.m_bRunningInGnomonic=this.tryUpdateGnomonic(e));const t=new a.a,s=this.m_bufferer.bufferPoint2D(e,this.m_bRunningInGnomonic,t);return this.m_bNeedsSimplify=s,t}isPointBufferInCurrentGnomonic(e){return null!==this.m_gnomonic&&w(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,this.m_gnomonicCenterRad,this.m_minGnomonicRadius)}tryUpdateGnomonic(e){const t=new u.P,s=new u.P,n=[0];return function(e,t,s,n,i,r,m,a){const h=(0,o.at)(e,t,n,75/180*Math.PI);return!!w(e,t,n,i,n,h)&&(null!==r&&(r.setCoordsPoint2D(n),r.scale(1/s)),null!==m&&m.setCoordsPoint2D(n),null!==a&&(a[0]=h),!0)}(this.m_bufferer.m_a,this.m_bufferer.m_eSquared,this.m_bufferer.m_rpu,e,this.m_bufferer.m_absDistance*this.m_bufferer.m_ellipticToGeodesicMaxRatio,t,s,n)?(this.m_gnomonicCenterRad.setCoordsPoint2D(s),this.m_minGnomonicRadius=n[0],this.m_gnomonic=C(this.m_bufferer.m_gcs,t),!0):(this.m_gnomonic=null,!1)}}class T{getOperatorType(){return 10110}supportsCurves(){return!0}accelerateGeometry(e,t,s){return!1}canAccelerateGeometry(e){return!1}executeMany(e,t,s,n,i,r,m,a){if(m){const m=new k(e,t,s,n,i,!1,r,a);return(new o.W).executeMany(m,t,a)}return new k(e,t,s,n,i,!1,r,a)}execute(e,t,s,r,o,m,a){const h=new n.S([e]),c=[r],u=this.executeMany(h,t,s,c,o,!1,m,a).next();return u||(0,i.d)("geodesic buffer null output"),u}}class k extends n.G{constructor(e,t,s,n,o,m,a,h){super(),this.m_currentUnionEnvelope2D=new r.Envelope2D,this.m_index=-1,this.m_dindex=-1,this.m_progressTracker=h,m&&(0,i.t)(""),t||(0,i.a)(""),0===t.getCoordinateSystemType()&&(0,i.a)(""),this.m_inputGeoms=e,this.m_spatialReference=t,this.m_curveType=s,this.m_distances=n,this.m_convergenceOffset=o,this.m_bOutlineOnly=m,this.m_bUnion=a}next(){let e;for(;e=this.m_inputGeoms.next();)return(0,i.c)(e),this.m_index=this.m_inputGeoms.getGeometryID(),this.m_dindex+1<this.m_distances.length&&this.m_dindex++,this.geodesicBuffer(e,this.m_distances[this.m_dindex]);return null}getGeometryID(){return this.m_index}tock(){return!0}getRank(){return 1}geodesicBuffer(e,t){return function(e,t,s,n,r,o){n<Number.MAX_VALUE&&n>-Number.MAX_VALUE||(0,i.a)("Geodesic_bufferer.buffer - bad distance"),(0,i.c)(e);const m=(0,_.c)(e),a=m.getGeometryType();if((0,i.i)(a)){const e=m.getPointCount(),h=8e6;if(Math.abs(n)>h&&(e>50||a!==i.G.enumMultiPoint&&4===s&&e>2)){let e=m;const i=n>0?1:-1,a=7e6;let c=n,u=1;do{u++,c=(Math.abs(c)-a)*i}while(Math.abs(c)>h);c=n;for(let n=0;n<u-1;n++)e=g(e,t,s,a*i,r,u,o),c=(Math.abs(c)-a)*i;return e=g(e,t,s,c,r,u,o),e}}return g(m,t,s,n,r,1,o)}(e,this.m_spatialReference,this.m_curveType,t,this.m_convergenceOffset,this.m_progressTracker)}}}}]);