@arcgis/core 4.34.0-next.75 → 4.34.0-next.76

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 (117) hide show
  1. package/applications/Components/arcadeEditorUtils.d.ts +4 -0
  2. package/applications/Components/arcadeEditorUtils.js +5 -0
  3. package/applications/Components/featureUtils.d.ts +1 -0
  4. package/applications/Components/featureUtils.js +1 -1
  5. package/arcade/Feature.js +1 -1
  6. package/arcade/Pixel.js +1 -1
  7. package/arcade/Voxel.js +1 -1
  8. package/arcade/arcadeAsyncRuntime.js +1 -1
  9. package/arcade/arcadeCompiler.js +1 -1
  10. package/arcade/arcadeRuntime.js +1 -1
  11. package/arcade/featureset/support/FeatureSetIterator.js +1 -1
  12. package/arcade/functions/feature.js +1 -1
  13. package/arcade/functions/featuresetbase.js +1 -1
  14. package/arcade/functions/geometry.js +1 -1
  15. package/assets/esri/core/workers/RemoteClient.js +1 -1
  16. package/assets/esri/core/workers/chunks/13de06e614adf92239fe.js +1 -0
  17. package/assets/esri/core/workers/chunks/14a22d1a0eefa970efa1.js +1 -0
  18. package/assets/esri/core/workers/chunks/16d66770ef841564ee3f.js +1 -0
  19. package/assets/esri/core/workers/chunks/17103e6542aae53c7301.js +1 -0
  20. package/assets/esri/core/workers/chunks/{5c30252c1bb8350cae5f.js → 1c52999a6392370844a6.js} +1 -1
  21. package/assets/esri/core/workers/chunks/21bfad7283620766d9cd.js +1 -0
  22. package/assets/esri/core/workers/chunks/3064320d54a9b48bd697.js +1 -0
  23. package/assets/esri/core/workers/chunks/3a5f0c759dd2f4638343.js +1 -0
  24. package/assets/esri/core/workers/chunks/4832faefd3b7edc17c84.js +1 -0
  25. package/assets/esri/core/workers/chunks/4d47187bc0821413492d.js +1 -0
  26. package/assets/esri/core/workers/chunks/5102c20645d9708c34b4.js +1 -0
  27. package/assets/esri/core/workers/chunks/58cc06ed86301f4cee75.js +1 -0
  28. package/assets/esri/core/workers/chunks/{e12e8d69c05c182b6a69.js → 61bb39597ccf89f99a72.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{a25b75de1bca1dd21941.js → 70367da4ba916376f40c.js} +1 -1
  30. package/assets/esri/core/workers/chunks/7b73a808922b52755abd.js +1 -0
  31. package/assets/esri/core/workers/chunks/a0edff37fd4a3f2cb2eb.js +1 -0
  32. package/assets/esri/core/workers/chunks/a9f6054d86982b9e5a7c.js +1 -0
  33. package/assets/esri/core/workers/chunks/{10ec10ca361842efce92.js → ab005fe84952f0676020.js} +1 -1
  34. package/assets/esri/core/workers/chunks/b70d71144a060f7eeeeb.js +1 -0
  35. package/assets/esri/core/workers/chunks/b8d02f1b73c374767a5f.js +1 -0
  36. package/assets/esri/core/workers/chunks/ba6452acee3d6defb37e.js +1 -0
  37. package/assets/esri/core/workers/chunks/bfbbf180c2c8fdbb6731.js +1 -0
  38. package/assets/esri/core/workers/chunks/{356c96fad88558be9054.js → c6fecf2bbd2a711f15d3.js} +1 -1
  39. package/assets/esri/core/workers/chunks/c86f5bb199cf046b8952.js +1 -0
  40. package/assets/esri/core/workers/chunks/{b5f197e24982f6e14468.js → d1f181f91b36351f1d3b.js} +2 -2
  41. package/assets/esri/core/workers/chunks/{8e428b0f33ef4688415e.js → d95554f43694b4769675.js} +1 -1
  42. package/assets/esri/core/workers/chunks/dd587d51dad2d82708d1.js +1 -0
  43. package/assets/esri/core/workers/chunks/ecac5ca00c742bfb5898.js +1 -0
  44. package/assets/esri/core/workers/chunks/{0d946a226b846b3c0849.js → fc06014fb484fc8c697e.js} +1 -1
  45. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  46. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  47. package/chunks/Compositing.glsl.js +4 -3
  48. package/chunks/cameraUtilsSpherical.js +1 -1
  49. package/chunks/lyr3DMain.js +1 -1
  50. package/chunks/lyr3DWorker.js +1 -1
  51. package/config.js +1 -1
  52. package/core/sql.d.ts +1 -0
  53. package/geometry/support/heightModelInfoUtils.js +1 -1
  54. package/geometry/support/normalizeUtils.js +1 -1
  55. package/geometry/support/spatialReferenceUtils.js +1 -1
  56. package/interfaces.d.ts +45 -0
  57. package/kernel.js +1 -1
  58. package/layers/GaussianSplatLayer.js +1 -1
  59. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  60. package/layers/Lyr3DWorkerHandle.js +1 -1
  61. package/layers/support/tiles3DUtils.js +1 -1
  62. package/networks/CircuitManager.js +1 -1
  63. package/networks/support/Circuit.js +1 -1
  64. package/networks/support/CircuitSection.js +1 -1
  65. package/networks/support/Subcircuit.js +1 -1
  66. package/package.json +1 -1
  67. package/support/arcadeUtils.js +1 -1
  68. package/support/modeUtils.js +1 -1
  69. package/support/revision.js +1 -1
  70. package/views/2d/layers/MediaLayerView2D.js +1 -1
  71. package/views/2d/layers/TileLayerView2D.js +1 -1
  72. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  73. package/views/3d/layers/Lyr3DWorker.js +1 -1
  74. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  75. package/views/3d/support/cameraUtils.js +1 -1
  76. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  77. package/{layers/support/GaussianSplatAtlasPageAllocator.js → views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js} +1 -1
  78. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +5 -0
  79. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +5 -0
  80. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +5 -0
  81. package/views/3d/support/gaussianSplatting/GaussianTile.js +5 -0
  82. package/views/3d/terrain/OverlayManager.js +1 -1
  83. package/views/3d/terrain/TerrainSurface.js +1 -1
  84. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +12 -13
  85. package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
  86. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  87. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  88. package/views/3d/webgl-engine/lib/edgeRendering/strokes.js +1 -1
  89. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  90. package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
  91. package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
  92. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +10 -11
  93. package/views/VideoView.js +1 -1
  94. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  95. package/widgets/support/widget.js +1 -1
  96. package/assets/esri/core/workers/chunks/06bd58c219678315cf5c.js +0 -1
  97. package/assets/esri/core/workers/chunks/0751f539db31bdb5caec.js +0 -1
  98. package/assets/esri/core/workers/chunks/19228ab0fe7944c554e5.js +0 -1
  99. package/assets/esri/core/workers/chunks/2a19a4d7d1c580121065.js +0 -1
  100. package/assets/esri/core/workers/chunks/37ff19a9c5c99bd4e7c7.js +0 -1
  101. package/assets/esri/core/workers/chunks/3d2629357242492afcfa.js +0 -1
  102. package/assets/esri/core/workers/chunks/5c4ba165816809e06340.js +0 -1
  103. package/assets/esri/core/workers/chunks/5f239972cb95afdfa77a.js +0 -1
  104. package/assets/esri/core/workers/chunks/6963ded8428cc8d51d85.js +0 -1
  105. package/assets/esri/core/workers/chunks/6c3ae96c6ef764fb9552.js +0 -1
  106. package/assets/esri/core/workers/chunks/76ec3d2646ba64e3442f.js +0 -1
  107. package/assets/esri/core/workers/chunks/925ad2665c2fe0f47cc3.js +0 -1
  108. package/assets/esri/core/workers/chunks/93b2e0a300b2758a1ca4.js +0 -1
  109. package/assets/esri/core/workers/chunks/b03dcbc31bccb9fdf9fe.js +0 -1
  110. package/assets/esri/core/workers/chunks/b0de01f8c9b1c3182e0c.js +0 -1
  111. package/assets/esri/core/workers/chunks/c7ba8f2aca0fbd6ceded.js +0 -1
  112. package/assets/esri/core/workers/chunks/c908184d747d33366881.js +0 -1
  113. package/assets/esri/core/workers/chunks/d1711256493d55eca523.js +0 -1
  114. package/assets/esri/core/workers/chunks/e6e4e2fb9568319c6207.js +0 -1
  115. package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +0 -1
  116. package/assets/esri/core/workers/chunks/f060a52a9b69eb250d63.js +0 -1
  117. package/layers/support/gaussianSplatUtils.js +0 -5
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[979,7136],{4146:(e,t,r)=>{r.d(t,{A:()=>b});var i=r(31635),o=r(78888),s=r(49186),n=r(65529),a=r(4902),l=r(92474),u=r(53966),p=r(74887),c=r(84952),d=r(10107),y=(r(44208),r(87811),r(40608)),m=r(5443),h=r(16930),f=r(92602),g=r(79677);let v=0,b=class extends((0,n.Zt)((0,a.sA)(l.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new m.A(-180,-90,180,90,h.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=h.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",o=r?.portal?.url||f.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+i+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,p.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):"groundLayers"in e&&e.groundLayers.includes(t)?e.groundLayers.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 loaded(){return super.loaded}get parsedUrl(){return(0,c.An)(this.url)}createLayerView(e,t){return Promise.reject(new s.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,o.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,d.MZ)({type:String})],b.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,d.MZ)({readOnly:!0})],b.prototype,"effectiveVisible",null),(0,i.Cg)([(0,d.MZ)({type:m.A})],b.prototype,"fullExtent",void 0),(0,i.Cg)([(0,d.MZ)({readOnly:!0})],b.prototype,"hasAttributionData",null),(0,i.Cg)([(0,d.MZ)({type:String,clonable:!1})],b.prototype,"id",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,d.MZ)({type:["show","hide","hide-children"]})],b.prototype,"listMode",void 0),(0,i.Cg)([(0,d.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],b.prototype,"opacity",void 0),(0,i.Cg)([(0,d.MZ)({clonable:!1})],b.prototype,"parent",void 0),(0,i.Cg)([(0,d.MZ)({readOnly:!0})],b.prototype,"parsedUrl",null),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],b.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean})],b.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean})],b.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,d.MZ)({type:h.A})],b.prototype,"spatialReference",void 0),(0,i.Cg)([(0,d.MZ)({type:String})],b.prototype,"title",void 0),(0,i.Cg)([(0,d.MZ)({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),(0,i.Cg)([(0,d.MZ)()],b.prototype,"url",void 0),(0,i.Cg)([(0,d.MZ)({type:g.A})],b.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,nonNullable:!0})],b.prototype,"visible",void 0),b=(0,i.Cg)([(0,y.$)("esri.layers.Layer")],b)},4197:(e,t,r)=>{r.d(t,{Vj:()=>u,cj:()=>l,jh:()=>s,l5:()=>a,xm:()=>n});var i=r(34275),o=r(9093);function s(e){return e<=i.y9?new Array(e).fill(0):new Float64Array(e)}function n(e){return((0,i.iu)(e)?e.byteLength/8:e.length)<=i.y9?Array.from(e):new Float64Array(e)}function a(e,t,r){return Array.isArray(e)?e.slice(t,t+r):e.subarray(t,t+r)}function l(e){return[...e]}function u(e){const t=(0,o.vt)();for(let r=0;r<16;++r)t[r]=e[r];return t}},6797:(e,t,r)=>{r.d(t,{Mj:()=>d,Ui:()=>m,w2:()=>y});var i=r(65008),o=r(7762),s=r(88620);const n=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function a(e){return e instanceof i.A}function l(e){return e instanceof o.A?Object.keys(e.items):a(e)?(0,s.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof o.A?e.items[t]:e[t]}function p(e){return e?e.declaredClass:null}function c(e,t){const r=e.diff;if(r&&"function"==typeof r)return r(e,t);const i=l(e),o=l(t);if(0===i.length&&0===o.length)return;if(!i.length||!o.length||function(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}(e,t))return{type:"complete",oldValue:e,newValue:t};const s=o.filter(e=>!i.includes(e)),d=i.filter(e=>!o.includes(e)),y=i.filter(r=>o.includes(r)&&u(e,r)!==u(t,r)).concat(s,d).sort(),m=p(e);if(m&&n.has(m)&&y.length)return{type:"complete",oldValue:e,newValue:t};let h;const f=a(e)&&a(t);for(const i of y){const o=u(e,i),s=u(t,i);let n;if((f||"function"!=typeof o&&"function"!=typeof s)&&o!==s&&(null!=o||null!=s)){if(r&&r[i]&&"function"==typeof r[i])n=r[i]?.(o,s);else if(o instanceof Date&&s instanceof Date){if(o.getTime()===s.getTime())continue;n={type:"complete",oldValue:o,newValue:s}}else n="object"==typeof o&&"object"==typeof s&&p(o)===p(s)?c(o,s):{type:"complete",oldValue:o,newValue:s};null!=n&&(null!=h?h.diff[i]=n:h={type:"partial",diff:{[i]:n}})}}return h}function d(e,t){return function(e,t){if(null==e)return!1;const r=t.split(".");let i=e;for(const e of r){if("complete"===i.type)return!0;if("partial"!==i.type)return!1;{const t=i.diff[e];if(!t)return!1;i=t}}return!0}(e,t)}function y(e,t){if(!e)return!1;if("partial"===e.type){const r=Object.keys(e.diff);return 1===r.length&&r[0]===t}return!1}function m(e,t){if("function"!=typeof e&&"function"!=typeof t&&(null!=e||null!=t))return null==e||null==t||"object"==typeof e&&"object"==typeof t&&p(e)!==p(t)?{type:"complete",oldValue:e,newValue:t}:c(e,t)}},8303:(e,t,r)=>{r.d(t,{A:()=>T});var i=r(31635),o=r(92602),s=r(70333),n=r(78888),a=r(60999),l=r(49186),u=r(53966),p=r(97768),c=r(74887),d=r(84952),y=r(10107),m=(r(44208),r(87811),r(36005)),h=r(40608),f=r(43937),g=r(77548),v=r(20655),b=r(80812),w=r(41318),C=r(10407);const T=e=>{const t=e;let T=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,p.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 b.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,c.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,c.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,c.QP)(e),!0)))}async setUserPrivileges(e,t){if(!o.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:o}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",o)}catch(e){(0,c.QP)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const i=!s.id?.findCredential(this.url),o=e===r.id;if(o&&r.portal.user)return this._getUserPrivileges(r,i);let n,a;if(o)n=r.portal.url;else try{n=await(0,g.wI)(this.url,t)}catch(e){(0,c.QP)(e)}if(!n||!(0,d.b8)(n,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(s.id?.getCredential(`${n}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.QP)(e)}const l=!0,u=!1,p=!1;if(!a)return{features:{edit:l,fullEdit:u},content:{updateItem:p}};try{if(o?await r.reload():(r=new b.default({id:e,portal:{url:n}}),await r.load(t)),r.portal.user)return this._getUserPrivileges(r,i)}catch(e){(0,c.QP)(e)}return{features:{edit:l,fullEdit:u},content:{updateItem:p}}}_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,c.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const r=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.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=s.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,o=v.A.getDefault();if(o&&o.loaded&&(0,d.S8)(o.restUrl)===(0,d.S8)(i))return o.user;const l=`${i}/community/self`,u=null!=e?e.signal:null,p=await(0,a.Ke)((0,n.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:u}));return p.ok?w.A.fromJSON(p.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,d.ut)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.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,y.MZ)({type:b.default})],T.prototype,"portalItem",null),(0,i.Cg)([(0,m.w)("web-document","portalItem",["itemId"])],T.prototype,"readPortalItem",null),(0,i.Cg)([(0,f.K)("web-document","portalItem",{itemId:{type:String}})],T.prototype,"writePortalItem",null),(0,i.Cg)([(0,y.MZ)({clonable:!1})],T.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,y.MZ)({type:Boolean,readOnly:!0})],T.prototype,"userHasUpdateItemPrivileges",void 0),T=(0,i.Cg)([(0,h.$)("esri.layers.mixins.PortalLayer")],T),T},S={credential:null,user:null}},9093:(e,t,r)=>{function i(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}r.d(t,{o8:()=>o,vt:()=>i,zK:()=>s});const s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:s,clone:o,create:i,fromValues:function(e,t,r,i,o,s,n,a,l,u,p,c,d,y,m,h){return[e,t,r,i,o,s,n,a,l,u,p,c,d,y,m,h]}},Symbol.toStringTag,{value:"Module"}))},17136:(e,t,r)=>{r.d(t,{O7:()=>S,el:()=>T});var i=r(92602),o=r(49186),s=r(53966),n=r(39829),a=r(82799),l=r(80754),u=r(21325),p=r(28735),c=r(78888),d=r(65864),y=r(2272),m=r(84952),h=r(92300);const f=()=>s.A.getLogger("esri.geometry.support.normalizeUtils");function g(e){return"polygon"===e[0].type}function v(e){return"polyline"===e[0].type}function b(e,t,r){if(t){const t=function(e,t){if(!(e instanceof a.A||e instanceof n.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw f().error(e),new o.A("internal:geometry",e)}const r=(0,l.r8)(e),i=[];for(const e of r){const r=[];i.push(r),r.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const o=e[i][0],s=e[i][1],n=e[i+1][0],a=e[i+1][1],l=Math.sqrt((n-o)*(n-o)+(a-s)*(a-s)),u=(a-s)/l,p=(n-o)/l,c=l/t;if(c>1){for(let e=1;e<=c-1;e++){const i=e*t,n=p*i+o,a=u*i+s;r.push([n,a])}const e=(l+Math.floor(c-1)*t)/2,i=p*e+o,n=u*e+s;r.push([i,n])}r.push([n,a])}}return function(e){return"polygon"===e.type}(e)?new n.A({rings:i,spatialReference:e.spatialReference}):new a.A({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,p.ci)(t,!0)}return r&&(e=(0,l.kS)(e,r)),e}function w(e,t,r){if(Array.isArray(e)){const i=e[0];if(i>t){const r=(0,l.kd)(i,t);e[0]=i+r*(-2*t)}else if(i<r){const t=(0,l.kd)(i,r);e[0]=i+t*(-2*r)}}else{const i=e.x;if(i>t){const r=(0,l.kd)(i,t);e=e.clone().offset(r*(-2*t),0)}else if(i<r){const t=(0,l.kd)(i,r);e=e.clone().offset(t*(-2*r),0)}}return e}function C(e,t){let r=-1;for(let i=0;i<t.cutIndexes.length;i++){const o=t.cutIndexes[i],s=t.geometries[i],n=(0,l.r8)(s);for(let e=0;e<n.length;e++){const t=n[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const i=t[e][0];r=i>r?i:r}r=Number(r.toFixed(9));const i=-360*(0,l.kd)(r,180);for(let r=0;r<t.length;r++){const t=s.getPoint(e,r);s.setPoint(e,r,t.clone().offset(i,0))}return!0}})}if(o===r){if(g(e))for(const t of(0,l.r8)(s))e[o]=e[o].addRing(t);else if(v(e))for(const t of(0,l.r8)(s))e[o]=e[o].addPath(t)}else r=o,e[o]=s}return e}async function T(e,t,r){if(!Array.isArray(e))return T([e],t);t&&"string"!=typeof t&&f().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const o="string"==typeof t?t:t?.url??i.A.geometryServiceUrl;let s,g,v,S,M,A,O,N,I=0;const Z=[],D=[];for(const t of e)if(null!=t)if(s||(s=t.spatialReference,g=(0,u.Vp)(s),v=s.isWebMercator,A=v?102100:4326,S=l.j7[A].maxX,M=l.j7[A].minX,O=l.j7[A].plus180Line,N=l.j7[A].minus180Line),g)if("mesh"===t.type)D.push(t);else if("point"===t.type)D.push(w(t.clone(),S,M));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>w(e,S,M)),D.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,g);D.push(e.rings?new n.A(e):e)}else if(t.extent){const e=t.extent,r=(0,l.kd)(e.xmin,M)*(2*S);let i=0===r?t.clone():(0,l.kS)(t.clone(),r);e.offset(r,0);let{xmin:o,xmax:s}=e;o=Number(o.toFixed(9)),s=Number(s.toFixed(9)),e.intersects(O)&&s!==S?(I=s>I?s:I,i=b(i,v),Z.push(i),D.push("cut")):e.intersects(N)&&o!==M?(I=s*(2*S)>I?s*(2*S):I,i=b(i,v,360),Z.push(i),D.push("cut")):D.push(i)}else D.push(t.clone());else D.push(t);else D.push(t);let j=(0,l.kd)(I,S),F=-90;const _=j,x=new a.A;for(;j>0;){const e=360*j-180;x.addPath([[e,F],[e,-1*F]]),F*=-1,j--}if(Z.length>0&&_>0){const t=C(Z,await async function(e,t,r,i){const o=(0,y.Dl)(e),s=t[0].spatialReference,n={...i,responseType:"json",query:{...o.query,f:"json",sr:(0,u.YX)(s),target:JSON.stringify({geometryType:(0,d.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},a=await(0,c.A)(o.path+"/cut",n),{cutIndexes:l,geometries:p=[]}=a.data;return{cutIndexes:l,geometries:p.map(e=>{const t=(0,d.rS)(e);return t.spatialReference=s,t})}}(o,Z,x,r)),i=[],s=[];for(let r=0;r<D.length;r++){const o=D[r];if("cut"!==o)s.push(o);else{const o=t.shift(),n=e[r];null!=n&&"polygon"===n.type&&n.rings&&n.rings.length>1&&o.rings.length>=n.rings.length?(i.push(o),s.push("simplify")):s.push(v?(0,p.Gh)(o):o)}}if(!i.length)return s;const n=await async function(e,t,r){const i="string"==typeof e?(0,m.An)(e):e,o=t[0].spatialReference,s=(0,d.$B)(t[0]),n={...r,query:{...i.query,f:"json",sr:(0,u.YX)(o),geometries:JSON.stringify((0,h.X)(t))}},{data:a}=await(0,c.A)(i.path+"/simplify",n);return(0,h.V)(a.geometries,s,o)}(o,i,r),a=[];for(let e=0;e<s.length;e++){const t=s[e];"simplify"!==t?a.push(t):a.push(v?(0,p.Gh)(n.shift()):n.shift())}return a}const B=[];for(let e=0;e<D.length;e++){const t=D[e];if("cut"!==t)B.push(t);else{const e=Z.shift();B.push(!0===v?(0,p.Gh)(e):e)}}return B}function S(e,t,r){const i=(0,u.Vp)(r);if(null==i)return e;const[o,s]=i.valid,n=2*s;let a=0,l=0;t>s?a=Math.ceil(Math.abs(t-s)/n):t<o&&(a=-Math.ceil(Math.abs(t-o)/n)),e>s?l=Math.ceil(Math.abs(e-s)/n):e<o&&(l=-Math.ceil(Math.abs(e-o)/n));let p=e+(a-l)*n;const c=p-t;return c>s?p-=n:c<o&&(p+=n),p}},24097:(e,t,r)=>{r.d(t,{K:()=>i});const i={type:String,json:{read:{source:"token"},write:{target:"token"}}}},25036:(e,t,r)=>{r.d(t,{j:()=>n});var i=r(31635),o=r(10107),s=(r(44208),r(53966),r(87811),r(40608));const n=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,o.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"minScale",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],r.prototype,"maxScale",void 0),(0,i.Cg)([(0,o.MZ)({readOnly:!0})],r.prototype,"effectiveScaleRange",null),r=(0,i.Cg)([(0,s.$)("esri.layers.mixins.ScaleRangeLayer")],r),r}},46130:(e,t,r)=>{r.d(t,{v:()=>o});var i=r(76553);function o(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)})}},46140:(e,t,r)=>{r.d(t,{R:()=>o});var i=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,s]=t.split("."),n=/^\s*\d+\s*$/;if(!o?.match||!n.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!n.test(s))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const a=parseInt(o,10),l=parseInt(s,10);return new e(a,l,r)}}},54339:(e,t,r)=>{function i(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{const r=[];for(const i of t.fieldNames)r.push(e.attributes[i]??null);return JSON.stringify(r)}}}function o(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];const r=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(r)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}r.d(t,{W:()=>i,r:()=>o})},55674:(e,t,r)=>{r.d(t,{Ad:()=>y,Gj:()=>f,QY:()=>d,lL:()=>g,xR:()=>m});var i=r(66131),o=r(49186),s=(r(44208),r(44729)),n=r(15032),a=r(65864),l=r(95466),u=r(43668),p=r(98623);const c=["geometry","scale","timeProperties"];function d(e,t){if(null!=t)for(const r of c)t.hasArcadeDependency(r)&&e.add(r);return e}function y(e,t){return h.create(e,t,null,["$feature","$view"])}function m(e,t,r){return h.create(e,t,r,["$feature","$view","$config"])}class h{static async create(e,t,r,i){const{arcade:s,Dictionary:n}=await(0,u.l)();let a;try{a=s.parseScript(e)}catch(t){throw new o.A("arcade-bad-expression","Failed to parse arcade script",{script:e,error:t})}const l=s.scriptUsesGeometryEngine(a);l&&await s.enableGeometrySupport(),await s.loadDependentModules(new Set,a,null,!1,l);const p={vars:i.reduce((e,t)=>({...e,[t]:null}),{}),spatialReference:t,useAsync:!1},c=s.compileScript(a,p);let d=null;null!=r&&(d=new n(r),d.immutable=!0);const y=new n;return y.immutable=!1,y.setField("scale",0),new h(e,s,a,c,t,y,d,n)}constructor(e,t,r,i,o,s,n,a){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=o,this._viewDict=s,this._configDict=n,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new f,this._dependencies.set("geometry",t.scriptTouchesGeometry(this._syntaxTree)),this._dependencies.set("scale",this._arcade.referencesMember(this._syntaxTree,"scale")),this._dependencies.set("timeProperties",this._arcade.scriptUsesViewProperties(this._syntaxTree,["timeProperties"]))}evaluate(e,t){const r=t.$view?.timeZone;if(t.$view){let e;if(this._viewDict.setField("scale",t.$view.scale),null!=t.$view.timeProperties){const{currentStart:o,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=o?null!=r?i.lY.epochToArcadeDate(o,r):i.lY.unknownEpochToArcadeDate(o):void 0,currentEnd:null!=s?null!=r?i.lY.epochToArcadeDate(s,r):i.lY.unknownEpochToArcadeDate(s):void 0,startIncluded:!0,endIncluded:!0})}this._viewDict.setField("timeProperties",e)}return this._compiled({vars:{$view:this._viewDict,$config:this._configDict,$feature:e},spatialReference:this._spatialReference,timeZone:r})}repurposeFeature(e,t){return this._featureReader.bind(e,t,this._spatialReference),this._featureReader}references(e){return this._dependencies.get(e)??!1}}class f{constructor(){this._boundTarget=null,this._boundSchema={fields:null,fieldsIndex:null,spatialReference:null,get geometryType(){return null},get objectIdField(){return null}},this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}bind(e,t,r){const i=t??new l.A(g(e.attributes));this._boundTarget=e,this._boundSchema.fields=i.fields,this._boundSchema.fieldsIndex=i,this._boundSchema.spatialReference=r}_getField(e){return this._boundSchema.fieldsIndex.get(e)}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this._boundSchema.fieldsIndex.has(e)}geometry(){if("fromJSON"in this._boundTarget)return this._boundTarget.geometry;const e=(0,a.rS)(this._boundTarget.geometry);if(e){if(!this._boundSchema.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");e.spatialReference=this._boundSchema.spatialReference}return e}isUnknownDateTimeField(e){return this._boundSchema.fieldsIndex.getTimeZone(e)===p.L5}field(e,t=!0){const r=this._getField(e);if(r){const t=this._boundTarget.attributes[r.name];if(null==t)return null;switch(r.type){case"date-only":case"esriFieldTypeDateOnly":return s.n.fromReader(t);case"time-only":case"esriFieldTypeTimeOnly":return n.k.fromReader(t);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return i.lY.fromReaderAsTimeStampOffset(t);case"date":case"esriFieldTypeDate":return this.isUnknownDateTimeField(e)?i.lY.unknownEpochToArcadeDate(t):i.lY.epochToArcadeDate(t,this.contextTimeZone??p.qU);default:return t}}if(t)throw new Error(`Field ${e} does not exist`);return null}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this._boundSchema.fieldsIndex.fields.map(e=>e.name)}castToText(e=!1){return JSON.stringify(this._boundTarget)}gdbVersion(){return null}fullSchema(){return this._boundSchema}castAsJson(e=null){return{attributes:this._boundTarget.attributes,geometry:!0===e?.keepGeometryType?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}}function g(e){const t=[];for(const r in e)t.push({name:r,alias:r,type:"string"==typeof e[r]?"esriFieldTypeString":"esriFieldTypeDouble"});return t}},63074:(e,t,r)=>{r.d(t,{LF:()=>p,dM:()=>c,sU:()=>l});var i=r(31635),o=r(10107),s=(r(44208),r(53966),r(87811),r(40608)),n=r(89317),a=r(76369);const l={type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:{layerContainerTypes:n.K}},"portal-item":{read:!0,write:{layerContainerTypes:n.K}}}}},u={read:{reader:a.LF},write:{allowNull:!0,writer:a.M9,layerContainerTypes:n.K}},p={json:{read:!1,write:!1,origins:{"web-map":u,"portal-item":u}}},c=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return(0,i.Cg)([(0,o.MZ)(l)],r.prototype,"blendMode",void 0),(0,i.Cg)([(0,o.MZ)(p)],r.prototype,"effect",void 0),r=(0,i.Cg)([(0,s.$)("esri.layers.mixins.BlendLayer")],r),r}},64185:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Tt});var i=r(31635),o=r(92602),s=r(52106),n=r(37838),a=r(7762),l=r(49186),u=r(53966),p=r(92071),c=r(93637),d=r(74887),y=r(36708),m=r(83047),h=r(84952),f=r(10107),g=(r(44208),r(87811),r(36005)),v=r(40608),b=r(43937),w=r(46130),C=r(5443),T=r(48526),S=r(98988),M=r(16930),A=r(21325),O=r(4146),N=r(63074),I=r(16131),Z=r(8303),D=r(25036),j=r(60694),F=r(25482),_=r(53930),x=r(33910);let B=class extends F.o{constructor(e){super(e),this.break=new _.A({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new _.A({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new _.A({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new _.A({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new _.A({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new _.A({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};(0,i.Cg)([(0,f.MZ)({types:x.wC})],B.prototype,"break",void 0),(0,i.Cg)([(0,f.MZ)({types:x.wC})],B.prototype,"first",void 0),(0,i.Cg)([(0,f.MZ)({types:x.wC})],B.prototype,"unlocated",void 0),(0,i.Cg)([(0,f.MZ)({types:x.wC})],B.prototype,"last",void 0),(0,i.Cg)([(0,f.MZ)({types:x.wC})],B.prototype,"middle",void 0),(0,i.Cg)([(0,f.MZ)({types:x.wC})],B.prototype,"waypoint",void 0),B=(0,i.Cg)([(0,v.$)("esri.layers.support.RouteStopSymbols")],B);var E=r(94985),P=r(31593);let L=class extends F.o{constructor(e){super(e),this.directionLines=new P.A({color:[0,122,194],width:6}),this.directionPoints=new _.A({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new _.A({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new E.A({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new P.A({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new P.A({width:8,color:[20,89,127]}),this.stops=new B}};(0,i.Cg)([(0,f.MZ)({types:x.Y7})],L.prototype,"directionLines",void 0),(0,i.Cg)([(0,f.MZ)({types:x.wC})],L.prototype,"directionPoints",void 0),(0,i.Cg)([(0,f.MZ)({types:x.wC})],L.prototype,"pointBarriers",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Ac})],L.prototype,"polygonBarriers",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Y7})],L.prototype,"polylineBarriers",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Y7})],L.prototype,"routeInfo",void 0),(0,i.Cg)([(0,f.MZ)({type:B})],L.prototype,"stops",void 0),L=(0,i.Cg)([(0,v.$)("esri.layers.support.RouteSymbols")],L);var R=r(20655),J=r(80812),U=r(10407),k=r(65494),$=r(78888),V=r(2272),W=r(93223),q=r(2073);let G=class extends F.o{constructor(e){super(e),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};(0,i.Cg)([(0,f.MZ)({type:String})],G.prototype,"dataType",void 0),(0,i.Cg)([(0,W.e)(q.et,{ignoreUnknown:!1})],G.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({type:[String]})],G.prototype,"parameterNames",void 0),(0,i.Cg)([(0,f.MZ)({type:String})],G.prototype,"restrictionUsageParameterName",void 0),(0,i.Cg)([(0,W.e)(q.Mm,{ignoreUnknown:!1})],G.prototype,"timeNeutralAttributeName",void 0),(0,i.Cg)([(0,f.MZ)({type:String})],G.prototype,"trafficSupport",void 0),(0,i.Cg)([(0,W.e)(q.dn)],G.prototype,"units",void 0),(0,i.Cg)([(0,W.e)(q.WU)],G.prototype,"usageType",void 0),G=(0,i.Cg)([(0,v.$)("esri.rest.support.NetworkAttribute")],G);const z=G;let Y=class extends F.o{constructor(e){super(e),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};(0,i.Cg)([(0,f.MZ)({type:Number})],Y.prototype,"buildTime",void 0),(0,i.Cg)([(0,f.MZ)({type:String})],Y.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({type:[z]})],Y.prototype,"networkAttributes",void 0),(0,i.Cg)([(0,f.MZ)()],Y.prototype,"networkSources",void 0),(0,i.Cg)([(0,f.MZ)({type:String})],Y.prototype,"state",void 0),Y=(0,i.Cg)([(0,v.$)("esri.rest.support.NetworkDataset")],Y);const K=Y;var H=r(69540);let X=class extends((0,H.OU)(F.o)){constructor(e){super(e),this.attributeParameterValues=null,this.description=null,this.distanceAttributeName=null,this.id=null,this.impedanceAttributeName=null,this.name=null,this.restrictionAttributeNames=null,this.simplificationTolerance=null,this.simplificationToleranceUnits=null,this.timeAttributeName=null,this.type=null,this.useHierarchy=null,this.uturnAtJunctions=null}readId(e,t){return t.id??t.itemId??null}readRestrictionAttributes(e,t){const{restrictionAttributeNames:r}=t;return null==r?null:r.map(e=>q.OC.fromJSON(e))}writeRestrictionAttributes(e,t,r){null!=e&&(t[r]=e.map(e=>q.OC.toJSON(e)))}};(0,i.Cg)([(0,f.MZ)({type:[Object],json:{write:!0}})],X.prototype,"attributeParameterValues",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],X.prototype,"description",void 0),(0,i.Cg)([(0,W.e)(q.dd,{ignoreUnknown:!1})],X.prototype,"distanceAttributeName",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],X.prototype,"id",void 0),(0,i.Cg)([(0,g.w)("id",["id","itemId"])],X.prototype,"readId",null),(0,i.Cg)([(0,W.e)(q.et,{ignoreUnknown:!1})],X.prototype,"impedanceAttributeName",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],X.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({type:[String],json:{write:!0}})],X.prototype,"restrictionAttributeNames",void 0),(0,i.Cg)([(0,g.w)("restrictionAttributeNames")],X.prototype,"readRestrictionAttributes",null),(0,i.Cg)([(0,b.K)("restrictionAttributeNames")],X.prototype,"writeRestrictionAttributes",null),(0,i.Cg)([(0,f.MZ)({type:Number,json:{write:{allowNull:!0}}})],X.prototype,"simplificationTolerance",void 0),(0,i.Cg)([(0,W.e)(q.hY)],X.prototype,"simplificationToleranceUnits",void 0),(0,i.Cg)([(0,W.e)(q.Mm,{ignoreUnknown:!1})],X.prototype,"timeAttributeName",void 0),(0,i.Cg)([(0,W.e)(q.ow)],X.prototype,"type",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"useHierarchy",void 0),(0,i.Cg)([(0,W.e)(q.hE)],X.prototype,"uturnAtJunctions",void 0),X=(0,i.Cg)([(0,v.$)("esri.rest.support.TravelMode")],X);let Q=class extends F.o{constructor(e){super(e),this.accumulateAttributeNames=null,this.attributeParameterValues=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(e){return null==e?null:e.map(e=>q.et.fromJSON(e))}writeAccumulateAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>q.et.toJSON(e)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}readDefaultTravelMode(e,t){const r=t.supportedTravelModes?.find(({id:e})=>e===t.defaultTravelMode)??t.supportedTravelModes?.find(({itemId:e})=>e===t.defaultTravelMode);return r?X.fromJSON(r):null}};function ee(e,t,r,i){i[r]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}async function te(e,t,r){if(!e)throw new l.A("network-service:missing-url","Url to Network service is missing");const i=(0,V.jV)({f:"json",token:t},r),{data:o}=await(0,$.A)(e,i),s=o.currentVersion>=10.4?async function(e,t,r){try{const i=(0,V.jV)({f:"json",token:t},r),o=(0,h.UC)(e)+"/retrieveTravelModes",{data:{supportedTravelModes:s,defaultTravelMode:n}}=await(0,$.A)(o,i);return{supportedTravelModes:s,defaultTravelMode:n}}catch(e){throw new l.A("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:e})}}(e,t,r):async function(e,t){const r=(0,V.jV)({f:"json"},t),{data:i}=await(0,$.A)(e.replace(/\/rest\/.*$/i,"/info"),r);if(!i?.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:o}=i,s=(0,h.UC)(o)+"/sharing/rest/portals/self",{data:n}=await(0,$.A)(s,r),a=(0,c.wc)("helperServices.routingUtilities.url",n);if(!a)return{supportedTravelModes:[],defaultTravelMode:null};const l=(0,V.Dl)(o),u=/\/solve$/i.test(l.path)?"Route":/\/solveclosestfacility$/i.test(l.path)?"ClosestFacility":"ServiceAreas",p=(0,V.jV)({f:"json",serviceName:u},t),d=(0,h.UC)(a)+"/GetTravelModes/execute",y=await(0,$.A)(d,p),m=[];let f=null;if(y?.data?.results?.length){const e=y.data.results;for(const t of e)if("supportedTravelModes"===t.paramName){if(t.value?.features)for(const{attributes:e}of t.value.features)if(e){const t=JSON.parse(e.TravelMode);m.push(t)}}else"defaultTravelMode"===t.paramName&&(f=t.value)}return{supportedTravelModes:m,defaultTravelMode:f}}(e,r),{defaultTravelMode:n,supportedTravelModes:a}=await s;return o.defaultTravelMode=n,o.supportedTravelModes=a,Q.fromJSON(o)}(0,i.Cg)([(0,f.MZ)()],Q.prototype,"accumulateAttributeNames",void 0),(0,i.Cg)([(0,g.w)("accumulateAttributeNames")],Q.prototype,"readAccumulateAttributes",null),(0,i.Cg)([(0,b.K)("accumulateAttributeNames")],Q.prototype,"writeAccumulateAttributes",null),(0,i.Cg)([(0,f.MZ)()],Q.prototype,"attributeParameterValues",void 0),(0,i.Cg)([(0,f.MZ)()],Q.prototype,"capabilities",null),(0,i.Cg)([(0,f.MZ)()],Q.prototype,"currentVersion",void 0),(0,i.Cg)([(0,f.MZ)()],Q.prototype,"defaultTravelMode",void 0),(0,i.Cg)([(0,g.w)("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],Q.prototype,"readDefaultTravelMode",null),(0,i.Cg)([(0,f.MZ)()],Q.prototype,"directionsLanguage",void 0),(0,i.Cg)([(0,W.e)(q.Z7)],Q.prototype,"directionsLengthUnits",void 0),(0,i.Cg)([(0,f.MZ)()],Q.prototype,"directionsSupportedLanguages",void 0),(0,i.Cg)([(0,W.e)(q.Mm,{ignoreUnknown:!1})],Q.prototype,"directionsTimeAttribute",void 0),(0,i.Cg)([(0,f.MZ)()],Q.prototype,"hasZ",void 0),(0,i.Cg)([(0,W.e)(q.et,{ignoreUnknown:!1})],Q.prototype,"impedance",void 0),(0,i.Cg)([(0,f.MZ)({type:K})],Q.prototype,"networkDataset",void 0),(0,i.Cg)([(0,f.MZ)({type:[X]})],Q.prototype,"supportedTravelModes",void 0),Q=(0,i.Cg)([(0,v.$)("esri.rest.support.NetworkServiceDescription")],Q);var re=r(16649),ie=r(17136);function oe(e,t){if(null==e)return null;const r={},i=new RegExp(`^${t}`,"i");for(const o of Object.keys(e))if(i.test(o)){const i=o.slice(t.length);r[q.et.fromJSON(i)]=e[o]}return r}function se(e,t,r){if(null!=e){t.attributes||(t.attributes={});for(const i in e){const o=q.et.toJSON(i);t.attributes[`${r}${o}`]=e[i]}}}function ne(e){const t={};for(const r of Object.keys(e)){const i=r;t[q.et.fromJSON(i)]=e[r]}return t}function ae(e){const t={};for(const r of Object.keys(e)){const i=r;t[q.et.toJSON(i)]=e[r]}return t}function le(e,t){return null==e||null==t?null:Math.round((e-t)/6e4)}function ue(e){const t=e.toJSON(),r=t;return r.accumulateAttributeNames&&=t.accumulateAttributeNames?.join(),r.attributeParameterValues&&=JSON.stringify(t.attributeParameterValues),r.barriers&&=JSON.stringify(t.barriers),r.outSR&&=t.outSR?.wkid,r.overrides&&=JSON.stringify(t.overrides),r.polygonBarriers&&=JSON.stringify(t.polygonBarriers),r.polylineBarriers&&=JSON.stringify(t.polylineBarriers),r.restrictionAttributeNames&&=t.restrictionAttributeNames?.join(),r.stops&&=JSON.stringify(t.stops),r.travelMode&&=JSON.stringify(t.travelMode),r}var pe=r(22671),ce=r(4576),de=r(66552),ye=r(37807);const me=new de.J({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let he=class extends ye.A{constructor(e){super(e),this.type=null}};(0,i.Cg)([(0,f.MZ)({type:String,json:{read:me.read,write:me.write}})],he.prototype,"type",void 0),he=(0,i.Cg)([(0,v.$)("esri.rest.support.NAMessage")],he);const fe=he;var ge=r(82799),ve=r(86738);let be=class extends F.o{constructor(e){super(e)}};(0,i.Cg)([(0,f.MZ)({json:{read:{source:"string"}}})],be.prototype,"text",void 0),(0,i.Cg)([(0,W.e)(q.Ec,{name:"stringType"})],be.prototype,"type",void 0),be=(0,i.Cg)([(0,v.$)("esri.rest.support.DirectionsString")],be);const we=be;let Ce=class extends F.o{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,t){return le(t.ETA,t.arriveTimeUTC)}readGeometry(e,t){return ve.A.fromJSON(t.point)}};(0,i.Cg)([(0,f.MZ)({type:Date,json:{read:{source:"arriveTimeUTC"}}})],Ce.prototype,"arriveTime",void 0),(0,i.Cg)([(0,f.MZ)()],Ce.prototype,"arriveTimeOffset",void 0),(0,i.Cg)([(0,g.w)("arriveTimeOffset",["arriveTimeUTC","ETA"])],Ce.prototype,"readArriveTimeOffset",null),(0,i.Cg)([(0,f.MZ)({type:ve.A})],Ce.prototype,"geometry",void 0),(0,i.Cg)([(0,g.w)("geometry",["point"])],Ce.prototype,"readGeometry",null),(0,i.Cg)([(0,f.MZ)({type:[we]})],Ce.prototype,"strings",void 0),Ce=(0,i.Cg)([(0,v.$)("esri.rest.support.DirectionsEvent")],Ce);const Te=Ce;let Se=class extends s.A{constructor(e){super(e),this.events=null,this.geometry=null,this.strings=null}set attributes(e){super.attributes=e}readGeometry(e,t){const r=function(e){if(null==e||""===e)return null;let t=0,r=0,i=0,o=0;const s=[];let n,a,l,u,p,c,d,y,m=0,h=0,f=0;if(p=e.match(/((\+|-)[^+\-|]+|\|)/g),p||(p=[]),0===parseInt(p[m],32)){m=2;const e=parseInt(p[m],32);m++,c=parseInt(p[m],32),m++,1&e&&(h=p.indexOf("|")+1,d=parseInt(p[h],32),h++),2&e&&(f=p.indexOf("|",h)+1,y=parseInt(p[f],32),f++)}else c=parseInt(p[m],32),m++;for(;m<p.length&&"|"!==p[m];){n=parseInt(p[m],32)+t,m++,t=n,a=parseInt(p[m],32)+r,m++,r=a;const e=[n/c,a/c];h&&(u=parseInt(p[h],32)+i,h++,i=u,e.push(u/d)),f&&(l=parseInt(p[f],32)+o,f++,o=l,e.push(l/y)),s.push(e)}return{paths:[s],hasZ:h>0,hasM:f>0}}(t.compressedGeometry);return null!=r?ge.A.fromJSON(r):null}};(0,i.Cg)([(0,f.MZ)({type:[Te]})],Se.prototype,"events",void 0),(0,i.Cg)([(0,f.MZ)({type:ge.A})],Se.prototype,"geometry",void 0),(0,i.Cg)([(0,g.w)("geometry",["compressedGeometry"])],Se.prototype,"readGeometry",null),(0,i.Cg)([(0,f.MZ)({type:[we]})],Se.prototype,"strings",void 0),Se=(0,i.Cg)([(0,v.$)("esri.rest.support.DirectionsFeature")],Se);const Me=Se;let Ae=class extends pe.A{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,t){if(!e)return[];const r=t.summary.envelope.spatialReference??t.spatialReference,i=r&&M.A.fromJSON(r);return e.map(e=>{const t=Me.fromJSON(e);if(null!=t.geometry&&(t.geometry.spatialReference=i),null!=t.events)for(const e of t.events)null!=e.geometry&&(e.geometry.spatialReference=i);return t})}get mergedGeometry(){return this.features?function(e,t){if(0===e.length)return new ge.A({spatialReference:t});const r=[];for(const t of e)for(const e of t.paths)r.push(...e);const i=[];r.forEach((e,t)=>{0!==t&&e[0]===r[t-1][0]&&e[1]===r[t-1][1]||i.push(e)});const{hasM:o,hasZ:s}=e[0];return new ge.A({hasM:o,hasZ:s,paths:[i],spatialReference:t})}(this.features.map(({geometry:e})=>e),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:e})=>e).filter(ce.Ru)}};(0,i.Cg)([(0,f.MZ)({type:C.A,json:{read:{source:"summary.envelope"}}})],Ae.prototype,"extent",void 0),(0,i.Cg)([(0,f.MZ)({nonNullable:!0})],Ae.prototype,"features",void 0),(0,i.Cg)([(0,g.w)("features")],Ae.prototype,"readFeatures",null),(0,i.Cg)([(0,f.MZ)()],Ae.prototype,"geometryType",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ae.prototype,"mergedGeometry",null),(0,i.Cg)([(0,f.MZ)()],Ae.prototype,"routeId",void 0),(0,i.Cg)([(0,f.MZ)()],Ae.prototype,"routeName",void 0),(0,i.Cg)([(0,f.MZ)({value:null,readOnly:!0})],Ae.prototype,"strings",null),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"summary.totalDriveTime"}}})],Ae.prototype,"totalDriveTime",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"summary.totalLength"}}})],Ae.prototype,"totalLength",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"summary.totalTime"}}})],Ae.prototype,"totalTime",void 0),Ae=(0,i.Cg)([(0,v.$)("esri.rest.support.DirectionsFeatureSet")],Ae);const Oe=Ae;let Ne=class extends F.o{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};(0,i.Cg)([(0,f.MZ)({type:pe.A,json:{write:!0}})],Ne.prototype,"directionLines",void 0),(0,i.Cg)([(0,f.MZ)({type:pe.A,json:{write:!0}})],Ne.prototype,"directionPoints",void 0),(0,i.Cg)([(0,f.MZ)({type:Oe,json:{write:!0}})],Ne.prototype,"directions",void 0),(0,i.Cg)([(0,f.MZ)({type:s.A,json:{write:!0}})],Ne.prototype,"route",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],Ne.prototype,"routeName",void 0),(0,i.Cg)([(0,f.MZ)({type:[s.A],json:{write:!0}})],Ne.prototype,"stops",void 0),(0,i.Cg)([(0,f.MZ)({type:pe.A,json:{write:!0}})],Ne.prototype,"traversedEdges",void 0),(0,i.Cg)([(0,f.MZ)({type:pe.A,json:{write:!0}})],Ne.prototype,"traversedJunctions",void 0),(0,i.Cg)([(0,f.MZ)({type:pe.A,json:{write:!0}})],Ne.prototype,"traversedTurns",void 0),Ne=(0,i.Cg)([(0,v.$)("esri.rest.support.RouteResult")],Ne);const Ie=Ne;function Ze(e){return e?pe.A.fromJSON(e).features.filter(ce.Ru):[]}let De=class extends F.o{constructor(e){super(e),this.checksum=null,this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,t){return Ze(t.barriers)}readPolylineBarriers(e){return Ze(e)}readPolygonBarriers(e){return Ze(e)}};function je(e){return e instanceof pe.A}async function Fe(e,t,r){const i=[],o=[],s={},n={},a=(0,V.Dl)(e),{path:l}=a;je(t.stops)&&ee(t.stops.features,o,"stops.features",s),je(t.pointBarriers)&&ee(t.pointBarriers.features,o,"pointBarriers.features",s),je(t.polylineBarriers)&&ee(t.polylineBarriers.features,o,"polylineBarriers.features",s),je(t.polygonBarriers)&&ee(t.polygonBarriers.features,o,"polygonBarriers.features",s);const p=await(0,ie.el)(o);for(const e in s){const t=s[e];i.push(e),n[e]=p.slice(t[0],t[1])}if(function(e,t){for(let r=0;r<t.length;r++){const i=e[t[r]];if(i&&i.length)for(const e of i)if(null!=e&&e.hasZ)return!0}return!1}(n,i)){let e=null;try{e=await te(l,t.apiKey,r)}catch{}e&&!e.hasZ&&function(e,t){for(let r=0;r<t.length;r++){const i=e[t[r]];if(i&&i.length)for(const e of i)e.z=void 0}u.A.getLogger("esri.rest.networkService").warnOnce("The remote Network Analysis service is powered by a network dataset which is not Z-aware.\nZ-coordinates of the input geometry are ignored.")}(n,i)}for(const e in n)n[e].forEach((r,i)=>{(0,re.Jt)(t,e)[i].geometry=r});const c={...r,query:{...a.query,...ue(t),f:"json"}},d=l.endsWith("/solve")?l:`${l}/solve`,{data:y}=await(0,$.A)(d,c);return function(e){const{barriers:t,checksum:r,directionLines:i,directionPoints:o,directions:s,messages:n,polygonBarriers:a,polylineBarriers:l,routes:u,stops:p,traversedEdges:c,traversedJunctions:d,traversedTurns:y}=e,m=e=>{const t=f.find(t=>t.routeName===e);if(null!=t)return t;const r={routeId:f.length+1,routeName:e};return f.push(r),r},h=e=>{const t=f.find(t=>t.routeId===e);if(null!=t)return t;const r={routeId:e,routeName:null};return f.push(r),r},f=[];u?.features.forEach((e,t)=>{e.geometry.spatialReference=u.spatialReference??void 0;const r=e.attributes.Name,i=t+1;f.push({routeId:i,routeName:r,route:e})}),s?.forEach(e=>{const{routeName:t}=e;m(t).directions=e});const g=p?.features.every(e=>null==e.attributes.RouteName)&&f.length>0?f[0].routeName:null;return p?.features.forEach(e=>{e.geometry&&(e.geometry.spatialReference??=p.spatialReference??void 0);const t=g??e.attributes.RouteName,r=m(t);r.stops??=[],r.stops.push(e)}),i?.features.forEach(e=>{const t=e.attributes.RouteID,r=h(t),{geometryType:o,spatialReference:s}=i;r.directionLines??={features:[],geometryType:o,spatialReference:s},r.directionLines.features.push(e)}),o?.features.forEach(e=>{const t=e.attributes.RouteID,r=h(t),{geometryType:i,spatialReference:s}=o;r.directionPoints??={features:[],geometryType:i,spatialReference:s},r.directionPoints.features.push(e)}),c?.features.forEach(e=>{const t=e.attributes.RouteID,r=h(t),{geometryType:i,spatialReference:o}=c;r.traversedEdges??={features:[],geometryType:i,spatialReference:o},r.traversedEdges.features.push(e)}),d?.features.forEach(e=>{const t=e.attributes.RouteID,r=h(t),{geometryType:i,spatialReference:o}=d;r.traversedJunctions??={features:[],geometryType:i,spatialReference:o},r.traversedJunctions.features.push(e)}),y?.features.forEach(e=>{const t=e.attributes.RouteID,r=h(t);r.traversedTurns??={features:[]},r.traversedTurns.features.push(e)}),De.fromJSON({barriers:t,checksum:r,messages:n,polygonBarriers:a,polylineBarriers:l,routeResults:f})}(y)}var _e;(0,i.Cg)([(0,f.MZ)({type:String})],De.prototype,"checksum",void 0),(0,i.Cg)([(0,f.MZ)({type:[fe]})],De.prototype,"messages",void 0),(0,i.Cg)([(0,f.MZ)({type:[s.A]})],De.prototype,"pointBarriers",void 0),(0,i.Cg)([(0,g.w)("pointBarriers",["barriers"])],De.prototype,"readPointBarriers",null),(0,i.Cg)([(0,f.MZ)({type:[s.A]})],De.prototype,"polylineBarriers",void 0),(0,i.Cg)([(0,g.w)("polylineBarriers")],De.prototype,"readPolylineBarriers",null),(0,i.Cg)([(0,f.MZ)({type:[s.A]})],De.prototype,"polygonBarriers",void 0),(0,i.Cg)([(0,g.w)("polygonBarriers")],De.prototype,"readPolygonBarriers",null),(0,i.Cg)([(0,f.MZ)({type:[Ie]})],De.prototype,"routeResults",void 0),De=(0,i.Cg)([(0,v.$)("esri.rest.support.RouteSolveResult")],De);let xe=class extends((0,H.OU)(F.o)){static{_e=this}constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger"},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger"},{name:"FromLevel",alias:"From Level",type:"esriFieldTypeInteger"},{name:"Meters",alias:"Meters",type:"esriFieldTypeDouble"},{name:"Minutes",alias:"Minutes",type:"esriFieldTypeDouble"},{name:"ToLevel",alias:"To Level",type:"esriFieldTypeInteger"}]}static fromGraphic(e){return new _e({directionLineType:q.gD.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:e.attributes.FromLevel??null,geometry:e.geometry,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:e.attributes.ToLevel??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionLineType:this.directionLineType?q.gD.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return null!=this.fromLevel&&(e.FromLevel=this.fromLevel),null!=this.toLevel&&(e.ToLevel=this.toLevel),new s.A({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};var Be;(0,i.Cg)([(0,f.MZ)({type:q.gD.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:q.gD.read}}})],xe.prototype,"directionLineType",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.DirectionPointID"}}})],xe.prototype,"directionPointId",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.Meters"}}})],xe.prototype,"distance",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.Minutes"}}})],xe.prototype,"duration",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.FromLevel"}}})],xe.prototype,"fromLevel",void 0),(0,i.Cg)([(0,f.MZ)({type:ge.A})],xe.prototype,"geometry",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.ObjectID"}}})],xe.prototype,"objectId",void 0),(0,i.Cg)([(0,f.MZ)({type:n.A})],xe.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Es})],xe.prototype,"symbol",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.ToLevel"}}})],xe.prototype,"toLevel",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],xe.prototype,"type",void 0),xe=_e=(0,i.Cg)([(0,v.$)("esri.rest.support.DirectionLine")],xe);let Ee=class extends((0,H.OU)(F.o)){static{Be=this}constructor(e){super(e),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(e,t){return null!=t.attributes.ArrivalTime?new Date(t.attributes.ArrivalTime):null}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AlternateName",alias:"Alternative Name",type:"esriFieldTypeString"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time Offset",type:"esriFieldTypeInteger"},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble"},{name:"BranchName",alias:"Branch Name",type:"esriFieldTypeString"},{name:"DirectionPointType",alias:"Directions Point Type",type:"esriFieldTypeInteger"},{name:"DisplayText",alias:"Display Text",type:"esriFieldTypeString"},{name:"ExitName",alias:"Exit Name",type:"esriFieldTypeString"},{name:"IntersectingName",alias:"Intersecting Name",type:"esriFieldTypeString"},{name:"Level",alias:"Level",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ShortVoiceInstruction",alias:"Short Voice Instruction",type:"esriFieldTypeString"},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger"},{name:"TowardName",alias:"Toward Name",type:"esriFieldTypeString"},{name:"VoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString"}]}static fromGraphic(e){return new Be({alternateName:e.attributes.AlternateName??null,arrivalTime:null!=e.attributes.ArrivalTime?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:e.attributes.ArrivalUTCOffset??null,azimuth:e.attributes.Azimuth??null,branchName:e.attributes.BranchName??null,directionPointType:q._6.fromJSON(e.attributes.DirectionPointType),displayText:e.attributes.DisplayText??null,exitName:e.attributes.ExitName??null,geometry:e.geometry,intersectingName:e.attributes.IntersectingName??null,level:e.attributes.Level??null,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,sequence:e.attributes.Sequence,shortVoiceInstruction:e.attributes.ShortVoiceInstruction??null,stopId:e.attributes.StopID??null,symbol:e.symbol,towardName:e.attributes.TowardName??null,voiceInstruction:e.attributes.VoiceInstruction??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionPointType:this.directionPointType?q._6.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return null!=this.alternateName&&(e.AlternateName=this.alternateName),null!=this.arrivalTime&&(e.ArrivalTime=this.arrivalTime.getTime()),null!=this.arrivalTimeOffset&&(e.ArrivalUTCOffset=this.arrivalTimeOffset),null!=this.azimuth&&(e.Azimuth=this.azimuth),null!=this.branchName&&(e.BranchName=this.branchName),null!=this.displayText&&(e.DisplayText=this.displayText),null!=this.exitName&&(e.ExitName=this.exitName),null!=this.intersectingName&&(e.IntersectingName=this.intersectingName),null!=this.level&&(e.Level=this.level),null!=this.name&&(e.Name=this.name),null!=this.shortVoiceInstruction&&(e.ShortVoiceInstruction=this.shortVoiceInstruction),null!=this.towardName&&(e.TowardName=this.towardName),null!=this.voiceInstruction&&(e.VoiceInstruction=this.voiceInstruction),new s.A({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};var Pe;(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.AlternateName"}}})],Ee.prototype,"alternateName",void 0),(0,i.Cg)([(0,f.MZ)({type:Date})],Ee.prototype,"arrivalTime",void 0),(0,i.Cg)([(0,g.w)("arrivalTime",["attributes.ArrivalTime"])],Ee.prototype,"readArrivalTime",null),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],Ee.prototype,"arrivalTimeOffset",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.Azimuth"}}})],Ee.prototype,"azimuth",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.BranchName"}}})],Ee.prototype,"branchName",void 0),(0,i.Cg)([(0,f.MZ)({type:q._6.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:q._6.read}}})],Ee.prototype,"directionPointType",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.DisplayText"}}})],Ee.prototype,"displayText",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.ExitName"}}})],Ee.prototype,"exitName",void 0),(0,i.Cg)([(0,f.MZ)({type:ve.A})],Ee.prototype,"geometry",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.IntersectingName"}}})],Ee.prototype,"intersectingName",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.Level"}}})],Ee.prototype,"level",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.Name"}}})],Ee.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.ObjectID"}}})],Ee.prototype,"objectId",void 0),(0,i.Cg)([(0,f.MZ)({type:n.A})],Ee.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.Sequence"}}})],Ee.prototype,"sequence",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.ShortVoiceInstruction"}}})],Ee.prototype,"shortVoiceInstruction",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.StopID"}}})],Ee.prototype,"stopId",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Es})],Ee.prototype,"symbol",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.TowardName"}}})],Ee.prototype,"towardName",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Ee.prototype,"type",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.VoiceInstruction"}}})],Ee.prototype,"voiceInstruction",void 0),Ee=Be=(0,i.Cg)([(0,v.$)("esri.rest.support.DirectionPoint")],Ee);let Le=class extends((0,H.OU)(F.o)){static{Pe=this}constructor(e){super(e),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(e,t){return oe(t.attributes,"Attr_")}writeCosts(e,t){se(e,t,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"}]}static fromGraphic(e){return new Pe({addedCost:e.attributes.AddedCost??null,barrierType:null!=e.attributes.BarrierType?q.iM.fromJSON(e.attributes.BarrierType):null,costs:null!=e.attributes.Costs?ne(JSON.parse(e.attributes.Costs)):null,curbApproach:null!=e.attributes.CurbApproach?q.JJ.fromJSON(e.attributes.CurbApproach):null,fullEdge:null!=e.attributes.FullEdge?q.fe.fromJSON(e.attributes.FullEdge):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,status:null!=e.attributes.Status?q.$r.fromJSON(e.attributes.Status):null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType?q.iM.toJSON(this.barrierType):null,Costs:this.costs?JSON.stringify(ae(this.costs)):null,CurbApproach:this.curbApproach?q.JJ.toJSON(this.curbApproach):null,FullEdge:this.fullEdge?q.fe.toJSON(this.fullEdge):null,Name:this.name,Status:this.status?q.$r.toJSON(this.status):null};return new s.A({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};(0,i.Cg)([(0,f.MZ)()],Le.prototype,"addedCost",void 0),(0,i.Cg)([(0,f.MZ)({type:q.iM.apiValues,json:{name:"attributes.BarrierType",read:{reader:q.iM.read},write:{writer:q.iM.write}}})],Le.prototype,"barrierType",void 0),(0,i.Cg)([(0,f.MZ)()],Le.prototype,"costs",void 0),(0,i.Cg)([(0,g.w)("costs",["attributes"])],Le.prototype,"readCosts",null),(0,i.Cg)([(0,b.K)("costs")],Le.prototype,"writeCosts",null),(0,i.Cg)([(0,f.MZ)({type:q.JJ.apiValues,json:{read:{source:"attributes.CurbApproach",reader:q.JJ.read}}})],Le.prototype,"curbApproach",void 0),(0,i.Cg)([(0,f.MZ)({type:q.fe.apiValues,json:{name:"attributes.FullEdge",read:{reader:q.fe.read},write:{writer:q.fe.write}}})],Le.prototype,"fullEdge",void 0),(0,i.Cg)([(0,f.MZ)({type:ve.A,json:{write:!0}})],Le.prototype,"geometry",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.Name"}})],Le.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.ObjectID"}})],Le.prototype,"objectId",void 0),(0,i.Cg)([(0,f.MZ)({type:n.A})],Le.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,f.MZ)({type:q.mt.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:q.mt.read}}})],Le.prototype,"sideOfEdge",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.SourceID"}}})],Le.prototype,"sourceId",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.SourceOID"}}})],Le.prototype,"sourceOid",void 0),(0,i.Cg)([(0,f.MZ)({type:q.$r.apiValues,json:{read:{source:"attributes.Status",reader:q.$r.read}}})],Le.prototype,"status",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Es})],Le.prototype,"symbol",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Le.prototype,"type",void 0),Le=Pe=(0,i.Cg)([(0,v.$)("esri.rest.support.PointBarrier")],Le);var Re,Je=r(39829);let Ue=class extends((0,H.OU)(F.o)){static{Re=this}constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(e,t){return oe(t.attributes,"Attr_")}writeCosts(e,t){se(e,t,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}]}static fromGraphic(e){return new Re({barrierType:null!=e.attributes.BarrierType?q.iM.fromJSON(e.attributes.BarrierType):null,costs:null!=e.attributes.Costs?ne(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType?q.iM.toJSON(this.barrierType):null,Costs:this.costs?JSON.stringify(ae(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new s.A({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};var ke;(0,i.Cg)([(0,f.MZ)({type:q.iM.apiValues,json:{name:"attributes.BarrierType",read:{reader:q.iM.read},write:{writer:q.iM.write}}})],Ue.prototype,"barrierType",void 0),(0,i.Cg)([(0,f.MZ)()],Ue.prototype,"costs",void 0),(0,i.Cg)([(0,g.w)("costs",["attributes"])],Ue.prototype,"readCosts",null),(0,i.Cg)([(0,b.K)("costs")],Ue.prototype,"writeCosts",null),(0,i.Cg)([(0,f.MZ)({type:Je.A,json:{write:!0}})],Ue.prototype,"geometry",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.Name"}})],Ue.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.ObjectID"}})],Ue.prototype,"objectId",void 0),(0,i.Cg)([(0,f.MZ)({type:n.A})],Ue.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,f.MZ)()],Ue.prototype,"scaleFactor",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Es})],Ue.prototype,"symbol",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Ue.prototype,"type",void 0),Ue=Re=(0,i.Cg)([(0,v.$)("esri.rest.support.PolygonBarrier")],Ue);let $e=class extends((0,H.OU)(F.o)){static{ke=this}constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(e,t){return oe(t.attributes,"Attr_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}]}static fromGraphic(e){return new ke({barrierType:null!=e.attributes.BarrierType?q.iM.fromJSON(e.attributes.BarrierType):null,costs:null!=e.attributes.Costs?ne(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType?q.iM.toJSON(this.barrierType):null,Costs:this.costs?JSON.stringify(ae(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new s.A({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};(0,i.Cg)([(0,f.MZ)({type:q.iM.apiValues,json:{read:{source:"attributes.BarrierType",reader:q.iM.read}}})],$e.prototype,"barrierType",void 0),(0,i.Cg)([(0,f.MZ)()],$e.prototype,"costs",void 0),(0,i.Cg)([(0,g.w)("costs",["attributes"])],$e.prototype,"readCosts",null),(0,i.Cg)([(0,f.MZ)({type:ge.A,json:{write:!0}})],$e.prototype,"geometry",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.Name"}})],$e.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.ObjectID"}})],$e.prototype,"objectId",void 0),(0,i.Cg)([(0,f.MZ)({type:n.A})],$e.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,f.MZ)()],$e.prototype,"scaleFactor",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Es})],$e.prototype,"symbol",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],$e.prototype,"type",void 0),$e=ke=(0,i.Cg)([(0,v.$)("esri.rest.support.PolylineBarrier")],$e);let Ve=class extends F.o{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return null==e?null:e.map(e=>q.et.fromJSON(e))}writeAccumulateAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>q.et.toJSON(e)))}};var We;(0,i.Cg)([(0,f.MZ)({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],Ve.prototype,"accumulateAttributes",void 0),(0,i.Cg)([(0,g.w)("accumulateAttributes")],Ve.prototype,"readAccumulateAttributes",null),(0,i.Cg)([(0,b.K)("accumulateAttributes")],Ve.prototype,"writeAccumulateAttributes",null),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],Ve.prototype,"directionsLanguage",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],Ve.prototype,"findBestSequence",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],Ve.prototype,"preserveFirstStop",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],Ve.prototype,"preserveLastStop",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],Ve.prototype,"startTimeIsUTC",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],Ve.prototype,"timeWindowsAreUTC",void 0),(0,i.Cg)([(0,f.MZ)({type:X,json:{write:!0}})],Ve.prototype,"travelMode",void 0),Ve=(0,i.Cg)([(0,v.$)("esri.rest.support.RouteSettings")],Ve);let qe=class extends((0,H.OU)(F.o)){static{We=this}constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,t){return null!=t.attributes.EndTimeUTC?new Date(t.attributes.EndTimeUTC):null}readEndTimeOffset(e,t){return le(t.attributes.EndTime,t.attributes.EndTimeUTC)}readStartTime(e,t){return null!=t.attributes.StartTimeUTC?new Date(t.attributes.StartTimeUTC):null}readStartTimeOffset(e,t){return le(t.attributes.StartTime,t.attributes.StartTimeUTC)}readTotalCosts(e,t){return oe(t.attributes,"Total_")}readTotalViolations(e,t){return oe(t.attributes,"TotalViolation_")}readTotalWait(e,t){return oe(t.attributes,"TotalWait_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"},{name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}]}static fromGraphic(e){return new We({analysisSettings:null!=e.attributes.AnalysisSettings?Ve.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:null!=e.attributes.EndTime?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:null!=e.attributes.Messages?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:null!=e.attributes.StartTime?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:null!=e.attributes.TotalCosts?ne(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime?.getTime()??null,EndUTCOffset:this.endTimeOffset,Messages:this.messages?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime?.getTime()??null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts?JSON.stringify(ae(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new s.A({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};(0,i.Cg)([(0,f.MZ)()],qe.prototype,"analysisSettings",void 0),(0,i.Cg)([(0,f.MZ)({type:Date})],qe.prototype,"endTime",void 0),(0,i.Cg)([(0,g.w)("endTime",["attributes.EndTimeUTC"])],qe.prototype,"readEndTime",null),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"endTimeOffset",void 0),(0,i.Cg)([(0,g.w)("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],qe.prototype,"readEndTimeOffset",null),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.FirstStopID"}}})],qe.prototype,"firstStopId",void 0),(0,i.Cg)([(0,f.MZ)({type:ge.A})],qe.prototype,"geometry",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.LastStopID"}}})],qe.prototype,"lastStopId",void 0),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"messages",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.Name"}}})],qe.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.ObjectID"}}})],qe.prototype,"objectId",void 0),(0,i.Cg)([(0,f.MZ)({type:n.A})],qe.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,f.MZ)({type:Date})],qe.prototype,"startTime",void 0),(0,i.Cg)([(0,g.w)("startTime",["attributes.StartTimeUTC"])],qe.prototype,"readStartTime",null),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"startTimeOffset",void 0),(0,i.Cg)([(0,g.w)("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],qe.prototype,"readStartTimeOffset",null),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.StopCount"}}})],qe.prototype,"stopCount",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Es})],qe.prototype,"symbol",void 0),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"totalCosts",void 0),(0,i.Cg)([(0,g.w)("totalCosts",["attributes"])],qe.prototype,"readTotalCosts",null),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"totalDistance",void 0),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"totalDuration",void 0),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"totalLateDuration",void 0),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"totalViolations",void 0),(0,i.Cg)([(0,g.w)("totalViolations",["attributes"])],qe.prototype,"readTotalViolations",null),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"totalWait",void 0),(0,i.Cg)([(0,g.w)("totalWait",["attributes"])],qe.prototype,"readTotalWait",null),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"totalWaitDuration",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],qe.prototype,"type",void 0),(0,i.Cg)([(0,f.MZ)()],qe.prototype,"version",void 0),qe=We=(0,i.Cg)([(0,v.$)("esri.rest.support.RouteInfo")],qe);var Ge=r(56507),ze=r(24097),Ye=r(65864),Ke=r(50498);let He=class extends((0,H.OU)(F.o)){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};var Xe;(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],He.prototype,"doNotLocateOnRestrictedElements",void 0),(0,i.Cg)([(0,f.MZ)({types:Ke.yR,json:{read:Ye.rS,write:!0}})],He.prototype,"geometry",void 0),(0,i.Cg)([(0,W.e)(q.Vj)],He.prototype,"geometryType",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{name:"layerName",write:!0}})],He.prototype,"name",void 0),(0,i.Cg)([(0,W.e)(q.vS,{name:"spatialRel"})],He.prototype,"spatialRelationship",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],He.prototype,"type",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],He.prototype,"where",void 0),He=(0,i.Cg)([(0,v.$)("esri.rest.support.DataLayer")],He);let Qe=class extends pe.A{static{Xe=this}constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Xe({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],Qe.prototype,"doNotLocateOnRestrictedElements",void 0),Qe=Xe=(0,i.Cg)([(0,v.$)("esri.rest.support.NetworkFeatureSet")],Qe);let et=class extends((0,H.OU)(F.o)){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};var tt;(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],et.prototype,"doNotLocateOnRestrictedElements",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],et.prototype,"url",void 0),et=(0,i.Cg)([(0,v.$)("esri.rest.support.NetworkUrl")],et);let rt=class extends((0,H.OU)(F.o)){static{tt=this}constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.checksum=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return(0,Ge.PZ)(tt,e)}readAccumulateAttributes(e){return null==e?null:e.map(e=>q.et.fromJSON(e))}writeAccumulateAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>q.et.toJSON(e)))}writePointBarriers(e,t,r){it(e,t,r)}writePolygonBarrier(e,t,r){it(e,t,r)}writePolylineBarrier(e,t,r){it(e,t,r)}readRestrictionAttributes(e){return null==e?null:e.map(e=>q.OC.fromJSON(e))}writeRestrictionAttributes(e,t,r){e?.length&&(t[r]=e.map(e=>q.OC.toJSON(e)))}readStartTime(e,t){const{startTime:r}=t;return null==r?null:"now"===r?"now":new Date(r)}writeStartTime(e,t){null!=e&&(t.startTime="now"===e?"now":e.getTime())}readStops(e,t){return function(e){return function(e){return e&&"type"in e}(e)?He.fromJSON(e):function(e){return e&&"url"in e}(e)?et.fromJSON(e):function(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}(e)?Qe.fromJSON(e):function(e){return e&&"features"in e}(e)?pe.A.fromJSON(e):null}(t.stops)}writeStops(e,t,r){it(e,t,r)}};function it(e,t,r){null!=e&&(t[r]=a.A.isCollection(e)?{features:e.toArray().map(e=>e.toJSON())}:e.toJSON())}var ot;(0,i.Cg)([(0,f.MZ)({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],rt.prototype,"accumulateAttributes",void 0),(0,i.Cg)([(0,g.w)("accumulateAttributes")],rt.prototype,"readAccumulateAttributes",null),(0,i.Cg)([(0,b.K)("accumulateAttributes")],rt.prototype,"writeAccumulateAttributes",null),(0,i.Cg)([(0,f.MZ)(ze.K)],rt.prototype,"apiKey",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],rt.prototype,"attributeParameterValues",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],rt.prototype,"checksum",void 0),(0,i.Cg)([(0,f.MZ)({type:String,json:{write:!0}})],rt.prototype,"directionsLanguage",void 0),(0,i.Cg)([(0,W.e)(q.Z7)],rt.prototype,"directionsLengthUnits",void 0),(0,i.Cg)([(0,W.e)(q.aJ)],rt.prototype,"directionsOutputType",void 0),(0,i.Cg)([(0,W.e)(q.$n)],rt.prototype,"directionsStyleName",void 0),(0,i.Cg)([(0,W.e)(q.Mm,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],rt.prototype,"directionsTimeAttribute",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"findBestSequence",void 0),(0,i.Cg)([(0,f.MZ)({type:Number,json:{write:!0}})],rt.prototype,"geometryPrecision",void 0),(0,i.Cg)([(0,f.MZ)({type:Number,json:{write:!0}})],rt.prototype,"geometryPrecisionM",void 0),(0,i.Cg)([(0,f.MZ)({type:Number,json:{write:!0}})],rt.prototype,"geometryPrecisionZ",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"ignoreInvalidLocations",void 0),(0,i.Cg)([(0,W.e)(q.et,{name:"impedanceAttributeName",ignoreUnknown:!1})],rt.prototype,"impedanceAttribute",void 0),(0,i.Cg)([(0,f.MZ)({type:Number,json:{write:!0}})],rt.prototype,"outputGeometryPrecision",void 0),(0,i.Cg)([(0,W.e)(q.hY)],rt.prototype,"outputGeometryPrecisionUnits",void 0),(0,i.Cg)([(0,W.e)(q.Sr)],rt.prototype,"outputLines",void 0),(0,i.Cg)([(0,f.MZ)({type:M.A,json:{name:"outSR",write:!0}})],rt.prototype,"outSpatialReference",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],rt.prototype,"overrides",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"barriers",write:!0}})],rt.prototype,"pointBarriers",void 0),(0,i.Cg)([(0,b.K)("pointBarriers")],rt.prototype,"writePointBarriers",null),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],rt.prototype,"polygonBarriers",void 0),(0,i.Cg)([(0,b.K)("polygonBarriers")],rt.prototype,"writePolygonBarrier",null),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],rt.prototype,"polylineBarriers",void 0),(0,i.Cg)([(0,b.K)("polylineBarriers")],rt.prototype,"writePolylineBarrier",null),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"preserveFirstStop",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"preserveLastStop",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"preserveObjectID",void 0),(0,i.Cg)([(0,f.MZ)({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],rt.prototype,"restrictionAttributes",void 0),(0,i.Cg)([(0,g.w)("restrictionAttributes")],rt.prototype,"readRestrictionAttributes",null),(0,i.Cg)([(0,b.K)("restrictionAttributes")],rt.prototype,"writeRestrictionAttributes",null),(0,i.Cg)([(0,W.e)(q.hE)],rt.prototype,"restrictUTurns",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnBarriers",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnDirections",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnPolygonBarriers",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnPolylineBarriers",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnRoutes",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnStops",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnTraversedEdges",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnTraversedJunctions",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnTraversedTurns",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"returnZ",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],rt.prototype,"startTime",void 0),(0,i.Cg)([(0,g.w)("startTime")],rt.prototype,"readStartTime",null),(0,i.Cg)([(0,b.K)("startTime")],rt.prototype,"writeStartTime",null),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"startTimeIsUTC",void 0),(0,i.Cg)([(0,f.MZ)({json:{write:!0}})],rt.prototype,"stops",void 0),(0,i.Cg)([(0,g.w)("stops")],rt.prototype,"readStops",null),(0,i.Cg)([(0,b.K)("stops")],rt.prototype,"writeStops",null),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"timeWindowsAreUTC",void 0),(0,i.Cg)([(0,f.MZ)({type:X,json:{write:!0}})],rt.prototype,"travelMode",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"useHierarchy",void 0),(0,i.Cg)([(0,f.MZ)({type:Boolean,json:{write:!0}})],rt.prototype,"useTimeWindows",void 0),rt=tt=(0,i.Cg)([(0,v.$)("esri.rest.support.RouteParameters")],rt);let st=class extends((0,H.OU)(F.o)){static{ot=this}constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,t){return le(t.attributes.ArriveTime,t.attributes.ArriveTimeUTC)}readCumulativeCosts(e,t){return oe(t.attributes,"Cumul_")}readDepartTimeOffset(e,t){return le(t.attributes.DepartTime,t.attributes.DepartTimeUTC)}readServiceCosts(e,t){return oe(t.attributes,"Attr_")}writeServiceCosts(e,t){se(e,t,"Attr_")}writeTimeWindowEnd(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,t){null!=e&&(t.attributes||(t.attributes={}),t.attributes.TimeWindowStart=e.getTime())}readViolations(e,t){return oe(t.attributes,"Violation_")}readWait(e,t){return oe(t.attributes,"Wait_")}static{this.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}]}static fromGraphic(e){return new ot({arriveCurbApproach:null!=e.attributes.ArrivalCurbApproach?q.JJ.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:null!=e.attributes.ArrivalTime?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:null!=e.attributes.CumulativeCosts?ne(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:null!=e.attributes.CurbApproach?q.JJ.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:null!=e.attributes.DepartureCurbApproach?q.JJ.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:null!=e.attributes.DepartureTime?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:null!=e.attributes.LocationType?q.EM.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:null!=e.attributes.ServiceCosts?ne(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:null!=e.attributes.Status?q.$r.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:null!=e.attributes.TimeWindowEnd?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:null!=e.attributes.TimeWindowStart?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach?q.JJ.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime?.getTime()??null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts?JSON.stringify(ae(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach?q.JJ.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach?q.JJ.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime?.getTime()??null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType?q.EM.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts?JSON.stringify(ae(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status?q.$r.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd?.getTime()??null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart?.getTime()??null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new s.A({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};function nt(e){if(!e.length)return;const t=e.toArray(),r=t.map(({objectId:e})=>e).filter(e=>null!=e);let i=Math.max(...r,0);for(const e of t)null==e.objectId&&(e.objectId=++i)}function at(e,t){return!!e.length&&e.length===t.length&&lt(e)&&lt(t)}function lt(e){return e.every(({objectId:e})=>null!=e)}function ut(e){return e.length?e:null}function pt(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:pt("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:pt("esriGeometryPolyline")}}}function ct(e){return"layers"in e}async function dt(e){const t=M.A.WGS84;return await(0,S.initializeProjection)(e.spatialReference,t),(0,S.project)(e,t)}function yt(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function mt(e,t){return"decimal-degrees"===t||"points"===t||"unknown"===t?e:(0,m.oU)(e,t,"meters")}(0,i.Cg)([(0,f.MZ)({type:q.JJ.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:q.JJ.read}}})],st.prototype,"arriveCurbApproach",void 0),(0,i.Cg)([(0,f.MZ)({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],st.prototype,"arriveTime",void 0),(0,i.Cg)([(0,f.MZ)()],st.prototype,"arriveTimeOffset",void 0),(0,i.Cg)([(0,g.w)("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],st.prototype,"readArriveTimeOffset",null),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.Bearing",read:!1,write:!0}})],st.prototype,"bearing",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.BearingTol",read:!1,write:!0}})],st.prototype,"bearingTol",void 0),(0,i.Cg)([(0,f.MZ)()],st.prototype,"cumulativeCosts",void 0),(0,i.Cg)([(0,g.w)("cumulativeCosts",["attributes"])],st.prototype,"readCumulativeCosts",null),(0,i.Cg)([(0,f.MZ)()],st.prototype,"cumulativeDistance",void 0),(0,i.Cg)([(0,f.MZ)()],st.prototype,"cumulativeDuration",void 0),(0,i.Cg)([(0,f.MZ)({type:q.JJ.apiValues,json:{name:"attributes.CurbApproach",read:{reader:q.JJ.read},write:{writer:q.JJ.write}}})],st.prototype,"curbApproach",void 0),(0,i.Cg)([(0,f.MZ)({type:q.JJ.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:q.JJ.read}}})],st.prototype,"departCurbApproach",void 0),(0,i.Cg)([(0,f.MZ)({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],st.prototype,"departTime",void 0),(0,i.Cg)([(0,f.MZ)()],st.prototype,"departTimeOffset",void 0),(0,i.Cg)([(0,g.w)("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],st.prototype,"readDepartTimeOffset",null),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],st.prototype,"distanceToNetworkInMeters",void 0),(0,i.Cg)([(0,f.MZ)({type:ve.A,json:{write:!0}})],st.prototype,"geometry",void 0),(0,i.Cg)([(0,f.MZ)()],st.prototype,"lateDuration",void 0),(0,i.Cg)([(0,f.MZ)({type:q.EM.apiValues,json:{name:"attributes.LocationType",read:{reader:q.EM.read},write:{writer:q.EM.write}}})],st.prototype,"locationType",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.Name"}})],st.prototype,"name",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.NavLatency",read:!1,write:!0}})],st.prototype,"navLatency",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.ObjectID"}})],st.prototype,"objectId",void 0),(0,i.Cg)([(0,f.MZ)({type:n.A})],st.prototype,"popupTemplate",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.PosAlong"}}})],st.prototype,"posAlong",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.RouteName"}})],st.prototype,"routeName",void 0),(0,i.Cg)([(0,f.MZ)()],st.prototype,"serviceCosts",void 0),(0,i.Cg)([(0,g.w)("serviceCosts",["attributes"])],st.prototype,"readServiceCosts",null),(0,i.Cg)([(0,b.K)("serviceCosts")],st.prototype,"writeServiceCosts",null),(0,i.Cg)([(0,f.MZ)()],st.prototype,"serviceDistance",void 0),(0,i.Cg)([(0,f.MZ)()],st.prototype,"serviceDuration",void 0),(0,i.Cg)([(0,f.MZ)({json:{name:"attributes.Sequence"}})],st.prototype,"sequence",void 0),(0,i.Cg)([(0,f.MZ)({type:q.mt.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:q.mt.read}}})],st.prototype,"sideOfEdge",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.SnapX"}}})],st.prototype,"snapX",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.SnapY"}}})],st.prototype,"snapY",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.SnapZ"}}})],st.prototype,"snapZ",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.SourceID"}}})],st.prototype,"sourceId",void 0),(0,i.Cg)([(0,f.MZ)({json:{read:{source:"attributes.SourceOID"}}})],st.prototype,"sourceOid",void 0),(0,i.Cg)([(0,f.MZ)({type:q.$r.apiValues,json:{read:{source:"attributes.Status",reader:q.$r.read}}})],st.prototype,"status",void 0),(0,i.Cg)([(0,f.MZ)({types:x.Es})],st.prototype,"symbol",void 0),(0,i.Cg)([(0,f.MZ)({type:Date,json:{name:"attributes.TimeWindowEnd"}})],st.prototype,"timeWindowEnd",void 0),(0,i.Cg)([(0,b.K)("timeWindowEnd")],st.prototype,"writeTimeWindowEnd",null),(0,i.Cg)([(0,f.MZ)()],st.prototype,"timeWindowEndOffset",void 0),(0,i.Cg)([(0,f.MZ)({type:Date,json:{name:"attributes.TimeWindowStart"}})],st.prototype,"timeWindowStart",void 0),(0,i.Cg)([(0,b.K)("timeWindowStart")],st.prototype,"writeTimeWindowStart",null),(0,i.Cg)([(0,f.MZ)()],st.prototype,"timeWindowStartOffset",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],st.prototype,"type",void 0),(0,i.Cg)([(0,f.MZ)()],st.prototype,"violations",void 0),(0,i.Cg)([(0,g.w)("violations",["attributes"])],st.prototype,"readViolations",null),(0,i.Cg)([(0,f.MZ)()],st.prototype,"waitDuration",void 0),(0,i.Cg)([(0,f.MZ)()],st.prototype,"wait",void 0),(0,i.Cg)([(0,g.w)("wait",["attributes"])],st.prototype,"readWait",null),st=ot=(0,i.Cg)([(0,v.$)("esri.rest.support.Stop")],st);const ht=a.A.ofType(xe),ft=a.A.ofType(Ee),gt=a.A.ofType(Le),vt=a.A.ofType(Ue),bt=a.A.ofType($e),wt=a.A.ofType(st);let Ct=class extends((0,N.dM)((0,D.j)((0,I.q)((0,Z.A)((0,p.P)(O.A)))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.checksum=null,this.defaultSymbols=new L,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new gt,this.polygonBarriers=new vt,this.polylineBarriers=new bt,this.routeInfo=null,this.spatialReference=M.A.WGS84,this.stops=new wt,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles((0,y.on)(()=>this.stops,"change",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,r,i){const o=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(e=>!!e),s=o.map((e,t)=>t),n="web-map"===i.origin?"featureCollection.layers":"layers";(0,c.sM)(n,o,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=s}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",e=>xe.fromGraphic(e))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",e=>Ee.fromGraphic(e))}get fullExtent(){const e=new C.A({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:M.A.WGS84});if(null!=this.routeInfo?.geometry)return this.routeInfo.geometry.extent??e;if(null==this.stops)return e;const t=this.stops.filter(e=>null!=e.geometry);if(t.length<2)return e;const{spatialReference:r}=t.at(0).geometry;if(null==r)return e;const i=t.toArray().map(e=>{const t=e.geometry;return[t.x,t.y]});return new T.A({points:i,spatialReference:r}).extent}readMaxScale(e,t){const r=ct(t)?t.layers:t.featureCollection?.layers,i=r?.find(e=>null!=e.layerDefinition.maxScale);return i?.layerDefinition.maxScale??0}readMinScale(e,t){const r=ct(t)?t.layers:t.featureCollection?.layers,i=r?.find(e=>null!=e.layerDefinition.minScale);return i?.layerDefinition.minScale??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",e=>Le.fromGraphic(e))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",e=>Ue.fromGraphic(e))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",e=>$e.fromGraphic(e))}readRouteInfo(e,t){return this._getNetworkFeatures(t,"RouteInfo",e=>qe.fromGraphic(e)).at(0)??null}readSpatialReference(e,t){const r=ct(t)?t.layers:t.featureCollection?.layers;if(!r?.length)return M.A.WGS84;const{layerDefinition:i,featureSet:o}=r[0],s=o.features[0],n=s?.geometry?.spatialReference??o.spatialReference??i.spatialReference??i.extent.spatialReference??A.KK;return M.A.fromJSON(n)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",e=>st.fromGraphic(e),e=>this._setStopSymbol(e))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return o.A.routeServiceUrl}set url(e){null!=e?this._set("url",(0,j.Jf)(e,u.A.getLogger(this))):this._set("url",o.A.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){null!=this.directionLines&&(this.directionLines.removeAll(),this._set("directionLines",null)),null!=this.directionPoints&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),null!=this.routeInfo&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new l.A("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new l.A("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if("Feature Collection"!==t.type)throw new l.A("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(!this.routeInfo)throw new l.A("routelayer:route-unsolved","save() requires a solved route");const{portal:r}=t;await r.signIn(),r.user||await t.reload();const{itemUrl:i,itemControl:o}=t;if("admin"!==o&&"update"!==o)throw new l.A("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const s={messages:[],origin:"portal-item",portal:r,url:i?(0,h.An)(i):void 0,writtenProperties:[]},n=this.write(void 0,s);return t.extent=await dt(e),t.title=this.title,await t.update({data:n}),t}async saveAs(e,t={}){if(await this.load(),null==this.routeInfo)throw new l.A("routelayer:route-unsolved","saveAs() requires a solved route");const r=J.default.from(e).clone();r.extent??=await dt(this.fullExtent),r.id=null,r.portal??=R.A.getDefault(),r.title??=this.title,r.type="Feature Collection",r.typeKeywords=["Data","Feature Collection",U.mm.MULTI_LAYER,"Route Layer"];const{portal:i}=r,o={messages:[],origin:"portal-item",portal:i,url:null,writtenProperties:[]};await i.signIn();const s=t?.folder,n=this.write(void 0,o);return await i.user.addItem({item:r,folder:s,data:n}),this.portalItem=r,(0,w.v)(o),o.portalItem=r,r}async solve(e,t){nt(this.stops),nt(this.pointBarriers),nt(this.polylineBarriers),nt(this.polygonBarriers);const r=e?.stops??this.stops,i=e?.pointBarriers??ut(this.pointBarriers),o=e?.polylineBarriers??ut(this.polylineBarriers),s=e?.polygonBarriers??ut(this.polygonBarriers);if(null==r)throw new l.A("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((function(e){return"esri.rest.support.FeatureSet"===e.declaredClass}(r)||function(e){return"esri.rest.support.NetworkFeatureSet"===e.declaredClass}(r))&&r.features.length<2||a.A.isCollection(r)&&r.length<2)throw new l.A("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(a.A.isCollection(r))for(const e of r)e.routeName=null;const n=e?.apiKey,{checksum:u,url:p}=this,c=await this._getServiceDescription(p,n,t),y=e?.travelMode??c.defaultTravelMode,m=e?.accumulateAttributes??[];y&&(m.push(y.distanceAttributeName),y.timeAttributeName&&m.push(y.timeAttributeName));const h={accumulateAttributes:m,checksum:u,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:i,polylineBarriers:o,polygonBarriers:s,preserveObjectID:!0,returnBarriers:!!i,returnDirections:!0,returnPolygonBarriers:!!s,returnPolylineBarriers:!!o,returnRoutes:!0,returnStops:!0,stops:r},f=rt.from(e??{});let g;f.set(h);try{g=await Fe(p,f,t)}catch(e){throw(0,d.zf)(e)?e:new l.A("routelayer:failed-route-request","the routing request failed",{error:e})}const v=this._toRouteLayerSolution(g);return this._isOverridden("title")||(this.title=v.routeInfo.name??"Route"),this._populatePortalFields(v,c,f),v}update(e){const{checksum:t,directionLines:r,directionPoints:i,pointBarriers:o,polygonBarriers:s,polylineBarriers:n,routeInfo:a,stops:l}=e;at(l,this.stops)?function(e,t){for(const r of e){const e=t.find(e=>e.objectId===r.objectId);e&&(e.arriveCurbApproach=r.arriveCurbApproach,e.arriveTime=r.arriveTime,e.arriveTimeOffset=r.arriveTimeOffset,e.cumulativeCosts=r.cumulativeCosts,e.cumulativeDistance=r.cumulativeDistance,e.cumulativeDuration=r.cumulativeDuration,e.curbApproach=r.curbApproach,e.departCurbApproach=r.departCurbApproach,e.departTime=r.departTime,e.departTimeOffset=r.departTimeOffset,e.distanceToNetworkInMeters=r.distanceToNetworkInMeters,e.geometry=r.geometry,e.lateDuration=r.lateDuration,e.name=r.name,e.navLatency=r.navLatency,e.posAlong=r.posAlong,e.routeName=r.routeName,e.serviceCosts=r.serviceCosts,e.serviceDistance=r.serviceDistance,e.serviceDuration=r.serviceDuration,e.sequence=r.sequence,e.sideOfEdge=r.sideOfEdge,e.snapX=r.snapX,e.snapY=r.snapY,e.snapZ=r.snapZ,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol,e.timeWindowEnd=r.timeWindowEnd,e.timeWindowStart=r.timeWindowStart,e.violations=r.violations,e.waitDuration=r.waitDuration,e.wait=r.wait)}}(l,this.stops):this.set({stops:l}),at(o,this.pointBarriers)?function(e,t){for(const r of e){const e=t.find(e=>e.objectId===r.objectId);e&&(e.addedCost=r.addedCost,e.barrierType=r.barrierType,e.costs=r.costs,e.curbApproach=r.curbApproach,e.fullEdge=r.fullEdge,e.geometry=r.geometry,e.name=r.name,e.sideOfEdge=r.sideOfEdge,e.sourceId=r.sourceId,e.sourceOid=r.sourceOid,e.status=r.status,e.symbol=r.symbol)}}(o,this.pointBarriers):this.set({pointBarriers:o}),at(n,this.polylineBarriers)?function(e,t){for(const r of e){const e=t.find(e=>e.objectId===r.objectId);e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}(n,this.polylineBarriers):this.set({polylineBarriers:n}),at(s,this.polygonBarriers)?function(e,t){for(const r of e){const e=t.find(e=>e.objectId===r.objectId);e&&(e.barrierType=r.barrierType,e.costs=r.costs,e.geometry=r.geometry,e.name=r.name,e.scaleFactor=r.scaleFactor,e.symbol=r.symbol)}}(s,this.polygonBarriers):this.set({polygonBarriers:s}),this.set({checksum:t}),this._set("directionLines",r),this._set("directionPoints",i),this._set("routeInfo",a),null!=a.geometry&&(this.spatialReference=a.geometry.spatialReference)}_getNetworkFeatures(e,t,r,i){const o=ct(e)?e.layers:e.featureCollection?.layers,l=o?.find(e=>e.layerDefinition.name===t);if(null==l)return new a.A;const{layerDefinition:u,popupInfo:p,featureSet:c}=l,d=u.drawingInfo.renderer,{features:y}=c,m=c.spatialReference??u.spatialReference??u.extent.spatialReference??A.KK,h=d&&(0,k.L)(d),f=M.A.fromJSON(m),g=y.map(e=>{const i=s.A.fromJSON(e);null!=i.geometry&&null!=e.geometry&&null==e.geometry.spatialReference&&(i.geometry.spatialReference=f);const o=r(i);return o.symbol??=h?.getSymbol(i)??this._getNetworkSymbol(t),o.popupTemplate??=p&&n.A.fromJSON(p),o});return i&&g.some(({symbol:e})=>!e)&&i(g),new a.A(g)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,r){if(null!=this._cachedServiceDescription&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const i=await te(e,t,r);return this._cachedServiceDescription={serviceDescription:i,url:e},i}_setStopSymbol(e){if(!e||!e.length||!this.defaultSymbols.stops||e.every(({symbol:e})=>!!e))return;const{first:t,last:r,middle:i,unlocated:o,waypoint:s,break:n}=this.defaultSymbols.stops,a=e.map(({sequence:e})=>e).filter(e=>null!=e),l=e.length===a.length;if(!this.routeInfo&&!l||1===e.length)return void e.forEach((o,s)=>{switch(s){case 0:o.symbol=t;break;case e.length-1:o.symbol=r;break;default:o.symbol=i}});const u=Math.min(...a),p=Math.max(...a);for(const a of e)a.sequence!==u?a.sequence!==p?this.routeInfo&&"ok"!==a.status&&"not-located-on-closest"!==a.status?a.symbol=o:"waypoint"!==a.locationType?"break"!==a.locationType?a.symbol=i:a.symbol=n:a.symbol=s:a.symbol=r:a.symbol=t}_toRouteLayerSolution(e){const{checksum:t,routeResults:r}=e,i=r[0].stops?.map(e=>st.fromJSON(e.toJSON()));this._setStopSymbol(i);const o=new wt(i),s=new vt(e.polygonBarriers?.map(e=>{const t=Ue.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polygonBarriers,t})),n=new bt(e.polylineBarriers?.map(e=>{const t=$e.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.polylineBarriers,t})),a=new gt(e.pointBarriers?.map(e=>{const t=Le.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.pointBarriers,t})),l=r[0].route?.toJSON(),u=qe.fromJSON(l);u.symbol=this.defaultSymbols.routeInfo;const p=new ft(r[0].directionPoints?.features.map(e=>{const t=Ee.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionPoints,t}));return{checksum:t,directionLines:new ht(r[0].directionLines?.features.map(e=>{const t=xe.fromJSON(e.toJSON());return t.symbol=this.defaultSymbols.directionLines,t})),directionPoints:p,pointBarriers:a,polygonBarriers:s,polylineBarriers:n,routeInfo:u,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",xe.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",Ee.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,r,i,o,s){if(!e?.length)return null;const n=this.spatialReference.toJSON(),{fullExtent:a,maxScale:l,minScale:u}=this;return{featureSet:{features:e.toArray().map(e=>function(e){const{attributes:t,geometry:r,popupTemplate:i,symbol:o}=e.toGraphic().toJSON();return{attributes:t,geometry:r,popupInfo:i,symbol:o}}(e)),geometryType:r,spatialReference:n},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:null!=t?t.toJSON():pt(r)}},extent:a.toJSON(),fields:i,geometryType:r,hasM:!1,hasZ:!1,maxScale:l,minScale:u,name:o,objectIdField:"ObjectID",spatialReference:n,title:s,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",Le.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",Ue.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",$e.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(null!=this.routeInfo?new a.A([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",qe.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",st.fields,"Stops","Stops");if(null==e)return null;const{stops:t}=this.defaultSymbols,r=t?.first?.toJSON(),i=t?.middle?.toJSON(),o=t?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:i,uniqueValueInfos:[{value:"1",symbol:r,label:"First Stop"},{value:`${this.stops.length}`,symbol:o,label:"Last Stop"}]},e}_populatePortalFields(e,t,r){const i=t.networkDataset?.networkAttributes,o=i?.filter(({usageType:e})=>"cost"===e)??[],s=r.travelMode??t.defaultTravelMode;if(null==s)return void u.A.getLogger(this).warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:n,distanceAttributeName:a}=s,p=o.find(({name:e})=>e===n),c=o.find(({name:e})=>e===a),d=r.travelMode?.impedanceAttributeName??r.impedanceAttribute??t.impedance,y=p?.units,m=c?.units;if(!y||!m)throw new l.A("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const h=r.directionsLanguage??t.directionsLanguage,f=r.accumulateAttributes??t.accumulateAttributeNames??[],g=new Set(o.filter(({name:e})=>e===n||e===a||e===d||null!=e&&f.includes(e)).map(({name:e})=>e)),v=e=>{for(const t in e)g.has(t)||delete e[t]};for(const t of e.pointBarriers)null!=t.costs&&(t.addedCost=t.costs[d]??0,v(t.costs));for(const t of e.polygonBarriers)null!=t.costs&&(t.scaleFactor=t.costs[d]??1,v(t.costs));for(const t of e.polylineBarriers)null!=t.costs&&(t.scaleFactor=t.costs[d]??1,v(t.costs));const{routeInfo:b}=e,{findBestSequence:w,preserveFirstStop:C,preserveLastStop:T,startTimeIsUTC:S,timeWindowsAreUTC:M}=r;b.analysisSettings=new Ve({accumulateAttributes:f,directionsLanguage:h,findBestSequence:w,preserveFirstStop:C,preserveLastStop:T,startTimeIsUTC:S,timeWindowsAreUTC:M,travelMode:s}),b.totalDuration=yt(b.totalCosts?.[n]??0,y),b.totalDistance=mt(b.totalCosts?.[a]??0,m),b.totalLateDuration=yt(b.totalViolations?.[n]??0,y),b.totalWaitDuration=yt(b.totalWait?.[n]??0,y),null!=b.totalCosts&&v(b.totalCosts),null!=b.totalViolations&&v(b.totalViolations),null!=b.totalWait&&v(b.totalWait);for(const t of e.stops)null!=t.serviceCosts&&(t.serviceDuration=yt(t.serviceCosts[n]??0,y),t.serviceDistance=mt(t.serviceCosts[a]??0,m),v(t.serviceCosts)),null!=t.cumulativeCosts&&(t.cumulativeDuration=yt(t.cumulativeCosts[n]??0,y),t.cumulativeDistance=mt(t.cumulativeCosts[a]??0,m),v(t.cumulativeCosts)),null!=t.violations&&(t.lateDuration=yt(t.violations[n]??0,y),v(t.violations)),null!=t.wait&&(t.waitDuration=yt(t.wait[n]??0,y),v(t.wait))}};(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:null==this.portalItem}}}}}}})],Ct.prototype,"_featureCollection",void 0),(0,i.Cg)([(0,b.K)(["web-map","portal-item"],"_featureCollection")],Ct.prototype,"writeFeatureCollectionWebmap",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:null!=this.portalItem}}}}}}})],Ct.prototype,"_type",void 0),(0,i.Cg)([(0,f.MZ)({type:String})],Ct.prototype,"checksum",void 0),(0,i.Cg)([(0,f.MZ)({nonNullable:!0,type:L})],Ct.prototype,"defaultSymbols",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ct.prototype,"directionLines",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],Ct.prototype,"readDirectionLines",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ct.prototype,"directionPoints",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],Ct.prototype,"readDirectionPoints",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],Ct.prototype,"featureCollectionType",void 0),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ct.prototype,"fullExtent",null),(0,i.Cg)([(0,f.MZ)({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],Ct.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,f.MZ)({type:["show","hide"]})],Ct.prototype,"listMode",void 0),(0,i.Cg)([(0,f.MZ)({type:Number,nonNullable:!0,json:{write:!1}})],Ct.prototype,"maxScale",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],Ct.prototype,"readMaxScale",null),(0,i.Cg)([(0,f.MZ)({type:Number,nonNullable:!0,json:{write:!1}})],Ct.prototype,"minScale",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],Ct.prototype,"readMinScale",null),(0,i.Cg)([(0,f.MZ)({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],Ct.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,f.MZ)({nonNullable:!0,type:a.A.ofType(Le)})],Ct.prototype,"pointBarriers",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],Ct.prototype,"readPointBarriers",null),(0,i.Cg)([(0,f.MZ)({nonNullable:!0,type:a.A.ofType(Ue)})],Ct.prototype,"polygonBarriers",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],Ct.prototype,"readPolygonBarriers",null),(0,i.Cg)([(0,f.MZ)({nonNullable:!0,type:a.A.ofType($e)})],Ct.prototype,"polylineBarriers",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],Ct.prototype,"readPolylineBarriers",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0})],Ct.prototype,"routeInfo",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],Ct.prototype,"readRouteInfo",null),(0,i.Cg)([(0,f.MZ)({type:M.A})],Ct.prototype,"spatialReference",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],Ct.prototype,"readSpatialReference",null),(0,i.Cg)([(0,f.MZ)({nonNullable:!0,type:a.A.ofType(st)})],Ct.prototype,"stops",void 0),(0,i.Cg)([(0,g.w)(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],Ct.prototype,"readStops",null),(0,i.Cg)([(0,f.MZ)()],Ct.prototype,"title",null),(0,i.Cg)([(0,f.MZ)({readOnly:!0,json:{read:!1}})],Ct.prototype,"type",void 0),(0,i.Cg)([(0,f.MZ)()],Ct.prototype,"url",null),Ct=(0,i.Cg)([(0,v.$)("esri.layers.RouteLayer")],Ct);const Tt=Ct},65494:(e,t,r)=>{r.d(t,{L:()=>l,r:()=>n});var i=r(67076),o=r(90360),s=r(41214);function n(e,t){return l(e,null,t)}const a=(0,o.C)({types:s.Hg});function l(e,t,r){return e?e&&(e.styleName||e.styleUrl)&&"uniqueValue"!==e.type?(r?.messages&&r.messages.push(new i.A("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):a(e,t,r):null}},70328:(e,t,r)=>{r.d(t,{BI:()=>b,DC:()=>c,Ej:()=>y,Ie:()=>g,Jt:()=>v,Ne:()=>m,RF:()=>p,aI:()=>C,fA:()=>n,gE:()=>l,hZ:()=>f,iT:()=>d,is:()=>w,qv:()=>T,vI:()=>h,vY:()=>a,v_:()=>S,vt:()=>s,w1:()=>u});var i=r(5443),o=(r(19419),r(4197));function s(e=S){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function n(e,t,r,i,o,n,a=s()){return a[0]=e,a[1]=t,a[2]=r,a[3]=i,a[4]=o,a[5]=n,a}function a(e,t=s()){return function(e,t,r,i=s()){return f(i,T),function(e,t,r=0,i=t.length/3){let o=e[0],s=e[1],n=e[2],a=e[3],l=e[4],u=e[5];for(let e=0;e<i;e++)o=Math.min(o,t[r+3*e]),s=Math.min(s,t[r+3*e+1]),n=Math.min(n,t[r+3*e+2]),a=Math.max(a,t[r+3*e]),l=Math.max(l,t[r+3*e+1]),u=Math.max(u,t[r+3*e+2]);e[0]=o,e[1]=s,e[2]=n,e[3]=a,e[4]=l,e[5]=u}(i,e,t,r),i}(e,0,e.length/3,t)}function l(e,t=(0,o.jh)(24)){const[r,i,s,n,a,l]=e;return t[0]=r,t[1]=i,t[2]=s,t[3]=r,t[4]=i,t[5]=l,t[6]=r,t[7]=a,t[8]=s,t[9]=r,t[10]=a,t[11]=l,t[12]=n,t[13]=i,t[14]=s,t[15]=n,t[16]=i,t[17]=l,t[18]=n,t[19]=a,t[20]=s,t[21]=n,t[22]=a,t[23]=l,t}function u(e,t){const r=isFinite(e[2])||isFinite(e[5]);return new i.A(r?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function p(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function d(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function y(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function m(e,t,r=e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==e&&(r[3]=e[3],r[4]=e[4],r[5]=e[5]),r}function h(e,t,r=e){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==e&&(r[0]=e[0],r[1]=e[1],r[2]=e[2]),e}function f(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function g(e){return e?f(e,T):s(T)}function v(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function b(e,t,r,i,o){return e[0]=t,e[1]=r,e[2]=Number.NEGATIVE_INFINITY,e[3]=i,e[4]=o,e[5]=Number.POSITIVE_INFINITY,e}function w(e){return 6===e.length}function C(e,t,r){if(null==e||null==t)return e===t;if(!w(e)||!w(t))return!1;if(r){for(let i=0;i<e.length;i++)if(!r(e[i],t[i]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}const T=[1/0,1/0,1/0,-1/0,-1/0,-1/0],S=[0,0,0,0,0,0];s()},73681:(e,t,r)=>{r.d(t,{n:()=>l});var i=r(49186),o=r(53966),s=r(46140),n=r(95466),a=r(55674);class l{static async from(e,t,r){const n=e.dictionary_version?s.R.parse(e.dictionary_version):null,p=new Set(e.itemsNames),c={};if(t)for(const e in t)c[e]=t[e];if(e.authoringInfo.configuration)for(const t of e.authoringInfo.configuration)c.hasOwnProperty(t.name)||(c[t.name]=t.value);const d=new Set(e.authoringInfo.symbol);for(const e of Object.keys(r))d.delete(e);d.size&&o.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:d});const y=await(0,a.xR)(e.expression,null,c);if(!y)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const m=!n||!n.greaterEqual(4,0);m&&o.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:n});const h=new u(r,m);return new l(m,p,y,h)}constructor(e,t,r,i){this._requiresFieldCoercionToString=e,this._itemNames=t,this._compiled=r,this._reader=i}get itemNames(){return this._itemNames}evaluate(e,t,r,i){try{return this._reader.bind(e,r,i),this._compiled.evaluate(this._reader,{$view:{scale:t}})}catch(e){o.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new n.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new n.A(t)}}class u extends a.Gj{constructor(e,t){super(),this._fieldMap=e,this._requiresFieldCoercionToString=t}_getField(e){const t=this._fieldMap[e]??e;return this._boundSchema.fieldsIndex.get(t)}field(e){if(!this._requiresFieldCoercionToString)return super.field(e,!1);const t=this._getField(e);return null==t||null==this._boundTarget.attributes[t.name]?"":""+this._boundTarget.attributes[t.name]}}},76369:(e,t,r)=>{r.d(t,{LF:()=>T,M9:()=>S});var i=r(49186),o=r(93637),s=r(40876),n=r(59247),a=r(27865);class l extends SyntaxError{constructor(e,t,r,i){super(e),this.expected=t,this.found=r,this.location=i,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let r=null;const i=e.find(e=>e.source===this.location.source);i&&(r=i.text.split(/\r\n|\n|\r/g));const o=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(o):o,n=this.location.source+":"+s.line+":"+s.column;if(r){const e=this.location.end,i="".padEnd(s.line.toString().length," "),a=r[o.line-1],l=(o.line===e.line?e.column:a.length+1)-o.column||1;t+="\n --\x3e "+n+"\n"+i+" |\n"+s.line+" | "+a+"\n"+i+" | "+"".padEnd(o.column-1," ")+"".padEnd(l,"^")}else t+="\n at "+n}return t}static buildMessage(e,t){function r(e){return e.codePointAt(0).toString(16).toUpperCase()}const i=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function o(e){return i?e.replace(i,e=>"\\u{"+r(e)+"}"):e}function s(e){return o(e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}function n(e){return o(e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,e=>"\\x0"+r(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+r(e)))}const a={literal:e=>'"'+s(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?n(e[0])+"-"+n(e[1]):n(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function l(e){return a[e.type](e)}return"Expected "+function(e){const t=e.map(l);if(t.sort(),t.length>0){let e=1;for(let r=1;r<t.length;r++)t[r-1]!==t[r]&&(t[e]=t[r],e++);t.length=e}switch(t.length){case 1:return t[0];case 2:return t[0]+" or "+t[1];default:return t.slice(0,-1).join(", ")+", or "+t[t.length-1]}}(e)+" but "+function(e){return e?'"'+s(e)+'"':"end of input"}(t)+" found."}}function u(e){if(!e||0===e.length)return null;if("string"==typeof e){const t=p(e);return t&&0!==t.length?t:null}const t=e.map(e=>{if(!Number.isFinite(e.scale)||e.scale<=0)throw new i.A("effect:invalid-scale","scale must be finite and greater than 0",{stop:e});return{scale:e.scale,effects:p(e.value)}});t.sort((e,t)=>t.effects.length-e.effects.length);for(let e=0;e<t.length-1;e++){if(!(0,a.mj)(t[e].effects,t[e+1].effects))throw new i.A("effect:interpolation-impossible","Cannot interpolate by scale between 2 lists of mixed effects",{a:t[e].effects,b:t[e+1].effects});(0,a.O9)(t[e].effects,t[e+1].effects)}return t.sort((e,t)=>t.scale-e.scale),t}function p(e){let t;if(!e)return[];try{t=function(e,t){const r={},i=(t=void 0!==t?t:{}).grammarSource,o={start:Ce};let s=Ce;const n="none",a=")",u=",",p="(",c="%",d="px",y="cm",m="mm",h="in",f="pt",g="pc",v="deg",b="rad",w="grad",C="turn",T="#",S=".",M="e",A=/^[ \t\n\r]/,O=/^[a-z\-]/,N=/^[0-9a-fA-F]/,I=/^[+\-]/,Z=/^[0-9]/,D=ge("none"),j=he("none",!1),F=he(")",!1),_=he(",",!1),x=fe([" ","\t","\n","\r"],!1,!1,!1),B=ge("function"),E=he("(",!1),P=ge("identifier"),L=fe([["a","z"],"-"],!1,!1,!1),R=ge("percentage"),J=he("%",!1),U=ge("length"),k=he("px",!1),$=he("cm",!1),V=he("mm",!1),W=he("in",!1),q=he("pt",!1),G=he("pc",!1),z=ge("angle"),Y=he("deg",!1),K=he("rad",!1),H=he("grad",!1),X=he("turn",!1),Q=ge("number"),ee=ge("color"),te=he("#",!1),re=fe([["0","9"],["a","f"],["A","F"]],!1,!1,!1),ie=fe(["+","-"],!1,!1,!1),oe=fe([["0","9"]],!1,!1,!1),se=he(".",!1),ne=he("e",!1);let ae=0|t.peg$currPos,le=ae;const ue=[{line:1,column:1}];let pe,ce=ae,de=t.peg$maxFailExpected||[],ye=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');s=o[t.startRule]}function me(){return e.substring(le,ae)}function he(e,t){return{type:"literal",text:e,ignoreCase:t}}function fe(e,t,r,i){return{type:"class",parts:e,inverted:t,ignoreCase:r,unicode:i}}function ge(e){return{type:"other",description:e}}function ve(t){let r,i=ue[t];if(i)return i;if(t>=ue.length)r=ue.length-1;else for(r=t;!ue[--r];);for(i=ue[r],i={line:i.line,column:i.column};r<t;)10===e.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return ue[t]=i,i}function be(e,t,r){const o=ve(e),s=ve(t);return{source:i,start:{offset:e,line:o.line,column:o.column},end:{offset:t,line:s.line,column:s.column}}}function we(e){ae<ce||(ae>ce&&(ce=ae,de=[]),de.push(e))}function Ce(){let e;return e=Te(),e===r&&(e=function(){let e,t;if(e=[],t=Se(),t!==r)for(;t!==r;)e.push(t),t=Se();else e=r;return e}()),e}function Te(){let t,i;return ye++,t=ae,Ae(),e.substr(ae,4)===n?(i=n,ae+=4):(i=r,0===ye&&we(j)),i!==r?(Ae(),le=t,t=[]):(ae=t,t=r),ye--,t===r&&0===ye&&we(D),t}function Se(){let t,i,o,s;return t=ae,Ae(),i=function(){let t,i,o;return ye++,t=ae,i=Oe(),i!==r?(40===e.charCodeAt(ae)?(o=p,ae++):(o=r,0===ye&&we(E)),o!==r?(le=t,t=i):(ae=t,t=r)):(ae=t,t=r),ye--,t===r&&(i=r,0===ye&&we(B)),t}(),i!==r?(Ae(),o=function(){let t,i,o,s,n,a,l,p;if(t=ae,i=Me(),i!==r){for(o=[],s=ae,n=Ae(),44===e.charCodeAt(ae)?(a=u,ae++):(a=r,0===ye&&we(_)),a===r&&(a=null),l=Ae(),p=Me(),p!==r?(n=[n,a,l,p],s=n):(ae=s,s=r);s!==r;)o.push(s),s=ae,n=Ae(),44===e.charCodeAt(ae)?(a=u,ae++):(a=r,0===ye&&we(_)),a===r&&(a=null),l=Ae(),p=Me(),p!==r?(n=[n,a,l,p],s=n):(ae=s,s=r);le=t,t=function(e,t){return t.length>0?function(e,t){return[e].concat(function(e){return e.map(function(e){return e[3]})}(t))}(e,t):[e]}(i,o)}else ae=t,t=r;return t}(),o===r&&(o=null),Ae(),41===e.charCodeAt(ae)?(s=a,ae++):(s=r,0===ye&&we(F)),s!==r?(Ae(),le=t,t=function(e,t){return{type:"function",name:e,parameters:t||[]}}(i,o)):(ae=t,t=r)):(ae=t,t=r),t}function Me(){let e,t;return e=ae,t=Ne(),t===r&&(t=Ie(),t===r&&(t=Ze(),t===r&&(t=function(){let e,t;return ye++,e=ae,Ae(),t=je(),t!==r?(le=e,e=function(e){return{value:e,unit:null}}(t)):(ae=e,e=r),ye--,e===r&&0===ye&&we(Q),e}()))),t!==r&&(le=e,t=function(e){return{type:"quantity",value:e.value,unit:e.unit}}(t)),e=t,e===r&&(e=ae,t=De(),t!==r&&(le=e,t=function(e){return{type:"color",colorType:e.type,value:e.value}}(t)),e=t),e}function Ae(){let t,i;for(ye++,t=[],i=e.charAt(ae),A.test(i)?ae++:(i=r,0===ye&&we(x));i!==r;)t.push(i),i=e.charAt(ae),A.test(i)?ae++:(i=r,0===ye&&we(x));return ye--,t}function Oe(){let t,i,o;if(ye++,t=ae,i=[],o=e.charAt(ae),O.test(o)?ae++:(o=r,0===ye&&we(L)),o!==r)for(;o!==r;)i.push(o),o=e.charAt(ae),O.test(o)?ae++:(o=r,0===ye&&we(L));else i=r;return i!==r&&(le=t,i=me()),t=i,ye--,t===r&&(i=r,0===ye&&we(P)),t}function Ne(){let t,i,o;return ye++,t=ae,Ae(),i=je(),i!==r?(37===e.charCodeAt(ae)?(o=c,ae++):(o=r,0===ye&&we(J)),o!==r?(le=t,t=function(e){return{value:e,unit:"%"}}(i)):(ae=t,t=r)):(ae=t,t=r),ye--,t===r&&0===ye&&we(R),t}function Ie(){let t,i,o;return ye++,t=ae,Ae(),i=je(),i!==r?(e.substr(ae,2)===d?(o=d,ae+=2):(o=r,0===ye&&we(k)),o!==r?(le=t,t=function(e){return{value:e,unit:"px"}}(i)):(ae=t,t=r)):(ae=t,t=r),t===r&&(t=ae,Ae(),i=je(),i!==r?(e.substr(ae,2)===y?(o=y,ae+=2):(o=r,0===ye&&we($)),o!==r?(le=t,t=function(e){return{value:e,unit:"cm"}}(i)):(ae=t,t=r)):(ae=t,t=r),t===r&&(t=ae,Ae(),i=je(),i!==r?(e.substr(ae,2)===m?(o=m,ae+=2):(o=r,0===ye&&we(V)),o!==r?(le=t,t=function(e){return{value:e,unit:"mm"}}(i)):(ae=t,t=r)):(ae=t,t=r),t===r&&(t=ae,Ae(),i=je(),i!==r?(e.substr(ae,2)===h?(o=h,ae+=2):(o=r,0===ye&&we(W)),o!==r?(le=t,t=function(e){return{value:e,unit:"in"}}(i)):(ae=t,t=r)):(ae=t,t=r),t===r&&(t=ae,Ae(),i=je(),i!==r?(e.substr(ae,2)===f?(o=f,ae+=2):(o=r,0===ye&&we(q)),o!==r?(le=t,t=function(e){return{value:e,unit:"pt"}}(i)):(ae=t,t=r)):(ae=t,t=r),t===r&&(t=ae,Ae(),i=je(),i!==r?(e.substr(ae,2)===g?(o=g,ae+=2):(o=r,0===ye&&we(G)),o!==r?(le=t,t=function(e){return{value:e,unit:"pc"}}(i)):(ae=t,t=r)):(ae=t,t=r)))))),ye--,t===r&&0===ye&&we(U),t}function Ze(){let t,i,o;return ye++,t=ae,i=je(),i!==r?(e.substr(ae,3)===v?(o=v,ae+=3):(o=r,0===ye&&we(Y)),o!==r?(le=t,t=function(e){return{value:e,unit:"deg"}}(i)):(ae=t,t=r)):(ae=t,t=r),t===r&&(t=ae,i=je(),i!==r?(e.substr(ae,3)===b?(o=b,ae+=3):(o=r,0===ye&&we(K)),o!==r?(le=t,t=function(e){return{value:e,unit:"rad"}}(i)):(ae=t,t=r)):(ae=t,t=r),t===r&&(t=ae,i=je(),i!==r?(e.substr(ae,4)===w?(o=w,ae+=4):(o=r,0===ye&&we(H)),o!==r?(le=t,t=function(e){return{value:e,unit:"grad"}}(i)):(ae=t,t=r)):(ae=t,t=r),t===r&&(t=ae,i=je(),i!==r?(e.substr(ae,4)===C?(o=C,ae+=4):(o=r,0===ye&&we(X)),o!==r?(le=t,t=function(e){return{value:e,unit:"turn"}}(i)):(ae=t,t=r)):(ae=t,t=r)))),ye--,t===r&&(i=r,0===ye&&we(z)),t}function De(){let t,i,o,s;if(ye++,t=ae,35===e.charCodeAt(ae)?(i=T,ae++):(i=r,0===ye&&we(te)),i!==r){if(o=[],s=e.charAt(ae),N.test(s)?ae++:(s=r,0===ye&&we(re)),s!==r)for(;s!==r;)o.push(s),s=e.charAt(ae),N.test(s)?ae++:(s=r,0===ye&&we(re));else o=r;o!==r?(le=t,t={type:"hex",value:me()}):(ae=t,t=r)}else ae=t,t=r;return t===r&&(t=ae,i=Se(),i!==r&&(le=t,i=function(e){return{type:"function",value:e}}(i)),t=i,t===r&&(t=ae,i=Oe(),i!==r&&(le=t,i={type:"named",value:me()}),t=i)),ye--,t===r&&(i=r,0===ye&&we(ee)),t}function je(){let t,i,o,s,n,a,l,u;for(t=ae,i=e.charAt(ae),I.test(i)?ae++:(i=r,0===ye&&we(ie)),i===r&&(i=null),o=ae,s=[],n=e.charAt(ae),Z.test(n)?ae++:(n=r,0===ye&&we(oe));n!==r;)s.push(n),n=e.charAt(ae),Z.test(n)?ae++:(n=r,0===ye&&we(oe));if(46===e.charCodeAt(ae)?(n=S,ae++):(n=r,0===ye&&we(se)),n!==r){if(a=[],l=e.charAt(ae),Z.test(l)?ae++:(l=r,0===ye&&we(oe)),l!==r)for(;l!==r;)a.push(l),l=e.charAt(ae),Z.test(l)?ae++:(l=r,0===ye&&we(oe));else a=r;a!==r?(s=[s,n,a],o=s):(ae=o,o=r)}else ae=o,o=r;if(o===r)if(o=[],s=e.charAt(ae),Z.test(s)?ae++:(s=r,0===ye&&we(oe)),s!==r)for(;s!==r;)o.push(s),s=e.charAt(ae),Z.test(s)?ae++:(s=r,0===ye&&we(oe));else o=r;if(o!==r){if(s=ae,101===e.charCodeAt(ae)?(n=M,ae++):(n=r,0===ye&&we(ne)),n!==r){if(a=e.charAt(ae),I.test(a)?ae++:(a=r,0===ye&&we(ie)),a===r&&(a=null),l=[],u=e.charAt(ae),Z.test(u)?ae++:(u=r,0===ye&&we(oe)),u!==r)for(;u!==r;)l.push(u),u=e.charAt(ae),Z.test(u)?ae++:(u=r,0===ye&&we(oe));else l=r;l!==r?(n=[n,a,l],s=n):(ae=s,s=r)}else ae=s,s=r;s===r&&(s=null),le=t,t=parseFloat(me())}else ae=t,t=r;return t}pe=s();const Fe=pe!==r&&ae===e.length;function _e(){throw pe!==r&&ae<e.length&&we({type:"end"}),function(e,t,r){return new l(l.buildMessage(e,t),e,t,r)}(de,ce<e.length?function(t=ae){const r=e.codePointAt(t);return void 0===r?"":String.fromCodePoint(r)}(ce):null,ce<e.length?be(ce,ce+1):be(ce,ce))}return t.peg$library?{peg$result:pe,peg$currPos:ae,peg$FAILED:r,peg$maxFailExpected:de,peg$maxFailPos:ce,peg$success:Fe,peg$throw:Fe?void 0:_e}:Fe?pe:void _e()}(e)}catch(t){throw new i.A("effect:invalid-syntax","Invalid effect syntax",{value:e,error:t})}return t.map(e=>function(e){try{switch(e.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return function(e){let t=1;return c(e.parameters,1),1===e.parameters.length&&(t=f(e.parameters[0])),new n.yG(e.name,t)}(e);case"opacity":return function(e){let t=1;return c(e.parameters,1),1===e.parameters.length&&(t=f(e.parameters[0])),new n.jm(t)}(e);case"hue-rotate":return function(e){let t=0;return c(e.parameters,1),1===e.parameters.length&&(t=function(e){return function(e){if("quantity"!==e.type||!(0===e.value&&null===e.unit||e.unit&&null!=m[e.unit]))throw new i.A("effect:type-error",`Expected <angle>, Actual: ${d(e)}`,{term:e})}(e),e.value*m[e.unit]||0}(e.parameters[0])),new n.Nd(t)}(e);case"blur":return function(e){let t=0;return c(e.parameters,1),1===e.parameters.length&&(t=g(e.parameters[0]),y(t,e.parameters[0])),new n.Fk(t)}(e);case"drop-shadow":return function(e){const t=[];let r=null;for(const o of e.parameters)if("color"===o.type){if(t.length&&Object.freeze(t),r)throw new i.A("effect:type-error","Accepts only one color",{});r=v(o)}else{const e=g(o);if(Object.isFrozen(t))throw new i.A("effect:type-error","<length> parameters not consecutive",{lengths:t});t.push(e),3===t.length&&y(e,o)}if(t.length<2||t.length>3)throw new i.A("effect:type-error",`Expected <length>{2,3}, Actual: <length>{${t.length}}`,{lengths:t});return new n.$b(t[0],t[1],t[2]||0,r||b("black"))}(e);case"bloom":return function(e){let t=1,r=0,i=0;return c(e.parameters,3),e.parameters[0]&&(t=f(e.parameters[0])),e.parameters[1]&&(r=g(e.parameters[1]),y(r,e.parameters[1])),e.parameters[2]&&(i=f(e.parameters[2])),new n.bv(t,r,i)}(e)}}catch(t){throw t.details.filter=e,t}throw new i.A("effect:unknown-effect",`Effect '${e.name}' is not supported`,{effect:e})}(e))}function c(e,t){if(e.length>t)throw new i.A("effect:type-error",`Function supports up to ${t} parameters, Actual: ${e.length}`,{parameters:e})}function d(e){if("color"===e.type)return"<color>";if(e.unit){if(e.unit in h)return"<length>";if(e.unit in m)return"<angle>";if("%"===e.unit)return"<percentage>"}return"<double>"}function y(e,t){if(e<0)throw new i.A("effect:type-error",`Negative values are not allowed, Actual: ${e}`,{term:t})}const m={deg:1,grad:.9,rad:180/Math.PI,turn:360},h={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function f(e){!function(e){if("quantity"!==e.type||null!==e.unit&&"%"!==e.unit)throw new i.A("effect:type-error",`Expected <double> or <percentage>, Actual: ${d(e)}`,{term:e})}(e);const t=e.value;return y(t,e),"%"===e.unit?.01*t:t}function g(e){return function(e){if("quantity"!==e.type||!(0===e.value&&null===e.unit||e.unit&&null!=h[e.unit]))throw new i.A("effect:type-error",`Expected <length>, Actual: ${d(e)}`,{term:e})}(e),e.value*h[e.unit]||0}function v(e){switch(e.colorType){case"hex":return(0,s.j5)(e.value);case"named":return b(e.value);case"function":return function(e){if(c(e.parameters,4),w.test(e.name))return[f(e.parameters[0]),f(e.parameters[1]),f(e.parameters[2]),e.parameters[3]?f(e.parameters[3]):1];if(C.test(e.name))return(0,s.ay)(function(e){return function(e){if("quantity"!==e.type||null!==e.unit)throw new i.A("effect:type-error",`Expected <double>, Actual: ${d(e)}`,{term:e})}(e),y(e.value,e),e.value}(e.parameters[0]),f(e.parameters[1]),f(e.parameters[2]),e.parameters[3]?f(e.parameters[3]):1);throw new i.A("effect:syntax-error",`Invalid color function '${e.name}'`,{colorFunction:e})}(e.value)}}function b(e){if(!(0,s.V6)(e))throw new i.A("effect:unknown-color",`color '${e}' isn't valid`,{namedColor:e});return(0,s.c4)(e)}const w=/^rgba?/i,C=/^hsla?/i;function T(e,t,r){try{return function(e){if(!e||0===e.length)return null;if(function(e){const t=e[0];return!!t&&"scale"in t}(e)){const t=[];for(const r of e)t.push({scale:r.scale,value:M(r.value)});return t}return M(e)}(e)}catch(e){r?.messages?.push(e)}return null}function S(e,t,r,i){try{const i=function(e){const t=u(e);return t?(0,a.dw)(t)?t.map(e=>e.toJSON()):t.map(({scale:e,effects:t})=>({scale:e,value:t.map(e=>e.toJSON())})):null}(e);(0,o.sM)(r,i,t)}catch(e){i.messages&&i.messages.push(e)}}function M(e){if(!e?.length)return"";const t=[];for(const r of e){let e=[];switch(r.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":e=[A(r,"amount")];break;case"blur":e=[A(r,"radius","pt")];break;case"hue-rotate":e=[A(r,"angle","deg")];break;case"drop-shadow":e=[A(r,"xoffset","pt"),A(r,"yoffset","pt"),A(r,"blurRadius","pt"),O(r,"color")];break;case"bloom":e=[A(r,"strength"),A(r,"radius","pt"),A(r,"threshold")]}const i=`${r.type}(${e.filter(Boolean).join(" ")})`;u(i),t.push(i)}return t.join(" ")}function A(e,t,r){if(null==e[t])throw new i.A("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});return r?e[t]+r:""+e[t]}function O(e,t){if(null==e[t])throw new i.A("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});const r=e[t];return`rgba(${r[0]||0}, ${r[1]||0}, ${r[2]||0}, ${r[3]/255||0})`}},76553:(e,t,r)=>{function i(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{H:()=>i})},80754:(e,t,r)=>{r.d(t,{j7:()=>n,kS:()=>l,kd:()=>a,r8:()=>u});var i=r(82799),o=r(16930),s=r(65864);const n={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:o.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:o.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:o.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:o.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const r=u(e);for(const e of r)for(const r of e)r[0]+=t;return e}function u(e){return(0,s.Bi)(e)?e.rings:e.paths}},92071:(e,t,r)=>{r.d(t,{P:()=>v,L:()=>b});var i=r(31635),o=r(65008),s=r(76953),n=r(4718),a=r(35666);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new l,r=this._originStores[0];r&&r.forEach((e,r)=>{t.set(r,(0,n.o8)(e),0)});for(let r=2;r<a.AU;r++){const i=this._originStores[r];i&&i.forEach((i,o)=>{e&&e.has(o)||t.set(o,(0,n.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),o=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),o!==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),p=r(88620),c=r(40608);const d=e=>{const t=e;let r=class extends t{constructor(...e){super(...e);const t=(0,p.oY)(this),r=t.store,i=new l;t.store=i,(0,s.k)(t,r,i)}read(e,t){(0,u.L)(this,e,t)}getAtOrigin(e,t){const r=y(this),i=(0,a.aB)(t);if("string"==typeof e)return r.get(e,i);const o={};return e.forEach(e=>{o[e]=r.get(e,i)}),o}originOf(e){return(0,a.OL)(this.originIdOf(e))}originIdOf(e){return y(this).originOf(e)}revert(e,t){const r=y(this),i=(0,a.aB)(t),o=(0,p.oY)(this);let s;s="string"==typeof e?"*"===e?r.keys(i):[e]:e,s.forEach(e=>{o.invalidate(e),r.revert(e,i),o.commit(e)})}};return r=(0,i.Cg)([(0,c.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],r),r};function y(e){return(0,p.oY)(e).store}d(o.A);var m=r(16649),h=r(49422);const f=e=>{const t=e;let r=class extends t{constructor(...e){super(...e)}clear(e,t="user"){(0,p.oY)(this).clearOrigin(e,(0,a.aB)(t))}write(e,t){return(0,h.M)(this,e=e||{},t),e}setAtOrigin(e,t,r){(0,p.oY)(this).setAtOrigin(e,t,(0,a.aB)(r))}removeOrigin(e){const t=g(this),r=(0,a.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=g(this),i=(0,a.aB)(t),o=(0,m.Jt)(this,e);for(let t=i+1;t<a.AU;++t)r.delete(e,t);r.set(e,o,i)}toJSON(e){return this.write({},e)}};return r=(0,i.Cg)([(0,c.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],r),r.prototype.toJSON.isDefaultToJSON=!0,r};function g(e){return(0,p.oY)(e).store}const v=e=>{const t=f(d(e));let r=class extends t{};return r=(0,i.Cg)([(0,c.$)("esri.core.MultiOriginJSONSupport")],r),r},b=v(o.A)},92300:(e,t,r)=>{r.d(t,{V:()=>s,X:()=>o});var i=r(65864);function o(e){return{geometryType:(0,i.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function s(e,t,r){const o=(0,i.xD)(t);return e.map(e=>{const t=o.fromJSON(e);return t.spatialReference=r,t})}},95466:(e,t,r)=>{r.d(t,{A:()=>y});var i=r(49186),o=r(53966),s=r(91869),n=r(3330),a=r(12195),l=r(30524),u=r(98623),p=r(56400),c=r(96285);const d=new Map;class y{static fromJSON(e){return new y(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new y(e.fields??[],g(e))}static fromLayerJSON(e){return new y(e.fields??[],g(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=h(t);if(t&&i){const o=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(o,e),this._normalizedFieldsMap.set(i,e),r.push(`${o}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.te)(e)||(0,l.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,l.te)(e)||(0,l.Xz)(e)||e.nullable||void 0!==(0,l.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(m(e))??this._normalizedFieldsMap.get(h(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?(o.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?n.GB.instance:t===u.n$?c.mQ.utcInstance:(0,s.tE)(d,t,()=>c.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.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,a.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function h(e){return(0,l.rS)(e)?.toLowerCase()??""}const f=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const r=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:o}=e,s=(i?"startField"in i?i.startField:i.startTimeField:"")??"",n=(i?"endField"in i?i.endField:i.endTimeField:"")??"",a=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,p.ZS)(e.dateFieldsTimeReference):null,l=o?function(e){return"timeZone"in e}(o)?o.timeZone??a:o.dateFieldsTimeReference?(0,p.ZS)(o.dateFieldsTimeReference):a??u.n$:null,c=i?function(e){return"timeZone"in e}(i)?i.timeZone??a:i.timeReference?(0,p.ZS)(i.timeReference):a:null,d=new Map([[m(o?.creationDateField??""),l],[m(o?.editDateField??""),l],[m(s),c],[m(n),c]]);for(const{name:i,type:o}of e.fields)if(f.has(o))t.set(i,u.L5);else if("date"!==o&&"esriFieldTypeDate"!==o)t.set(i,null);else if(r)t.set(i,u.L5);else{const e=d.get(m(i??""))??a;t.set(i,e)}return t}},96576:(e,t,r)=>{r.d(t,{A:()=>d});var i,o=r(31635),s=r(4718),n=r(10107),a=(r(44208),r(53966),r(93223)),l=r(40608),u=r(92438),p=r(63988),c=r(49849);let d=i=class extends((0,p.h)(u.A)){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.symbols.map(r=>r.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}get symbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,t)=>e+t.getAttributeHash(),"")??""}getMeshHash(){return this.symbols.reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new i({description:this.description,label:this.label,symbol:(0,s.o8)(this.symbol),visualVariables:(0,s.o8)(this.visualVariables),authoringInfo:(0,s.o8)(this.authoringInfo)})}};(0,o.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],d.prototype,"description",void 0),(0,o.Cg)([(0,n.MZ)({type:String,json:{write:!0}})],d.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)(c.Wp)],d.prototype,"symbol",void 0),(0,o.Cg)([(0,a.e)({simple:"simple"})],d.prototype,"type",void 0),d=i=(0,o.Cg)([(0,l.$)("esri.renderers.SimpleRenderer")],d)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5335,8256],{4146:(t,e,r)=>{r.d(e,{A:()=>w});var i=r(31635),s=r(78888),n=r(49186),o=r(65529),a=r(4902),l=r(92474),u=r(53966),c=r(74887),p=r(84952),d=r(10107),g=(r(44208),r(87811),r(40608)),h=r(5443),y=r(16930),f=r(92602),m=r(79677);let v=0,w=class extends((0,o.Zt)((0,a.sA)(l.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new h.A(-180,-90,180,90,y.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=y.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(t){const e="string"==typeof t?{url:t}:t;return(await r.e(7982).then(r.bind(r,27982))).fromUrl(e)}static fromPortalItem(t){return async function(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:i}=await r.e(5613).then(r.bind(r,45613));try{return await i(e)}catch(t){const r=e?.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+"')",t),t}}(t)}initialize(){this.when().catch(t=>{(0,c.zf)(t)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const e=this;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"groundLayers"in t&&t.groundLayers.includes(e)?t.groundLayers.remove(e):"referenceLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e),this._set("parent",null)}}get effectiveVisible(){let t=this.visible;const e=this.parent;return t&&e&&"effectiveVisible"in e&&(t&&=e.effectiveVisible),t}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}get parsedUrl(){return(0,p.An)(this.url)}createLayerView(t,e){return Promise.reject(new n.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await(0,s.A)(t,{query:{f:"json"},responseType:"json"})).data;throw new n.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i.Cg)([(0,d.MZ)({type:String})],w.prototype,"attributionDataUrl",void 0),(0,i.Cg)([(0,d.MZ)({readOnly:!0})],w.prototype,"effectiveVisible",null),(0,i.Cg)([(0,d.MZ)({type:h.A})],w.prototype,"fullExtent",void 0),(0,i.Cg)([(0,d.MZ)({readOnly:!0})],w.prototype,"hasAttributionData",null),(0,i.Cg)([(0,d.MZ)({type:String,clonable:!1})],w.prototype,"id",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"legendEnabled",void 0),(0,i.Cg)([(0,d.MZ)({type:["show","hide","hide-children"]})],w.prototype,"listMode",void 0),(0,i.Cg)([(0,d.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],w.prototype,"opacity",void 0),(0,i.Cg)([(0,d.MZ)({clonable:!1})],w.prototype,"parent",void 0),(0,i.Cg)([(0,d.MZ)({readOnly:!0})],w.prototype,"parsedUrl",null),(0,i.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],w.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean})],w.prototype,"popupEnabled",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean})],w.prototype,"attributionVisible",void 0),(0,i.Cg)([(0,d.MZ)({type:y.A})],w.prototype,"spatialReference",void 0),(0,i.Cg)([(0,d.MZ)({type:String})],w.prototype,"title",void 0),(0,i.Cg)([(0,d.MZ)({readOnly:!0,json:{read:!1}})],w.prototype,"type",void 0),(0,i.Cg)([(0,d.MZ)()],w.prototype,"url",void 0),(0,i.Cg)([(0,d.MZ)({type:m.A})],w.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,d.MZ)({type:Boolean,nonNullable:!0})],w.prototype,"visible",void 0),w=(0,i.Cg)([(0,g.$)("esri.layers.Layer")],w)},4902:(t,e,r)=>{r.d(e,{PH:()=>a,sA:()=>o});var i=r(31635),s=r(40608);let n=0;const o=t=>{const e=t;let r=class extends e{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n++})}};return r=(0,i.Cg)([(0,s.$)("esri.core.Identifiable")],r),r},a=t=>{const e=t;let r=class extends e{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:n++})}};return r=(0,i.Cg)([(0,s.$)("esri.core.Identifiable.NumericIdentifiable")],r),r};o(class{})},8303:(t,e,r)=>{r.d(e,{A:()=>A});var i=r(31635),s=r(92602),n=r(70333),o=r(78888),a=r(60999),l=r(49186),u=r(53966),c=r(97768),p=r(74887),d=r(84952),g=r(10107),h=(r(44208),r(87811),r(36005)),y=r(40608),f=r(43937),m=r(77548),v=r(20655),w=r(80812),S=r(41318),b=r(10407);const A=t=>{const e=t;let A=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,e,r){if(e.itemId)return new w.default({id:e.itemId,portal:r?.portal})}writePortalItem(t,e){t?.id&&(e.itemId=t.id)}async loadFromPortal(t,e){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,p.Te)(e),await i({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap,populateGroupLayer:t.populateGroupLayer},e)}catch(t){throw(0,p.zf)(t)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${t}`),t}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch(t=>((0,p.QP)(t),!0)))}async setUserPrivileges(t,e){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(t,e);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(t){(0,p.QP)(t)}}async _fetchUserPrivileges(t,e){let r=this.portalItem;if(!t||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=!n.id?.findCredential(this.url),s=t===r.id;if(s&&r.portal.user)return this._getUserPrivileges(r,i);let o,a;if(s)o=r.portal.url;else try{o=await(0,m.wI)(this.url,e)}catch(t){(0,p.QP)(t)}if(!o||!(0,d.b8)(o,r.portal.url))return this._fetchFallbackUserPrivileges(e);try{const t=null!=e?e.signal:null;a=await(n.id?.getCredential(`${o}/sharing`,{prompt:!1,signal:t}))}catch(t){(0,p.QP)(t)}const l=!0,u=!1,c=!1;if(!a)return{features:{edit:l,fullEdit:u},content:{updateItem:c}};try{if(s?await r.reload():(r=new w.default({id:t,portal:{url:o}}),await r.load(e)),r.portal.user)return this._getUserPrivileges(r,i)}catch(t){(0,p.QP)(t)}return{features:{edit:l,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(t,e){const r=(0,b.It)(t);return e&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(t){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(t)}catch(t){(0,p.QP)(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const e=this.url?n.id?.findCredential(this.url):null;if(!e)return!0;const r=C.credential===e?C.user:await this._fetchEditingUser(t);return C.credential=e,C.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const e=this.portalItem?.portal?.user;if(e)return e;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,d.S8)(s.restUrl)===(0,d.S8)(i))return s.user;const l=`${i}/community/self`,u=null!=t?t.signal:null,c=await(0,a.Ke)((0,o.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?S.A.fromJSON(c.value.data):null}read(t,e){e&&(e.layer=this),super.read(t,e)}write(t,e){const r=e?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&i&&!(0,d.ut)(i.restUrl,r.restUrl)?(e.messages&&e.messages.push(new l.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(t,{...e,layer:this})}};return(0,i.Cg)([(0,g.MZ)({type:w.default})],A.prototype,"portalItem",null),(0,i.Cg)([(0,h.w)("web-document","portalItem",["itemId"])],A.prototype,"readPortalItem",null),(0,i.Cg)([(0,f.K)("web-document","portalItem",{itemId:{type:String}})],A.prototype,"writePortalItem",null),(0,i.Cg)([(0,g.MZ)({clonable:!1})],A.prototype,"resourceReferences",void 0),(0,i.Cg)([(0,g.MZ)({type:Boolean,readOnly:!0})],A.prototype,"userHasEditingPrivileges",void 0),(0,i.Cg)([(0,g.MZ)({type:Boolean,readOnly:!0})],A.prototype,"userHasFullEditingPrivileges",void 0),(0,i.Cg)([(0,g.MZ)({type:Boolean,readOnly:!0})],A.prototype,"userHasUpdateItemPrivileges",void 0),A=(0,i.Cg)([(0,y.$)("esri.layers.mixins.PortalLayer")],A),A},C={credential:null,user:null}},13069:(t,e,r)=>{r.d(e,{AG:()=>a,lk:()=>s,vD:()=>o,yS:()=>n});const i="randomUUID"in crypto;function s(){if(i)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=e=>t[e].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function n(){return`{${s().toUpperCase()}}`}function o(){return`{${s()}}`}function a(t){const e=t.toUpperCase();return t.startsWith("{")?e:`{${e}}`}},18768:(t,e,r)=>{r.d(e,{b:()=>l});var i=r(31635),s=r(53966),n=r(10107),o=(r(44208),r(87811),r(40608)),a=r(60694);const l=t=>{const e=t;let r=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const t=(0,a.qg)(this.url);if(t?.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",(0,a.Jf)(t,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}},25036:(t,e,r)=>{r.d(e,{j:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=t=>{const e=t;let r=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const t={minScale:this.minScale,maxScale:this.maxScale},e=this.parent;e&&"effectiveScaleRange"in e&&function(t,e){t.minScale=t.minScale>0?e.minScale>0?Math.min(t.minScale,e.minScale):t.minScale:e.minScale,t.maxScale=t.maxScale>0?e.maxScale>0?Math.max(t.maxScale,e.maxScale):t.maxScale:e.maxScale}(t,e.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===t.minScale&&r.maxScale===t.maxScale?r:t}};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}},52136:(t,e,r)=>{r.d(e,{p:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=t=>{const e=t;let r=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(t){null!=t?this._override("apiKey",t):(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}},58325:(t,e,r)=>{r.d(e,{A:()=>w});var i,s=r(31635),n=r(78888),o=r(7762),a=r(25482),l=r(84952),u=r(10107),c=(r(44208),r(53966),r(87811),r(40608)),p=r(4718),d=r(67076),g=r(43937),h=r(87024),y=r(39829),f=r(98988);let m=i=class extends a.o{constructor(t){super(t),this.geometry=null,this.type="clip"}writeGeometry(t,e,r,i){if(i.layer?.spatialReference&&!i.layer.spatialReference.equals(this.geometry.spatialReference)){if(!(0,f.canProjectWithoutEngine)(t.spatialReference,i.layer.spatialReference))return void(i?.messages&&i.messages.push(new d.A("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:i.layer.spatialReference,context:i})));const s=new y.A;(0,f.projectPolygon)(t,s,i.layer.spatialReference),e[r]=s.toJSON(i)}else e[r]=t.toJSON(i)}clone(){return new i({geometry:(0,p.o8)(this.geometry),type:this.type})}};var v;(0,s.Cg)([(0,u.MZ)({type:y.A}),(0,h.P)()],m.prototype,"geometry",void 0),(0,s.Cg)([(0,g.K)(["web-scene","portal-item"],"geometry")],m.prototype,"writeGeometry",null),(0,s.Cg)([(0,u.MZ)({type:["clip","mask","replace"],nonNullable:!0}),(0,h.P)()],m.prototype,"type",void 0),m=i=(0,s.Cg)([(0,c.$)("esri.layers.support.SceneModification")],m);let w=v=class extends((0,a.T)(o.A.ofType(m))){constructor(t){super(t),this.url=null}clone(){return new v({url:this.url,items:this.items.map(t=>t.clone())})}toJSON(t){return this.toArray().map(e=>e.toJSON(t)).filter(t=>!!t.geometry)}static fromJSON(t,e){const r=new v;for(const i of t)r.add(m.fromJSON(i,e));return r}static async fromUrl(t,e,r){const i={url:(0,l.An)(t),origin:"service"},s=await(0,n.A)(t,{responseType:"json",signal:r?.signal}),o=e.toJSON(),a=[];for(const t of s.data)a.push(m.fromJSON({...t,geometry:{spatialReference:o,...t.geometry}},i));return new v({url:t,items:a})}};(0,s.Cg)([(0,u.MZ)({type:String})],w.prototype,"url",void 0),w=v=(0,s.Cg)([(0,c.$)("esri.layers.support.SceneModifications")],w)},69208:(t,e,r)=>{r.d(e,{d:()=>o});var i=r(31635),s=r(10107),n=(r(44208),r(53966),r(87811),r(40608));const o=t=>{const e=t;let r=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,i.Cg)([(0,s.MZ)({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],r.prototype,"customParameters",void 0),r=(0,i.Cg)([(0,n.$)("esri.layers.mixins.CustomParametersMixin")],r),r}},69540:(t,e,r)=>{r.d(e,{OU:()=>c,Pw:()=>p});var i=r(31635),s=r(65008),n=(r(44208),r(4718)),o=(r(53966),r(97768)),a=r(88620),l=r(40608);const u=Symbol("ClonableMixin"),c=t=>{var e;const r=t;let s=class extends r{constructor(){super(...arguments),this[e]=!0}static{e=u}clone(t){const e=(0,a.oY)(this);(0,o.Lw)(e,"unable to clone instance of non-accessor class");const r=e.metadata,i=e.store,s={},l=new Map;for(const e in r){const o=r[e],a=i?.originOf(e),u=o.clonable;if(o.readOnly||!1===u||7!==a&&0!==a&&5!==a&&4!==a)continue;const c=this[e];let p=null;if("function"==typeof u)p=u(c,t);else if("reference"===u)p=c;else if(p=(0,n.TU)(c,t),null!=c&&null==p)continue;0===a?l.set(e,p):s[e]=p}const u=new(0,Object.getPrototypeOf(this).constructor)(s);if(l.size){const t=(0,a.oY)(u)?.store;if(t)for(const[e,r]of l)t.set(e,r,0)}return u}};return s=(0,i.Cg)([(0,l.$)("esri.core.Clonable")],s),s},p=c(s.A)},78553:(t,e,r)=>{r.d(e,{D:()=>n,p:()=>s});var i=r(56507);function s(t){const e=(0,i.Vr)(100*(1-t));return Math.max(0,Math.min(e,100))}function n(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}},79677:(t,e,r)=>{r.d(e,{A:()=>d});var i,s=r(31635),n=r(25482),o=r(88930),a=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),u=r(40608),c=r(43937),p=r(98623);let d=class extends n.o{static{i=this}static get allTime(){return g}static get empty(){return h}static fromArray(t){return new i({start:null!=t[0]?new Date(t[0]):t[0],end:null!=t[1]?new Date(t[1]):t[1]})}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=t.start?.getTime()??t.start,s=t.end?.getTime()??t.end;return e===i&&r===s}expandTo(t,e=p.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.lL)(r,t,e));let s=this.end;if(s){const r=(0,o.lL)(s,t,e);s=s.getTime()===r.getTime()?r:(0,o.S1)(r,1,t,e)}return new i({start:r,end:s})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return i.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=t.start?.getTime()??-1/0,n=t.end?.getTime()??1/0;let o,a;return s>=e&&s<=r?o=s:e>=s&&e<=n&&(o=e),r>=s&&r<=n?a=r:n>=e&&n<=r&&(a=n),null==o||null==a||isNaN(o)||isNaN(a)?i.empty:new i({start:o===-1/0?null:new Date(o),end:a===1/0?null:new Date(a)})}offset(t,e,r=p.qU){if(this.isEmpty||this.isAllTime)return this.clone();const s=new i,{start:n,end:a}=this;return null!=n&&(s.start=(0,o.S1)(n,t,e,r)),null!=a&&(s.end=(0,o.S1)(a,t,e,r)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return g.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,r=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new i({start:e,end:r})}};(0,s.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,s.Cg)([(0,l.w)("end")],d.prototype,"readEnd",null),(0,s.Cg)([(0,c.K)("end")],d.prototype,"writeEnd",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,s.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,s.Cg)([(0,l.w)("start")],d.prototype,"readStart",null),(0,s.Cg)([(0,c.K)("start")],d.prototype,"writeStart",null),d=i=(0,s.Cg)([(0,u.$)("esri.time.TimeExtent")],d);const g=new d,h=new d({start:void 0,end:void 0})},80200:(t,e,r)=>{r.d(e,{T:()=>i,d:()=>y});const i={Base64:0,Hex:1,String:2,Raw:3},s=8,n=(1<<s)-1;function o(t,e){const r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function a(t){const e=[];for(let r=0,i=t.length*s;r<i;r+=s)e[r>>5]|=(t.charCodeAt(r/s)&n)<<r%32;return e}function l(t){const e=[];for(let r=0,i=32*t.length;r<i;r+=s)e.push(String.fromCharCode(t[r>>5]>>>r%32&n));return e.join("")}function u(t,e,r,i,s,n){return o(function(t,e){return t<<e|t>>>32-e}(o(o(e,t),o(i,n)),s),r)}function c(t,e,r,i,s,n,o){return u(e&r|~e&i,t,e,s,n,o)}function p(t,e,r,i,s,n,o){return u(e&i|r&~i,t,e,s,n,o)}function d(t,e,r,i,s,n,o){return u(e^r^i,t,e,s,n,o)}function g(t,e,r,i,s,n,o){return u(r^(e|~i),t,e,s,n,o)}function h(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;let r=1732584193,i=-271733879,s=-1732584194,n=271733878;for(let e=0;e<t.length;e+=16){const a=r,l=i,u=s,h=n;r=c(r,i,s,n,t[e],7,-680876936),n=c(n,r,i,s,t[e+1],12,-389564586),s=c(s,n,r,i,t[e+2],17,606105819),i=c(i,s,n,r,t[e+3],22,-1044525330),r=c(r,i,s,n,t[e+4],7,-176418897),n=c(n,r,i,s,t[e+5],12,1200080426),s=c(s,n,r,i,t[e+6],17,-1473231341),i=c(i,s,n,r,t[e+7],22,-45705983),r=c(r,i,s,n,t[e+8],7,1770035416),n=c(n,r,i,s,t[e+9],12,-1958414417),s=c(s,n,r,i,t[e+10],17,-42063),i=c(i,s,n,r,t[e+11],22,-1990404162),r=c(r,i,s,n,t[e+12],7,1804603682),n=c(n,r,i,s,t[e+13],12,-40341101),s=c(s,n,r,i,t[e+14],17,-1502002290),i=c(i,s,n,r,t[e+15],22,1236535329),r=p(r,i,s,n,t[e+1],5,-165796510),n=p(n,r,i,s,t[e+6],9,-1069501632),s=p(s,n,r,i,t[e+11],14,643717713),i=p(i,s,n,r,t[e],20,-373897302),r=p(r,i,s,n,t[e+5],5,-701558691),n=p(n,r,i,s,t[e+10],9,38016083),s=p(s,n,r,i,t[e+15],14,-660478335),i=p(i,s,n,r,t[e+4],20,-405537848),r=p(r,i,s,n,t[e+9],5,568446438),n=p(n,r,i,s,t[e+14],9,-1019803690),s=p(s,n,r,i,t[e+3],14,-187363961),i=p(i,s,n,r,t[e+8],20,1163531501),r=p(r,i,s,n,t[e+13],5,-1444681467),n=p(n,r,i,s,t[e+2],9,-51403784),s=p(s,n,r,i,t[e+7],14,1735328473),i=p(i,s,n,r,t[e+12],20,-1926607734),r=d(r,i,s,n,t[e+5],4,-378558),n=d(n,r,i,s,t[e+8],11,-2022574463),s=d(s,n,r,i,t[e+11],16,1839030562),i=d(i,s,n,r,t[e+14],23,-35309556),r=d(r,i,s,n,t[e+1],4,-1530992060),n=d(n,r,i,s,t[e+4],11,1272893353),s=d(s,n,r,i,t[e+7],16,-155497632),i=d(i,s,n,r,t[e+10],23,-1094730640),r=d(r,i,s,n,t[e+13],4,681279174),n=d(n,r,i,s,t[e],11,-358537222),s=d(s,n,r,i,t[e+3],16,-722521979),i=d(i,s,n,r,t[e+6],23,76029189),r=d(r,i,s,n,t[e+9],4,-640364487),n=d(n,r,i,s,t[e+12],11,-421815835),s=d(s,n,r,i,t[e+15],16,530742520),i=d(i,s,n,r,t[e+2],23,-995338651),r=g(r,i,s,n,t[e],6,-198630844),n=g(n,r,i,s,t[e+7],10,1126891415),s=g(s,n,r,i,t[e+14],15,-1416354905),i=g(i,s,n,r,t[e+5],21,-57434055),r=g(r,i,s,n,t[e+12],6,1700485571),n=g(n,r,i,s,t[e+3],10,-1894986606),s=g(s,n,r,i,t[e+10],15,-1051523),i=g(i,s,n,r,t[e+1],21,-2054922799),r=g(r,i,s,n,t[e+8],6,1873313359),n=g(n,r,i,s,t[e+15],10,-30611744),s=g(s,n,r,i,t[e+6],15,-1560198380),i=g(i,s,n,r,t[e+13],21,1309151649),r=g(r,i,s,n,t[e+4],6,-145523070),n=g(n,r,i,s,t[e+11],10,-1120210379),s=g(s,n,r,i,t[e+2],15,718787259),i=g(i,s,n,r,t[e+9],21,-343485551),r=o(r,a),i=o(i,l),s=o(s,u),n=o(n,h)}return[r,i,s,n]}function y(t,e=i.Hex){const r=e||i.Base64,n=h(a(t),t.length*s);switch(r){case i.Raw:return n;case i.Hex:return function(t){const e="0123456789abcdef",r=[];for(let i=0,s=4*t.length;i<s;i++)r.push(e.charAt(t[i>>2]>>i%4*8+4&15)+e.charAt(t[i>>2]>>i%4*8&15));return r.join("")}(n);case i.String:return l(n);case i.Base64:return function(t){const e=[];for(let r=0,i=4*t.length;r<i;r+=3){const i=(t[r>>2]>>r%4*8&255)<<16|(t[r+1>>2]>>(r+1)%4*8&255)<<8|t[r+2>>2]>>(r+2)%4*8&255;for(let s=0;s<4;s++)8*r+6*s>32*t.length?e.push("="):e.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>6*(3-s)&63))}return e.join("")}(n)}}},85648:(t,e,r)=>{r.d(e,{n:()=>s});var i=r(84952);function s(t){return n[function(t){return"json"===t.type?"application/json":"blob"===t.type?t.blob.type:function(t){const e=(0,i.Zo)(t);return l[e]||o}(t.url)}(t)]||a}const n={},o="text/plain",a=n[o],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const t in l)n[l[t]]=t},87024:(t,e,r)=>{r.d(e,{P:()=>g});var i=r(49186),s=r(80200),n=r(76553),o=r(84952),a=r(13069),l=r(96156),u=r(35666),c=r(10107),p=r(85648),d=r(97159);function g(t){const e=t?.origins??[void 0];return(r,i)=>{const s=function(t,e,r){if("resource"===t?.type)return function(t,e,r){const i=(0,l.z4)(e,r);return{type:String,read:(t,e,r)=>{const s=(0,d.r)(t,e,r);return i.type===String?s:"function"==typeof i.type?new i.type({url:s}):void 0},write:{isRequired:i.json?.write?.isRequired,writer(e,s,a,l){if(!l?.resources)return"string"==typeof e?void(s[a]=(0,d.t)(e,l)):void(s[a]=e.write({},l));const c=function(t){return null==t?null:"string"==typeof t?t:t.url}(e),g=(0,d.t)(c,{...l,verifyItemRelativeUrls:l?.verifyItemRelativeUrls?{writtenUrls:l.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},1),m=i.type!==String&&(!(0,n.H)(this)||l?.origin&&this.originIdOf(r)>(0,u.aB)(l.origin)),v={object:this,propertyName:r,value:e,targetUrl:g,dest:s,targetPropertyName:a,context:l,params:t};l?.portalItem&&g&&!(0,o.oP)(g)?m&&t?.contentAddressed?h(v):m?function(t){const{context:e,targetUrl:r,params:i,value:s,dest:n,targetPropertyName:a}=t;if(!e.portalItem)return;const l=e.portalItem.resourceFromPath(r),u=f(s,r,e),c=(0,p.n)(u),d=(0,o.Zo)(l.path),g=i?.compress??!1;c===d?(e.resources&&y({...t,resource:l,content:u,compress:g,updates:e.resources.toUpdate}),n[a]=r):h(t)}(v):function({context:t,targetUrl:e,dest:r,targetPropertyName:i}){t.portalItem&&t.resources&&(t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(e),compress:!1}),r[i]=e)}(v):l?.portalItem&&(null==g||null!=(0,d.i)(g)||(0,o.w8)(g)||m)?h(v):s[a]=g}}}}(t,e,r);switch(t?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:t,write:e}=d.b;return{read:t,write:e}}}}(t,r,i);for(const t of e){const e=(0,c.rM)(r,t,i);for(const t in s)e[t]=s[t]}}}function h(t){const{targetUrl:e,params:r,value:n,context:l,dest:u,targetPropertyName:c}=t;if(!l.portalItem)return;const g=(0,d.p)(e),h=f(n,e,l);if(r?.contentAddressed&&"json"!==h.type)return void l.messages?.push(new i.A("persistable:contentAddressingUnsupported",`Property "${c}" is trying to serializing a resource with content of type ${h.type} with content addressing. Content addressing is only supported for json resources.`,{content:h}));const m=r?.contentAddressed&&"json"===h.type?(0,s.d)(h.jsonString):g?.filename??(0,a.lk)(),v=(0,o.fj)(r?.prefix??g?.prefix,m),w=`${v}.${(0,p.n)(h)}`;if(r?.contentAddressed&&l.resources&&"json"===h.type){const t=l.resources.toKeep.find(({resource:t})=>t.path===w)??l.resources.toAdd.find(({resource:t})=>t.path===w);if(t)return void(u[c]=t.resource.itemRelativeUrl)}const S=l.portalItem.resourceFromPath(w);(0,o.w8)(e)&&l.resources&&l.resources.pendingOperations.push((0,o.tk)(e).then(t=>{S.path=`${v}.${(0,p.n)({type:"blob",blob:t})}`,u[c]=S.itemRelativeUrl}).catch(()=>{}));const b=r?.compress??!1;l.resources&&y({...t,resource:S,content:h,compress:b,updates:l.resources.toAdd}),u[c]=S.itemRelativeUrl}function y({object:t,propertyName:e,updates:r,resource:i,content:s,compress:n}){r.push({resource:i,content:s,compress:n,finish:r=>{!function(t,e,r){"string"==typeof t[e]?t[e]=r.url:t[e].url=r.url}(t,e,r)}})}function f(t,e,r){return"string"==typeof t?{type:"url",url:e}:{type:"json",jsonString:JSON.stringify(t.toJSON(r))}}},92071:(t,e,r)=>{r.d(e,{P:()=>v,L:()=>w});var i=r(31635),s=r(65008),n=r(76953),o=r(4718),a=r(35666);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(t){const e=new l,r=this._originStores[0];r&&r.forEach((t,r)=>{e.set(r,(0,o.o8)(t),0)});for(let r=2;r<a.AU;r++){const i=this._originStores[r];i&&i.forEach((i,s)=>{t&&t.has(s)||e.set(s,(0,o.o8)(i),r)})}return e}get(t,e){const r=void 0===e?this._values:this._originStores[e];return r?r.get(t):void 0}keys(t){const e=null==t?this._values:this._originStores[t];return e?[...e.keys()]:[]}set(t,e,r=7){let i=this._originStores[r];if(i||(i=new Map,this._originStores[r]=i),i.set(t,e),!this._values.has(t)||this._propertyOriginMap.get(t)<=r){const i=this._values.get(t);return this._values.set(t,e),this._propertyOriginMap.set(t,r),i!==e}return!1}delete(t,e=7){const r=this._originStores[e];if(!r)return;const i=r.get(t);if(r.delete(t),this._values.has(t)&&this._propertyOriginMap.get(t)===e){this._values.delete(t);for(let r=e-1;r>=0;r--){const e=this._originStores[r];if(e&&e.has(t)){this._values.set(t,e.get(t)),this._propertyOriginMap.set(t,r);break}}}return i}has(t,e){const r=void 0===e?this._values:this._originStores[e];return!!r&&r.has(t)}revert(t,e){for(;e>0&&!this.has(t,e);)--e;const r=this._originStores[e],i=r?.get(t),s=this._values.get(t);return this._values.set(t,i),this._propertyOriginMap.set(t,e),s!==i}originOf(t){return this._propertyOriginMap.get(t)||0}isAtOrigin(t,e){return this.has(t,e)&&this.originOf(t)===e}isBelowOrigin(t,e){return!this.has(t)||this.originOf(t)<e}forEach(t){this._values.forEach(t)}}var u=r(45917),c=r(88620),p=r(40608);const d=t=>{const e=t;let r=class extends e{constructor(...t){super(...t);const e=(0,c.oY)(this),r=e.store,i=new l;e.store=i,(0,n.k)(e,r,i)}read(t,e){(0,u.L)(this,t,e)}getAtOrigin(t,e){const r=g(this),i=(0,a.aB)(e);if("string"==typeof t)return r.get(t,i);const s={};return t.forEach(t=>{s[t]=r.get(t,i)}),s}originOf(t){return(0,a.OL)(this.originIdOf(t))}originIdOf(t){return g(this).originOf(t)}revert(t,e){const r=g(this),i=(0,a.aB)(e),s=(0,c.oY)(this);let n;n="string"==typeof t?"*"===t?r.keys(i):[t]:t,n.forEach(t=>{s.invalidate(t),r.revert(t,i),s.commit(t)})}};return r=(0,i.Cg)([(0,p.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],r),r};function g(t){return(0,c.oY)(t).store}d(s.A);var h=r(16649),y=r(49422);const f=t=>{const e=t;let r=class extends e{constructor(...t){super(...t)}clear(t,e="user"){(0,c.oY)(this).clearOrigin(t,(0,a.aB)(e))}write(t,e){return(0,y.M)(this,t=t||{},e),t}setAtOrigin(t,e,r){(0,c.oY)(this).setAtOrigin(t,e,(0,a.aB)(r))}removeOrigin(t){const e=m(this),r=(0,a.aB)(t),i=e.keys(r);for(const t of i)e.originOf(t)===r&&e.set(t,e.get(t,r),7)}updateOrigin(t,e){const r=m(this),i=(0,a.aB)(e),s=(0,h.Jt)(this,t);for(let e=i+1;e<a.AU;++e)r.delete(t,e);r.set(t,s,i)}toJSON(t){return this.write({},t)}};return r=(0,i.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],r),r.prototype.toJSON.isDefaultToJSON=!0,r};function m(t){return(0,c.oY)(t).store}const v=t=>{const e=f(d(t));let r=class extends e{};return r=(0,i.Cg)([(0,p.$)("esri.core.MultiOriginJSONSupport")],r),r},w=v(s.A)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[603],{70603:(e,t,n)=>{n.r(t),n.d(t,{registerFunctions:()=>ie});var i=n(52106),r=n(66131),o=n(47609),a=n(66395),s=n(59534),l=n(85935),u=n(93833),d=n(40334),c=n(93818),f=n(78878),m=n(80672),p=n(68423),y=n(35704),w=n(86691),g=n(54461),I=n(85978),h=n(30235),F=n(87594),b=n(33325),D=n(80609),N=n(334),A=n(74887),T=n(88368),v=n(29784),k=n(20437),C=n(20655),E=n(78888),S=n(51447),$=n(53966),x=n(66552);new x.J({Clean:"clean",Dirty:"dirty"}),new x.J({Physical:"physical",Virtual:"virtual"}),new x.J({"Start and end":"start-and-end",Start:"start",Midspan:"midspan",End:"end"}),new x.J({startingPoint:"starting-point",barrier:"barrier",stoppingPoint:"stopping-point"}),new x.J({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation",path:"path",circuit:"circuit"});const Z=new x.J({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionEdgeMidspanConnectivity:"junction-edge-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"});new x.J({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});var j=n(2272),U=n(31635),M=n(25482),L=n(10107),P=(n(44208),n(87811),n(40608)),R=n(36005),O=n(43937),G=n(82799);let B=class extends M.o{constructor(e){super(e),this.type="networkElement",this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};(0,U.Cg)([(0,L.MZ)({json:{write:!1}})],B.prototype,"type",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],B.prototype,"assetGroupCode",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],B.prototype,"assetTypeCode",void 0),(0,U.Cg)([(0,L.MZ)({type:String,json:{write:!0}})],B.prototype,"globalId",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],B.prototype,"networkSourceId",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],B.prototype,"objectId",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],B.prototype,"positionFrom",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],B.prototype,"positionTo",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],B.prototype,"terminalId",void 0),B=(0,U.Cg)([(0,P.$)("esri.rest.networks.support.NetworkElement")],B);let J=class extends B{constructor(e){super(e),this.type="telecomNetworkElement",this.firstUnit=null,this.numUnits=null}};(0,U.Cg)([(0,L.MZ)({json:{write:!1}})],J.prototype,"type",void 0),(0,U.Cg)([(0,L.MZ)({json:{write:!0}})],J.prototype,"firstUnit",void 0),(0,U.Cg)([(0,L.MZ)({json:{write:!0}})],J.prototype,"numUnits",void 0),J=(0,U.Cg)([(0,P.$)("esri.rest.networks.support.TelecomNetworkElement")],J);let V=class extends M.o{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return t.fromFirstUnit||t.fromNumUnits?new J({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId,firstUnit:t.fromFirstUnit,numUnits:t.fromNumUnits}):new B({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){if(e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId,"telecomNetworkElement"===e.type)){const n=e;t.fromFirstUnit=n.firstUnit,t.fromNumUnits=n.numUnits}}readToNetworkElement(e,t){return t.toFirstUnit||t.toNumUnits?new J({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId,firstUnit:t.toFirstUnit,numUnits:t.toNumUnits}):new B({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){if(e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId,"telecomNetworkElement"===e.type)){const n=e;t.toFirstUnit=n.firstUnit,t.toNumUnits=n.numUnits}}};(0,U.Cg)([(0,L.MZ)({type:String,json:{write:!0}})],V.prototype,"globalId",void 0),(0,U.Cg)([(0,L.MZ)({type:Z.apiValues,json:{type:Z.jsonValues,read:Z.read,write:Z.write}})],V.prototype,"associationType",void 0),(0,U.Cg)([(0,L.MZ)({type:B,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number},fromFirstUnit:{type:Number},fromNumUnits:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId","fromFirstUnit","fromNumUnits"]}}})],V.prototype,"fromNetworkElement",void 0),(0,U.Cg)([(0,R.w)("fromNetworkElement")],V.prototype,"readFromNetworkElement",null),(0,U.Cg)([(0,O.K)("fromNetworkElement")],V.prototype,"writeFromNetworkElement",null),(0,U.Cg)([(0,L.MZ)({type:B,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number},toFirstUnit:{type:Number},toNumUnits:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId","toFirstUnit","toNumUnits"]}}})],V.prototype,"toNetworkElement",void 0),(0,U.Cg)([(0,R.w)("toNetworkElement")],V.prototype,"readToNetworkElement",null),(0,U.Cg)([(0,O.K)("toNetworkElement")],V.prototype,"writeToNetworkElement",null),(0,U.Cg)([(0,L.MZ)({type:G.A,json:{write:!0}})],V.prototype,"geometry",void 0),(0,U.Cg)([(0,L.MZ)({type:String,json:{write:!0}})],V.prototype,"errorMessage",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],V.prototype,"percentAlong",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],V.prototype,"errorCode",void 0),(0,U.Cg)([(0,L.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"isContentVisible",void 0),(0,U.Cg)([(0,L.MZ)({type:Number,json:{write:!0}})],V.prototype,"status",void 0),V=(0,U.Cg)([(0,P.$)("esri.rest.networks.support.Association")],V);let K=class extends M.o{constructor(e){super(e),this.associations=[]}};function H(e){const{returnDeletes:t,elements:n,gdbVersion:i,moment:r}=e.toJSON();return{returnDeletes:t,elements:JSON.stringify(n.map(e=>({globalId:e.globalId,networkSourceId:e.networkSourceId,terminalId:e.terminalId}))),types:JSON.stringify(e.types.map(e=>Z.toJSON(e))).replaceAll('"connectivity"','"junctionJunctionConnectivity"'),gdbVersion:i,moment:r??Date.now()}}(0,U.Cg)([(0,L.MZ)({type:[V],json:{write:!0}})],K.prototype,"associations",void 0),K=(0,U.Cg)([(0,P.$)("esri.rest.networks.support.QueryAssociationsResult")],K);var z,W=n(56507);let _=z=class extends M.o{static from(e){return(0,W.PZ)(z,e)}constructor(e){super(e),this.returnDeletes=!1,this.elements=[],this.types=[],this.gdbVersion=null,this.moment=null}};(0,U.Cg)([(0,L.MZ)({type:Boolean,json:{write:!0}})],_.prototype,"returnDeletes",void 0),(0,U.Cg)([(0,L.MZ)({type:[B],json:{write:!0}})],_.prototype,"elements",void 0),(0,U.Cg)([(0,L.MZ)({type:[Z.apiValues],json:{type:Z.jsonValues,read:Z.read,write:Z.write}})],_.prototype,"types",void 0),(0,U.Cg)([(0,L.MZ)({type:String,json:{write:!0}})],_.prototype,"gdbVersion",void 0),(0,U.Cg)([(0,L.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.moment=e?.getTime()}}}})],_.prototype,"moment",void 0),_=z=(0,U.Cg)([(0,P.$)("esri.rest.networks.support.QueryAssociationsParameters")],_);var Q=n(54218);function q(e,t,n){const i=e.getVariables();if(i.length>0){const r={};for(const e of i)r[e]=t.evaluateIdentifier(n,{name:e});e.parameters=r}return e}function Y(e,t,n=null){for(const n in e)if(n.toLowerCase()===t.toLowerCase())return e[n];return n}function X(e){if(null===e)return null;const t={type:Y(e,"type",""),name:Y(e,"name","")};if("range"===t.type)t.range=Y(e,"range",[]);else{t.codedValues=[];for(const n of Y(e,"codedValues",[]))t.codedValues.push({name:Y(n,"name",""),code:Y(n,"code",null)})}return t}function ee(e){if(null===e)return null;const t={},n=Y(e,"wkt");null!==n&&(t.wkt=n);const i=Y(e,"wkid");return null!==i&&(t.wkid=i),t}function te(e){if(null===e)return null;const t={hasZ:Y(e,"hasz",!1),hasM:Y(e,"hasm",!1)},n=Y(e,"spatialreference");null!=n&&(t.spatialReference=ee(n));const i=Y(e,"x",null);if(null!==i)return t.x=i,t.y=Y(e,"y",null),t.hasZ&&(t.z=Y(e,"z",null)),t.hasM&&(t.m=Y(e,"m",null)),t;const r=Y(e,"rings",null);if(null!==r)return t.rings=r,t;const o=Y(e,"paths",null);if(null!==o)return t.paths=o,t;const a=Y(e,"points",null);if(null!==a)return t.points=a,t;for(const n of["xmin","xmax","ymin","ymax","zmin","zmax","mmin","mmax"]){const i=Y(e,n,null);null!==i&&(t[n]=i)}return t}function ne(e){return"utc"===e?.toLowerCase()?"UTC":"unknown"===e?.toLowerCase()?"Unknown":e}function ie(e){if("async"===e.mode){e.functions.timezone=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,o)=>{if((0,f.B)(o,1,2,t,n),(0,f.g)(o[0]))return"Unknown";if((0,f.f)(o[0]))return"Unknown";if((0,f.m)(o[0])){if(await o[0].load(),1===o.length||null===o[1])return o[0].datesInUnknownTimezone?ne("unknown"):ne(o[0].dateFieldsTimeZone);if(!(o[1]instanceof a.A)||!1===o[1].hasField("type"))throw new l.D$(t,"InvalidParameter",n);const e=o[1].field("type");if(!1===(0,Q.Kg)(e))throw new l.D$(t,"InvalidParameter",n);switch((0,f.u)(e).toLowerCase()){case"preferredtimezone":return ne(o[0].preferredTimeZone);case"editfieldsinfo":return ne(o[0].editFieldsInfo?.timeZone??null);case"timeinfo":return ne(o[0].timeInfo?.timeZone??null);case"field":if(o[1].hasField("fieldname")&&(0,Q.Kg)(o[1].field("fieldname")))return ne(o[0].fieldTimeZone((0,f.u)(o[1].field("fieldname"))))}throw new l.D$(t,"InvalidParameter",n)}const s=(0,f.N)(o[0],(0,f.K)(t));if(null===s)return null;const u=s.timeZone;return"system"===u?r.lY.systemTimeZoneCanonicalName:"utc"===u.toLowerCase()?"UTC":"unknown"===u.toLowerCase()?"Unknown":u})},e.functions.sqltimestamp=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,r)=>{(0,f.B)(r,1,3,t,n);const o=r[0];if((0,f.e)(o)){if(1===r.length)return o.toSQLWithKeyword();if(2===r.length)return o.changeTimeZone((0,f.u)(r[1])).toSQLWithKeyword();throw new l.D$(t,"InvalidParameter",n)}if((0,f.f)(o))return o.toSQLWithKeyword();if((0,f.m)(o)){if(3!==r.length)throw new l.D$(t,"InvalidParameter",n);await o.load();const e=(0,f.u)(r[1]);if((0,f.f)(r[2]))return r[2].toSQLWithKeyword();if(!1===(0,f.e)(r[2]))throw new l.D$(t,"InvalidParameter",n);const i=o.fieldTimeZone(e);return null==i?r[2].toSQLWithKeyword():r[2].changeTimeZone(i).toSQLWithKeyword()}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"sqltimestamp",min:2,max:4}),e.functions.featuresetbyid=function(t,n){return e.standardFunctionAsync(t,n,(e,i,r)=>{if((0,f.B)(r,2,4,t,n),(0,f.l)(r[0])){const e=(0,f.u)(r[1]);let i=(0,f.J)(r[2],null);const o=(0,f.H)((0,f.J)(r[3],!0));if(null===i&&(i=["*"]),!1===(0,Q.cy)(i))throw new l.D$(t,"InvalidParameter",n);return r[0].featureSetById(e,o,i)}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"featuresetbyid",min:2,max:4});const t=new s.b(["datasource","parent","root"]);e.functions.getfeatureset=function(n,i){return e.standardFunctionAsync(n,i,async(e,r,o)=>{if((0,f.B)(o,1,2,n,i),(0,f.k)(o[0])){const e=null==o[1]?"datasource":t.lookup((0,f.u)(o[1]));return(0,d.convertToFeatureSet)(o[0].fullSchema(),e,n.lrucache,n.interceptor,n.spatialReference)}throw new l.D$(n,"InvalidParameter",i)})},e.signatures.push({name:"getfeatureset",min:1,max:2}),e.functions.featuresetbyportalitem=function(t,n){return e.standardFunctionAsync(t,n,(e,i,r)=>{if((0,f.B)(r,2,5,t,n),null===r[0])throw new l.D$(t,"PortalRequired",n);if(r[0]instanceof o.A){const e=(0,f.u)(r[1]),i=(0,f.u)(r[2]);let o=(0,f.J)(r[3],null);const a=(0,f.H)((0,f.J)(r[4],!0));if(null===o&&(o=["*"]),!1===(0,Q.cy)(o))throw new l.D$(t,"InvalidParameter",n);let s;return s=t.services?.portal?t.services.portal:C.A.getDefault(),s=(0,m.R)(r[0],s),(0,d.constructFeatureSetFromPortalItem)(e,i,t.spatialReference,o,a,s,t.lrucache,t.interceptor)}if(!1===(0,Q.Kg)(r[0]))throw new l.D$(t,"PortalRequired",n);const a=(0,f.u)(r[0]),s=(0,f.u)(r[1]);let u=(0,f.J)(r[2],null);const c=(0,f.H)((0,f.J)(r[3],!0));if(null===u&&(u=["*"]),!1===(0,Q.cy)(u))throw new l.D$(t,"InvalidParameter",n);return(0,d.constructFeatureSetFromPortalItem)(a,s,t.spatialReference,u,c,t.services?.portal??C.A.getDefault(),t.lrucache,t.interceptor)})},e.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),e.functions.featuresetbyname=function(t,n){return e.standardFunctionAsync(t,n,(e,i,r)=>{if((0,f.B)(r,2,4,t,n),(0,f.l)(r[0])){const e=(0,f.u)(r[1]);let i=(0,f.J)(r[2],null);const o=(0,f.H)((0,f.J)(r[3],!0));if(null===i&&(i=["*"]),!1===(0,Q.cy)(i))throw new l.D$(t,"InvalidParameter",n);return r[0].featureSetByName(e,o,i)}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"featuresetbyname",min:2,max:4}),e.functions.featureset=function(t,n){return e.standardFunction(t,n,(e,i,r)=>{(0,f.B)(r,1,1,t,n);const o={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if((0,Q.Kg)(r[0])){const e=JSON.parse(r[0]);void 0!==e.layerDefinition?(o.layerDefinition=e.layerDefinition,o.featureSet=e.featureSet,e.layerDefinition.spatialReference&&(o.layerDefinition.spatialReference=e.layerDefinition.spatialReference)):(o.featureSet.features=e.features,o.featureSet.geometryType=e.geometryType,o.layerDefinition.geometryType=o.featureSet.geometryType,o.layerDefinition.objectIdField=e.objectIdFieldName??"",o.layerDefinition.typeIdField=e.typeIdFieldName,o.layerDefinition.globalIdField=e.globalIdFieldName,o.layerDefinition.fields=e.fields,e.spatialReference&&(o.layerDefinition.spatialReference=e.spatialReference))}else{if(!(r[0]instanceof a.A))throw new l.D$(t,"InvalidParameter",n);{const e=JSON.parse(r[0].castToText(!0)),i=Y(e,"layerdefinition");if(null!==i){o.layerDefinition.geometryType=Y(i,"geometrytype",""),o.featureSet.geometryType=o.layerDefinition.geometryType,o.layerDefinition.globalIdField=Y(i,"globalidfield",""),o.layerDefinition.objectIdField=Y(i,"objectidfield",""),o.layerDefinition.typeIdField=Y(i,"typeidfield",""),o.layerDefinition.hasZ=!0===Y(i,"hasz",!1),o.layerDefinition.hasM=!0===Y(i,"hasm",!1);const t=Y(i,"spatialreference");t&&(o.layerDefinition.spatialReference=ee(t));const n=[];for(const e of Y(i,"fields",[])){const t={name:Y(e,"name",""),alias:Y(e,"alias",""),type:Y(e,"type",""),nullable:Y(e,"nullable",!0),editable:Y(e,"editable",!0),length:Y(e,"length",null),domain:X(Y(e,"domain"))};n.push(t)}o.layerDefinition.fields=n;const r=Y(e,"featureset");if(r){const e={};for(const t of n)e[t.name.toLowerCase()]=t.name;for(const t of Y(r,"features",[])){const n={},i=Y(t,"attributes",{});for(const t in i)n[e[t.toLowerCase()]]=i[t];o.featureSet.features.push({attributes:n,geometry:te(Y(t,"geometry"))})}}}else{o.layerDefinition.hasZ=!0===Y(e,"hasz",!1),o.layerDefinition.hasM=!0===Y(e,"hasm",!1),o.layerDefinition.geometryType=Y(e,"geometrytype",""),o.featureSet.geometryType=o.layerDefinition.geometryType,o.layerDefinition.objectIdField=Y(e,"objectidfieldname",""),o.layerDefinition.typeIdField=Y(e,"typeidfieldname","");const i=Y(e,"spatialreference");i&&(o.layerDefinition.spatialReference=ee(i));const r=[],a=Y(e,"fields",null);if(!(0,Q.cy)(a))throw new l.D$(t,"InvalidParameter",n);for(const e of a){const t={name:Y(e,"name",""),alias:Y(e,"alias",""),type:Y(e,"type",""),nullable:Y(e,"nullable",!0),editable:Y(e,"editable",!0),length:Y(e,"length",null),domain:X(Y(e,"domain"))};r.push(t)}o.layerDefinition.fields=r;const s={};for(const e of r)s[e.name.toLowerCase()]=e.name;let u=Y(e,"features",null);if((0,Q.cy)(u))for(const e of u){const t={},n=Y(e,"attributes",{});for(const e in n)t[s[e.toLowerCase()]]=n[e];o.featureSet.features.push({attributes:t,geometry:te(Y(e,"geometry",null))})}else u=null,o.featureSet.features=u}}}if(!1===function(e){return!!e.layerDefinition&&!!e.featureSet&&!1!==function(e){for(const t of["",null,"esriGeometryNull","esriGeometryPoint","esriGeometryPolyline","esriGeometryPolygon","esriGeometryMultipoint","esriGeometryEnvelope"])if(t===e)return!0;return!1}(e.layerDefinition.geometryType)&&!1!==(0,Q.cy)(e.layerDefinition.fields)&&!1!==(0,Q.cy)(e.featureSet.features)}(o))throw new l.D$(t,"InvalidParameter",n);return o.layerDefinition.geometryType||(o.layerDefinition.geometryType="esriGeometryNull"),h.A.create(o,t.spatialReference)})},e.signatures.push({name:"featureset",min:1,max:1}),e.functions.filter=function(t,n){return e.standardFunctionAsync(t,n,async(i,r,o)=>{if((0,f.B)(o,2,2,t,n),(0,Q.cy)(o[0])||(0,f.j)(o[0])){const e=[];let i,r=o[0];if(r instanceof c.A&&(r=r.toArray()),!(0,f.i)(o[1]))throw new l.D$(t,"InvalidParameter",n);i=o[1].createFunction(t);for(const t of r){const n=i(t);(0,A.$X)(n)?!0===await n&&e.push(t):!0===n&&e.push(t)}return e}if((0,f.m)(o[0])){const n=await o[0].load(),i=T.A.create(o[1],{fieldsIndex:n.getFieldsIndex(),timeZone:n.dateFieldsTimeZoneDefaultUTC}),r=i.getVariables();if(r.length>0){const n={};for(const i of r)n[i]=e.evaluateIdentifier(t,{name:i});i.parameters=n}return new y.A({parentfeatureset:o[0],whereclause:i})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"filter",min:2,max:2}),e.functions.orderby=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,r)=>{if((0,f.B)(r,2,2,t,n),(0,f.m)(r[0])){const e=new F.A(r[1]);return new w.A({parentfeatureset:r[0],orderbyclause:e})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"orderby",min:2,max:2}),e.functions.top=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,r)=>{if((0,f.B)(r,2,2,t,n),(0,f.m)(r[0]))return new g.A({parentfeatureset:r[0],topnum:r[1]});if((0,Q.cy)(r[0]))return(0,f.s)(r[1])>=r[0].length?r[0].slice():r[0].slice(0,(0,f.s)(r[1]));if((0,f.j)(r[0]))return(0,f.s)(r[1])>=r[0].length()?r[0].slice():r[0].slice(0,(0,f.s)(r[1]));throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"top",min:2,max:2}),e.functions.first=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,r)=>{if((0,f.B)(r,1,1,t,n),(0,f.m)(r[0])){const n=await r[0].first(e.abortSignal);if(null!==n){const e=u.A.createFromGraphicLikeObject(n.geometry,n.attributes,r[0],t.timeZone);return e._underlyingGraphic=n,e}return n}return(0,Q.cy)(r[0])?0===r[0].length?null:r[0][0]:(0,f.j)(r[0])?0===r[0].length()?null:r[0].get(0):null})},e.signatures.push({name:"first",min:1,max:1}),e.functions.attachments=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,r)=>{(0,f.B)(r,1,2,t,n);const o={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(r.length>1)if(r[1]instanceof a.A){if(r[1].hasField("minsize")&&(o.minsize=(0,f.s)(r[1].field("minsize"))),r[1].hasField("metadata")&&(o.returnMetadata=(0,f.H)(r[1].field("metadata"))),r[1].hasField("maxsize")&&(o.maxsize=(0,f.s)(r[1].field("maxsize"))),r[1].hasField("types")){const e=(0,f.L)(r[1].field("types"),!1);e.length>0&&(o.types=e)}}else if(null!==r[1])throw new l.D$(t,"InvalidParameter",n);if((0,f.k)(r[0])){const e=r[0]._layer;let n;if((0,f.m)(e))n=e;else{if(null==e||!(0,b.eB)(e))return[];n=(0,d.constructFeatureSet)(e,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)}return await n.load(),n.queryAttachments(r[0].field(n.objectIdField),o.minsize,o.maxsize,o.types,o.returnMetadata)}if(null===r[0])return[];throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"attachments",min:1,max:2}),e.functions.featuresetbyrelationshipname=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,r)=>{(0,f.B)(r,2,4,t,n);const o=r[0],a=(0,f.u)(r[1]);let s=(0,f.J)(r[2],null);const u=(0,f.H)((0,f.J)(r[3],!0));if(null===s&&(s=["*"]),!1===(0,Q.cy)(s))throw new l.D$(t,"InvalidParameter",n);if(null===r[0])return null;if(!(0,f.k)(r[0]))throw new l.D$(t,"InvalidParameter",n);const c=o._layer;let m;if((0,f.m)(c))m=c;else{if(null==c||!(0,b.eB)(c))return null;m=(0,d.constructFeatureSet)(c,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)}m=await m.load();const p=m.relationshipMetaData().filter(e=>e.name===a);if(0===p.length)return null;if(void 0!==p[0].relationshipTableId&&null!==p[0].relationshipTableId&&p[0].relationshipTableId>-1)return(0,d.constructFeatureSetFromRelationship)(m,p[0],o.field(m.objectIdField),m.spatialReference,s,u,t.lrucache,t.interceptor);let y=m.serviceUrl();if(!y)return null;y=y.endsWith("/")?y+p[0].relatedTableId.toString():y+"/"+p[0].relatedTableId.toString();const w=await(0,d.constructFeatureSetFromUrl)(y,m.spatialReference,s,u,t.lrucache,t.interceptor);await w.load();let g=w.relationshipMetaData();if(g=g.filter(e=>e.id===p[0].id),!1===o.hasField(p[0].keyField)||null===o.field(p[0].keyField)){const e=await m.getFeatureByObjectId(o.field(m.objectIdField),[p[0].keyField]);if(e){const t=T.A.create(g[0].keyField+"= @id",{fieldsIndex:w.getFieldsIndex(),timeZone:w.dateFieldsTimeZoneDefaultUTC});return t.parameters={id:e.attributes[p[0].keyField]},w.filter(t)}return new I.A({parentfeatureset:w})}const h=T.A.create(g[0].keyField+"= @id",{fieldsIndex:w.getFieldsIndex(),timeZone:w.dateFieldsTimeZoneDefaultUTC});return h.parameters={id:o.field(p[0].keyField)},w.filter(h)})},e.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),e.functions.featuresetbyassociation=function(t,n){return e.standardFunctionAsync(t,n,async(e,r,o)=>{(0,f.B)(o,2,3,t,n);const a=o[0],u=(0,s.B)((0,f.u)((0,f.J)(o[1],""))),c=(0,Q.Kg)(o[2])?(0,f.u)(o[2]):null;if(null===o[0])return null;if(!(0,f.k)(o[0]))throw new l.D$(t,"InvalidParameter",n);let m=a._layer;if(m instanceof v.default&&(m=(0,d.constructFeatureSet)(m,t.spatialReference,["*"],!0,t.lrucache,t.interceptor)),null===m)return null;if(!1===(0,f.m)(m))return null;await m.load();const y=m.serviceUrl(),w=await(0,d.constructAssociationMetaDataFeatureSetFromUrl)(y,t.spatialReference,!0);if(w.unVersion>=8)return await async function(e,t,n,r,o,a,s){const u=await e.getFeatureSetInfo();if(null===(u?.layerId??null))return null;if(!o.layerIdLookup.get(u.layerId))return null;const c=e.serviceUrl().replace(/\/FeatureServer/i,"/UtilityNetworkServer"),f=[];switch(n){case"connected":f.push("connectivity"),f.push("junction-edge-from-connectivity"),f.push("junction-edge-to-connectivity"),f.push("junction-edge-midspan-connectivity"),f.push("junction-junction-connectivity");break;case"container":case"content":f.push("containment");break;case"structure":case"attached":f.push("attachment");break;case"junctionedge":f.push("junction-edge-from-connectivity"),f.push("junction-edge-to-connectivity");break;case"midspan":f.push("junction-edge-midspan-connectivity");break;default:throw new l.D$(a,"InvalidParameter",s)}let m=null,p=!1;if(null!==r&&""!==r&&void 0!==r){for(const e of o.terminals)e.terminalName===r&&(m=e.terminalId);null===m&&(p=!0)}const y=[];if(!p){const r=new B({globalId:t.field(e.globalIdField),networkSourceId:o.layerIdLookup.get(u.layerId).sourceId,...m?{terminalId:m}:""}),a=await async function(e,t){const n=(0,j.Dl)(e),i={...H(t),f:"json"},r=(0,j.lF)({...n.query,...i}),o=(0,j.jV)(r,{method:"post"}),a=`${n.path}/associations/query`,{data:s}=await(0,E.A)(a,o),l=K.fromJSON(s);return t.types.includes("connectivity")&&(0,S.Lx)($.A.getLogger("esri/rest/networks/support/QueryAssociationsParameters"),"types",{replacement:"Please use 'junction-junction-connectivity' instead of 'connectivity'.",see:"https://arcg.is/11Tr8a#types",version:"4.29",warnOnce:!0}),l}(c,new _({types:f,elements:[r]}));let s=0;for(const e of a.associations){let t=null,a="",l="";if(e.fromNetworkElement?.globalId===r.globalId?(t=e.toNetworkElement,l="to"):e.toNetworkElement?.globalId===r.globalId&&(t=e.fromNetworkElement,l="from"),!t)continue;switch(n){case"attached":if("attachment"!==e.associationType)continue;if("to"!==l)continue;break;case"structure":if("attachment"!==e.associationType)continue;if("from"!==l)continue;break;case"container":if("containment"!==e.associationType)continue;if("from"!==l)continue;break;case"content":if("containment"!==e.associationType)continue;if("to"!==l)continue;break;case"connected":break;case"junctionedge":"junction-edge-to-connectivity"===e.associationType?a="to":"junction-edge-from-connectivity"===e.associationType&&(a="from");break;case"midspan":if("junction-edge-midspan-connectivity"!==e.associationType)continue}const u=o.sourceIdLookup.get(t.networkSourceId)?.className??"";y.push(new i.A({geometry:null,attributes:{objectId:s++,globalId:t.globalId,percentAlong:e.percentAlong??0,isContentVisible:e.isContentVisible?0:1,className:u,side:a}}))}}const w=new v.default({source:y,geometryType:null,objectIdField:"objectId",globalIdField:"globalId",fields:[new k.A({name:"objectId",alias:"objectId",type:"oid"}),new k.A({name:"globalId",alias:"globalId",type:"global-id"}),new k.A({name:"percentAlong",alias:"percentAlong",type:"double"}),new k.A({name:"side",alias:"side",type:"string"}),new k.A({name:"isContentVisible",alias:"isContentVisible",type:"integer"}),new k.A({name:"className",alias:"className",type:"string"})]});return(0,d.constructFeatureSet)(w)}(m,a,u,c,w,t,n);const g=w.associations;let I=null,h=null,F=!1;if(null!==c&&""!==c&&void 0!==c){for(const e of w.terminals)e.terminalName===c&&(h=e.terminalId);null===h&&(F=!0)}const D=g.getFieldsIndex(),N=D.get("TOGLOBALID").name,A=D.get("FROMGLOBALID").name,C=D.get("TOTERMINALID").name,x=D.get("FROMTERMINALID").name,Z=D.get("FROMNETWORKSOURCEID").name,U=D.get("TONETWORKSOURCEID").name,M=D.get("ASSOCIATIONTYPE").name,L=D.get("ISCONTENTVISIBLE").name,P=D.get("OBJECTID").name;for(const e of m.fields)if("global-id"===e.type){I=a.field(e.name);break}let R=null,O=new p.Gr(new k.A({name:"percentalong",alias:"percentalong",type:"double"}),T.A.create("0",{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC})),G=new p.Gr(new k.A({name:"side",alias:"side",type:"string"}),T.A.create("''",{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC}));const J="globalid",V="globalId",z={};for(const e in w.lkp)z[e]=w.lkp[e].sourceId;const W=new p.bV(new k.A({name:"classname",alias:"classname",type:"string"}),null,z);let q="";switch(u){case"midspan":{q=`((${N}='${I}') OR ( ${A}='${I}')) AND (${M} IN (5))`,W.codefield=T.A.create(`CASE WHEN (${N}='${I}') THEN ${Z} ELSE ${U} END`,{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC});const e=(0,b.ke)(p.a.findField(g.fields,A));e.name=J,e.alias=J,R=new p.Gr(e,T.A.create(`CASE WHEN (${A}='${I}') THEN ${N} ELSE ${A} END`,{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC})),O=w.unVersion>=4?new p.IO(p.a.findField(g.fields,D.get("PERCENTALONG").name)):new p.Gr(new k.A({name:"percentalong",alias:"percentalong",type:"double"}),T.A.create("0",{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{q=`((${N}='${I}') OR ( ${A}='${I}')) AND (${M} IN (4,6))`,W.codefield=T.A.create(`CASE WHEN (${N}='${I}') THEN ${Z} ELSE ${U} END`,{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC});const e=(0,b.ke)(p.a.findField(g.fields,A));e.name=J,e.alias=J,R=new p.Gr(e,T.A.create(`CASE WHEN (${A}='${I}') THEN ${N} ELSE ${A} END`,{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC})),G=new p.Gr(new k.A({name:"side",alias:"side",type:"string"}),T.A.create(`CASE WHEN (${M}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let e=`${N}='@T'`,t=`${A}='@T'`;null!==h&&(e+=` AND ${C}=@A`,t+=` AND ${x}=@A`),q="(("+e+") OR ("+t+"))",q=(0,f.Z)(q,"@T",I??""),e=(0,f.Z)(e,"@T",I??""),null!==h&&(e=(0,f.Z)(e,"@A",h.toString()),q=(0,f.Z)(q,"@A",h.toString())),W.codefield=T.A.create("CASE WHEN "+e+` THEN ${Z} ELSE ${U} END`,{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC});const n=(0,b.ke)(p.a.findField(g.fields,A));n.name=J,n.alias=J,R=new p.Gr(n,T.A.create("CASE WHEN "+e+` THEN ${A} ELSE ${N} END`,{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC}));break}case"container":q=`${N}='${I}' AND ${M} = 2`,null!==h&&(q+=` AND ${C} = `+h.toString()),W.codefield=Z,q="( "+q+" )",R=new p.p8(p.a.findField(g.fields,A),J,J);break;case"content":q=`(${A}='${I}' AND ${M} = 2)`,null!==h&&(q+=` AND ${x} = `+h.toString()),W.codefield=U,q="( "+q+" )",R=new p.p8(p.a.findField(g.fields,N),J,J);break;case"structure":q=`(${N}='${I}' AND ${M} = 3)`,null!==h&&(q+=` AND ${C} = `+h.toString()),W.codefield=Z,q="( "+q+" )",R=new p.p8(p.a.findField(g.fields,A),J,V);break;case"attached":q=`(${A}='${I}' AND ${M} = 3)`,null!==h&&(q+=` AND ${x} = `+h.toString()),W.codefield=U,q="( "+q+" )",R=new p.p8(p.a.findField(g.fields,N),J,V);break;default:throw new l.D$(t,"InvalidParameter",n)}return F&&(q="1 <> 1"),new p.a({parentfeatureset:g,adaptedFields:[new p.IO(p.a.findField(g.fields,P)),new p.IO(p.a.findField(g.fields,L)),R,G,W,O],extraFilter:q?T.A.create(q,{fieldsIndex:g.getFieldsIndex(),timeZone:g.dateFieldsTimeZoneDefaultUTC}):null})})},e.signatures.push({name:"featuresetbyassociation",min:2,max:6}),e.functions.groupby=function(t,n){return e.standardFunctionAsync(t,n,async(i,r,o)=>{if((0,f.B)(o,3,3,t,n),!(0,f.m)(o[0]))throw new l.D$(t,"InvalidParameter",n);const s=await o[0].load(),u=[],d=[];let c=!1,m=[];if((0,Q.Kg)(o[1]))m.push(o[1]);else if(o[1]instanceof a.A)m.push(o[1]);else if((0,Q.cy)(o[1]))m=o[1];else{if(!(0,f.j)(o[1]))throw new l.D$(t,"InvalidParameter",n);m=o[1].toArray()}for(const e of m)if((0,Q.Kg)(e)){const t=T.A.create((0,f.u)(e),{fieldsIndex:s.getFieldsIndex(),timeZone:s.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,D.DA)(t)?(0,f.u)(e):"%%%%FIELDNAME";u.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(c=!0)}else{if(!(e instanceof a.A))throw new l.D$(t,"InvalidParameter",n);{const i=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",r=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===i&&(c=!0),!i)throw new l.D$(t,"InvalidParameter",n);u.push({name:i,expression:T.A.create(r||i,{fieldsIndex:s.getFieldsIndex(),timeZone:s.dateFieldsTimeZoneDefaultUTC})})}}if(m=[],(0,Q.Kg)(o[2]))m.push(o[2]);else if((0,Q.cy)(o[2]))m=o[2];else if((0,f.j)(o[2]))m=o[2].toArray();else{if(!(o[2]instanceof a.A))throw new l.D$(t,"InvalidParameter",n);m.push(o[2])}for(const e of m){if(!(e instanceof a.A))throw new l.D$(t,"InvalidParameter",n);{const i=e.hasField("name")?e.field("name"):"",r=e.hasField("statistic")?e.field("statistic"):"",o=e.hasField("expression")?e.field("expression"):"";if(!(i&&r&&(0,Q.Kg)(r)&&o))throw new l.D$(t,"InvalidParameter",n);d.push({name:i,statistic:r,expression:T.A.create(o,{fieldsIndex:s.getFieldsIndex(),timeZone:s.dateFieldsTimeZoneDefaultUTC})})}}if(c){const e={};for(const t of s.fields)e[t.name.toLowerCase()]=1;for(const t of u)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);for(const t of d)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of u)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of u)q(n.expression,e,t);for(const n of d)q(n.expression,e,t);return o[0].groupby(u,d)})},e.signatures.push({name:"groupby",min:3,max:3}),e.functions.distinct=function(t,n){return e.standardFunctionAsync(t,n,async(i,r,o)=>{if((0,f.m)(o[0])){(0,f.B)(o,2,2,t,n);const i=await o[0].load(),r=[];let s=[];if((0,Q.Kg)(o[1]))s.push(o[1]);else if(o[1]instanceof a.A)s.push(o[1]);else if((0,Q.cy)(o[1]))s=o[1];else{if(!(0,f.j)(o[1]))throw new l.D$(t,"InvalidParameter",n);s=o[1].toArray()}let u=!1;for(const e of s)if((0,Q.Kg)(e)){const t=T.A.create((0,f.u)(e),{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC}),n=!0===(0,D.DA)(t)?(0,f.u)(e):"%%%%FIELDNAME";r.push({name:n,expression:t}),"%%%%FIELDNAME"===n&&(u=!0)}else{if(!(e instanceof a.A))throw new l.D$(t,"InvalidParameter",n);{const o=e.hasField("name")?e.field("name"):"%%%%FIELDNAME",a=e.hasField("expression")?e.field("expression"):"";if("%%%%FIELDNAME"===o&&(u=!0),!o)throw new l.D$(t,"InvalidParameter",n);r.push({name:o,expression:T.A.create(a||o,{fieldsIndex:i.getFieldsIndex(),timeZone:i.dateFieldsTimeZoneDefaultUTC})})}}if(u){const e={};for(const t of i.fields)e[t.name.toLowerCase()]=1;for(const t of r)"%%%%FIELDNAME"!==t.name&&(e[t.name.toLowerCase()]=1);let t=0;for(const n of r)if("%%%%FIELDNAME"===n.name){for(;1===e["field_"+t.toString()];)t++;e["field_"+t.toString()]=1,n.name="FIELD_"+t.toString()}}for(const n of r)q(n.expression,e,t);return o[0].groupby(r,[])}return function(e){if(1===e.length){if((0,Q.cy)(e[0]))return(0,N.t)("distinct",e[0],-1);if((0,f.j)(e[0]))return(0,N.t)("distinct",e[0].toArray(),-1)}return(0,N.t)("distinct",e,-1)}(o)})},e.functions.getfeaturesetinfo=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,r)=>{if((0,f.B)(r,1,1,t,n),!(0,f.m)(r[0]))return null;const o=await r[0].getFeatureSetInfo();return o?a.A.convertObjectToArcadeDictionary({layerId:o.layerId,layerName:o.layerName,itemId:o.itemId,serviceLayerUrl:o.serviceLayerUrl,webMapLayerId:o.webMapLayerId??null,webMapLayerTitle:o.webMapLayerTitle??null,className:null,objectClassId:null},(0,f.K)(t),!1,!1):null})},e.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),e.functions.filterbysubtypecode=function(t,n){return e.standardFunctionAsync(t,n,async(e,i,r)=>{if((0,f.B)(r,2,2,t,n),(0,f.m)(r[0])){const e=await r[0].load(),i=r[1];if(!(0,Q.Fq)(i))throw new l.D$(t,"InvalidParameter",n);if(e.subtypeField){const t=T.A.create(`${e.subtypeField}= ${r[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new y.A({parentfeatureset:r[0],whereclause:t})}if(null===e.typeIdField||""===e.typeIdField)throw new l.D$(t,"FeatureSetDoesNotHaveSubtypes",n);const o=T.A.create(`${e.typeIdField}= ${r[1]}`,{fieldsIndex:e.getFieldsIndex(),timeZone:e.dateFieldsTimeZoneDefaultUTC});return new y.A({parentfeatureset:r[0],whereclause:o})}throw new l.D$(t,"InvalidParameter",n)})},e.signatures.push({name:"filterbysubtypecode",min:2,max:2})}}},80672:(e,t,n)=>{n.d(t,{R:()=>r});var i=n(20655);function r(e,t){return null===e?t:new i.A({url:e.field("url")})}}}]);