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

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 (178) hide show
  1. package/Graphic.js +1 -1
  2. package/arcade/ArcadeDate.js +1 -1
  3. package/arcade/ArcadeModuleResolver.js +1 -1
  4. package/arcade/featureset/actions/GroupBy.js +1 -1
  5. package/arcade/functions/date.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/{28e04ef3575f164f611a.js → 00870a35b254295bc408.js} +1 -1
  8. package/assets/esri/core/workers/chunks/017adbbb77c9c9b4d49f.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b4b30a7f1b673461dc55.js → 0997e09fe5b0aba1f804.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{9bc6d974b0fce9db64ef.js → 15a5a89cd228a9364332.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{847455bf4fc33d6e6efc.js → 1dc410bc070cabb7198d.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{94a3474e3f45efa4a4fe.js → 2c816d3a737e39e6eb84.js} +1 -1
  13. package/assets/esri/core/workers/chunks/2de11a8e5d426c381991.js +1 -0
  14. package/assets/esri/core/workers/chunks/3a7e43675163f7bed6ac.js +1 -0
  15. package/assets/esri/core/workers/chunks/40b0c5368b8322498189.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4778acd0cfaf0cebeec7.js → 439128f23fa091633d2d.js} +1 -1
  17. package/assets/esri/core/workers/chunks/6000a302369799ea42a6.js +1 -0
  18. package/assets/esri/core/workers/chunks/{5d0c92aaa5891e6cb8f0.js → 641ca71d7c1a07bde66a.js} +1 -1
  19. package/assets/esri/core/workers/chunks/646227b500b92999f2c8.js +1 -0
  20. package/assets/esri/core/workers/chunks/{98f6d4ea026ed96fd3f3.js → 773feb0e0fad26df57ef.js} +1 -1
  21. package/assets/esri/core/workers/chunks/7b1d14a921d30c95d68b.js +1 -0
  22. package/assets/esri/core/workers/chunks/{b78d00c4e493086741e1.js → 7d25f57299c642e727a6.js} +1 -1
  23. package/assets/esri/core/workers/chunks/8b7f6f2d1692b6b6dbd5.js +1 -0
  24. package/assets/esri/core/workers/chunks/91d48c32bf11ad1405c8.js +1 -0
  25. package/assets/esri/core/workers/chunks/9228f760129e48585b54.js +1 -0
  26. package/assets/esri/core/workers/chunks/a36be186ad10200c420c.js +1 -0
  27. package/assets/esri/core/workers/chunks/aa12ba96fb8c91105473.js +1 -0
  28. package/assets/esri/core/workers/chunks/{ea240d9e594bfbd8af68.js → aaf696a1026de569c82d.js} +1 -1
  29. package/assets/esri/core/workers/chunks/b331543767c35e5edcc6.js +1 -0
  30. package/assets/esri/core/workers/chunks/{7d852617e91b51121ea7.js → ba29c535128c4e8ae2d3.js} +1 -1
  31. package/assets/esri/core/workers/chunks/bf60d4da0dff1e14da8e.js +1 -0
  32. package/assets/esri/core/workers/chunks/{39bff604d4b4a1295038.js → c038472cb7f60af9426e.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{ca46f78aac1133d127fa.js → c1e5e2a6e7e2d7a1d63c.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{a809042fdce7ced2a415.js → cc3ca1729af33688c1e3.js} +1 -1
  35. package/assets/esri/core/workers/chunks/cde79c3644166d4798a8.js +1 -0
  36. package/assets/esri/core/workers/chunks/{181f8bbe670b4468307a.js → ce8f0ed9179c0d314df8.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{ac30cf2f9a94597f7665.js → d6b2ab614f308db50c4a.js} +2 -2
  38. package/assets/esri/core/workers/chunks/{abe2cdfc2eda46b00812.js → d9045b964f536695840b.js} +1 -1
  39. package/assets/esri/core/workers/chunks/dde6000aa2f69f6ecad0.js +1 -0
  40. package/assets/esri/core/workers/chunks/dec9656997683ef01ba6.js +1 -0
  41. package/assets/esri/core/workers/chunks/e18bb372457cedbf4f8c.js +1 -0
  42. package/assets/esri/core/workers/chunks/e892ed8b0b990d7eba28.js +1 -0
  43. package/assets/esri/core/workers/chunks/{dc5a8cf2a44a5ac201c5.js → ed05399f9a07fea66685.js} +1 -1
  44. package/config.js +1 -1
  45. package/core/BidiEngine.js +1 -1
  46. package/core/Promise.js +1 -1
  47. package/core/promiseUtils.js +1 -1
  48. package/core/sql/SqlInterval.js +1 -1
  49. package/core/sql/sqlDateParsingUtils.js +1 -1
  50. package/core/unitUtils.js +1 -1
  51. package/geometry/support/coordinateSystem.js +1 -1
  52. package/graphic/BuildingGraphicOrigin.d.ts +4 -0
  53. package/graphic/BuildingGraphicOrigin.js +5 -0
  54. package/graphic/CSVGraphicOrigin.d.ts +4 -0
  55. package/graphic/CSVGraphicOrigin.js +5 -0
  56. package/graphic/CatalogGraphicOrigin.d.ts +4 -0
  57. package/graphic/CatalogGraphicOrigin.js +5 -0
  58. package/graphic/FeatureGraphicOrigin.d.ts +4 -0
  59. package/graphic/FeatureGraphicOrigin.js +5 -0
  60. package/graphic/GeoJSONGraphicOrigin.d.ts +4 -0
  61. package/graphic/GeoJSONGraphicOrigin.js +5 -0
  62. package/graphic/GraphicOrigin.d.ts +4 -0
  63. package/graphic/GraphicOrigin.js +5 -0
  64. package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +4 -0
  65. package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +5 -0
  66. package/graphic/IntegratedMeshGraphicOrigin.d.ts +4 -0
  67. package/graphic/IntegratedMeshGraphicOrigin.js +5 -0
  68. package/graphic/OGCFeatureGraphicOrigin.d.ts +4 -0
  69. package/graphic/OGCFeatureGraphicOrigin.js +5 -0
  70. package/graphic/PointCloudGraphicOrigin.d.ts +4 -0
  71. package/graphic/PointCloudGraphicOrigin.js +5 -0
  72. package/graphic/SceneGraphicOrigin.d.ts +4 -0
  73. package/graphic/SceneGraphicOrigin.js +5 -0
  74. package/graphic/StreamGraphicOrigin.d.ts +4 -0
  75. package/graphic/StreamGraphicOrigin.js +5 -0
  76. package/graphic/VectorTileGraphicOrigin.d.ts +4 -0
  77. package/graphic/VectorTileGraphicOrigin.js +5 -0
  78. package/graphic/VoxelGraphicOrigin.d.ts +4 -0
  79. package/graphic/VoxelGraphicOrigin.js +5 -0
  80. package/graphic/WFSGraphicOrigin.d.ts +4 -0
  81. package/graphic/WFSGraphicOrigin.js +5 -0
  82. package/graphic/graphicOriginUtils.js +5 -0
  83. package/graphic/graphicOrigins.d.ts +14 -0
  84. package/graphic/graphicOrigins.js +5 -0
  85. package/graphic/isBuildingGraphicOrigin.js +5 -0
  86. package/graphic/isCSVGraphicOrigin.js +5 -0
  87. package/graphic/isCatalogGraphicOrigin.js +5 -0
  88. package/graphic/isFeatureGraphicOrigin.js +5 -0
  89. package/graphic/isGeoJSONGraphicOrigin.js +5 -0
  90. package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +5 -0
  91. package/graphic/isIntegratedMeshGraphicOrigin.js +5 -0
  92. package/graphic/isOGCFeatureGraphicOrigin.js +5 -0
  93. package/graphic/isPointCloudGraphicOrigin.js +5 -0
  94. package/graphic/isSceneGraphicOrigin.js +5 -0
  95. package/graphic/isStreamGraphicOrigin.js +5 -0
  96. package/graphic/isVectorTileGraphicOrigin.js +5 -0
  97. package/graphic/isVoxelGraphicOrigin.js +5 -0
  98. package/graphic/isWFSGraphicOrigin.js +5 -0
  99. package/interfaces.d.ts +354 -13
  100. package/kernel.js +1 -1
  101. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  102. package/layers/support/Field.js +1 -1
  103. package/layers/support/featurePopupQueryUtils.js +1 -1
  104. package/layers/voxel/NCTimeParser.js +1 -1
  105. package/package.json +1 -1
  106. package/rest/knowledgeGraphService.js +1 -1
  107. package/smartMapping/statistics/support/utils.js +1 -1
  108. package/support/arcadeExpressionUtils.js +1 -1
  109. package/support/revision.js +1 -1
  110. package/symbols/support/svgUtils.js +1 -1
  111. package/views/2d/engine/vectorTiles/VectorTileFeatureIndex.js +1 -1
  112. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  113. package/views/2d/engine/webgl/Painter.js +1 -1
  114. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  115. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  116. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  117. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  118. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  119. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementComputation.js +5 -0
  120. package/views/3d/analysis/VolumeMeasurement/CutFillVolumeMeasurementController.js +1 -1
  121. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  122. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  123. package/views/3d/layers/CSVLayerView3D.js +1 -1
  124. package/views/3d/layers/CatalogFootprintLayerView3D.js +1 -1
  125. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  126. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  127. package/views/3d/layers/FlowSubView3D.js +1 -1
  128. package/views/3d/layers/GeoJSONLayerView3D.js +1 -1
  129. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  130. package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
  131. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  132. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  133. package/views/3d/layers/SceneLayerView3D.js +1 -1
  134. package/views/3d/layers/StreamLayerView3D.js +1 -1
  135. package/views/3d/layers/WFSLayerView3D.js +1 -1
  136. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  137. package/views/3d/layers/graphics/StreamController.js +1 -1
  138. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  139. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  140. package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
  141. package/views/3d/layers/support/FeatureTileDescriptor.js +1 -1
  142. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  143. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  144. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  145. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  146. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  147. package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
  148. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  149. package/views/3d/state/ConstraintsManager.js +1 -1
  150. package/views/3d/support/flow/geometryUtils.js +1 -1
  151. package/views/3d/terrain/OverlayManager.js +1 -1
  152. package/views/3d/terrain/TerrainSurface.js +1 -1
  153. package/views/3d/terrain/Tile.js +1 -1
  154. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  155. package/views/SceneView.js +1 -1
  156. package/views/interactive/Tooltip.js +1 -1
  157. package/views/layers/FeatureLayerView.js +1 -1
  158. package/views/layers/support/popupUtils.js +1 -1
  159. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  160. package/assets/esri/core/workers/chunks/07b2cc0f6b064277632f.js +0 -1
  161. package/assets/esri/core/workers/chunks/13f9e92e7e5d44d9f95c.js +0 -1
  162. package/assets/esri/core/workers/chunks/140efe4735605258ecc9.js +0 -1
  163. package/assets/esri/core/workers/chunks/2b76e716f478468b6798.js +0 -1
  164. package/assets/esri/core/workers/chunks/386ab72a45102c2d47f2.js +0 -1
  165. package/assets/esri/core/workers/chunks/3fb6146d914f9b410c2e.js +0 -1
  166. package/assets/esri/core/workers/chunks/432365fcd7becd508541.js +0 -1
  167. package/assets/esri/core/workers/chunks/439ce953a25b2776cb7f.js +0 -1
  168. package/assets/esri/core/workers/chunks/4c8d2334fcdb1354ff43.js +0 -1
  169. package/assets/esri/core/workers/chunks/5f321be63ed5447b04a1.js +0 -1
  170. package/assets/esri/core/workers/chunks/6006fbdb90c3bfc493a6.js +0 -1
  171. package/assets/esri/core/workers/chunks/700c641347853b1034d9.js +0 -1
  172. package/assets/esri/core/workers/chunks/7c35c61e3673cf94cdfd.js +0 -1
  173. package/assets/esri/core/workers/chunks/7c75876a0c6460585055.js +0 -1
  174. package/assets/esri/core/workers/chunks/949dc266ac6f3505d357.js +0 -1
  175. package/assets/esri/core/workers/chunks/a84af1b8b64b86b49bd3.js +0 -1
  176. package/assets/esri/core/workers/chunks/a9d83a442d8d7a376fc0.js +0 -1
  177. package/assets/esri/core/workers/chunks/ba1b21a90b257ac9a342.js +0 -1
  178. package/assets/esri/core/workers/chunks/f9ad37dfbe1d14c6a352.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3367],{3367:(e,t,n)=>{n.d(t,{A:()=>v,B:()=>T,P:()=>g,g:()=>b,r:()=>w});var r=n(48938),i=n(66395),s=n(85935),o=n(78878),a=n(49186),l=n(53966),u=n(91869),c=n(20655),f=n(45475),d=n(67090),p=n(62791),y=n(14942),h=n(54218);class g{constructor(e,t){this.portal=e,this._debugLog=t}async translate(e){this.portal.loaded||await this.portal.load();const t=this.portal.helperServices?.aiUtilityServices;if(null==t)return{success:!1};const n=t.url+t.translateUtility;try{return e.requestSource??="arcade",{success:!0,results:(await(0,f.T)(n,e,{authMode:"no-prompt"})).map(e=>e.toJSON())}}catch(e){return null!=this._debugLog&&(e instanceof Error||e instanceof a.A)&&this._debugLog(`TranslateText error: ${e.message}`),l.A.getLogger("esri.arcade.functions.aiServices").error(e),{success:!1}}}}class m{constructor(e,t,n){this._parameters=e,this._maxTotalContentSize=t,this._maxContentsLength=n,this._requests=[],this._normalizedContents=new Map,this._contentsTotalSize=0}tryAdd(e){const t=new Set(e.filter(e=>!this._normalizedContents.has(e.text)).map(e=>e.text));if(this._requests.length+t.size>this._maxContentsLength)return null;let n=0;for(const e of t)n+=e.length;if((n+this._contentsTotalSize)*(this._parameters.to.length??1)>this._maxTotalContentSize)return null;const r=this._requests.length;for(const{key:t,text:n}of e)(0,u.tE)(this._normalizedContents,n,()=>[]).push({batchIdx:r,key:t});return this._requests.push(e),this._contentsTotalSize+=n,r}async send(e){const t=[],n=[];let r=0;for(const[e,i]of this._normalizedContents)t.push(new d.A({key:String(r++),text:e})),n.push(i);const i=new p.A(this._parameters);i.contents=t;const s=await e.translate(i);if(!s.success)return Array.from(this._requests,()=>s);const o=Array.from(this._requests,()=>({success:!0,results:[]}));for(const e of s.results){const t=Number(e.key);for(const r of n[t])o[r.batchIdx].results.push({...e,key:r.key})}return o}}function b(e){const t=[...new Set(e.to)].sort(),n=e.from??null,r=e.portalUrl,i=e.translator,s=e.apiKey??null;return JSON.stringify([t,n,r,i,s])}async function S(e,t,n){try{return(await e.yieldFor(n))[t]}catch{return{success:!1}}}class T{constructor(e,t,{maxTotalContentSize:n=5e4,maxContentsLength:r=1e3}={}){this._executor=e,this._service=t,this._openBatches=new Map,this._maxTotalContentSize=n,this._maxContentsLength=r}create(e){return{translate:async t=>{const n=b(t),{contents:r,to:i,from:s,translator:o,portalUrl:a,apiKey:l}=t;if(null==i)return{success:!1};if(null==r||r.every(e=>0===e.text.length))return{success:!1};const u=this._openBatches.get(n);if(null!=u){const t=u.data.tryAdd(r);if(null!=t)return await S(e,t,u);u.send()}const c=new m({to:i,from:s,translator:o,portalUrl:a,apiKey:l},this._maxTotalContentSize,this._maxContentsLength),f=c.tryAdd(r);if(null!=f){const t=this._executor.openBatch(c,{open:e=>{this._openBatches.set(n,e)},execute:e=>e.send(this._service),close:e=>{this._openBatches.get(n)===e&&this._openBatches.delete(n)}});return await S(e,f,t)}return await this._service.translate(t)}}}}function w(e){"async"===e.mode&&(e.functions[(0,r.X)("TranslateText")]=function(t,n){return e.standardFunctionAsync(t,n,async(e,t,n)=>{if((0,o.B)(n,2,3,e,t),!(0,h.Kg)(n[0])&&!(0,h.cy)(n[0])&&!(0,o.j)(n[0]))throw new s.D$(e,"InvalidParameter",t);const r=(0,o.L)(n[0]);if(!(0,h.Kg)(n[1])&&!(0,h.cy)(n[1])&&!(0,o.j)(n[1]))throw new s.D$(e,"InvalidParameter",t);const a=(0,o.L)(n[1]);let l=null;if(n.length>=3){if(!(0,h.Kg)(n[2]))throw new s.D$(e,"InvalidParameter",t);l=n[2]}const u=r.map((e,t)=>new d.A({key:String(t),text:e})),f=e.services?.portal??c.A.getDefault(),m=new p.A({to:a,contents:u,from:l,portalUrl:f.restUrl.replace(/\/sharing\/rest$/,"")}),S=new Map;let T=null;if(null!=e.lrucache){const t=e.lrucache;T??=b(m),m.contents=m.contents?.filter(e=>{const n=t.getCachedTranslation(T,e.text);return null==n||(S.set(e.key,{...n,key:e.key,text:e.text}),!1)})}if(m.contents?.length){const t=e.services?.translation??new g(f,e.console),n=await t.translate(m);if(!n.success)return new i.A({__proto__:null,success:!1});for(const t of n.results){const n=m.contents?.find(e=>e.key===t.key)?.text;if(null==n)throw new s.D$(null,"NeverReach",null);S.set(t.key,t),null!=e.lrucache&&(T??=b(m),e.lrucache.setCachedTranslation(T,n,{detectedLanguage:t.detectedLanguage,translation:t.translation}))}}const w=Array.from(u,t=>{const n=y.A.fromJSON(S.get(t.key));if(null==n)throw new s.D$(null,"NeverReach",null);return n.text=t.text,i.A.convertJsonToArcade(n.toJSON(),e.timeZone??"system",!0)});return new i.A({__proto__:null,success:!0,results:w})})})}const v=Object.freeze(Object.defineProperty({__proto__:null,BatchTranslationServiceFactory:T,PortalTranslationService:g,getTranslateParametersKey:b,registerFunctions:w},Symbol.toStringTag,{value:"Module"}))},6800:(e,t,n)=>{n.d(t,{G:()=>l,y:()=>o});var r=n(99719),i=n(78878),s=n(54218);function o(e){a=e}let a;function l(e){return null===e?null:(0,i.e)(e)?e.clone():(0,i.d)(e)?e:(0,i.h)(e)?e.clone():(0,i.j)(e)?e.toArray().map(e=>l(e)):(0,s.cy)(e)?e.map(e=>l(e)):(0,i.k)(e)?a.createFromArcadeFeature(e):(0,i.l)(e)||(0,i.m)(e)?e:(0,i.n)(e)||"esri.arcade.Attachment"===e?.declaredClass?e.deepClone():("esri.arcade.Portal"===e?.declaredClass||(0,i.o)(e)||e instanceof r.x||(0,i.i)(e),e)}},7335:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(93818),i=n(84939);class s extends r.A{constructor(e,t,n,r,i){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=n,this._hasM=r,this._spRef=t,this._cacheId=i}get(e){if(void 0===this._lazyPath[e]){const t=this._elements[e];if(void 0===t)return;this._lazyPath[e]=new i.A(t,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||null!==e&&e instanceof s!=0&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}},14607:(e,t,n)=>{n.d(t,{B:()=>u,GP:()=>a,qg:()=>c});var r=n(799),i=n(73444);const s={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],no:[","," "],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function o(e=(0,i.JK)()){let t=(e=e.toLowerCase())in s;if(!t){const n=e.split("-");n.length>1&&n[0]in s&&(e=n[0],t=!0),t||(e="en")}const[n,r,o="#,##0.###"]=s[e];return{decimal:n,group:r,pattern:o}}function a(e,t){const n=o((t={...t}).locale);t.customs=n;const r=t.pattern||n.pattern;return isNaN(e)||Math.abs(e)===1/0?null:function(e,t,n){const r=(n=n||{}).customs.group,i=n.customs.decimal,s=t.split(";"),o=s[0];if((t=s[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const a=l,u=o.match(a);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return!1===n.fractional&&(n.places=0),t.replace(a,function(e,t,n){!0===(n=n||{}).places&&(n.places=0),n.places===1/0&&(n.places=6);const r=t.split("."),i="string"==typeof n.places&&n.places.indexOf(",");let s=n.places;i?s=n.places.slice(i+1):+s>=0||(s=(r[1]||[]).length),n.round<0||(e=Number(e.toFixed(Number(s))));const o=String(Math.abs(e)).split("."),a=o[1]||"";if(r[1]||n.places){i&&(n.places=n.places.slice(0,Math.max(0,i)));const e=void 0!==n.places?n.places:r[1]&&r[1].lastIndexOf("0")+1;+e>a.length&&(o[1]=a.padEnd(Number(e),"0")),+s<a.length&&(o[1]=a.slice(0,Math.max(0,Number(s))))}else o[1]&&o.pop();const l=r[0].replace(",","");let u=l.indexOf("0");-1!==u&&(u=l.length-u,u>o[0].length&&(o[0]=o[0].padStart(u,"0")),l.includes("#")||(o[0]=o[0].slice(-u)));let c,f,d=r[0].lastIndexOf(",");if(-1!==d){c=r[0].length-d-1;const e=r[0].slice(0,d);d=e.lastIndexOf(","),-1!==d&&(f=e.length-d-1)}const p=[];for(let e=o[0];e;){const t=e.length-c;p.push(t>0?e.slice(Math.max(0,t)):e),e=t>0?e.slice(0,t):"",f&&(c=f,f=void 0)}return o[0]=p.reverse().join(n.group||","),o.join(n.decimal||".")}(e,u[0],{decimal:i,group:r,places:n.places,round:n.round}))}(e,r,t)}const l=/[#0,]*[#0](?:\.0*#*)?/;function u(e){const t=o((e=e||{}).locale),n=e.pattern||t.pattern,i=t.group,s=t.decimal;let a=1;if(n.includes("%"))a/=100;else if(n.includes("‰"))a/=1e3;else if(n.includes("¤"))throw new Error("currency notation not supported");const u=n.split(";");1===u.length&&u.push("-"+u[0]);const c=d(u,t=>(t="(?:"+(0,r.Cj)(t,".")+")").replace(l,t=>{const n={signed:!1,separator:e.strict?i:[i,""],fractional:e.fractional,decimal:s,exponent:!1},r=t.split(".");let o=e.places;1===r.length&&1!==a&&(r[1]="###"),1===r.length||0===o?n.fractional=!1:(void 0===o&&(o=e.pattern?r[1].lastIndexOf("0")+1:1/0),o&&null==e.fractional&&(n.fractional=!0),!e.places&&+o<r[1].length&&(o+=","+r[1].length),n.places=o);const l=r[0].split(",");return l.length>1&&(n.groupSize=l.pop().length,l.length>1&&(n.groupSize2=l.pop().length)),"("+function(e){"places"in(e=e||{})||(e.places=1/0),"string"!=typeof e.decimal&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=f(e),n=d(e.fractional,t=>{let n="";return t&&0!==e.places&&(n="\\"+e.decimal,e.places===1/0?n="(?:"+n+"\\d+)?":n+="\\d{"+e.places+"}"),n},!0);let r=t+n;return n&&(r="(?:(?:"+r+")|(?:"+n+"))"),r+d(e.exponent,t=>t?"([eE]"+f({signed:e.eSigned})+")":"")}(n)+")"}),!0);return{regexp:c.replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:i,decimal:s,factor:a}}function c(e,t){const n=u(t),r=new RegExp("^"+n.regexp+"$").exec(e);if(!r)return NaN;let i=r[1];if(!r[1]){if(!r[2])return NaN;i=r[2],n.factor*=-1}return i=i.replaceAll(new RegExp("["+n.group+"\\s\\xa0]","g"),"").replace(n.decimal,"."),Number(i)*n.factor}function f(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",d(e.signed,e=>e?"[-+]":"",!0)+d(e.separator,t=>{if(!t)return"(?:\\d+)";" "===(t=(0,r.Cj)(t))?t="\\s":" "===t&&(t="\\s\\xa0");const n=e.groupSize,i=e.groupSize2;if(i){const e="(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+t+"]\\d{"+i+"})*["+t+"]\\d{"+n+"})";return n-i>0?"(?:"+e+"|(?:0|[1-9]\\d{0,"+(n-1)+"}))":e}return"(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*)"},!0)}const d=(e,t,n)=>{if(!Array.isArray(e))return t(e);const r=[];for(let n=0;n<e.length;n++)r.push(t(e[n]));return p(r.join("|"),Boolean(n))},p=(e,t)=>"("+(t?"?:":"")+e+")"},14942:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(31635),i=n(25482),s=n(10107),o=n(40608);let a=class extends i.A{constructor(e){super(e),this.text=null,this.detectedLanguage="en",this.detectedLanguageScore=-1}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],a.prototype,"key",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],a.prototype,"text",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{read:{source:"detectedLanguage.language"},write:{target:"detectedLanguage.language"}}})],a.prototype,"detectedLanguage",void 0),(0,r.Cg)([(0,s.MZ)({type:Number,json:{read:{source:"detectedLanguage.score"},write:{target:"detectedLanguage.score"}}})],a.prototype,"detectedLanguageScore",void 0),(0,r.Cg)([(0,s.MZ)({type:Object,json:{write:!0}})],a.prototype,"translation",void 0),a=(0,r.Cg)([(0,o.$)("esri.rest.support.TranslateResult")],a)},20437:(e,t,n)=>{n.d(t,{A:()=>h});var r,i=n(31635),s=n(66552),o=n(25482),a=n(10107),l=n(56507),u=(n(44208),n(87811),n(93223)),c=n(36005),f=n(40608),d=n(80451),p=n(98453);const y=new s.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let h=class extends o.A{static{r=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let n=null;try{n=t?JSON.parse(t):null}catch(e){}return n?.value??null}readValueType(e,{description:t}){let n=null;try{n=t?JSON.parse(t):null}catch(e){}return n?y.fromJSON(n.fieldValueType):null}clone(){return new r({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"alias",void 0),(0,i.Cg)([(0,a.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],h.prototype,"defaultValue",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"description",void 0),(0,i.Cg)([(0,c.w)("description")],h.prototype,"readDescription",null),(0,i.Cg)([(0,a.MZ)({types:d.gK,json:{read:{reader:d.rS},write:!0}})],h.prototype,"domain",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],h.prototype,"editable",void 0),(0,i.Cg)([(0,a.MZ)({type:l.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],h.prototype,"length",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],h.prototype,"name",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],h.prototype,"nullable",void 0),(0,i.Cg)([(0,u.e)(p.m)],h.prototype,"type",void 0),(0,i.Cg)([(0,a.MZ)()],h.prototype,"valueType",void 0),(0,i.Cg)([(0,c.w)("valueType",["description"])],h.prototype,"readValueType",null),(0,i.Cg)([(0,a.MZ)({type:Boolean,json:{read:!1}})],h.prototype,"visible",void 0),h=r=(0,i.Cg)([(0,f.$)("esri.layers.support.Field")],h)},24097:(e,t,n)=>{n.d(t,{K:()=>r});const r={type:String,json:{read:{source:"token"},write:{target:"token"}}}},33325:(e,t,n)=>{n.d(t,{$P:()=>c,At:()=>b,JB:()=>T,Lk:()=>f,NI:()=>w,Qi:()=>S,eB:()=>v,eg:()=>y,f0:()=>p,gO:()=>h,ik:()=>g,ke:()=>l,nE:()=>u,rX:()=>d,yT:()=>m});var r=n(66131),i=n(44729),s=n(15032),o=n(20437),a=n(96285);function l(e){return o.A.fromJSON(e.toJSON())}function u(e){return e.toJSON?e.toJSON():e}function c(e){return e instanceof Date}function f(e){return e instanceof a.c9}function d(e){return e instanceof r.lY}function p(e){return e instanceof i.n}function y(e){return e instanceof s.k}const h=1e3,g={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},m={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope",envelope:"esriGeometryEnvelope"},b={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate","date-only":"esriFieldTypeDateOnly","time-only":"esriFieldTypeTimeOnly","timestamp-offset":"esriFieldTypeTimestampOffset",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID",xml:"esriFieldTypeXML","big-integer":"esriFieldTypeBigInteger",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeDateOnly:"esriFieldTypeDateOnly",esriFieldTypeTimeOnly:"esriFieldTypeTimeOnly",esriFieldTypeTimestampOffset:"esriFieldTypeTimestampOffset",esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"esriFieldTypeXML",esriFieldTypeBigInteger:"esriFieldTypeBigInteger"};function S(e){return void 0===e?"":e=(e=(e=e.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer")).replace(/\/mapserver\/[0-9]*/i,"/MapServer")).split("?")[0]}function T(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const n="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&(i=t.cmp,function(e){return function(t,n){const r={key:t,value:e[t]},s={key:n,value:e[n]};return i(r,s)}});var i;const s=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,o;if(Array.isArray(t)){for(o="[",i=0;i<t.length;i++)i&&(o+=","),o+=e(t[i])||"null";return o+"]"}if(null===t)return"null";if(s.includes(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const a=s.push(t)-1,l=Object.keys(t).sort(r?.(t));for(o="",i=0;i<l.length;i++){const n=l[i],r=e(t[n]);r&&(o&&(o+=","),o+=JSON.stringify(n)+":"+r)}return s.splice(a,1),"{"+o+"}"}(e)}function w(e){switch(e.type){case"catalog":case"csv":case"feature":case"geojson":case"knowledge-graph-sublayer":case"oriented-imagery":case"subtype-group":case"wfs":return!0;default:return!1}}function v(e){switch(e.type){case"catalog-footprint":case"subtype-sublayer":return!0;default:return w(e)}}},39357:(e,t,n)=>{n.d(t,{H:()=>l});var r,i=n(31635),s=n(25482),o=n(10107),a=(n(44208),n(53966),n(87811),n(40608));let l=r=class extends s.A{constructor(e){super(e),this.name=null,this.code=null}clone(){return new r({name:this.name,code:this.code})}};(0,i.Cg)([(0,o.MZ)({type:String,json:{write:{isRequired:!0}}})],l.prototype,"name",void 0),(0,i.Cg)([(0,o.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],l.prototype,"code",void 0),l=r=(0,i.Cg)([(0,a.$)("esri.layers.support.CodedValue")],l)},45475:(e,t,n)=>{n.d(t,{T:()=>o});var r=n(78888),i=n(2272),s=n(14942);async function o(e,t,n){const o=t.toJSON();o.contents=JSON.stringify(o.contents),o.token=await(0,i.gf)(t.portalUrl,t.apiKey,{signal:n?.signal,prompt:"no-prompt"!==n?.authMode});const a=(0,i.Dl)(e),l=(0,i.jV)(a.query,{...n,query:o,method:"post",authMode:"anonymous"});return(await(0,r.A)(a.path,l)).data.results.map(e=>s.A.fromJSON(e))}},48938:(e,t,n)=>{n.d(t,{X:()=>i,_:()=>s});var r=n(85935);function i(e){if("string"==typeof e)return e.toLowerCase();if("name"in e)return e.name.toLowerCase();if("string"!=typeof e.value)throw new r.D$(null,"InvalidIdentifier",null);return e.value.toLowerCase()}const s=Object.freeze({aborted:!1})},53177:(e,t,n)=>{n.d(t,{A:()=>f});var r,i=n(31635),s=n(4718),o=n(10107),a=(n(44208),n(53966),n(93223)),l=n(40608),u=n(39357),c=n(76357);let f=class extends c.A{static{r=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const n=String(e);this.codedValues.some(e=>(String(e.code)===n&&(t=e.name),!!t))}return t}clone(){return new r({codedValues:(0,s.o8)(this.codedValues),name:this.name})}};(0,i.Cg)([(0,o.MZ)({type:[u.H],json:{write:{isRequired:!0}}})],f.prototype,"codedValues",void 0),(0,i.Cg)([(0,a.e)({codedValue:"coded-value"})],f.prototype,"type",void 0),f=r=(0,i.Cg)([(0,l.$)("esri.layers.support.CodedValueDomain")],f)},62791:(e,t,n)=>{n.d(t,{A:()=>u});var r=n(31635),i=n(25482),s=n(10107),o=n(40608),a=n(24097),l=n(67090);let u=class extends i.A{constructor(e){super(e),this.to=null,this.contents=null,this.portalUrl="https://www.arcgis.com",this.translator="esri",this.from=null,this.apiKey=null,this.requestSource=null}};(0,r.Cg)([(0,s.MZ)({type:[String],json:{write:!0}})],u.prototype,"to",void 0),(0,r.Cg)([(0,s.MZ)({type:[l.A],json:{write:!0}})],u.prototype,"contents",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],u.prototype,"portalUrl",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0,default:"esri"}})],u.prototype,"translator",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],u.prototype,"from",void 0),(0,r.Cg)([(0,s.MZ)(a.K)],u.prototype,"apiKey",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{name:"x-esri-request-source"}})],u.prototype,"requestSource",void 0),u=(0,r.Cg)([(0,o.$)("esri.rest.support.TranslateParameters")],u)},66395:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(66131),i=n(6800),s=n(85935),o=n(78878),a=n(91075),l=n(54218);function u(e,t,n=!1,r=!1){if(null==e)return null;if((0,l.Et)(e)||(0,l.Lm)(e)||(0,l.Kg)(e)||(0,o.e)(e)||(0,o.f)(e)||(0,o.g)(e))return e;if((0,l.cy)(e)){const i=[];for(const s of e)i.push(u(s,t,n,r));return i}if(r&&(0,o.h)(e))return e;const i=new c;i.immutable=!1;for(const[s,o]of Object.entries(e))void 0!==o&&i.setField(s,u(o,t,n,r));return i.immutable=n,i}class c{constructor(e){this.declaredClass="esri.arcade.Dictionary",this.plain=!1,this.immutable=!0,e instanceof c?this.attributes=e.attributes:null==e?this.attributes=Object.create(null):null!=Object.getPrototypeOf(e)?this.attributes={__proto__:null,...e}:this.attributes=e}static containerEntry(e,t){return new c({__proto__:null,key:e,value:t})}static textFormatting(){const e=new c({__proto__:null,newline:"\n",tab:"\t",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});return e.immutable=!1,e}field(e){const t=e.toLowerCase(),n=this.attributes[e];if(void 0!==n)return n;for(const e in this.attributes)if(e.toLowerCase()===t)return this.attributes[e];throw new s.D$(null,"FieldNotFound",null,{key:e})}setField(e,t){if(this.immutable)throw new s.D$(null,"Immutable",null);if((0,o.i)(t))throw new s.D$(null,"NoFunctionInDictionary",null);const n=e.toLowerCase();if(t instanceof Date&&(t=r.lY.dateJSToArcadeDate(t)),void 0===this.attributes[e]){for(const e in this.attributes)if(e.toLowerCase()===n)return void(this.attributes[e]=t);this.attributes[e]=t}else this.attributes[e]=t}hasField(e){const t=e.toLowerCase();if(void 0!==this.attributes[e])return!0;for(const e in this.attributes)if(e.toLowerCase()===t)return!0;return!1}keys(){let e=[];for(const t in this.attributes)e.push(t);return e=e.sort(),e}castToText(e=!1){return(0,o.c)(this.attributes,{useNumbersForDates:e})}static convertObjectToArcadeDictionary(e,t,n=!0,r=!1){const i=new c;i.immutable=!1;for(const s in e){const o=e[s];void 0!==o&&i.setField(s.toString(),u(o,t,n,r))}return i.immutable=n,i}static convertJsonToArcade(e,t,n=!1,r=!1){return u(e,t,n,r)}castAsJson(e=null){const t=Object.create(null);for(let n in this.attributes){const r=this.attributes[n];void 0!==r&&(e?.keyTranslate&&(n=e.keyTranslate(n)),t[n]=(0,o.a)(r,e))}return t}async castDictionaryValueAsJsonAsync(e,t,n,r=null,i){const s=await(0,o.b)(n,r,i);return e[t]=s,s}async castAsJsonAsync(e=null,t=null){const n=Object.create(null),i=[];for(let s in this.attributes){const l=this.attributes[s];t?.keyTranslate&&(s=t.keyTranslate(s)),void 0!==l&&((0,o.d)(l)||l instanceof a.A||l instanceof r.lY?n[s]=(0,o.a)(l,t):i.push(this.castDictionaryValueAsJsonAsync(n,s,l,e,t)))}return i.length>0&&await Promise.all(i),n}deepClone(){const e=new c;e.immutable=!1;for(const t of this.keys())e.setField(t,(0,i.G)(this.field(t)));return e}}},67090:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(31635),i=n(25482),s=n(10107),o=n(40608);let a=class extends i.A{constructor(e){super(e)}};(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],a.prototype,"key",void 0),(0,r.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],a.prototype,"text",void 0),a=(0,r.Cg)([(0,o.$)("esri.rest.support.TranslateContent")],a)},76357:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(31635),i=n(66552),s=n(25482),o=n(10107),a=(n(44208),n(53966),n(87811),n(93223)),l=n(40608);const u=new i.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let c=class extends s.A{constructor(e){super(e),this.name=null,this.type=null}};(0,r.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"name",void 0),(0,r.Cg)([(0,a.e)(u),(0,o.MZ)({json:{write:{isRequired:!0}}})],c.prototype,"type",void 0),c=(0,r.Cg)([(0,l.$)("esri.layers.support.Domain")],c)},78878:(e,t,n)=>{n.d(t,{$:()=>je,A:()=>R,B:()=>W,C:()=>ve,D:()=>he,E:()=>Ne,F:()=>Ce,G:()=>xe,H:()=>ye,I:()=>O,J:()=>I,K:()=>Ge,L:()=>_e,M:()=>P,N:()=>pe,O:()=>re,P:()=>ee,Q:()=>Je,R:()=>F,S:()=>Re,T:()=>Pe,U:()=>Ee,V:()=>Ie,W:()=>ge,X:()=>V,Y:()=>M,Z:()=>Ve,_:()=>ue,a:()=>ke,a0:()=>Oe,a1:()=>Se,a2:()=>me,a3:()=>be,b:()=>Me,c:()=>ae,d:()=>J,e:()=>B,f:()=>H,g:()=>X,h:()=>G,i:()=>L,j:()=>U,k:()=>E,l:()=>q,m:()=>z,n:()=>K,o:()=>Y,p:()=>Ke,q:()=>k,r:()=>D,s:()=>$,t:()=>ce,u:()=>de,v:()=>Z,w:()=>le,x:()=>se,y:()=>oe,z:()=>Ze});var r=n(92602),i=n(70333),s=n(66131),o=n(99719),a=n(85935),l=n(92400),u=n(93818),c=n(7335),f=n(84939),d=n(33325),p=n(14607),y=n(44729),h=n(15032),g=n(5443),m=n(91075),b=n(48526),S=n(86738),T=n(39829),w=n(82799),v=n(16930),A=n(95108),N=n(65864),C=n(73444),x=n(54218),_=n(96285);class F{constructor(e){this.value=e}}class O{constructor(e){this.value=e}}const Z={type:"VOID"},k=Symbol("BREAK"),D=Symbol("CONTINUE");function M(e,t,n){return""===t||null==t||t===n||t===n?e:e=e.split(t).join(n)}function L(e){return e instanceof l.fF}function j(e){return e instanceof o.x}function J(e){return!!((0,x.Kg)(e)||(0,x.Et)(e)||B(e)||H(e)||X(e)||(0,x.Lm)(e)||null===e||e===Z||"number"==typeof e)}function I(e,t){return void 0===e?t:e}function P(e){return null==e?"":(0,x.cy)(e)||U(e)?"Array":B(e)?"Date":X(e)?"Time":H(e)?"DateOnly":(0,x.Kg)(e)?"String":(0,x.Lm)(e)?"Boolean":(0,x.Et)(e)?"Number":"esri.arcade.Attachment"===e?.declaredClass?"Attachment":"esri.arcade.Portal"===e?.declaredClass?"Portal":"esri.arcade.Dictionary"===e?.declaredClass?"Dictionary":Y(e)?"KnowledgeGraph":e instanceof o.x?"Module":E(e)?"Feature":e instanceof S.A?"Point":e instanceof T.A?"Polygon":e instanceof w.A?"Polyline":e instanceof b.A?"Multipoint":e instanceof g.A?"Extent":L(e)?"Function":z(e)?"FeatureSet":q(e)?"FeatureSetCollection":V(e)?"Voxel":e===Z?"":"number"==typeof e&&isNaN(e)?"Number":"Unrecognized Type"}function R(e){return e===Z}function G(e){return e instanceof m.A}function E(e){return"esri.arcade.Feature"===e?.arcadeDeclaredClass}function V(e){return"esri.arcade.Voxel"===e?.arcadeDeclaredClass}function z(e){return"esri.arcade.featureset.support.FeatureSet"===e?.declaredRootClass}function K(e){return"esri.arcade.Dictionary"===e?.declaredClass}function $(e){return K(e)||E(e)||V(e)}function q(e){return"esri.arcade.featureSetCollection"===e?.declaredRootClass}function Y(e){return"esri.rest.knowledgeGraph.KnowledgeGraph"===e?.declaredClass}function U(e){return e instanceof u.A}function B(e){return e instanceof s.lY}function H(e){return e instanceof y.n}function X(e){return e instanceof h.k}function Q(e){return null!=e&&"object"==typeof e}function W(e,t,n,r,i){if(e.length<t||e.length>n)throw new a.D$(r,"WrongNumberOfParameters",i)}function ee(e){return e<0?-Math.round(-e):Math.round(e)}function te(e,t){return isNaN(e)||null==t||""===t?e.toString():(t=M(t,"‰",""),t=M(t,"¤",""),(0,p.GP)(e,{pattern:t}))}function ne(e,t){return null==t||""===t?e.toISOString(!0):e.toFormat(re(t),{locale:(0,C.JK)(),numberingSystem:"latn"})}function re(e,t=!1){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let n="";const r=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const i of e.match(r)||[])switch(i){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="Z";break;case"ZZ":n+="ZZ";break;case"ZZZ":n+="ZZZ";break;case"ZZZZ":n+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":n+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=i;break;default:i.length>=2&&"["===i.slice(0,1)&&"]"===i.slice(-1)?n+=`'${i.slice(1,-1)}'`:n+=`'${i}'`}return n}function ie(e,t,n){switch(n){case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}return!1}function se(e,t,n){if(null===e){if(null===t||t===Z)return ie(null,null,n);if((0,x.Et)(t))return ie(0,t,n);if((0,x.Kg)(t))return ie(0,de(t),n);if((0,x.Lm)(t))return ie(0,de(t),n);if(B(t))return ie(0,t.toNumber(),n);if(X(t))return ie(e,t.toNumber(),n);if(H(t))return ie(e,t.toNumber(),n)}if(e===Z){if(null===t||t===Z)return ie(null,null,n);if((0,x.Et)(t))return ie(0,t,n);if((0,x.Kg)(t))return ie(0,de(t),n);if((0,x.Lm)(t))return ie(0,de(t),n);if(B(t))return ie(0,t.toNumber(),n);if(X(t))return ie(e,t.toNumber(),n);if(H(t))return ie(e,t.toNumber(),n)}else if((0,x.Et)(e)){if((0,x.Et)(t))return ie(e,t,n);if((0,x.Lm)(t))return ie(e,de(t),n);if(null===t||t===Z)return ie(e,0,n);if((0,x.Kg)(t))return ie(e,de(t),n);if(B(t))return ie(e,t.toNumber(),n);if(X(t))return ie(e,t.toNumber(),n);if(H(t))return ie(e,t.toNumber(),n)}else if((0,x.Kg)(e)){if((0,x.Kg)(t))return ie(le(e),le(t),n);if(B(t))return ie(de(e),t.toNumber(),n);if(X(t))return ie(de(e),t.toNumber(),n);if(H(t))return ie(de(e),t.toNumber(),n);if((0,x.Et)(t))return ie(de(e),t,n);if(null===t||t===Z)return ie(de(e),0,n);if((0,x.Lm)(t))return ie(de(e),de(t),n)}else if(B(e)){if(B(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=s.lY.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=s.lY.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),ie(e.toNumber(),t.toNumber(),n);if(null===t||t===Z)return ie(e.toNumber(),0,n);if((0,x.Et)(t))return ie(e.toNumber(),t,n);if((0,x.Lm)(t))return ie(e.toNumber(),de(t),n);if((0,x.Kg)(t))return ie(e.toNumber(),de(t),n);if(X(t))throw new a.D$(null,"CannotCompareDateAndTime",null);if(H(t))return ie(e.toNumber(),t.toNumber(),n)}else if((0,x.Lm)(e)){if((0,x.Lm)(t))return ie(e,t,n);if((0,x.Et)(t))return ie(de(e),de(t),n);if(B(t))return ie(de(e),t.toNumber(),n);if(X(t))return ie(de(e),t.toNumber(),n);if(H(t))return ie(de(e),t.toNumber(),n);if(null===t||t===Z)return ie(de(e),0,n);if((0,x.Kg)(t))return ie(de(e),de(t),n)}else if(H(e)){if(B(t))return ie(e.toNumber(),t.toNumber(),n);if(null===t||t===Z)return ie(e.toNumber(),0,n);if((0,x.Et)(t))return ie(e.toNumber(),t,n);if((0,x.Lm)(t))return ie(e.toNumber(),de(t),n);if((0,x.Kg)(t))return ie(e.toNumber(),de(t),n);if(X(t))throw new a.D$(null,"CannotCompareDateAndTime",null);if(H(t))return ie(e.toNumber(),t.toNumber(),n)}else if(X(e)){if(B(t))throw new a.D$(null,"CannotCompareDateAndTime",null);if(null===t||t===Z)return ie(e.toNumber(),0,n);if((0,x.Et)(t))return ie(e.toNumber(),t,n);if((0,x.Lm)(t))return ie(e.toNumber(),de(t),n);if((0,x.Kg)(t))return ie(e.toNumber(),de(t),n);if(X(t))return ie(e.toNumber(),t.toNumber(),n);if(H(t))throw new a.D$(null,"CannotCompareDateAndTime",null)}return!!oe(e,t)&&("<="===n||">="===n)}function oe(e,t){if(e===t)return!0;if(null===e&&t===Z||null===t&&e===Z)return!0;if(B(e)&&B(t))return e.equals(t);if(X(e)&&X(t))return e.equals(t);if(H(e)&&H(t))return e.equals(t);if(e instanceof c.A)return e.equalityTest(t);if(e instanceof f.A)return e.equalityTest(t);if(e instanceof S.A&&t instanceof S.A){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(null!=n)return n===r}if(Q(e)&&Q(t)){if(e._arcadeCacheId===t._arcadeCacheId&&void 0!==e._arcadeCacheId&&null!==e._arcadeCacheId)return!0;if(e._underlyingGraphic===t._underlyingGraphic&&void 0!==e._underlyingGraphic&&null!==e._underlyingGraphic)return!0}return!1}function ae(e,{useNumbersForDates:t}){let n="";for(const r in e){""!==n&&(n+=",");const i=e[r];null==i?n+=JSON.stringify(r)+":null":(0,x.Lm)(i)||(0,x.Et)(i)||(0,x.Kg)(i)?n+=JSON.stringify(r)+":"+JSON.stringify(i):G(i)?n+=JSON.stringify(r)+":"+ce(i):X(i)||H(i)?n+=`${JSON.stringify(r)}:${JSON.stringify(i.toString())}`:U(i)||Array.isArray(i)?n+=JSON.stringify(r)+":"+ce(i,null,t):B(i)?n+=t?JSON.stringify(r)+":"+JSON.stringify(i.getTime()):JSON.stringify(r)+":"+i.stringify():null!==i&&"object"==typeof i&&"castToText"in i&&(n+=JSON.stringify(r)+":"+i.castToText(t))}return"{"+n+"}"}function le(e,t){if((0,x.Kg)(e))return e;if(null===e)return"";if((0,x.Et)(e))return te(e,t);if((0,x.Lm)(e))return e.toString();if(B(e))return ne(e,t);if(X(e))return e.toFormat(t);if(H(e))return e.toFormat(t);if(e instanceof m.A)return JSON.stringify(e.toJSON());if((0,x.cy)(e)){const t=[];for(let n=0;n<e.length;n++)t[n]=fe(e[n]);return"["+t.join(",")+"]"}if(e instanceof u.A){const t=[];for(let n=0;n<e.length();n++)t[n]=fe(e.get(n));return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText():L(e)?"object, Function":e===Z?"":j(e)?"object, Module":""}function ue(e){const t=[];if(e instanceof u.A){for(let n=0;n<e.length();n++)t[n]=de(e.get(n));return t}if(!(0,x.cy)(e))return null;for(let n=0;n<e.length;n++)t[n]=de(e[n]);return t}function ce(e,t,n=!1){if((0,x.Kg)(e))return e;if(null===e)return"";if((0,x.Et)(e))return te(e,t);if((0,x.Lm)(e))return e.toString();if(B(e))return ne(e,t);if(X(e))return e.toFormat(t);if(H(e))return e.toFormat(t);if(e instanceof m.A)return e instanceof g.A?'{"xmin":'+e.xmin.toString()+',"ymin":'+e.ymin.toString()+","+(e.hasZ?'"zmin":'+e.zmin.toString()+",":"")+(e.hasM?'"mmin":'+e.mmin.toString()+",":"")+'"xmax":'+e.xmax.toString()+',"ymax":'+e.ymax.toString()+","+(e.hasZ?'"zmax":'+e.zmax.toString()+",":"")+(e.hasM?'"mmax":'+e.mmax.toString()+",":"")+'"spatialReference":'+we(e.spatialReference)+"}":we(e.toJSON(),(e,t)=>e.key===t.key?0:"spatialReference"===e.key?1:"spatialReference"===t.key||e.key<t.key?-1:e.key>t.key?1:0);if((0,x.cy)(e)){const t=[];for(let r=0;r<e.length;r++)t[r]=fe(e[r],n);return"["+t.join(",")+"]"}if(e instanceof u.A){const t=[];for(let r=0;r<e.length();r++)t[r]=fe(e.get(r),n);return"["+t.join(",")+"]"}return null!==e&&"object"==typeof e&&"castToText"in e?e.castToText(n):L(e)?"object, Function":e===Z?"":j(e)?"object, Module":""}function fe(e,t=!1){if(null===e)return"null";if((0,x.Lm)(e)||(0,x.Et)(e)||(0,x.Kg)(e))return JSON.stringify(e);if(e instanceof m.A)return ce(e,null,t);if(e instanceof u.A)return ce(e,null,t);if(Array.isArray(e))return ce(e,null,t);if(B(e))return t?JSON.stringify(e.getTime()):JSON.stringify(ne(e,""));if(X(e))return JSON.stringify(e.toString());if(H(e))return JSON.stringify(e.toString());if(null!==e&&"object"==typeof e){if("castToText"in e)return e.castToText(t)}else if(e===Z)return"null";return"null"}function de(e,t){return(0,x.Et)(e)?e:null===e||""===e?0:B(e)||H(e)||X(e)?NaN:(0,x.Lm)(e)?e?1:0:(0,x.cy)(e)||""===e||void 0===e?NaN:void 0!==t&&(0,x.Kg)(e)?(t=M(t,"‰",""),t=M(t,"¤",""),(0,p.qg)(e,{pattern:t})):e===Z?0:Number(e)}function pe(e,t){if(B(e))return e;if((0,x.Kg)(e)){const n=function(e,t){const n=/ (\d\d)/,r=(0,s.mT)(t);let i=_.c9.fromISO(e,{zone:r});return i.isValid||n.test(e)&&(e=e.replace(n,"T$1"),i=_.c9.fromISO(e,{zone:t}),i.isValid)?i:null}(e,t);if(n)return s.lY.dateTimeToArcadeDate(n)}return null}function ye(e){return(0,x.Lm)(e)?e:(0,x.Kg)(e)?"true"===(e=e.toLowerCase()):!!(0,x.Et)(e)&&0!==e&&!isNaN(e)}function he(e,t){return null==e?null:(null!==e.spatialReference&&void 0!==e.spatialReference||(e.spatialReference=t),e)}function ge(e){if(null===e)return null;if(e instanceof S.A)return"NaN"===e.x||null===e.x||isNaN(e.x)?null:e;if(e instanceof T.A){if(0===(e.curveRings??e.rings).length)return null;for(const t of e.curveRings??e.rings)if(t.length>0)return e;return null}if(e instanceof w.A){if(0===(e.curvePaths??e.paths).length)return null;for(const t of e.curvePaths??e.paths)if(t.length>0)return e;return null}return e instanceof b.A?0===e.points.length?null:e:e instanceof g.A?"NaN"===e.xmin||null===e.xmin||isNaN(e.xmin)?null:e:null}function me(e,t){if(!e)return t;if(!e.domain)return t;let n=null,r=null;if(B(t))n=t.toNumber();else if(H(t))n=t.toString();else if(X(t))n=t.toStorageString();else if("string"===e.field.type||"esriFieldTypeString"===e.field.type)n=le(t);else{if(null==t)return null;if(""===t)return t;n=de(t)}for(let t=0;t<e.domain.codedValues.length;t++){const i=e.domain.codedValues[t];i.code===n&&(r=i)}return null===r?le(t):r.name}function be(e,t){if(!e)return t;if(!e.domain)return t;let n=null;const r=le(t);for(let t=0;t<e.domain.codedValues.length;t++){const i=e.domain.codedValues[t];i.name===r&&(n=i)}return null===n?t:n.code}function Se(e,t,n=null,r=null){if(!t)return null;if(!t.fields)return null;let i,s,o=null;for(let n=0;n<t.fields.length;n++){const r=t.fields[n];r.name.toLowerCase()===e.toString().toLowerCase()&&(o=r)}if(null===o)throw new a.D$(null,"FieldNotFound",null,{key:e});let l=t.typeIdField,u="id",c=t.types;if(t.subtypeField&&(l=t.subtypeField,u="code",c=t.subtypes??[]),null===r&&n&&l)r=n.hasField(l)?n.field(l):null;else if(l&&null!==r){let e=!1;for(const t of c||[])if(r===t[u]){e=!0;break}if(!e)for(const t of c||[])if(r===t.name){r=t[u],e=!0;break}e||(r=null,n&&l&&(r=n.hasField(l)?n.field(l):null))}return null!=r&&c.some(e=>e[u]===r&&(i=e.domains?.[o.name],i&&"inherited"===i.type&&(i=Te(o.name,t),s=!0),!0)),s||i||(i=Te(e,t)),{field:o,domain:i}}function Te(e,t){let n;return t.fields.some(t=>(t.name.toLowerCase()===e.toLowerCase()&&(n=t.domain),!!n)),n}function we(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});const n="boolean"==typeof t.cycles&&t.cycles,r=t.cmp&&(i=t.cmp,function(e){return function(t,n){const r={key:t,value:e[t]},s={key:n,value:e[n]};return i(r,s)}});var i;const s=[];return function e(t){if(t?.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0===t)return;if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);let i,o;if(Array.isArray(t)){for(o="[",i=0;i<t.length;i++)i&&(o+=","),o+=e(t[i])||"null";return o+"]"}if(null===t)return"null";if(s.includes(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}const a=s.push(t)-1,l=Object.keys(t).sort(r?.(t));for(o="",i=0;i<l.length;i++){const n=l[i],r=e(t[n]);r&&(o&&(o+=","),o+=JSON.stringify(n)+":"+r)}return s.splice(a,1),"{"+o+"}"}(e)}function ve(e){if(null===e)return null;const t=[];for(const n of e)E(n)?t.push(n.geometry()):t.push(n);return t}function Ae(e,t){if(!(t instanceof S.A))throw new a.D$(null,"InvalidParameter",null);e.push(t.hasZ?t.hasM?[t.x,t.y,t.z,t.m]:[t.x,t.y,t.z]:[t.x,t.y])}function Ne(e,t){if((0,x.cy)(e)||U(e)){let n=!1,r=!1,i=[],s=t;if((0,x.cy)(e)){for(const t of e)Ae(i,t);i.length>0&&(s=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof f.A)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,s=e.get(0).spatialReference);else{if(!U(e))throw new a.D$(null,"InvalidParameter",null);for(const t of e.toArray())Ae(i,t);i.length>0&&(s=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===i.length?null:((0,A.$3)(i)||(i=i.slice().reverse()),new T.A({rings:[i],spatialReference:s,hasZ:n,hasM:r}))}return e}function Ce(e,t){if((0,x.cy)(e)||U(e)){let n=!1,r=!1,i=[],s=t;if((0,x.cy)(e)){for(const t of e)Ae(i,t);i.length>0&&(s=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f.A)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,s=e.get(0).spatialReference);else if(U(e)){for(const t of e.toArray())Ae(i,t);i.length>0&&(s=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===i.length?null:new w.A({paths:[i],spatialReference:s,hasZ:n,hasM:r})}return e}function xe(e,t){if((0,x.cy)(e)||U(e)){let n=!1,r=!1,i=[],s=t;if((0,x.cy)(e)){for(const t of e)Ae(i,t);i.length>0&&(s=e[0].spatialReference,n=!0===e[0].hasZ,r=!0===e[0].hasM)}else if(e instanceof f.A)i=e._elements,i.length>0&&(n=e._hasZ,r=e._hasM,s=e.get(0).spatialReference);else if(U(e)){for(const t of e.toArray())Ae(i,t);i.length>0&&(s=e.get(0).spatialReference,n=!0===e.get(0).hasZ,r=!0===e.get(0).hasM)}return 0===i.length?null:new b.A({points:i,spatialReference:s,hasZ:n,hasM:r})}return e}function _e(e,t=!0){if(null==e)return[];if((0,x.cy)(e)){const n=[];for(const r of e){const e=le(r);(t||""!==e)&&n.push(e)}return n}if(U(e)){const n=[];for(let r=0;r<e.length();r++){const i=le(e.get(r));(t||""!==i)&&n.push(i)}return n}if(J(e)){const n=le(e);if(t||""!==n)return[n]}return[]}let Fe=0;function Oe(e){return Fe++,Fe%100==0?(Fe=0,new Promise(t=>{setTimeout(()=>{t(e)},0)})):e}function Ze(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<<t;case">>":return e>>t;case">>>":return e>>>t}}function ke(e,t=null){return null==e?null:(0,x.Lm)(e)||(0,x.Et)(e)||(0,x.Kg)(e)?e:e instanceof m.A?!0===t?.keepGeometryType?e:e.toJSON():e instanceof u.A?e.toArray().map(e=>ke(e,t)):Array.isArray(e)?e.map(e=>ke(e,t)):(0,x.$P)(e)?e:B(e)?e.toJSDate():X(e)?e.toString():H(e)?e.toJSDate():null!==e&&"object"==typeof e&&void 0!==e.castAsJson?e.castAsJson(t):null}async function De(e,t,n,r,i){const s=await Me(e,t,n);i[r]=s}async function Me(e,t=null,n=null){if(e instanceof u.A&&(e=e.toArray()),null==e)return null;if(J(e)||e instanceof m.A||(0,x.$P)(e)||B(e))return ke(e,n);if(Array.isArray(e)){const r=[],i=[];for(const s of e)null===s||J(s)||s instanceof m.A||(0,x.$P)(s)||B(s)?i.push(ke(s,n)):(i.push(null),r.push(De(s,t,n,i.length-1,i)));return r.length>0&&await Promise.all(r),i}return null!==e&&"object"==typeof e&&void 0!==e.castAsJsonAsync?e.castAsJsonAsync(t,n):null}function Le(e){return je(e)?e.parent:e}function je(e){return e&&"declaredClass"in e&&"esri.layers.support.SubtypeSublayer"===e.declaredClass}function Je(e,t,n){const r=Le(e.fullSchema());return null===r?null:r.fields?Se(t,r,e,n):null}function Ie(e){const t=Le(e.fullSchema());return null===t?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map(e=>({name:e.name,code:e.code})):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(e=>({name:e.name,code:e.id})):[]}:null:null}function Pe(e,t,n,r){const i=Le(e.fullSchema());if(null===i)return null;if(!i.fields)return null;const s=Se(t,i,e,r);if(void 0===n)try{n=e.field(t)}catch(e){return null}return me(s,n)}function Re(e,t,n,r){const i=Le(e.fullSchema());if(null===i)return null;if(!i.fields)return null;if(void 0===n){try{n=e.field(t)}catch(e){return null}return n}return be(Se(t,i,e,r),n)}function Ge(e){return e?.timeZone??"system"}function Ee(e){const t=Le(e.fullSchema());if(null===t)return null;if(!t.fields)return null;const n=[];for(const e of t.fields)n.push((0,d.nE)(e));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:void 0===d.yT[t.geometryType]?"":d.yT[t.geometryType],fields:n}}function Ve(e,t){const n=s.lY.systemTimeZoneCanonicalName;return"system"===e&&(e=n),{version:ze,engineVersion:i.rE,timeZone:e,userTimeZone:n,spatialReference:t instanceof v.A?t.toJSON():t,application:r.A.applicationName??"",engine:"web",locale:(0,C.JK)()}}const ze="1.32",Ke=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:O,ReturnResult:F,absRound:ee,arcadeVersion:ze,autoCastArrayOfPointsToMultiPoint:xe,autoCastArrayOfPointsToPolygon:Ne,autoCastArrayOfPointsToPolyline:Ce,autoCastFeatureToGeometry:ve,binaryOperator:Ze,breakResult:k,castAsJson:ke,castAsJsonAsync:Me,castRecordToText:ae,continueResult:D,defaultExecutingContext:Ve,defaultTimeZone:Ge,defaultUndefined:I,equalityTest:oe,featureDomainCodeLookup:Re,featureDomainValueLookup:Pe,featureFullDomain:Je,featureSchema:Ee,featureSubtypes:Ie,fixNullGeometry:ge,fixSpatialReference:he,formatDate:ne,formatNumber:te,getDomain:Se,getDomainCode:be,getDomainValue:me,getType:P,greaterThanLessThan:se,isArray:x.cy,isBoolean:x.Lm,isDate:B,isDateOnly:H,isDictionary:K,isDictionaryLike:$,isFeature:E,isFeatureSet:z,isFeatureSetCollection:q,isFunctionParameter:L,isGeometry:G,isGraphic:x.DU,isImmutableArray:U,isInteger:x.Fq,isJsDate:x.$P,isKnowledgeGraph:Y,isModule:j,isNumber:x.Et,isObject:Q,isSimpleType:J,isString:x.Kg,isSubtypeGrouplayer:function(e){return e&&"declaredClass"in e&&"esri.layers.SubtypeGroupLayer"===e.declaredClass},isSubtypeSublayer:je,isTime:X,isVoid:R,isVoxel:V,multiReplace:M,parseGeometryFromJson:function(e,t){const n=JSON.parse(e);return n&&!n.spatialReference&&(n.spatialReference=t),(0,N.rS)(n)},pcCheck:W,stableStringify:we,standardiseDateFormat:re,tick:Oe,toBoolean:ye,toDate:pe,toNumber:de,toNumberArray:ue,toString:le,toStringArray:_e,toStringExplicit:ce,voidOperation:Z},Symbol.toStringTag,{value:"Module"}))},80451:(e,t,n)=>{n.d(t,{rS:()=>y,gK:()=>p}),n(44208);var r,i=n(53177),s=n(76357),o=n(31635),a=(n(53966),n(87811),n(49186),n(93223)),l=n(40608);let u=class extends s.A{static{r=this}constructor(e){super(e),this.type="inherited"}clone(){return new r}};(0,o.Cg)([(0,a.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=r=(0,o.Cg)([(0,l.$)("esri.layers.support.InheritedDomain")],u);var c,f=n(10107);let d=class extends s.A{static{c=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new c({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,o.Cg)([(0,f.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,n){t[n]=[this.minValue||0,e]},isRequired:!0}}})],d.prototype,"maxValue",void 0),(0,o.Cg)([(0,f.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,n){t[n]=[e,this.maxValue||0]},isRequired:!0}}})],d.prototype,"minValue",void 0),(0,o.Cg)([(0,a.e)({range:"range"})],d.prototype,"type",void 0),d=c=(0,o.Cg)([(0,l.$)("esri.layers.support.RangeDomain")],d);const p={key:"type",base:s.A,typeMap:{range:d,"coded-value":i.A,inherited:u}};function y(e){if(!e?.type)return null;switch(e.type){case"range":return d.fromJSON(e);case"codedValue":return i.A.fromJSON(e);case"inherited":return u.fromJSON(e)}return null}},84939:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(93818),i=n(86738);class s extends r.A{constructor(e,t,n,r,i,s){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=t,this._hasZ=n,this._hasM=r,this._cacheId=i,this._partId=s}get(e){if(void 0===this._lazyPt[e]){const t=this._elements[e];if(void 0===t)return;const n=new i.A(t[0],t[1],this._spRef);this._hasZ&&(n.z=t[2]),this._hasM&&(n.m=this._hasZ?t[3]:t[2]),n.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=n}return this._lazyPt[e]}equalityTest(e){return e===this||null!==e&&e instanceof s!=0&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}},92400:(e,t,n)=>{n.d(t,{CU:()=>a,UQ:()=>o,fF:()=>i,o6:()=>s});var r=n(74887);class i{constructor(){}}function s(e,t,n){if(e instanceof i&&!(e instanceof a)){const r=new a;return r.fn=e,r.parameterEvaluator=n,r.context=t,r}return e}class o extends i{constructor(e){super(),this.fn=e}createFunction(e){return(...t)=>this.fn(e,{preparsed:!0,arguments:t})}call(e,t){return this.fn(e,t)}marshalledCall(e,t,n,o){return o(e,t,(t,l,u)=>{u=u.map(t=>t instanceof i&&!(t instanceof a)?s(t,e,o):t);const c=this.call(n,{args:u});return(0,r.$X)(c)?c.then(e=>s(e,n,o)):c})}}class a extends i{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,t){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}marshalledCall(e,t,n){return this.fn.marshalledCall(e,t,this.context,this.parameterEvaluator)}}},93818:(e,t,n)=>{n.d(t,{A:()=>r});class r{constructor(e=[]){this._elements=e}length(){return this._elements.length}get(e){return this._elements[e]}toArray(){return this.slice()}slice(e=0,t=this.length()){const n=[];for(let r=e;r<t;r++)n.push(this.get(r));return n}}},99719:(e,t,n)=>{n.d(t,{x:()=>r});class r{}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6719,8407],{10407:(e,t,r)=>{r.d(t,{It:()=>y,LG:()=>o,OM:()=>u,Sm:()=>p,Y:()=>a,bK:()=>l,mm:()=>h,sQ:()=>c});var s=r(98988),i=r(16930),n=r(28735);function o(e,t){if(!a(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function a(e,t){return!!e.typeKeywords?.includes(t)}function l(e){return a(e,h.HOSTED_SERVICE)}function u(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function p(e,t,r){r?o(e,t):u(e,t)}async function c(e){const t=e.clone().normalize();let r;if(t.length>1)for(const e of t)r?e.width>r.width&&(r=e):r=e;else r=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,n.ci)(e);const r=i.A.WGS84;return await(0,s.initializeProjection)(t,r),(0,s.project)(e,r)}(r)}const h={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function y(e){const{portal:t,isOrgItem:r,itemControl:s}=e,i=t.user?.privileges;let n=!i||i.includes("features:user:edit"),o=!!r&&!!i?.includes("features:user:fullEdit");const a="update"===s||"admin"===s;return a?o=n=!0:o&&(n=!0),{features:{edit:n,fullEdit:o},content:{updateItem:a}}}},17311:(e,t,r)=>{r.d(t,{A:()=>h});var s=r(31635),i=r(69622),n=r(4576),o=r(60999),a=r(7762),l=r(10107),u=(r(44208),r(53966),r(40608)),p=r(30524),c=r(43668);let h=class extends i.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,o.UT)(()=>(0,c.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??r.e(9926).then(r.bind(r,29926)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new a.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter(t=>e.includes(`{expression/${t.name.toLowerCase()}}`))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some(e=>!0===e.invalid)}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),s=this.fieldsIndex.get(r.at(-1)??"");s&&e.add(s.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){const s=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],r)).get(s)??""}async getTitles(e,t,r){const s=new Map,i=r?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:n}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);r?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:o,workingTitle:a}=this,l=a&&o;t.forEach(t=>{const r=t.getObjectId()??t.attributes[e.objectIdField],u=l?n({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:o,globalAttributes:this._createFormattedAttributes(e,t,i).global,layer:e,text:a}):"";s.set(r,u)})}catch{}return s}async _checkAndReQueryGraphics(e,t){const r=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(n.Ru);if(r.length!==t.length)return t;if(t.some(e=>!(0,p.Kl)(e,this.requiredFields))){const s=e.createQuery();s.where="1=1",s.outFields=[...this.requiredFields],s.objectIds=r;const i=await e.queryFeatures(s);if(i?.features.length===t.length)return i.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),s=e?.name??r.fieldName;r.fieldName=s,t.set(s.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const s=this.effectivePopupTemplate?.fieldInfos??[],i={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{i[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const n={...t.attributes,...i};return{global:this._featureUtils.formatAttributes({fieldInfos:s,attributes:n,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,p.nw)(e).filter(e=>!(0===e.indexOf("relationships/")||0===e.indexOf("expression/")))}};(0,s.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"_arcadeTask",null),(0,s.Cg)([(0,l.MZ)()],h.prototype,"_featureUtils",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"featureUtilsPromise",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"calculatedExpressions",null),(0,s.Cg)([(0,l.MZ)()],h.prototype,"displayField",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"effectivePopupTemplate",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"expressionsUsedInTitle",null),(0,s.Cg)([(0,l.MZ)()],h.prototype,"fieldsIndex",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"fieldInfoMap",null),(0,s.Cg)([(0,l.MZ)()],h.prototype,"fields",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"objectIdField",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"requiredFields",null),h=(0,s.Cg)([(0,u.$)("esri.layers.support.TitleCreator")],h)},22671:(e,t,r)=>{r.d(t,{A:()=>b});var s,i=r(31635),n=r(52106),o=r(66552),a=r(25482),l=r(4718),u=r(10107),p=(r(44208),r(53966),r(36005)),c=r(40608),h=r(43937),y=r(16930),f=r(65864),d=r(50498),g=r(20437);const m=new o.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=s=class extends a.A{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,n.A)}writeGeometryType(e,t,r,s){if(e)return void m.write(e,t,r,s);const{features:i}=this;if(i)for(const e of i)if(null!=e?.geometry)return void m.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,f.rS)(e);return s&&!r&&t.spatialReference&&(s.spatialReference=y.A.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(this.cloneProperties())}cloneProperties(){return(0,l.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e?.[r];s.geometry=t?.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,i]}=e,n=this.features,o=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-s)/t),e=>Math.round((i-e)/r));for(let e=0,t=n.length;e<t;e++)o?.(n[e].geometry)||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,i],scale:[n,o]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,e=>e*n+s,e=>i-e*o,a,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const s=y.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const n=e[t],o=r.fromJSON(n),a=n.geometry?.spatialReference;null==o.geometry||a||(o.geometry.spatialReference=s);const l=n.aggregateGeometries,u=o.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],r=l[e],i=r?.spatialReference;null==t||i||(t.spatialReference=s)}i.push(o)}return i}_quantizePoints(e,t,r){let s,i;const n=[];for(let o=0,a=e.length;o<a;o++){const a=e[o];if(o>0){const e=t(a[0]),o=r(a[1]);e===s&&o===i||(n.push([e-s,o-i]),s=e,i=o)}else s=t(a[0]),i=r(a[1]),n.push([s,i])}return n.length>0?n:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,f.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,n=s.length;e<n;e++){const n=s[e],o=this._quantizePoints(n,t,r);o&&i.push(o)}return i.length>0?((0,f.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s&&s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,s,i){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),s&&(e.z=s(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,f.Bi)(e)?e.rings:e.paths;let o,a;for(let e=0,s=n.length;e<s;e++){const s=n[e];for(let e=0,i=s.length;e<i;e++){const i=s[e];e>0?(o+=i[0],a+=i[1]):(o=i[0],a=i[1]),i[0]=t(o),i[1]=r(a)}}if(s&&i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2]),r[3]=i(r[3])}}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),s&&null!=e.zmax&&null!=e.zmin&&(e.zmax=s(e.zmax),e.zmin=s(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let o,a;for(let e=0,s=n.length;e<s;e++){const s=n[e];e>0?(o+=s[0],a+=s[1]):(o=s[0],a=s[1]),s[0]=t(o),s[1]=r(a)}if(s&&i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=s(t[2]),t[3]=i(t[3])}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=s(t[2])}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2])}}:null}};(0,i.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,i.Cg)([(0,u.MZ)({type:[n.A],json:{write:!0}})],b.prototype,"features",void 0),(0,i.Cg)([(0,p.w)("features")],b.prototype,"readFeatures",null),(0,i.Cg)([(0,u.MZ)({type:[g.A],json:{write:!0}})],b.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:m.read}}})],b.prototype,"geometryType",void 0),(0,i.Cg)([(0,h.K)("geometryType")],b.prototype,"writeGeometryType",null),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,i.Cg)([(0,u.MZ)({types:d.yR,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,i.Cg)([(0,p.w)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,i.Cg)([(0,u.MZ)({type:y.A,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,i.Cg)([(0,h.K)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,i.Cg)([(0,u.MZ)({json:{write:!0}})],b.prototype,"transform",void 0),b=s=(0,i.Cg)([(0,c.$)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0},32756:(e,t,r)=>{r.d(t,{Rr:()=>l,fY:()=>p,ne:()=>u});var s=r(31635),i=r(93637),n=r(10107),o=(r(44208),r(53966),r(87811),r(40608)),a=r(91880);function l(e,t,r){if(!e)return null;const s=e.find(e=>!!e.field);if(!s)return null;const i=new a.A;return i.read(s,r),[i]}const u={type:[a.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:l},write:{writer:function(e,t,r,s){const n=e.find(e=>!!e.field);n&&(0,i.sM)(r,[n.toJSON()],t)}}}},p=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,s.Cg)([(0,n.MZ)(u)],r.prototype,"orderBy",void 0),r=(0,s.Cg)([(0,o.$)("esri.layers.mixins.OrderedLayer")],r),r}},33143:(e,t,r)=>{r.d(t,{A:()=>h});var s=r(31635),i=r(69540),n=r(25482),o=r(10107),a=(r(44208),r(53966),r(87811),r(36005)),l=r(40608),u=r(43937),p=r(80451),c=r(29005);let h=class extends(i.A.ClonableMixin(n.A)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.rS)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],h.prototype,"id",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],h.prototype,"name",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],h.prototype,"domains",void 0),(0,s.Cg)([(0,a.w)("domains")],h.prototype,"readDomains",null),(0,s.Cg)([(0,u.K)("domains")],h.prototype,"writeDomains",null),(0,s.Cg)([(0,o.MZ)({type:[c.A],json:{write:!0}})],h.prototype,"templates",void 0),h=(0,s.Cg)([(0,l.$)("esri.layers.support.FeatureType")],h)},52106:(e,t,r)=>{r.d(t,{A:()=>_});var s,i=r(31635),n=r(13874),o=r(69540),a=r(51447),l=r(25482),u=r(53966),p=r(36708),c=r(24326),h=r(10107),y=(r(44208),r(87811),r(40608)),f=r(12195),d=r(65864),g=r(50498),m=r(54339),b=r(33910);function v(e){if(null==e)return null;const t={};for(const r in e){const s=e[r];s&&(t[r]=s.toJSON())}return 0!==Object.keys(t).length?t:null}let _=class extends(o.A.ClonableMixin(l.A)){static{s=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,c.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new s({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const r of[t,this.sourceLayer,this.layer])if(r){if("popupTemplate"in r&&r.popupTemplate)return r.popupTemplate;if(e&&"defaultPopupTemplate"in r&&null!=r.defaultPopupTemplate)return r.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=this.sourceLayer??this.layer;return e?(0,m.r)(this,e):null}getGlobalId(){const e=this.sourceLayer??this.layer;return e&&"globalIdField"in e&&e.globalIdField?this.getAttribute(e.globalIdField):null}toJSON(){return{aggregateGeometries:v(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,f.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,s){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const i={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(i.action=s),"attributes"===e&&(i.attributeName=s),this.layer.graphicChanged(i)}_watchMeshGeometryChanges(){this.addHandles([(0,p.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,p.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,i.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const s=(0,d.rS)(e[r]);s&&(t[r]=s)}return 0!==Object.keys(t).length?t:null}}})],_.prototype,"aggregateGeometries",null),(0,i.Cg)([(0,h.MZ)({value:null})],_.prototype,"attributes",null),(0,i.Cg)([(0,h.MZ)({value:null,types:g.yR,json:{read:d.rS}})],_.prototype,"geometry",null),(0,i.Cg)([(0,h.MZ)({type:Boolean})],_.prototype,"isAggregate",void 0),(0,i.Cg)([(0,h.MZ)({clonable:!1})],_.prototype,"layer",void 0),(0,i.Cg)([(0,h.MZ)({clonable:"reference"})],_.prototype,"origin",void 0),(0,i.Cg)([(0,h.MZ)({type:n.A,value:null})],_.prototype,"popupTemplate",null),(0,i.Cg)([(0,h.MZ)({clonable:"reference"})],_.prototype,"sourceLayer",void 0),(0,i.Cg)([(0,h.MZ)({value:null,types:b.Es})],_.prototype,"symbol",null),(0,i.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],_.prototype,"_version",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,value:!0})],_.prototype,"visible",null),_=s=(0,i.Cg)([(0,y.$)("esri.Graphic")],_)},60999:(e,t,r)=>{r.d(t,{DZ:()=>f,Ke:()=>y,Tj:()=>p,UT:()=>d,jJ:()=>u});var s=r(31635),i=r(69622),n=r(97768),o=r(74887),a=r(10107),l=r(40608);function u(e,t,r){return(0,o.Lx)(e.map((e,s)=>t.apply(r,[e,s])))}async function p(e,t,r){return(await(0,o.Lx)(e.map((e,s)=>t.apply(r,[e,s])))).map(e=>e.value)}function c(e){return{ok:!0,value:e}}function h(e){return{ok:!1,error:e}}async function y(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return c(await e)}catch(e){return h(e)}}async function f(e){try{return c(await e)}catch(e){return(0,o.QP)(e),h(e)}}function d(e,t){return new g(e,t)}let g=class extends i.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,n.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then(e=>{this._result=c(e),this._cleanup()},e=>{this._result=h(e),this._cleanup()}),this._abortHandle=(0,o.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.xt)(this._abortHandle),this._abortController=null}};(0,s.Cg)([(0,a.MZ)()],g.prototype,"value",null),(0,s.Cg)([(0,a.MZ)()],g.prototype,"error",null),(0,s.Cg)([(0,a.MZ)()],g.prototype,"finished",null),(0,s.Cg)([(0,a.MZ)()],g.prototype,"promise",void 0),(0,s.Cg)([(0,a.MZ)()],g.prototype,"_result",void 0),g=(0,s.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],g)},77548:(e,t,r)=>{r.d(t,{Gh:()=>d,tk:()=>c,BR:()=>p,wI:()=>u,G$:()=>y,$x:()=>h,Ov:()=>a,W_:()=>l,OP:()=>f,TU:()=>o,XX:()=>n});var s=r(70333),i=r(78888);r(7762),r(84952),r(36563),r(36708),new WeakMap;const n={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function o(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function a(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function l(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function u(e,t){const r=s.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const n=e.toLowerCase().indexOf("/rest/services");if(-1===n)return null;const o=`${e.slice(0,n)}/rest/info`,a=null!=t?t.signal:null,{data:l}=await(0,i.A)(o,{query:{f:"json"},responseType:"json",signal:a});return l?.owningSystemUrl||null}function p(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function c(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function h(e,t){return null}function y(e){return null}function f(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function d(e,t){if(!t||!f(e))return;const r=(e.url,null);r&&(e.url=r)}},91880:(e,t,r)=>{r.d(t,{A:()=>p});var s,i=r(31635),n=r(66552),o=r(25482),a=r(10107),l=(r(44208),r(53966),r(87811),r(40608));const u=new n.J({asc:"ascending",desc:"descending"});let p=class extends o.A{static{s=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new s({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],p.prototype,"field",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],p.prototype,"valueExpression",void 0),(0,i.Cg)([(0,a.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],p.prototype,"order",void 0),p=s=(0,i.Cg)([(0,l.$)("esri.layers.support.OrderByInfo")],p)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6719,8407],{10407:(e,t,r)=>{r.d(t,{It:()=>y,LG:()=>o,OM:()=>u,Sm:()=>p,Y:()=>a,bK:()=>l,mm:()=>h,sQ:()=>c});var s=r(98988),i=r(16930),n=r(28735);function o(e,t){if(!a(e,t)){const r=e.typeKeywords;r?r.push(t):e.typeKeywords=[t]}}function a(e,t){return!!e.typeKeywords?.includes(t)}function l(e){return a(e,h.HOSTED_SERVICE)}function u(e,t){const r=e.typeKeywords;if(r){const e=r.indexOf(t);e>-1&&r.splice(e,1)}}function p(e,t,r){r?o(e,t):u(e,t)}async function c(e){const t=e.clone().normalize();let r;if(t.length>1)for(const e of t)r?e.width>r.width&&(r=e):r=e;else r=t[0];return async function(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return(0,n.ci)(e);const r=i.A.WGS84;return await(0,s.initializeProjection)(t,r),(0,s.project)(e,r)}(r)}const h={CHARTS:"Charts",DYNAMIC:"Dynamic",DEVELOPER_BASEMAP:"DeveloperBasemap",GROUP_LAYER_MAP:"Map",HOSTED_SERVICE:"Hosted Service",JSAPI:"ArcGIS API for JavaScript",LOCAL_SCENE:"ViewingMode-Local",METADATA:"Metadata",MULTI_LAYER:"Multilayer",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer",SINGLE_LAYER:"Singlelayer",SUBTYPE_GROUP_LAYER:"SubtypeGroupLayer",SUBTYPE_GROUP_TABLE:"SubtypeGroupTable",TABLE:"Table",TILED_IMAGERY:"Tiled Imagery"};function y(e){const{portal:t,isOrgItem:r,itemControl:s}=e,i=t.user?.privileges;let n=!i||i.includes("features:user:edit"),o=!!r&&!!i?.includes("features:user:fullEdit");const a="update"===s||"admin"===s;return a?o=n=!0:o&&(n=!0),{features:{edit:n,fullEdit:o},content:{updateItem:a}}}},17311:(e,t,r)=>{r.d(t,{A:()=>h});var s=r(31635),i=r(69622),n=r(4576),o=r(60999),a=r(7762),l=r(10107),u=(r(44208),r(53966),r(40608)),p=r(30524),c=r(43668);let h=class extends i.A{constructor(e){super(e),this._featureUtils=null,this.effectivePopupTemplate=null}get _arcadeTask(){return this.expressionsUsedInTitle.length>0?this._get("_arcadeTask")||(0,o.UT)(()=>(0,c.l)()):null}get featureUtilsPromise(){return this._get("featureUtilsPromise")??r.e(9926).then(r.bind(r,29926)).then(e=>this._featureUtils=e)}get calculatedExpressions(){const e=new a.A;if(!this.expressionsUsedInTitle.length)return e;if(!this._arcadeTask?.value){for(const t of this.expressionsUsedInTitle??[])e.push({name:t.name,invalid:!0});return e}for(const t of this.expressionsUsedInTitle)try{const r=this._arcadeTask.value.arcade.parseScript(t.expression,["$layer","$map","$datastore"]);if(r.isAsync){e.push({name:t.name,invalid:!0});break}e.push({name:t.name,syntax:r,invalid:!1,func:this._arcadeTask.value.arcade.compileScript(r,{vars:{$feature:"any"}})})}catch{e.push({name:t.name,invalid:!0});break}return e}get expressionsUsedInTitle(){let e=this.effectivePopupTemplate?.title??"";return"string"!=typeof e?[]:(e=e.toLowerCase(),this.effectivePopupTemplate?.expressionInfos?.filter(t=>e.includes(`{expression/${t.name.toLowerCase()}}`))??[])}get fieldInfoMap(){return this._featureUtils?this._createFieldInfoMap(this._featureUtils.getAllFieldInfos(this.effectivePopupTemplate)):null}get hasBadExpressions(){return this.calculatedExpressions.some(e=>!0===e.invalid)}get requiredFields(){const e=new Set;if(this._arcadeTask?.value&&!this.hasBadExpressions)for(const t of this.calculatedExpressions?.toArray()??[])try{const r=this._arcadeTask.value.arcade.extractFieldLiterals(t.syntax);for(const t of r){const r=t.split("."),s=this.fieldsIndex.get(r.at(-1)??"");s&&e.add(s.name)}}catch{}const t=this._extractFieldNames(this.workingTitle);for(const r of t){const t=this.fieldsIndex.get(r);t&&e.add(t.name)}return null!=this.objectIdField&&e.add(this.objectIdField),e}get titleFromDisplayField(){let e="";return this.displayField&&(e=this.fieldsIndex.get(this.displayField)?.name??""),e||(e=this.fieldsIndex.get(this.objectIdField)?.name??""),e?`{${e}}`:""}get workingTitle(){const e=this.effectivePopupTemplate?this.effectivePopupTemplate.title:"";return""===e||null==e||this.hasBadExpressions||"string"!=typeof e?this.titleFromDisplayField:e}async getTitle(e,t,r){const s=t.getObjectId()??t.attributes[e.objectIdField];return(await this.getTitles(e,[t],r)).get(s)??""}async getTitles(e,t,r){const s=new Map,i=r?.timeZone??"system";try{const[{substituteFieldsInLinksAndAttributes:n}]=await Promise.all([this.featureUtilsPromise,this._arcadeTask?.promise]);r?.fetchMissingFields&&(t=await this._checkAndReQueryGraphics(e,t));const{fieldInfoMap:o,workingTitle:a}=this,l=a&&o;t.forEach(t=>{const r=t.getObjectId()??t.attributes[e.objectIdField],u=l?n({attributes:t.attributes,expressionAttributes:null,fieldInfoMap:o,globalAttributes:this._createFormattedAttributes(e,t,i).global,layer:e,text:a}):"";s.set(r,u)})}catch{}return s}async _checkAndReQueryGraphics(e,t){const r=t.map(t=>t.getObjectId()??t.attributes[e.objectIdField]).filter(n.Ru);if(r.length!==t.length)return t;if(t.some(e=>!(0,p.Kl)(e,this.requiredFields))){const s=e.createQuery();s.where="1=1",s.outFields=[...this.requiredFields],s.objectIds=r;const i=await e.queryFeatures(s);if(i?.features.length===t.length)return i.features}return t}_createFieldInfoMap(e){const t=new Map;if(!e)return t;for(const r of e){if(!r.fieldName)continue;const e=this.fieldsIndex.get(r.fieldName),s=e?.name??r.fieldName;r.fieldName=s,t.set(s.toLowerCase(),r)}return t}_createFormattedAttributes(e,t,r="system"){const s=this.effectivePopupTemplate?.fieldInfos??[],i={};if(!this._featureUtils)return{};if(!this.hasBadExpressions&&this.calculatedExpressions.length>0&&this._arcadeTask?.value){const r=this._arcadeTask.value.Feature.createFromGraphicLikeObject(t.geometry,t.attributes,e,null);for(const e of this.calculatedExpressions)try{i[`expression/${e.name}`]=e.func({vars:{$feature:r}})}catch{}}const n={...t.attributes,...i};return{global:this._featureUtils.formatAttributes({fieldInfos:s,attributes:n,graphic:t,timeZone:r,layer:e,fieldInfoMap:this.fieldInfoMap}),content:[]}}_extractFieldNames(e){return(0,p.nw)(e).filter(e=>!(0===e.indexOf("relationships/")||0===e.indexOf("expression/")))}};(0,s.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"_arcadeTask",null),(0,s.Cg)([(0,l.MZ)()],h.prototype,"_featureUtils",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"featureUtilsPromise",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"calculatedExpressions",null),(0,s.Cg)([(0,l.MZ)()],h.prototype,"displayField",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"effectivePopupTemplate",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"expressionsUsedInTitle",null),(0,s.Cg)([(0,l.MZ)()],h.prototype,"fieldsIndex",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"fieldInfoMap",null),(0,s.Cg)([(0,l.MZ)()],h.prototype,"fields",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"objectIdField",void 0),(0,s.Cg)([(0,l.MZ)()],h.prototype,"requiredFields",null),h=(0,s.Cg)([(0,u.$)("esri.layers.support.TitleCreator")],h)},22671:(e,t,r)=>{r.d(t,{A:()=>b});var s,i=r(31635),n=r(52106),o=r(66552),a=r(25482),l=r(4718),u=r(10107),p=(r(44208),r(53966),r(36005)),c=r(40608),h=r(43937),y=r(16930),f=r(65864),d=r(50498),g=r(20437);const m=new o.J({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=s=class extends a.A{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){return this.readFeaturesWithClass(e,t,n.A)}writeGeometryType(e,t,r,s){if(e)return void m.write(e,t,r,s);const{features:i}=this;if(i)for(const e of i)if(null!=e?.geometry)return void m.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,f.rS)(e);return s&&!r&&t.spatialReference&&(s.spatialReference=y.A.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(this.cloneProperties())}cloneProperties(){return(0,l.o8)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e?.[r];s.geometry=t?.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,i]}=e,n=this.features,o=this._getQuantizationFunction(this.geometryType,e=>Math.round((e-s)/t),e=>Math.round((i-e)/r));for(let e=0,t=n.length;e<t;e++)o?.(n[e].geometry)||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,i],scale:[n,o]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,e=>e*n+s,e=>i-e*o,a,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}readFeaturesWithClass(e,t,r){const s=y.A.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const n=e[t],o=r.fromJSON(n),a=n.geometry?.spatialReference;null==o.geometry||a||(o.geometry.spatialReference=s);const l=n.aggregateGeometries,u=o.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],r=l[e],i=r?.spatialReference;null==t||i||(t.spatialReference=s)}i.push(o)}return i}_quantizePoints(e,t,r){let s,i;const n=[];for(let o=0,a=e.length;o<a;o++){const a=e[o];if(o>0){const e=t(a[0]),o=r(a[1]);e===s&&o===i||(n.push([e-s,o-i]),s=e,i=o)}else s=t(a[0]),i=r(a[1]),n.push([s,i])}return n.length>0?n:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,f.Bi)(e)?e.rings:e.paths,i=[];for(let e=0,n=s.length;e<n;e++){const n=s[e],o=this._quantizePoints(n,t,r);o&&i.push(o)}return i.length>0?((0,f.Bi)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s&&s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,s,i){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),s&&(e.z=s(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,f.Bi)(e)?e.rings:e.paths;let o,a;for(let e=0,s=n.length;e<s;e++){const s=n[e];for(let e=0,i=s.length;e<i;e++){const i=s[e];e>0?(o+=i[0],a+=i[1]):(o=i[0],a=i[1]),i[0]=t(o),i[1]=r(a)}}if(s&&i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2]),r[3]=i(r[3])}}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=i(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),s&&null!=e.zmax&&null!=e.zmin&&(e.zmax=s(e.zmax),e.zmin=s(e.zmin)),i&&null!=e.mmax&&null!=e.mmin&&(e.mmax=i(e.mmax),e.mmin=i(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let o,a;for(let e=0,s=n.length;e<s;e++){const s=n[e];e>0?(o+=s[0],a+=s[1]):(o=s[0],a=s[1]),s[0]=t(o),s[1]=r(a)}if(s&&i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=s(t[2]),t[3]=i(t[3])}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=s(t[2])}else if(i)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=i(t[2])}}:null}};(0,i.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,i.Cg)([(0,u.MZ)({type:[n.A],json:{write:!0}})],b.prototype,"features",void 0),(0,i.Cg)([(0,p.w)("features")],b.prototype,"readFeatures",null),(0,i.Cg)([(0,u.MZ)({type:[g.A],json:{write:!0}})],b.prototype,"fields",void 0),(0,i.Cg)([(0,u.MZ)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:m.read}}})],b.prototype,"geometryType",void 0),(0,i.Cg)([(0,h.K)("geometryType")],b.prototype,"writeGeometryType",null),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,i.Cg)([(0,u.MZ)({types:d.yR,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,i.Cg)([(0,p.w)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,i.Cg)([(0,u.MZ)({type:y.A,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,i.Cg)([(0,h.K)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,i.Cg)([(0,u.MZ)({json:{write:!0}})],b.prototype,"transform",void 0),b=s=(0,i.Cg)([(0,c.$)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0},32756:(e,t,r)=>{r.d(t,{Rr:()=>l,fY:()=>p,ne:()=>u});var s=r(31635),i=r(93637),n=r(10107),o=(r(44208),r(53966),r(87811),r(40608)),a=r(91880);function l(e,t,r){if(!e)return null;const s=e.find(e=>!!e.field);if(!s)return null;const i=new a.A;return i.read(s,r),[i]}const u={type:[a.A],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:l},write:{writer:function(e,t,r,s){const n=e.find(e=>!!e.field);n&&(0,i.sM)(r,[n.toJSON()],t)}}}},p=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.orderBy=null}};return(0,s.Cg)([(0,n.MZ)(u)],r.prototype,"orderBy",void 0),r=(0,s.Cg)([(0,o.$)("esri.layers.mixins.OrderedLayer")],r),r}},33143:(e,t,r)=>{r.d(t,{A:()=>h});var s=r(31635),i=r(69540),n=r(25482),o=r(10107),a=(r(44208),r(53966),r(87811),r(36005)),l=r(40608),u=r(43937),p=r(80451),c=r(29005);let h=class extends(i.A.ClonableMixin(n.A)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.rS)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],h.prototype,"id",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],h.prototype,"name",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0}})],h.prototype,"domains",void 0),(0,s.Cg)([(0,a.w)("domains")],h.prototype,"readDomains",null),(0,s.Cg)([(0,u.K)("domains")],h.prototype,"writeDomains",null),(0,s.Cg)([(0,o.MZ)({type:[c.A],json:{write:!0}})],h.prototype,"templates",void 0),h=(0,s.Cg)([(0,l.$)("esri.layers.support.FeatureType")],h)},52106:(e,t,r)=>{r.d(t,{A:()=>_});var s,i=r(31635),n=r(13874),o=r(69540),a=r(51447),l=r(25482),u=r(53966),p=r(36708),c=r(24326),h=r(10107),y=(r(44208),r(87811),r(40608)),f=r(12195),d=r(65864),g=r(50498),m=r(54339),b=r(33910);function v(e){if(null==e)return null;const t={};for(const r in e){const s=e[r];s&&(t[r]=s.toJSON())}return 0!==Object.keys(t).length?t:null}let _=class extends(o.A.ClonableMixin(l.A)){static{s=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,c.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new s({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const r of[t,this.sourceLayer,this.layer])if(r&&"object"==typeof r){if("popupTemplate"in r&&r.popupTemplate)return r.popupTemplate;if(e&&"defaultPopupTemplate"in r&&null!=r.defaultPopupTemplate)return r.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=this.sourceLayer??this.layer;return e?(0,m.r)(this,e):null}getGlobalId(){const e=this.sourceLayer??this.layer;return e&&"globalIdField"in e&&e.globalIdField?this.getAttribute(e.globalIdField):null}toJSON(){return{aggregateGeometries:v(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,f.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,s){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const i={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(i.action=s),"attributes"===e&&(i.attributeName=s),this.layer.graphicChanged(i)}_watchMeshGeometryChanges(){this.addHandles([(0,p.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,p.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,i.Cg)([(0,h.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const s=(0,d.rS)(e[r]);s&&(t[r]=s)}return 0!==Object.keys(t).length?t:null}}})],_.prototype,"aggregateGeometries",null),(0,i.Cg)([(0,h.MZ)({value:null})],_.prototype,"attributes",null),(0,i.Cg)([(0,h.MZ)({value:null,types:g.yR,json:{read:d.rS}})],_.prototype,"geometry",null),(0,i.Cg)([(0,h.MZ)({type:Boolean})],_.prototype,"isAggregate",void 0),(0,i.Cg)([(0,h.MZ)({clonable:!1})],_.prototype,"layer",void 0),(0,i.Cg)([(0,h.MZ)({clonable:"reference"})],_.prototype,"origin",void 0),(0,i.Cg)([(0,h.MZ)({type:n.A,value:null})],_.prototype,"popupTemplate",null),(0,i.Cg)([(0,h.MZ)({clonable:"reference"})],_.prototype,"sourceLayer",void 0),(0,i.Cg)([(0,h.MZ)({value:null,types:b.Es})],_.prototype,"symbol",null),(0,i.Cg)([(0,h.MZ)({clonable:!1,json:{read:!1,write:!1}})],_.prototype,"_version",void 0),(0,i.Cg)([(0,h.MZ)({type:Boolean,value:!0})],_.prototype,"visible",null),_=s=(0,i.Cg)([(0,y.$)("esri.Graphic")],_)},60999:(e,t,r)=>{r.d(t,{DZ:()=>f,Ke:()=>y,Tj:()=>p,UT:()=>d,jJ:()=>u});var s=r(31635),i=r(69622),n=r(97768),o=r(74887),a=r(10107),l=r(40608);function u(e,t,r){return(0,o.Lx)(e.map((e,s)=>t.apply(r,[e,s])))}async function p(e,t,r){return(await(0,o.Lx)(e.map((e,s)=>t.apply(r,[e,s])))).map(e=>e.value)}function c(e){return{ok:!0,value:e}}function h(e){return{ok:!1,error:e}}async function y(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return c(await e)}catch(e){return h(e)}}async function f(e){try{return c(await e)}catch(e){return(0,o.QP)(e),h(e)}}function d(e,t){return new g(e,t)}let g=class extends i.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,n.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then(e=>{this._result=c(e),this._cleanup()},e=>{this._result=h(e),this._cleanup()}),this._abortHandle=(0,o.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.xt)(this._abortHandle),this._abortController=null}};(0,s.Cg)([(0,a.MZ)()],g.prototype,"value",null),(0,s.Cg)([(0,a.MZ)()],g.prototype,"error",null),(0,s.Cg)([(0,a.MZ)()],g.prototype,"finished",null),(0,s.Cg)([(0,a.MZ)()],g.prototype,"promise",void 0),(0,s.Cg)([(0,a.MZ)()],g.prototype,"_result",void 0),g=(0,s.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],g)},77548:(e,t,r)=>{r.d(t,{Gh:()=>d,tk:()=>c,BR:()=>p,wI:()=>u,G$:()=>y,$x:()=>h,Ov:()=>a,W_:()=>l,OP:()=>f,TU:()=>o,XX:()=>n});var s=r(70333),i=r(78888);r(7762),r(84952),r(36563),r(36708),new WeakMap;const n={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function o(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function a(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function l(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}async function u(e,t){const r=s.id?.findServerInfo(e);if(null!=r?.currentVersion)return r.owningSystemUrl||null;const n=e.toLowerCase().indexOf("/rest/services");if(-1===n)return null;const o=`${e.slice(0,n)}/rest/info`,a=null!=t?t.signal:null,{data:l}=await(0,i.A)(o,{query:{f:"json"},responseType:"json",signal:a});return l?.owningSystemUrl||null}function p(e){return function(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function c(e){return!!function(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function h(e,t){return null}function y(e){return null}function f(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function d(e,t){if(!t||!f(e))return;const r=(e.url,null);r&&(e.url=r)}},91880:(e,t,r)=>{r.d(t,{A:()=>p});var s,i=r(31635),n=r(66552),o=r(25482),a=r(10107),l=(r(44208),r(53966),r(87811),r(40608));const u=new n.J({asc:"ascending",desc:"descending"});let p=class extends o.A{static{s=this}constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new s({field:this.field,valueExpression:this.valueExpression,order:this.order})}};(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],p.prototype,"field",void 0),(0,i.Cg)([(0,a.MZ)({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],p.prototype,"valueExpression",void 0),(0,i.Cg)([(0,a.MZ)({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],p.prototype,"order",void 0),p=s=(0,i.Cg)([(0,l.$)("esri.layers.support.OrderByInfo")],p)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8368],{1262:(e,t,n)=>{n.d(t,{L:()=>o});var r=n(799);const a={InvalidValueForAggregateFunction:"Invalid value used in aggregate function",MissingStatisticParameters:"Statistic does not have 1 or 0 Parameters",InvalidFunctionParameters:"Invalid parameters for call to {function}",UnsupportedIsLhs:"Unsupported left hand expression in is statement",UnsupportedIsRhs:"Unsupported right hand expression in is statement",UnsupportedOperator:"Unsupported operator - {operator}",UnsupportedSyntax:"Unsupported syntax - {node}",UnsupportedSqlFunction:"Sql function not found = {function}",InvalidDataType:"Invalid sql data type",InvalidDate:"Invalid date encountered",InvalidOperator:"Invalid operator encountered",InvalidTime:"Invalid time encountered",IllegalInterval:"Illegal interval",FunctionNotRecognized:"Function not recognized",InvalidTimeStamp:"Invalid timestamp encountered",InvalidParameterCount:"Invalid parameter count for call to {name}",PrimarySecondaryQualifiers:"Primary and Secondary SqlInterval qualifiers not supported",YearMonthIntervals:"Year-Month Intervals not supported",CannotCastValue:"Cannot cast value to the required data type"};class o extends Error{constructor(e,t){super((0,r.HC)(a[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,o)}}},55612:(e,t,n)=>{n.d(t,{g:()=>i});var r=n(96285);function a(e){return Number.isNaN(e)||0===e?e:Math.trunc(e)}const o="esri.core.sql.SqlTimeStampOffset";class i{constructor(e){this._timeStampOffset=e,this.declaredRootClass=o,this._date=null}static isTimestampOffset(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===o}toDateTime(){return this._date??=r.c9.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return a(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return a(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return i.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(e){return new i(r.c9.fromJSDate(e).toISO({includeOffset:!0}))}static fromDateTime(e){return new i(e.toISO({includeOffset:!0}))}static fromParts(e,t,n=0,r=0,a=0,o=0,u=0,s=!1,l=0,c=0){const f=`${e.toString().padStart(4,"0")}-${t.toString().padStart(2,"0")}-${n.toString().padStart(2,"0")}`;let d="";o<10&&(d="0");let p=`${r.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${d+o.toString()}`;0!==u&&(p+="."+u.toString().padStart(3,"0"));const m=`${s?"-":"+"}${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;return new i(f+"T"+p+m)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let e=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return e&&(e=e.replace(".000","")),e}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(e){const t=this.toDateTime().plus(e);return i.fromDateTime(t)}}},74639:(e,t,n)=>{n.d(t,{M:()=>l,s:()=>s});var r=n(44729),a=n(1262),o=n(55612),i=n(15032),u=n(96285);function s(e,t){const n=c[e.toLowerCase()];if(null==n)throw new a.L("FunctionNotRecognized");if(t.length<n.minParams||t.length>n.maxParams)throw new a.L("InvalidParameterCount",{name:e.toUpperCase()});return n.evaluate(t)}function l(e,t){const n=c[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}const c={min:{minParams:1,maxParams:1,evaluate:e=>p(e[0],"min")},max:{minParams:1,maxParams:1,evaluate:e=>p(e[0],"max")},avg:{minParams:1,maxParams:1,evaluate:e=>f(e[0])},sum:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(null!==r){if(!d(r))throw new a.L("InvalidValueForAggregateFunction");t+=r}}return t}(e[0])},stddev:{minParams:1,maxParams:1,evaluate:e=>function(e){if(null===e)return null;const t=m(e);return null===t?null:Math.sqrt(t)}(e[0])},count:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].length},var:{minParams:1,maxParams:1,evaluate:e=>m(e[0])}};function f(e){if(null===e)return null;let t=0,n=0;for(let r=0;r<e.length;r++){const o=e[r];if(null!==o){if(!d(o))throw new a.L("InvalidValueForAggregateFunction");n++,t+=o}}return 0===n?null:t/e.length}function d(e){return"number"==typeof e}function p(e,t){if(null===e)return null;let n=null,a=null;for(const s of e){let e=s;e=r.n.isDateOnly(s)||i.k.isTimeOnly(s)?s.toNumber():u.c9.isDateTime(s)?s.toMillis():o.g.isTimestampOffset(s)?s.toMilliseconds():s,(null===n||"max"===t&&null!==a&&null!==e&&a<=e||"min"===t&&null!==a&&null!==e&&a>=e)&&(n=s,a=e)}return n}function m(e){if(null===e)return null;if(0===(e=e.filter(e=>null!==e)).length)return null;const t=f(e);if(null===t)return null;let n=0;for(const r of e){if(!d(r))throw new a.L("InvalidValueForAggregateFunction");n+=(t-r)**2}return n/(e.length-1)}},88368:(e,t,n)=>{n.d(t,{A:()=>ce});var r=n(44208),a=n(74639),o=n(44729),i=n(1262);function u(e){if(null!==e.precision||null!==e.secondary)throw new i.L("PrimarySecondaryQualifiers")}function s(e,t){if(t.includes(".")){const n=t.split(".");e.second=parseFloat(n[0]),e.millis=parseInt(n[1],10)}else e.second=parseFloat(t)}const l="esri.core.sql.SqlInterval";class c{constructor(){this.declaredRootClass=l,this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static isInterval(e){return"object"==typeof e&&null!=e&&"declaredRootClass"in e&&e.declaredRootClass===l}static createFromMilliseconds(e){const t=new c;return t.second=e/1e3,t}static createFromValueAndQualifier(e,t,n){let r=null;const a=new c;if(a.op="-"===n?"-":"+","interval-period"===t.type){u(t);const n=new RegExp("^[0-9]{1,}$");if("year"===t.period||"month"===t.period)throw new i.L("YearMonthIntervals");if("second"===t.period){if(!/^[0-9]{1,}(\.[0-9]{1,}){0,1}$/.test(e))throw new i.L("IllegalInterval");s(a,e)}else{if(!n.test(e))throw new i.L("IllegalInterval");a[t.period]=parseFloat(e)}}else{if(u(t.start),u(t.end),"year"===t.start.period||"month"===t.start.period||"year"===t.end.period||"month"===t.end.period)throw new i.L("YearMonthIntervals");switch(t.start.period){case"day":switch(t.end.period){case"hour":if(r=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!r.test(e))throw new i.L("IllegalInterval");a[t.start.period]=parseFloat(e.split(" ")[0]),a[t.end.period]=parseFloat(e.split(" ")[1]);break;case"minute":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!r.test(e))throw new i.L("IllegalInterval");{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1])}break;case"second":if(r=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}(\\.[0-9]{1,}){0,1}$"),!r.test(e))throw new i.L("IllegalInterval");{a[t.start.period]=parseFloat(e.split(" ")[0]);const n=e.split(" ")[1].split(":");a.hour=parseFloat(n[0]),a.minute=parseFloat(n[1]),s(a,n[2])}break;default:throw new i.L("IllegalInterval")}break;case"hour":switch(t.end.period){case"minute":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!r.test(e))throw new i.L("IllegalInterval");a.hour=parseFloat(e.split(":")[0]),a.minute=parseFloat(e.split(":")[1]);break;case"second":if(r=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}(\\.[0-9]{1,}){0,1}$"),!r.test(e))throw new i.L("IllegalInterval");{const t=e.split(":");a.hour=parseFloat(t[0]),a.minute=parseFloat(t[1]),s(a,t[2])}break;default:throw new i.L("IllegalInterval")}break;case"minute":if("second"!==t.end.period)throw new i.L("IllegalInterval");if(r=new RegExp("^[0-9]{1,}:[0-9]{1,}(\\.[0-9]{1,}){0,1}$"),!r.test(e))throw new i.L("IllegalInterval");{const t=e.split(":");a.minute=parseFloat(t[0]),s(a,t[1])}break;default:throw new i.L("IllegalInterval")}}return a}valueInMilliseconds(){return("-"===this.op?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}var f=n(55612),d=n(15032),p=n(3330),m=n(96285);const h=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,w=/^(\d{1,2}):(\d{1,2})$/,v=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,I=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,g=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,y=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)? {0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,L=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})? {0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,T=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function N(e,t){if(t instanceof m.bo)return t===p.GB.instance?m.c9.fromMillis(e.getTime(),{zone:p.GB.instance}):m.c9.fromJSDate(e,{zone:t});switch(t){case"system":case"local":case null:return m.c9.fromJSDate(e);default:return"unknown"===t?.toLowerCase()?m.c9.fromMillis(e.getTime(),{zone:p.GB.instance}):m.c9.fromJSDate(e,{zone:t})}}function O(e){return c.isInterval(e)}function E(e){return m.c9.isDateTime(e)}function S(e){return o.n.isDateOnly(e)}function x(e){return d.k.isTimeOnly(e)}function C(e){return f.g.isTimestampOffset(e)}function D(e){let t=h.exec(e);if(null!==t){const[,e,n,r]=t,a=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),0);if(null!==a)return a;throw new i.L("InvalidTime")}if(t=w.exec(e),null!==t){const[,e,n]=t,r=d.k.fromParts(parseInt(e,10),parseInt(n,10),0,0);if(null!==r)return r;throw new i.L("InvalidTime")}if(t=v.exec(e),null!==t){const[,e,n,r,a]=t,o=d.k.fromParts(parseInt(e,10),parseInt(n,10),parseInt(r,10),parseInt(a,10));if(null!==o)return o;throw new i.L("InvalidTime")}throw new i.L("InvalidTime")}function _(e,t,n=!1){let r=g.exec(e);if(null!==r){const[,e,n,a,o,u,s,l]=r,c=m.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(o,10),minute:parseInt(u,10),second:parseInt(s,10),millisecond:l?parseInt(l.replace(".",""),10):0},{zone:(0,p.Qo)(t)});if(!1===c.isValid)throw new i.L("InvalidTimeStamp");return c}if(r=y.exec(e),null!==r){const[,e,t,n,a,o,u,s,l,c,d]=r,p=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(o,10),parseInt(u,10),s?parseInt(s.replace(".",""),10):0,"-"===l,parseInt(c,10),parseInt(d,10));if(!1===p.isValid)throw new i.L("InvalidTimeStamp");return p}if(r=L.exec(e),null!==r){const[,e,t,n,a,o,u,s,l]=r,c=f.g.fromParts(parseInt(e,10),parseInt(t,10),parseInt(n,10),parseInt(a,10),parseInt(o,10),0,0,"-"===u,parseInt(s,10),parseInt(l,10));if(!1===c.isValid)throw new i.L("InvalidTimeStamp");return c}if(r=T.exec(e),null!==r){const[,e,n,a,o,u]=r,s=m.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:parseInt(o,10),minute:parseInt(u,10),second:0},{zone:(0,p.Qo)(t)});if(!1===s.isValid)throw new i.L("InvalidTimeStamp");return s}if(r=I.exec(e),null!==r){const[,e,n,a]=r,o=m.c9.fromObject({year:parseInt(e,10),month:parseInt(n,10),day:parseInt(a,10),hour:0,minute:0,second:0},{zone:(0,p.Qo)(t)});if(!1===o.isValid)throw new i.L("InvalidTimeStamp");return o}throw new i.L("InvalidTimeStamp")}function M(e,t){const n=I.exec(e);if(null===n)try{return _(e,t)}catch{throw new i.L("InvalidDate")}const[,r,a,u]=n,s=o.n.fromParts(parseInt(r,10),parseInt(a,10),parseInt(u,10));if(null===s)throw new i.L("InvalidDate");return s}var b=n(34727),P=n(799),A=n(54218);function F(e){return!!E(e)||!!C(e)}function $(e){return!!(E(e)||S(e)||C(e)||x(e))}function R(e){if(E(e))return e.toMillis();if(S(e))return e.toNumber();if(C(e))return e.toMilliseconds();throw new i.L("InvalidDataType")}function k(e,t,n){if(null==e||null==t)return null;if((0,A.Et)(e)){if((0,A.Et)(t))return U(e,t,n);if((0,A.Kg)(t))return function(e,t,n){const r=parseFloat(t);if(!isNaN(r))return U(e,r,n);const a=e.toString();switch(n){case"<>":return a!==t;case"=":return a===t;case">":return a>t;case"<":return a<t;case">=":return a>=t;case"<=":return a<=t}}(e,t,n);if($(t))throw new i.L("InvalidOperator");if(S(t))throw new i.L("InvalidOperator")}else if((0,A.Kg)(e)){if((0,A.Et)(t))return function(e,t,n){const r=parseFloat(e);if(!isNaN(r))return U(r,t,n);const a=t.toString();switch(n){case"<>":return e!==a;case"=":return e===a;case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a}}(e,t,n);if((0,A.Kg)(t))return function(e,t,n){switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}(e,t,n);if(E(t))throw new i.L("InvalidOperator");if(S(t))throw new i.L("InvalidOperator");if(x(t))throw new i.L("InvalidOperator");if(C(t))throw new i.L("InvalidOperator")}else if(E(e)){if(F(t)){if((0,p.Y4)(e.zone)){if(m.c9.isDateTime(t)&&!(0,p.Y4)(t.zone))return V(e,t,n);if(f.g.isTimestampOffset(t))return V(e,t,n)}else if(m.c9.isDateTime(t)&&(0,p.Y4)(t.zone)){if(!(0,p.Y4)(e.zone))return V(e,t,n);if(f.g.isTimestampOffset(e))return V(e,t,n)}return U(R(e),R(t),n)}if((0,A.Kg)(t))throw new i.L("InvalidOperator");if(S(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.zone);return U((e=e.startOf("day")).toMillis(),r.toMillis(),n)}(e,t,n);if(x(t))throw new i.L("InvalidOperator");if((0,A.Et)(t))throw new i.L("InvalidOperator")}else if(S(e)){if(C(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.toDateTime().zone);return t=t.startOfDay(),U(r.toMillis(),t.toMilliseconds(),n)}(e,t,n);if(E(t))return function(e,t,n){const r=e.toDateTimeLuxon(t.zone);return t=t.startOf("day"),U(r.toMillis(),t.toMillis(),n)}(e,t,n);if((0,A.Kg)(t))throw new i.L("InvalidOperator");if(S(t))return U(e.toNumber(),t.toNumber(),n);if(x(t))throw new i.L("InvalidOperator");if((0,A.Et)(t))throw new i.L("InvalidOperator")}else if(x(e)){if(x(t))return U(e.toNumber(),t.toNumber(),n);if((0,A.Kg)(t))throw new i.L("InvalidOperator");if((0,A.Et)(t))throw new i.L("InvalidOperator");if(S(t))throw new i.L("InvalidOperator");if(F(t))throw new i.L("InvalidOperator")}else if(C(e)){if(F(t))return m.c9.isDateTime(t)&&(0,p.Y4)(t.zone)?V(e,t,n):U(R(e),R(t),n);if((0,A.Kg)(t))throw new i.L("InvalidOperator");if(S(t))return function(e,t,n){const r=t.toDateTimeLuxon(e.toDateTime().zone);return U((e=e.startOfDay()).toMilliseconds(),r.toMillis(),n)}(e,t,n);if(x(t))throw new i.L("InvalidOperator");if((0,A.Et)(t))throw new i.L("InvalidOperator")}switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function U(e,t,n){switch(n){case"<>":return e!==t;case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}}function V(e,t,n){f.g.isTimestampOffset(e)&&(e=e.toDateTime()),f.g.isTimestampOffset(t)&&(t=t.toDateTime());const r=z(e),a=z(t);switch(n){case"<>":return r!==a;case"=":return r===a;case">":return r>a;case"<":return r<a;case">=":return r>=a;case"<=":return r<=a}}function z(e){return 321408e5*e.year+26784e5*e.month+864e5*e.day+36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond}function H(e,t,n){const r=Z[e.toLowerCase()];if(null==r)throw new i.L("FunctionNotRecognized");if(t.length<r.minParams||t.length>r.maxParams)throw new i.L("InvalidParameterCount",{name:e.toUpperCase()});return r.evaluate(t,n)}function q(e){return!((0,A.$P)(e)||S(e)||E(e)||x(e)||C(e))}function K(e){return S(e)||x(e)?e.toString():C(e)?e.toSQLValue():E(e)?0===e.millisecond?e.toFormat("yyyy-LL-dd HH:mm:ss"):e.toSQL({includeOffset:!1}):(0,A.$P)(e)?K(m.c9.fromJSDate(e)):e.toString()}const Z={extract:{minParams:2,maxParams:2,evaluate:([e,t])=>{if(null==t)return null;if((0,A.$P)(t))switch(e.toUpperCase()){case"SECOND":return t.getSeconds();case"MINUTE":return t.getMinutes();case"HOUR":return t.getHours();case"DAY":return t.getDate();case"MONTH":return t.getMonth()+1;case"YEAR":return t.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0;case"DOW":return m.c9.fromJSDate(t,{zone:"system"}).weekday;case"DOY":return m.c9.fromJSDate(t,{zone:"system"}).ordinal;case"WEEK":return m.c9.fromJSDate(t,{zone:"system"}).weekNumber}else if(E(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new i.L("InvalidFunctionParameters",{function:"EXTRACT"});case"DOW":return t.weekday;case"DOY":return t.ordinal;case"WEEK":return t.weekNumber}else if(S(t))switch(e.toUpperCase()){case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new i.L("InvalidFunctionParameters",{function:"EXTRACT"});case"DOW":return t.toDateTime("unknown").weekday;case"DOY":return t.toDateTime("unknown").ordinal;case"WEEK":return t.toDateTime("unknown").weekNumber}else if(x(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour}else if(C(t))switch(e.toUpperCase()){case"SECOND":return t.second;case"MINUTE":return t.minute;case"HOUR":return t.hour;case"DAY":return t.day;case"MONTH":return t.month;case"YEAR":return t.year;case"TIMEZONE_HOUR":return t.timezoneOffsetHour;case"TIMEZONE_MINUTE":return t.timezoneOffsetMinutes;case"DOW":return t.toDateTime().weekday;case"DOY":return t.toDateTime().ordinal;case"WEEK":return t.toDateTime().weekNumber}throw new i.L("InvalidFunctionParameters",{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:e=>{if(2===e.length){const[t,n]=e;return null==t||null==n?null:t.toString().substring(n-1)}if(3===e.length){const[t,n,r]=e;return null==t||null==n||null==r?null:r<=0?"":t.toString().substring(n-1,n+r-1)}}},position:{minParams:2,maxParams:2,evaluate:([e,t])=>null==e||null==t?null:t.indexOf(e)+1},trim:{minParams:2,maxParams:3,evaluate:e=>{const t=3===e.length,n=t?e[1]:" ",r=t?e[2]:e[1];if(null==n||null==r)return null;const a=`(${(0,P.Cj)(n)})`;switch(e[0]){case"BOTH":return r.replaceAll(new RegExp(`^${a}*|${a}*$`,"g"),"");case"LEADING":return r.replaceAll(new RegExp(`^${a}*`,"g"),"");case"TRAILING":return r.replaceAll(new RegExp(`${a}*$`,"g"),"")}throw new i.L("InvalidFunctionParameters",{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.abs(e[0])},ceiling:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.ceil(e[0])},floor:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.floor(e[0])},log:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])},log10:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.log(e[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sin(e[0])},cos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cos(e[0])},tan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tan(e[0])},asin:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.asin(e[0])},acos:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.acos(e[0])},atan:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.atan(e[0])},sign:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0]>0?1:e[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]**e[1]},mod:{minParams:2,maxParams:2,evaluate:e=>null==e[0]||null==e[1]?null:e[0]%e[1]},round:{minParams:1,maxParams:2,evaluate:e=>{const t=e[0],n=2===e.length?10**e[1]:1;return null==t?null:Math.round(t*n)/n}},truncate:{minParams:1,maxParams:2,evaluate:e=>null==e[0]?null:1===e.length||0===e[1]?Math.trunc(e[0]):(0,b.pF)("trunc",e[0],-Number(e[1]))},char_length:{minParams:1,maxParams:1,evaluate:e=>(0,A.Kg)(e[0])?e[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:e=>{let t="";for(let n=0;n<e.length;n++){if(null==e[n])return null;t+=e[n].toString()}return t}},lower:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:e[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:e=>{for(const t of e)if(null!==t)return t;return null}},cosh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.cosh(e[0])},sinh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.sinh(e[0])},tanh:{minParams:1,maxParams:1,evaluate:e=>null==e[0]?null:Math.tanh(e[0])},nullif:{minParams:2,maxParams:2,evaluate:e=>k(e[0],e[1],"=")?null:e[0]},cast:{minParams:2,maxParams:2,evaluate:(e,t)=>{const n=e[0],r=e[1];if(null===n)return null;switch(r.type){case"integer":{if(!q(n))throw new i.L("CannotCastValue");const e=parseInt(n,10);if(isNaN(e))throw new i.L("CannotCastValue");return e}case"smallint":{if(!q(n))throw new i.L("CannotCastValue");const e=parseInt(n,10);if(isNaN(e))throw new i.L("CannotCastValue");if(e>32767||e<-32767)throw new i.L("CannotCastValue");return e}case"float":case"real":{if(!q(n))throw new i.L("CannotCastValue");const e=parseFloat(n);if(isNaN(e))throw new i.L("CannotCastValue");return e}case"time":return function(e){if((0,A.$P)(e))return d.k.fromDateJS(e);if(E(e))return d.k.fromDateTime(e);if(S(e))throw new i.L("CannotCastValue");if(x(e))return e;if(C(e))return d.k.fromSqlTimeStampOffset(e);if((0,A.Kg)(e))return D(e);throw new i.L("CannotCastValue")}(n);case"date":return function(e){if((0,A.$P)(e))return o.n.fromDateJS(e);if(E(e))return o.n.fromParts(e.year,e.month,e.day);if(S(e))return e;if(x(e))throw new i.L("CannotCastValue");if(C(e)&&null===o.n.fromParts(e.year,e.month,e.day))throw new i.L("CannotCastValue");if((0,A.Kg)(e)){const t=o.n.fromReader(e);if(null!==t&&t.isValid)return t}throw new i.L("CannotCastValue")}(n);case"timestamp":return function(e,t,n){if((0,A.$P)(e))return N(e,t);if(E(e))return e;if(S(e))return e.toDateTimeLuxon("unknown");if(x(e))throw new i.L("CannotCastValue");if(C(e))return e;if((0,A.Kg)(e))return _(e,"unknown",n);throw new i.L("CannotCastValue")}(n,t,!0===r.withtimezone);case"varchar":{const e=K(n);if(e.length>r.size)throw new i.L("CannotCastValue");return e}default:throw new i.L("InvalidDataType")}}}};function Y(e,t,n,r){if("||"===e)return H("concat",[t,n],r);if(null===t||null===n)return null;if((0,A.Et)(t)){if((0,A.Et)(n))return j(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e/t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(){throw new i.L("InvalidOperator")}();if(C(n))return function(){throw new i.L("InvalidOperator")}();if(E(n))return function(){throw new i.L("InvalidOperator")}();if((0,A.Kg)(n))return function(e,t,n){const r=parseFloat(t);if(isNaN(r))throw new i.L("InvalidOperator");return j(e,r,n)}(t,n,e);throw new i.L("InvalidOperator")}if(S(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon("UTC").diff(t.toDateTimeLuxon("UTC")).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(C(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.toDateTime().zone).diff(t.toDateTime()).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(E(n))return function(e,t,n){if("-"===n)return e.toDateTimeLuxon(t.zone).diff(t).as("days");throw new i.L("InvalidOperator")}(t,n,e);if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if(x(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus("milliseconds",r);case"-":return e.plus("milliseconds",-1*r)}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return e.plus("milliseconds",t.valueInMilliseconds());case"-":return e.plus("milliseconds",-1*t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(){throw new i.L("InvalidOperator")}();if(C(n))return function(){throw new i.L("InvalidOperator")}();if(E(n))return function(){throw new i.L("InvalidOperator")}();if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if(O(t)){if((0,A.Et)(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t);case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t);case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t);case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t)}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return c.createFromMilliseconds(e.valueInMilliseconds()+t.valueInMilliseconds());case"-":return c.createFromMilliseconds(e.valueInMilliseconds()-t.valueInMilliseconds());case"*":return c.createFromMilliseconds(e.valueInMilliseconds()*t.valueInMilliseconds());case"/":return c.createFromMilliseconds(e.valueInMilliseconds()/t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new i.L("InvalidOperator")}(t,n,e);if(S(n))return function(e,t,n){if("+"===n)return t.plus("milliseconds",e.valueInMilliseconds());throw new i.L("InvalidOperator")}(t,n,e);if(C(n))return function(e,t,n){if("+"===n)return t.addMilliseconds(e.valueInMilliseconds());throw new i.L("InvalidOperator")}(t,n,e);if(E(n))return function(e,t,n){switch(n){case"+":return t.plus({milliseconds:e.valueInMilliseconds()});case"-":return e.valueInMilliseconds()-t.toMillis()}throw new i.L("InvalidOperator")}(t,n,e);if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if(E(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.plus({milliseconds:r});case"-":return e.minus({milliseconds:r})}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return e.plus({milliseconds:t.valueInMilliseconds()});case"-":return e.minus({milliseconds:t.valueInMilliseconds()})}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTimeLuxon(e.zone)).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(C(n))return function(e,t,n){if("-"===n)return e.diff(t.toDateTime()).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(E(n))return function(e,t,n){if("-"===n)return e.diff(t).as("days");throw new i.L("InvalidOperator")}(t,n,e);if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if(C(t)){if((0,A.Et)(n))return function(e,t,n){const r=1e3*t*24*60*60;switch(n){case"+":return e.addMilliseconds(r);case"-":return e.addMilliseconds(-1*r)}throw new i.L("InvalidOperator")}(t,n,e);if(O(n))return function(e,t,n){switch(n){case"+":return e.addMilliseconds(t.valueInMilliseconds());case"-":return e.addMilliseconds(-1*t.valueInMilliseconds())}throw new i.L("InvalidOperator")}(t,n,e);if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTimeLuxon(e.toDateTime().zone)).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(C(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t.toDateTime()).as("days");throw new i.L("InvalidOperator")}(t,n,e);if(E(n))return function(e,t,n){if("-"===n)return e.toDateTime().diff(t).as("days");throw new i.L("InvalidOperator")}(t,n,e);if((0,A.Kg)(n))return function(){throw new i.L("InvalidOperator")}();throw new i.L("InvalidOperator")}if((0,A.Kg)(t)){if((0,A.Et)(n))return function(e,t,n){const r=parseFloat(e);if(isNaN(r))throw new i.L("InvalidOperator");return j(r,t,n)}(t,n,e);if(O(n))return function(){throw new i.L("InvalidOperator")}();if(x(n))return function(){throw new i.L("InvalidOperator")}();if(S(n))return function(){throw new i.L("InvalidOperator")}();if(C(n))return function(){throw new i.L("InvalidOperator")}();if(E(n))return function(){throw new i.L("InvalidOperator")}();if((0,A.Kg)(n))return function(e,t,n){if("+"===n)return e+t;throw new i.L("InvalidOperator")}(t,n,e);throw new i.L("InvalidOperator")}throw new i.L("InvalidOperator")}function j(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t}throw new i.L("InvalidOperator")}class W extends SyntaxError{constructor(e,t,n,r){super(e),this.expected=t,this.found=n,this.location=r,this.name="SyntaxError"}format(e){let t="Error: "+this.message;if(this.location){let n=null;const r=e.find(e=>e.source===this.location.source);r&&(n=r.text.split(/\r\n|\n|\r/g));const a=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,i=this.location.source+":"+o.line+":"+o.column;if(n){const e=this.location.end,r="".padEnd(o.line.toString().length," "),u=n[a.line-1],s=(a.line===e.line?e.column:u.length+1)-a.column||1;t+="\n --\x3e "+i+"\n"+r+" |\n"+o.line+" | "+u+"\n"+r+" | "+"".padEnd(a.column-1," ")+"".padEnd(s,"^")}else t+="\n at "+i}return t}static buildMessage(e,t){function n(e){return e.codePointAt(0).toString(16).toUpperCase()}const r=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function a(e){return r?e.replace(r,e=>"\\u{"+n(e)+"}"):e}function o(e){return a(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"+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+n(e)))}function i(e){return a(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"+n(e)).replace(/[\x10-\x1F\x7F-\x9F]/g,e=>"\\x"+n(e)))}const u={literal:e=>'"'+o(e.text)+'"',class(e){const t=e.parts.map(e=>Array.isArray(e)?i(e[0])+"-"+i(e[1]):i(e));return"["+(e.inverted?"^":"")+t.join("")+"]"+(e.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:e=>e.description};function s(e){return u[e.type](e)}return"Expected "+function(e){const t=e.map(s);if(t.sort(),t.length>0){let e=1;for(let n=1;n<t.length;n++)t[n-1]!==t[n]&&(t[e]=t[n],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?'"'+o(e)+'"':"end of input"}(t)+" found."}}function J(e,t){const n={},r=(t=void 0!==t?t:{}).grammarSource,a={start:Tn};let o=Tn;const i="!",u="=",s=">=",l=">",c="<=",f="<>",d="!=",p="||",m="@",h="'",w="N'",v="''",I=".",g="null",y="true",L="false",T="in",N="is",O="like",E="escape",S="not",x="and",C="or",D="between",_="from",M="for",b="substring",P="extract",A="trim",F="position",$="timestamp",R="date",k="time",U="leading",V="trailing",z="both",H="cast",q="as",K="integer",Z="int",Y="smallint",j="float",J="real",B="varchar",G="to",Q="interval",X="year",ee="timezone_hour",te="timezone_minute",ne="month",re="day",ae="hour",oe="minute",ie="second",ue="dow",se="doy",le="week",ce="case",fe="end",de="when",pe="then",me="else",he=",",we="(",ve=")",Ie="`",ge=/^[<-=]/,ye=/^[+\-]/,Le=/^[*\/]/,Te=/^[A-Za-z_\x80-\uFFFF]/,Ne=/^[A-Za-z0-9_]/,Oe=/^[A-Za-z0-9_.\x80-\uFFFF]/,Ee=/^["]/,Se=/^[^']/,xe=/^[0-9]/,Ce=/^[eE]/,De=/^[ \t\n\r]/,_e=/^[^`]/,Me=vn("!",!1),be=vn("=",!1),Pe=vn(">=",!1),Ae=vn(">",!1),Fe=vn("<=",!1),$e=vn("<>",!1),Re=In([["<","="]],!1,!1,!1),ke=vn("!=",!1),Ue=In(["+","-"],!1,!1,!1),Ve=vn("||",!1),ze=In(["*","/"],!1,!1,!1),He=In([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1,!1),qe=In([["A","Z"],["a","z"],["0","9"],"_"],!1,!1,!1),Ke=In([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1,!1),Ze=In(['"'],!1,!1,!1),Ye=vn("@",!1),je=vn("'",!1),We=vn("N'",!1),Je=vn("''",!1),Be=In(["'"],!0,!1,!1),Ge=vn(".",!1),Qe=In([["0","9"]],!1,!1,!1),Xe=In(["e","E"],!1,!1,!1),et=vn("NULL",!0),tt=vn("TRUE",!0),nt=vn("FALSE",!0),rt=vn("IN",!0),at=vn("IS",!0),ot=vn("LIKE",!0),it=vn("ESCAPE",!0),ut=vn("NOT",!0),st=vn("AND",!0),lt=vn("OR",!0),ct=vn("BETWEEN",!0),ft=vn("FROM",!0),dt=vn("FOR",!0),pt=vn("SUBSTRING",!0),mt=vn("EXTRACT",!0),ht=vn("TRIM",!0),wt=vn("POSITION",!0),vt=vn("TIMESTAMP",!0),It=vn("DATE",!0),gt=vn("TIME",!0),yt=vn("LEADING",!0),Lt=vn("TRAILING",!0),Tt=vn("BOTH",!0),Nt=vn("CAST",!0),Ot=vn("AS",!0),Et=vn("INTEGER",!0),St=vn("INT",!0),xt=vn("SMALLINT",!0),Ct=vn("FLOAT",!0),Dt=vn("REAL",!0),_t=vn("VARCHAR",!0),Mt=vn("TO",!0),bt=vn("INTERVAL",!0),Pt=vn("YEAR",!0),At=vn("TIMEZONE_HOUR",!0),Ft=vn("TIMEZONE_MINUTE",!0),$t=vn("MONTH",!0),Rt=vn("DAY",!0),kt=vn("HOUR",!0),Ut=vn("MINUTE",!0),Vt=vn("SECOND",!0),zt=vn("DOW",!0),Ht=vn("DOY",!0),qt=vn("WEEK",!0),Kt=vn("CASE",!0),Zt=vn("END",!0),Yt=vn("WHEN",!0),jt=vn("THEN",!0),Wt=vn("ELSE",!0),Jt=vn(",",!1),Bt=vn("(",!1),Gt=vn(")",!1),Qt=In([" ","\t","\n","\r"],!1,!1,!1),Xt=vn("`",!1),en=In(["`"],!0,!1,!1);function tn(e,t,n){return{op:t,expr:n,location:hn()}}function nn(e,t,n){return{op:t,expr:n,location:hn()}}function rn(e,t){return{op:e,expr:t,location:hn()}}function an(e,t,n){return{op:t,expr:n,location:hn()}}function on(e,t,n){return{op:t,expr:n,location:hn()}}function un(){return"'"}let sn=0|t.peg$currPos,ln=sn;const cn=[{line:1,column:1}];let fn,dn=sn,pn=t.peg$maxFailExpected||[],mn=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in a))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=a[t.startRule]}function hn(){return yn(ln,sn)}function wn(e,t){throw function(e,t){return new W(e,null,null,t)}(e,t=void 0!==t?t:yn(ln,sn))}function vn(e,t){return{type:"literal",text:e,ignoreCase:t}}function In(e,t,n,r){return{type:"class",parts:e,inverted:t,ignoreCase:n,unicode:r}}function gn(t){let n,r=cn[t];if(r)return r;if(t>=cn.length)n=cn.length-1;else for(n=t;!cn[--n];);for(r=cn[n],r={line:r.line,column:r.column};n<t;)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return cn[t]=r,r}function yn(e,t,n){const a=gn(e),o=gn(t);return{source:r,start:{offset:e,line:a.line,column:a.column},end:{offset:t,line:o.line,column:o.column}}}function Ln(e){sn<dn||(sn>dn&&(dn=sn,pn=[]),pn.push(e))}function Tn(){let e,t;return e=sn,oa(),t=On(),t!==n?(oa(),ln=e,e=t):(sn=e,e=n),e}function Nn(){let e,t,r,a,o,i,u,s;if(e=sn,t=ra(),t!==n){for(oa(),r=[],a=On();a!==n;)r.push(a),a=sn,o=sn,i=oa(),u=na(),u!==n?(s=oa(),i=[i,u,s],o=i):(sn=o,o=n),o!==n?(o=On(),o===n?(sn=a,a=n):a=o):a=o;a=oa(),o=aa(),o!==n?(ln=e,e=function(e){return{type:"expression-list",location:hn(),value:e}}(r)):(sn=e,e=n)}else sn=e,e=n;return e}function On(){let e,t,r,a,o,i;if(e=sn,t=En(),t!==n){for(r=[],a=sn,oa(),o=wr(),o!==n?(oa(),i=En(),i!==n?(ln=a,a=tn(0,o,i)):(sn=a,a=n)):(sn=a,a=n);a!==n;)r.push(a),a=sn,oa(),o=wr(),o!==n?(oa(),i=En(),i!==n?(ln=a,a=tn(0,o,i)):(sn=a,a=n)):(sn=a,a=n);ln=e,e=function(e,t){return ca(e,t)}(t,r)}else sn=e,e=n;return e}function En(){let e,t,r,a,o,i;if(e=sn,t=Sn(),t!==n){for(r=[],a=sn,oa(),o=hr(),o!==n?(oa(),i=Sn(),i!==n?(ln=a,a=nn(0,o,i)):(sn=a,a=n)):(sn=a,a=n);a!==n;)r.push(a),a=sn,oa(),o=hr(),o!==n?(oa(),i=Sn(),i!==n?(ln=a,a=nn(0,o,i)):(sn=a,a=n)):(sn=a,a=n);ln=e,e=function(e,t){return ca(e,t)}(t,r)}else sn=e,e=n;return e}function Sn(){let t,r,a,o,s;return t=sn,r=mr(),r===n&&(r=sn,33===e.charCodeAt(sn)?(a=i,sn++):(a=n,0===mn&&Ln(Me)),a!==n?(o=sn,mn++,61===e.charCodeAt(sn)?(s=u,sn++):(s=n,0===mn&&Ln(be)),mn--,s===n?o=void 0:(sn=o,o=n),o!==n?(a=[a,o],r=a):(sn=r,r=n)):(sn=r,r=n)),r!==n?(a=oa(),o=Sn(),o!==n?(ln=t,t=function(e){return function(e,t,n){return{type:"unary-expression",location:n,operator:"NOT",expr:t}}(0,e,hn())}(o)):(sn=t,t=n)):(sn=t,t=n),t===n&&(t=function(){let e,t,r,a;return e=sn,t=_n(),t!==n?(r=sn,oa(),a=function(){let e;return e=function(){let e,t,r,a,o;if(e=sn,t=[],r=sn,oa(),a=xn(),a!==n?(oa(),o=_n(),o!==n?(ln=r,r=rn(a,o)):(sn=r,r=n)):(sn=r,r=n),r!==n)for(;r!==n;)t.push(r),r=sn,oa(),a=xn(),a!==n?(oa(),o=_n(),o!==n?(ln=r,r=rn(a,o)):(sn=r,r=n)):(sn=r,r=n);else t=n;return t!==n&&(ln=e,t=function(e){return{type:"arithmetic",tail:e}}(t)),e=t,e}(),e===n&&(e=function(){let e,t,r;return e=sn,t=Dn(),t!==n?(oa(),r=Nn(),r!==n?(ln=e,e=function(e,t){return{op:e,right:t}}(t,r)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=Dn(),t!==n?(oa(),r=zn(),r!==n?(ln=e,e=function(e,t){return{op:e,right:t}}(t,r)):(sn=e,e=n)):(sn=e,e=n)),e}(),e===n&&(e=function(){let e,t,r,a,o,i,u,s;return e=sn,t=mr(),t!==n?(oa(),r=vr(),r!==n?(a=oa(),o=sn,i=_n(),i!==n?(oa(),u=hr(),u!==n?(oa(),s=_n(),s!==n?(ln=o,o=function(e,t,n){return la(hn(),t,n)}(0,i,s)):(sn=o,o=n)):(sn=o,o=n)):(sn=o,o=n),o!==n?(ln=e,e=function(e,t){return{op:"NOT"+e,right:t}}(r,o)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=vr(),t!==n?(oa(),r=sn,a=_n(),a!==n?(o=oa(),i=hr(),i!==n?(oa(),u=_n(),u!==n?(ln=r,r=function(e,t,n){return la(hn(),t,n)}(0,a,u)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n),r!==n?(ln=e,e=function(e,t){return{op:e,right:t}}(t,r)):(sn=e,e=n)):(sn=e,e=n)),e}(),e===n&&(e=function(){let e,t,r,a;return e=sn,t=fr(),t!==n?(oa(),r=mr(),r!==n?(oa(),a=_n(),a!==n?(ln=e,e=function(e,t){return{op:e+"NOT",right:t}}(t,a)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=fr(),t!==n?(oa(),r=_n(),r!==n?(ln=e,e=function(e,t){return{op:e,right:t}}(t,r)):(sn=e,e=n)):(sn=e,e=n)),e}(),e===n&&(e=function(){let e,t,r,a,o;return e=sn,t=Cn(),t!==n?(oa(),r=Bn(),r!==n?(oa(),a=pr(),a!==n?(oa(),o=Gn(),o!==n?(ln=e,e=function(e,t,n){return{op:e,right:t,escape:n.value}}(t,r,o)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=Cn(),t!==n?(oa(),r=Bn(),r!==n?(ln=e,e=function(e,t){return{op:e,right:t,escape:""}}(t,r)):(sn=e,e=n)):(sn=e,e=n)),e}())))),e}(),a!==n?r=a:(sn=r,r=n),r===n&&(r=null),ln=e,e=function(e,t){return""==t||null==t||null==t?e:"arithmetic"==t.type?ca(e,t.tail):sa(t.op,e,t.right,t.escape,hn())}(t,r)):(sn=e,e=n),e}()),t}function xn(){let t;return e.substr(sn,2)===s?(t=s,sn+=2):(t=n,0===mn&&Ln(Pe)),t===n&&(62===e.charCodeAt(sn)?(t=l,sn++):(t=n,0===mn&&Ln(Ae)),t===n&&(e.substr(sn,2)===c?(t=c,sn+=2):(t=n,0===mn&&Ln(Fe)),t===n&&(e.substr(sn,2)===f?(t=f,sn+=2):(t=n,0===mn&&Ln($e)),t===n&&(t=e.charAt(sn),ge.test(t)?sn++:(t=n,0===mn&&Ln(Re)),t===n&&(e.substr(sn,2)===d?(t=d,sn+=2):(t=n,0===mn&&Ln(ke))))))),t}function Cn(){let e,t,r,a,o;return e=sn,t=sn,r=mr(),r!==n?(a=oa(),o=dr(),o!==n?(r=[r,a,o],t=r):(sn=t,t=n)):(sn=t,t=n),t!==n&&(ln=e,t=function(e){return e[0]+" "+e[2]}(t)),e=t,e===n&&(e=dr()),e}function Dn(){let e,t,r,a,o;return e=sn,t=sn,r=mr(),r!==n?(a=oa(),o=cr(),o!==n?(r=[r,a,o],t=r):(sn=t,t=n)):(sn=t,t=n),t!==n&&(ln=e,t=function(e){return e[0]+" "+e[2]}(t)),e=t,e===n&&(e=cr()),e}function _n(){let e,t,r,a,o,i;if(e=sn,t=bn(),t!==n){for(r=[],a=sn,oa(),o=Mn(),o!==n?(oa(),i=bn(),i!==n?(ln=a,a=an(0,o,i)):(sn=a,a=n)):(sn=a,a=n);a!==n;)r.push(a),a=sn,oa(),o=Mn(),o!==n?(oa(),i=bn(),i!==n?(ln=a,a=an(0,o,i)):(sn=a,a=n)):(sn=a,a=n);ln=e,e=function(e,t){return ca(e,t)}(t,r)}else sn=e,e=n;return e}function Mn(){let t;return t=e.charAt(sn),ye.test(t)?sn++:(t=n,0===mn&&Ln(Ue)),t===n&&(e.substr(sn,2)===p?(t=p,sn+=2):(t=n,0===mn&&Ln(Ve))),t}function bn(){let e,t,r,a,o,i;if(e=sn,t=An(),t!==n){for(r=[],a=sn,oa(),o=Pn(),o!==n?(oa(),i=An(),i!==n?(ln=a,a=on(0,o,i)):(sn=a,a=n)):(sn=a,a=n);a!==n;)r.push(a),a=sn,oa(),o=Pn(),o!==n?(oa(),i=An(),i!==n?(ln=a,a=on(0,o,i)):(sn=a,a=n)):(sn=a,a=n);ln=e,e=function(e,t){return ca(e,t)}(t,r)}else sn=e,e=n;return e}function Pn(){let t;return t=e.charAt(sn),Le.test(t)?sn++:(t=n,0===mn&&Ln(ze)),t}function An(){let e,t,r,a;return e=function(){let e;return e=Gn(),e===n&&(e=function(){let e,t,r,a;return e=sn,t=function(){let e,t,r,a;return e=sn,t=tr(),t!==n?(r=nr(),r!==n?(a=rr(),a!==n?(ln=e,e=function(e,t,n){return parseFloat(e+t+n)}(t,r,a)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=tr(),t!==n?(r=nr(),r!==n?(ln=e,e=function(e,t){return parseFloat(e+t)}(t,r)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=tr(),t!==n?(r=rr(),r!==n?(ln=e,e=function(e,t){return parseFloat(e+t)}(t,r)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=tr(),t!==n&&(ln=e,t=function(e){return parseFloat(e)}(t)),e=t))),e}(),t!==n?(r=sn,mn++,a=$n(),mn--,a===n?r=void 0:(sn=r,r=n),r!==n?(ln=e,e=function(e){return{type:"number",location:hn(),value:e}}(t)):(sn=e,e=n)):(sn=e,e=n),e}(),e===n&&(e=function(){let e,t;return e=sn,t=sr(),t!==n&&(ln=e,t={type:"boolean",location:hn(),value:!0}),e=t,e===n&&(e=sn,t=lr(),t!==n&&(ln=e,t={type:"boolean",location:hn(),value:!1}),e=t),e}(),e===n&&(e=function(){let e,t;return e=sn,t=ur(),t!==n&&(ln=e,t={type:"null",location:hn(),value:null}),e=t,e}(),e===n&&(e=function(){let e,t,r;return e=sn,t=Er(),t!==n?(oa(),r=Bn(),r!==n?(ln=e,e=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&wn("Date literal is invalid")}(e.value),{type:"date",location:hn(),value:e.value}}(r)):(sn=e,e=n)):(sn=e,e=n),e}(),e===n&&(e=function(){let e,t,r;return e=sn,t=Or(),t!==n?(oa(),r=Bn(),r!==n?(ln=e,e=function(e){return"string"===e.type&&function(e){!0!==/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)&&wn("Timestamp literal is invalid")}(e.value),{type:"timestamp",location:hn(),value:e.value}}(r)):(sn=e,e=n)):(sn=e,e=n),e}(),e===n&&(e=Zn(),e===n&&(e=function(){let e,t,r;return e=sn,t=Sr(),t!==n?(oa(),r=Bn(),r!==n?(ln=e,e=function(e){return"string"===e.type&&function(e){!0!==/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)&&wn("Time literal is invalid")}(e.value),{type:"time",location:hn(),value:e.value}}(r)):(sn=e,e=n)):(sn=e,e=n),e}()))))))),e}(),e===n&&(e=function(){let e,t,r,a,o,i,u,s;return e=sn,t=Lr(),t!==n?(oa(),r=sn,a=ra(),a!==n?(oa(),o=Kn(),o!==n?(oa(),i=Ir(),i!==n?(oa(),u=On(),u!==n?(oa(),s=aa(),s!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,u)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n),r===n&&(r=sn,a=ra(),a!==n?(oa(),o=Kn(),o!==n?(oa(),i=na(),i!==n?(oa(),u=On(),u!==n?(oa(),s=aa(),s!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,u)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"extract",args:e}}(r)):(sn=e,e=n)):(sn=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,o,i,u,s,l,c,f;return e=sn,t=yr(),t!==n?(oa(),r=sn,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=Ir(),i!==n?(oa(),u=On(),u!==n?(oa(),s=sn,l=gr(),l!==n?(c=oa(),f=On(),f!==n?(oa(),s=f):(sn=s,s=n)):(sn=s,s=n),s===n&&(s=null),l=aa(),l!==n?(ln=r,r=function(e,t,n){return la(hn(),e,t,...n?[n]:[])}(o,u,s)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n),r===n&&(r=sn,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=na(),i!==n?(oa(),u=On(),u!==n?(oa(),s=na(),s!==n?(l=oa(),c=On(),c!==n?(f=aa(),f!==n?(ln=r,r=function(e,t,n){return la(hn(),e,t,n)}(o,u,c)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"substring",args:e}}(r)):(sn=e,e=n)):(sn=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,o,i,u,s,l;return e=sn,t=Tr(),t!==n?(oa(),r=sn,a=ra(),a!==n?(oa(),o=qn(),oa(),i=On(),i!==n?(oa(),u=Ir(),u!==n?(oa(),s=On(),s!==n?(oa(),l=aa(),l!==n?(ln=r,r=function(e,t,n){return la(hn(),e,t,n)}(o,i,s)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n),r===n&&(r=sn,a=ra(),a!==n?(oa(),o=qn(),oa(),i=On(),i!==n?(oa(),u=aa(),u!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,i)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"trim",args:e}}(r)):(sn=e,e=n)):(sn=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,o,i,u,s;return e=sn,t=Nr(),t!==n?(oa(),r=sn,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=cr(),i!==n?(oa(),u=On(),u!==n?(oa(),s=aa(),s!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,u)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n),r===n&&(r=sn,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=na(),i!==n?(oa(),u=On(),u!==n?(oa(),s=aa(),s!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,u)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"position",args:e}}(r)):(sn=e,e=n)):(sn=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a,o,i,u,s;return e=sn,t=_r(),t!==n?(oa(),r=sn,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=Mr(),i!==n?(oa(),u=Hn(),u!==n?(oa(),s=aa(),s!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,u)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n),r===n&&(r=sn,a=ra(),a!==n?(oa(),o=On(),o!==n?(oa(),i=na(),i!==n?(oa(),u=Hn(),u!==n?(oa(),s=aa(),s!==n?(ln=r,r=function(e,t){return la(hn(),e,t)}(o,u)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)):(sn=r,r=n)),r!==n?(ln=e,e=function(e){return{type:"function",location:hn(),name:"cast",args:e}}(r)):(sn=e,e=n)):(sn=e,e=n),e}(),e===n&&(e=function(){let e,t,r,a;return e=sn,t=sn,mn++,r=Lr(),mn--,r===n?t=void 0:(sn=t,t=n),t!==n?(r=ua(),r!==n?(oa(),a=Nn(),a!==n?(ln=e,e=function(e,t){return{type:"function",location:hn(),name:e,args:t}}(r,a)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e}(),e===n&&(e=function(){let e;return e=function(){let e,t,r,a,o,i,u;if(e=sn,t=Gr(),t!==n)if(oa(),r=On(),r!==n){for(oa(),a=[],o=sn,i=Xn(),i!==n?(u=oa(),o=i):(sn=o,o=n);o!==n;)a.push(o),o=sn,i=Xn(),i!==n?(u=oa(),o=i):(sn=o,o=n);o=Qr(),o!==n?(ln=e,e=function(e,t){return{type:"case-expression",location:hn(),format:"simple",operand:e,clauses:t,else:null,elseLocation:null}}(r,a)):(sn=e,e=n)}else sn=e,e=n;else sn=e,e=n;if(e===n)if(e=sn,t=Gr(),t!==n)if(oa(),r=On(),r!==n){for(oa(),a=[],o=sn,i=Xn(),i!==n?(u=oa(),o=i):(sn=o,o=n);o!==n;)a.push(o),o=sn,i=Xn(),i!==n?(u=oa(),o=i):(sn=o,o=n);o=er(),o!==n?(i=oa(),u=Qr(),u!==n?(ln=e,e=function(e,t,n){return{type:"case-expression",location:hn(),format:"simple",operand:e,clauses:t,else:n.value,elseLocation:n.location}}(r,a,o)):(sn=e,e=n)):(sn=e,e=n)}else sn=e,e=n;else sn=e,e=n;return e}(),e===n&&(e=function(){let e,t,r,a,o,i;if(e=sn,t=Gr(),t!==n){for(oa(),r=[],a=sn,o=Qn(),o!==n?(i=oa(),a=o):(sn=a,a=n);a!==n;)r.push(a),a=sn,o=Qn(),o!==n?(i=oa(),a=o):(sn=a,a=n);a=Qr(),a!==n?(ln=e,e=function(e){return{type:"case-expression",location:hn(),format:"searched",clauses:e,else:null,elseLocation:null}}(r)):(sn=e,e=n)}else sn=e,e=n;if(e===n)if(e=sn,t=Gr(),t!==n){for(oa(),r=[],a=sn,o=Qn(),o!==n?(i=oa(),a=o):(sn=a,a=n);a!==n;)r.push(a),a=sn,o=Qn(),o!==n?(i=oa(),a=o):(sn=a,a=n);a=er(),a!==n?(o=oa(),i=Qr(),i!==n?(ln=e,e=function(e,t){return{type:"case-expression",location:hn(),format:"searched",clauses:e,else:t.value,elseLocation:t.location}}(r,a)):(sn=e,e=n)):(sn=e,e=n)}else sn=e,e=n;return e}()),e}(),e===n&&(e=function(){let e,t;return e=sn,t=function(){let e,t;return e=sn,t=function(){let e,t,r,a;if(e=sn,t=$n(),t!==n){for(r=[],a=kn();a!==n;)r.push(a),a=kn();ln=e,e=function(e,t){return e+t.join("")}(t,r)}else sn=e,e=n;return e}(),t!==n&&(ln=e),e=t,e}(),t!==n&&(ln=e,t=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:hn(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:hn(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:hn(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:hn()}:{type:"column-reference",location:hn(),table:"",column:e}}(t)),e=t,e===n&&(e=sn,t=function(){let e,t,r,a;return e=sn,t=Vn(),t!==n?(r=function(){let e,t,r;for(e=sn,t=[],r=Un();r!==n;)t.push(r),r=Un();return ln=e,t=function(e){return e.join("")}(t),e=t,e}(),a=Vn(),a!==n?(ln=e,e=r):(sn=e,e=n)):(sn=e,e=n),e}(),t!==n&&(ln=e,t=function(e){return{type:"column-reference",location:hn(),table:"",column:e,delimited:!0}}(t)),e=t),e}(),e===n&&(e=zn(),e===n&&(e=sn,t=ra(),t!==n?(oa(),r=On(),r!==n?(oa(),a=aa(),a!==n?(ln=e,e=function(e){return e.paren=!0,e}(r)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n))))))))))),e}function Fn(){let e,t,r,a;if(e=sn,t=$n(),t!==n){for(r=[],a=Rn();a!==n;)r.push(a),a=Rn();ln=e,e=function(e,t){return e+t.join("")}(t,r)}else sn=e,e=n;return e}function $n(){let t;return t=e.charAt(sn),Te.test(t)?sn++:(t=n,0===mn&&Ln(He)),t}function Rn(){let t;return t=e.charAt(sn),Ne.test(t)?sn++:(t=n,0===mn&&Ln(qe)),t}function kn(){let t;return t=e.charAt(sn),Oe.test(t)?sn++:(t=n,0===mn&&Ln(Ke)),t}function Un(){let t;return t=function(){let t;return t=e.charAt(sn),Oe.test(t)?sn++:(t=n,0===mn&&Ln(Ke)),t}(),t===n&&(t=function(){let e,t,r;return e=sn,t=Vn(),t!==n?(r=Vn(),r!==n?(ln=e,e='"'):(sn=e,e=n)):(sn=e,e=n),e}()),t}function Vn(){let t;return t=e.charAt(sn),Ee.test(t)?sn++:(t=n,0===mn&&Ln(Ze)),t}function zn(){let t,r,a,o;return t=sn,r=sn,64===e.charCodeAt(sn)?(a=m,sn++):(a=n,0===mn&&Ln(Ye)),a!==n?(o=Fn(),o!==n?(a=[a,o],r=a):(sn=r,r=n)):(sn=r,r=n),r!==n&&(ln=t,r=function(e){return{type:"parameter",location:hn(),value:e[1]}}(r)),t=r,t}function Hn(){let e,t,r,a,o;return e=sn,t=br(),t===n&&(t=Pr()),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"integer"}}),e=t,e===n&&(e=sn,t=Ar(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"smallint"}}),e=t,e===n&&(e=sn,t=Fr(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"float"}}),e=t,e===n&&(e=sn,t=$r(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"real"}}),e=t,e===n&&(e=sn,t=Er(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"date"}}),e=t,e===n&&(e=sn,t=Or(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"timestamp"}}),e=t,e===n&&(e=sn,t=Sr(),t!==n&&(ln=e,t={type:"data-type",location:hn(),value:{type:"time"}}),e=t,e===n&&(e=sn,t=Rr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=ar(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e){return{type:"data-type",location:hn(),value:{type:"varchar",size:parseInt(e)}}}(a)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)))))))),e}function qn(){let e,t;return e=sn,t=xr(),t===n&&(t=Cr(),t===n&&(t=Dr())),t===n&&(t=null),ln=e,t=function(e){return{type:"string",location:hn(),value:e??"BOTH"}}(t),e=t,e}function Kn(){let e,t;return e=sn,t=Vr(),t===n&&(t=qr(),t===n&&(t=Kr(),t===n&&(t=Zr(),t===n&&(t=Yr(),t===n&&(t=jr(),t===n&&(t=zr(),t===n&&(t=Hr(),t===n&&(t=Wr(),t===n&&(t=Jr(),t===n&&(t=Br())))))))))),t!==n&&(ln=e,t=function(e){return{type:"string",location:hn(),value:e}}(t)),e=t,e}function Zn(){let t,r,a,o,i;return t=sn,r=Ur(),r!==n?(oa(),a=e.charAt(sn),ye.test(a)?sn++:(a=n,0===mn&&Ln(Ue)),a!==n?(oa(),o=Bn(),o!==n?(oa(),i=Yn(),i!==n?(ln=t,t=function(e,t,n){return{type:"interval",location:hn(),value:t,qualifier:n,op:e}}(a,o,i)):(sn=t,t=n)):(sn=t,t=n)):(sn=t,t=n)):(sn=t,t=n),t===n&&(t=sn,r=Ur(),r!==n?(oa(),a=Bn(),a!==n?(oa(),o=Yn(),o!==n?(ln=t,t=function(e,t){return{type:"interval",location:hn(),value:e,qualifier:t,op:""}}(a,o)):(sn=t,t=n)):(sn=t,t=n)):(sn=t,t=n)),t}function Yn(){let e,t,r,a;return e=sn,t=function(){let e,t,r,a,o;return e=sn,t=jn(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Jn(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e,t){return{type:"interval-period",location:hn(),period:e.value,precision:t,secondary:null}}(t,a)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=jn(),t!==n&&(ln=e,t=function(e){return{type:"interval-period",location:hn(),period:e.value,precision:null,secondary:null}}(t)),e=t),e}(),t!==n?(oa(),r=kr(),r!==n?(oa(),a=function(){let e,t,r,a,o,i,u;return e=sn,t=jn(),t!==n&&(ln=e,t=function(e){return{type:"interval-period",location:hn(),period:e.value,precision:null,secondary:null}}(t)),e=t,e===n&&(e=sn,t=jr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Jn(),a!==n?(oa(),o=na(),o!==n?(oa(),i=Wn(),i!==n?(oa(),u=aa(),u!==n?(ln=e,e=function(e,t){return{type:"interval-period",location:hn(),period:"second",precision:e,secondary:t}}(a,i)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=jr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Jn(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e){return{type:"interval-period",location:hn(),period:"second",precision:e,secondary:null}}(a)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=jr(),t!==n&&(ln=e,t={type:"interval-period",location:hn(),period:"second",precision:null,secondary:null}),e=t))),e}(),a!==n?(ln=e,e=function(e,t){return{type:"interval-qualifier",location:hn(),start:e,end:t}}(t,a)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=function(){let e,t,r,a,o,i,u;return e=sn,t=jn(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Wn(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e,t){return{type:"interval-period",location:hn(),period:e.value,precision:t,secondary:null}}(t,a)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=jn(),t!==n&&(ln=e,t=function(e){return{type:"interval-period",location:hn(),period:e.value,precision:null,secondary:null}}(t)),e=t,e===n&&(e=sn,t=jr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Jn(),a!==n?(oa(),o=na(),o!==n?(oa(),i=Wn(),i!==n?(oa(),u=aa(),u!==n?(ln=e,e=function(e,t){return{type:"interval-period",location:hn(),period:"second",precision:e,secondary:t}}(a,i)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=jr(),t!==n?(oa(),r=ra(),r!==n?(oa(),a=Wn(),a!==n?(oa(),o=aa(),o!==n?(ln=e,e=function(e){return{type:"interval-period",location:hn(),period:"second",precision:e,secondary:null}}(a)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e===n&&(e=sn,t=jr(),t!==n&&(ln=e,t={type:"interval-period",location:hn(),period:"second",precision:null,secondary:null}),e=t)))),e}()),e}function jn(){let e,t;return e=sn,t=Kr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"day"}),e=t,e===n&&(e=sn,t=Zr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"hour"}),e=t,e===n&&(e=sn,t=Yr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"minute"}),e=t,e===n&&(e=sn,t=qr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"month"}),e=t,e===n&&(e=sn,t=Vr(),t!==n&&(ln=e,t={type:"string",location:hn(),value:"year"}),e=t)))),e}function Wn(){let e,t;return e=sn,t=ar(),t!==n&&(ln=e,t=function(e){return parseFloat(e)}(t)),e=t,e}function Jn(){let e,t;return e=sn,t=ar(),t!==n&&(ln=e,t=function(e){return parseFloat(e)}(t)),e=t,e}function Bn(){let e;return e=Gn(),e===n&&(e=zn()),e}function Gn(){let t,r,a,o,i;if(t=sn,39===e.charCodeAt(sn)?(r=h,sn++):(r=n,0===mn&&Ln(je)),r===n&&(e.substr(sn,2)===w?(r=w,sn+=2):(r=n,0===mn&&Ln(We))),r!==n){for(a=[],o=sn,e.substr(sn,2)===v?(i=v,sn+=2):(i=n,0===mn&&Ln(Je)),i!==n&&(ln=o,i="'"),o=i,o===n&&(o=e.charAt(sn),Se.test(o)?sn++:(o=n,0===mn&&Ln(Be)));o!==n;)a.push(o),o=sn,e.substr(sn,2)===v?(i=v,sn+=2):(i=n,0===mn&&Ln(Je)),i!==n&&(ln=o,i=un()),o=i,o===n&&(o=e.charAt(sn),Se.test(o)?sn++:(o=n,0===mn&&Ln(Be)));39===e.charCodeAt(sn)?(o=h,sn++):(o=n,0===mn&&Ln(je)),o!==n?(ln=t,t=function(e){return{type:"string",location:hn(),value:e.join("")}}(a)):(sn=t,t=n)}else sn=t,t=n;return t}function Qn(){let e,t,r,a,o;return e=sn,t=Xr(),t!==n?(oa(),r=On(),r!==n?(oa(),a=ea(),a!==n?(oa(),o=On(),o!==n?(ln=e,e=function(e,t){return{type:"when-clause",location:hn(),operand:e,value:t}}(r,o)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e}function Xn(){let e,t,r,a,o;return e=sn,t=Xr(),t!==n?(oa(),r=On(),r!==n?(oa(),a=ea(),a!==n?(oa(),o=On(),o!==n?(ln=e,e=function(e,t){return{type:"when-clause",location:hn(),operand:e,value:t}}(r,o)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n)):(sn=e,e=n),e}function er(){let e,t,r;return e=sn,t=ta(),t!==n?(oa(),r=On(),r!==n?(ln=e,e=function(e){return{type:"else-clause",location:hn(),value:e}}(r)):(sn=e,e=n)):(sn=e,e=n),e}function tr(){let t,r,a;return t=ar(),t===n&&(t=sn,r=e.charAt(sn),ye.test(r)?sn++:(r=n,0===mn&&Ln(Ue)),r!==n?(a=ar(),a!==n?(ln=t,t=function(e,t){return e[0]+t}(r,a)):(sn=t,t=n)):(sn=t,t=n)),t}function nr(){let t,r,a;return t=sn,46===e.charCodeAt(sn)?(r=I,sn++):(r=n,0===mn&&Ln(Ge)),r!==n?(a=ar(),a===n&&(a=null),ln=t,t=function(e){return"."+(null!=e?e:"")}(a)):(sn=t,t=n),t}function rr(){let e,t,r;return e=sn,t=ir(),t!==n?(r=ar(),r!==n?(ln=e,e=function(e,t){return e+t}(t,r)):(sn=e,e=n)):(sn=e,e=n),e}function ar(){let e,t,r;if(e=sn,t=[],r=or(),r!==n)for(;r!==n;)t.push(r),r=or();else t=n;return t!==n&&(ln=e,t=function(e){return e.join("")}(t)),e=t,e}function or(){let t;return t=e.charAt(sn),xe.test(t)?sn++:(t=n,0===mn&&Ln(Qe)),t}function ir(){let t,r,a;return t=sn,r=e.charAt(sn),Ce.test(r)?sn++:(r=n,0===mn&&Ln(Xe)),r!==n?(a=e.charAt(sn),ye.test(a)?sn++:(a=n,0===mn&&Ln(Ue)),a===n&&(a=null),ln=t,t=function(e,t){return"e"+(null===t?"":t)}(0,a)):(sn=t,t=n),t}function ur(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===g?sn+=4:(r=n,0===mn&&Ln(et)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(r=[r,a],t=r):(sn=t,t=n)):(sn=t,t=n),t}function sr(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===y?sn+=4:(r=n,0===mn&&Ln(tt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(r=[r,a],t=r):(sn=t,t=n)):(sn=t,t=n),t}function lr(){let t,r,a,o;return t=sn,r=e.substr(sn,5),r.toLowerCase()===L?sn+=5:(r=n,0===mn&&Ln(nt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(r=[r,a],t=r):(sn=t,t=n)):(sn=t,t=n),t}function cr(){let t,r,a,o;return t=sn,r=e.substr(sn,2),r.toLowerCase()===T?sn+=2:(r=n,0===mn&&Ln(rt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="IN"):(sn=t,t=n)):(sn=t,t=n),t}function fr(){let t,r,a,o;return t=sn,r=e.substr(sn,2),r.toLowerCase()===N?sn+=2:(r=n,0===mn&&Ln(at)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="IS"):(sn=t,t=n)):(sn=t,t=n),t}function dr(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===O?sn+=4:(r=n,0===mn&&Ln(ot)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="LIKE"):(sn=t,t=n)):(sn=t,t=n),t}function pr(){let t,r,a,o;return t=sn,r=e.substr(sn,6),r.toLowerCase()===E?sn+=6:(r=n,0===mn&&Ln(it)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="ESCAPE"):(sn=t,t=n)):(sn=t,t=n),t}function mr(){let t,r,a,o;return t=sn,r=e.substr(sn,3),r.toLowerCase()===S?sn+=3:(r=n,0===mn&&Ln(ut)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="NOT"):(sn=t,t=n)):(sn=t,t=n),t}function hr(){let t,r,a,o;return t=sn,r=e.substr(sn,3),r.toLowerCase()===x?sn+=3:(r=n,0===mn&&Ln(st)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="AND"):(sn=t,t=n)):(sn=t,t=n),t}function wr(){let t,r,a,o;return t=sn,r=e.substr(sn,2),r.toLowerCase()===C?sn+=2:(r=n,0===mn&&Ln(lt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="OR"):(sn=t,t=n)):(sn=t,t=n),t}function vr(){let t,r,a,o;return t=sn,r=e.substr(sn,7),r.toLowerCase()===D?sn+=7:(r=n,0===mn&&Ln(ct)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="BETWEEN"):(sn=t,t=n)):(sn=t,t=n),t}function Ir(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===_?sn+=4:(r=n,0===mn&&Ln(ft)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="FROM"):(sn=t,t=n)):(sn=t,t=n),t}function gr(){let t,r,a,o;return t=sn,r=e.substr(sn,3),r.toLowerCase()===M?sn+=3:(r=n,0===mn&&Ln(dt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="FOR"):(sn=t,t=n)):(sn=t,t=n),t}function yr(){let t,r,a,o;return t=sn,r=e.substr(sn,9),r.toLowerCase()===b?sn+=9:(r=n,0===mn&&Ln(pt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="SUBSTRING"):(sn=t,t=n)):(sn=t,t=n),t}function Lr(){let t,r,a,o;return t=sn,r=e.substr(sn,7),r.toLowerCase()===P?sn+=7:(r=n,0===mn&&Ln(mt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="EXTRACT"):(sn=t,t=n)):(sn=t,t=n),t}function Tr(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===A?sn+=4:(r=n,0===mn&&Ln(ht)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="TRIM"):(sn=t,t=n)):(sn=t,t=n),t}function Nr(){let t,r,a,o;return t=sn,r=e.substr(sn,8),r.toLowerCase()===F?sn+=8:(r=n,0===mn&&Ln(wt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="POSITION"):(sn=t,t=n)):(sn=t,t=n),t}function Or(){let t,r,a,o;return t=sn,r=e.substr(sn,9),r.toLowerCase()===$?sn+=9:(r=n,0===mn&&Ln(vt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="TIMESTAMP"):(sn=t,t=n)):(sn=t,t=n),t}function Er(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===R?sn+=4:(r=n,0===mn&&Ln(It)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="DATE"):(sn=t,t=n)):(sn=t,t=n),t}function Sr(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===k?sn+=4:(r=n,0===mn&&Ln(gt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="TIME"):(sn=t,t=n)):(sn=t,t=n),t}function xr(){let t,r,a,o;return t=sn,r=e.substr(sn,7),r.toLowerCase()===U?sn+=7:(r=n,0===mn&&Ln(yt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="LEADING"):(sn=t,t=n)):(sn=t,t=n),t}function Cr(){let t,r,a,o;return t=sn,r=e.substr(sn,8),r.toLowerCase()===V?sn+=8:(r=n,0===mn&&Ln(Lt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="TRAILING"):(sn=t,t=n)):(sn=t,t=n),t}function Dr(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===z?sn+=4:(r=n,0===mn&&Ln(Tt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="BOTH"):(sn=t,t=n)):(sn=t,t=n),t}function _r(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===H?sn+=4:(r=n,0===mn&&Ln(Nt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="CAST"):(sn=t,t=n)):(sn=t,t=n),t}function Mr(){let t,r,a,o;return t=sn,r=e.substr(sn,2),r.toLowerCase()===q?sn+=2:(r=n,0===mn&&Ln(Ot)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="AS"):(sn=t,t=n)):(sn=t,t=n),t}function br(){let t,r,a,o;return t=sn,r=e.substr(sn,7),r.toLowerCase()===K?sn+=7:(r=n,0===mn&&Ln(Et)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="INTEGER"):(sn=t,t=n)):(sn=t,t=n),t}function Pr(){let t,r,a,o;return t=sn,r=e.substr(sn,3),r.toLowerCase()===Z?sn+=3:(r=n,0===mn&&Ln(St)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="INT"):(sn=t,t=n)):(sn=t,t=n),t}function Ar(){let t,r,a,o;return t=sn,r=e.substr(sn,8),r.toLowerCase()===Y?sn+=8:(r=n,0===mn&&Ln(xt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="SMALLINT"):(sn=t,t=n)):(sn=t,t=n),t}function Fr(){let t,r,a,o;return t=sn,r=e.substr(sn,5),r.toLowerCase()===j?sn+=5:(r=n,0===mn&&Ln(Ct)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="FLOAT"):(sn=t,t=n)):(sn=t,t=n),t}function $r(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===J?sn+=4:(r=n,0===mn&&Ln(Dt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="REAL"):(sn=t,t=n)):(sn=t,t=n),t}function Rr(){let t,r,a,o;return t=sn,r=e.substr(sn,7),r.toLowerCase()===B?sn+=7:(r=n,0===mn&&Ln(_t)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="VARCHAR"):(sn=t,t=n)):(sn=t,t=n),t}function kr(){let t,r,a,o;return t=sn,r=e.substr(sn,2),r.toLowerCase()===G?sn+=2:(r=n,0===mn&&Ln(Mt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="TO"):(sn=t,t=n)):(sn=t,t=n),t}function Ur(){let t,r,a,o;return t=sn,r=e.substr(sn,8),r.toLowerCase()===Q?sn+=8:(r=n,0===mn&&Ln(bt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="INTERVAL"):(sn=t,t=n)):(sn=t,t=n),t}function Vr(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===X?sn+=4:(r=n,0===mn&&Ln(Pt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="YEAR"):(sn=t,t=n)):(sn=t,t=n),t}function zr(){let t,r,a,o;return t=sn,r=e.substr(sn,13),r.toLowerCase()===ee?sn+=13:(r=n,0===mn&&Ln(At)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="TIMEZONE_HOUR"):(sn=t,t=n)):(sn=t,t=n),t}function Hr(){let t,r,a,o;return t=sn,r=e.substr(sn,15),r.toLowerCase()===te?sn+=15:(r=n,0===mn&&Ln(Ft)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="TIMEZONE_MINUTE"):(sn=t,t=n)):(sn=t,t=n),t}function qr(){let t,r,a,o;return t=sn,r=e.substr(sn,5),r.toLowerCase()===ne?sn+=5:(r=n,0===mn&&Ln($t)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="MONTH"):(sn=t,t=n)):(sn=t,t=n),t}function Kr(){let t,r,a,o;return t=sn,r=e.substr(sn,3),r.toLowerCase()===re?sn+=3:(r=n,0===mn&&Ln(Rt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="DAY"):(sn=t,t=n)):(sn=t,t=n),t}function Zr(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===ae?sn+=4:(r=n,0===mn&&Ln(kt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="HOUR"):(sn=t,t=n)):(sn=t,t=n),t}function Yr(){let t,r,a,o;return t=sn,r=e.substr(sn,6),r.toLowerCase()===oe?sn+=6:(r=n,0===mn&&Ln(Ut)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="MINUTE"):(sn=t,t=n)):(sn=t,t=n),t}function jr(){let t,r,a,o;return t=sn,r=e.substr(sn,6),r.toLowerCase()===ie?sn+=6:(r=n,0===mn&&Ln(Vt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="SECOND"):(sn=t,t=n)):(sn=t,t=n),t}function Wr(){let t,r,a,o;return t=sn,r=e.substr(sn,3),r.toLowerCase()===ue?sn+=3:(r=n,0===mn&&Ln(zt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="DOW"):(sn=t,t=n)):(sn=t,t=n),t}function Jr(){let t,r,a,o;return t=sn,r=e.substr(sn,3),r.toLowerCase()===se?sn+=3:(r=n,0===mn&&Ln(Ht)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="DOY"):(sn=t,t=n)):(sn=t,t=n),t}function Br(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===le?sn+=4:(r=n,0===mn&&Ln(qt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="WEEK"):(sn=t,t=n)):(sn=t,t=n),t}function Gr(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===ce?sn+=4:(r=n,0===mn&&Ln(Kt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="CASE"):(sn=t,t=n)):(sn=t,t=n),t}function Qr(){let t,r,a,o;return t=sn,r=e.substr(sn,3),r.toLowerCase()===fe?sn+=3:(r=n,0===mn&&Ln(Zt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="END"):(sn=t,t=n)):(sn=t,t=n),t}function Xr(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===de?sn+=4:(r=n,0===mn&&Ln(Yt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="WHEN"):(sn=t,t=n)):(sn=t,t=n),t}function ea(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===pe?sn+=4:(r=n,0===mn&&Ln(jt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="THEN"):(sn=t,t=n)):(sn=t,t=n),t}function ta(){let t,r,a,o;return t=sn,r=e.substr(sn,4),r.toLowerCase()===me?sn+=4:(r=n,0===mn&&Ln(Wt)),r!==n?(a=sn,mn++,o=Rn(),mn--,o===n?a=void 0:(sn=a,a=n),a!==n?(ln=t,t="ELSE"):(sn=t,t=n)):(sn=t,t=n),t}function na(){let t;return 44===e.charCodeAt(sn)?(t=he,sn++):(t=n,0===mn&&Ln(Jt)),t}function ra(){let t;return 40===e.charCodeAt(sn)?(t=we,sn++):(t=n,0===mn&&Ln(Bt)),t}function aa(){let t;return 41===e.charCodeAt(sn)?(t=ve,sn++):(t=n,0===mn&&Ln(Gt)),t}function oa(){let e,t;for(e=[],t=ia();t!==n;)e.push(t),t=ia();return e}function ia(){let t;return t=e.charAt(sn),De.test(t)?sn++:(t=n,0===mn&&Ln(Qt)),t}function ua(){let t,r,a,o;if(t=sn,r=Fn(),r!==n&&(ln=t),t=r,t===n)if(t=sn,96===e.charCodeAt(sn)?(r=Ie,sn++):(r=n,0===mn&&Ln(Xt)),r!==n){if(a=[],o=e.charAt(sn),_e.test(o)?sn++:(o=n,0===mn&&Ln(en)),o!==n)for(;o!==n;)a.push(o),o=e.charAt(sn),_e.test(o)?sn++:(o=n,0===mn&&Ln(en));else a=n;a!==n?(96===e.charCodeAt(sn)?(o=Ie,sn++):(o=n,0===mn&&Ln(Xt)),o!==n?(ln=t,t=function(e){return e.join("")}(a)):(sn=t,t=n)):(sn=t,t=n)}else sn=t,t=n;return t}function sa(e,t,n,r,a){const o={type:"binary-expression",location:a,operator:e,left:t,right:n};return void 0!==r&&(o.escape=r),o}function la(e,...t){return{type:"expression-list",location:e,value:t}}function ca(e,t){let n=e;for(const{op:e,expr:r,location:{end:a}}of t)n=sa(e,n,r,void 0,{...n.location,end:a});return n}fn=o();const fa=fn!==n&&sn===e.length;function da(){throw fn!==n&&sn<e.length&&Ln({type:"end"}),function(e,t,n){return new W(W.buildMessage(e,t),e,t,n)}(pn,dn<e.length?function(t=sn){const n=e.codePointAt(t);return void 0===n?"":String.fromCodePoint(n)}(dn):null,dn<e.length?yn(dn,dn+1):yn(dn,dn))}return t.peg$library?{peg$result:fn,peg$currPos:sn,peg$FAILED:n,peg$maxFailExpected:pn,peg$maxFailPos:dn,peg$success:fa,peg$throw:fa?void 0:da}:fa?fn:void da()}class B{static parse(e){return J(e)}}function G(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":G(e.operand,t),G(e.value,t);break;case"case-expression":for(const n of e.clauses)G(n,t);"simple"===e.format&&G(e.operand,t),null!==e.else&&G(e.else,t);break;case"expression-list":for(const n of e.value)G(n,t);break;case"unary-expression":G(e.expr,t);break;case"binary-expression":G(e.left,t),G(e.right,t);break;case"function":G(e.args,t);break;case"interval":G(e.value,t),G(e.qualifier,t);break;case"interval-qualifier":G(e.start,t),G(e.end,t)}}const Q=new Set(["current_timestamp","current_date","current_time"]);class X{constructor(e){this.staticData=e}makeBool(e){return fe(e)}featureValue(e,t,n,r){return Te(e,t,n,r)}equalsNull(e){return null===e}applyLike(e,t,n){return Le(e,t,n)}ensureArray(e){return de(e)}applyIn(e,t){return we(e,t)}currentTimestamp(e){return ve(e)}currentDate(e){return Ie(e)}currentTime(e){return ge(e)}makeSqlInterval(e,t,n){return c.createFromValueAndQualifier(e,t,n)}convertInterval(e){return c.isInterval(e)?e.valueInMilliseconds():e}compare(e,t,n){return k(t,n,e)}calculate(e,t,n,r){return Y(e,t,n,r)}evaluateTime(e){return D(e)}evaluateTimestamp(e,t,n){return _(e,t,n)}evaluateDate(e,t){return M(e,t)}evaluateFunction(e,t,n){return H(e,t,n)}lookup(e,t){const n=t[e];return void 0===n?null:n}between(e,t){return null==e||null==t[0]||null==t[1]?null:k(e,t[0],">=")&&k(e,t[1],"<=")}notbetween(e,t){return null==e||null==t[0]||null==t[1]?null:k(e,t[0],"<")||k(e,t[1],">")}ternaryNot(e){return pe(e)}ternaryAnd(e,t){return me(e,t)}ternaryOr(e,t){return he(e,t)}}function ee(e,...t){return`this.${e}(${t.join(", ")})`}function te(e){return void 0===e?"void 0":JSON.stringify(e)}function ne({type:e,period:t,precision:n,secondary:r}){return JSON.stringify({type:e,period:t,precision:n,secondary:r})}const re="feature",ae="lookups",oe="attributeAdapter",ie="fieldsIndex",ue="timeZone",se="currentUser";class le{constructor(e){this._parseTree=e,this._staticData=Object.create(null),this._nextStaticDataId=0,this._tempVars=new Set,this._nextTempVarId=0}compile(){const e=this._compileNode(this._parseTree),t=`\n ${this._tempVars.size>0?`var ${Array.from(this._tempVars).join(", ")};`:""}\n return this.convertInterval(${e});\n `;return new Function(re,ae,oe,ie,ue,se,t).bind(new X(this._staticData))}_storeStaticData(e){const t="static$"+this._nextStaticDataId++;return this._staticData[t]=e,t}_compileRefStaticData(e){return`this.staticData[${te(e)}]`}_generateTempVar(){const e="temp$"+this._nextTempVarId++;return this._tempVars.add(e),e}_compileSimpleCase(e){const t=this._compileNode(e.operand),n=this._generateTempVar(),r=[];for(const t of e.clauses){const e=ee("compare",te("="),n,this._compileNode(t.operand)),a=this._compileNode(t.value);r.push(`${e} ? (${a}) :`)}return null!=e.else?r.push(this._compileNode(e.else)):r.push(te(null)),`(${n} = ${t}, ${r.join(" ")})`}_compileSearchedCase(e){const t=[];for(const n of e.clauses){const e=ee("makeBool",this._compileNode(n.operand)),r=this._compileNode(n.value);t.push(`${e} ? (${r}) :`)}return null!=e.else?t.push(this._compileNode(e.else)):t.push(te(null)),t.join(" ")}_compileInExpr(e,t){const n=new Set,r=[];for(const e of t.value)"number"===e.type||"string"===e.type?n.add(e.value):r.push(e);const a=this._compileNode(e),o=ee("ensureArray",this._compileNode({type:"expression-list",location:t.location,value:r}));if(n.size>0){const e=this._compileRefStaticData(this._storeStaticData(n)),t=this._generateTempVar();return r.length>0?`(${t} = ${a}, ${e}.has(${t}) || ${ee("applyIn",t,o)})`:`(${t} = ${a}, ${t} == null ? null : ${e}.has(${t}))`}return ee("applyIn",a,o)}_compileNode(e){switch(e.type){case"interval":return ee("makeSqlInterval",this._compileNode(e.value),"interval-qualifier"===e.qualifier.type?function({type:e,start:t,end:n}){return`{type: ${te(e)}, start: ${ne(t)}, end: ${ne(n)}}`}(e.qualifier):ne(e.qualifier),te(e.op));case"case-expression":return"simple"===e.format?this._compileSimpleCase(e):this._compileSearchedCase(e);case"parameter":return ee("lookup",te(e.value.toLowerCase()),ae);case"expression-list":return`[${e.value.map(e=>this._compileNode(e)).join(", ")}]`;case"unary-expression":return ee("ternaryNot",this._compileNode(e.expr));case"binary-expression":switch(e.operator){case"AND":return ee("ternaryAnd",this._compileNode(e.left),this._compileNode(e.right));case"OR":return ee("ternaryOr",this._compileNode(e.left),this._compileNode(e.right));case"IS":if("null"!==e.right.type)throw new i.L("UnsupportedIsRhs");return ee("equalsNull",this._compileNode(e.left));case"ISNOT":if("null"!==e.right.type)throw new i.L("UnsupportedIsRhs");return`!${ee("equalsNull",this._compileNode(e.left))}`;case"IN":return this._compileInExpr(e.left,e.right);case"NOT IN":return ee("ternaryNot",this._compileInExpr(e.left,e.right));case"BETWEEN":return ee("between",this._compileNode(e.left),this._compileNode(e.right));case"NOTBETWEEN":return ee("notbetween",this._compileNode(e.left),this._compileNode(e.right));case"LIKE":return ee("applyLike",this._compileNode(e.left),this._compileNode(e.right),te(e.escape));case"NOT LIKE":return ee("ternaryNot",ee("applyLike",this._compileNode(e.left),this._compileNode(e.right),te(e.escape)));case"<>":case"<":case">":case">=":case"<=":case"=":return ee("compare",te(e.operator),this._compileNode(e.left),this._compileNode(e.right));case"*":case"-":case"+":case"/":case"||":return ee("calculate",te(e.operator),this._compileNode(e.left),this._compileNode(e.right),ue);default:throw new i.L("UnsupportedOperator",{operator:e.operator})}case"null":case"boolean":case"string":case"number":return te(e.value);case"time":try{return this._compileRefStaticData(this._storeStaticData(D(e.value)))}catch{return ee("evaluateTime",te(e.value))}case"date":try{return this._compileRefStaticData(this._storeStaticData(M(e.value,"unknown")))}catch{return ee("evaluateDate",te(e.value),te("unknown"))}case"timestamp":try{return this._compileRefStaticData(this._storeStaticData(_(e.value,"unknown")))}catch{return ee("evaluateTimestamp",te(e.value),te("unknown"))}case"current-time":return"date"===e.mode?ee("currentDate",ue):"time"===e.mode?ee("currentTime",ue):ee("currentTimestamp",ue);case"current-user":return se;case"column-reference":return ee("featureValue",re,te(e.column),ie,oe);case"data-type":return function({type:e,size:t,withtimezone:n}){return JSON.stringify({type:e,size:t,withtimezone:n})}(e.value);case"function":return ee("evaluateFunction",te(e.name),this._compileNode(e.args),ue)}throw new i.L("UnsupportedSyntax",{node:e.type})}}class ce{static create(e,t={}){return new ce(e,t.fieldsIndex,t.timeZone??void 0,t.currentUser)}constructor(e,t,n="UTC",r=null){this.fieldsIndex=t,this.timeZone=n,this.currentUser=r,this.parameters={},this._compiledExecutor=null,this._hasDateFunctions=void 0,this.parseTree=B.parse(e);const{isStandardized:a,isAggregate:o,currentUserRequired:i,referencedFieldNames:u}=this._extractExpressionInfo(t);this._referencedFieldNames=u,this.isStandardized=a,this.isAggregate=o,this.currentUserRequired=i}static convertValueToStorageFormat(e,t=null){if(null===t)return(0,A.$P)(e)?e.getTime():E(e)?e.toMillis():C(e)?e.toStorageFormat():x(e)?e.toStorageString():S(e)?e.toStorageFormat():e;switch(t){case"date":return(0,A.$P)(e)?e.getTime():E(e)?e.toMillis():C(e)?e.toMilliseconds():S(e)?e.toNumber():e;case"date-only":return(0,A.$P)(e)?o.n.fromDateJS(e).toString():C(e)?o.n.fromSqlTimeStampOffset(e).toString():E(e)?o.n.fromDateTime(e).toString():e;case"time-only":return(0,A.$P)(e)?d.k.fromDateJS(e).toStorageString():E(e)?d.k.fromDateTime(e).toStorageString():C(e)?d.k.fromSqlTimeStampOffset(e).toStorageString():x(e)?e.toStorageString():e;case"timestamp-offset":if((0,A.$P)(e))return f.g.fromJSDate(e).toStorageFormat();if(E(e))return f.g.fromDateTime(e).toStorageFormat();if(C(e))return e.toStorageFormat()}return e}get fieldNames(){return this._referencedFieldNames}testSet(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,null,t,e,n)}calculateValue(e,t=Ne,n=this.currentUser){const r=this._evaluateNode(this.parseTree,e,t,null,n);return c.isInterval(r)?r.valueInMilliseconds()/864e5:r}tryGetCompiledExecutor(){if(null!=this._compiledExecutor)return this._compiledExecutor;if((0,r.A)("esri-csp-restrictions"))return null;const e=new le(this.parseTree);return this._compiledExecutor=e.compile(),this._compiledExecutor}calculateValueCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.calculateValue(e,t):r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}testFeature(e,t=Ne,n=this.currentUser){return!!this._evaluateNode(this.parseTree,e,t,null,n)}testFeatureCompiled(e,t=Ne,n=this.currentUser){const r=this.tryGetCompiledExecutor();return null==r?this.testFeature(e,t):!!r(e,this.parameters,t,this.fieldsIndex,this.timeZone,n??null)}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,G(this.parseTree,e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||Q.has(e.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const e=new Set;return G(this.parseTree,t=>{"function"===t.type&&e.add(t.name.toLowerCase())}),Array.from(e)}getExpressions(){const e=new Map;return G(this.parseTree,t=>{if("function"===t.type){const n=t.name.toLowerCase(),r=t.args.value[0];if("column-reference"===r.type){const t=r.column,a=`${n}-${t}`;e.has(a)||e.set(a,{aggregateType:n,field:t})}}}),[...e.values()]}getVariables(){const e=new Set;return G(this.parseTree,t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())}),Array.from(e)}_extractExpressionInfo(e){const t=[],n=new Set;let r=!0,o=!1,i=!1;return G(this.parseTree,u=>{switch(u.type){case"column-reference":{const r=e?.get(u.column);let a,o;r?a=o=r.name??"":(o=u.column,a=o.toLowerCase()),n.has(a)||(n.add(a),t.push(o)),u.column=o;break}case"current-user":i=!0;break;case"function":{const{name:e,args:t}=u,n=t.value.length;r&&(r=function(e,t){const n=Z[e.toLowerCase()];return null!=n&&t>=n.minParams&&t<=n.maxParams}(e,n)),!1===o&&(o=(0,a.M)(e,n));break}}}),{referencedFieldNames:Array.from(t),isStandardized:r,isAggregate:o,currentUserRequired:i}}_evaluateNode(e,t,n,r,o){let u;switch(e.type){case"interval":{const a=this._evaluateNode(e.value,t,n,r,o);return c.createFromValueAndQualifier(a,e.qualifier,e.op)}case"case-expression":if("simple"===e.format){const a=this._evaluateNode(e.operand,t,n,r,o);for(let i=0;i<e.clauses.length;i++)if(k(a,this._evaluateNode(e.clauses[i].operand,t,n,r,o),"="))return this._evaluateNode(e.clauses[i].value,t,n,r,o);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,o)}else{for(let a=0;a<e.clauses.length;a++)if(fe(this._evaluateNode(e.clauses[a].operand,t,n,r,o)))return this._evaluateNode(e.clauses[a].value,t,n,r,o);if(null!==e.else)return this._evaluateNode(e.else,t,n,r,o)}return null;case"parameter":return u=this.parameters[e.value.toLowerCase()],(0,A.$P)(u)?m.c9.fromJSDate(u):null!=u&&"object"==typeof u&&"toDateTime"in u?u.toDateTime():u;case"expression-list":{const a=[];for(const i of e.value)a.push(this._evaluateNode(i,t,n,r,o));return a}case"unary-expression":return pe(this._evaluateNode(e.expr,t,n,r,o));case"binary-expression":switch(e.operator){case"AND":return me(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o));case"OR":return he(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o));case"IS":if("null"!==e.right.type)throw new i.L("UnsupportedIsRhs");return null===this._evaluateNode(e.left,t,n,r,o);case"ISNOT":if("null"!==e.right.type)throw new i.L("UnsupportedIsRhs");return null!==this._evaluateNode(e.left,t,n,r,o);case"IN":{const a=de(this._evaluateNode(e.right,t,n,r,o));return we(this._evaluateNode(e.left,t,n,r,o),a)}case"NOT IN":{const a=de(this._evaluateNode(e.right,t,n,r,o));return pe(we(this._evaluateNode(e.left,t,n,r,o),a))}case"BETWEEN":{const a=this._evaluateNode(e.left,t,n,r,o),i=this._evaluateNode(e.right,t,n,r,o);return null==a||null==i[0]||null==i[1]?null:k(a,i[0],">=")&&k(a,i[1],"<=")}case"NOTBETWEEN":{const a=this._evaluateNode(e.left,t,n,r,o),i=this._evaluateNode(e.right,t,n,r,o);return null==a||null==i[0]||null==i[1]?null:k(a,i[0],"<")||k(a,i[1],">")}case"LIKE":return Le(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o),e.escape);case"NOT LIKE":return pe(Le(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o),e.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return k(this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o),e.operator);case"-":case"+":case"*":case"/":case"||":return Y(e.operator,this._evaluateNode(e.left,t,n,r,o),this._evaluateNode(e.right,t,n,r,o),this.timeZone)}case"null":case"boolean":case"string":case"number":return e.value;case"date":return e.parsedValue??=M(e.value,"unknown"),e.parsedValue;case"timestamp":return e.parsedValue??=_(e.value,"unknown"),e.parsedValue;case"time":return D(e.value);case"current-time":return"date"===e.mode?Ie(this.timeZone):"time"===e.mode?ge(this.timeZone):ve(this.timeZone);case"current-user":return o??null;case"column-reference":return Te(t,e.column,this.fieldsIndex,n);case"data-type":return e.value;case"function":{if(this.isAggregate&&(0,a.M)(e.name,e.args.value.length)){const t=[];for(const a of e.args?.value||[]){const e=[];for(const t of r||[])e.push(this._evaluateNode(a,t,n,null,o));t.push(e)}return(0,a.s)(e.name,t)}const i=this._evaluateNode(e.args,t,n,r,o);return H(e.name,i,this.timeZone)}}throw new i.L("UnsupportedSyntax",{node:e.type})}}function fe(e){return!0===e}function de(e){return Array.isArray(e)?e:[e]}function pe(e){return null!==e?!0!==e:null}function me(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function he(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function we(e,t){if(null==e)return null;let n=!1;for(const r of t)if(null==r)n=null;else{if(e===r){n=!0;break}if($(e)&&$(r)&&(n=k(e,r,"="),n))break}return n}function ve(e){return N(new Date,e)}function Ie(e){return o.n.fromNow(e)}function ge(e){const t=N(new Date,e);return d.k.fromDateTime(t)}const ye="-[]/{}()*+?.\\^$|";function Le(e,t,n){return null==e?null:function(e,t){const n=t;let r="",a=0;for(let t=0;t<e.length;t++){const o=e.charAt(t);switch(a){case 0:o===n?a=1:ye.includes(o)?r+="\\"+o:r+="%"===o?".*":"_"===o?".":o;break;case 1:ye.includes(o)?r+="\\"+o:r+=o,a=0}}return new RegExp("^"+r+"$","m")}(t,n).test(e)}function Te(e,t,n,r){if("getAttributeSQL"in r)return r.getAttributeSQL(e,t);const a=r.getAttribute(e,t);if(null==a)return a;const i=n?.get(t);switch(i?.type){case"esriFieldTypeDate":case"date":return N(new Date(a),n?.getLuxonTimeZone(i.name)??m.mQ.utcInstance);case"esriFieldTypeDateOnly":case"date-only":return o.n.fromReader(a);case"esriFieldTypeTimeOnly":case"time-only":return d.k.fromReader(a);case"esriFieldTypeTimestampOffset":case"timestamp-offset":return new f.g(a)}return a}const Ne={getAttribute:(e,t)=>(function(e){return e&&"object"==typeof e.attributes}(e)?e.attributes:e)[t]}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3356],{4071:(e,t,r)=>{r.d(t,{$:()=>i,P:()=>n});const i={supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1,supportedStatistics:void 0,supportedNormalizationTypes:void 0},n={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsOrderByFields:!1,supportsResize:!1},data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:i,query:{maxRecordCount:0,maxRecordCountFactor:0,maxUniqueIDCount:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsCurrentUser:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPaginationOnAggregatedQueries:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsTrueCurve:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}}},4197:(e,t,r)=>{r.d(t,{jh:()=>n,l5:()=>o,xm:()=>s});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float64Array(e)}function s(e){return((0,i.iu)(e)?e.byteLength/8:e.length)<=i.y9?Array.from(e):new Float64Array(e)}function o(e,t,r){return Array.isArray(e)?e.slice(t,t+r):e.subarray(t,t+r)}},6797:(e,t,r)=>{r.d(t,{Mj:()=>d,Ui:()=>h,w2:()=>m});var i=r(69622),n=r(7762),s=r(88620);const o=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 n.A?Object.keys(e.items):a(e)?(0,s.oY)(e).keys():e?Object.keys(e):[]}function u(e,t){return e instanceof n.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),n=l(t);if(0===i.length&&0===n.length)return;if(!i.length||!n.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=n.filter(e=>!i.includes(e)),d=i.filter(e=>!n.includes(e)),m=i.filter(r=>n.includes(r)&&u(e,r)!==u(t,r)).concat(s,d).sort(),h=p(e);if(h&&o.has(h)&&m.length)return{type:"complete",oldValue:e,newValue:t};let f;const y=a(e)&&a(t);for(const i of m){const n=u(e,i),s=u(t,i);let o;if((y||"function"!=typeof n&&"function"!=typeof s)&&n!==s&&(null!=n||null!=s)){if(r&&r[i]&&"function"==typeof r[i])o=r[i]?.(n,s);else if(n instanceof Date&&s instanceof Date){if(n.getTime()===s.getTime())continue;o={type:"complete",oldValue:n,newValue:s}}else o="object"==typeof n&&"object"==typeof s&&p(n)===p(s)?c(n,s):{type:"complete",oldValue:n,newValue:s};null!=o&&(null!=f?f.diff[i]=o:f={type:"partial",diff:{[i]:o}})}}return f}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 m(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 h(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)}},13069:(e,t,r)=>{r.d(t,{AG:()=>a,lk:()=>n,vD:()=>o,yS:()=>s});const i="randomUUID"in crypto;function n(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function s(){return`{${n().toUpperCase()}}`}function o(){return`{${n()}}`}function a(e){const t=e.toUpperCase();return"{"!==e[0]?`{${t}}`:t}},32730:(e,t,r)=>{r.d(t,{BI:()=>y,D3:()=>h,XJ:()=>f,lc:()=>m,mX:()=>b,rU:()=>g,tH:()=>F});var i=r(799);const n="__begin__",s="__end__",o=new RegExp(n,"ig"),a=new RegExp(s,"ig"),l=new RegExp("^"+n,"i"),u=new RegExp(s+"$","i"),p='"',c=p+" + ",d=" + "+p;function m(e){return e.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function h(e){return e.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function f(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):null!=e.labelExpression&&(t.expression=m(e.labelExpression),t.type="conventional"),t}function y(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return b(t.expression);case"arcade":return t.expression}return null}function g(e){const t=f(e);if(!t)return null;switch(t.type){case"conventional":return function(e){const t=e?.match(_);return t?.[1].trim()||null}(t.expression);case"arcade":return F(t.expression)}return null}function b(e){let t;return e?(t=(0,i.HC)(e,e=>n+'$feature["'+e+'"]'+s),t=l.test(t)?t.replace(l,""):p+t,t=u.test(t)?t.replace(u,""):t+p,t=t.replaceAll(o,c).replaceAll(a,d)):t='""',t}const _=/^\s*\{([^}]+)\}\s*$/i,T=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,v=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,w=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function F(e){if(!e)return null;let t=T.exec(e)||v.exec(e);return t?t[1]||t[3]:(t=w.exec(e),t?t[2]:null)}},39516:(e,t,r)=>{let i;async function n(){return null==i&&(i=Promise.all([r.e(8368),r.e(4123)]).then(r.bind(r,44123)).then(e=>new e.WhereClauseCache(500,500))),i}async function s(e,t){const r=await n(),i=r.get(e,t);if(null==i)throw r.getError(e,t);return i}function o(e,t){return e||=null,t||=null,"1=1"===e?t??e:"1=1"===t?e??t:e&&t?`(${e}) AND (${t})`:e??t}function a(e,t){return e||=null,t||=null,"1=1"===e||"1=1"===t||e===t?"1=1"===e?e:t:e&&t?`(${e}) OR (${t})`:e??t}r.d(t,{GP:()=>s,IW:()=>a,mA:()=>o})},41366:(e,t,r)=>{r.d(t,{K:()=>d,Q:()=>u});var i=r(31635),n=r(66552),s=r(53966),o=r(10107),a=(r(44208),r(87811),r(93223)),l=r(40608);const u=(0,n.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),p="percent-of-total",c="field",d=e=>{const t=e;let r=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,r=null!=this.normalizationTotal;return t||r?(e=t&&c||r&&p||null,t&&r&&s.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==c&&e!==p||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,i.Cg)([(0,o.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],r.prototype,"normalizationField",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],r.prototype,"normalizationMaxValue",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],r.prototype,"normalizationMinValue",void 0),(0,i.Cg)([(0,o.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],r.prototype,"normalizationTotal",void 0),(0,i.Cg)([(0,a.e)(u,{name:"parameters.normalizationType"})],r.prototype,"normalizationType",null),r=(0,i.Cg)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],r),r}},46140:(e,t,r)=>{r.d(t,{R:()=>n});var i=r(49186);let n=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[n,s]=t.split("."),o=/^\s*\d+\s*$/;if(!n?.match||!o.test(n))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!o.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(n,10),l=parseInt(s,10);return new e(a,l,r)}}},50498:(e,t,r)=>{r.d(t,{Ye:()=>c,gy:()=>p,yR:()=>d});var i=r(66552),n=r(5443),s=r(91075),o=r(48526),a=r(86738),l=r(39829),u=r(82799);const p=(0,i.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),c=(0,i.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),d={base:s.A,key:"type",typeMap:{extent:n.A,multipoint:o.A,point:a.A,polyline:u.A,polygon:l.A}}},52106:(e,t,r)=>{r.d(t,{A:()=>T});var i,n=r(31635),s=r(13874),o=r(69540),a=r(51447),l=r(25482),u=r(53966),p=r(36708),c=r(24326),d=r(10107),m=(r(44208),r(87811),r(40608)),h=r(12195),f=r(65864),y=r(50498),g=r(54339),b=r(33910);function _(e){if(null==e)return null;const t={};for(const r in e){const i=e[r];i&&(t[r]=i.toJSON())}return 0!==Object.keys(t).length?t:null}let T=class extends(o.A.ClonableMixin(l.A)){static{i=this}constructor(e){super(e),this.isAggregate=!1,this.layer=null,this.origin=null,this.sourceLayer=null,this._version=0,Object.defineProperty(this,"uid",{value:(0,c.c)(),configurable:!0}),Object.defineProperty(this,"_lastMeshTransform",{value:{},configurable:!0,writable:!0,enumerable:!1}),arguments.length>1&&(0,a.eF)(u.A.getLogger(this),"Graphic",{version:"4.30"})}initialize(){this._watchMeshGeometryChanges()}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),"mesh"!==e?.type&&this._notifyLayer("geometry",t,e))}set popupTemplate(e){const t=this._get("popupTemplate");t!==e&&(this._set("popupTemplate",e),this._notifyLayer("popupTemplate",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}get version(){return this._version}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new i({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const r of[t,this.sourceLayer,this.layer])if(r&&"object"==typeof r){if("popupTemplate"in r&&r.popupTemplate)return r.popupTemplate;if(e&&"defaultPopupTemplate"in r&&null!=r.defaultPopupTemplate)return r.defaultPopupTemplate}return null}getAttribute(e){return this.attributes?.[e]}setAttribute(e,t){if(this.attributes){const r=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",r,t,e)}else this.attributes={[e]:t}}getObjectId(){const e=this.sourceLayer??this.layer;return e?(0,g.r)(this,e):null}getGlobalId(){const e=this.sourceLayer??this.layer;return e&&"globalIdField"in e&&e.globalIdField?this.getAttribute(e.globalIdField):null}toJSON(){return{aggregateGeometries:_(this.aggregateGeometries),geometry:null!=this.geometry?this.geometry.toJSON():null,symbol:null!=this.symbol?this.symbol.toJSON():null,attributes:(0,h.W)(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:this.popupTemplate?.toJSON()??null}}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if("mesh"===t?.type){const r={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",r,r,e.action)}}_notifyLayer(e,t,r,i){if(this._version++,!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:e,oldValue:t,newValue:r};"origin-transform"===e&&(n.action=i),"attributes"===e&&(n.attributeName=i),this.layer.graphicChanged(n)}_watchMeshGeometryChanges(){this.addHandles([(0,p.z7)(()=>"mesh"===this.geometry?.type&&this.geometry.vertexSpace.origin?{localMatrix:this.geometry.transform?.localMatrix,origin:this.geometry.vertexSpace.origin}:void 0,({localMatrix:e,origin:t})=>{this._lastMeshTransform.localMatrix===e&&this._lastMeshTransform.origin===t||(this._lastMeshTransform.localMatrix=e,this._lastMeshTransform.origin=t,this.notifyMeshTransformChanged())}),(0,p.z7)(()=>"mesh"===this.geometry?.type?{vertexAttributes:this.geometry.vertexAttributes}:void 0,()=>{const e=this.geometry;"mesh"===e?.type&&e.vertexSpace.origin?(this._lastMeshTransform.localMatrix=e.transform?.localMatrix,this._lastMeshTransform.origin=e.vertexSpace.origin):(this._lastMeshTransform.localMatrix=void 0,this._lastMeshTransform.origin=void 0),this._notifyLayer("geometry",this.geometry,this.geometry)},{equals:(e,t)=>e===t,sync:!0})])}};(0,n.Cg)([(0,d.MZ)({value:null,json:{read:function(e){if(!e)return null;const t={};for(const r in e){const i=(0,f.rS)(e[r]);i&&(t[r]=i)}return 0!==Object.keys(t).length?t:null}}})],T.prototype,"aggregateGeometries",null),(0,n.Cg)([(0,d.MZ)({value:null})],T.prototype,"attributes",null),(0,n.Cg)([(0,d.MZ)({value:null,types:y.yR,json:{read:f.rS}})],T.prototype,"geometry",null),(0,n.Cg)([(0,d.MZ)({type:Boolean})],T.prototype,"isAggregate",void 0),(0,n.Cg)([(0,d.MZ)({clonable:!1})],T.prototype,"layer",void 0),(0,n.Cg)([(0,d.MZ)({clonable:"reference"})],T.prototype,"origin",void 0),(0,n.Cg)([(0,d.MZ)({type:s.A,value:null})],T.prototype,"popupTemplate",null),(0,n.Cg)([(0,d.MZ)({clonable:"reference"})],T.prototype,"sourceLayer",void 0),(0,n.Cg)([(0,d.MZ)({value:null,types:b.Es})],T.prototype,"symbol",null),(0,n.Cg)([(0,d.MZ)({clonable:!1,json:{read:!1,write:!1}})],T.prototype,"_version",void 0),(0,n.Cg)([(0,d.MZ)({type:Boolean,value:!0})],T.prototype,"visible",null),T=i=(0,n.Cg)([(0,m.$)("esri.Graphic")],T)},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 n(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:()=>n})},55674:(e,t,r)=>{r.d(t,{Ad:()=>m,Gj:()=>y,QY:()=>d,lL:()=>g,xR:()=>h});var i=r(66131),n=r(49186),s=(r(44208),r(44729)),o=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 m(e,t){return f.create(e,t,null,["$feature","$view"])}function h(e,t,r){return f.create(e,t,r,["$feature","$view","$config"])}class f{static async create(e,t,r,i){const{arcade:s,Dictionary:o}=await(0,u.l)();let a;try{a=s.parseScript(e)}catch(t){throw new n.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 o(r),d.immutable=!0);const m=new o;return m.immutable=!1,m.setField("scale",0),new f(e,s,a,c,t,m,d,o)}constructor(e,t,r,i,n,s,o,a){this.script=e,this._arcade=t,this._syntaxTree=r,this._compiled=i,this._spatialReference=n,this._viewDict=s,this._configDict=o,this._dictionaryCtor=a,this._dependencies=new Map,this._featureReader=new y,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:n,currentEnd:s}=t.$view.timeProperties;e=new this._dictionaryCtor({currentStart:null!=n?null!=r?i.lY.epochToArcadeDate(n,r):i.lY.unknownEpochToArcadeDate(n):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 y{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 o.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}},70328:(e,t,r)=>{r.d(t,{BI:()=>b,Ej:()=>d,Ie:()=>y,Jt:()=>g,Ne:()=>m,RF:()=>p,aI:()=>T,fA:()=>o,gE:()=>l,hZ:()=>f,iT:()=>c,is:()=>_,qv:()=>v,vI:()=>h,vY:()=>a,v_:()=>w,vt:()=>s,w1:()=>u});var i=r(5443),n=(r(19419),r(4197));function s(e=w){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t,r,i,n,o,a=s()){return a[0]=e,a[1]=t,a[2]=r,a[3]=i,a[4]=n,a[5]=o,a}function a(e,t=s()){return function(e,t,r,i=s()){return f(i,v),function(e,t,r=0,i=t.length/3){let n=e[0],s=e[1],o=e[2],a=e[3],l=e[4],u=e[5];for(let e=0;e<i;e++)n=Math.min(n,t[r+3*e]),s=Math.min(s,t[r+3*e+1]),o=Math.min(o,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]=n,e[1]=s,e[2]=o,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,n.jh)(24)){const[r,i,s,o,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]=o,t[13]=i,t[14]=s,t[15]=o,t[16]=i,t[17]=l,t[18]=o,t[19]=a,t[20]=s,t[21]=o,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[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 d(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 y(e){return e?f(e,v):s(v)}function g(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,n){return e[0]=t,e[1]=r,e[2]=Number.NEGATIVE_INFINITY,e[3]=i,e[4]=n,e[5]=Number.POSITIVE_INFINITY,e}function _(e){return 6===e.length}function T(e,t,r){if(null==e||null==t)return e===t;if(!_(e)||!_(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 v=[1/0,1/0,1/0,-1/0,-1/0,-1/0],w=[0,0,0,0,0,0];s()},73681:(e,t,r)=>{r.d(t,{n:()=>l});var i=r(49186),n=r(53966),s=r(46140),o=r(95466),a=r(55674);class l{static async from(e,t,r){const o=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&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("missing-fields: fieldMap entries for the following symbol fields are missing",{symbolFields:d});const m=await(0,a.xR)(e.expression,null,c);if(!m)throw new i.A("dictionary-renderer:expression-error","Unable to create dictionary renderer expression");const h=!o||!o.greaterEqual(4,0);h&&n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("Dictionary script does not support native field types. Applying fallback",{version:o});const f=new u(r,h);return new l(h,p,m,f)}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){n.A.getLogger("esri.renderers.support.DictionaryScriptEvaluator").warnOnce("arcade: dictionary script evaluation failed",{error:e})}return null}createDictionaryFieldsIndex(e){if(!this._requiresFieldCoercionToString)return new o.A(e);const t=e.map(e=>({...e,type:"esriFieldTypeString"}));return new o.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]}}},95466:(e,t,r)=>{r.d(t,{A:()=>m});var i=r(49186),n=r(53966),s=r(91869),o=r(3330),a=r(12195),l=r(30524),u=r(98623),p=r(56400),c=r(96285);const d=new Map;class m{static fromJSON(e){return new m(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new m(e.fields??[],g(e))}static fromLayerJSON(e){return new m(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=f(t);if(t&&i){const n=h(t);this._fieldsMap.set(t,e),this._fieldsMap.set(n,e),this._normalizedFieldsMap.set(i,e),r.push(`${n}:${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(h(e))??this._normalizedFieldsMap.get(f(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?(n.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new i.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):y.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?o.GB.instance:t===u.n$?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 h(e){return e.trim().toLowerCase()}function f(e){return(0,l.rS)(e)?.toLowerCase()??""}const y=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:n}=e,s=(i?"startField"in i?i.startField:i.startTimeField:"")??"",o=(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=n?function(e){return"timeZone"in e}(n)?n.timeZone??a:n.dateFieldsTimeReference?(0,p.ZS)(n.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([[h(n?.creationDateField??""),l],[h(n?.editDateField??""),l],[h(s),c],[h(o),c]]);for(const{name:i,type:n}of e.fields)if(y.has(n))t.set(i,u.L5);else if("date"!==n&&"esriFieldTypeDate"!==n)t.set(i,null);else if(r)t.set(i,u.L5);else{const e=d.get(h(i??""))??a;t.set(i,e)}return t}}}]);