@arcgis/core 4.28.0 → 4.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/0a3da4b73beeaacd4667.js +1 -0
  3. package/assets/esri/core/workers/chunks/41306b698f78001dda55.js +1 -0
  4. package/assets/esri/core/workers/chunks/49faa024bab1ba6e2bf0.js +1 -0
  5. package/assets/esri/core/workers/chunks/{74951370a341f02d3714.js → 630b31a205d9db7147d0.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{6867ed1860afb7aac536.js → b8f3a1d887c9e054feaa.js} +1 -1
  7. package/assets/esri/core/workers/chunks/f520f093aa81d8ee1790.js +1 -0
  8. package/assets/esri/themes/base/widgets/_FeatureForm.scss +0 -16
  9. package/assets/esri/themes/base/widgets/_Features.scss +0 -5
  10. package/assets/esri/themes/base/widgets/_Popup.scss +1 -0
  11. package/assets/esri/themes/dark/main.css +1 -1
  12. package/assets/esri/themes/light/main.css +1 -1
  13. package/assets/esri/themes/light/view.css +1 -1
  14. package/interfaces.d.ts +2 -2
  15. package/kernel.js +1 -1
  16. package/layers/save/featureLayerUtils.js +1 -1
  17. package/layers/support/LayerContingentValuesCache.js +1 -1
  18. package/layers/support/imageryRendererUtils.js +1 -1
  19. package/layers/support/vectorTileLayerLoader.js +1 -1
  20. package/package.json +1 -1
  21. package/renderers/support/RasterSymbolizer.js +1 -1
  22. package/support/revision.js +1 -1
  23. package/versionManagement/VersionManagementService.js +1 -1
  24. package/views/2d/engine/vectorTiles/TileManager.js +1 -1
  25. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  26. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  27. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  28. package/widgets/FeatureForm/css.js +1 -1
  29. package/widgets/FeatureForm.js +1 -1
  30. package/widgets/Search/support/layerSearchUtils.js +1 -1
  31. package/assets/esri/core/workers/chunks/07adca463da5554e514d.js +0 -1
  32. package/assets/esri/core/workers/chunks/3ac9001b19a90faf5573.js +0 -1
  33. package/assets/esri/core/workers/chunks/934c32c49bb9e21482fd.js +0 -1
  34. package/assets/esri/core/workers/chunks/ffa330a19a09679212fb.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5481],{92835:(t,e,r)=>{r.d(e,{Z:()=>f});var i,s=r(43697),l=r(96674),o=r(35463),n=r(5600),a=(r(75215),r(67676),r(80442),r(71715)),u=r(52011),h=r(30556),c=r(25031);let p=i=class extends l.wq{static get allTime(){return d}static get empty(){return y}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=t.start?.getTime()??t.start,s=t.end?.getTime()??t.end;return e===i&&r===s}expandTo(t,e=c.By){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,o.JE)(r,t,e));let s=this.end;if(s){const r=(0,o.JE)(s,t,e);s=s.getTime()===r.getTime()?r:(0,o.Nm)(r,1,t,e)}return new i({start:r,end:s})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return i.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=t.start?.getTime()??-1/0,l=t.end?.getTime()??1/0;let o,n;if(s>=e&&s<=r?o=s:e>=s&&e<=l&&(o=e),r>=s&&r<=l?n=r:l>=e&&l<=r&&(n=l),null!=o&&null!=n&&!isNaN(o)&&!isNaN(n)){const t=new i;return t.start=o===-1/0?null:new Date(o),t.end=n===1/0?null:new Date(n),t}return i.empty}offset(t,e,r=c.By){if(this.isEmpty||this.isAllTime)return this.clone();const s=new i,{start:l,end:n}=this;return null!=l&&(s.start=(0,o.Nm)(l,t,e,r)),null!=n&&(s.end=(0,o.Nm)(n,t,e,r)),s}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return d.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,r=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new i({start:e,end:r})}};(0,s._)([(0,n.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,s._)([(0,a.r)("end")],p.prototype,"readEnd",null),(0,s._)([(0,h.c)("end")],p.prototype,"writeEnd",null),(0,s._)([(0,n.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,s._)([(0,n.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,s._)([(0,n.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,s._)([(0,a.r)("start")],p.prototype,"readStart",null),(0,s._)([(0,h.c)("start")],p.prototype,"writeStart",null),p=i=(0,s._)([(0,u.j)("esri.TimeExtent")],p);const d=new p,y=new p({start:void 0,end:void 0}),f=p},10699:(t,e,r)=>{r.d(e,{IG:()=>o,iv:()=>n});var i=r(43697),s=r(52011);let l=0;const o=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+l++})}};return e=(0,i._)([(0,s.j)("esri.core.Identifiable")],e),e},n=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:l++})}};return e=(0,i._)([(0,s.j)("esri.core.NumericIdentifiable")],e),e};let a=class extends(o(class{})){};a=(0,i._)([(0,s.j)("esri.core.Identifiable")],a)},13867:(t,e,r)=>{r.d(e,{z:()=>s});var i=r(69801);class s{constructor(t,e){this._storage=new i.WJ,this.id="",this.name="",this.size=0,this._storage.maxSize=t,this._storage.register(this),e&&this._storage.registerRemoveFunc("",e)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(t,e,r=1){this._storage.put(this,t,e,r,1)}pop(t){return this._storage.pop(this,t)}get(t){return this._storage.get(this,t)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}resetHitRate(){}}},69801:(t,e,r)=>{r.d(e,{WJ:()=>n,Xq:()=>o});var i,s,l=r(44553);(s=i||(i={}))[s.ALL=0]="ALL",s[s.SOME=1]="SOME";class o{constructor(t,e,r){this.name=t,this._storage=e,this.id=a+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(t,e,r,i=0){this._storage.put(this,t,e,r,i)}get(t){const e=this._storage.get(this,t);return void 0===e?++this._miss:++this._hit,e}peek(t){return this._storage.peek(this,t)}pop(t){const e=this._storage.pop(this,t);return void 0===e?++this._miss:++this._hit,e}updateSize(t,e,r){this._storage.updateSize(this,t,e,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}}class n{get size(){return this._size}constructor(t=10485760){this._maxSize=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new l.Z,this._users=new l.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(t){this._users.push(t)}deregister(t){this._users.removeUnordered(t)}registerRemoveFunc(t,e){this._removeFuncs.push([t,e])}deregisterRemoveFunc(t){this._removeFuncs.filterInPlace((e=>e[0]!==t))}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize=Math.max(t,0),this._checkSizeLimits()}put(t,e,r,s,l){e=t.id+e;const o=this._db.get(e);if(o&&(this._size-=o.size,t.size-=o.size,this._db.delete(e),o.entry!==r&&this._notifyRemove(e,o.entry,i.ALL)),s>this._maxSize)return void this._notifyRemove(e,r,i.ALL);if(void 0===r)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return console.warn(`Refusing to cache entry with size ${s} for key ${e}`),void this._notifyRemove(e,r,i.ALL);const n=1+Math.max(l,-3)- -3;this._db.set(e,{entry:r,size:s,lifetime:n,lives:n}),this._size+=s,t.size+=s,this._checkSizeLimits()}updateSize(t,e,r,s){e=t.id+e;const l=this._db.get(e);if(l&&l.entry===r){for(this._size-=l.size,t.size-=l.size;s>this._maxSize;){const t=this._notifyRemove(e,r,i.SOME);if(!(null!=t&&t>0))return void this._db.delete(e);s=t}l.size=s,this._size+=s,t.size+=s,this._checkSizeLimits()}}pop(t,e){e=t.id+e;const r=this._db.get(e);if(r)return this._size-=r.size,t.size-=r.size,this._db.delete(e),++this._hit,r.entry;++this._miss}get(t,e){e=t.id+e;const r=this._db.get(e);if(void 0!==r)return this._db.delete(e),r.lives=r.lifetime,this._db.set(e,r),++this._hit,r.entry;++this._miss}peek(t,e){const r=this._db.get(t.id+e);return r?++this._hit:++this._miss,r?.entry}get performanceInfo(){const t={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},e={},r=new Array;this._db.forEach(((t,i)=>{const s=t.lifetime;r[s]=(r[s]||0)+t.size,this._users.forAll((r=>{const{id:s,name:l}=r;if(i.startsWith(s)){const r=e[l]||0;e[l]=r+t.size}}))}));const i={};this._users.forAll((t=>{const r=t.name;if("hitRate"in t&&"number"==typeof t.hitRate&&!isNaN(t.hitRate)&&t.hitRate>0){const s=e[r]||0;e[r]=s,i[r]=Math.round(100*t.hitRate)+"%"}else i[r]="0%"}));const s=Object.keys(e);s.sort(((t,r)=>e[r]-e[t])),s.forEach((r=>t[r]=Math.round(e[r]/2**20)+"MB / "+i[r]));for(let e=r.length-1;e>=0;--e){const i=r[e];i&&(t["Priority "+(e+-3-1)]=Math.round(i/this._size*100)+"%")}return t}resetStats(){this._hit=this._miss=0,this._users.forAll((t=>t.resetHitRate()))}clear(t){const e=t.id;this._db.forEach(((t,r)=>{r.startsWith(e)&&(this._size-=t.size,this._db.delete(r),this._notifyRemove(r,t.entry,i.ALL))})),t.size=0}clearAll(){this._db.forEach(((t,e)=>this._notifyRemove(e,t.entry,i.ALL))),this._users.forEach((t=>t.size=0)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(t,e,r){let i;return this._removeFuncs.some((s=>{if(t.startsWith(s[0])){const t=s[1](e,r);return"number"==typeof t&&(i=t),!0}return!1})),i}_checkSizeLimits(){if(this._size>this._maxSize)for(const[t,e]of this._db)if(this._purgeItem(t,e),this._size<=.9*this.maxSize)return;this._users.forEach((t=>{if(t.maxSize>0&&t.size>t.maxSize)for(const[e,r]of this._db)if(e.startsWith(t.id)&&(this._purgeItem(e,r,t),t.size<=.9*t.maxSize))return}))}_purgeItem(t,e,r=this._users.find((e=>t.startsWith(e.id)))){if(this._db.delete(t),e.lives<=1){this._size-=e.size,r&&(r.size-=e.size);const s=this._notifyRemove(t,e.entry,i.SOME);null!=s&&s>0&&(this._size+=s,r&&(r.size+=s),e.lives=e.lifetime,e.size=s,this._db.set(t,e))}else--e.lives,this._db.set(t,e)}}let a=0},17445:(t,e,r)=>{r.d(e,{N1:()=>p,YP:()=>a,Z_:()=>f,gx:()=>u,nn:()=>m,on:()=>c,tX:()=>g}),r(66643),r(46791);var i=r(91460),s=r(50758),l=r(70586),o=r(95330),n=r(26258);function a(t,e,r={}){return h(t,e,r,d)}function u(t,e,r={}){return h(t,e,r,y)}function h(t,e,r={},i){let s=null;const o=r.once?(t,r)=>{i(t)&&((0,l.hw)(s),e(t,r))}:(t,r)=>{i(t)&&e(t,r)};if(s=(0,n.aQ)(t,o,r.sync,r.equals),r.initial){const e=t();o(e,e)}return s}function c(t,e,r,o={}){let n=null,u=null,h=null;function c(){n&&u&&(u.remove(),o.onListenerRemove?.(n),n=null,u=null)}function p(t){o.once&&o.once&&(0,l.hw)(h),r(t)}const d=a(t,((t,r)=>{c(),(0,i.vT)(t)&&(n=t,u=(0,i.on)(t,e,p),o.onListenerAdd?.(t))}),{sync:o.sync,initial:!0});return h=(0,s.kB)((()=>{d.remove(),c()})),h}function p(t,e){return function(t,e,r){if((0,o.Hc)(r))return Promise.reject((0,o.zE)());const i=t();if(e?.(i))return Promise.resolve(i);let n=null;function a(){n=(0,l.hw)(n)}return new Promise(((i,l)=>{n=(0,s.AL)([(0,o.fu)(r,(()=>{a(),l((0,o.zE)())})),h(t,(t=>{a(),i(t)}),{sync:!1,once:!0},e??d)])}))}(t,y,e)}function d(t){return!0}function y(t){return!!t}r(87538);const f={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},87085:(t,e,r)=>{r.d(e,{Z:()=>v});var i=r(43697),s=(r(66577),r(3172)),l=r(20102),o=r(32448),n=r(10699),a=r(83379),u=r(92604),h=r(95330),c=r(17452),p=r(5600),d=(r(75215),r(67676),r(80442),r(52011)),y=r(68773),f=r(6570),m=r(82971);let g=0,_=class extends(o.Z.EventedMixin((0,n.IG)(a.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.Z(-180,-90,180,90,m.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+g++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=m.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(t){const e="string"==typeof t?{url:t}:t;return(await r.e(3529).then(r.bind(r,63529))).fromUrl(e)}static fromPortalItem(t){return async function(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:i}=await r.e(8008).then(r.bind(r,28008));try{return await i(e)}catch(t){const r=e&&e.portalItem,i=r?.id||"unset",s=r&&r.portal&&r.portal.url||y.default.portalUrl;throw u.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+s+"', id: '"+i+"')",t),t}}(t)}initialize(){this.when().catch((t=>{(0,h.D_)(t)||u.Z.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})}))}destroy(){const t=this.parent;if(t){const e=this;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"referenceLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,c.mN)(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await(0,s.Z)(t,{query:{f:"json"},responseType:"json"})).data;throw new l.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,i._)([(0,p.Cb)({type:String})],_.prototype,"attributionDataUrl",void 0),(0,i._)([(0,p.Cb)({type:f.Z})],_.prototype,"fullExtent",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],_.prototype,"hasAttributionData",null),(0,i._)([(0,p.Cb)({type:String,clonable:!1})],_.prototype,"id",void 0),(0,i._)([(0,p.Cb)({type:Boolean,nonNullable:!0})],_.prototype,"legendEnabled",void 0),(0,i._)([(0,p.Cb)({type:["show","hide","hide-children"]})],_.prototype,"listMode",void 0),(0,i._)([(0,p.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],_.prototype,"opacity",void 0),(0,i._)([(0,p.Cb)({clonable:!1})],_.prototype,"parent",void 0),(0,i._)([(0,p.Cb)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,i._)([(0,p.Cb)({type:Boolean,readOnly:!0})],_.prototype,"persistenceEnabled",void 0),(0,i._)([(0,p.Cb)({type:Boolean})],_.prototype,"popupEnabled",void 0),(0,i._)([(0,p.Cb)({type:Boolean})],_.prototype,"attributionVisible",void 0),(0,i._)([(0,p.Cb)({type:m.Z})],_.prototype,"spatialReference",void 0),(0,i._)([(0,p.Cb)({type:String})],_.prototype,"title",void 0),(0,i._)([(0,p.Cb)({readOnly:!0,json:{read:!1}})],_.prototype,"type",void 0),(0,i._)([(0,p.Cb)()],_.prototype,"url",void 0),(0,i._)([(0,p.Cb)({type:Boolean,nonNullable:!0})],_.prototype,"visible",void 0),_=(0,i._)([(0,d.j)("esri.layers.Layer")],_);const v=_},94756:(t,e,r)=>{r.r(e),r.d(e,{default:()=>yt});var i=r(43697),s=r(3172),l=r(66643),o=r(20102),n=r(22974),a=r(16453),u=r(95330),h=r(17452),c=r(5600),p=(r(75215),r(71715)),d=r(52011),y=r(30556),f=r(6570),m=r(82971),g=r(87085),_=r(54295),v=r(46486),w=r(17287),b=r(71612),S=r(17017),A=r(38009),x=r(16859),E=r(72965);let I=null;var R=r(92604),T=r(1533);class U{constructor(t,e){this._spriteSource=t,this._maxTextureSize=e,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded","url"===t.type&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const e in this._spritesData)t.push(e);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>1.15;const{width:e,height:r,data:i,json:s}=await this._getSpriteData(this._spriteSource,t),l=Object.keys(s);if(!l||0===l.length||!i)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=s,this.width=e,this.height=r;const n=Math.max(this._maxTextureSize,4096);if(e>n||r>n){const t=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${n} pixels}`;throw R.Z.getLogger("esri.layers.support.SpriteSource").error(t),new o.Z("SpriteSource",t)}let a;for(let t=0;t<i.length;t+=4)a=i[t+3]/255,i[t]=i[t]*a,i[t+1]=i[t+1]*a,i[t+2]=i[t+2]*a;this.image=i}async _getSpriteData(t,e){if("image"===t.type){let e,r;if(this.devicePixelRatio<1.15){if(!t.spriteSource1x)throw new o.Z("SpriteSource","no image data provided for low resolution sprites!");e=t.spriteSource1x.image,r=t.spriteSource1x.json}else{if(!t.spriteSource2x)throw new o.Z("SpriteSource","no image data provided for high resolution sprites!");e=t.spriteSource2x.image,r=t.spriteSource2x.json}return"width"in e&&"height"in e&&"data"in e&&((0,T.eP)(e.data)||(0,T.KZ)(e.data))?{width:e.width,height:e.height,data:new Uint8Array(e.data),json:r}:{...P(e),json:r}}const r=(0,h.mN)(this.baseURL),i=r.query?"?"+(0,h.B7)(r.query):"",l=this._isRetina?"@2x":"",n=`${r.path}${l}.${this._spriteImageFormat}${i}`,a=`${r.path}${l}.json${i}`,[u,c]=await Promise.all([(0,s.Z)(a,e),(0,s.Z)(n,{responseType:"image",...e})]);return{...P(c.data),json:u.data}}}function P(t){const e=document.createElement("canvas"),r=e.getContext("2d");e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height);const i=r.getImageData(0,0,t.width,t.height);return{width:t.width,height:t.height,data:new Uint8Array(i.data)}}var C=r(11145),L=r(28589),z=r(8744),O=r(40488),B=r(55415);class D{constructor(t){this.url=t}destroy(){this._tileIndexPromise=null}async fetchTileIndex(){return this._tileIndexPromise||(this._tileIndexPromise=(0,s.Z)(this.url).then((t=>t.data.index))),this._tileIndexPromise}async dataKey(t,e){const r=await this.fetchTileIndex();return(0,u.k_)(e),this._getIndexedDataKey(r,t)}_getIndexedDataKey(t,e){const r=[e];if(e.level<0||e.row<0||e.col<0||e.row>>e.level>0||e.col>>e.level>0)return null;let i=e;for(;0!==i.level;)i=new B.Z(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,l,o=t,n=r.pop();if(1===o)return n;for(;r.length;)if(s=r.pop(),l=(1&s.col)+((1&s.row)<<1),o){if(0===o[l]){n=null;break}if(1===o[l]){n=s;break}n=s,o=o[l]}return n}}var F=r(70586);class M{constructor(t,e){this._tilemap=t,this._tileIndexUrl=e}destroy(){this._tilemap=(0,F.SC)(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(t){return this._tileIndexPromise||(this._tileIndexPromise=(0,s.Z)(this._tileIndexUrl,{query:{...t?.query}}).then((t=>t.data.index))),this._tileIndexPromise}dataKey(t,e){const{level:r,row:i,col:s}=t,l=new B.Z(t);return this._tilemap.fetchAvailabilityUpsample(r,i,s,l,e).then((()=>(l.world=t.world,l))).catch((t=>{if((0,u.D_)(t))throw t;return null}))}}var j=r(30175);class Z{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){null===this._promise&&(this._abortController=new AbortController,this._promise=this._makeRequest(this._tileUrl,this._abortController.signal));const e=this._abortOptions;return e.push(t),(0,u.fu)(t,(()=>{e.every((t=>(0,u.Hc)(t)))&&this._abortController.abort()})),this._promise.then((t=>(0,n.d9)(t)))}async _makeRequest(t,e){const{data:r}=await(0,s.Z)(t,{responseType:"array-buffer",signal:e});return r}}const N=new Map;function k(t,e){return(0,j.s1)(N,t,(()=>new Z(t))).getData(e).then((e=>(N.delete(t),e))).catch((e=>{throw N.delete(t),e}))}class W{constructor(t,e,r){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=t,this.sourceUrl=e;const i=(0,h.mN)(this.sourceUrl),s=(0,n.d9)(r),l=s.tiles;if(i)for(let t=0;t<l.length;t++){const e=(0,h.mN)(l[t]);e&&((0,h.YP)(e.path)||(e.path=(0,h.v_)(i.path,e.path)),l[t]=(0,h.fl)(e.path,{...i.query,...e.query}))}this.tileServers=l;const o=r.capabilities&&r.capabilities.split(",").map((t=>t.toLowerCase().trim())),a=!0===r?.exportTilesAllowed,u=!0===o?.includes("tilemap"),c=a&&r.hasOwnProperty("maxExportTilesCount")?r.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:a,supportsTileMap:u},exportTiles:a?{maxExportTilesCount:+c}:null},this.tileInfo=C.Z.fromJSON(s.tileInfo);const p=r.tileMap?(0,h.fl)((0,h.v_)(i.path,r.tileMap),i.query??{}):null;u?(this.type="vector-tile",this.tilemap=new M(new L.y({layer:{parsedUrl:i,tileInfo:this.tileInfo},minLOD:s.minLOD??this.tileInfo.lods[0].level,maxLOD:s.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),p)):p&&(this.tilemap=new D(p)),this.fullExtent=f.Z.fromJSON(r.fullExtent),this.initialExtent=f.Z.fromJSON(r.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(t,e){return await(this.tilemap?.dataKey(t,e))??t}requestTile(t,e,r,i){return function(t,e,r,i,s){const l=(0,h.mN)(t),o=l.query;if(o)for(const[t,s]of Object.entries(o))switch(s){case"{x}":o[t]=i.toString();break;case"{y}":o[t]=r.toString();break;case"{z}":o[t]=e.toString()}const n=l.path;return k((0,h.fl)(n.replaceAll(/\{z\}/gi,e.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...l.query}),s)}(this.tileServers[e%this.tileServers.length],t,e,r,i)}isCompatibleWith(t){const e=this.tileInfo,r=t.tileInfo;if(!e.spatialReference.equals(r.spatialReference))return!1;if(!e.origin.equals(r.origin))return!1;if(Math.round(e.dpi)!==Math.round(r.dpi))return!1;const i=e.lods,s=r.lods,l=Math.min(i.length,s.length);for(let t=0;t<l;t++){const e=i[t],r=s[t];if(e.level!==r.level||Math.round(e.scale)!==Math.round(r.scale))return!1}return!0}}function G(...t){let e;for(const r of t)if(null!=r)if((0,h.oC)(r)){if(e){const t=e.split("://")[0];e=t+":"+r.trim()}}else e=(0,h.YP)(r)?r:(0,h.v_)(e,r);return e?(0,h.Qj)(e):void 0}async function $(t,e,r,i,l){let o,n,a;if((0,u.k_)(l),"string"==typeof r){const t=(0,h.Fv)(r);a=await(0,s.Z)(t,{...l,responseType:"json",query:{f:"json",...l?.query}}),a.ssl&&(o&&(o=o.replace(/^http:/i,"https:")),n&&(n=n.replace(/^http:/i,"https:"))),o=t,n=t}else null!=r&&(a={data:r},o=r.jsonUrl||null,n=i);const c=a?.data;if(H(c))return t.styleUrl=o||null,async function(t,e,r,i){const s=r?(0,h.Yd)(r):(0,h.L)();t.styleBase=s,t.style=e,e["sprite-format"]&&"webp"===e["sprite-format"].toLowerCase()&&(t.spriteFormat="webp");const l=[];if(e.sources&&e.sources.esri){const r=e.sources.esri;r.url?await $(t,"esri",G(s,r.url),void 0,i):l.push($(t,"esri",r,s,i))}for(const r of Object.keys(e.sources))"esri"!==r&&"vector"===e.sources[r].type&&(e.sources[r].url?l.push($(t,r,G(s,e.sources[r].url),void 0,i)):e.sources[r].tiles&&l.push($(t,r,e.sources[r],s,i)));await Promise.all(l)}(t,c,n,l);if(!H(c))return t.sourceUrl?K(t,c,n,!1,e,l):(t.sourceUrl=o||null,K(t,c,n,!0,e,l));throw new Error("You must specify the URL or the JSON for a service or for a style.")}function q(t){return"object"==typeof t&&!!t&&"tilejson"in t&&null!=t.tilejson}function H(t){return!!t&&"sources"in t&&!!t.sources}async function K(t,e,r,i,s,l){const o=r?(0,h.Qj)(r)+"/":(0,h.L)(),a=function(t){if(t.hasOwnProperty("tileInfo"))return t;const e={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100}};let r=null;if(q(t)){const{bounds:e}=t;if(e){const t=(0,O.$)({x:e[0],y:e[1],spatialReference:(0,n.d9)(z.Zn)}),i=(0,O.$)({x:e[2],y:e[3],spatialReference:(0,n.d9)(z.Zn)});r={xmin:t.x,ymin:t.y,xmax:i.x,ymax:i.y,spatialReference:(0,n.d9)(z.R_)}}}null===r&&(r=e);let i=78271.51696400007,s=295828763.7957775;const l=[],o=t.hasOwnProperty("minzoom")?+t.minzoom:0,a=t.hasOwnProperty("maxzoom")?+t.maxzoom:22;for(let t=0;t<=a;t++)t>=o&&l.push({level:t,scale:s,resolution:i}),i/=2,s/=2;return{capabilities:"TilesOnly",initialExtent:r,fullExtent:e,minScale:0,maxScale:0,tiles:t.tiles,tileInfo:{rows:512,cols:512,dpi:96,format:"pbf",origin:{x:-20037508.342787,y:20037508.342787},lods:l,spatialReference:(0,n.d9)(z.R_)}}}(e),u=new W(s,(0,h.fl)(o,l?.query??{}),a);if(!i&&t.primarySourceName in t.sourceNameToSource){const e=t.sourceNameToSource[t.primarySourceName];if(!e.isCompatibleWith(u))return;null!=u.fullExtent&&(null!=e.fullExtent?e.fullExtent.union(u.fullExtent):e.fullExtent=u.fullExtent.clone()),e.tileInfo&&u.tileInfo&&e.tileInfo.lods.length<u.tileInfo.lods.length&&(e.tileInfo=u.tileInfo)}if(i&&(t.sourceBase=o,t.source=e,t.validatedSource=a,t.primarySourceName=s),t.sourceNameToSource[s]=u,!q(t)&&"defaultStyles"in e&&!t.style){if(null==e.defaultStyles)throw new Error;return"string"==typeof e.defaultStyles?$(t,"",G(o,e.defaultStyles,"root.json"),void 0,l):$(t,"",e.defaultStyles,G(o,"root.json"),l)}}var V=r(33516),Q=r(19745),J=r(25929),X=r(94139),Y=r(39450);const tt=1e-6;function et(t,e){if(t===e)return!0;if(null==t&&null!=e)return!1;if(null!=t&&null==e)return!1;if(null==t||null==e)return!1;if(!t.spatialReference.equals(e.spatialReference)||t.dpi!==e.dpi)return!1;const r=t.origin,i=e.origin;if(Math.abs(r.x-i.x)>=tt||Math.abs(r.y-i.y)>=tt)return!1;let s,l;t.lods[0].scale>e.lods[0].scale?(s=t,l=e):(l=t,s=e);for(let t=s.lods[0].scale;t>=l.lods[l.lods.length-1].scale-tt;t/=2)if(Math.abs(t-l.lods[0].scale)<tt)return!0;return!1}function rt(t,e){if(t===e)return t;if(null==t&&null!=e)return e;if(null!=t&&null==e)return t;if(null==t||null==e)return null;const r=t.size[0],i=t.format,s=t.dpi,l=new X.Z({x:t.origin.x,y:t.origin.y}),o=t.spatialReference,n=t.lods[0].scale>e.lods[0].scale?t.lods[0]:e.lods[0],a=t.lods[t.lods.length-1].scale<=e.lods[e.lods.length-1].scale?t.lods[t.lods.length-1]:e.lods[e.lods.length-1],u=n.scale,h=n.resolution,c=a.scale,p=[];let d=u,y=h,f=0;for(;d>c;)p.push(new Y.Z({level:f,resolution:y,scale:d})),f++,d/=2,y/=2;return new C.Z({size:[r,r],dpi:s,format:i||"pbf",origin:l,lods:p,spatialReference:o})}var it=r(51785),st=r(7575);let lt,ot;function nt(t){const e=(0,st.Sh)(t);for(;e.length>1;){const t=at(e.shift());if(t.available)return t}return at(e.shift())}function at(t){switch(t){case st.zO.WEBGL1:return lt||(lt=function(){const t=new ht,e=pt(st.zO.WEBGL1,t);return null==e||(t.supportsElementIndexUint=null!==e.getExtension("OES_element_index_uint"),t.supportsStandardDerivatives=null!==e.getExtension("OES_standard_derivatives"),t.supportsInstancedArrays=null!==e.getExtension("ANGLE_instanced_arrays"),t.supportsTextureFloat=null!==e.getExtension("OES_texture_float"),t.supportsTextureHalfFloat=null!==e.getExtension("OES_texture_half_float"),t.supportsColorBufferFloat=null!==e.getExtension("WEBGL_color_buffer_float"),t.supportsColorBufferFloatBlend=null!==e.getExtension("EXT_float_blend"),t.supportsColorBufferHalfFloat=null!==e.getExtension("EXT_color_buffer_half_float")),t}()),lt;case st.zO.WEBGL2:return ot||(ot=function(){const t=new ct,e=pt(st.zO.WEBGL2,t);return null==e||(t.supportsColorBufferFloat=null!==e.getExtension("EXT_color_buffer_float"),t.supportsColorBufferFloatBlend=null!==e.getExtension("EXT_float_blend"),t.supportsColorBufferHalfFloat=t.supportsColorBufferFloat||null!==e.getExtension("EXT_color_buffer_half_float")),t}()),ot}}class ut{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}}class ht extends ut{constructor(){super(...arguments),this.type=st.zO.WEBGL1}}class ct extends ut{constructor(){super(...arguments),this.type=st.zO.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}}function pt(t,e){if(t===st.zO.WEBGL1&&"undefined"==typeof WebGLRenderingContext||t===st.zO.WEBGL2&&"undefined"==typeof WebGL2RenderingContext)return null;const r=document.createElement("canvas");if(!r)return null;let i=(0,st.kr)(r,t,{failIfMajorPerformanceCaveat:!0});if(null==i&&(i=(0,st.kr)(r,t),null!=i&&(e.majorPerformanceCaveat=!0)),null==i)return i;if(t===st.zO.WEBGL1){const t=i.getParameter(i.VERSION),r=t?.match(/^WebGL\s+([\d.]*)/);if(r){const t=parseFloat(r[1]);e.available=t>=.94}}else e.available=!0;e.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const s=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);return s&&(e.supportsHighPrecisionFragment=s.precision>0),i}let dt=class extends((0,b.h)((0,E.M)((0,v.Z)((0,w.Y)((0,A.q)((0,x.I)((0,S.N)((0,_.V)((0,a.R)(g.Z)))))))))){constructor(...t){super(...t),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null,this.path=null}normalizeCtorArgs(t,e){return"string"==typeof t?{url:t,...e}:t}destroy(){if(this.sourceNameToSource)for(const t of Object.values(this.sourceNameToSource))t?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(t){await this.loadSpriteSource(globalThis.devicePixelRatio||1,t)}load(t){const e=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},t).catch(u.r9).then((async()=>{if(!this.portalItem?.id)return;const e=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await(0,s.Z)(e,{...t,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:e},(0,V.ht)(this.portalItem))})).catch(u.r9).then((()=>this._loadStyle(t)));return this.addResolvingPromise(e),Promise.resolve(this)}get attributionDataUrl(){const t=this.currentStyleInfo,e=t?.serviceUrl&&(0,h.mN)(t.serviceUrl);if(!e)return null;const r=this._getDefaultAttribution(e.path);return r?(0,h.fl)(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const t=this.primarySource;return t?t.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?(0,h.mN)(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(t,e){t&&(0,h.oC)(t)&&(t=`https:${t}`);const r=(0,Q.a)(t);e.styleUrl=(0,J.e)(t,r)}get tileInfo(){const t=[];for(const e in this.sourceNameToSource)t.push(this.sourceNameToSource[e]);let e=this.primarySource?.tileInfo||new C.Z;if(t.length>1)for(let r=0;r<t.length;r++)et(e,t[r].tileInfo)&&(e=rt(e,t[r].tileInfo));return e}readTilemapCache(t,e){const r=e.capabilities?.includes("Tilemap");return r?new L.y({layer:this}):null}readVersion(t,e){return e.version?parseFloat(e.version):parseFloat(e.currentVersion)}async loadSpriteSource(t=1,e){if(!this._spriteSourceMap.has(t)){const r=nt("2d").maxTextureSize,i=this.currentStyleInfo?.spriteUrl?(0,h.fl)(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,s=new U({type:"url",spriteUrl:i,pixelRatio:t,spriteFormat:this.currentStyleInfo?.spriteFormat},r);await s.load(e),this._spriteSourceMap.set(t,s)}return this._spriteSourceMap.get(t)}async setSpriteSource(t,e){if(!t)return null;const r=nt("2d").maxTextureSize,i=t.spriteUrl,s=i?(0,h.fl)(i,{...this.customParameters,token:this.apiKey}):null;if(!s&&"url"===t.type)return null;const l=new U(t,r);try{await l.load(e);const r=t.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,l),s&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=s),this.emit("spriteSource-change",{spriteSource:l}),l}catch(t){(0,u.r9)(t)}return null}async loadStyle(t,e){const r=t||this.style||this.url;return this._loadingTask&&"string"==typeof r&&this.url===r||(this._loadingTask?.abort(),this._loadingTask=(0,l.vr)((t=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:t}))),e)),this._loadingTask.promise}getStyleLayerId(t){return this.styleRepository.getStyleLayerId(t)}getStyleLayerIndex(t){return this.styleRepository.getStyleLayerIndex(t)}getPaintProperties(t){return(0,n.d9)(this.styleRepository?.getPaintProperties(t))}setPaintProperties(t,e){const r=this.styleRepository.isPainterDataDriven(t);this.styleRepository.setPaintProperties(t,e);const i=this.styleRepository.isPainterDataDriven(t);this.emit("paint-change",{layer:t,paint:e,isDataDriven:r||i})}getStyleLayer(t){return(0,n.d9)(this.styleRepository.getStyleLayer(t))}setStyleLayer(t,e){this.styleRepository.setStyleLayer(t,e),this.emit("style-layer-change",{layer:t,index:e})}deleteStyleLayer(t){this.styleRepository.deleteStyleLayer(t),this.emit("delete-style-layer",{layer:t})}getLayoutProperties(t){return(0,n.d9)(this.styleRepository.getLayoutProperties(t))}setLayoutProperties(t,e){this.styleRepository.setLayoutProperties(t,e),this.emit("layout-change",{layer:t,layout:e})}setStyleLayerVisibility(t,e){this.styleRepository.setStyleLayerVisibility(t,e),this.emit("style-layer-visibility-change",{layer:t,visibility:e})}getStyleLayerVisibility(t){return this.styleRepository.getStyleLayerVisibility(t)}write(t,e){return e?.origin&&!this.styleUrl?(e.messages&&e.messages.push(new o.Z("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(t,e)}getTileUrl(t,e,r){return null}async _getSourceAndStyle(t,e){if(!t)throw new Error("invalid style!");const r=await async function(t,e){const r={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:"",spriteFormat:"png"},[i,s]="string"==typeof t?[t,null]:[null,t.jsonUrl];return await $(r,"esri",t,s,e),{layerDefinition:r.validatedSource,url:i,serviceUrl:r.sourceUrl,style:r.style,styleUrl:r.styleUrl,spriteUrl:r.style.sprite&&G(r.styleBase,r.style.sprite),spriteFormat:r.spriteFormat,glyphsUrl:r.style.glyphs&&G(r.styleBase,r.style.glyphs),sourceNameToSource:r.sourceNameToSource,primarySourceName:r.primarySourceName}}(t,{...e,query:{...this.customParameters,token:this.apiKey}});"webp"===r.spriteFormat&&(await function(t){if(I)return I;const e={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return I=new Promise((t=>{const r=new Image;r.onload=()=>{r.onload=r.onerror=null,t(r.width>0&&r.height>0)},r.onerror=()=>{r.onload=r.onerror=null,t(!1)},r.src="data:image/webp;base64,"+e.lossy})),I}()||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),"string"==typeof t?(this.url=t,this.style=null):(this.url=null,this.style=t),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new it.Z(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(t){const e=t.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!e)return;const i=e[2]&&e[2].toLowerCase();if(!i)return;const s=e[1]||"";for(const t of r)if(t.toLowerCase().includes(i))return(0,h.Fv)(`//static.arcgis.com/attribution/Vector${s}/${t}`)}async _loadStyle(t){return this._loadingTask?.promise??this.loadStyle(null,t)}};(0,i._)([(0,c.Cb)({readOnly:!0})],dt.prototype,"attributionDataUrl",null),(0,i._)([(0,c.Cb)({type:["show","hide"]})],dt.prototype,"listMode",void 0),(0,i._)([(0,c.Cb)({json:{read:!0,write:!0}})],dt.prototype,"blendMode",void 0),(0,i._)([(0,c.Cb)({readOnly:!0,json:{read:!1}})],dt.prototype,"capabilities",null),(0,i._)([(0,c.Cb)({readOnly:!0})],dt.prototype,"currentStyleInfo",void 0),(0,i._)([(0,c.Cb)({json:{read:!1},readOnly:!0,type:f.Z})],dt.prototype,"fullExtent",null),(0,i._)([(0,c.Cb)({json:{read:!1},readOnly:!0,type:f.Z})],dt.prototype,"initialExtent",null),(0,i._)([(0,c.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],dt.prototype,"isReference",void 0),(0,i._)([(0,c.Cb)({type:["VectorTileLayer"]})],dt.prototype,"operationalLayerType",void 0),(0,i._)([(0,c.Cb)({readOnly:!0})],dt.prototype,"parsedUrl",null),(0,i._)([(0,c.Cb)()],dt.prototype,"style",void 0),(0,i._)([(0,c.Cb)({readOnly:!0})],dt.prototype,"serviceUrl",null),(0,i._)([(0,c.Cb)({type:m.Z,readOnly:!0})],dt.prototype,"spatialReference",null),(0,i._)([(0,c.Cb)({readOnly:!0})],dt.prototype,"styleRepository",void 0),(0,i._)([(0,c.Cb)({readOnly:!0})],dt.prototype,"sourceNameToSource",void 0),(0,i._)([(0,c.Cb)({readOnly:!0})],dt.prototype,"primarySource",void 0),(0,i._)([(0,c.Cb)({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],dt.prototype,"styleUrl",null),(0,i._)([(0,y.c)(["portal-item","web-document"],"styleUrl")],dt.prototype,"writeStyleUrl",null),(0,i._)([(0,c.Cb)({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:C.Z})],dt.prototype,"tileInfo",null),(0,i._)([(0,c.Cb)()],dt.prototype,"tilemapCache",void 0),(0,i._)([(0,p.r)("service","tilemapCache",["capabilities","tileInfo"])],dt.prototype,"readTilemapCache",null),(0,i._)([(0,c.Cb)({json:{read:!1},readOnly:!0,value:"vector-tile"})],dt.prototype,"type",void 0),(0,i._)([(0,c.Cb)({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],dt.prototype,"url",void 0),(0,i._)([(0,c.Cb)({readOnly:!0})],dt.prototype,"version",void 0),(0,i._)([(0,p.r)("version",["version","currentVersion"])],dt.prototype,"readVersion",null),(0,i._)([(0,c.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],dt.prototype,"path",void 0),dt=(0,i._)([(0,d.j)("esri.layers.VectorTileLayer")],dt);const yt=dt},54295:(t,e,r)=>{r.d(e,{V:()=>o});var i=r(43697),s=r(5600),l=(r(75215),r(67676),r(80442),r(52011));const o=t=>{let e=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(t){null!=t?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,s.Cb)({type:String})],e.prototype,"apiKey",null),e=(0,i._)([(0,l.j)("esri.layers.mixins.APIKeyMixin")],e),e}},17017:(t,e,r)=>{r.d(e,{N:()=>o});var i=r(43697),s=r(5600),l=(r(75215),r(67676),r(80442),r(52011));const o=t=>{let e=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i._)([(0,s.Cb)({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=(0,i._)([(0,l.j)("esri.layers.mixins.CustomParametersMixin")],e),e}},16859:(t,e,r)=>{r.d(e,{I:()=>S});var i=r(43697),s=r(68773),l=r(40330),o=r(3172),n=r(66643),a=r(20102),u=r(92604),h=r(70586),c=r(95330),p=r(17452),d=r(5600),y=(r(75215),r(67676),r(80442),r(71715)),f=r(52011),m=r(30556),g=r(84230),_=r(48522),v=r(15235),w=r(86082),b=r(14661);const S=t=>{let e=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,h.SC)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,e,r){if(e.itemId)return new v.default({id:e.itemId,portal:r?.portal})}writePortalItem(t,e){t?.id&&(e.itemId=t.id)}async loadFromPortal(t,e){if(this.portalItem?.id)try{const{load:i}=await r.e(8062).then(r.bind(r,18062));return(0,c.k_)(e),await i({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap},e)}catch(t){throw(0,c.D_)(t)||u.Z.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${t}`),t}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch((t=>((0,c.r9)(t),!0))))}async setUserPrivileges(t,e){if(!s.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(t,e);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(t){(0,c.r9)(t)}}async _fetchUserPrivileges(t,e){let r=this.portalItem;if(!t||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=t===r.id;if(i&&r.portal.user)return(0,b.Ss)(r);let s,o;if(i)s=r.portal.url;else try{s=await(0,g.oP)(this.url,e)}catch(t){(0,c.r9)(t)}if(!s||!(0,p.Zo)(s,r.portal.url))return this._fetchFallbackUserPrivileges(e);try{const t=null!=e?e.signal:null;o=await(l.id?.getCredential(`${s}/sharing`,{prompt:!1,signal:t}))}catch(t){(0,c.r9)(t)}if(!o)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(i?await r.reload():(r=new v.default({id:t,portal:{url:s}}),await r.load(e)),r.portal.user)return(0,b.Ss)(r)}catch(t){(0,c.r9)(t)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(t){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(t)}catch(t){(0,c.r9)(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const e=this.url?l.id?.findCredential(this.url):null;if(!e)return!0;const r=A.credential===e?A.user:await this._fetchEditingUser(t);return A.credential=e,A.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const e=this.portalItem?.portal?.user;if(e)return e;const r=l.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,s=_.Z.getDefault();if(s&&s.loaded&&(0,p.Fv)(s.restUrl)===(0,p.Fv)(i))return s.user;const a=`${i}/community/self`,u=null!=t?t.signal:null,h=await(0,n.q6)((0,o.Z)(a,{authMode:"no-prompt",query:{f:"json"},signal:u}));return h.ok?w.Z.fromJSON(h.value.data):null}read(t,e){e&&(e.layer=this),super.read(t,e)}write(t,e){const r=e?.portal,i=this.portalItem?.id&&(this.portalItem.portal||_.Z.getDefault());return r&&i&&!(0,p.tm)(i.restUrl,r.restUrl)?(e.messages&&e.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...e,layer:this})}};return(0,i._)([(0,d.Cb)({type:v.default})],e.prototype,"portalItem",null),(0,i._)([(0,y.r)("web-document","portalItem",["itemId"])],e.prototype,"readPortalItem",null),(0,i._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],e.prototype,"writePortalItem",null),(0,i._)([(0,d.Cb)({clonable:!1})],e.prototype,"resourceReferences",void 0),(0,i._)([(0,d.Cb)({type:Boolean,readOnly:!0})],e.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,d.Cb)({type:Boolean,readOnly:!0})],e.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,d.Cb)({type:Boolean,readOnly:!0})],e.prototype,"userHasUpdateItemPrivileges",void 0),e=(0,i._)([(0,f.j)("esri.layers.mixins.PortalLayer")],e),e},A={credential:null,user:null}},33516:(t,e,r)=>{r.d(e,{M4:()=>a,Yv:()=>o,ht:()=>l,wk:()=>n});var i=r(17452),s=r(48522);function l(t){return{origin:"portal-item",url:(0,i.mN)(t.itemUrl),portal:t.portal||s.Z.getDefault(),portalItem:t,readResourcePaths:[]}}function o(t){const e=(0,i.mN)(t.itemUrl);return{origin:"portal-item",messages:[],writtenProperties:[],url:e,portal:t.portal||s.Z.getDefault(),portalItem:t,verifyItemRelativeUrls:e?{rootPath:e.path,writtenUrls:[]}:null,blockedRelativeUrls:[]}}function n(t){return{origin:"web-map",url:(0,i.mN)(t.itemUrl),portal:t.portal||s.Z.getDefault(),portalItem:t,readResourcePaths:[]}}function a(t,e){const r=(0,i.mN)(t.itemUrl);return{origin:"web-map",messages:[],writtenProperties:[],url:r,portal:t.portal||s.Z.getDefault(),portalItem:t,initiator:e,verifyItemRelativeUrls:r?{rootPath:r.path,writtenUrls:[]}:null,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}}},55415:(t,e,r)=>{r.d(e,{Z:()=>s});var i=r(71143);class s{static getId(t,e,r,i){return"object"==typeof t?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${e}/${r}/${i}`}constructor(t,e,r,i){this.set(t,e,r,i)}get key(){return this}get id(){return this.toString()}set id(t){this.set(t)}get hash(){const t=4095&this.row,e=4095&this.col,r=63&this.level;return(3&this.world)<<30|e<<22|t<<8|r}acquire(t,e,r,i){this.set(t,e,r,i)}contains(t){const e=t.level-this.level;return e>=0&&this.row===t.row>>e&&this.col===t.col>>e&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,e,r,i){if(null==t)this.level=0,this.row=0,this.col=0,this.world=0;else if("object"==typeof t)this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if("string"==typeof t){const[e,r,i,s]=t.split("/");this.level=parseFloat(e),this.row=parseFloat(r),this.col=parseFloat(i),this.world=parseFloat(s)}else this.level=+t,this.row=+e,this.col=+r,this.world=+i||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const t=this.level+1,e=this.row<<1,r=this.col<<1,i=this.world;return[new s(t,e,r,i),new s(t,e,r+1,i),new s(t,e+1,r,i),new s(t,e+1,r+1,i)]}compareRowMajor(t){return this.row<t.row?-1:this.row>t.row?1:this.col<t.col?-1:this.col>t.col?1:0}}s.pool=new i.Z(s,null,null,25,50)},7575:(t,e,r)=>{r.d(e,{Sh:()=>o,kr:()=>l,zO:()=>i});var i,s=r(80442);function l(t,e,r={}){const s=e===i.WEBGL1?"webgl":"webgl2";return t.getContext(s,r)||null}function o(t){if("3d"===t)return[i.WEBGL2];const e=(0,s.Z)("esri-force-webgl");return e===i.WEBGL1||e===i.WEBGL2?[e]:(0,s.Z)("mac")&&(0,s.Z)("chrome")?[i.WEBGL1,i.WEBGL2]:[i.WEBGL2,i.WEBGL1]}!function(t){t[t.WEBGL1=1]="WEBGL1",t[t.WEBGL2=2]="WEBGL2"}(i||(i={}))}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2664],{65845:(e,t,r)=>{r.d(t,{D:()=>n});var a=r(81153);function n(e){e?.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,a.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function a(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>a})},32664:(e,t,r)=>{r.d(t,{save:()=>P,saveAs:()=>N});var a=r(67676),n=(r(20102),r(19238)),o=r(64383),i=r(66677),s=r(52104),l=r(84230),u=(r(33516),r(14661));const c="Feature Service",p="feature-layer-utils",d=`${p}-save`,y=`${p}-save-as`;function f(e){return{isValid:(0,l.fP)(e)&&("feature"!==e.type||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function m(e){const t=[],r=[];for(const{layer:a,layerJSON:n}of e)a.isTable?r.push(n):t.push(n);return{layers:t,tables:r}}function w(e){return m([e])}async function v(e,t){return/\/\d+\/?$/.test(e.url)?w(t[0]):async function(e,t){if(!t)return m(e);const{layer:{url:r,customParameters:a,apiKey:o}}=e[0];let i=await t.fetchData("json");null!=i?.layers&&null!=i.tables||(i=await async function(e,t,r){e||={},e.layers||=[],e.tables||=[];const{url:a,customParameters:o,apiKey:i}=t,{serviceJSON:l,layersJSON:u}=await(0,s.V)(a,{customParameters:o,apiKey:i}),c=b(e.layers,l.layers,r),p=b(e.tables,l.tables,r);e.layers=c.itemResources,e.tables=p.itemResources;const d=[...c.added,...p.added],y=u?[...u.layers,...u.tables]:[];return await async function(e,t,r,a){const o=t.map((({id:e})=>new n.default({url:r,layerId:e,sourceJSON:a.find((({id:t})=>t===e))})));await Promise.allSettled(o.map((e=>e.load()))),o.forEach((t=>{const{layerId:r,loaded:a,defaultPopupTemplate:n}=t;a&&null!=n&&g(t,{id:r,popupInfo:n.toJSON()},e)}))}(e,d,a,y),e}(i,{url:r??"",customParameters:a,apiKey:o},e.map((e=>e.layer.layerId))));for(const t of e)g(t.layer,t.layerJSON,i);return i}(t,e)}function b(e,t,r){const n=(0,a.e5)(e,t,((e,t)=>e.id===t.id));e=e.filter((e=>!n.removed.some((t=>t.id===e.id))));const o=n.added.map((({id:e})=>({id:e})));return o.forEach((({id:t})=>{e.push({id:t})})),{itemResources:e,added:o.filter((({id:e})=>!r.includes(e)))}}function g(e,t,r){e.isTable?h(r.tables,t):h(r.layers,t)}function h(e,t){const r=e.findIndex((({id:e})=>e===t.id));-1===r?e.push(t):e[r]=t}async function I(e,t){const{url:r,layerId:a,title:n,fullExtent:o,isTable:s}=e,l=(0,i.Qc)(r);t.url="FeatureServer"===l?.serverType?r:`${r}/${a}`,t.title||=n,t.extent=null,s||null==o||(t.extent=await(0,u.$o)(o)),(0,u.ck)(t,u.Kz.METADATA),(0,u.ck)(t,u.Kz.MULTI_LAYER),(0,u.qj)(t,u.Kz.SINGLE_LAYER),s&&(0,u.qj)(t,u.Kz.TABLE)}async function P(e,t){return(0,o.a1)({layer:e,itemType:c,validateLayer:f,createItemData:(e,t)=>v(t,[e]),errorNamePrefix:d},t)}async function N(e,t,r){return(0,o.po)({layer:e,itemType:c,validateLayer:f,createItemData:(e,t)=>Promise.resolve(w(e)),errorNamePrefix:y,newItem:t,setItemProperties:I},r)}},64383:(e,t,r)=>{r.d(t,{a1:()=>v,po:()=>b});var a=r(20102),n=r(65845),o=r(48522),i=r(15235),s=r(33516),l=r(14661),u=r(14769);async function c(e){const{layer:t,errorNamePrefix:r,validateLayer:n}=e;await t.load(),function(e,t,r){const n=r(e);if(!n.isValid)throw new a.Z(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}(t,r,n)}function p(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function d(e){const{item:t,itemType:r,errorNamePrefix:n,layer:o,validateItem:i}=e;if((0,u.w)(t),t.type!==r)throw new a.Z(`${n}:portal-item-wrong-type`,`Portal item type should be "${r}"`,{item:t,layer:o});if(i){const e=i(t);if(!e.isValid)throw new a.Z(`${n}:invalid-parameters`,e.errorMessage,{layer:o})}}function y(e){const{layer:t,errorNamePrefix:r}=e,{portalItem:n}=t;if(!n)throw new a.Z(`${r}:portal-item-not-set`,p(t,"requires the portalItem property to be set"));if(!n.loaded)throw new a.Z(`${r}:portal-item-not-loaded`,p(t,"cannot be saved to a portal item that does not exist or is inaccessible"));d({...e,item:n})}function f(e){const{newItem:t,itemType:r}=e;let a=i.default.from(t);return a.id&&(a=a.clone(),a.id=null),a.type??=r,a.portal??=o.Z.getDefault(),d({...e,item:a}),a}async function m(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const n=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),function(e,t){let r=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:t,details:r})=>new a.Z(e,t,r)));if(e.blockedRelativeUrls&&(r=r.concat(e.blockedRelativeUrls.map((e=>new a.Z("url:unsupported",`Relative url '${e}' is not supported`))))),t?.ignoreUnsupported&&(r=r.filter((({name:e})=>"layer:unsupported"!==e&&"symbol:unsupported"!==e&&"symbol-layer:unsupported"!==e&&"property:unsupported"!==e&&"url:unsupported"!==e))),r.length>0)throw new a.Z("layer-write:unsupported","Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}(t,r),n}function w(e){(0,l.qj)(e,l.Kz.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function v(e,t){const{layer:r,createItemData:a,createJSONContext:o,saveResources:i}=e;await c(e),y(e);const l=r.portalItem,u=o?o(l):(0,s.Yv)(l),p=await m(r,u,t),d=await a({layer:r,layerJSON:p},l);return w(l),await l.update({data:d}),(0,n.D)(u),await(i?.(l,u)),l}async function b(e,t){const{layer:r,createItemData:a,createJSONContext:o,setItemProperties:i,saveResources:l}=e;await c(e);const u=f(e),p=o?o(u):(0,s.Yv)(u),d=await m(r,p,t),y=await a({layer:r,layerJSON:d},u);return await i(r,u),w(u),await async function(e,t,r){const a=e.portal;await a.signIn(),await(a.user?.addItem({item:e,data:t,folder:r?.folder}))}(u,y,t),r.portalItem=u,(0,n.D)(p),await(l?.(u,p)),u}},52104:(e,t,r)=>{r.d(t,{V:()=>n});var a=r(96187);async function n(e,t){const r=await(0,a.T)(e,t);r.layers=r.layers.filter(o);const n={serviceJSON:r};if((r.currentVersion??0)<10.5)return n;const i=await(0,a.T)(e+"/layers",t);return n.layersJSON={layers:i.layers.filter(o),tables:i.tables},n}function o(e){return!e.type||"Feature Layer"===e.type||"Oriented Imagery Layer"===e.type}},33516:(e,t,r)=>{r.d(t,{M4:()=>l,Yv:()=>i,ht:()=>o,wk:()=>s});var a=r(17452),n=r(48522);function o(e){return{origin:"portal-item",url:(0,a.mN)(e.itemUrl),portal:e.portal||n.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function i(e){const t=(0,a.mN)(e.itemUrl);return{origin:"portal-item",messages:[],writtenProperties:[],url:t,portal:e.portal||n.Z.getDefault(),portalItem:e,verifyItemRelativeUrls:t?{rootPath:t.path,writtenUrls:[]}:null,blockedRelativeUrls:[]}}function s(e){return{origin:"web-map",url:(0,a.mN)(e.itemUrl),portal:e.portal||n.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function l(e,t){const r=(0,a.mN)(e.itemUrl);return{origin:"web-map",messages:[],writtenProperties:[],url:r,portal:e.portal||n.Z.getDefault(),portalItem:e,initiator:t,verifyItemRelativeUrls:r?{rootPath:r.path,writtenUrls:[]}:null,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}}},96187:(e,t,r)=>{r.d(t,{T:()=>n});var a=r(3172);async function n(e,t){const{data:r}=await(0,a.Z)(e,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}});return r}},14769:(e,t,r)=>{r.d(t,{w:()=>i});var a=r(68773),n=r(20102),o=r(71058);function i(e){if(a.default.apiKey&&(0,o.r)(e.portal.url))throw new n.Z("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${e.portal.url} when using an api key`)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3831,2664],{65845:(e,t,r)=>{r.d(t,{D:()=>n});var o=r(81153);function n(e){e?.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,o.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function o(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>o})},32664:(e,t,r)=>{r.d(t,{save:()=>R,saveAs:()=>P});var o=r(67676),n=(r(20102),r(19238)),a=r(64383),i=r(66677),s=r(52104),l=r(84230),u=(r(33516),r(14661));const p="Feature Service",c="feature-layer-utils",y=`${c}-save`,f=`${c}-save-as`;function m(e){return{isValid:(0,l.fP)(e)&&("feature"!==e.type||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function d(e){const t=[],r=[];for(const{layer:o,layerJSON:n}of e)o.isTable?r.push(n):t.push(n);return{layers:t,tables:r}}function h(e){return d([e])}async function g(e,t){return/\/\d+\/?$/.test(e.url)?h(t[0]):async function(e,t){if(!t)return d(e);const{layer:{url:r,customParameters:o,apiKey:a}}=e[0];let i=await t.fetchData("json");null!=i?.layers&&null!=i.tables||(i=await async function(e,t,r){e||={},e.layers||=[],e.tables||=[];const{url:o,customParameters:a,apiKey:i}=t,{serviceJSON:l,layersJSON:u}=await(0,s.V)(o,{customParameters:a,apiKey:i}),p=w(e.layers,l.layers,r),c=w(e.tables,l.tables,r);e.layers=p.itemResources,e.tables=c.itemResources;const y=[...p.added,...c.added],f=u?[...u.layers,...u.tables]:[];return await async function(e,t,r,o){const a=t.map((({id:e})=>new n.default({url:r,layerId:e,sourceJSON:o.find((({id:t})=>t===e))})));await Promise.allSettled(a.map((e=>e.load()))),a.forEach((t=>{const{layerId:r,loaded:o,defaultPopupTemplate:n}=t;o&&null!=n&&v(t,{id:r,popupInfo:n.toJSON()},e)}))}(e,y,o,f),e}(i,{url:r??"",customParameters:o,apiKey:a},e.map((e=>e.layer.layerId))));for(const t of e)v(t.layer,t.layerJSON,i);return i}(t,e)}function w(e,t,r){const n=(0,o.e5)(e,t,((e,t)=>e.id===t.id));e=e.filter((e=>!n.removed.some((t=>t.id===e.id))));const a=n.added.map((({id:e})=>({id:e})));return a.forEach((({id:t})=>{e.push({id:t})})),{itemResources:e,added:a.filter((({id:e})=>!r.includes(e)))}}function v(e,t,r){e.isTable?b(r.tables,t):b(r.layers,t)}function b(e,t){const r=e.findIndex((({id:e})=>e===t.id));-1===r?e.push(t):e[r]=t}async function x(e,t){const{url:r,layerId:o,title:n,fullExtent:a,isTable:s}=e,l=(0,i.Qc)(r);t.url="FeatureServer"===l?.serverType?r:`${r}/${o}`,t.title||=n,t.extent=null,s||null==a||(t.extent=await(0,u.$o)(a)),(0,u.ck)(t,u.Kz.METADATA),(0,u.ck)(t,u.Kz.MULTI_LAYER),(0,u.qj)(t,u.Kz.SINGLE_LAYER),s&&(0,u.qj)(t,u.Kz.TABLE)}async function R(e,t){return(0,a.a1)({layer:e,itemType:p,validateLayer:m,createItemData:(e,t)=>g(t,[e]),errorNamePrefix:y},t)}async function P(e,t,r){return(0,a.po)({layer:e,itemType:p,validateLayer:m,createItemData:(e,t)=>Promise.resolve(h(e)),errorNamePrefix:f,newItem:t,setItemProperties:x},r)}},64383:(e,t,r)=>{r.d(t,{a1:()=>g,po:()=>w});var o=r(20102),n=r(65845),a=r(48522),i=r(15235),s=r(33516),l=r(14661),u=r(14769);async function p(e){const{layer:t,errorNamePrefix:r,validateLayer:n}=e;await t.load(),function(e,t,r){const n=r(e);if(!n.isValid)throw new o.Z(`${t}:invalid-parameters`,n.errorMessage,{layer:e})}(t,r,n)}function c(e,t){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${t}`}function y(e){const{item:t,itemType:r,errorNamePrefix:n,layer:a,validateItem:i}=e;if((0,u.w)(t),t.type!==r)throw new o.Z(`${n}:portal-item-wrong-type`,`Portal item type should be "${r}"`,{item:t,layer:a});if(i){const e=i(t);if(!e.isValid)throw new o.Z(`${n}:invalid-parameters`,e.errorMessage,{layer:a})}}function f(e){const{layer:t,errorNamePrefix:r}=e,{portalItem:n}=t;if(!n)throw new o.Z(`${r}:portal-item-not-set`,c(t,"requires the portalItem property to be set"));if(!n.loaded)throw new o.Z(`${r}:portal-item-not-loaded`,c(t,"cannot be saved to a portal item that does not exist or is inaccessible"));y({...e,item:n})}function m(e){const{newItem:t,itemType:r}=e;let o=i.default.from(t);return o.id&&(o=o.clone(),o.id=null),o.type??=r,o.portal??=a.Z.getDefault(),y({...e,item:o}),o}async function d(e,t,r){"beforeSave"in e&&"function"==typeof e.beforeSave&&await e.beforeSave();const n=e.write({},t);return await Promise.all(t.resources?.pendingOperations??[]),function(e,t){let r=(e.messages??[]).filter((({type:e})=>"error"===e)).map((({name:e,message:t,details:r})=>new o.Z(e,t,r)));if(e.blockedRelativeUrls&&(r=r.concat(e.blockedRelativeUrls.map((e=>new o.Z("url:unsupported",`Relative url '${e}' is not supported`))))),t?.ignoreUnsupported&&(r=r.filter((({name:e})=>"layer:unsupported"!==e&&"symbol:unsupported"!==e&&"symbol-layer:unsupported"!==e&&"property:unsupported"!==e&&"url:unsupported"!==e))),r.length>0)throw new o.Z("layer-write:unsupported","Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}(t,r),n}function h(e){(0,l.qj)(e,l.Kz.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}async function g(e,t){const{layer:r,createItemData:o,createJSONContext:a,saveResources:i}=e;await p(e),f(e);const l=r.portalItem,u=a?a(l):(0,s.Yv)(l),c=await d(r,u,t),y=await o({layer:r,layerJSON:c},l);return h(l),await l.update({data:y}),(0,n.D)(u),await(i?.(l,u)),l}async function w(e,t){const{layer:r,createItemData:o,createJSONContext:a,setItemProperties:i,saveResources:l}=e;await p(e);const u=m(e),c=a?a(u):(0,s.Yv)(u),y=await d(r,c,t),f=await o({layer:r,layerJSON:y},u);return await i(r,u),h(u),await async function(e,t,r){const o=e.portal;await o.signIn(),await(o.user?.addItem({item:e,data:t,folder:r?.folder}))}(u,f,t),r.portalItem=u,(0,n.D)(c),await(l?.(u,c)),u}},16451:(e,t,r)=>{r.d(t,{Z:()=>f});var o=r(43697),n=r(2368),a=r(96674),i=r(5600),s=(r(75215),r(67676),r(80442),r(71715)),l=r(52011),u=r(30556),p=r(72729),c=r(70082);let y=class extends((0,n.J)(a.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,o._)([(0,i.Cb)({json:{write:!0}})],y.prototype,"id",void 0),(0,o._)([(0,i.Cb)({json:{write:!0}})],y.prototype,"name",void 0),(0,o._)([(0,i.Cb)({json:{write:!0}})],y.prototype,"domains",void 0),(0,o._)([(0,s.r)("domains")],y.prototype,"readDomains",null),(0,o._)([(0,u.c)("domains")],y.prototype,"writeDomains",null),(0,o._)([(0,i.Cb)({type:[c.Z],json:{write:!0}})],y.prototype,"templates",void 0),y=(0,o._)([(0,l.j)("esri.layers.support.FeatureType")],y);const f=y},52104:(e,t,r)=>{r.d(t,{V:()=>n});var o=r(96187);async function n(e,t){const r=await(0,o.T)(e,t);r.layers=r.layers.filter(a);const n={serviceJSON:r};if((r.currentVersion??0)<10.5)return n;const i=await(0,o.T)(e+"/layers",t);return n.layersJSON={layers:i.layers.filter(a),tables:i.tables},n}function a(e){return!e.type||"Feature Layer"===e.type||"Oriented Imagery Layer"===e.type}},33516:(e,t,r)=>{r.d(t,{M4:()=>l,Yv:()=>i,ht:()=>a,wk:()=>s});var o=r(17452),n=r(48522);function a(e){return{origin:"portal-item",url:(0,o.mN)(e.itemUrl),portal:e.portal||n.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function i(e){const t=(0,o.mN)(e.itemUrl);return{origin:"portal-item",messages:[],writtenProperties:[],url:t,portal:e.portal||n.Z.getDefault(),portalItem:e,verifyItemRelativeUrls:t?{rootPath:t.path,writtenUrls:[]}:null,blockedRelativeUrls:[]}}function s(e){return{origin:"web-map",url:(0,o.mN)(e.itemUrl),portal:e.portal||n.Z.getDefault(),portalItem:e,readResourcePaths:[]}}function l(e,t){const r=(0,o.mN)(e.itemUrl);return{origin:"web-map",messages:[],writtenProperties:[],url:r,portal:e.portal||n.Z.getDefault(),portalItem:e,initiator:t,verifyItemRelativeUrls:r?{rootPath:r.path,writtenUrls:[]}:null,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}}},28694:(e,t,r)=>{r.d(t,{p:()=>n});var o=r(69285);function n(e,t,r){if(!r?.features||!r.hasZ)return;const n=(0,o.k)(r.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of r.features)n(e.geometry)}},74889:(e,t,r)=>{r.d(t,{Z:()=>v});var o,n=r(43697),a=r(66577),i=r(38171),s=r(35454),l=r(96674),u=r(22974),p=r(5600),c=(r(75215),r(71715)),y=r(52011),f=r(30556),m=r(82971),d=r(33955),h=r(1231);const g=new s.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=o=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=m.Z.fromJSON(t.spatialReference),o=[];for(let t=0;t<e.length;t++){const n=e[t],a=i.Z.fromJSON(n),s=n.geometry?.spatialReference;null==a.geometry||s||(a.geometry.spatialReference=r);const l=n.aggregateGeometries,u=a.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],o=l[e],n=o?.spatialReference;null==t||n||(t.spatialReference=r)}o.push(a)}return o}writeGeometryType(e,t,r,o){if(e)return void g.write(e,t,r,o);const{features:n}=this;if(n)for(const e of n)if(null!=e?.geometry)return void g.write(e.geometry.type,t,r,o)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,o=(0,d.im)(e);return o&&!r&&t.spatialReference&&(o.spatialReference=m.Z.fromJSON(t.spatialReference)),o}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new o(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const o=t.features[r];if(o.geometry){const t=e?.[r];o.geometry=t?.toJSON()||o.geometry}}return t}quantize(e){const{scale:[t,r],translate:[o,n]}=e,a=this.features,i=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-o)/t)),(e=>Math.round((n-e)/r)));for(let e=0,t=a.length;e<t;e++)i?.(a[e].geometry)||(a.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[o,n],scale:[a,i]}=r;let s=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;s=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*a+o),(e=>n-e*i),s,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,r){let o,n;const a=[];for(let i=0,s=e.length;i<s;i++){const s=e[i];if(i>0){const e=t(s[0]),i=r(s[1]);e===o&&i===n||(a.push([e-o,i-n]),o=e,n=i)}else o=t(s[0]),n=r(s[1]),a.push([o,n])}return a.length>0?a:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const o=(0,d.oU)(e)?e.rings:e.paths,n=[];for(let e=0,a=o.length;e<a;e++){const a=o[e],i=this._quantizePoints(a,t,r);i&&n.push(i)}return n.length>0?((0,d.oU)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const o=this._quantizePoints(e.points,t,r);return o&&o.length>0?(e.points=o,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,o,n){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),o&&(e.z=o(e.z))}:"polyline"===e||"polygon"===e?e=>{const a=(0,d.oU)(e)?e.rings:e.paths;let i,s;for(let e=0,o=a.length;e<o;e++){const o=a[e];for(let e=0,n=o.length;e<n;e++){const n=o[e];e>0?(i+=n[0],s+=n[1]):(i=n[0],s=n[1]),n[0]=t(i),n[1]=r(s)}}if(o&&n)for(let e=0,t=a.length;e<t;e++){const t=a[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2]),r[3]=n(r[3])}}else if(o)for(let e=0,t=a.length;e<t;e++){const t=a[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2])}}else if(n)for(let e=0,t=a.length;e<t;e++){const t=a[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),o&&null!=e.zmax&&null!=e.zmin&&(e.zmax=o(e.zmax),e.zmin=o(e.zmin)),n&&null!=e.mmax&&null!=e.mmin&&(e.mmax=n(e.mmax),e.mmin=n(e.mmin))}:"multipoint"===e?e=>{const a=e.points;let i,s;for(let e=0,o=a.length;e<o;e++){const o=a[e];e>0?(i+=o[0],s+=o[1]):(i=o[0],s=o[1]),o[0]=t(i),o[1]=r(s)}if(o&&n)for(let e=0,t=a.length;e<t;e++){const t=a[e];t[2]=o(t[2]),t[3]=n(t[3])}else if(o)for(let e=0,t=a.length;e<t;e++){const t=a[e];t[2]=o(t[2])}else if(n)for(let e=0,t=a.length;e<t;e++){const t=a[e];t[2]=n(t[2])}}:null}};(0,n._)([(0,p.Cb)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,n._)([(0,p.Cb)({type:[i.Z],json:{write:!0}})],w.prototype,"features",void 0),(0,n._)([(0,c.r)("features")],w.prototype,"readFeatures",null),(0,n._)([(0,p.Cb)({type:[h.Z],json:{write:!0}})],w.prototype,"fields",void 0),(0,n._)([(0,p.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],w.prototype,"geometryType",void 0),(0,n._)([(0,f.c)("geometryType")],w.prototype,"writeGeometryType",null),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,n._)([(0,p.Cb)({types:a.qM,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,n._)([(0,c.r)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,n._)([(0,p.Cb)({type:m.Z,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,n._)([(0,f.c)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,n._)([(0,p.Cb)({json:{write:!0}})],w.prototype,"transform",void 0),w=o=(0,n._)([(0,y.j)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const v=w},96187:(e,t,r)=>{r.d(t,{T:()=>n});var o=r(3172);async function n(e,t){const{data:r}=await(0,o.Z)(e,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}});return r}},14769:(e,t,r)=>{r.d(t,{w:()=>i});var o=r(68773),n=r(20102),a=r(71058);function i(e){if(o.default.apiKey&&(0,a.r)(e.portal.url))throw new n.Z("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${e.portal.url} when using an api key`)}}}]);