@arcgis/core 5.0.0-next.5 → 5.0.0-next.7
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.
- package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/020c8913d8e35d63080b.js +1 -0
- package/assets/esri/core/workers/chunks/{c2b47a7dc961863d283f.js → 02e69f0c63d97661da60.js} +1 -1
- package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +1 -0
- package/assets/esri/core/workers/chunks/{929ece362604dc301229.js → 17acde0245ecd956306c.js} +1 -1
- package/assets/esri/core/workers/chunks/{8cea114168d849c38b1b.js → 20278683bddc8c2d8136.js} +1 -1
- package/assets/esri/core/workers/chunks/{dc4982b0ac007bd70213.js → 22d6b8102e75bdef204c.js} +1 -1
- package/assets/esri/core/workers/chunks/{3271614322ba4b44fb5a.js → 279366e6b743f9680603.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 3ac7562ea90f91a9f30c.js} +1 -1
- package/assets/esri/core/workers/chunks/3f3d492f1093b7832aab.js +1 -0
- package/assets/esri/core/workers/chunks/464d42bebb365287808d.js +1 -0
- package/assets/esri/core/workers/chunks/{d570c75a425aa29672c8.js → 4d599008e1ea42321b37.js} +1 -1
- package/assets/esri/core/workers/chunks/{0686243904381ef863dc.js → 53bd8996e8812f1ad7b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{762fe93015b705546188.js → 5bd36dbf46c25bd961c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{b7a17927e14f502006b4.js → 5ea0c62016d56990787b.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ea6985da4eb0107bb9d.js → 5fc7b61f467f1d60a284.js} +1 -1
- package/assets/esri/core/workers/chunks/{a87521ebe632bf783ef4.js → 62a49cfd9a2508950e9f.js} +1 -1
- package/assets/esri/core/workers/chunks/{ec13053af1999701464a.js → 6826fe54562dcdc054d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{309c5f69ea06f3081d83.js → 73487b9d85e726e9c012.js} +1 -1
- package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +1 -0
- package/assets/esri/core/workers/chunks/{88d942cd25bef74fd50a.js → 7461124454bfb4fb6474.js} +1 -1
- package/assets/esri/core/workers/chunks/{147ad5fdd02f46b6da24.js → 7544316a75dbd981aea6.js} +1 -1
- package/assets/esri/core/workers/chunks/{0f8847f9ae3068833fa4.js → 75bf27271a31e26e1b21.js} +1 -1
- package/assets/esri/core/workers/chunks/{630efe10c871425b6a95.js → 76ae1702fecc7ad7017c.js} +1 -1
- package/assets/esri/core/workers/chunks/{de1f75c907152df7e788.js → 794748fd1edc29a621cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{e1258b6a404e58878c7a.js → 7aaaebbabee27690283c.js} +1 -1
- package/assets/esri/core/workers/chunks/{6a69dafeb7c9ca8a3d84.js → 7c4a63aeead2505d6f02.js} +1 -1
- package/assets/esri/core/workers/chunks/{d84373a6ec94dcfec8c2.js → 88074189fa10c335370b.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8c4fd779e454e4075c4.js → 8833c3d168951be4bf20.js} +1 -1
- package/assets/esri/core/workers/chunks/{85622fe99f4d08afe875.js → 8a314b3790313e6dc5db.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0b2670596d6d8c32b5e.js → 8c056eac35d05d9524b7.js} +1 -1
- package/assets/esri/core/workers/chunks/{1a713dcc9971e1935401.js → 8f56f298e7c1a283f407.js} +1 -1
- package/assets/esri/core/workers/chunks/{dabc5a38a472c9719df9.js → 8ffd4710d168c2fcfd96.js} +1 -1
- package/assets/esri/core/workers/chunks/{1da74aa308ded5748ef5.js → 90250e9239c173aace88.js} +1 -1
- package/assets/esri/core/workers/chunks/90b2b43b8b54c9a1ec35.js +1 -0
- package/assets/esri/core/workers/chunks/90f8b4bda28af43ea019.js +1 -0
- package/assets/esri/core/workers/chunks/{89027f6800e17fab8973.js → 9486032af3e934d85582.js} +1 -1
- package/assets/esri/core/workers/chunks/95c594a87b732f5c4979.js +1 -0
- package/assets/esri/core/workers/chunks/{239377336a2009caea01.js → 99859dce1925b406ccd0.js} +1 -1
- package/assets/esri/core/workers/chunks/{a137c27ce078bea44f89.js → 9e8dceef4c961f56940d.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5b7e7f2860a825ed373.js → 9fac5a12e878cd745354.js} +1 -1
- package/assets/esri/core/workers/chunks/{f779034623980bf9a37c.js → a06bac9b8f9e18874de8.js} +2 -2
- package/assets/esri/core/workers/chunks/{01642fe19e81bfa33eb5.js → a395373e3173e6458a56.js} +1 -1
- package/assets/esri/core/workers/chunks/a3991ae8caa713d4ddcd.js +1 -0
- package/assets/esri/core/workers/chunks/{a6ac1ff89c40f3a4797a.js → a712cdff78fc826acd8c.js} +1 -1
- package/assets/esri/core/workers/chunks/{af3fc2562bb6d217adf6.js → aa54b6f2aba6952af149.js} +1 -1
- package/assets/esri/core/workers/chunks/ac26e3e77df4302f47a2.js +1 -0
- package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
- package/assets/esri/core/workers/chunks/{bc3bcf88b252760e2574.js → b3028b1ff75eafd0c358.js} +1 -1
- package/assets/esri/core/workers/chunks/{5875a51b97ee9bd438a0.js → bc241c7735e4efba734a.js} +1 -1
- package/assets/esri/core/workers/chunks/{56916e56c20465428dd4.js → be3b874f86f627f4fa98.js} +1 -1
- package/assets/esri/core/workers/chunks/c4e4da69969499a89a2c.js +1 -0
- package/assets/esri/core/workers/chunks/c8733cd621105afab2ac.js +1 -0
- package/assets/esri/core/workers/chunks/ccc0da0e01f023c8aa1f.js +1 -0
- package/assets/esri/core/workers/chunks/{c0b7e86860838638537f.js → cd1930f08e1fc8b30b14.js} +1 -1
- package/assets/esri/core/workers/chunks/{551c6c89b51b99f4864b.js → d1fe816b6990918c13c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{8605ec4678eb4511c715.js → d305a21666b1ed5bf33d.js} +1 -1
- package/assets/esri/core/workers/chunks/{037b2548bf85e2d7c6ac.js → d40f57f9fc47f9a9f97c.js} +1 -1
- package/assets/esri/core/workers/chunks/{a29d7205394cb8b2a847.js → d97fadbc69e055d183a0.js} +1 -1
- package/assets/esri/core/workers/chunks/dedc4583b5f32a278124.js +1 -0
- package/assets/esri/core/workers/chunks/{e5bcc44f3dc6fc90835a.js → e5a06ce0ef6a9a90e100.js} +1 -1
- package/assets/esri/core/workers/chunks/f0e0a63962784acb4ba1.js +1 -0
- package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +1 -0
- package/assets/esri/core/workers/chunks/{7c5c272612198db83851.js → f5e47eea8720ba84665b.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa4411e0a5ac3fcba365.js → f65c0102af17390a50ac.js} +1 -1
- package/assets/esri/core/workers/chunks/f6c11c8ac687de3ef1ab.js +1 -0
- package/assets/esri/core/workers/chunks/{7596d005a4dc3964b140.js → f6c8beb60f6d29945a2e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a2a284d4dd5caaecbc2e.js → f746e3f7ebff2bbdf333.js} +1 -1
- package/assets/esri/core/workers/chunks/f9324e88c359c03f35aa.js +1 -0
- package/assets/esri/core/workers/chunks/{cfa3164e7fa1884dc2b9.js → facb3886714222772ab2.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa6eb55e4fb57c4e8eeb.js → fd2efd1d1cf9d95a87e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe3f95fda29e4844b153.js → fe77ae6cf232a7a3298e.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ce4a0fe4fae63c43a81.js → ff35a077ac6776469805.js} +1 -1
- package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/config.js +1 -1
- package/core/Identifiable.js +1 -1
- package/core/MultiOriginJSONSupport.js +1 -1
- package/core/NumericIdentifiable.js +5 -0
- package/core/WriteableMultiOriginJSONMixin.js +5 -0
- package/core/performance.js +5 -0
- package/core/scheduling.js +1 -1
- package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
- package/interfaces.d.ts +18 -2
- package/kernel.js +1 -1
- package/layers/support/MediaElementBase.js +1 -1
- package/layers/support/fieldUtils.js +1 -1
- package/package.json +3 -3
- package/support/basemapDefinitions.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/constraints/GeometryConstraint.js +1 -1
- package/views/2d/constraints/RotationConstraint.js +1 -1
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
- package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
- package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/analysis/ElevationProfile/constants.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/widgets/Attachments/AttachmentsViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/Search/LayerSearchSource.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/assets/esri/core/workers/chunks/0366b78b0ccf4ed5f6ac.js +0 -1
- package/assets/esri/core/workers/chunks/0429c1a3690f20647c9f.js +0 -1
- package/assets/esri/core/workers/chunks/0f100e163e1847e04155.js +0 -1
- package/assets/esri/core/workers/chunks/1eedac33c9fcd7681427.js +0 -1
- package/assets/esri/core/workers/chunks/2f03d33f4ca8a48461fc.js +0 -1
- package/assets/esri/core/workers/chunks/50864c1924030e62497d.js +0 -1
- package/assets/esri/core/workers/chunks/655360995c1cbc78a5a3.js +0 -1
- package/assets/esri/core/workers/chunks/71762199aef5d3107da2.js +0 -1
- package/assets/esri/core/workers/chunks/72c851c400752094b162.js +0 -1
- package/assets/esri/core/workers/chunks/7558919912f7fdc4837b.js +0 -1
- package/assets/esri/core/workers/chunks/829bc5dbda2f51561446.js +0 -1
- package/assets/esri/core/workers/chunks/98311fec6c16a1b23586.js +0 -1
- package/assets/esri/core/workers/chunks/a61cb4f1ca282bf8b75d.js +0 -1
- package/assets/esri/core/workers/chunks/bc6619307f312f9241bf.js +0 -1
- package/assets/esri/core/workers/chunks/bfc1e8aec7aace3ff30e.js +0 -1
- package/assets/esri/core/workers/chunks/c134ebbaeac514cbd657.js +0 -1
- package/assets/esri/core/workers/chunks/c368a8e8d2f1535af446.js +0 -1
- package/assets/esri/core/workers/chunks/d886fb97bdb348a16f25.js +0 -1
- package/assets/esri/core/workers/chunks/e6a86cad44056735ed26.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[588,7548,8207],{4146:(e,t,i)=>{i.d(t,{A:()=>_});var r=i(31635),s=i(78888),n=i(49186),a=i(65529),l=i(4902),o=i(92474),h=i(53966),u=i(74887),c=i(84952),d=i(10107),p=(i(44208),i(87811),i(64108)),f=i(5443),y=i(16930),g=i(92602),m=i(79677);let v=0,_=class extends((0,a.Zt)((0,l.s)(o.x_))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.A(-180,-90,180,90,y.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+v++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await Promise.all([i.e(812),i.e(7982)]).then(i.bind(i,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:r}=await Promise.all([i.e(812),i.e(5613),i.e(5710)]).then(i.bind(i,45613));try{return await r(t)}catch(e){const i=t?.portalItem,r=i?.id||"unset",s=i?.portal?.url||g.A.portalUrl;throw h.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+r+"')",e),e}}(e)}initialize(){this.when().catch(e=>{(0,u.zf)(e)||h.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const{parent:e}=this;e&&(this.parent=null,e.removeChildLayer?.(this))}get effectiveVisible(){return this.visible&&(this.parent?.effectiveVisible??!0)}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}removeFromParent(){const{parent:e}=this;e&&(e.removeChildLayer?.(this),this.parent=null)}get parsedUrl(){return(0,c.An)(this.url)}createLayerView(e,t){return Promise.reject(new n.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,s.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new n.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,r.Cg)([(0,d.MZ)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],_.prototype,"effectiveVisible",null),(0,r.Cg)([(0,d.MZ)({type:f.A})],_.prototype,"fullExtent",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,r.Cg)([(0,d.MZ)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,d.MZ)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,r.Cg)([(0,d.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,r.Cg)([(0,d.MZ)({clonable:!1})],_.prototype,"parent",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,r.Cg)([(0,d.MZ)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,r.Cg)([(0,d.MZ)({type:y.A})],_.prototype,"spatialReference",void 0),(0,r.Cg)([(0,d.MZ)({type:String})],_.prototype,"title",void 0),(0,r.Cg)([(0,d.MZ)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,r.Cg)([(0,d.MZ)()],_.prototype,"url",void 0),(0,r.Cg)([(0,d.MZ)({type:m.A})],_.prototype,"visibilityTimeExtent",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,r.Cg)([(0,p.$)("esri.layers.Layer")],_)},4902:(e,t,i)=>{i.d(t,{s:()=>a});var r=i(31635),s=i(64108);let n=0;const a=e=>{const t=e;let i=class extends t{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n++})}};return i=(0,r.Cg)([(0,s.$)("esri.core.Identifiable")],i),i};a(class{})},8303:(e,t,i)=>{i.d(t,{A:()=>C});var r=i(31635),s=i(92602),n=i(70333),a=i(78888),l=i(60999),o=i(49186),h=i(53966),u=i(97768),c=i(74887),d=i(84952),p=i(10107),f=(i(44208),i(87811),i(36005)),y=i(64108),g=i(43937),m=i(77548),v=i(20655),_=i(80812),w=i(41318),b=i(10407);const C=e=>{const t=e;let C=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,u.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new _.default({id:t.itemId,portal:i?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:r}=await i.e(1204).then(i.bind(i,41204));return(0,c.Te)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap,populateGroupLayer:e.populateGroupLayer},t)}catch(e){throw(0,c.zf)(e)||h.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch(e=>((0,c.QP)(e),!0)))}async setUserPrivileges(e,t){if(!s.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:i,fullEdit:r},content:{updateItem:s}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",s)}catch(e){(0,c.QP)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=!n.id?.findCredential(this.url),s=e===i.id;if(s&&i.portal.user)return this._getUserPrivileges(i,r);let a,l;if(s)a=i.portal.url;else try{a=await(0,m.wI)(this.url,t)}catch(e){(0,c.QP)(e)}if(!a||!(0,d.b8)(a,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;l=await(n.id?.getCredential(`${a}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.QP)(e)}const o=!0,h=!1,u=!1;if(!l)return{features:{edit:o,fullEdit:h},content:{updateItem:u}};try{if(s?await i.reload():(i=new _.default({id:e,portal:{url:a}}),await i.load(t)),i.portal.user)return this._getUserPrivileges(i,r)}catch(e){(0,c.QP)(e)}return{features:{edit:o,fullEdit:h},content:{updateItem:u}}}_getUserPrivileges(e,t){const i=(0,b.It)(e);return t&&(i.features.edit=!0),i}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const i=M.credential===t?M.user:await this._fetchEditingUser(e);return M.credential=t,M.user=i,null==i?.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=n.id?.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,s=v.A.getDefault();if(s&&s.loaded&&(0,d.S8)(s.restUrl)===(0,d.S8)(r))return s.user;const o=`${r}/community/self`,h=null!=e?e.signal:null,u=await(0,l.Ke)((0,a.A)(o,{authMode:"no-prompt",query:{f:"json"},signal:h}));return u.ok?w.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t?.portal,r=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return i&&r&&!(0,d.ut)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new o.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r.Cg)([(0,p.MZ)({type:_.default})],C.prototype,"portalItem",null),(0,r.Cg)([(0,f.w)("web-document","portalItem",["itemId"])],C.prototype,"readPortalItem",null),(0,r.Cg)([(0,g.K)("web-document","portalItem",{itemId:{type:String}})],C.prototype,"writePortalItem",null),(0,r.Cg)([(0,p.MZ)({clonable:!1})],C.prototype,"resourceReferences",void 0),(0,r.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],C.prototype,"userHasEditingPrivileges",void 0),(0,r.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],C.prototype,"userHasFullEditingPrivileges",void 0),(0,r.Cg)([(0,p.MZ)({type:Boolean,readOnly:!0})],C.prototype,"userHasUpdateItemPrivileges",void 0),C=(0,r.Cg)([(0,y.$)("esri.layers.mixins.PortalLayer")],C),C},M={credential:null,user:null}},10407:(e,t,i)=>{i.d(t,{It:()=>p,LG:()=>a,OM:()=>h,Sm:()=>u,Y:()=>l,bK:()=>o,mm:()=>d,sQ:()=>c});var r=i(91218),s=i(16930),n=i(28735);function a(e,t){if(!l(e,t)){const i=e.typeKeywords;i?i.push(t):e.typeKeywords=[t]}}function l(e,t){return!!e.typeKeywords?.includes(t)}function o(e){return l(e,d.HOSTED_SERVICE)}function h(e,t){const i=e.typeKeywords;if(i){const e=i.indexOf(t);e>-1&&i.splice(e,1)}}function u(e,t,i){i?a(e,t):h(e,t)}async function c(e){const t=e.clone().normalize();let i;if(t.length>1)for(const e of t)i?e.width>i.width&&(i=e):i=e;else i=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 i=s.A.WGS84;return await(0,r.initializeProjection)(t,i),(0,r.project)(e,i)}(i)}const d={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 p(e){const{portal:t,isOrgItem:i,itemControl:r}=e,s=t.user?.privileges;let n=!s||s.includes("features:user:edit"),a=!!i&&!!s?.includes("features:user:fullEdit");const l="update"===r||"admin"===r;return l?a=n=!0:a&&(n=!0),{features:{edit:n,fullEdit:a},content:{updateItem:l}}}},16215:(e,t,i)=>{i.d(t,{S:()=>s,Y:()=>r});const r=Symbol("BasemapInstance");function s(e){return null!=e&&"object"==typeof e&&r in e}},18768:(e,t,i)=>{i.d(t,{b:()=>o});var r=i(31635),s=i(53966),n=i(10107),a=(i(44208),i(87811),i(64108)),l=i(60694);const o=e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Jf)(e,s.A.getLogger(this)))}};return(0,r.Cg)([(0,n.MZ)()],i.prototype,"title",null),(0,r.Cg)([(0,n.MZ)({type:String})],i.prototype,"url",null),i=(0,r.Cg)([(0,a.$)("esri.layers.mixins.ArcGISService")],i),i}},25943:(e,t,i)=>{i.d(t,{d:()=>S});var r,s=i(31635),n=i(78888),a=i(69622),l=i(49186),o=i(36563),h=(i(44208),i(66344)),u=i(15142),c=i(74887),d=i(36708),p=i(76030),f=i(84952),y=i(10107),g=(i(53966),i(87811),i(64108)),m=i(72802),v=i(4718),_=i(69397),w=i(34275);class b{constructor(e){!function(e){if(!e?.location)throw new l.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new l.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new l.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new l.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new l.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);const{location:t,data:i}=e;this.location=Object.freeze((0,v.o8)(t));const r=this.location.width,s=this.location.height;let n=!0,a=!0;const o=function(e,t=!1){return e<=w.y9?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(r*s/32));let h=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(a=!1,o[h]|=1<<t):n=!1,31===t&&++h}a?(this._availability="unavailable",this.byteSize=40):n?(this._availability="available",this.byteSize=40):(this._availability=o,this.byteSize=40+(0,_.Qf)(o))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),r=i%32,s=i>>5,n=this._availability;return s<0||s>n.length?"unknown":n[s]&1<<r?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||n.A,{row:r,col:s,width:a,height:o}=e,h={query:{f:"json"}};return t=t?{...h,...t}:h,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:r,left:s,width:a,height:o},valid:!0,data:new Array(a*o).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==r||e.location.left!==s||e.location.width!==a||e.location.height!==o))throw new l.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:r,left:s,width:a,height:o}});return b.fromJSON(e)})}static fromJSON(e){return Object.freeze(new b(e))}}function C(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function M(e,t,i){return new l.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let S=class extends a.A{static{r=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=n.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new h.q(2097152),this.addHandles((0,d.wB)(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),d.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(M(e,t,i)):this._fetchTilemap(e,t,i,r).catch(e=>e).then(r=>{if(r instanceof b){const s=r.getAvailability(t,i);if("unavailable"===s)throw M(e,t,i);return s}if((0,c.zf)(r))throw r;return"unknown"})}fetchAvailabilityUpsample(e,t,i,r,s){r.level=e,r.row=t,r.col=i;const n=this.layer.tileInfo;n.updateTileInfo(r);const a=this.fetchAvailability(e,t,i,s).catch(e=>{if((0,c.zf)(e))throw e;if(n.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,s);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,s,a),a}async _fetchAvailabilityUpsamplePrefetch(e,t,i,s,n){if(!this._prefetchingEnabled)return;const a=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(a))return;const l=new AbortController;n.then(()=>l.abort(),()=>l.abort());let h=!1;const u=(0,o.hA)(()=>{h||(h=!0,l.abort())});if(this.addHandles(u,a),await(0,p.md)(10,l.signal).catch(()=>{}),h||(h=!0,this.removeHandles(a)),(0,c.G4)(l))return;const d=new m.U(e,t,i),f={...s,signal:l.signal},y=this.layer.tileInfo;for(let e=0;r._prefetches.length<r._maxPrefetch&&y.upsampleTile(d);++e){const e=this.fetchAvailability(d.level,d.row,d.col,f);r._prefetches.push(e);const t=()=>{r._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new u.A({initialSize:r._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,r){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new l.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const s=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,i,s);if(n)return Promise.resolve(n);const a=r?.signal;return r={...r,signal:null},new Promise((e,t)=>{(0,c.u7)(a,()=>t((0,c.NK)()));const i=C(s);let n=this._pendingTilemapRequests[i];if(!n){n=b.fromDefinition(s,r).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=n,n.then(e,e)}n.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,f.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;const s=C(r);return this._tilemapCache.get(s)}get test(){}};(0,s.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"layer",void 0),(0,s.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"minLOD",void 0),(0,s.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"maxLOD",void 0),(0,s.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"request",void 0),(0,s.Cg)([(0,y.MZ)({constructOnly:!0})],S.prototype,"size",void 0),S=r=(0,s.Cg)([(0,g.$)("esri.layers.support.TilemapCache")],S)},35982:(e,t,i)=>{i.d(t,{B:()=>o});var r=i(4576),s=i(36563),n=i(53966),a=i(74887),l=i(29953);class o{constructor(e,t,i,r,s={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=(0,l.ho)(e,{...s,schedule:r}).then(e=>{if(void 0===this._thread){this._thread=e,this._promise=null,s.hasInitialize&&this.broadcast({},"initialize");for(const e of this._listeners)this._connectListener(e)}else e.close()}),this._promise.catch(t=>n.A.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${t}`))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),(0,s.hA)(()=>{i.removed=!0,(0,r.TF)(this._listeners,i),this._thread&&null!=i.threadHandle&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t,i){return this.invokeMethod(this._mainMethod,e,t,i)}invokeMethod(e,t,i,r){if(this._thread){const s=this._transferLists[e],n=s?s(t):[];return this._thread.invoke(e,t,{transferList:n,signal:i,jobPriority:r})}return this._promise?this._promise.then(()=>((0,a.Te)(i),this.invokeMethod(e,t,i))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(h):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}}function h(){}},36708:(e,t,i)=>{i.d(t,{C_:()=>d,OH:()=>y,Vh:()=>g,on:()=>c,pc:()=>m,wB:()=>o,z7:()=>h});var r=i(37955),s=i(36563),n=i(97768),a=i(74887),l=i(14012);function o(e,t,i={}){return u(e,t,i,p)}function h(e,t,i={}){return u(e,t,i,f)}function u(e,t,i={},r){let s=null;const a=i.once?(e,i)=>{r(e)&&((0,n.xt)(s),t(e,i))}:(e,i)=>{r(e)&&t(e,i)};if(s=(0,l.Cn)(e,a,i.sync,i.equals),i.initial){const t=e();a(t,t)}return s}function c(e,t,i,a={}){let l=null,h=null,u=null;function c(){l&&h&&(h.remove(),a.onListenerRemove?.(l),l=null,h=null)}function d(e){a.once&&a.once&&(0,n.xt)(u),i(e)}const p=o(e,(e,i)=>{c(),(0,r.wb)(e)&&(l=e,h=(0,r.on)(e,t,d),a.onListenerAdd?.(e))},{sync:a.sync,initial:!0});return u=(0,s.hA)(()=>{p.remove(),c()}),u}function d(e,t){return function(e,t,i){if((0,a.G4)(i))return Promise.reject((0,a.NK)());const r=e();if(t?.(r))return Promise.resolve(r);let l=null;function o(){l=(0,n.xt)(l)}return new Promise((r,n)=>{l=(0,s.vE)([(0,a.u7)(i,()=>{o(),n((0,a.NK)())}),u(e,e=>{o(),r(e)},{sync:!1,once:!0},t??p)])})}(e,f,t)}function p(e){return!0}function f(e){return!!e}i(80559);const y={sync:!0},g={initial:!0},m={sync:!0,initial:!0}},54239:(e,t,i)=>{i.d(t,{A:()=>m});var r,s=i(31635),n=i(4576),a=i(66552),l=i(25482),o=i(83047),h=i(67076),u=i(10107),c=(i(44208),i(53966),i(36005)),d=i(64108),p=i(43937);const f=(0,a.O)()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),y=f.jsonValues.slice();(0,n.Xy)(y,"orthometric");const g=(0,a.O)()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let m=r=class extends l.o{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return f.write(e,t,i)}readHeightModel(e,t,i){return f.read(e)||(i?.messages&&i.messages.push(function(e,t){return new h.A("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}(e,{context:i})),null)}readHeightUnit(e,t,i){return g.read(e)||(i?.messages&&i.messages.push(v(e,{context:i})),null)}readHeightUnitService(e,t,i){return(0,o.LA)(e)||g.read(e)||(i?.messages&&i.messages.push(v(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new r({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=(0,o.k1)(t);return new r({heightModel:e.heightModel,heightUnit:i??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new r;return t.read(e,{origin:"web-scene"}),t}};function v(e,t){return new h.A("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}(0,s.Cg)([(0,u.MZ)({type:f.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:y,default:"ellipsoidal",write:{isRequired:!0}}}}})],m.prototype,"heightModel",void 0),(0,s.Cg)([(0,p.K)("web-scene","heightModel")],m.prototype,"writeHeightModel",null),(0,s.Cg)([(0,c.w)(["web-scene","service"],"heightModel")],m.prototype,"readHeightModel",null),(0,s.Cg)([(0,u.MZ)({type:g.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g.jsonValues,write:{writer:g.write,isRequired:!0}}}}})],m.prototype,"heightUnit",void 0),(0,s.Cg)([(0,c.w)("web-scene","heightUnit")],m.prototype,"readHeightUnit",null),(0,s.Cg)([(0,c.w)("service","heightUnit")],m.prototype,"readHeightUnitService",null),(0,s.Cg)([(0,u.MZ)({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],m.prototype,"vertCRS",void 0),(0,s.Cg)([(0,c.w)("service","vertCRS",["vertCRS","ellipsoid","geoid"])],m.prototype,"readVertCRS",null),m=r=(0,s.Cg)([(0,d.$)("esri.geometry.HeightModelInfo")],m)},60999:(e,t,i)=>{i.d(t,{DZ:()=>f,Ke:()=>p,Tj:()=>u,UT:()=>y,aD:()=>m,jJ:()=>h});var r=i(31635),s=i(69622),n=i(97768),a=i(74887),l=i(10107),o=i(64108);function h(e,t,i){return(0,a.Lx)(e.map((e,r)=>t.apply(i,[e,r])))}async function u(e,t,i){return(await(0,a.Lx)(e.map((e,r)=>t.apply(i,[e,r])))).map(e=>e.value)}function c(e){return{ok:!0,value:e}}function d(e){return{ok:!1,error:e}}async function p(e){if(null==e)return{ok:!1,error:new Error("no promise provided")};try{return c(await e)}catch(e){return d(e)}}async function f(e){try{return c(await e)}catch(e){return(0,a.QP)(e),d(e)}}function y(e,t){return new g(e,t)}let g=class extends s.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:i}=this._abortController;this.promise=e(i),this.promise.then(e=>{this._result=c(e),this._cleanup()},e=>{this._result=d(e),this._cleanup()}),this._abortHandle=(0,a.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.xt)(this._abortHandle),this._abortController=null}};(0,r.Cg)([(0,l.MZ)()],g.prototype,"value",null),(0,r.Cg)([(0,l.MZ)()],g.prototype,"error",null),(0,r.Cg)([(0,l.MZ)()],g.prototype,"finished",null),(0,r.Cg)([(0,l.MZ)()],g.prototype,"promise",void 0),(0,r.Cg)([(0,l.MZ)()],g.prototype,"_result",void 0),g=(0,r.Cg)([(0,o.$)("esri.core.asyncUtils.ReactiveTask")],g);class m{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});const t=await e;return{[Symbol.dispose]:t}}async run(e){const t={stack:[],error:void 0,hasError:!1};try{return(0,r.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,r.hk)(t)}}}},66344:(e,t,i)=>{i.d(t,{q:()=>l});const r=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class s{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._users=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._users.clear(),this._db=null}register(e){this._users.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._users.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const i=this._db.get(e.id+t);return i?.size??0}put(e,t,i,s,a){t=e.id+t;const l=this._db.get(t);if(l&&(this._size-=l.size,e.size-=l.size,this._db.delete(t),l.entry!==i&&this._notifyRemove(t,l.entry,l.size,0)),s>this._maxSize)return void this._notifyRemove(t,i,s,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return r||console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,i,0,0);const o=1+Math.max(a,-4)- -3;this._db.set(t,new n(i,s,o)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t){t=e.id+t;const i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let r=i.entry.usedMemory;for(;r>this._maxSize;){const e=this._notifyRemove(t,i.entry,r,1);if(!(null!=e&&e>0))return void this._db.delete(t);r=e}i.size=r,this._size+=r,e.size+=r,this._checkSize()}pop(e,t){t=e.id+t;const i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;const i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=new Array;this._db.forEach((e,r)=>{const s=e.lifetime;i[s]=(i[s]||0)+e.size,this._users.forEach(i=>{const{id:s,name:n}=i;if(r.startsWith(s)){const i=t[n]||0;t[n]=i+e.size}})});const r={};this._users.forEach(e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){const s=t[i]||0;t[i]=s,r[i]=Math.round(100*e.hitRate)+"%"}else r[i]="0%"});const s=Object.keys(t);s.sort((e,i)=>t[i]-t[e]),s.forEach(i=>e[i]=Math.round(t[i]/2**20)+"MB / "+r[i]);for(let t=i.length-1;t>=0;--t){const r=i[t];r&&(e["Priority "+(t+-3-1)]=Math.round(r/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forEach(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._users.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(const[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,r){const s=this._users.get(e.split(a)[0])?.removeFunc,n=s?.(t,r,i);return"number"==typeof n?n:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._checkSizeLimits(this.maxSize)}setMaxSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){const i=t??this;if(i.size<=e)return;const r=t?.id;let s=!0;for(;s;){s=!1;for(const[n,l]of this._db)if(0===l.lifetime&&(!r||n.startsWith(r))){const r=t??this._users.get(n.split(a)[0]);if(this._purgeItem(n,l,r),i.size<=.9*e)return;s||=this._db.has(n)}}for(const[s,n]of this._db)if(!r||s.startsWith(r)){const r=t??this._users.get(s.split(a)[0]);if(this._purgeItem(s,n,r),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const r=this._notifyRemove(e,t.entry,t.size,1);null!=r&&r>0&&(this._size+=r,i&&(i.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new s(0);class n{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const a=":";class l{constructor(e,t){this.removeFunc=t,this._storage=new s,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy(),this._storage=null}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},68611:(e,t,i)=>{i.r(t),i.d(t,{default:()=>T});var r=i(31635),s=i(78888),n=i(49186),a=i(97768),l=i(25728),o=i(74887),h=i(84952),u=i(10107),c=(i(44208),i(53966),i(87811),i(36005)),d=i(64108),p=i(54239),f=i(4146),y=i(89186),g=i(18768),m=i(16131),v=i(8303),_=i(10873);class w{constructor(e,t,i,r){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=r)}get hasNoDataValues(){if(null==this._hasNoDataValues){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}get usedMemory(){return this.values.byteLength+256}_ensureBounds(){if(null!=this._minValue)return;const{noDataValue:e,values:t}=this;let i=1/0,r=-1/0,s=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=n<i?n:i,r=n>r?n:r,s=!1);s?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=r>-3e38?r:0)}}var b=i(35982);class C extends b.B{constructor(e=null){super("LercWorker","_decode",{_decode:e=>[e.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&0!==e.byteLength?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(M.forEach((e,t)=>{e===this&&M.delete(t)}),this.destroy())}}const M=new Map;let S=class extends((0,y.f)((0,g.b)((0,m.q)((0,v.A)((0,l.P)(f.A)))))){constructor(...e){super(...e),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=function(e=null){let t=M.get(e);return t||(null!=e?(t=new C(t=>e.immediate.schedule(t)),M.set(e,t)):(t=new C,M.set(null,t))),++t.ref,t}()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._lercDecoder=(0,a.Gz)(this._lercDecoder)}readCapabilities(e,t){const i=t.capabilities&&t.capabilities.split(",").map(e=>e.toLowerCase().trim());return i?{operations:{supportsTileMap:i.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(e,t){let i=t.currentVersion;return i||(i=9.3),i}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:e=>{if(e.typeKeywords)for(let t=0;t<e.typeKeywords.length;t++)if("elevation 3d layer"===e.typeKeywords[t].toLowerCase())return!0;throw new n.A("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}' ",{type:"Image Service",expectedType:"Image Service Elevation 3D Layer"})}},e).catch(o.QP).then(()=>this._fetchImageService(t))),Promise.resolve(this)}fetchTile(e,t,i,r){const n=r?.signal,a={responseType:"array-buffer",signal:n},l={noDataValue:r?.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(e,t,i,r)).then(()=>(0,s.A)(this.getTileUrl(e,t,i),a)).then(e=>this._lercDecoder.decode(e.data,l,n)).then(e=>new w(e))}getTileUrl(e,t,i){const r=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,s=(0,h.x0)({...this.parsedUrl.query,blankTile:!r&&null});return`${this.parsedUrl.path}/tile/${e}/${t}/${i}${s?"?"+s:""}`}async queryElevation(e,t){const{query:r}=await i.e(4375).then(i.bind(i,94375));return(0,o.Te)(t),r(this,e,t)}async createElevationSampler(e,t){const{createSampler:r}=await i.e(4375).then(i.bind(i,94375));return(0,o.Te)(t),r(this,e,t)}_fetchTileAvailability(e,t,i,r){return this.tilemapCache?this.tilemapCache.fetchAvailability(e,t,i,r):Promise.resolve("unknown")}async _fetchImageService(e){if(this.sourceJSON)return this.sourceJSON;const t={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:e},i=await(0,s.A)(this.parsedUrl.path,t);i.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=i.data,this.read(i.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[A]}};(0,r.Cg)([(0,u.MZ)({readOnly:!0})],S.prototype,"capabilities",void 0),(0,r.Cg)([(0,c.w)("service","capabilities",["capabilities"])],S.prototype,"readCapabilities",null),(0,r.Cg)([(0,u.MZ)({json:{read:{source:"copyrightText"}}})],S.prototype,"copyright",void 0),(0,r.Cg)([(0,u.MZ)({readOnly:!0,type:p.A})],S.prototype,"heightModelInfo",void 0),(0,r.Cg)([(0,u.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],S.prototype,"path",void 0),(0,r.Cg)([(0,u.MZ)({type:["show","hide"]})],S.prototype,"listMode",void 0),(0,r.Cg)([(0,u.MZ)({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],S.prototype,"minScale",void 0),(0,r.Cg)([(0,u.MZ)({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],S.prototype,"maxScale",void 0),(0,r.Cg)([(0,u.MZ)({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],S.prototype,"opacity",void 0),(0,r.Cg)([(0,u.MZ)({type:["ArcGISTiledElevationServiceLayer"]})],S.prototype,"operationalLayerType",void 0),(0,r.Cg)([(0,u.MZ)()],S.prototype,"sourceJSON",void 0),(0,r.Cg)([(0,u.MZ)({json:{read:!1},value:"elevation",readOnly:!0})],S.prototype,"type",void 0),(0,r.Cg)([(0,u.MZ)(_.OZ)],S.prototype,"url",void 0),(0,r.Cg)([(0,u.MZ)()],S.prototype,"version",void 0),(0,r.Cg)([(0,c.w)("version",["currentVersion"])],S.prototype,"readVersion",null),S=(0,r.Cg)([(0,d.$)("esri.layers.ElevationLayer")],S);const A=Symbol("default-fetch-tile");S.prototype.fetchTile[A]=!0;const T=S},69397:(e,t,i)=>{i.d(t,{$B:()=>s,Qf:()=>h,Qh:()=>l,RS:()=>n,ez:()=>d,lM:()=>a,qK:()=>c});var r=i(34275);function s(e){return 32+e.length}const n=16;function a(e){if(!e)return 0;let t=c;for(const i in e)e.hasOwnProperty(i)&&(t+=o(e[i],!1));return t}function l(e){if(!e)return 0;if("number"==typeof e[0])return h(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return u(e,8);let i=d;for(let r=0;r<t;r++)i+=o(e[r]);return i}(e);let t=c;for(const i in e)e.hasOwnProperty(i)&&(t+=o(e[i]));return t}function o(e,t=!0){switch(typeof e){case"object":return t?l(e):c;case"string":return s(e);case"number":return n;case"boolean":return 4;default:return 8}}function h(...e){return e.reduce((e,t)=>e+(t?(0,r.iu)(t)?t.byteLength+p:Array.isArray(t)?u(t,n):0:0),0)}function u(e,t){return d+e.length*t}const c=32,d=16,p=145},69540:(e,t,i)=>{i.d(t,{OU:()=>u,Pw:()=>c});var r=i(31635),s=i(69622),n=(i(44208),i(4718)),a=(i(53966),i(97768)),l=i(88620),o=i(64108);const h=Symbol("ClonableMixin"),u=e=>{var t;const i=e;let s=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=h}clone(e){const t=(0,l.oY)(this);(0,a.Lw)(t,"unable to clone instance of non-accessor class");const i=t.metadata,r=t.store,s={},o=new Map;for(const t in i){const a=i[t],l=r?.originOf(t),h=a.clonable;if(a.readOnly||!1===h||7!==l&&0!==l&&5!==l&&4!==l)continue;const u=this[t];let c=null;if("function"==typeof h)c=h(u,e);else if("reference"===h)c=u;else if(c=(0,n.TU)(u,e),null!=u&&null==c)continue;0===l?o.set(t,c):s[t]=c}const h=new(0,Object.getPrototypeOf(this).constructor)(s);if(o.size){const e=(0,l.oY)(h)?.store;if(e)for(const[t,i]of o)e.set(t,i,0)}return h}};return s=(0,r.Cg)([(0,o.$)("esri.core.Clonable")],s),s},c=u(s.A)},77548:(e,t,i)=>{i.d(t,{Gh:()=>g,tk:()=>d,BR:()=>c,wI:()=>u,G$:()=>f,$x:()=>p,Ov:()=>l,W_:()=>o,OP:()=>y,TU:()=>a,XX:()=>n,jy:()=>h});var r=i(70333),s=i(78888);i(7762),i(84952),i(36563),i(36708),i(4146),new WeakMap,i(16215);const n={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function a(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function l(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function o(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t)&&"feature-layer"===e?.source?.type}function h(e){return function(e){return null!=e&&"object"==typeof e&&"type"in e&&"feature"===e.type}(e)&&function(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}(e)}async function u(e,t){const i=r.id?.findServerInfo(e);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const n=e.toLowerCase().indexOf("/rest/services");if(-1===n)return null;const a=`${e.slice(0,n)}/rest/info`,l=null!=t?t.signal:null,{data:o}=await(0,s.A)(a,{query:{f:"json"},responseType:"json",signal:l});return o?.owningSystemUrl||null}function c(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 d(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":case"knowledge-graph-sublayer":return!0;default:return!1}}(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function p(e,t){return null}function f(e){return null}function y(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function g(e,t){if(!t||!y(e))return;const i=(e.url,null);i&&(e.url=i)}},78553:(e,t,i)=>{i.d(t,{D:()=>n,p:()=>s});var r=i(56507);function s(e){const t=(0,r.Vr)(100*(1-e));return Math.max(0,Math.min(t,100))}function n(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}},79677:(e,t,i)=>{i.d(t,{A:()=>d});var r,s=i(31635),n=i(25482),a=i(88930),l=i(10107),o=(i(44208),i(53966),i(87811),i(36005)),h=i(64108),u=i(43937),c=i(98623);let d=class extends n.o{static{r=this}static get allTime(){return p}static get empty(){return f}static fromArray(e){return new r({start:null!=e[0]?new Date(e[0]):e[0],end:null!=e[1]?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null!=t.end?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===r&&i===s}expandTo(e,t=c.qU){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=(0,a.lL)(i,e,t));let s=this.end;if(s){const i=(0,a.lL)(s,e,t);s=s.getTime()===i.getTime()?i:(0,a.S1)(i,1,e,t)}return new r({start:i,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,i=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let a,l;return s>=t&&s<=i?a=s:t>=s&&t<=n&&(a=t),i>=s&&i<=n?l=i:n>=t&&n<=i&&(l=n),null==a||null==l||isNaN(a)||isNaN(l)?r.empty:new r({start:a===-1/0?null:new Date(a),end:l===1/0?null:new Date(l)})}offset(e,t,i=c.qU){if(this.isEmpty||this.isAllTime)return this.clone();const s=new r,{start:n,end:l}=this;return null!=n&&(s.start=(0,a.S1)(n,e,t,i)),null!=l&&(s.end=(0,a.S1)(l,e,t,i)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return p.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:i})}};(0,s.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,s.Cg)([(0,o.w)("end")],d.prototype,"readEnd",null),(0,s.Cg)([(0,u.K)("end")],d.prototype,"writeEnd",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,s.Cg)([(0,l.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,s.Cg)([(0,o.w)("start")],d.prototype,"readStart",null),(0,s.Cg)([(0,u.K)("start")],d.prototype,"writeStart",null),d=r=(0,s.Cg)([(0,h.$)("esri.time.TimeExtent")],d);const p=new d,f=new d({start:void 0,end:void 0})},89186:(e,t,i)=>{i.d(t,{f:()=>c});var r=i(31635),s=i(10107),n=(i(44208),i(53966),i(87811),i(36005)),a=i(64108),l=i(16930),o=i(87045),h=i(65509),u=i(25943);const c=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(e,t,i){const r=t.capabilities?.includes("Tilemap");let{minLOD:s,maxLOD:n,minScale:a,maxScale:l}=t;if(null==s&&null==n&&(0!==a||0!==l)){const e=e=>Math.round(1e4*e)/1e4;a=e(a||t.tileInfo.lods[0].scale),l=e(l||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(const i of t.tileInfo.lods){const t=e(i.scale);s=t>=a?i.level:s,n=t>=l?i.level:n}}if(r)return new u.d({layer:this,minLOD:s,maxLOD:n});if(t.tileInfo){const e=new o.A;return e.read(t.tileInfo,i),new h.A(e,s,n)}return null}};return(0,r.Cg)([(0,s.MZ)({json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),(0,r.Cg)([(0,s.MZ)()],i.prototype,"minScale",void 0),(0,r.Cg)([(0,n.w)("service","minScale")],i.prototype,"readMinScale",null),(0,r.Cg)([(0,s.MZ)()],i.prototype,"maxScale",void 0),(0,r.Cg)([(0,n.w)("service","maxScale")],i.prototype,"readMaxScale",null),(0,r.Cg)([(0,s.MZ)({type:l.A})],i.prototype,"spatialReference",void 0),(0,r.Cg)([(0,s.MZ)({readOnly:!0})],i.prototype,"supportsBlankTile",null),(0,r.Cg)([(0,s.MZ)({type:o.A})],i.prototype,"tileInfo",void 0),(0,r.Cg)([(0,s.MZ)()],i.prototype,"tilemapCache",void 0),(0,r.Cg)([(0,n.w)("service","tilemapCache",["capabilities","tileInfo"])],i.prototype,"readTilemapCache",null),(0,r.Cg)([(0,s.MZ)()],i.prototype,"version",void 0),i=(0,r.Cg)([(0,a.$)("esri.layers.mixins.ArcGISCachedService")],i),i}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2568],{35448:(e,t,r)=>{r.d(t,{Eq:()=>n,bV:()=>a,nP:()=>s,r5:()=>o,ti:()=>d,vy:()=>l,wr:()=>i});const n={Regular:0,Provenance:1,Document:2},o={esriFieldTypeSmallInteger:0,esriFieldTypeInteger:1,esriFieldTypeSingle:2,esriFieldTypeDouble:3,esriFieldTypeString:4,esriFieldTypeDate:5,esriFieldTypeOID:6,esriFieldTypeGeometry:7,esriFieldTypeBlob:8,esriFieldTypeRaster:9,esriFieldTypeGUID:10,esriFieldTypeGlobalID:11,esriFieldTypeXML:12,esriFieldTypeBigInteger:13,esriFieldTypeDateOnly:14,esriFieldTypeTimeOnly:15,esriFieldTypeTimestampOffset:16},a={esriGeometryNull:0,esriGeometryPoint:1,esriGeometryMultipoint:2,esriGeometryPolyline:3,esriGeometryPolygon:4,esriGeometryEnvelope:5,esriGeometryAny:7,esriGeometryMultiPatch:9},i={esriMethodHintUNSPECIFIED:0,esriUUIDESRI:1,esriUUIDRFC4122:2},s={esriTypeUNSPECIFIED:0,esriTypeEntity:1,esriTypeRelationship:2,esriTypeBoth:4,esriTypeMetaEntityProvenance:8},d={esriGraphPropertyUNSPECIFIED:0,esriGraphPropertyRegular:1,esriGraphPropertyDocumentName:2,esriGraphPropertyDocumentTitle:3,esriGraphPropertyDocumentUrl:4,esriGraphPropertyDocumentText:5,esriGraphPropertyDocumentKeywords:6,esriGraphPropertyDocumentContentType:7,esriGraphPropertyDocumentMetadata:8,esriGraphPropertyDocumentFileExtension:9,esriGraphPropertyProvenanceInstanceId:10,esriGraphPropertyProvenanceSourceType:11,esriGraphPropertyProvenanceSourceName:12,esriGraphPropertyProvenanceSource:13,esriGraphPropertyProvenanceComment:14,esriGraphPropertyProvenanceTypeName:15,esriGraphPropertyProvenancePropertyName:16},l={esriIdentifierInfoTypeUNSPECIFIED:0,esriIdentifierInfoTypeDatabaseNative:1,esriIdentifierInfoTypeUniformProperty:2}},45724:(e,t,r)=>{r.d(t,{I:()=>d});var n=r(2741),o=r(44208);const a="esri/rest/knowledgeGraph/wasmInterface/";let i,s;async function d(){const e=i??s;if(e)return e;const t=!!(0,o.A)("wasm-simd");return s=l(t),s}async function l(e){if(e){const{default:e}=await r.e(5367).then(r.bind(r,15367)).then(e=>e.a);return e({locateFile:e=>(0,n.s)(a+e)})}const{default:t}=await r.e(9013).then(r.bind(r,29013)).then(e=>e.a);return t({locateFile:e=>(0,n.s)(a+e)})}},62568:(e,t,r)=>{r.r(t),r.d(t,{_checkAuthentication:()=>or,_esriRequestWrapper:()=>nr,_fetchWrapper:()=>tr,_getClientDataCacheCopy:()=>St,_setMaxQueryParsingDurationForTesting:()=>lr,_submitJobWrapper:()=>rr,clearClientDataCache:()=>er,clientDataCache:()=>kt,executeAddGraphFieldIndex:()=>qt,executeAddGraphProperties:()=>Et,executeAddNamedTypes:()=>It,executeApplyEdits:()=>jt,executeDeleteGraphFieldIndex:()=>$t,executeDeleteGraphProperty:()=>Ft,executeDeleteNamedType:()=>Dt,executeFindPaths:()=>Yt,executeFindPathsAsynchronous:()=>Wt,executeQuery:()=>Lt,executeQueryStreaming:()=>Ut,executeSearch:()=>zt,executeSearchStreaming:()=>Jt,executeUpdateGraphProperty:()=>Nt,executeUpdateNamedType:()=>Zt,executeUpdateSearchIndex:()=>Ot,fetchAllClientDataKeys:()=>Kt,fetchAsynchronousFindPathsResultData:()=>Xt,fetchClientDataAtKeys:()=>Vt,fetchKnowledgeGraph:()=>Qt,kgRestServices:()=>Rt,refreshDataModel:()=>Bt,refreshServiceDefinition:()=>Ht});var n,o=r(70333),a=r(78888),i=r(49186),s=r(53966),d=r(74887),l=r(91075),p=r(16930),u=r(31635),c=r(69622),h=r(10107),y=r(56507),g=(r(44208),r(87811),r(64108)),f=r(5443);let w=n=class extends c.A{constructor(e){super(e),this.outSpatialReference=null,this.processExtent=null,this.processSpatialReference=null,this.returnColumnName=!1,this.returnFeatureCollection=!1,this.returnM=!1,this.returnZ=!1}static from(e){return(0,y.PZ)(n,e)}};(0,u.Cg)([(0,h.MZ)({type:p.A})],w.prototype,"outSpatialReference",void 0),(0,u.Cg)([(0,h.MZ)({type:f.A})],w.prototype,"processExtent",void 0),(0,u.Cg)([(0,h.MZ)({type:p.A})],w.prototype,"processSpatialReference",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnColumnName",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnFeatureCollection",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnM",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnZ",void 0),w=n=(0,u.Cg)([(0,g.$)("esri.rest.geoprocessor.GPOptions")],w);var m=r(17136),_=r(20437),v=r(25482);let b=class extends v.o{constructor(e){super(e),this.extent=null,this.height=null,this.href=null,this.opacity=1,this.rotation=0,this.scale=null,this.visible=!0,this.width=null}};(0,u.Cg)([(0,h.MZ)({type:f.A})],b.prototype,"extent",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"height",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"href",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"opacity",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"rotation",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"scale",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"visible",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"width",void 0),b=(0,u.Cg)([(0,g.$)("esri.layers.support.MapImage")],b);var C=r(2272),A=r(93223),G=r(2073);let M=class extends v.o{constructor(e){super(e),this.area=0,this.units=null}};(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],M.prototype,"area",void 0),(0,u.Cg)([(0,A.e)(G.UO)],M.prototype,"units",void 0),M=(0,u.Cg)([(0,g.$)("esri.rest.support.ArealUnit")],M);let x=class extends v.o{constructor(e){super(e),this.itemId=null,this.url=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{read:{source:"itemID"},write:{target:"itemID"}}})],x.prototype,"itemId",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],x.prototype,"url",void 0),x=(0,u.Cg)([(0,g.$)("esri.rest.support.DataFile")],x);var T=r(22671);let P=class extends v.o{constructor(e){super(e),this.distance=0,this.units=null}};(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],P.prototype,"distance",void 0),(0,u.Cg)([(0,A.e)(G.Y8)],P.prototype,"units",void 0),P=(0,u.Cg)([(0,g.$)("esri.rest.support.LinearUnit")],P);var k=r(66552);const S="multi-value-",R=new k.J({GPArealUnit:"areal-unit",GPBoolean:"boolean",GPComposite:"composite",GPDataFile:"data-file",GPDate:"date",GPDouble:"double",GPFeatureRecordSetLayer:"feature-record-set-layer",Field:"field",GPLinearUnit:"linear-unit",GPLong:"long",GPRasterData:"raster-data",GPRasterDataLayer:"raster-data-layer",GPRecordSet:"record-set",GPString:"string",GPValueTable:"value-table","GPMultiValue:GPArealUnit":`${S}areal-unit`,"GPMultiValue:GPBoolean":`${S}boolean`,"GPMultiValue:GPComposite":`${S}composite`,"GPMultiValue:GPDataFile":`${S}data-file`,"GPMultiValue:GPDate":`${S}date`,"GPMultiValue:GPDouble":`${S}double`,"GPMultiValue:GPFeatureRecordSetLayer":`${S}feature-record-set-layer`,"GPMultiValue:Field":`${S}field`,"GPMultiValue:GPLinearUnit":`${S}linear-unit`,"GPMultiValue:GPLong":`${S}long`,"GPMultiValue:GPRasterData":`${S}raster-data`,"GPMultiValue:GPRasterDataLayer":`${S}raster-data-layer`,"GPMultiValue:GPRecordSet":`${S}record-set`,"GPMultiValue:GPString":`${S}string`});let j=class extends v.o{constructor(e){super(e),this.dataType=null,this.paramName=null,this.value=null}};(0,u.Cg)([(0,A.e)(R,{ignoreUnknown:!1})],j.prototype,"dataType",void 0),(0,u.Cg)([(0,h.MZ)()],j.prototype,"paramName",void 0),(0,u.Cg)([(0,h.MZ)()],j.prototype,"value",void 0),j=(0,u.Cg)([(0,g.$)("esri.rest.support.ParameterValue")],j);var I=r(36005);let D=class extends v.o{constructor(e){super(e),this.format=null,this.itemId=null,this.type=null,this.url=null}readType(e){return"ImageService"===e?"image-service":null}};async function Z(e,t){switch(e){case"areal-unit":return M.fromJSON(t);case"boolean":case"double":case"long":case"string":case"value-table":return t;case"date":return new Date(t);case"data-file":return x.fromJSON(t);case"linear-unit":return P.fromJSON(t);case"feature-record-set-layer":if("url"in t)return x.fromJSON(t);if("layerDefinition"in t){const e=new(0,(await Promise.all([r.e(7330),r.e(4045),r.e(6554),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(957),r.e(8506),r.e(8654),r.e(3548)]).then(r.bind(r,68654))).default),{layerDefinition:n,featureSet:o}=t;return e.read({layerDefinition:n,featureSet:o},{origin:"portal-item"}),e.spatialReference=p.A.fromJSON(o.spatialReference??n.spatialReference??n.extent.spatialReference),e}return T.A.fromJSON(t);case"record-set":return"url"in t?x.fromJSON(t):T.A.fromJSON(t);case"raster-data":case"raster-data-layer":return"mapImage"in t?b.fromJSON(t.mapImage):D.fromJSON(t);case"field":return _.A.fromJSON(t)}}async function E(e){const t=R.fromJSON(e.dataType),{paramName:r}=e,n=function(e){return e.startsWith(S)}(t)?await async function(e,t){const r=function(e){return e.replace(S,"")}(e),n="composite"===r?t.map(e=>Z(R.fromJSON(e.dataType),e.value)):t.map(e=>Z(r,e));return Promise.all(n)}(t,e.value):await Z(t,e.value);return new j({dataType:t,paramName:r,value:n})}function F(e,t,r){for(const t in e){const r=e[t];Array.isArray(r)?e[t]=JSON.stringify(r.map(e=>F({item:e},!0).item)):r instanceof Date&&(e[t]=r.getTime())}return(0,C.lF)(e,t,r)}(0,u.Cg)([(0,h.MZ)()],D.prototype,"format",void 0),(0,u.Cg)([(0,h.MZ)({json:{name:"itemID",write:!0}})],D.prototype,"itemId",void 0),(0,u.Cg)([(0,h.MZ)()],D.prototype,"type",void 0),(0,u.Cg)([(0,I.w)("type")],D.prototype,"readType",null),(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],D.prototype,"url",void 0),D=(0,u.Cg)([(0,g.$)("esri.rest.support.RasterData")],D);var N,q=r(37807);const $=(0,k.O)()({esriJobCancelled:"job-cancelled",esriJobCancelling:"job-cancelling",esriJobDeleted:"job-deleted",esriJobDeleting:"job-deleting",esriJobTimedOut:"job-timed-out",esriJobExecuting:"job-executing",esriJobFailed:"job-failed",esriJobNew:"job-new",esriJobSubmitted:"job-submitted",esriJobSucceeded:"job-succeeded",esriJobWaiting:"job-waiting"},{ignoreUnknown:!1}),O=1e3;let L=class extends v.o{static{N=this}constructor(e){super(e),this.jobId=null,this.jobStatus=null,this.messages=null,this.progress=null,this.requestOptions=null,this.sourceUrl=null,this._cancelJobTimer=void 0,this._jobCompletionTimer=void 0}async cancelJob(e){const{jobId:t,sourceUrl:r}=this,{path:n}=(0,C.Dl)(r),o={...this.requestOptions,...e,query:{f:"json"}},i=`${n}/jobs/${t}/cancel`,{data:s}=await(0,a.A)(i,o),{messages:l,jobStatus:p,progress:u}=N.fromJSON(s);return this.set({messages:l,jobStatus:p,progress:u}),"job-cancelled"===p?this:new Promise((t,r)=>{(0,d.u7)(o.signal,()=>{this.clearCancelJobTimer(),r((0,d.NK)())}),this.clearCancelJobTimer();const n=()=>{this._cancelJobTimer||r((0,d.NK)()),this.checkJobStatus(e).then(({jobStatus:e})=>{switch(e){case"job-cancelling":default:this._cancelJobTimer=setTimeout(n,O);break;case"job-deleted":case"job-deleting":case"job-executing":case"job-failed":case"job-new":case"job-submitted":case"job-succeeded":case"job-timed-out":case"job-waiting":r(this);break;case"job-cancelled":t(this)}}).catch(e=>{r(e)})};this._cancelJobTimer=setTimeout(n,O)})}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=(0,C.Dl)(this.sourceUrl),r={...this.requestOptions,...e,query:{...e?.query,f:"json"}},n=`${t}/jobs/${this.jobId}`,{data:o}=await(0,a.A)(n,r),{messages:i,jobStatus:s,progress:d}=N.fromJSON(o);return this.set({messages:i,jobStatus:s,progress:d}),this}async fetchResultData(e,t,r){t=w.from(t||{});const{returnColumnName:n,returnFeatureCollection:o,returnM:i,returnZ:s,outSpatialReference:d}=t,{path:l}=(0,C.Dl)(this.sourceUrl),p=F({returnColumnName:n||null,returnFeatureCollection:o||null,returnM:i||null,returnZ:s||null,outSR:d,returnType:"data",f:"json",...r?.query},null),u={...this.requestOptions,...r,query:p},c=`${l}/jobs/${this.jobId}/results/${e}`,{data:h}=await(0,a.A)(c,u);return E(h)}async fetchResultImage(e,t,r){const{path:n}=(0,C.Dl)(this.sourceUrl),o=F({...t.toJSON(),f:"json"}),i={...this.requestOptions,...r,query:o},s=`${n}/jobs/${this.jobId}/results/${e}`,{data:d}=await(0,a.A)(s,i);return E(d)}async fetchResultMapImageLayer(){const{path:e}=(0,C.Dl)(this.sourceUrl),t=e.indexOf("/GPServer/"),n=`${e.slice(0,Math.max(0,t))}/MapServer/jobs/${this.jobId}`;return new(0,(await Promise.all([r.e(4045),r.e(6554),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(8399),r.e(957),r.e(364),r.e(7048),r.e(7656),r.e(7548)]).then(r.bind(r,7656))).default)({url:n})}async waitForJobCompletion(e={}){const{interval:t=O,signal:r,statusCallback:n,apiKey:o}=e;return new Promise((e,a)=>{(0,d.u7)(r,()=>{this.clearJobCompletionTimer(),a((0,d.NK)())}),this.clearJobCompletionTimer();const i=()=>{this._jobCompletionTimer||a((0,d.NK)()),this.checkJobStatus({query:{token:o}}).then(({jobStatus:r})=>{switch(r){case"job-succeeded":e(this);break;case"job-executing":case"job-new":case"job-submitted":case"job-waiting":n&&n(this),this._jobCompletionTimer=setTimeout(i,t);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":a(this);break;default:this._jobCompletionTimer=setTimeout(i,t)}}).catch(e=>{a(e)})};this._jobCompletionTimer=setTimeout(i,t)})}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};(0,u.Cg)([(0,h.MZ)()],L.prototype,"jobId",void 0),(0,u.Cg)([(0,A.e)($,{ignoreUnknown:!1})],L.prototype,"jobStatus",void 0),(0,u.Cg)([(0,h.MZ)({type:[q.A]})],L.prototype,"messages",void 0),(0,u.Cg)([(0,h.MZ)()],L.prototype,"progress",void 0),(0,u.Cg)([(0,h.MZ)()],L.prototype,"requestOptions",void 0),(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],L.prototype,"sourceUrl",void 0),L=N=(0,u.Cg)([(0,g.$)("esri.rest.support.JobInfo")],L);let U=class extends c.A{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};(0,u.Cg)([(0,h.MZ)()],U.prototype,"headerKeys",void 0),(0,u.Cg)([(0,h.MZ)()],U.prototype,"outSpatialReference",void 0),(0,u.Cg)([(0,h.MZ)()],U.prototype,"exceededTransferLimit",void 0),U=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphQueryResultHeader")],U);let z=class extends c.A{constructor(e){super(e),this.resultRows=[],this.resultHeader=new U}};(0,u.Cg)([(0,h.MZ)()],z.prototype,"resultRows",void 0),(0,u.Cg)([(0,h.MZ)()],z.prototype,"resultHeader",void 0),z=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphQueryResult")],z);let J=class extends c.A{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new U}};(0,u.Cg)([(0,h.MZ)()],J.prototype,"resultRowsStream",void 0),(0,u.Cg)([(0,h.MZ)()],J.prototype,"resultHeader",void 0),J=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],J);let K=class extends v.o{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=!0,this.description="",this.fieldNames=[]}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],K.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],K.prototype,"unique",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],K.prototype,"ascending",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],K.prototype,"description",void 0),(0,u.Cg)([(0,h.MZ)({type:[String],json:{write:!0}})],K.prototype,"fieldNames",void 0),K=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.FieldIndex")],K);let V=class extends v.o{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=!0,this.required=!1,this.defaultVisibility=!0,this.systemMaintained=null,this.role="esriGraphPropertyUNSPECIFIED",this.defaultValue=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"alias",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"fieldType",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"geometryType",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"hasM",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"hasZ",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"nullable",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"editable",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"required",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"defaultVisibility",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"systemMaintained",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"role",void 0),(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],V.prototype,"defaultValue",void 0),V=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphProperty")],V);let Q=class extends v.o{constructor(e){super(e),this.name=null,this.alias=null,this.role="Regular",this.strict=null,this.properties=[],this.fieldIndexes=[],this.type=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Q.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Q.prototype,"alias",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Q.prototype,"role",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"strict",void 0),(0,u.Cg)([(0,h.MZ)({type:[V],json:{write:!0}})],Q.prototype,"properties",void 0),(0,u.Cg)([(0,h.MZ)({type:[K],json:{write:!0}})],Q.prototype,"fieldIndexes",void 0),Q=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphObjectType")],Q);let B=class extends Q{constructor(e){super(e),this.type="entity"}};B=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.EntityType")],B);let H=class extends Q{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],H.prototype,"endPoints",void 0),H=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.RelationshipType")],H);let W=class extends v.o{constructor(e){super(e),this.value=null,this.behavior=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],W.prototype,"value",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],W.prototype,"behavior",void 0),W=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],W);let Y=class extends v.o{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=[],this.entityTypes=[],this.relationshipTypes=[],this.metaEntityTypes=[],this.provenanceSourceTypeValues=[]}};(0,u.Cg)([(0,h.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],Y.prototype,"timestamp",void 0),(0,u.Cg)([(0,h.MZ)({type:p.A,json:{write:!0}})],Y.prototype,"spatialReference",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],Y.prototype,"strict",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Y.prototype,"objectIdField",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Y.prototype,"globalIdField",void 0),(0,u.Cg)([(0,h.MZ)()],Y.prototype,"arcgisManaged",void 0),(0,u.Cg)([(0,h.MZ)()],Y.prototype,"identifierInfo",void 0),(0,u.Cg)([(0,h.MZ)()],Y.prototype,"searchIndexes",void 0),(0,u.Cg)([(0,h.MZ)({type:[B],json:{write:!0}})],Y.prototype,"entityTypes",void 0),(0,u.Cg)([(0,h.MZ)({type:[H],json:{write:!0}})],Y.prototype,"relationshipTypes",void 0),(0,u.Cg)([(0,h.MZ)({type:[B],json:{write:!0}})],Y.prototype,"metaEntityTypes",void 0),(0,u.Cg)([(0,h.MZ)({type:[W],json:{write:!0}})],Y.prototype,"provenanceSourceTypeValues",void 0),Y=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.DataModel")],Y);let X=class extends v.o{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};(0,u.Cg)([(0,h.MZ)({type:[String],json:{write:!0}})],X.prototype,"capabilities",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"supportsSearch",void 0),(0,u.Cg)([(0,h.MZ)({type:[String],json:{write:!0}})],X.prototype,"supportedQueryFormats",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"allowGeometryUpdates",void 0),(0,u.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],X.prototype,"searchMaxRecordCount",void 0),(0,u.Cg)([(0,h.MZ)({type:Object,json:{write:!0}})],X.prototype,"serviceCapabilities",void 0),(0,u.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],X.prototype,"maxRecordCount",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"description",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"copyrightText",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"units",void 0),(0,u.Cg)([(0,h.MZ)({type:p.A,json:{write:!0}})],X.prototype,"spatialReference",void 0),(0,u.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],X.prototype,"currentVersion",void 0),(0,u.Cg)([(0,h.MZ)({type:Object,json:{write:!0}})],X.prototype,"dateFieldsTimeReference",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"serviceItemId",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"supportsDocuments",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"dataEditingNotSupported",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"schemaEditingNotSupported",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"supportsProvenance",void 0),X=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.ServiceDefinition")],X);let ee=class extends v.o{constructor(e){super(e),this.url=null,this.dataModel=null,this.serviceDefinition=null}};function te(e,t,r){if(0!==e.error_code)throw new i.A(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function re(e){return e?.error_code?new i.A("knowledgeGraphService:server-or-decoding-error",e.error_message,{errorCode:e.error_code}):void 0}function ne(e,t,r,n=!1){const o=new r.ClientDataFetchRequestEncoder;o.deleteLater();for(const a of e){const e=oe(a,t,r,n);o.add_client_data_fetch_request_parameter(e)}o.encode();const a=o.get_encoding_result();return te(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function oe(e,t,r,n){const o=new r.ClientDataKey;o.deleteLater(),o.key_string=e;const a=new r.ClientDataFetchRequestParameter;a.deleteLater(),a.set_key(o);const i=t.get(e);return i&&!n&&(a.v_tag={v_tag:i.version}),a}(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],ee.prototype,"url",void 0),(0,u.Cg)([(0,h.MZ)({type:Y,json:{write:!0}})],ee.prototype,"dataModel",void 0),(0,u.Cg)([(0,h.MZ)({type:X,json:{write:!0}})],ee.prototype,"serviceDefinition",void 0),ee=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.KnowledgeGraph")],ee);var ae=r(45724),ie=r(48526),se=r(86738),de=r(39829),le=r(82799);const pe={exclude:0,include:1};function ue(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ye(e,t))}),r}function ce(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,o]of Object.entries(e))r.set_key_value(n,ye(o,t));return r}function he(e,t){if(e instanceof ie.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=r.geometry_type=t.esriGeometryType.esriGeometryMultipoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let a=0;return e.points.forEach(e=>{e.forEach(e=>{n[a]=e,a++})}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof se.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=t.esriGeometryType.esriGeometryPoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let a=2;return e.hasZ&&(n[a]=e.z,a++),e.hasM&&(n[a]=e.m,a++),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof le.A||e instanceof de.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];let a=[];e instanceof le.A?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof de.A&&(r.geometry_type=t.esriGeometryType.esriGeometryPolygon,a=e.rings);let i=0,s=0;return a.forEach(e=>{let t=0;e.forEach(e=>{t++,e.forEach(e=>{n[s]=e,s++})}),o[i]=t,i++}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);throw new i.A("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function ye(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof l.A)return he(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ye(e,t))}),r}return ce(e,t)}var ge=r(35448);function fe(e,t){if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(!("originId"in e)){const r=new t.EntityValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,be(o,t));return e.id&&r.set_id(e.id),r}if("originId"in e&&"destinationId"in e){const r=new t.RelationshipValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,be(o,t));return e.id&&r.set_id(e.id),e.originId&&e.destinationId&&r.set_related_entity_ids(e.originId,e.destinationId),r}throw new i.A("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function we(e,t){const r=new t.GraphProperty;return r.deleteLater(),r.name=e.name,r.alias=e.alias??"",r.field_type={value:ge.r5[e.fieldType]},r.geometry_type={value:e.geometryType?ge.bV[e.geometryType]:ge.bV.esriGeometryNull},r.has_m=e.hasM??!1,r.has_z=e.hasZ??!1,r.nullable=e.nullable??!1,r.editable=e.editable,r.required=e.required,r.default_visibility=e.defaultVisibility,r.system_maintained=e.systemMaintained??!1,r.role={value:ge.ti[e.role]},r.default_value=be(e.defaultValue,t),r}function me(e,t){const r=new t.SearchIndexProperties;r.deleteLater();for(const t of e.propertyNames)r.add_search_property_name(t);return r}function _e(e,t,r){r.name=e.name,r.alias=e.alias??"",r.role={value:ge.Eq[e.role]},r.strict=e.strict;for(const n of e.properties){const e=we(n,t);r.add_property(e)}return r}function ve(e,t){return e.hasOwnProperty("alias")&&(t.alias=e.alias),t}function be(e,t){return null==e?null:"object"!=typeof e||e instanceof Date?e:e instanceof l.A?he(e,t):null}let Ce=class extends c.A{constructor(e){super(e),this.decoderError=null,this.resultsCount=0,this.results=[],this.updatedKnowledgeGraph=null}};(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"decoderError",void 0),(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"resultsCount",void 0),(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"results",void 0),(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"updatedKnowledgeGraph",void 0),Ce=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDataModelOperationResult")],Ce);const Ae=Ce;let Ge=class extends Ae{constructor(e){super(e)}};Ge=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphAddFieldIndexResult")],Ge);const Me=Ge;let xe=class extends Ae{constructor(e){super(e),this.entityAddResultsCount=0,this.relationshipAddResultsCount=0,this.entityAddResults=[],this.relationshipAddResults=[]}};(0,u.Cg)([(0,h.MZ)()],xe.prototype,"entityAddResultsCount",void 0),(0,u.Cg)([(0,h.MZ)()],xe.prototype,"relationshipAddResultsCount",void 0),(0,u.Cg)([(0,h.MZ)()],xe.prototype,"entityAddResults",void 0),(0,u.Cg)([(0,h.MZ)()],xe.prototype,"relationshipAddResults",void 0),xe=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphAddNamedTypesResult")],xe);const Te=xe;let Pe=class extends Ae{constructor(e){super(e)}};Pe=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphAddPropertyResult")],Pe);const ke=Pe;let Se=class extends Ae{constructor(e){super(e)}};Se=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDeleteFieldIndexResult")],Se);const Re=Se;let je=class extends Ae{constructor(e){super(e)}};je=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],je);const Ie=je;let De=class extends Ae{constructor(e){super(e)}};De=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDeletePropertyResult")],De);const Ze=De;let Ee=class extends Ae{constructor(e){super(e)}};Ee=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphUpdateNamedTypesResult")],Ee);const Fe=Ee;let Ne=class extends Ae{constructor(e){super(e)}};Ne=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphUpdatePropertyResult")],Ne);const qe=Ne;let $e=class extends Ae{constructor(e){super(e)}};$e=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphUpdateSearchIndexResult")],$e);const Oe=$e;function Le(e,t){const r=[];for(let n=0;n<t;n++){const t=e.get_result_at(n);r.push({name:t.get_name(),error:re(t.get_error())})}return r}function Ue(e){const t=e.get_results_count(),r=e.get_entity_type_add_results_count(),n=e.get_relationship_type_add_results_count(),o=new Te({resultsCount:t,results:Le(e,t),decoderError:re(e.error),entityAddResultsCount:r,relationshipAddResultsCount:n});for(let t=0;t<r;t++){const r=e.get_entity_type_add_results_at(t),n=r.get_name(),a=r.get_error();o.entityAddResults.push({name:n,error:re(a)})}for(let t=0;t<n;t++){const r=e.get_relationship_type_add_results_at(t),n=r.get_name(),a=r.get_error();o.relationshipAddResults.push({name:n,error:re(a)})}return o}function ze(e){const t=e.get_results_count();return new Fe({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Je(e){const t=e.get_results_count();return new Ie({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Ke(e){const t=e.get_results_count();return new ke({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Ve(e){const t=e.get_results_count();return new Ze({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Qe(e){const t=e.get_results_count();return new qe({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Be(e){const t=e.get_results_count();return new Oe({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function He(e){const t=e.get_results_count();return new Me({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function We(e){const t=e.get_results_count();return new Re({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}var Ye=r(93637);let Xe=class extends c.A{constructor(e){super(e),this.name=null,this.supportedCategory="esriTypeUNSPECIFIED",this.analyzers=[],this.searchProperties=new Map}};(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"supportedCategory",void 0),(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"analyzers",void 0),(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"searchProperties",void 0),Xe=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.SearchIndex")],Xe);let et=!1;function tt(e){return e.deleteLater(),new B(nt(e))}function rt(e){return e.deleteLater(),new K({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:dt(e.fields)})}function nt(e){return{name:e.name,alias:e.alias,role:(0,Ye.i7)(ge.Eq,e.role.value),strict:e.strict,properties:lt(e.properties),fieldIndexes:pt(e.field_indexes)}}function ot(e){return e.deleteLater(),new V({alias:e.alias,name:e.name,fieldType:(0,Ye.i7)(ge.r5,e.field_type.value)??void 0,geometryType:(0,Ye.i7)(ge.bV,e.geometry_type.value)??null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:(0,Ye.i7)(ge.ti,e.role.value),defaultValue:e.default_value})}function at(e){e.deleteLater();const t=nt(e),r=[];for(let t=0;t<e.end_points.size();t++){const n=e.end_points.get(t);r.push({originEntityType:n.origin_entity_type,destinationEntityType:n.dest_entity_type})}return e.end_points.delete(),new H(Object.assign({endPoints:r},t))}function it(e){return new W({behavior:e.behavior,value:e.value})}function st(e){const t=[];for(let r=0;r<e.size();r++)t.push(tt(e.get(r)));return e.delete(),t}function dt(e){const t=[];for(let r=0;r<e.size();r++)t.push(e.get(r));return e.delete(),t}function lt(e){const t=[];for(let r=0;r<e.size();r++){const n=ot(e.get(r));"esriFieldTypeBigInteger"===n.fieldType&&(et=!0),t.push(n)}return e.delete(),t}function pt(e){const t=[];for(let r=0;r<e.size();r++)t.push(rt(e.get(r)));return e.delete(),t}function ut(e){const t=[];for(let r=0;r<e.size();r++)t.push(at(e.get(r)));return e.delete(),t}function ct(e){const t=[];for(let r=0;r<e.size();r++){const n=e.get(r);n.deleteLater(),t.push(it(n))}return e.delete(),t}function ht(e){const t=[];for(let r=0;r<e.size();r++){const n=new Xe,o=e.get(r);n.name=o.name,n.supportedCategory=(0,Ye.i7)(ge.nP,o.supported_category.value);const a=o.analyzers.size();for(let e=0;e<a;e++)n.analyzers.push({name:o.analyzers.get(e).name});o.analyzers.delete();for(let e=0;e<o.search_properties.keys().size();e++){const t=o.search_properties.keys().get(e),r=o.search_properties.get(t),a=[];for(let e=0;e<r.property_names.size();e++)a.push(r.property_names.get(e));n.searchProperties.set(t,{propertyNames:a})}t.push(n)}return e.delete(),t}var yt=r(25927),gt=(r(77901),r(40662)),ft=r(42095),wt=r(23150);function mt(e,t){const r={paths:[],hasM:!1,hasZ:!1},n=_t(e,r),{coords:o,geometry_type:a,lengths:s}=e;if(a.value!==t)throw new i.A("KnowledgeGraph:illegal-geometry-type","Illegal Geometry type for multipath conversion");let d=0;return s.forEach(e=>{const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<n;t++)e[t]=o[d],d++;t.push(e)}r.paths.push(t)}),r}function _t(e,t){let r=2;return e.has_z?(t.hasZ=e.has_z,r++):t.hasZ=!1,e.has_m?(t.hasM=e.has_m,r++):t.hasM=!1,r}const vt=()=>s.A.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors");function bt(e,t,r){return((e,t,r)=>{if(null==e)return null;if("object"!=typeof e)return e;if("getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case 1:return function(e,t){const r={spatialReference:t};let n=2;_t(e,r);const o=e.coords;return r.x=o[0],r.y=o[1],e.has_z&&(r.z=o[n],n++),e.has_m&&(r.m=o[n]),new se.A(r)}(e,r);case 2:return function(e,t){const r={spatialReference:t},n=_t(e,r),o=e.lengths,a=e.coords,i=o[0];r.points=[];let s=0;for(let e=0;e<i;e++){const e=[];for(let t=0;t<n;t++)e[t]=a[s],s++;r.points.push(e)}return new ie.A(r)}(e,r);case 3:return function(e,t){const{paths:r,hasM:n,hasZ:o}=mt(e,3);return new le.A({paths:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 4:return function(e,t){const{paths:r,hasM:n,hasZ:o}=mt(e,4);return new de.A({rings:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 5:case 7:return vt().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;default:return vt().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return vt().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case 0:return function(e,t,r){return new gt.A(At(e,t,r))}(e,t,r);case 1:return Ct(e,t,r);case 2:return Gt(e,t,r);case 3:return function(e,t,r){const n=e.entity_count(),o=e.relationship_count(),a=[];for(let i=0;i<n;i++)a.push(Ct(e.get_entity_at(i),t,r)),i<o&&a.push(Gt(e.get_relationship_at(i),t,r));return new ft.A({path:a})}(e,t,r);case 4:return function(e,t,r){const n=[],o=e.count();for(let a=0;a<o;a++){const o=e.get_value_at(a);n.push(bt(o,t,r))}return n}(e,t,r);default:return vt().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}})(e,t,r)}function Ct(e,t,r){const n=e.type_name,o=At(e,t,r),a=e.get_id();return new yt.A(Object.assign({typeName:n,id:a},o))}function At(e,t,r){const n={},o=e.key_count();for(let a=0;a<o;a++)n[e.get_key_at(a)]=bt(e.get_value_at(a),t,r);return{properties:n}}function Gt(e,t,r){const n=e.type_name,o=At(e,t,r);return new wt.A(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},o))}function Mt(e){const t=[];for(let r=0;r<e.get_header_keys().size();r++)t.push(e.get_header_keys().get(r));const r=new p.A(e.get_out_sr());return new U({headerKeys:t,outSpatialReference:r,exceededTransferLimit:e.exceeded_transfer_limit()})}let xt=class extends c.A{constructor(e){super(e),this.hasError=!1,this.error=null,this.editResults=[],this.cascadeRelationshipDeleteResults=[],this.cascadeProvenanceDeleteResults=[]}};(0,u.Cg)([(0,h.MZ)()],xt.prototype,"hasError",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"error",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"editResults",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"cascadeRelationshipDeleteResults",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"cascadeProvenanceDeleteResults",void 0),xt=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphApplyEditsResult")],xt);const Tt=xt;function Pt(e){const t=e.has_error(),r=new Tt({hasError:t,error:t?re(e.error):null}),n=e.get_edit_results_count();for(let t=0;t<n;t++){const n=e.get_edit_results_at(t);n.deleteLater();const o=e.get_edit_results_type_name_at(t),a=[],i=[],s=[],d=n.get_add_results_count(),l=n.get_update_results_count(),p=n.get_delete_results_count();for(let e=0;e<d;e++){const t=n.get_add_result_at(e);t.deleteLater(),a.push({id:t.id,error:re(t.error)})}for(let e=0;e<l;e++){const t=n.get_update_result_at(e);t.deleteLater(),i.push({id:t.id,error:re(t.error)})}for(let e=0;e<p;e++){const t=n.get_delete_result_at(e);t.deleteLater(),s.push({id:t.id,error:re(t.error)})}r.editResults.push({typeName:o,adds:a,updates:i,deletes:s})}const o=e.get_cascaded_rel_deletes_count();for(let t=0;t<o;t++){const n=e.get_cascaded_rel_deletes_at(t);n.deleteLater();const o=e.get_cascaded_rel_deletes_type_name_at(t),a=[];for(let e=0;e<n.get_count();e++){const t=n.get_result_at(e);t.deleteLater(),a.push({id:t.id,originId:t.origin_id,destinationId:t.dest_id,error:re(t.error)})}r.cascadeRelationshipDeleteResults.push({typeName:o,cascadeRelationshipDeletes:a})}if(e.has_cascading_provenance_deletes()){const t=e.get_cascading_provenance_deletes();t.deleteLater();const n=t.get_count();for(let e=0;e<n;e++){const n=t.get_result_at(e);n.deleteLater(),r.cascadeProvenanceDeleteResults.push({id:n.id,error:re(n.error)})}}return r}const kt=new Map,St=()=>new Map(kt.entries()),Rt={fetchKnowledgeGraph:async e=>{const t=new ee({url:e}),r=[];return r.push(Bt(t)),r.push(Ht(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await cr(e)},refreshServiceDefinition:async e=>{const t=(await(0,a.A)(e.url,{query:{f:"json"}})).data;return t.capabilities=t?.capabilities?.split(","),t.supportedQueryFormats=t?.supportedQueryFormats?.split(","),e.serviceDefinition=new X(t),e.serviceDefinition},executeFindPathsAsynchronous:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],o=(await nr(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await rr(`${n}${a}`,{in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:e.config.toJSON(),result_type:"STRING"},{},t)},executeFindPaths:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],o=(await nr(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,s=await nr(`${n}${a}`,{method:"post",query:{f:"pjson",in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:JSON.stringify(e.config),result_type:"STRING"},...t});if(s.data.results.length<1)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results returned",s);let d;for(const e of s.data.results)if("out_results_string"===e.paramName){d=e.value;break}if(!d)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results were returned on the expected paramater out_results_string",s);return d},fetchAsynchronousFindPathsResultData:async(e,t)=>(await e.fetchResultData("out_results_string",null,t)).value,executeQueryStreaming:async(e,t,r)=>{const n=`${e.url}/graph/query`;await or(e);const o=await ir(n,r);if(!e.serviceDefinition?.supportsProvenance&&"include"===t.provenanceBehavior)throw new i.A("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");o.data.body=await async function(e,t){const r=await(0,ae.I)(),n=new r.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=r.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[t,o]of Object.entries(e.bindParameters))ar(t,o,n,r);if(e.bindGeometryQuantizationParameters)!function(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await Bt(t),4326!==t.dataModel?.spatialReference?.wkid)throw new i.A("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=r.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&function(e,t,r){if(!e.extent)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);t.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:r.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}(e.outputQuantizationParameters,n,r),e.provenanceBehavior&&function(e,t){t.provenance_behavior={value:pe[e]}}(e.provenanceBehavior,n);try{n.encode()}catch(e){throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:e})}const o=n.get_encoding_result();if(0!==o.error.error_code)throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}(t,e);const a=await tr(o.data.url,o.data);if(e.dataModel){const t=await ur(a,e.dataModel);return new J({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,r)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new i.A("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await or(e);const o=await ir(n,r);return o.data.body=await async function(e,t){if(t.dataModel||await Bt(t),!t.dataModel)throw new i.A("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const r=await(0,ae.I)(),n=!!e.options?.cascadeDelete,o=!!e.options?.cascadeProvenanceDelete,a=new r.GraphApplyEditsEncoder(r.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?function(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.options?.inputQuantizationParameters):r.InputQuantizationUtil.WGS84_lossless());a.deleteLater(),a.cascade_delete=n,a.cascade_delete_provenance=o;try{let t;e.entityAdds?.forEach(e=>{t=a.add_entity(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(e=>{if(!e.originId||!e.destinationId)throw new i.A("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=a.add_relationship(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(e=>{if(!e.id)throw new i.A("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=a.update_entity(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(e=>{if(!e.id)throw new i.A("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=a.update_relationship(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(e=>{if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=a.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach(e=>{t.delete_by_id(e)})}),e.relationshipDeletes?.forEach(e=>{if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=a.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),a.encode()}catch(e){throw new i.A("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const s=a.get_encoding_result();return te(s.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(s.get_byte_buffer())}(t,e),async function(e){return sr(e,(await(0,ae.I)()).GraphApplyEditsDecoder,Pt)}(await tr(o.data.url,o.data))},executeAddNamedTypes:async(e,t,r)=>{if(!t.newEntityTypes?.length&&!t.newRelationshipTypes?.length)throw new i.A("knowledge-graph:no-arguments","The operation to add types to the data model contained no values");const n=`${e.url}/dataModel/edit/namedTypes/add`;await or(e);const o=await ir(n,r);o.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphNamedObjectTypeAddsRequestEncoder;r.deleteLater(),e.newEntityTypes?.forEach(e=>{r.add_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),_e(e,t,r)}(e,t))}),e.newRelationshipTypes?.forEach(e=>{r.add_relationship_type(function(e,t){const r=new t.RelationshipType;r.deleteLater();for(const n of e.endPoints){const e=new t.EndPoint;e.deleteLater(),e.origin_entity_type=n.originEntityType,e.dest_entity_type=n.destinationEntityType,r.add_end_point(e)}return _e(e,t,r)}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed",{error:e})}const n=r.get_encoding_result();return te(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),structuredClone(n.get_byte_buffer())}(t);const a=await tr(o.data.url,o.data),s=await async function(e){return sr(e,(await(0,ae.I)()).GraphNamedObjectTypeAddsResponseDecoder,Ue)}(a);return s.updatedKnowledgeGraph=await Qt(e.url),s},executeDeleteNamedType:async(e,t,r)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to delete a named type from the data model contained no value");const n=`${e.url}/dataModel/edit/namedTypes/${t}/delete`;await or(e);const o=await ir(n,r);o.data.body="";const a=await tr(o.data.url,o.data),s=await async function(e){return sr(e,(await(0,ae.I)()).GraphNamedObjectTypeDeleteResponseDecoder,Je)}(a);return s.updatedKnowledgeGraph=await Qt(e.url),s},executeUpdateNamedType:async(e,t,r,n)=>{if(!t&&!Object.keys(r).length)throw new i.A("knowledge-graph:no-arguments","The operation to update types in the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/update`;await or(e);const a=await ir(o,n);a.data.body=await async function(e,t,r){const n=await(0,ae.I)(),o=new n.GraphNamedObjectTypeUpdateRequestEncoder;if(o.deleteLater(),r.entityTypes.some(e=>e.name===t))o.update_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),ve(e,r)}(e,n));else{if(!r.relationshipTypes.some(e=>e.name===t))throw new i.A("knowledge-graph:updateNamedType-encoding-failed","The named type you are trying to update does not exist in the data model");o.update_relationship_type(function(e,t){const r=new t.RelationshipType;return r.deleteLater(),ve(e,r)}(e,n))}o.update_alias=e.hasOwnProperty("alias");try{o.encode()}catch(e){throw new i.A("knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed",{error:e})}const a=o.get_encoding_result();return te(a.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),structuredClone(a.get_byte_buffer())}(r,t,e.dataModel);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphNamedObjectTypeUpdateResponseDecoder,ze)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeAddGraphProperties:async(e,t,r,n)=>{if(!t&&!r.length)throw new i.A("knowledge-graph:no-arguments","The operation to add properties to the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/add`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphPropertyAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_graph_property(we(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed",{error:e})}const n=r.get_encoding_result();return te(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),structuredClone(n.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphPropertyAddsResponseDecoder,Ke)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeDeleteGraphProperty:async(e,t,r,n)=>{if(!t&&!r)throw new i.A("knowledge-graph:no-arguments","The operation to delete property contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/delete`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=new((await(0,ae.I)()).GraphPropertyDeleteRequestEncoder);t.deleteLater(),t.field_name=e;try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed",{error:e})}const r=t.get_encoding_result();return te(r.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),structuredClone(r.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphPropertyDeleteResponseDecoder,Ve)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeUpdateGraphProperty:async(e,t,r,n,o)=>{if(!t&&!r&&!Object.keys(n).length)throw new i.A("knowledge-graph:no-arguments","The operation to update properties in the data model contained missing or empty values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/fields/update`;await or(e);const s=await ir(a,o);s.data.body=await async function(e,t){const r=await(0,ae.I)(),n=new r.GraphPropertyUpdateRequestEncoder;n.deleteLater(),n.update_graph_property(function(e,t){const r=new t.GraphProperty;return r.deleteLater(),e.hasOwnProperty("alias")&&(r.alias=e.alias),e.hasOwnProperty("editable")&&(r.editable=e.editable),e.hasOwnProperty("required")&&(r.required=e.required),e.hasOwnProperty("defaultVisibility")&&(r.default_visibility=e.defaultVisibility),e.hasOwnProperty("defaultValue")&&(r.default_value=be(e.defaultValue,t)),r}(t,r)),n.set_property_name(e),n.update_alias=t.hasOwnProperty("alias"),n.update_editable=t.hasOwnProperty("editable"),n.update_required=t.hasOwnProperty("required"),n.update_visible=t.hasOwnProperty("defaultVisibility"),n.update_default_value=t.hasOwnProperty("defaultValue");try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed",{error:e})}const o=n.get_encoding_result();return te(o.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),structuredClone(o.get_byte_buffer())}(r,n);const d=await tr(s.data.url,s.data),l=await async function(e){return sr(e,(await(0,ae.I)()).GraphPropertyUpdateResponseDecoder,Qe)}(d);return l.updatedKnowledgeGraph=await Qt(e.url),l},executeAddGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/add`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphIndexAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_field_index(function(e,t){const r=new t.FieldIndex;r.deleteLater(),r.name=e.name,r.unique=e.unique,r.ascending=e.ascending,r.description=e.description??"";for(const t of e.fieldNames)r.add_field(t);return r}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed",{error:e})}const n=r.get_encoding_result();return te(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),structuredClone(n.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphIndexAddsResponseDecoder,He)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeDeleteGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/delete`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=new((await(0,ae.I)()).GraphIndexDeleteRequestEncoder);t.deleteLater(),e.forEach(e=>{t.add_index_name(e)});try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed",{error:e})}const r=t.get_encoding_result();return te(r.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),structuredClone(r.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphIndexDeleteResponseDecoder,We)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeUpdateSearchIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!Object.keys(r.addSearchProperties??{}).length&&!Object.keys(r.removeSearchProperties??{}).length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty properties values");const o=`${e.url}/dataModel/searchIndex/update`;await or(e);const a=await ir(o,n);a.data.body=await async function(e,t){const r=await(0,ae.I)(),n=new r.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,me(t.addSearchProperties,r)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,me(t.removeSearchProperties,r));try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed",{error:e})}const o=n.get_encoding_result();return te(o.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),structuredClone(o.get_byte_buffer())}(t,r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphUpdateSearchIndexResponseDecoder,Be)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeQuery:async(e,t,r)=>{const n=`${e.url}/graph/query`,o=await(0,a.A)(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...r?.query},signal:r?.signal,timeout:r?.timeout}),s=o.getHeader?.("content-type"),d=o.data;if(s?.includes("application/x-protobuf")){const t=new((await(0,ae.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=pr({wasmQueryDecoder:t,newArrayBufferToParse:d,dataModel:e.dataModel});return new z({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:o.data})},executeSearch:async(e,t,r)=>{const n="provenance"===t.typeCategoryFilter?"metaEntityProvenance":t.typeCategoryFilter,o=`${e.url}/graph/search`,s=await(0,a.A)(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:n,...r?.query},signal:r?.signal,timeout:r?.timeout}),d=s.getHeader?.("content-type"),l=s.data;if(d?.includes("application/x-protobuf")){const t=new((await(0,ae.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=pr({wasmQueryDecoder:t,newArrayBufferToParse:l,dataModel:e.dataModel});return new z({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:d,data:s.data})},executeSearchStreaming:async(e,t,r)=>{const n=`${e.url}/graph/search`;await or(e);const o=await ir(n,r);o.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphSearchRequestEncoder;r.deleteLater(),r.search_query=e.searchQuery;const n="provenance"===e.typeCategoryFilter?"meta_entity_provenance":e.typeCategoryFilter;if(r.type_category_filter=t.esriNamedTypeCategory[n],!0===e.returnSearchContext&&(r.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(r.start_index=e.start),null!=e.num&&(r.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{r.set_ids_filter(ue(e.idsFilter,t))}catch(e){throw new i.A("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:e})}e.namedTypesFilter?.forEach(e=>{r.add_named_type_filter(e)});try{r.encode()}catch(e){throw new i.A("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:e})}const o=r.get_encoding_result();if(0!==o.error.error_code)throw new i.A("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}(t);const a=await tr(o.data.url,o.data);if(e.dataModel){const t=await ur(a,e.dataModel);return new J({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,t,r={ignoreCache:!1})=>{if(!t.length)return new Map;let n=kt.get(e.url||"");n||(n=new Map,kt.set(e.url||"",n));const o=new Map(n.entries()),a=`${e.url}/clientData/fetch`;t=Array.from(new Set(t));const s=await(0,ae.I)(),d=ne(t,n,s,r.ignoreCache),l=await ir(a,r.requestOptions);l.data.body=d;const p=await tr(l.data.url,l.data),u=p.headers.get("content-type");if(u?.includes("application/x-protobuf")){const e=new s.ClientDataFetchResponseDecoder;e.deleteLater();const t=await p.arrayBuffer();return e.decode(new Uint8Array(t)),e.has_error()&&te(e.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e,t,r,n=!1){const o=new Map;for(let a=0;a<e.get_results_count();a++){const i=e.get_result_at(a);if(2!==i.get_fetch_result_case().value||0!==i.error().error_code){const e=i.get_key().key_string;r.has(e)&&t.delete(e);continue}const s=i.get_value(),d=i.get_key().key_string,l=r.get(d);let p;if(2===s.get_data_case().value&&l)p=l.value;else{if(1!==s.get_data_case().value)continue;{p=s.get_data().client_data_string;const e=i.get_value().get_v_tag().v_tag;n||t.set(d,{key:d,version:e,value:p})}}o.set(d,p)}return o}(e,n,o,r.ignoreCache)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:u,data:p})},fetchAllClientDataKeys:async(e,t)=>{const r=`${e.url}/clientData`,n=await(0,a.A)(r,{responseType:"array-buffer",query:{f:"pbf"},signal:t?.signal,timeout:t?.timeout}),o=n.getHeader?.("content-type"),s=n.data;if(o?.includes("application/x-protobuf")){const e=new((await(0,ae.I)()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(s)),e.has_error()&&te(e.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e){const t=e.get_keys(),r=new Array;for(let e=0;e<t.get_keys_count();e++){const n=t.get_key_at(e);1===n.get_client_data_key_type().value&&r.push(n.key_string)}return r}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})},clearClientDataCache:()=>kt.clear(),_fetchWrapper:async(e,t)=>fetch(e,t),_submitJobWrapper:async(e,t,r,n)=>async function(e,t,r,n){return r=w.from(r||{}),async function(e,t,r,n,o){const i={},s={},d=[];return function(e,t,r){for(const n in e){const o=e[n];if(o&&"object"==typeof o&&o instanceof T.A){const{features:e}=o;r[n]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}}}(n,d,i),(0,m.el)(d).then(d=>{const{outSpatialReference:l,processExtent:p,processSpatialReference:u,returnColumnName:c,returnFeatureCollection:h,returnM:y,returnZ:g}=r,{path:f}=(0,C.Dl)(e);for(const e in i){const[t,r]=i[e];s[e]=d.slice(t,r)}const w=l?l.wkid||l:null,m=u?u.wkid||u:null,_="execute"===t?{returnColumnName:c||void 0,returnFeatureCollection:h||void 0,returnM:y||void 0,returnZ:g||void 0}:null,v=F({...p?{context:{extent:p,outSR:w,processSR:m}}:{"env:outSR":w,"env:processSR":m},...n,..._,f:"json"},null,s),b={...o,query:v};return(0,a.A)(`${f}/${t}`,b)})}(e,"submitJob",r,t??{},n).then(({data:t})=>{const r=L.fromJSON(t);return r.sourceUrl=e,r})}(e,t,r,n),_esriRequestWrapper:async(e,t)=>(0,a.A)(e,t)};async function jt(e,t,r){return Rt.executeApplyEdits(e,t,r)}async function It(e,t,r){return Rt.executeAddNamedTypes(e,t,r)}async function Dt(e,t,r){return Rt.executeDeleteNamedType(e,t,r)}async function Zt(e,t,r,n){return Rt.executeUpdateNamedType(e,t,r,n)}async function Et(e,t,r,n){return Rt.executeAddGraphProperties(e,t,r,n)}async function Ft(e,t,r,n){return Rt.executeDeleteGraphProperty(e,t,r,n)}async function Nt(e,t,r,n,o){return Rt.executeUpdateGraphProperty(e,t,r,n,o)}async function qt(e,t,r,n){return Rt.executeAddGraphFieldIndex(e,t,r,n)}async function $t(e,t,r,n){return Rt.executeDeleteGraphFieldIndex(e,t,r,n)}async function Ot(e,t,r,n){return Rt.executeUpdateSearchIndex(e,t,r,n)}async function Lt(e,t,r){return Rt.executeQuery(e,t,r)}async function Ut(e,t,r){return Rt.executeQueryStreaming(e,t,r)}async function zt(e,t,r){return Rt.executeSearch(e,t,r)}async function Jt(e,t,r){return Rt.executeSearchStreaming(e,t,r)}function Kt(e,t){return Rt.fetchAllClientDataKeys(e,t)}function Vt(e,t,r){return Rt.fetchClientDataAtKeys(e,t,r)}async function Qt(e){return Rt.fetchKnowledgeGraph(e)}async function Bt(e){return Rt.refreshDataModel(e)}async function Ht(e){return Rt.refreshServiceDefinition(e)}async function Wt(e,t){return Rt.executeFindPathsAsynchronous(e,t)}async function Yt(e,t){return Rt.executeFindPaths(e,t)}async function Xt(e,t){return Rt.fetchAsynchronousFindPathsResultData(e,t)}function er(){return Rt.clearClientDataCache()}async function tr(e,t){return Rt._fetchWrapper(e,t)}async function rr(e,t,r,n){return Rt._submitJobWrapper(e,t,r,n)}async function nr(e,t){return Rt._esriRequestWrapper(e,t)}async function or(e){const t=o.id?.findCredential(e.url);t||(e.dataModel?await cr(e):await Bt(e))}function ar(e,t,r,n){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof l.A?r.set_param_key_value(e,he(t,n)):Array.isArray(t)?r.set_param_key_value(e,ue(t,n)):r.set_param_key_value(e,ce(t,n))}async function ir(e,t){return(0,a.A)(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...t?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:t?.signal,timeout:t?.timeout})}async function sr(e,t,r){const n=e.headers.get("content-type");if(n?.includes("application/x-protobuf")){const n=await e.arrayBuffer(),o=new t;try{return o.decode(new Uint8Array(n)),r(o)}finally{o.deleteLater()}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:await e.text()})}let dr=50;function lr(e){dr=e}function pr({wasmQueryDecoder:e,newArrayBufferToParse:t,dataModel:r,decodedHeader:n,limitMaxProcessingTime:o=!1}){t&&e.push_buffer(new Uint8Array(t));const a=[];let s,d,l=0;const u=Date.now();let c=!0;for(;e.next_row();){s&&d||(s=n??Mt(e),d=s.outSpatialReference??new p.A({wkid:4326})),l||(l=e.get_header_keys().size());const t=new Array(l);for(let n=0;n<l;n++){const o=e.get_value(n);t[n]=bt(o,r,d)}if(a.push(t),o&&Date.now()-u>dr){c=!1;break}}if(e.has_error())throw new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - inner row decoding",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return{resultHeader:s,resultRows:a,parsedAllResultsFromBuffer:c}}async function ur(e,t){const r=e.headers.get("content-type");if(e.headers.get("content-length")&&s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),r?.includes("application/x-protobuf")){const r=e.body?.getReader(),n=new((await(0,ae.I)()).GraphQueryDecoder);let o,a,l;n.deleteLater();const p=new Promise((e,t)=>{a=e,l=t});let u=!1,c=null;const h=new ReadableStream({pull:async function e(p){if(!r){const e=new i.A("knowledge-graph:stream-decoding-error","Error reading from stream - reader is undefined");throw l(e),e}const{done:h,value:y}=c?{done:!1,value:null}:await r.read().catch(e=>{throw l(e),r.releaseLock(),e});y&&(c=y);try{if(h){let e;if(n.has_error()?e=new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:n.error.error_code,errorMessage:n.error.error_message}):u||a(new U),r.releaseLock(),e)throw p.error(e),l(e),e;return void p.close()}const{resultHeader:s,resultRows:d,parsedAllResultsFromBuffer:g}=pr({wasmQueryDecoder:n,newArrayBufferToParse:y,dataModel:t,decodedHeader:o,limitMaxProcessingTime:!0});return g&&(c=null),!o&&s&&(o=s,a(s),u=!0),d.length>0?void p.enqueue(d):await e(p)}catch(e){throw s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(e),l(e),r.releaseLock(),(0,d.zf)(e)?e:new i.A("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:e})}}});return{readableStream:h,resultHeader:await p}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}async function cr(e){const t=`${e.url}/dataModel/queryDataModel`,r=await(0,a.A)(t,{responseType:"array-buffer",query:{f:"pbf"}}),n=r.getHeader?.("content-type"),o=r.data;if(n?.includes("application/x-protobuf")){const e=(await(0,ae.I)()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!e)throw new i.A("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return function(e){e.deleteLater(),et=!1;const t=new Y({timestamp:e.timestamp,spatialReference:new p.A(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:(0,Ye.i7)(ge.vy,e.identifier_info?.identifier_mapping_info?.identifier_info_type?.value),databaseNativeIdentifier:e.identifier_info?.identifier_mapping_info?.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:e.identifier_info?.identifier_mapping_info?.uniform_property_identifier?.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:(0,Ye.i7)(ge.wr,e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value)}},searchIndexes:ht(e.search_indexes),entityTypes:st(e.entity_types),relationshipTypes:ut(e.relationship_types),metaEntityTypes:st(e.meta_entity_types),provenanceSourceTypeValues:ct(e.provenance_source_type_values.value_behavior_array)});return et&&s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("A big integer field was detected in the retrieved data model. The `big-integer` field type is not fully supported in web clients. Please see https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type"),t}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:r.data})}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2568],{35448:(e,t,r)=>{r.d(t,{Eq:()=>n,bV:()=>a,nP:()=>s,r5:()=>o,ti:()=>d,vy:()=>l,wr:()=>i});const n={Regular:0,Provenance:1,Document:2},o={esriFieldTypeSmallInteger:0,esriFieldTypeInteger:1,esriFieldTypeSingle:2,esriFieldTypeDouble:3,esriFieldTypeString:4,esriFieldTypeDate:5,esriFieldTypeOID:6,esriFieldTypeGeometry:7,esriFieldTypeBlob:8,esriFieldTypeRaster:9,esriFieldTypeGUID:10,esriFieldTypeGlobalID:11,esriFieldTypeXML:12,esriFieldTypeBigInteger:13,esriFieldTypeDateOnly:14,esriFieldTypeTimeOnly:15,esriFieldTypeTimestampOffset:16},a={esriGeometryNull:0,esriGeometryPoint:1,esriGeometryMultipoint:2,esriGeometryPolyline:3,esriGeometryPolygon:4,esriGeometryEnvelope:5,esriGeometryAny:7,esriGeometryMultiPatch:9},i={esriMethodHintUNSPECIFIED:0,esriUUIDESRI:1,esriUUIDRFC4122:2},s={esriTypeUNSPECIFIED:0,esriTypeEntity:1,esriTypeRelationship:2,esriTypeBoth:4,esriTypeMetaEntityProvenance:8},d={esriGraphPropertyUNSPECIFIED:0,esriGraphPropertyRegular:1,esriGraphPropertyDocumentName:2,esriGraphPropertyDocumentTitle:3,esriGraphPropertyDocumentUrl:4,esriGraphPropertyDocumentText:5,esriGraphPropertyDocumentKeywords:6,esriGraphPropertyDocumentContentType:7,esriGraphPropertyDocumentMetadata:8,esriGraphPropertyDocumentFileExtension:9,esriGraphPropertyProvenanceInstanceId:10,esriGraphPropertyProvenanceSourceType:11,esriGraphPropertyProvenanceSourceName:12,esriGraphPropertyProvenanceSource:13,esriGraphPropertyProvenanceComment:14,esriGraphPropertyProvenanceTypeName:15,esriGraphPropertyProvenancePropertyName:16},l={esriIdentifierInfoTypeUNSPECIFIED:0,esriIdentifierInfoTypeDatabaseNative:1,esriIdentifierInfoTypeUniformProperty:2}},45724:(e,t,r)=>{r.d(t,{I:()=>d});var n=r(2741),o=r(44208);const a="esri/rest/knowledgeGraph/wasmInterface/";let i,s;async function d(){const e=i??s;if(e)return e;const t=!!(0,o.A)("wasm-simd");return s=l(t),s}async function l(e){if(e){const{default:e}=await r.e(5367).then(r.bind(r,15367)).then(e=>e.a);return e({locateFile:e=>(0,n.s)(a+e)})}const{default:t}=await r.e(9013).then(r.bind(r,29013)).then(e=>e.a);return t({locateFile:e=>(0,n.s)(a+e)})}},62568:(e,t,r)=>{r.r(t),r.d(t,{_checkAuthentication:()=>or,_esriRequestWrapper:()=>nr,_fetchWrapper:()=>tr,_getClientDataCacheCopy:()=>St,_setMaxQueryParsingDurationForTesting:()=>lr,_submitJobWrapper:()=>rr,clearClientDataCache:()=>er,clientDataCache:()=>kt,executeAddGraphFieldIndex:()=>qt,executeAddGraphProperties:()=>Et,executeAddNamedTypes:()=>It,executeApplyEdits:()=>jt,executeDeleteGraphFieldIndex:()=>$t,executeDeleteGraphProperty:()=>Ft,executeDeleteNamedType:()=>Dt,executeFindPaths:()=>Yt,executeFindPathsAsynchronous:()=>Wt,executeQuery:()=>Lt,executeQueryStreaming:()=>Ut,executeSearch:()=>zt,executeSearchStreaming:()=>Jt,executeUpdateGraphProperty:()=>Nt,executeUpdateNamedType:()=>Zt,executeUpdateSearchIndex:()=>Ot,fetchAllClientDataKeys:()=>Kt,fetchAsynchronousFindPathsResultData:()=>Xt,fetchClientDataAtKeys:()=>Vt,fetchKnowledgeGraph:()=>Qt,kgRestServices:()=>Rt,refreshDataModel:()=>Bt,refreshServiceDefinition:()=>Ht});var n,o=r(70333),a=r(78888),i=r(49186),s=r(53966),d=r(74887),l=r(91075),p=r(16930),u=r(31635),c=r(69622),h=r(10107),y=r(56507),g=(r(44208),r(87811),r(64108)),f=r(5443);let w=n=class extends c.A{constructor(e){super(e),this.outSpatialReference=null,this.processExtent=null,this.processSpatialReference=null,this.returnColumnName=!1,this.returnFeatureCollection=!1,this.returnM=!1,this.returnZ=!1}static from(e){return(0,y.PZ)(n,e)}};(0,u.Cg)([(0,h.MZ)({type:p.A})],w.prototype,"outSpatialReference",void 0),(0,u.Cg)([(0,h.MZ)({type:f.A})],w.prototype,"processExtent",void 0),(0,u.Cg)([(0,h.MZ)({type:p.A})],w.prototype,"processSpatialReference",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnColumnName",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnFeatureCollection",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnM",void 0),(0,u.Cg)([(0,h.MZ)({nonNullable:!0})],w.prototype,"returnZ",void 0),w=n=(0,u.Cg)([(0,g.$)("esri.rest.geoprocessor.GPOptions")],w);var m=r(17136),_=r(20437),v=r(25482);let b=class extends v.o{constructor(e){super(e),this.extent=null,this.height=null,this.href=null,this.opacity=1,this.rotation=0,this.scale=null,this.visible=!0,this.width=null}};(0,u.Cg)([(0,h.MZ)({type:f.A})],b.prototype,"extent",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"height",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"href",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"opacity",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"rotation",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"scale",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"visible",void 0),(0,u.Cg)([(0,h.MZ)()],b.prototype,"width",void 0),b=(0,u.Cg)([(0,g.$)("esri.layers.support.MapImage")],b);var C=r(2272),A=r(93223),G=r(2073);let M=class extends v.o{constructor(e){super(e),this.area=0,this.units=null}};(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],M.prototype,"area",void 0),(0,u.Cg)([(0,A.e)(G.UO)],M.prototype,"units",void 0),M=(0,u.Cg)([(0,g.$)("esri.rest.support.ArealUnit")],M);let x=class extends v.o{constructor(e){super(e),this.itemId=null,this.url=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{read:{source:"itemID"},write:{target:"itemID"}}})],x.prototype,"itemId",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],x.prototype,"url",void 0),x=(0,u.Cg)([(0,g.$)("esri.rest.support.DataFile")],x);var T=r(22671);let P=class extends v.o{constructor(e){super(e),this.distance=0,this.units=null}};(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],P.prototype,"distance",void 0),(0,u.Cg)([(0,A.e)(G.Y8)],P.prototype,"units",void 0),P=(0,u.Cg)([(0,g.$)("esri.rest.support.LinearUnit")],P);var k=r(66552);const S="multi-value-",R=new k.J({GPArealUnit:"areal-unit",GPBoolean:"boolean",GPComposite:"composite",GPDataFile:"data-file",GPDate:"date",GPDouble:"double",GPFeatureRecordSetLayer:"feature-record-set-layer",Field:"field",GPLinearUnit:"linear-unit",GPLong:"long",GPRasterData:"raster-data",GPRasterDataLayer:"raster-data-layer",GPRecordSet:"record-set",GPString:"string",GPValueTable:"value-table","GPMultiValue:GPArealUnit":`${S}areal-unit`,"GPMultiValue:GPBoolean":`${S}boolean`,"GPMultiValue:GPComposite":`${S}composite`,"GPMultiValue:GPDataFile":`${S}data-file`,"GPMultiValue:GPDate":`${S}date`,"GPMultiValue:GPDouble":`${S}double`,"GPMultiValue:GPFeatureRecordSetLayer":`${S}feature-record-set-layer`,"GPMultiValue:Field":`${S}field`,"GPMultiValue:GPLinearUnit":`${S}linear-unit`,"GPMultiValue:GPLong":`${S}long`,"GPMultiValue:GPRasterData":`${S}raster-data`,"GPMultiValue:GPRasterDataLayer":`${S}raster-data-layer`,"GPMultiValue:GPRecordSet":`${S}record-set`,"GPMultiValue:GPString":`${S}string`});let j=class extends v.o{constructor(e){super(e),this.dataType=null,this.paramName=null,this.value=null}};(0,u.Cg)([(0,A.e)(R,{ignoreUnknown:!1})],j.prototype,"dataType",void 0),(0,u.Cg)([(0,h.MZ)()],j.prototype,"paramName",void 0),(0,u.Cg)([(0,h.MZ)()],j.prototype,"value",void 0),j=(0,u.Cg)([(0,g.$)("esri.rest.support.ParameterValue")],j);var I=r(36005);let D=class extends v.o{constructor(e){super(e),this.format=null,this.itemId=null,this.type=null,this.url=null}readType(e){return"ImageService"===e?"image-service":null}};async function Z(e,t){switch(e){case"areal-unit":return M.fromJSON(t);case"boolean":case"double":case"long":case"string":case"value-table":return t;case"date":return new Date(t);case"data-file":return x.fromJSON(t);case"linear-unit":return P.fromJSON(t);case"feature-record-set-layer":if("url"in t)return x.fromJSON(t);if("layerDefinition"in t){const e=new(0,(await Promise.all([r.e(7330),r.e(3508),r.e(6554),r.e(8303),r.e(4903),r.e(1214),r.e(9953),r.e(1956),r.e(8399),r.e(1017),r.e(957),r.e(8506),r.e(8654),r.e(3548)]).then(r.bind(r,68654))).default),{layerDefinition:n,featureSet:o}=t;return e.read({layerDefinition:n,featureSet:o},{origin:"portal-item"}),e.spatialReference=p.A.fromJSON(o.spatialReference??n.spatialReference??n.extent.spatialReference),e}return T.A.fromJSON(t);case"record-set":return"url"in t?x.fromJSON(t):T.A.fromJSON(t);case"raster-data":case"raster-data-layer":return"mapImage"in t?b.fromJSON(t.mapImage):D.fromJSON(t);case"field":return _.A.fromJSON(t)}}async function E(e){const t=R.fromJSON(e.dataType),{paramName:r}=e,n=function(e){return e.startsWith(S)}(t)?await async function(e,t){const r=function(e){return e.replace(S,"")}(e),n="composite"===r?t.map(e=>Z(R.fromJSON(e.dataType),e.value)):t.map(e=>Z(r,e));return Promise.all(n)}(t,e.value):await Z(t,e.value);return new j({dataType:t,paramName:r,value:n})}function F(e,t,r){for(const t in e){const r=e[t];Array.isArray(r)?e[t]=JSON.stringify(r.map(e=>F({item:e},!0).item)):r instanceof Date&&(e[t]=r.getTime())}return(0,C.lF)(e,t,r)}(0,u.Cg)([(0,h.MZ)()],D.prototype,"format",void 0),(0,u.Cg)([(0,h.MZ)({json:{name:"itemID",write:!0}})],D.prototype,"itemId",void 0),(0,u.Cg)([(0,h.MZ)()],D.prototype,"type",void 0),(0,u.Cg)([(0,I.w)("type")],D.prototype,"readType",null),(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],D.prototype,"url",void 0),D=(0,u.Cg)([(0,g.$)("esri.rest.support.RasterData")],D);var N,q=r(37807);const $=(0,k.O)()({esriJobCancelled:"job-cancelled",esriJobCancelling:"job-cancelling",esriJobDeleted:"job-deleted",esriJobDeleting:"job-deleting",esriJobTimedOut:"job-timed-out",esriJobExecuting:"job-executing",esriJobFailed:"job-failed",esriJobNew:"job-new",esriJobSubmitted:"job-submitted",esriJobSucceeded:"job-succeeded",esriJobWaiting:"job-waiting"},{ignoreUnknown:!1}),O=1e3;let L=class extends v.o{static{N=this}constructor(e){super(e),this.jobId=null,this.jobStatus=null,this.messages=null,this.progress=null,this.requestOptions=null,this.sourceUrl=null,this._cancelJobTimer=void 0,this._jobCompletionTimer=void 0}async cancelJob(e){const{jobId:t,sourceUrl:r}=this,{path:n}=(0,C.Dl)(r),o={...this.requestOptions,...e,query:{f:"json"}},i=`${n}/jobs/${t}/cancel`,{data:s}=await(0,a.A)(i,o),{messages:l,jobStatus:p,progress:u}=N.fromJSON(s);return this.set({messages:l,jobStatus:p,progress:u}),"job-cancelled"===p?this:new Promise((t,r)=>{(0,d.u7)(o.signal,()=>{this.clearCancelJobTimer(),r((0,d.NK)())}),this.clearCancelJobTimer();const n=()=>{this._cancelJobTimer||r((0,d.NK)()),this.checkJobStatus(e).then(({jobStatus:e})=>{switch(e){case"job-cancelling":default:this._cancelJobTimer=setTimeout(n,O);break;case"job-deleted":case"job-deleting":case"job-executing":case"job-failed":case"job-new":case"job-submitted":case"job-succeeded":case"job-timed-out":case"job-waiting":r(this);break;case"job-cancelled":t(this)}}).catch(e=>{r(e)})};this._cancelJobTimer=setTimeout(n,O)})}destroy(){clearInterval(this._cancelJobTimer),clearInterval(this._jobCompletionTimer)}async checkJobStatus(e){const{path:t}=(0,C.Dl)(this.sourceUrl),r={...this.requestOptions,...e,query:{...e?.query,f:"json"}},n=`${t}/jobs/${this.jobId}`,{data:o}=await(0,a.A)(n,r),{messages:i,jobStatus:s,progress:d}=N.fromJSON(o);return this.set({messages:i,jobStatus:s,progress:d}),this}async fetchResultData(e,t,r){t=w.from(t||{});const{returnColumnName:n,returnFeatureCollection:o,returnM:i,returnZ:s,outSpatialReference:d}=t,{path:l}=(0,C.Dl)(this.sourceUrl),p=F({returnColumnName:n||null,returnFeatureCollection:o||null,returnM:i||null,returnZ:s||null,outSR:d,returnType:"data",f:"json",...r?.query},null),u={...this.requestOptions,...r,query:p},c=`${l}/jobs/${this.jobId}/results/${e}`,{data:h}=await(0,a.A)(c,u);return E(h)}async fetchResultImage(e,t,r){const{path:n}=(0,C.Dl)(this.sourceUrl),o=F({...t.toJSON(),f:"json"}),i={...this.requestOptions,...r,query:o},s=`${n}/jobs/${this.jobId}/results/${e}`,{data:d}=await(0,a.A)(s,i);return E(d)}async fetchResultMapImageLayer(){const{path:e}=(0,C.Dl)(this.sourceUrl),t=e.indexOf("/GPServer/"),n=`${e.slice(0,Math.max(0,t))}/MapServer/jobs/${this.jobId}`;return new(0,(await Promise.all([r.e(3508),r.e(6554),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(8399),r.e(957),r.e(364),r.e(7048),r.e(7656),r.e(7548)]).then(r.bind(r,7656))).default)({url:n})}async waitForJobCompletion(e={}){const{interval:t=O,signal:r,statusCallback:n,apiKey:o}=e;return new Promise((e,a)=>{(0,d.u7)(r,()=>{this.clearJobCompletionTimer(),a((0,d.NK)())}),this.clearJobCompletionTimer();const i=()=>{this._jobCompletionTimer||a((0,d.NK)()),this.checkJobStatus({query:{token:o}}).then(({jobStatus:r})=>{switch(r){case"job-succeeded":e(this);break;case"job-executing":case"job-new":case"job-submitted":case"job-waiting":n&&n(this),this._jobCompletionTimer=setTimeout(i,t);break;case"job-cancelled":case"job-cancelling":case"job-deleted":case"job-deleting":case"job-failed":case"job-timed-out":a(this);break;default:this._jobCompletionTimer=setTimeout(i,t)}}).catch(e=>{a(e)})};this._jobCompletionTimer=setTimeout(i,t)})}clearCancelJobTimer(){clearTimeout(this._cancelJobTimer),this._cancelJobTimer=void 0}clearJobCompletionTimer(){clearTimeout(this._jobCompletionTimer),this._jobCompletionTimer=void 0}};(0,u.Cg)([(0,h.MZ)()],L.prototype,"jobId",void 0),(0,u.Cg)([(0,A.e)($,{ignoreUnknown:!1})],L.prototype,"jobStatus",void 0),(0,u.Cg)([(0,h.MZ)({type:[q.A]})],L.prototype,"messages",void 0),(0,u.Cg)([(0,h.MZ)()],L.prototype,"progress",void 0),(0,u.Cg)([(0,h.MZ)()],L.prototype,"requestOptions",void 0),(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],L.prototype,"sourceUrl",void 0),L=N=(0,u.Cg)([(0,g.$)("esri.rest.support.JobInfo")],L);let U=class extends c.A{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};(0,u.Cg)([(0,h.MZ)()],U.prototype,"headerKeys",void 0),(0,u.Cg)([(0,h.MZ)()],U.prototype,"outSpatialReference",void 0),(0,u.Cg)([(0,h.MZ)()],U.prototype,"exceededTransferLimit",void 0),U=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphQueryResultHeader")],U);let z=class extends c.A{constructor(e){super(e),this.resultRows=[],this.resultHeader=new U}};(0,u.Cg)([(0,h.MZ)()],z.prototype,"resultRows",void 0),(0,u.Cg)([(0,h.MZ)()],z.prototype,"resultHeader",void 0),z=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphQueryResult")],z);let J=class extends c.A{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new U}};(0,u.Cg)([(0,h.MZ)()],J.prototype,"resultRowsStream",void 0),(0,u.Cg)([(0,h.MZ)()],J.prototype,"resultHeader",void 0),J=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],J);let K=class extends v.o{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=!0,this.description="",this.fieldNames=[]}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],K.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],K.prototype,"unique",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],K.prototype,"ascending",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],K.prototype,"description",void 0),(0,u.Cg)([(0,h.MZ)({type:[String],json:{write:!0}})],K.prototype,"fieldNames",void 0),K=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.FieldIndex")],K);let V=class extends v.o{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=!0,this.required=!1,this.defaultVisibility=!0,this.systemMaintained=null,this.role="esriGraphPropertyUNSPECIFIED",this.defaultValue=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"alias",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"fieldType",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"geometryType",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"hasM",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"hasZ",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"nullable",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"editable",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"required",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"defaultVisibility",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],V.prototype,"systemMaintained",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],V.prototype,"role",void 0),(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],V.prototype,"defaultValue",void 0),V=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphProperty")],V);let Q=class extends v.o{constructor(e){super(e),this.name=null,this.alias=null,this.role="Regular",this.strict=null,this.properties=[],this.fieldIndexes=[],this.type=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Q.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Q.prototype,"alias",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Q.prototype,"role",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],Q.prototype,"strict",void 0),(0,u.Cg)([(0,h.MZ)({type:[V],json:{write:!0}})],Q.prototype,"properties",void 0),(0,u.Cg)([(0,h.MZ)({type:[K],json:{write:!0}})],Q.prototype,"fieldIndexes",void 0),Q=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphObjectType")],Q);let B=class extends Q{constructor(e){super(e),this.type="entity"}};B=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.EntityType")],B);let H=class extends Q{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};(0,u.Cg)([(0,h.MZ)({json:{write:!0}})],H.prototype,"endPoints",void 0),H=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.RelationshipType")],H);let W=class extends v.o{constructor(e){super(e),this.value=null,this.behavior=null}};(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],W.prototype,"value",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],W.prototype,"behavior",void 0),W=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],W);let Y=class extends v.o{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=[],this.entityTypes=[],this.relationshipTypes=[],this.metaEntityTypes=[],this.provenanceSourceTypeValues=[]}};(0,u.Cg)([(0,h.MZ)({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e?.getTime()}}}})],Y.prototype,"timestamp",void 0),(0,u.Cg)([(0,h.MZ)({type:p.A,json:{write:!0}})],Y.prototype,"spatialReference",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],Y.prototype,"strict",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Y.prototype,"objectIdField",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Y.prototype,"globalIdField",void 0),(0,u.Cg)([(0,h.MZ)()],Y.prototype,"arcgisManaged",void 0),(0,u.Cg)([(0,h.MZ)()],Y.prototype,"identifierInfo",void 0),(0,u.Cg)([(0,h.MZ)()],Y.prototype,"searchIndexes",void 0),(0,u.Cg)([(0,h.MZ)({type:[B],json:{write:!0}})],Y.prototype,"entityTypes",void 0),(0,u.Cg)([(0,h.MZ)({type:[H],json:{write:!0}})],Y.prototype,"relationshipTypes",void 0),(0,u.Cg)([(0,h.MZ)({type:[B],json:{write:!0}})],Y.prototype,"metaEntityTypes",void 0),(0,u.Cg)([(0,h.MZ)({type:[W],json:{write:!0}})],Y.prototype,"provenanceSourceTypeValues",void 0),Y=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.DataModel")],Y);let X=class extends v.o{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};(0,u.Cg)([(0,h.MZ)({type:[String],json:{write:!0}})],X.prototype,"capabilities",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"supportsSearch",void 0),(0,u.Cg)([(0,h.MZ)({type:[String],json:{write:!0}})],X.prototype,"supportedQueryFormats",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"allowGeometryUpdates",void 0),(0,u.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],X.prototype,"searchMaxRecordCount",void 0),(0,u.Cg)([(0,h.MZ)({type:Object,json:{write:!0}})],X.prototype,"serviceCapabilities",void 0),(0,u.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],X.prototype,"maxRecordCount",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"description",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"copyrightText",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"units",void 0),(0,u.Cg)([(0,h.MZ)({type:p.A,json:{write:!0}})],X.prototype,"spatialReference",void 0),(0,u.Cg)([(0,h.MZ)({type:Number,json:{write:!0}})],X.prototype,"currentVersion",void 0),(0,u.Cg)([(0,h.MZ)({type:Object,json:{write:!0}})],X.prototype,"dateFieldsTimeReference",void 0),(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],X.prototype,"serviceItemId",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"supportsDocuments",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"dataEditingNotSupported",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"schemaEditingNotSupported",void 0),(0,u.Cg)([(0,h.MZ)({type:Boolean,json:{write:!0}})],X.prototype,"supportsProvenance",void 0),X=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.ServiceDefinition")],X);let ee=class extends v.o{constructor(e){super(e),this.url=null,this.dataModel=null,this.serviceDefinition=null}};function te(e,t,r){if(0!==e.error_code)throw new i.A(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function re(e){return e?.error_code?new i.A("knowledgeGraphService:server-or-decoding-error",e.error_message,{errorCode:e.error_code}):void 0}function ne(e,t,r,n=!1){const o=new r.ClientDataFetchRequestEncoder;o.deleteLater();for(const a of e){const e=oe(a,t,r,n);o.add_client_data_fetch_request_parameter(e)}o.encode();const a=o.get_encoding_result();return te(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function oe(e,t,r,n){const o=new r.ClientDataKey;o.deleteLater(),o.key_string=e;const a=new r.ClientDataFetchRequestParameter;a.deleteLater(),a.set_key(o);const i=t.get(e);return i&&!n&&(a.v_tag={v_tag:i.version}),a}(0,u.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],ee.prototype,"url",void 0),(0,u.Cg)([(0,h.MZ)({type:Y,json:{write:!0}})],ee.prototype,"dataModel",void 0),(0,u.Cg)([(0,h.MZ)({type:X,json:{write:!0}})],ee.prototype,"serviceDefinition",void 0),ee=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.KnowledgeGraph")],ee);var ae=r(45724),ie=r(48526),se=r(86738),de=r(39829),le=r(82799);const pe={exclude:0,include:1};function ue(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ye(e,t))}),r}function ce(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[n,o]of Object.entries(e))r.set_key_value(n,ye(o,t));return r}function he(e,t){if(e instanceof ie.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=r.geometry_type=t.esriGeometryType.esriGeometryMultipoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let a=0;return e.points.forEach(e=>{e.forEach(e=>{n[a]=e,a++})}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof se.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=t.esriGeometryType.esriGeometryPoint,r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let a=2;return e.hasZ&&(n[a]=e.z,a++),e.hasM&&(n[a]=e.m,a++),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);if(e instanceof le.A||e instanceof de.A)return function(e,t){const r=new t.GeometryValue;r.deleteLater(),r.has_z=e.hasZ,r.has_m=e.hasM;const n=[],o=[];let a=[];e instanceof le.A?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof de.A&&(r.geometry_type=t.esriGeometryType.esriGeometryPolygon,a=e.rings);let i=0,s=0;return a.forEach(e=>{let t=0;e.forEach(e=>{t++,e.forEach(e=>{n[s]=e,s++})}),o[i]=t,i++}),r.coords=new Float64Array(n),r.lengths=new Uint32Array(o),r}(e,t);throw new i.A("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function ye(e,t){if(null==e)return"";if("object"!=typeof e)return e;if(e instanceof Date)return e;if(e instanceof l.A)return he(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(e=>{r.add_value(ye(e,t))}),r}return ce(e,t)}var ge=r(35448);function fe(e,t){if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(!("originId"in e)){const r=new t.EntityValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,be(o,t));return e.id&&r.set_id(e.id),r}if("originId"in e&&"destinationId"in e){const r=new t.RelationshipValue;r.deleteLater(),r.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))r.set_key_value(n,be(o,t));return e.id&&r.set_id(e.id),e.originId&&e.destinationId&&r.set_related_entity_ids(e.originId,e.destinationId),r}throw new i.A("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function we(e,t){const r=new t.GraphProperty;return r.deleteLater(),r.name=e.name,r.alias=e.alias??"",r.field_type={value:ge.r5[e.fieldType]},r.geometry_type={value:e.geometryType?ge.bV[e.geometryType]:ge.bV.esriGeometryNull},r.has_m=e.hasM??!1,r.has_z=e.hasZ??!1,r.nullable=e.nullable??!1,r.editable=e.editable,r.required=e.required,r.default_visibility=e.defaultVisibility,r.system_maintained=e.systemMaintained??!1,r.role={value:ge.ti[e.role]},r.default_value=be(e.defaultValue,t),r}function me(e,t){const r=new t.SearchIndexProperties;r.deleteLater();for(const t of e.propertyNames)r.add_search_property_name(t);return r}function _e(e,t,r){r.name=e.name,r.alias=e.alias??"",r.role={value:ge.Eq[e.role]},r.strict=e.strict;for(const n of e.properties){const e=we(n,t);r.add_property(e)}return r}function ve(e,t){return e.hasOwnProperty("alias")&&(t.alias=e.alias),t}function be(e,t){return null==e?null:"object"!=typeof e||e instanceof Date?e:e instanceof l.A?he(e,t):null}let Ce=class extends c.A{constructor(e){super(e),this.decoderError=null,this.resultsCount=0,this.results=[],this.updatedKnowledgeGraph=null}};(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"decoderError",void 0),(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"resultsCount",void 0),(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"results",void 0),(0,u.Cg)([(0,h.MZ)()],Ce.prototype,"updatedKnowledgeGraph",void 0),Ce=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDataModelOperationResult")],Ce);const Ae=Ce;let Ge=class extends Ae{constructor(e){super(e)}};Ge=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphAddFieldIndexResult")],Ge);const Me=Ge;let xe=class extends Ae{constructor(e){super(e),this.entityAddResultsCount=0,this.relationshipAddResultsCount=0,this.entityAddResults=[],this.relationshipAddResults=[]}};(0,u.Cg)([(0,h.MZ)()],xe.prototype,"entityAddResultsCount",void 0),(0,u.Cg)([(0,h.MZ)()],xe.prototype,"relationshipAddResultsCount",void 0),(0,u.Cg)([(0,h.MZ)()],xe.prototype,"entityAddResults",void 0),(0,u.Cg)([(0,h.MZ)()],xe.prototype,"relationshipAddResults",void 0),xe=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphAddNamedTypesResult")],xe);const Te=xe;let Pe=class extends Ae{constructor(e){super(e)}};Pe=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphAddPropertyResult")],Pe);const ke=Pe;let Se=class extends Ae{constructor(e){super(e)}};Se=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDeleteFieldIndexResult")],Se);const Re=Se;let je=class extends Ae{constructor(e){super(e)}};je=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDeleteNamedTypeResult")],je);const Ie=je;let De=class extends Ae{constructor(e){super(e)}};De=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphDeletePropertyResult")],De);const Ze=De;let Ee=class extends Ae{constructor(e){super(e)}};Ee=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphUpdateNamedTypesResult")],Ee);const Fe=Ee;let Ne=class extends Ae{constructor(e){super(e)}};Ne=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphUpdatePropertyResult")],Ne);const qe=Ne;let $e=class extends Ae{constructor(e){super(e)}};$e=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphUpdateSearchIndexResult")],$e);const Oe=$e;function Le(e,t){const r=[];for(let n=0;n<t;n++){const t=e.get_result_at(n);r.push({name:t.get_name(),error:re(t.get_error())})}return r}function Ue(e){const t=e.get_results_count(),r=e.get_entity_type_add_results_count(),n=e.get_relationship_type_add_results_count(),o=new Te({resultsCount:t,results:Le(e,t),decoderError:re(e.error),entityAddResultsCount:r,relationshipAddResultsCount:n});for(let t=0;t<r;t++){const r=e.get_entity_type_add_results_at(t),n=r.get_name(),a=r.get_error();o.entityAddResults.push({name:n,error:re(a)})}for(let t=0;t<n;t++){const r=e.get_relationship_type_add_results_at(t),n=r.get_name(),a=r.get_error();o.relationshipAddResults.push({name:n,error:re(a)})}return o}function ze(e){const t=e.get_results_count();return new Fe({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Je(e){const t=e.get_results_count();return new Ie({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Ke(e){const t=e.get_results_count();return new ke({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Ve(e){const t=e.get_results_count();return new Ze({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Qe(e){const t=e.get_results_count();return new qe({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function Be(e){const t=e.get_results_count();return new Oe({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function He(e){const t=e.get_results_count();return new Me({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}function We(e){const t=e.get_results_count();return new Re({resultsCount:t,results:Le(e,t),decoderError:re(e.error)})}var Ye=r(93637);let Xe=class extends c.A{constructor(e){super(e),this.name=null,this.supportedCategory="esriTypeUNSPECIFIED",this.analyzers=[],this.searchProperties=new Map}};(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"name",void 0),(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"supportedCategory",void 0),(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"analyzers",void 0),(0,u.Cg)([(0,h.MZ)()],Xe.prototype,"searchProperties",void 0),Xe=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.SearchIndex")],Xe);let et=!1;function tt(e){return e.deleteLater(),new B(nt(e))}function rt(e){return e.deleteLater(),new K({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:dt(e.fields)})}function nt(e){return{name:e.name,alias:e.alias,role:(0,Ye.i7)(ge.Eq,e.role.value),strict:e.strict,properties:lt(e.properties),fieldIndexes:pt(e.field_indexes)}}function ot(e){return e.deleteLater(),new V({alias:e.alias,name:e.name,fieldType:(0,Ye.i7)(ge.r5,e.field_type.value)??void 0,geometryType:(0,Ye.i7)(ge.bV,e.geometry_type.value)??null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:(0,Ye.i7)(ge.ti,e.role.value),defaultValue:e.default_value})}function at(e){e.deleteLater();const t=nt(e),r=[];for(let t=0;t<e.end_points.size();t++){const n=e.end_points.get(t);r.push({originEntityType:n.origin_entity_type,destinationEntityType:n.dest_entity_type})}return e.end_points.delete(),new H(Object.assign({endPoints:r},t))}function it(e){return new W({behavior:e.behavior,value:e.value})}function st(e){const t=[];for(let r=0;r<e.size();r++)t.push(tt(e.get(r)));return e.delete(),t}function dt(e){const t=[];for(let r=0;r<e.size();r++)t.push(e.get(r));return e.delete(),t}function lt(e){const t=[];for(let r=0;r<e.size();r++){const n=ot(e.get(r));"esriFieldTypeBigInteger"===n.fieldType&&(et=!0),t.push(n)}return e.delete(),t}function pt(e){const t=[];for(let r=0;r<e.size();r++)t.push(rt(e.get(r)));return e.delete(),t}function ut(e){const t=[];for(let r=0;r<e.size();r++)t.push(at(e.get(r)));return e.delete(),t}function ct(e){const t=[];for(let r=0;r<e.size();r++){const n=e.get(r);n.deleteLater(),t.push(it(n))}return e.delete(),t}function ht(e){const t=[];for(let r=0;r<e.size();r++){const n=new Xe,o=e.get(r);n.name=o.name,n.supportedCategory=(0,Ye.i7)(ge.nP,o.supported_category.value);const a=o.analyzers.size();for(let e=0;e<a;e++)n.analyzers.push({name:o.analyzers.get(e).name});o.analyzers.delete();for(let e=0;e<o.search_properties.keys().size();e++){const t=o.search_properties.keys().get(e),r=o.search_properties.get(t),a=[];for(let e=0;e<r.property_names.size();e++)a.push(r.property_names.get(e));n.searchProperties.set(t,{propertyNames:a})}t.push(n)}return e.delete(),t}var yt=r(25927),gt=(r(77901),r(40662)),ft=r(42095),wt=r(23150);function mt(e,t){const r={paths:[],hasM:!1,hasZ:!1},n=_t(e,r),{coords:o,geometry_type:a,lengths:s}=e;if(a.value!==t)throw new i.A("KnowledgeGraph:illegal-geometry-type","Illegal Geometry type for multipath conversion");let d=0;return s.forEach(e=>{const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<n;t++)e[t]=o[d],d++;t.push(e)}r.paths.push(t)}),r}function _t(e,t){let r=2;return e.has_z?(t.hasZ=e.has_z,r++):t.hasZ=!1,e.has_m?(t.hasM=e.has_m,r++):t.hasM=!1,r}const vt=()=>s.A.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors");function bt(e,t,r){return((e,t,r)=>{if(null==e)return null;if("object"!=typeof e)return e;if("getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case 1:return function(e,t){const r={spatialReference:t};let n=2;_t(e,r);const o=e.coords;return r.x=o[0],r.y=o[1],e.has_z&&(r.z=o[n],n++),e.has_m&&(r.m=o[n]),new se.A(r)}(e,r);case 2:return function(e,t){const r={spatialReference:t},n=_t(e,r),o=e.lengths,a=e.coords,i=o[0];r.points=[];let s=0;for(let e=0;e<i;e++){const e=[];for(let t=0;t<n;t++)e[t]=a[s],s++;r.points.push(e)}return new ie.A(r)}(e,r);case 3:return function(e,t){const{paths:r,hasM:n,hasZ:o}=mt(e,3);return new le.A({paths:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 4:return function(e,t){const{paths:r,hasM:n,hasZ:o}=mt(e,4);return new de.A({rings:r,hasM:n,hasZ:o,spatialReference:t})}(e,r);case 5:case 7:return vt().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;default:return vt().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return vt().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case 0:return function(e,t,r){return new gt.A(At(e,t,r))}(e,t,r);case 1:return Ct(e,t,r);case 2:return Gt(e,t,r);case 3:return function(e,t,r){const n=e.entity_count(),o=e.relationship_count(),a=[];for(let i=0;i<n;i++)a.push(Ct(e.get_entity_at(i),t,r)),i<o&&a.push(Gt(e.get_relationship_at(i),t,r));return new ft.A({path:a})}(e,t,r);case 4:return function(e,t,r){const n=[],o=e.count();for(let a=0;a<o;a++){const o=e.get_value_at(a);n.push(bt(o,t,r))}return n}(e,t,r);default:return vt().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}})(e,t,r)}function Ct(e,t,r){const n=e.type_name,o=At(e,t,r),a=e.get_id();return new yt.A(Object.assign({typeName:n,id:a},o))}function At(e,t,r){const n={},o=e.key_count();for(let a=0;a<o;a++)n[e.get_key_at(a)]=bt(e.get_value_at(a),t,r);return{properties:n}}function Gt(e,t,r){const n=e.type_name,o=At(e,t,r);return new wt.A(Object.assign({typeName:n,id:e.get_id(),originId:e.get_origin_entity_id(),destinationId:e.get_destination_entity_id()},o))}function Mt(e){const t=[];for(let r=0;r<e.get_header_keys().size();r++)t.push(e.get_header_keys().get(r));const r=new p.A(e.get_out_sr());return new U({headerKeys:t,outSpatialReference:r,exceededTransferLimit:e.exceeded_transfer_limit()})}let xt=class extends c.A{constructor(e){super(e),this.hasError=!1,this.error=null,this.editResults=[],this.cascadeRelationshipDeleteResults=[],this.cascadeProvenanceDeleteResults=[]}};(0,u.Cg)([(0,h.MZ)()],xt.prototype,"hasError",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"error",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"editResults",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"cascadeRelationshipDeleteResults",void 0),(0,u.Cg)([(0,h.MZ)()],xt.prototype,"cascadeProvenanceDeleteResults",void 0),xt=(0,u.Cg)([(0,g.$)("esri.rest.knowledgeGraph.GraphApplyEditsResult")],xt);const Tt=xt;function Pt(e){const t=e.has_error(),r=new Tt({hasError:t,error:t?re(e.error):null}),n=e.get_edit_results_count();for(let t=0;t<n;t++){const n=e.get_edit_results_at(t);n.deleteLater();const o=e.get_edit_results_type_name_at(t),a=[],i=[],s=[],d=n.get_add_results_count(),l=n.get_update_results_count(),p=n.get_delete_results_count();for(let e=0;e<d;e++){const t=n.get_add_result_at(e);t.deleteLater(),a.push({id:t.id,error:re(t.error)})}for(let e=0;e<l;e++){const t=n.get_update_result_at(e);t.deleteLater(),i.push({id:t.id,error:re(t.error)})}for(let e=0;e<p;e++){const t=n.get_delete_result_at(e);t.deleteLater(),s.push({id:t.id,error:re(t.error)})}r.editResults.push({typeName:o,adds:a,updates:i,deletes:s})}const o=e.get_cascaded_rel_deletes_count();for(let t=0;t<o;t++){const n=e.get_cascaded_rel_deletes_at(t);n.deleteLater();const o=e.get_cascaded_rel_deletes_type_name_at(t),a=[];for(let e=0;e<n.get_count();e++){const t=n.get_result_at(e);t.deleteLater(),a.push({id:t.id,originId:t.origin_id,destinationId:t.dest_id,error:re(t.error)})}r.cascadeRelationshipDeleteResults.push({typeName:o,cascadeRelationshipDeletes:a})}if(e.has_cascading_provenance_deletes()){const t=e.get_cascading_provenance_deletes();t.deleteLater();const n=t.get_count();for(let e=0;e<n;e++){const n=t.get_result_at(e);n.deleteLater(),r.cascadeProvenanceDeleteResults.push({id:n.id,error:re(n.error)})}}return r}const kt=new Map,St=()=>new Map(kt.entries()),Rt={fetchKnowledgeGraph:async e=>{const t=new ee({url:e}),r=[];return r.push(Bt(t)),r.push(Ht(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await cr(e)},refreshServiceDefinition:async e=>{const t=(await(0,a.A)(e.url,{query:{f:"json"}})).data;return t.capabilities=t?.capabilities?.split(","),t.supportedQueryFormats=t?.supportedQueryFormats?.split(","),e.serviceDefinition=new X(t),e.serviceDefinition},executeFindPathsAsynchronous:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],o=(await nr(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerToolsAsync/GPServer/ServerFilteredFindPaths`;return await rr(`${n}${a}`,{in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:e.config.toJSON(),result_type:"STRING"},{},t)},executeFindPaths:async(e,t)=>{const r=e.inKnowledgeGraphUrl.split("/rest/services");if(r.length<2)throw new i.A("knowledge-graph:invalid-tool-url","The URL for the KG Service was not correctly formatted. It should contain /rest/services/");const n=r[0],o=(await nr(`${n}/rest/info`,{query:{f:"json"}})).data.currentVersion,a=`/rest/services/${o&&o<12?"System":"Utilities"}/KnowledgeGraphServerTools/GPServer/ServerFilteredFindPaths/execute`,s=await nr(`${n}${a}`,{method:"post",query:{f:"pjson",in_knowledge_graph_url:e.inKnowledgeGraphUrl,config_type:"STRING",config_string:JSON.stringify(e.config),result_type:"STRING"},...t});if(s.data.results.length<1)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results returned",s);let d;for(const e of s.data.results)if("out_results_string"===e.paramName){d=e.value;break}if(!d)throw new i.A("knowledge-graph:no-results","No results were returned from the FindPaths tool - no results were returned on the expected paramater out_results_string",s);return d},fetchAsynchronousFindPathsResultData:async(e,t)=>(await e.fetchResultData("out_results_string",null,t)).value,executeQueryStreaming:async(e,t,r)=>{const n=`${e.url}/graph/query`;await or(e);const o=await ir(n,r);if(!e.serviceDefinition?.supportsProvenance&&"include"===t.provenanceBehavior)throw new i.A("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");o.data.body=await async function(e,t){const r=await(0,ae.I)(),n=new r.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=r.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[t,o]of Object.entries(e.bindParameters))ar(t,o,n,r);if(e.bindGeometryQuantizationParameters)!function(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.bindGeometryQuantizationParameters,n);else{if(t.dataModel||await Bt(t),4326!==t.dataModel?.spatialReference?.wkid)throw new i.A("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=r.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&function(e,t,r){if(!e.extent)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new i.A("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);t.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:r.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}(e.outputQuantizationParameters,n,r),e.provenanceBehavior&&function(e,t){t.provenance_behavior={value:pe[e]}}(e.provenanceBehavior,n);try{n.encode()}catch(e){throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:e})}const o=n.get_encoding_result();if(0!==o.error.error_code)throw new i.A("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}(t,e);const a=await tr(o.data.url,o.data);if(e.dataModel){const t=await ur(a,e.dataModel);return new J({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,r)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new i.A("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await or(e);const o=await ir(n,r);return o.data.body=await async function(e,t){if(t.dataModel||await Bt(t),!t.dataModel)throw new i.A("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const r=await(0,ae.I)(),n=!!e.options?.cascadeDelete,o=!!e.options?.cascadeProvenanceDelete,a=new r.GraphApplyEditsEncoder(r.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?function(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}(e.options?.inputQuantizationParameters):r.InputQuantizationUtil.WGS84_lossless());a.deleteLater(),a.cascade_delete=n,a.cascade_delete_provenance=o;try{let t;e.entityAdds?.forEach(e=>{t=a.add_entity(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(e=>{if(!e.originId||!e.destinationId)throw new i.A("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");t=a.add_relationship(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(e=>{if(!e.id)throw new i.A("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=a.update_entity(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(e=>{if(!e.id)throw new i.A("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");t=a.update_relationship(fe(e,r)),te(t,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(e=>{if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=a.make_delete_helper(e.typeName,!0);t.deleteLater(),e.ids?.forEach(e=>{t.delete_by_id(e)})}),e.relationshipDeletes?.forEach(e=>{if(!e.typeName)throw new i.A("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const t=a.make_delete_helper(e.typeName,!1);e.ids?.forEach(e=>{t.delete_by_id(e)})}),a.encode()}catch(e){throw new i.A("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:e})}const s=a.get_encoding_result();return te(s.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(s.get_byte_buffer())}(t,e),async function(e){return sr(e,(await(0,ae.I)()).GraphApplyEditsDecoder,Pt)}(await tr(o.data.url,o.data))},executeAddNamedTypes:async(e,t,r)=>{if(!t.newEntityTypes?.length&&!t.newRelationshipTypes?.length)throw new i.A("knowledge-graph:no-arguments","The operation to add types to the data model contained no values");const n=`${e.url}/dataModel/edit/namedTypes/add`;await or(e);const o=await ir(n,r);o.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphNamedObjectTypeAddsRequestEncoder;r.deleteLater(),e.newEntityTypes?.forEach(e=>{r.add_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),_e(e,t,r)}(e,t))}),e.newRelationshipTypes?.forEach(e=>{r.add_relationship_type(function(e,t){const r=new t.RelationshipType;r.deleteLater();for(const n of e.endPoints){const e=new t.EndPoint;e.deleteLater(),e.origin_entity_type=n.originEntityType,e.dest_entity_type=n.destinationEntityType,r.add_end_point(e)}return _e(e,t,r)}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed",{error:e})}const n=r.get_encoding_result();return te(n.error,"knowledge-graph:addNamedTypes-encoding-failed","Attempting to encode the addNamedTypes failed"),structuredClone(n.get_byte_buffer())}(t);const a=await tr(o.data.url,o.data),s=await async function(e){return sr(e,(await(0,ae.I)()).GraphNamedObjectTypeAddsResponseDecoder,Ue)}(a);return s.updatedKnowledgeGraph=await Qt(e.url),s},executeDeleteNamedType:async(e,t,r)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to delete a named type from the data model contained no value");const n=`${e.url}/dataModel/edit/namedTypes/${t}/delete`;await or(e);const o=await ir(n,r);o.data.body="";const a=await tr(o.data.url,o.data),s=await async function(e){return sr(e,(await(0,ae.I)()).GraphNamedObjectTypeDeleteResponseDecoder,Je)}(a);return s.updatedKnowledgeGraph=await Qt(e.url),s},executeUpdateNamedType:async(e,t,r,n)=>{if(!t&&!Object.keys(r).length)throw new i.A("knowledge-graph:no-arguments","The operation to update types in the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/update`;await or(e);const a=await ir(o,n);a.data.body=await async function(e,t,r){const n=await(0,ae.I)(),o=new n.GraphNamedObjectTypeUpdateRequestEncoder;if(o.deleteLater(),r.entityTypes.some(e=>e.name===t))o.update_entity_type(function(e,t){const r=new t.EntityType;return r.deleteLater(),ve(e,r)}(e,n));else{if(!r.relationshipTypes.some(e=>e.name===t))throw new i.A("knowledge-graph:updateNamedType-encoding-failed","The named type you are trying to update does not exist in the data model");o.update_relationship_type(function(e,t){const r=new t.RelationshipType;return r.deleteLater(),ve(e,r)}(e,n))}o.update_alias=e.hasOwnProperty("alias");try{o.encode()}catch(e){throw new i.A("knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed",{error:e})}const a=o.get_encoding_result();return te(a.error,"knowledge-graph:updateNamedType-encoding-failed","Attempting to encode the updateNamedType failed"),structuredClone(a.get_byte_buffer())}(r,t,e.dataModel);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphNamedObjectTypeUpdateResponseDecoder,ze)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeAddGraphProperties:async(e,t,r,n)=>{if(!t&&!r.length)throw new i.A("knowledge-graph:no-arguments","The operation to add properties to the data model contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/add`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphPropertyAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_graph_property(we(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed",{error:e})}const n=r.get_encoding_result();return te(n.error,"knowledge-graph:addGraphProperties-encoding-failed","Attempting to encode the addGraphProperties failed"),structuredClone(n.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphPropertyAddsResponseDecoder,Ke)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeDeleteGraphProperty:async(e,t,r,n)=>{if(!t&&!r)throw new i.A("knowledge-graph:no-arguments","The operation to delete property contained missing or empty values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/fields/delete`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=new((await(0,ae.I)()).GraphPropertyDeleteRequestEncoder);t.deleteLater(),t.field_name=e;try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed",{error:e})}const r=t.get_encoding_result();return te(r.error,"knowledge-graph:deleteGraphProperty-encoding-failed","Attempting to encode the deleteGraphProperty failed"),structuredClone(r.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphPropertyDeleteResponseDecoder,Ve)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeUpdateGraphProperty:async(e,t,r,n,o)=>{if(!t&&!r&&!Object.keys(n).length)throw new i.A("knowledge-graph:no-arguments","The operation to update properties in the data model contained missing or empty values");const a=`${e.url}/dataModel/edit/namedTypes/${t}/fields/update`;await or(e);const s=await ir(a,o);s.data.body=await async function(e,t){const r=await(0,ae.I)(),n=new r.GraphPropertyUpdateRequestEncoder;n.deleteLater(),n.update_graph_property(function(e,t){const r=new t.GraphProperty;return r.deleteLater(),e.hasOwnProperty("alias")&&(r.alias=e.alias),e.hasOwnProperty("editable")&&(r.editable=e.editable),e.hasOwnProperty("required")&&(r.required=e.required),e.hasOwnProperty("defaultVisibility")&&(r.default_visibility=e.defaultVisibility),e.hasOwnProperty("defaultValue")&&(r.default_value=be(e.defaultValue,t)),r}(t,r)),n.set_property_name(e),n.update_alias=t.hasOwnProperty("alias"),n.update_editable=t.hasOwnProperty("editable"),n.update_required=t.hasOwnProperty("required"),n.update_visible=t.hasOwnProperty("defaultVisibility"),n.update_default_value=t.hasOwnProperty("defaultValue");try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed",{error:e})}const o=n.get_encoding_result();return te(o.error,"knowledge-graph:updateGraphProperty-encoding-failed","Attempting to encode the updateGraphProperty failed"),structuredClone(o.get_byte_buffer())}(r,n);const d=await tr(s.data.url,s.data),l=await async function(e){return sr(e,(await(0,ae.I)()).GraphPropertyUpdateResponseDecoder,Qe)}(d);return l.updatedKnowledgeGraph=await Qt(e.url),l},executeAddGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/add`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphIndexAddsRequestEncoder;r.deleteLater(),e.forEach(e=>{r.add_field_index(function(e,t){const r=new t.FieldIndex;r.deleteLater(),r.name=e.name,r.unique=e.unique,r.ascending=e.ascending,r.description=e.description??"";for(const t of e.fieldNames)r.add_field(t);return r}(e,t))});try{r.encode()}catch(e){throw new i.A("knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed",{error:e})}const n=r.get_encoding_result();return te(n.error,"knowledge-graph:addGraphFieldIndex-encoding-failed","Attempting to encode the addGraphFieldIndex failed"),structuredClone(n.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphIndexAddsResponseDecoder,He)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeDeleteGraphFieldIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!r?.length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty field index values");const o=`${e.url}/dataModel/edit/namedTypes/${t}/indexes/delete`;await or(e);const a=await ir(o,n);a.data.body=await async function(e){const t=new((await(0,ae.I)()).GraphIndexDeleteRequestEncoder);t.deleteLater(),e.forEach(e=>{t.add_index_name(e)});try{t.encode()}catch(e){throw new i.A("knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed",{error:e})}const r=t.get_encoding_result();return te(r.error,"knowledge-graph:deleteGraphFieldIndex-encoding-failed","Attempting to encode the deleteGraphFieldIndex failed"),structuredClone(r.get_byte_buffer())}(r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphIndexDeleteResponseDecoder,We)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeUpdateSearchIndex:async(e,t,r,n)=>{if(!t)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing named type");if(!Object.keys(r.addSearchProperties??{}).length&&!Object.keys(r.removeSearchProperties??{}).length)throw new i.A("knowledge-graph:no-arguments","The operation to update search index in the data model contained missing or empty properties values");const o=`${e.url}/dataModel/searchIndex/update`;await or(e);const a=await ir(o,n);a.data.body=await async function(e,t){const r=await(0,ae.I)(),n=new r.GraphUpdateSearchIndexRequestEncoder;n.deleteLater(),t.hasOwnProperty("addSearchProperties")&&n.insert_add_search_property(e,me(t.addSearchProperties,r)),t.hasOwnProperty("removeSearchProperties")&&n.insert_delete_search_property(e,me(t.removeSearchProperties,r));try{n.encode()}catch(e){throw new i.A("knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed",{error:e})}const o=n.get_encoding_result();return te(o.error,"knowledge-graph:updateSearchIndex-encoding-failed","Attempting to encode the updateSearchIndex failed"),structuredClone(o.get_byte_buffer())}(t,r);const s=await tr(a.data.url,a.data),d=await async function(e){return sr(e,(await(0,ae.I)()).GraphUpdateSearchIndexResponseDecoder,Be)}(s);return d.updatedKnowledgeGraph=await Qt(e.url),d},executeQuery:async(e,t,r)=>{const n=`${e.url}/graph/query`,o=await(0,a.A)(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...r?.query},signal:r?.signal,timeout:r?.timeout}),s=o.getHeader?.("content-type"),d=o.data;if(s?.includes("application/x-protobuf")){const t=new((await(0,ae.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=pr({wasmQueryDecoder:t,newArrayBufferToParse:d,dataModel:e.dataModel});return new z({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:o.data})},executeSearch:async(e,t,r)=>{const n="provenance"===t.typeCategoryFilter?"metaEntityProvenance":t.typeCategoryFilter,o=`${e.url}/graph/search`,s=await(0,a.A)(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:n,...r?.query},signal:r?.signal,timeout:r?.timeout}),d=s.getHeader?.("content-type"),l=s.data;if(d?.includes("application/x-protobuf")){const t=new((await(0,ae.I)()).GraphQueryDecoder);if(t.deleteLater(),e.dataModel){const r=pr({wasmQueryDecoder:t,newArrayBufferToParse:l,dataModel:e.dataModel});return new z({resultRows:r.resultRows,resultHeader:r.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:d,data:s.data})},executeSearchStreaming:async(e,t,r)=>{const n=`${e.url}/graph/search`;await or(e);const o=await ir(n,r);o.data.body=await async function(e){const t=await(0,ae.I)(),r=new t.GraphSearchRequestEncoder;r.deleteLater(),r.search_query=e.searchQuery;const n="provenance"===e.typeCategoryFilter?"meta_entity_provenance":e.typeCategoryFilter;if(r.type_category_filter=t.esriNamedTypeCategory[n],!0===e.returnSearchContext&&(r.return_search_context=e.returnSearchContext),null!=e.start&&e.start>0&&(r.start_index=e.start),null!=e.num&&(r.max_num_results=e.num),null!=e.idsFilter&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{r.set_ids_filter(ue(e.idsFilter,t))}catch(e){throw new i.A("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:e})}e.namedTypesFilter?.forEach(e=>{r.add_named_type_filter(e)});try{r.encode()}catch(e){throw new i.A("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:e})}const o=r.get_encoding_result();if(0!==o.error.error_code)throw new i.A("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}(t);const a=await tr(o.data.url,o.data);if(e.dataModel){const t=await ur(a,e.dataModel);return new J({resultRowsStream:t.readableStream,resultHeader:t.resultHeader})}throw new i.A("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,t,r={ignoreCache:!1})=>{if(!t.length)return new Map;let n=kt.get(e.url||"");n||(n=new Map,kt.set(e.url||"",n));const o=new Map(n.entries()),a=`${e.url}/clientData/fetch`;t=Array.from(new Set(t));const s=await(0,ae.I)(),d=ne(t,n,s,r.ignoreCache),l=await ir(a,r.requestOptions);l.data.body=d;const p=await tr(l.data.url,l.data),u=p.headers.get("content-type");if(u?.includes("application/x-protobuf")){const e=new s.ClientDataFetchResponseDecoder;e.deleteLater();const t=await p.arrayBuffer();return e.decode(new Uint8Array(t)),e.has_error()&&te(e.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e,t,r,n=!1){const o=new Map;for(let a=0;a<e.get_results_count();a++){const i=e.get_result_at(a);if(2!==i.get_fetch_result_case().value||0!==i.error().error_code){const e=i.get_key().key_string;r.has(e)&&t.delete(e);continue}const s=i.get_value(),d=i.get_key().key_string,l=r.get(d);let p;if(2===s.get_data_case().value&&l)p=l.value;else{if(1!==s.get_data_case().value)continue;{p=s.get_data().client_data_string;const e=i.get_value().get_v_tag().v_tag;n||t.set(d,{key:d,version:e,value:p})}}o.set(d,p)}return o}(e,n,o,r.ignoreCache)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:u,data:p})},fetchAllClientDataKeys:async(e,t)=>{const r=`${e.url}/clientData`,n=await(0,a.A)(r,{responseType:"array-buffer",query:{f:"pbf"},signal:t?.signal,timeout:t?.timeout}),o=n.getHeader?.("content-type"),s=n.data;if(o?.includes("application/x-protobuf")){const e=new((await(0,ae.I)()).ClientDataKeysResponseDecoder);return e.deleteLater(),e.decode(new Uint8Array(s)),e.has_error()&&te(e.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),function(e){const t=e.get_keys(),r=new Array;for(let e=0;e<t.get_keys_count();e++){const n=t.get_key_at(e);1===n.get_client_data_key_type().value&&r.push(n.key_string)}return r}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})},clearClientDataCache:()=>kt.clear(),_fetchWrapper:async(e,t)=>fetch(e,t),_submitJobWrapper:async(e,t,r,n)=>async function(e,t,r,n){return r=w.from(r||{}),async function(e,t,r,n,o){const i={},s={},d=[];return function(e,t,r){for(const n in e){const o=e[n];if(o&&"object"==typeof o&&o instanceof T.A){const{features:e}=o;r[n]=[t.length,t.length+e.length],e.forEach(e=>{t.push(e.geometry)})}}}(n,d,i),(0,m.el)(d).then(d=>{const{outSpatialReference:l,processExtent:p,processSpatialReference:u,returnColumnName:c,returnFeatureCollection:h,returnM:y,returnZ:g}=r,{path:f}=(0,C.Dl)(e);for(const e in i){const[t,r]=i[e];s[e]=d.slice(t,r)}const w=l?l.wkid||l:null,m=u?u.wkid||u:null,_="execute"===t?{returnColumnName:c||void 0,returnFeatureCollection:h||void 0,returnM:y||void 0,returnZ:g||void 0}:null,v=F({...p?{context:{extent:p,outSR:w,processSR:m}}:{"env:outSR":w,"env:processSR":m},...n,..._,f:"json"},null,s),b={...o,query:v};return(0,a.A)(`${f}/${t}`,b)})}(e,"submitJob",r,t??{},n).then(({data:t})=>{const r=L.fromJSON(t);return r.sourceUrl=e,r})}(e,t,r,n),_esriRequestWrapper:async(e,t)=>(0,a.A)(e,t)};async function jt(e,t,r){return Rt.executeApplyEdits(e,t,r)}async function It(e,t,r){return Rt.executeAddNamedTypes(e,t,r)}async function Dt(e,t,r){return Rt.executeDeleteNamedType(e,t,r)}async function Zt(e,t,r,n){return Rt.executeUpdateNamedType(e,t,r,n)}async function Et(e,t,r,n){return Rt.executeAddGraphProperties(e,t,r,n)}async function Ft(e,t,r,n){return Rt.executeDeleteGraphProperty(e,t,r,n)}async function Nt(e,t,r,n,o){return Rt.executeUpdateGraphProperty(e,t,r,n,o)}async function qt(e,t,r,n){return Rt.executeAddGraphFieldIndex(e,t,r,n)}async function $t(e,t,r,n){return Rt.executeDeleteGraphFieldIndex(e,t,r,n)}async function Ot(e,t,r,n){return Rt.executeUpdateSearchIndex(e,t,r,n)}async function Lt(e,t,r){return Rt.executeQuery(e,t,r)}async function Ut(e,t,r){return Rt.executeQueryStreaming(e,t,r)}async function zt(e,t,r){return Rt.executeSearch(e,t,r)}async function Jt(e,t,r){return Rt.executeSearchStreaming(e,t,r)}function Kt(e,t){return Rt.fetchAllClientDataKeys(e,t)}function Vt(e,t,r){return Rt.fetchClientDataAtKeys(e,t,r)}async function Qt(e){return Rt.fetchKnowledgeGraph(e)}async function Bt(e){return Rt.refreshDataModel(e)}async function Ht(e){return Rt.refreshServiceDefinition(e)}async function Wt(e,t){return Rt.executeFindPathsAsynchronous(e,t)}async function Yt(e,t){return Rt.executeFindPaths(e,t)}async function Xt(e,t){return Rt.fetchAsynchronousFindPathsResultData(e,t)}function er(){return Rt.clearClientDataCache()}async function tr(e,t){return Rt._fetchWrapper(e,t)}async function rr(e,t,r,n){return Rt._submitJobWrapper(e,t,r,n)}async function nr(e,t){return Rt._esriRequestWrapper(e,t)}async function or(e){const t=o.id?.findCredential(e.url);t||(e.dataModel?await cr(e):await Bt(e))}function ar(e,t,r,n){null==t?r.set_param_key_value(e,""):"object"!=typeof t||t instanceof Date?r.set_param_key_value(e,t):t instanceof l.A?r.set_param_key_value(e,he(t,n)):Array.isArray(t)?r.set_param_key_value(e,ue(t,n)):r.set_param_key_value(e,ce(t,n))}async function ir(e,t){return(0,a.A)(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...t?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:t?.signal,timeout:t?.timeout})}async function sr(e,t,r){const n=e.headers.get("content-type");if(n?.includes("application/x-protobuf")){const n=await e.arrayBuffer(),o=new t;try{return o.decode(new Uint8Array(n)),r(o)}finally{o.deleteLater()}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:await e.text()})}let dr=50;function lr(e){dr=e}function pr({wasmQueryDecoder:e,newArrayBufferToParse:t,dataModel:r,decodedHeader:n,limitMaxProcessingTime:o=!1}){t&&e.push_buffer(new Uint8Array(t));const a=[];let s,d,l=0;const u=Date.now();let c=!0;for(;e.next_row();){s&&d||(s=n??Mt(e),d=s.outSpatialReference??new p.A({wkid:4326})),l||(l=e.get_header_keys().size());const t=new Array(l);for(let n=0;n<l;n++){const o=e.get_value(n);t[n]=bt(o,r,d)}if(a.push(t),o&&Date.now()-u>dr){c=!1;break}}if(e.has_error())throw new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - inner row decoding",{errorCode:e.error.error_code,errorMessage:e.error.error_message});return{resultHeader:s,resultRows:a,parsedAllResultsFromBuffer:c}}async function ur(e,t){const r=e.headers.get("content-type");if(e.headers.get("content-length")&&s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("Found `Content-Length` header when expecting a streaming HTTP response! Please investigate whether all intermediate HTTP proxies and/or load balancers are configured such that they don't forcefully buffer the entire response before returning it to the client. A valid HTTP streaming response should use Chunked Transfer Encoding and not have a Content Length defined."),r?.includes("application/x-protobuf")){const r=e.body?.getReader(),n=new((await(0,ae.I)()).GraphQueryDecoder);let o,a,l;n.deleteLater();const p=new Promise((e,t)=>{a=e,l=t});let u=!1,c=null;const h=new ReadableStream({pull:async function e(p){if(!r){const e=new i.A("knowledge-graph:stream-decoding-error","Error reading from stream - reader is undefined");throw l(e),e}const{done:h,value:y}=c?{done:!1,value:null}:await r.read().catch(e=>{throw l(e),r.releaseLock(),e});y&&(c=y);try{if(h){let e;if(n.has_error()?e=new i.A("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:n.error.error_code,errorMessage:n.error.error_message}):u||a(new U),r.releaseLock(),e)throw p.error(e),l(e),e;return void p.close()}const{resultHeader:s,resultRows:d,parsedAllResultsFromBuffer:g}=pr({wasmQueryDecoder:n,newArrayBufferToParse:y,dataModel:t,decodedHeader:o,limitMaxProcessingTime:!0});return g&&(c=null),!o&&s&&(o=s,a(s),u=!0),d.length>0?void p.enqueue(d):await e(p)}catch(e){throw s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(e),l(e),r.releaseLock(),(0,d.zf)(e)?e:new i.A("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:e})}}});return{readableStream:h,resultHeader:await p}}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}async function cr(e){const t=`${e.url}/dataModel/queryDataModel`,r=await(0,a.A)(t,{responseType:"array-buffer",query:{f:"pbf"}}),n=r.getHeader?.("content-type"),o=r.data;if(n?.includes("application/x-protobuf")){const e=(await(0,ae.I)()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!e)throw new i.A("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return function(e){e.deleteLater(),et=!1;const t=new Y({timestamp:e.timestamp,spatialReference:new p.A(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:(0,Ye.i7)(ge.vy,e.identifier_info?.identifier_mapping_info?.identifier_info_type?.value),databaseNativeIdentifier:e.identifier_info?.identifier_mapping_info?.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:e.identifier_info?.identifier_mapping_info?.uniform_property_identifier?.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:(0,Ye.i7)(ge.wr,e.identifier_info?.identifier_generation_info?.uuid_method_hint?.value)}},searchIndexes:ht(e.search_indexes),entityTypes:st(e.entity_types),relationshipTypes:ut(e.relationship_types),metaEntityTypes:st(e.meta_entity_types),provenanceSourceTypeValues:ct(e.provenance_source_type_values.value_behavior_array)});return et&&s.A.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").warnOnce("A big integer field was detected in the retrieved data model. The `big-integer` field type is not fully supported in web clients. Please see https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type"),t}(e)}throw new i.A("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:r.data})}}}]);
|