@arcgis/core 4.30.0 → 4.30.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.
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{c39237c00c1d588dc107.js → 25c41ceb1951d80f4798.js} +1 -1
- package/assets/esri/core/workers/chunks/{f13fb6b712e364bbf48c.js → 61e1f1564a8440f186e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{70ebc0e38eb1cfb79320.js → 85701ca4ebc2de529053.js} +1 -1
- package/assets/esri/core/workers/chunks/88e8547079b299572bfe.js +1 -0
- package/assets/esri/core/workers/chunks/{403f73017bf763f7471c.js → 91f8f99c6f64e85458f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{37dfb3ff86c4ef1b26c1.js → a9efe7abda35995d0dd8.js} +1 -1
- package/assets/esri/core/workers/chunks/ad6468d67bf50aff85ea.js +1 -0
- package/assets/esri/core/workers/chunks/{4cf5414d67aa888f2322.js → d502a5fe47e77d63ae5e.js} +1 -1
- package/assets/esri/core/workers/chunks/d6c954272cc96d6b7987.js +1 -0
- package/assets/esri/core/workers/chunks/{aa198e898b46c6e89d0b.js → e2c927ef4d88a0a8104b.js} +1 -1
- package/assets/esri/core/workers/chunks/{880e8329e264b6156fbc.js → e3a049ebcb0b89f16228.js} +1 -1
- package/assets/esri/core/workers/chunks/{f927c28f2fa78ec68235.js → ed9c88afccc5041d899a.js} +1 -1
- package/assets/esri/core/workers/chunks/{31f7a3c8e1a5b4ca4a73.js → fb97d6cc841c67c09d5c.js} +1 -1
- package/assets/esri/themes/base/widgets/_Grid.scss +3 -1
- 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/chunks/persistableUrlUtils.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +100 -50
- package/kernel.js +1 -1
- package/layers/CatalogLayer.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/support/MediaElementBase.js +1 -1
- package/package.json +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/portal/support/urlUtils.js +1 -1
- package/rest/imageService/fetchRasterInfo.js +1 -1
- package/support/persistableUrlUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/assets/esri/core/workers/chunks/20d447aa01a66a464363.js +0 -1
- package/assets/esri/core/workers/chunks/2b39f50b92fe27c30497.js +0 -1
- package/assets/esri/core/workers/chunks/8865ca9cb8d867d48d2d.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7899,1053,3069],{60945:(e,t,n)=>{n.d(t,{A:()=>f});var r,i=n(90237),o=n(25482),s=n(88930),a=n(10107),l=(n(44208),n(53966),n(87811),n(36005)),c=n(40608),u=n(43937),h=n(56400);let p=r=class extends o.oY{static get allTime(){return d}static get empty(){return m}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,n=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,i=e.end?.getTime()??e.end;return t===r&&n===i}expandTo(e,t=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=(0,s.lL)(n,e,t));let i=this.end;if(i){const n=(0,s.lL)(i,e,t);i=i.getTime()===n.getTime()?n:(0,s.S1)(n,1,e,t)}return new r({start:n,end:i})}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,n=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,o=e.end?.getTime()??1/0;let s,a;return i>=t&&i<=n?s=i:t>=i&&t<=o&&(s=t),n>=i&&n<=o?a=n:o>=t&&o<=n&&(a=o),null==s||null==a||isNaN(s)||isNaN(a)?r.empty:new r({start:s===-1/0?null:new Date(s),end:a===1/0?null:new Date(a)})}offset(e,t,n=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();const i=new r,{start:o,end:a}=this;return null!=o&&(i.start=(0,s.S1)(o,e,t,n)),null!=a&&(i.end=(0,s.S1)(a,e,t,n)),i}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 d.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:n})}};(0,i._)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,i._)([(0,l.w)("end")],p.prototype,"readEnd",null),(0,i._)([(0,u.K)("end")],p.prototype,"writeEnd",null),(0,i._)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,i._)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,i._)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,i._)([(0,l.w)("start")],p.prototype,"readStart",null),(0,i._)([(0,u.K)("start")],p.prototype,"writeStart",null),p=r=(0,i._)([(0,c.$)("esri.TimeExtent")],p);const d=new p,m=new p({start:void 0,end:void 0}),f=p},11053:(e,t,n)=>{n.d(t,{c:()=>r,g:()=>i});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11006:(e,t,n)=>{n.d(t,{q:()=>l});var r,i,o,s=n(11053),a={exports:{}};r=a,i=function(){function e(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*u/a+h)),Math.min(o,Math.floor(r+(a-l)*u/a+h)),s)}var p=n[r],d=i,m=o;for(t(n,i,r),s(n[o],p)>0&&t(n,i,o);d<m;){for(t(n,d,m),d++,m--;s(n[d],p)<0;)d++;for(;s(n[m],p)>0;)m--}0===s(n[i],p)?t(n,i,m):t(n,++m,o),m<=r&&(i=m+1),r<=m&&(o=m-1)}}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return e<t?-1:e>t?1:0}return function(t,r,i,o,s){e(t,r,i||0,o||t.length-1,s||n)}},void 0!==(o=i())&&(r.exports=o);const l=(0,s.g)(a.exports)},69540:(e,t,n)=>{n.d(t,{O:()=>u,P:()=>h});var r=n(90237),i=n(69622),o=(n(44208),n(4718)),s=(n(53966),n(97768)),a=n(35666),l=n(88620),c=n(40608);const u=e=>{let t=class extends e{clone(){const e=(0,l.oY)(this);(0,s.Lw)(e,"unable to clone instance of non-accessor class");const t=e.metadata,n=e.store,r={},i=new Map;for(const e in t){const s=t[e],l=n?.originOf(e),c=s.clonable;if(s.readOnly||!1===c||l!==a.Gr.USER&&l!==a.Gr.DEFAULTS&&l!==a.Gr.WEB_MAP&&l!==a.Gr.WEB_SCENE)continue;const u=this[e];let h=null;h="function"==typeof c?c(u):"reference"===c?u:(0,o.TU)(u),null!=u&&null==h||(l===a.Gr.DEFAULTS?i.set(e,h):r[e]=h)}const c=new(0,Object.getPrototypeOf(this).constructor)(r);if(i.size){const e=(0,l.oY)(c)?.store;if(e)for(const[t,n]of i)e.set(t,n,a.Gr.DEFAULTS)}return c}};return t=(0,r._)([(0,c.$)("esri.core.Clonable")],t),t};let h=class extends(u(i.A)){};h=(0,r._)([(0,c.$)("esri.core.Clonable")],h)},4902:(e,t,n)=>{n.d(t,{PH:()=>a,sA:()=>s});var r=n(90237),i=n(40608);let o=0;const s=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+o++})}};return t=(0,r._)([(0,i.$)("esri.core.Identifiable")],t),t},a=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:o++})}};return t=(0,r._)([(0,i.$)("esri.core.Identifiable.NumericIdentifiable")],t),t};let l=class extends(s(class{})){};l=(0,r._)([(0,i.$)("esri.core.Identifiable")],l)},92071:(e,t,n)=>{n.d(t,{P:()=>x,L:()=>v});var r=n(90237),i=n(69622),o=n(76953),s=n(4718),a=n(35666);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new l,n=this._originStores[a.Gr.DEFAULTS];n&&n.forEach(((e,n)=>{t.set(n,(0,s.o8)(e),a.Gr.DEFAULTS)}));for(let n=a.Gr.SERVICE;n<a.AU;n++){const r=this._originStores[n];r&&r.forEach(((r,i)=>{e&&e.has(i)||t.set(i,(0,s.o8)(r),n)}))}return t}get(e,t){const n=void 0===t?this._values:this._originStores[t];return n?n.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,n=a.Gr.USER){let r=this._originStores[n];if(r||(r=new Map,this._originStores[n]=r),r.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=n){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,n),r!==t}return!1}delete(e,t=a.Gr.USER){const n=this._originStores[t];if(!n)return;const r=n.get(e);if(n.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let n=t-1;n>=0;n--){const t=this._originStores[n];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,n);break}}}return r}has(e,t){const n=void 0===t?this._values:this._originStores[t];return!!n&&n.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const n=this._originStores[t],r=n?.get(e),i=this._values.get(e);return this._values.set(e,r),this._propertyOriginMap.set(e,t),i!==r}originOf(e){return this._propertyOriginMap.get(e)||a.Gr.DEFAULTS}forEach(e){this._values.forEach(e)}}var c=n(45917),u=n(88620),h=n(40608);const p=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,u.oY)(this),n=t.store,r=new l;t.store=r,(0,o.k)(t,n,r)}read(e,t){(0,c.L)(this,e,t)}getAtOrigin(e,t){const n=d(this),r=(0,a.aB)(t);if("string"==typeof e)return n.get(e,r);const i={};return e.forEach((e=>{i[e]=n.get(e,r)})),i}originOf(e){return(0,a.OL)(this.originIdOf(e))}originIdOf(e){return d(this).originOf(e)}revert(e,t){const n=d(this),r=(0,a.aB)(t),i=(0,u.oY)(this);let o;o="string"==typeof e?"*"===e?n.keys(r):[e]:e,o.forEach((e=>{i.invalidate(e),n.revert(e,r),i.commit(e)}))}};return t=(0,r._)([(0,h.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function d(e){return(0,u.oY)(e).store}let m=class extends(p(i.A)){};m=(0,r._)([(0,h.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],m);var f=n(16649),y=n(49422);const g=e=>{let t=class extends e{constructor(...e){super(...e)}clear(e,t="user"){return _(this).delete(e,(0,a.aB)(t))}write(e,t){return(0,y.M)(this,e=e||{},t),e}setAtOrigin(e,t,n){(0,u.oY)(this).setAtOrigin(e,t,(0,a.aB)(n))}removeOrigin(e){const t=_(this),n=(0,a.aB)(e),r=t.keys(n);for(const e of r)t.originOf(e)===n&&t.set(e,t.get(e,n),a.Gr.USER)}updateOrigin(e,t){const n=_(this),r=(0,a.aB)(t),i=(0,f.Jt)(this,e);for(let t=r+1;t<a.AU;++t)n.delete(e,t);n.set(e,i,r)}toJSON(e){return this.write({},e)}};return t=(0,r._)([(0,h.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function _(e){return(0,u.oY)(e).store}const x=e=>{let t=class extends(g(p(e))){constructor(...e){super(...e)}};return t=(0,r._)([(0,h.$)("esri.core.MultiOriginJSONSupport")],t),t};let v=class extends(x(i.A)){};v=(0,r._)([(0,h.$)("esri.core.MultiOriginJSONSupport")],v)},43668:(e,t,n)=>{n.d(t,{M5:()=>h,eV:()=>u});var r=n(78888),i=n(49186),o=n(74887),s=n(84952),a=n(26306);let l=null,c=!0;function u(e,t,n,r){if(!t||!n)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(e,t,n)}catch(e){c=!1}const i=function(e,t,n){return n||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),n=l),n.getContext("2d").createImageData(e,t)}(t,n,r);return i.data.set(e,0),i}async function h(e,t){const{arrayBuffer:l,mediaType:c}=await async function(e,t){const n=(0,s.r$)(e);if(n?.isBase64)return{arrayBuffer:(0,a.M)(n.data),mediaType:n.mediaType};const i=await(0,r.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:i.data,mediaType:i.getHeader?.("Content-Type")??""}}(e,t),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:e,parseGif:r}=await n.e(820).then(n.bind(n,10820));if(e(l))return r(l,t)}if(u){const{isAnimatedPNG:e,parseApng:r}=await n.e(2390).then(n.bind(n,22390));if(e(l))return r(l,t)}return async function(e,t){const n=window.URL.createObjectURL(e);try{const{data:e}=await(0,r.A)(n,{...t,responseType:"image"});return e}catch(e){if(!(0,o.zf)(e))throw new i.A("invalid-image",`Could not fetch requested image at ${n}`);throw e}finally{window.URL.revokeObjectURL(n)}}(new Blob([l],{type:c}),t)}},29242:(e,t,n)=>{function r(){return[1,0,0,0,1,0,0,0,1]}function i(e,t,n,r,i,o,s,a,l){return[e,t,n,r,i,o,s,a,l]}n.d(t,{fA:()=>i,vt:()=>r,zK:()=>o});const o=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},create:r,createView:function(e,t){return new Float64Array(e,t,9)},fromValues:i},Symbol.toStringTag,{value:"Module"}))},48163:(e,t,n)=>{function r(){return[0,0]}function i(e,t){return[e,t]}function o(){return i(1,1)}function s(){return i(1,0)}function a(){return i(0,1)}n.d(t,{Un:()=>l,fA:()=>i,vt:()=>r});const l=o(),c=s(),u=a();Object.freeze(Object.defineProperty({__proto__:null,ONES:l,UNIT_X:c,UNIT_Y:u,ZEROS:[0,0],clone:function(e){return[e[0],e[1]]},create:r,createView:function(e,t){return new Float64Array(e,t,2)},fromArray:function(e,t=[0,0]){const n=Math.min(2,e.length);for(let r=0;r<n;++r)t[r]=e[r];return t},fromValues:i,ones:o,unitX:s,unitY:a,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},77690:(e,t,n)=>{n.d(t,{B8:()=>a,Ge:()=>p,I0:()=>h,KC:()=>l,hZ:()=>o,hs:()=>u,lw:()=>c,mg:()=>s,z0:()=>i});var r=n(34304);function i(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function o(e,t,n,r,i,o,s,a,l,c){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e}function s(e,t){if(e===t){const n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function a(e,t){const n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*s-a*c,p=-u*o+a*l,d=c*o-s*l;let m=n*h+r*p+i*d;return m?(m=1/m,e[0]=h*m,e[1]=(-u*r+i*c)*m,e[2]=(a*r-i*s)*m,e[3]=p*m,e[4]=(u*n-i*l)*m,e[5]=(-a*n+i*o)*m,e[6]=d*m,e[7]=(-c*n+r*l)*m,e[8]=(s*n-r*o)*m,e):null}function l(e,t){const n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e[0]=s*u-a*c,e[1]=i*c-r*u,e[2]=r*a-i*s,e[3]=a*l-o*u,e[4]=n*u-i*l,e[5]=i*o-n*a,e[6]=o*c-s*l,e[7]=r*l-n*c,e[8]=n*s-r*o,e}function c(e,t,n){const r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=n[0],d=n[1],m=n[2],f=n[3],y=n[4],g=n[5],_=n[6],x=n[7],v=n[8];return e[0]=p*r+d*s+m*c,e[1]=p*i+d*a+m*u,e[2]=p*o+d*l+m*h,e[3]=f*r+y*s+g*c,e[4]=f*i+y*a+g*u,e[5]=f*o+y*l+g*h,e[6]=_*r+x*s+v*c,e[7]=_*i+x*a+v*u,e[8]=_*o+x*l+v*h,e}function u(e,t,n){const r=n[0],i=n[1],o=n[2];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=o*t[6],e[7]=o*t[7],e[8]=o*t[8],e}function h(e,t){const n=t[0],r=t[1],i=t[2],o=t[3],s=n+n,a=r+r,l=i+i,c=n*s,u=r*s,h=r*a,p=i*s,d=i*a,m=i*l,f=o*s,y=o*a,g=o*l;return e[0]=1-h-m,e[3]=u-g,e[6]=p+y,e[1]=u+g,e[4]=1-c-m,e[7]=d-f,e[2]=p-y,e[5]=d+f,e[8]=1-c-h,e}function p(e,t){const n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],d=t[11],m=t[12],f=t[13],y=t[14],g=t[15],_=n*a-r*s,x=n*l-i*s,v=n*c-o*s,M=r*l-i*a,w=r*c-o*a,b=i*c-o*l,S=u*f-h*m,A=u*y-p*m,I=u*g-d*m,P=h*y-p*f,L=h*g-d*f,T=p*g-d*y;let O=_*T-x*L+v*P+M*I-w*A+b*S;return O?(O=1/O,e[0]=(a*T-l*L+c*P)*O,e[1]=(l*I-s*T-c*A)*O,e[2]=(s*L-a*I+c*S)*O,e[3]=(i*L-r*T-o*P)*O,e[4]=(n*T-i*I+o*A)*O,e[5]=(r*I-n*L-o*S)*O,e[6]=(f*b-y*w+g*M)*O,e[7]=(y*v-m*b-g*x)*O,e[8]=(m*w-f*v+g*_)*O,e):null}function d(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}const m=c,f=d;Object.freeze(Object.defineProperty({__proto__:null,add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e},adjoint:l,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},determinant:function(e){const t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8];return t*(c*o-s*l)+n*(-c*i+s*a)+r*(l*i-o*a)},equals:function(e,t){const n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=t[0],d=t[1],m=t[2],f=t[3],y=t[4],g=t[5],_=t[6],x=t[7],v=t[8],M=(0,r.FD)();return Math.abs(n-p)<=M*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(i-d)<=M*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-m)<=M*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-f)<=M*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-y)<=M*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(l-g)<=M*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-_)<=M*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-x)<=M*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(h-v)<=M*Math.max(1,Math.abs(h),Math.abs(v))},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromMat4:i,fromQuat:h,fromRotation:function(e,t){const n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},invert:a,isOrthoNormal:function(e){const t=(0,r.FD)(),n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8];return Math.abs(1-(n*n+s*s+c*c))<=t&&Math.abs(1-(i*i+a*a+u*u))<=t&&Math.abs(1-(o*o+l*l+h*h))<=t},mul:m,multiply:c,multiplyScalar:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},multiplyScalarAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e},normalFromMat4:p,normalFromMat4Legacy:function(e,t){const n=t[0],r=t[1],i=t[2],o=t[4],s=t[5],a=t[6],l=t[8],c=t[9],u=t[10],h=u*s-a*c,p=-u*o+a*l,d=c*o-s*l,m=n*h+r*p+i*d;if(!m)return null;const f=1/m;return e[0]=h*f,e[1]=(-u*r+i*c)*f,e[2]=(a*r-i*s)*f,e[3]=p*f,e[4]=(u*n-i*l)*f,e[5]=(-a*n+i*o)*f,e[6]=d*f,e[7]=(-c*n+r*l)*f,e[8]=(s*n-r*o)*f,e},projection:function(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},rotate:function(e,t,n){const r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=Math.sin(n),d=Math.cos(n);return e[0]=d*r+p*s,e[1]=d*i+p*a,e[2]=d*o+p*l,e[3]=d*s-p*r,e[4]=d*a-p*i,e[5]=d*l-p*o,e[6]=c,e[7]=u,e[8]=h,e},scale:u,scaleByVec2:function(e,t,n){const r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e},set:o,str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},sub:f,subtract:d,translate:function(e,t,n){const r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=n[0],d=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=p*r+d*s+c,e[7]=p*i+d*a+u,e[8]=p*o+d*l+h,e},transpose:s},Symbol.toStringTag,{value:"Module"}))},37585:(e,t,n)=>{n.d(t,{Cc:()=>f,Io:()=>u,S8:()=>m,WQ:()=>o,e$:()=>g,hZ:()=>i,hs:()=>c,jb:()=>x,l0:()=>y});var r=n(34304);function i(e,t,n){return e[0]=t,e[1]=n,e}function o(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function s(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function a(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function l(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function c(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function u(e,t){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function h(e,t){const n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function p(e){const t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}function d(e){const t=e[0],n=e[1];return t*t+n*n}function m(e,t){const n=t[0],r=t[1];let i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e}function f(e,t,n,r){const i=t[0],o=t[1];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e}function y(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e}function g(e,t,n,r){const i=t[0]-n[0],o=t[1]-n[1],s=Math.sin(r),a=Math.cos(r);return e[0]=i*a-o*s+n[0],e[1]=i*s+o*a+n[1],e}const _=p,x=s,v=a,M=l,w=u,b=h,S=d;Object.freeze(Object.defineProperty({__proto__:null,add:o,angle:function(e,t){const n=e[0],r=e[1],i=t[0],o=t[1];let s=n*n+r*r;s>0&&(s=1/Math.sqrt(s));let a=i*i+o*o;a>0&&(a=1/Math.sqrt(a));const l=(n*i+r*o)*s*a;return l>1?0:l<-1?Math.PI:Math.acos(l)},ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},cross:function(e,t,n){const r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e},dist:w,distance:u,div:M,divide:l,dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},equals:function(e,t){const n=e[0],i=e[1],o=t[0],s=t[1],a=(0,r.FD)();return Math.abs(n-o)<=a*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=a*Math.max(1,Math.abs(i),Math.abs(s))},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]},floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},len:_,length:p,lerp:f,max:function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e},min:function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},mul:v,multiply:a,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},normalize:m,projectAndScale:function(e,t,n,r,i){let o=t[0]-n[0],s=t[1]-n[1];const a=(r[0]*o+r[1]*s)*(i-1);return o=r[0]*a,s=r[1]*a,e[0]=t[0]+o,e[1]=t[1]+s,e},random:function(e,t){t=t||1;const n=2*(0,r.Ov)()*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e},rotate:g,round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},scale:c,scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},set:i,sqrDist:b,sqrLen:S,squaredDistance:h,squaredLength:d,str:function(e){return"vec2("+e[0]+", "+e[1]+")"},sub:x,subtract:s,transformMat2:function(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e},transformMat2d:y,transformMat3:function(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e},transformMat4:function(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e}},Symbol.toStringTag,{value:"Module"}))},75503:(e,t,n)=>{n.d(t,{w:()=>s});var r=n(4576),i=(n(44208),n(3694)),o=n(11006);class s{constructor(e=9,t){this._compareMinX=h,this._compareMinY=p,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),v.prune(),M.prune(),w.prune(),b.prune()}all(e){a(this._data,e)}search(e,t){let n=this._data;const r=this._toBBox;if(_(e,n))for(v.clear();n;){for(let i=0,o=n.children.length;i<o;i++){const o=n.children[i],s=n.leaf?r(o):o;_(e,s)&&(n.leaf?t(o):g(e,s)?a(o,t):v.push(o))}n=v.pop()}}collides(e){let t=this._data;const n=this._toBBox;if(!_(e,t))return!1;for(v.clear();t;){for(let r=0,i=t.children.length;r<i;r++){const i=t.children[r],o=t.leaf?n(i):i;if(_(e,o)){if(t.leaf||g(e,o))return!0;v.push(i)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,n=e.length;t<n;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new I([]),this}remove(e){if(!e)return this;let t,n=this._data,i=null,o=0,s=!1;const a=this._toBBox(e);for(w.clear(),b.clear();n||w.length>0;){if(n||(n=w.pop(),i=w.data[w.length-1],o=b.pop()??0,s=!0),n.leaf&&(t=(0,r.qh)(n.children,e,n.children.length,n.indexHint),-1!==t))return n.children.splice(t,1),w.push(n),this._condense(w),this;s||n.leaf||!g(n,a)?i?(o++,n=i.children[o],s=!1):n=null:(w.push(n),b.push(o),o=0,i=n,n=n.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,n,r){const i=n-t+1;let o=this._maxEntries;if(i<=o){const r=new I(e.slice(t,n+1));return l(r,this._toBBox),r}r||(r=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/o**(r-1)));const s=new P([]);s.height=r;const a=Math.ceil(i/o),c=a*Math.ceil(Math.sqrt(o));x(e,t,n,c,this._compareMinX);for(let i=t;i<=n;i+=c){const t=Math.min(i+c-1,n);x(e,i,t,a,this._compareMinY);for(let n=i;n<=t;n+=a){const i=Math.min(n+a-1,t);s.children.push(this._build(e,n,i,r-1))}}return l(s,this._toBBox),s}_insert(e,t,n){const r=this._toBBox,i=n?e:r(e);w.clear();const o=function(e,t,n,r){for(;r.push(t),!0!==t.leaf&&r.length-1!==n;){let n,r=1/0,i=1/0;for(let o=0,s=t.children.length;o<s;o++){const s=t.children[o],a=d(s),l=f(e,s)-a;l<i?(i=l,r=a<r?a:r,n=s):l===i&&a<r&&(r=a,n=s)}t=n||t.children[0]}return t}(i,this._data,t,w);for(o.children.push(e),u(o,i);t>=0&&w.data[t].children.length>this._maxEntries;)this._split(w,t),t--;!function(e,t,n){for(let r=n;r>=0;r--)u(t.data[r],e)}(i,w,t)}_split(e,t){const n=e.data[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r);if(!o)return;const s=n.children.splice(o,n.children.length-o),a=n.leaf?new I(s):new P(s);a.height=n.height,l(n,this._toBBox),l(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this._data=new P([e,t]),this._data.height=e.height+1,l(this._data,this._toBBox)}_chooseSplitIndex(e,t,n){let r,i,o;r=i=1/0;for(let s=t;s<=n-t;s++){const t=c(e,0,s,this._toBBox),a=c(e,s,n,this._toBBox),l=y(t,a),u=d(t)+d(a);l<r?(r=l,o=s,i=u<i?u:i):l===r&&u<i&&(i=u,o=s)}return o}_chooseSplitAxis(e,t,n){const r=e.leaf?this._compareMinX:h,i=e.leaf?this._compareMinY:p;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);const i=this._toBBox,o=c(e,0,t,i),s=c(e,n-t,n,i);let a=m(o)+m(s);for(let r=t;r<n-t;r++){const t=e.children[r];u(o,e.leaf?i(t):t),a+=m(o)}for(let r=n-t-1;r>=t;r--){const t=e.children[r];u(s,e.leaf?i(t):t),a+=m(s)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const n=e.data[t];if(0===n.children.length)if(t>0){const i=e.data[t-1],o=i.children;o.splice((0,r.qh)(o,n,o.length,i.indexHint),1)}else this.clear();else l(n,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){let n=e;for(M.clear();n;){if(!0===n.leaf)for(const e of n.children)t(e);else M.pushArray(n.children);n=M.pop()??null}}function l(e,t){c(e,0,e.children.length,t,e)}function c(e,t,n,r,i){i||(i=new I([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o,s=t;s<n;s++)o=e.children[s],u(i,e.leaf?r(o):o);return i}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function p(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function y(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function x(e,t,n,r,i){const s=[t,n];for(;s.length;){const t=s.pop(),n=s.pop();if(t-n<=r)continue;const a=n+Math.ceil((t-n)/r/2)*r;(0,o.q)(e,a,n,t,i),s.push(n,a,a,t)}}const v=new i.A,M=new i.A,w=new i.A,b=new i.A({deallocator:void 0});class S{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class A extends S{constructor(){super(...arguments),this.height=1,this.indexHint=new r.vW}}class I extends A{constructor(e){super(),this.children=e,this.leaf=!0}}class P extends A{constructor(e){super(),this.children=e,this.leaf=!1}}},36708:(e,t,n)=>{n.d(t,{C_:()=>p,OH:()=>f,Vh:()=>y,on:()=>h,pc:()=>g,wB:()=>l,z7:()=>c}),n(60999),n(5503);var r=n(37955),i=n(36563),o=n(97768),s=n(74887),a=n(14012);function l(e,t,n={}){return u(e,t,n,d)}function c(e,t,n={}){return u(e,t,n,m)}function u(e,t,n={},r){let i=null;const s=n.once?(e,n)=>{r(e)&&((0,o.xt)(i),t(e,n))}:(e,n)=>{r(e)&&t(e,n)};if(i=(0,a.Cn)(e,s,n.sync,n.equals),n.initial){const t=e();s(t,t)}return i}function h(e,t,n,s={}){let a=null,c=null,u=null;function h(){a&&c&&(c.remove(),s.onListenerRemove?.(a),a=null,c=null)}function p(e){s.once&&s.once&&(0,o.xt)(u),n(e)}const d=l(e,((e,n)=>{h(),(0,r.wb)(e)&&(a=e,c=(0,r.on)(e,t,p),s.onListenerAdd?.(e))}),{sync:s.sync,initial:!0});return u=(0,i.hA)((()=>{d.remove(),h()})),u}function p(e,t){return function(e,t,n){if((0,s.G4)(n))return Promise.reject((0,s.NK)());const r=e();if(t?.(r))return Promise.resolve(r);let a=null;function l(){a=(0,o.xt)(a)}return new Promise(((r,o)=>{a=(0,i.vE)([(0,s.u7)(n,(()=>{l(),o((0,s.NK)())})),u(e,(e=>{l(),r(e)}),{sync:!1,once:!0},t??d)])}))}(e,m,t)}function d(e){return!0}function m(e){return!!e}n(80559);const f={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},13069:(e,t,n)=>{n.d(t,{lk:()=>i,vD:()=>s,yS:()=>o});const r="randomUUID"in crypto;function i(){if(r)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function o(){return`{${i().toUpperCase()}}`}function s(){return`{${i()}}`}},80754:(e,t,n)=>{n.d(t,{j7:()=>s,kS:()=>l,kd:()=>a,r8:()=>c});var r=n(82799),i=n(16930),o=n(65864);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new r.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new r.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const n=c(e);for(const e of n)for(const n of e)n[0]+=t;return e}function c(e){return(0,o.Bi)(e)?e.rings:e.paths}},4146:(e,t,n)=>{n.d(t,{A:()=>v});var r=n(90237),i=(n(59456),n(78888)),o=n(60945),s=n(49186),a=n(65529),l=n(4902),c=n(92474),u=n(53966),h=n(74887),p=n(84952),d=n(10107),m=(n(44208),n(87811),n(40608)),f=n(92602),y=n(5443),g=n(16930);let _=0,x=class extends(a.A.EventedMixin((0,l.sA)(c.A))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.A(-180,-90,180,90,g.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+_++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await n.e(7982).then(n.bind(n,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:r}=await n.e(5613).then(n.bind(n,45613));try{return await r(t)}catch(e){const n=t?.portalItem,r=n?.id||"unset",i=n?.portal?.url||f.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+r+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,h.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,p.An)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,i.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,r._)([(0,d.MZ)({type:String})],x.prototype,"attributionDataUrl",void 0),(0,r._)([(0,d.MZ)({type:y.A})],x.prototype,"fullExtent",void 0),(0,r._)([(0,d.MZ)({readOnly:!0})],x.prototype,"hasAttributionData",null),(0,r._)([(0,d.MZ)({type:String,clonable:!1})],x.prototype,"id",void 0),(0,r._)([(0,d.MZ)({type:Boolean,nonNullable:!0})],x.prototype,"legendEnabled",void 0),(0,r._)([(0,d.MZ)({type:["show","hide","hide-children"]})],x.prototype,"listMode",void 0),(0,r._)([(0,d.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],x.prototype,"opacity",void 0),(0,r._)([(0,d.MZ)({clonable:!1})],x.prototype,"parent",void 0),(0,r._)([(0,d.MZ)({readOnly:!0})],x.prototype,"parsedUrl",null),(0,r._)([(0,d.MZ)({type:Boolean,readOnly:!0})],x.prototype,"persistenceEnabled",void 0),(0,r._)([(0,d.MZ)({type:Boolean})],x.prototype,"popupEnabled",void 0),(0,r._)([(0,d.MZ)({type:Boolean})],x.prototype,"attributionVisible",void 0),(0,r._)([(0,d.MZ)({type:g.A})],x.prototype,"spatialReference",void 0),(0,r._)([(0,d.MZ)({type:String})],x.prototype,"title",void 0),(0,r._)([(0,d.MZ)({readOnly:!0,json:{read:!1}})],x.prototype,"type",void 0),(0,r._)([(0,d.MZ)()],x.prototype,"url",void 0),(0,r._)([(0,d.MZ)({type:o.A})],x.prototype,"visibilityTimeExtent",void 0),(0,r._)([(0,d.MZ)({type:Boolean,nonNullable:!0})],x.prototype,"visible",void 0),x=(0,r._)([(0,m.$)("esri.layers.Layer")],x);const v=x},87899:(e,t,n)=>{n.r(t),n.d(t,{default:()=>mt});var r=n(90237),i=n(5503),o=n(49186),s=n(53966),a=n(92071),l=n(74887),c=n(10107),u=n(79901),h=(n(87811),n(44208),n(36005)),p=n(40608),d=n(43937),m=n(35666),f=n(4146),y=n(63074),g=n(16131),_=n(8303),x=n(25036),v=n(69540),M=n(25482),w=n(77690),b=n(29242),S=n(37585),A=n(38954);const I=(0,n(51850).vt)(),P=(0,b.vt)(),L=(0,b.vt)(),T=(0,b.vt)();function O(e,t,n){return(0,A.s)(I,t[0],t[1],1),(0,A.t)(I,I,(0,w.mg)(P,n)),0===I[2]?(0,S.hZ)(e,I[0],I[1]):(0,S.hZ)(e,I[0]/I[2],I[1]/I[2])}function E(e,t,n){return R(L,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),R(T,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),(0,w.lw)(e,(0,w.KC)(L,L),T),0!==e[8]&&(e[0]/=e[8],e[1]/=e[8],e[2]/=e[8],e[3]/=e[8],e[4]/=e[8],e[5]/=e[8],e[6]/=e[8],e[7]/=e[8],e[8]/=e[8]),e}function R(e,t,n,r,i,o,s,a,l){(0,w.hZ)(e,t,r,o,n,i,s,1,1,1),(0,A.s)(I,a,l,1),(0,w.KC)(P,e);const[c,u,h]=(0,A.t)(I,I,(0,w.mg)(P,P));return(0,w.hZ)(P,c,0,0,0,u,0,0,0,h),(0,w.lw)(e,P,e)}var B=n(90629),Z=n(48163),G=n(86738),C=n(39829),j=n(57251),U=n(16930);let N=class extends v.P{projectOrWarn(e,t){if(null==e)return e;const{geometry:n,pending:r}=(0,j.projectOrLoad)(e,t);return r?null:r||n?n:(s.A.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};N=(0,r._)([(0,p.$)("esri.layers.support.GeoreferenceBase")],N);const $=N,Y=(0,b.vt)(),D=(0,Z.vt)();let X=class extends M.oY{};(0,r._)([(0,c.MZ)({type:Number,json:{write:!0}})],X.prototype,"x",void 0),(0,r._)([(0,c.MZ)({type:Number,json:{write:!0}})],X.prototype,"y",void 0),X=(0,r._)([(0,p.$)("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],X);let H=class extends v.P{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};(0,r._)([(0,c.MZ)()],H.prototype,"sourcePoint",void 0),(0,r._)([(0,c.MZ)({type:G.A})],H.prototype,"mapPoint",void 0),H=(0,r._)([(0,p.$)("esri.layers.support.ControlPointsGeoreference.ControlPoint")],H);let F=class extends((0,M.Te)($)){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=U.A.fromJSON(t.spatialReference),r=(0,b.fA)(...t.coefficients,1);return e.map((e=>((0,S.hZ)(D,e.x,e.y),O(D,D,r),{sourcePoint:e,mapPoint:new G.A({x:D[0],y:D[1],spatialReference:n})})))}writeControlPoints(e,t,n,r){if(null!=this.transform)null!=e&&V(e[0])&&(t.controlPoints=e.map((e=>{const t=e.sourcePoint;return{x:t.x,y:t.y}})),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const e=new o.A("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration.",{layer:r?.layer,georeference:this});r?.messages?r.messages.push(e):s.A.getLogger(this).error(e.name,e.message)}}get coords(){if(null==this.controlPoints)return null;const e=this._updateTransform(Y);if(null==e||!V(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return function(e,t,n,r){const i=(0,Z.fA)(0,n),o=(0,Z.fA)(0,0),s=(0,Z.fA)(t,0),a=(0,Z.fA)(t,n);return O(i,i,e),O(o,o,e),O(s,s,e),O(a,a,e),new C.A({rings:[[i,o,s,a,i]],spatialReference:r})}(e,this.width,this.height,t)}set coords(e){if(null==this.controlPoints||!V(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if(null==(e=this.projectOrWarn(e,t)))return;const{width:n,height:r}=this,{rings:[[i,o,s,a]]}=e,l={sourcePoint:(0,B.tc)(0,r),mapPoint:new G.A({x:i[0],y:i[1],spatialReference:t})},c={sourcePoint:(0,B.tc)(0,0),mapPoint:new G.A({x:o[0],y:o[1],spatialReference:t})},u={sourcePoint:(0,B.tc)(n,0),mapPoint:new G.A({x:s[0],y:s[1],spatialReference:t})},h={sourcePoint:(0,B.tc)(n,r),mapPoint:new G.A({x:a[0],y:a[1],spatialReference:t})};V(l)&&V(c)&&V(u)&&V(h)&&(re(Y,l,c,u,h),this.controlPoints=this.controlPoints.map((({sourcePoint:e})=>((0,S.hZ)(D,e.x,e.y),O(D,D,Y),{sourcePoint:e,mapPoint:new G.A({x:D[0],y:D[1],spatialReference:t})}))))}get inverseTransform(){return null==this.transform?null:(0,w.B8)((0,b.vt)(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(null==e||null==this.transform||null==this.controlPoints||!V(this.controlPoints[0]))return null;(0,S.hZ)(D,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return O(D,D,this.transform),new G.A({x:D[0],y:D[1],spatialReference:t})}toSource(e){if(null==e||null==this.inverseTransform||null==this.controlPoints||!V(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),null==(e=(0,j.projectOrLoad)(e,t).geometry)?null:((0,S.hZ)(D,e.x,e.y),O(D,D,this.inverseTransform),(0,B.tc)(D[0],D[1]))}toSourceNormalized(e){const t=this.toSource(e);return null!=t&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:r}=this;if(!(null!=t&&n>0&&r>0))return null;const[i,o,s,a]=t;if(!V(i))return null;const l=i.mapPoint.spatialReference,c=this._projectControlPoint(o,l),u=this._projectControlPoint(s,l),h=this._projectControlPoint(a,l);if(!c.valid||!u.valid||!h.valid)return null;if(!V(c.controlPoint))return null;null==e&&(e=(0,b.vt)());let p=null;return p=V(u.controlPoint)&&V(h.controlPoint)?re(e,i,c.controlPoint,u.controlPoint,h.controlPoint):V(u.controlPoint)?function(e,t,n,r){return ne(W,K,t),ne(z,J,n),ne(k,Q,r),(0,S.Cc)(q,W,z,.5),(0,S.e$)(q,k,q,Math.PI),(0,S.Cc)(ee,K,J,.5),(0,S.e$)(ee,Q,ee,Math.PI),ae(e,W,z,k,q,K,J,Q,ee)}(e,i,c.controlPoint,u.controlPoint):function(e,t,n){return ne(W,K,t),ne(z,J,n),(0,S.e$)(k,z,W,te),(0,S.e$)(q,W,z,te),(0,S.e$)(Q,J,K,-te),(0,S.e$)(ee,K,J,-te),ae(e,W,z,k,q,K,J,Q,ee)}(e,i,c.controlPoint),p.every((e=>0===e))?null:p}_projectControlPoint(e,t){if(!V(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:r}=e,{geometry:i,pending:o}=(0,j.projectOrLoad)(r,t);return o?{valid:!1,controlPoint:null}:o||i?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:i}}:(s.A.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:r.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function V(e){return null!=e?.sourcePoint&&null!=e.mapPoint}(0,r._)([(0,c.MZ)({type:[H],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[X]},coefficients:{type:[Number]},spatialReference:{type:U.A}}}}})],F.prototype,"controlPoints",void 0),(0,r._)([(0,h.w)("controlPoints")],F.prototype,"readControlPoints",null),(0,r._)([(0,d.K)("controlPoints")],F.prototype,"writeControlPoints",null),(0,r._)([(0,c.MZ)({clonable:!1})],F.prototype,"coords",null),(0,r._)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],F.prototype,"height",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],F.prototype,"inverseTransform",null),(0,r._)([(0,c.MZ)({readOnly:!0})],F.prototype,"transform",null),(0,r._)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],F.prototype,"width",void 0),F=(0,r._)([(0,p.$)("esri.layers.support.ControlPointsGeoreference")],F);const W=(0,Z.vt)(),z=(0,Z.vt)(),k=(0,Z.vt)(),q=(0,Z.vt)(),K=(0,Z.vt)(),J=(0,Z.vt)(),Q=(0,Z.vt)(),ee=(0,Z.vt)(),te=Math.PI/2;function ne(e,t,n){(0,S.hZ)(e,n.sourcePoint.x,n.sourcePoint.y),(0,S.hZ)(t,n.mapPoint.x,n.mapPoint.y)}function re(e,t,n,r,i){return ne(W,K,t),ne(z,J,n),ne(k,Q,r),ne(q,ee,i),ae(e,W,z,k,q,K,J,Q,ee)}const ie=new Array(8).fill(0),oe=new Array(8).fill(0);function se(e,t,n,r,i){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=r[0],e[5]=r[1],e[6]=i[0],e[7]=i[1],e}function ae(e,t,n,r,i,o,s,a,l){return E(e,se(ie,t,n,r,i),se(oe,o,s,a,l))}const le=F;var ce=n(78888),ue=n(43668),he=n(84952),pe=n(13069),de=n(4902),me=n(92474);const fe=(0,Z.vt)();let ye=class extends ${constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:r}=this;if(null==e||null==t||null==n||null==r)return null;const i=e.spatialReference;return t=this.projectOrWarn(t,i),n=this.projectOrWarn(n,i),r=this.projectOrWarn(r,i),null==t||null==n||null==r?null:new C.A({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[r.x,r.y],[n.x,n.y]]],spatialReference:i})}set coords(e){const{topLeft:t}=this;if(null==t)return;const n=t.spatialReference;if(null==(e=this.projectOrWarn(e,n)))return;const{rings:[[r,i,o,s]]}=e;this.bottomLeft=new G.A({x:r[0],y:r[1],spatialReference:n}),this.topLeft=new G.A({x:i[0],y:i[1],spatialReference:n}),this.topRight=new G.A({x:o[0],y:o[1],spatialReference:n}),this.bottomRight=new G.A({x:s[0],y:s[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:r,bottomLeft:i}=this;if(null==e||null==t||null==n||null==r||null==i)return null;const o=t.spatialReference;e=e.normalize();const s=(0,j.projectOrLoad)(e,o).geometry;if(null==s)return null;(0,S.hZ)(fe,s.x,s.y);const a=E((0,b.vt)(),[t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y],[0,0,0,1,1,0,1,1]);return O(fe,fe,a),(0,B.tc)(fe[0],fe[1])}};(0,r._)([(0,c.MZ)({clonable:!1})],ye.prototype,"coords",null),(0,r._)([(0,c.MZ)({type:G.A})],ye.prototype,"bottomLeft",void 0),(0,r._)([(0,c.MZ)({type:G.A})],ye.prototype,"bottomRight",void 0),(0,r._)([(0,c.MZ)({type:G.A})],ye.prototype,"topLeft",void 0),(0,r._)([(0,c.MZ)({type:G.A})],ye.prototype,"topRight",void 0),ye=(0,r._)([(0,p.$)("esri.layers.support.CornersGeoreference")],ye);const ge=ye;var _e=n(34727),xe=n(34304),ve=n(5443);let Me=class extends ${constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(null==this.extent)return null;const{xmin:e,ymin:t,xmax:n,ymax:r,spatialReference:i}=this.extent;let o;if(this.rotation){const{x:i,y:s}=this.extent.center,a=we(i,s,this.rotation);o=[a(e,t),a(e,r),a(n,r),a(n,t)],o.push(o[0])}else o=[[e,t],[e,r],[n,r],[n,t],[e,t]];return new C.A({rings:[o],spatialReference:i})}set coords(e){if(null==e||null==this.extent)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),null==e?.extent)return;const{rings:[[n,r,i]],extent:{center:{x:o,y:s}}}=e,a=(0,_e.KJ)(Math.PI/2-Math.atan2(r[1]-n[1],r[0]-n[0])),l=we(o,s,-a),[c,u]=l(n[0],n[1]),[h,p]=l(i[0],i[1]);this.extent=new ve.A({xmin:c,ymin:u,xmax:h,ymax:p,spatialReference:t}),this.rotation=a}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(null==e||null==t)return null;const{xmin:r,ymin:i,xmax:o,ymax:s,center:a,spatialReference:l}=t;e=e.normalize();const c=(0,j.projectOrLoad)(e,l).geometry;if(null==c)return null;let u=c.x,h=c.y;return n&&([u,h]=we(a.x,a.y,-n)(u,h)),(0,B.tc)((0,_e.hs)(u,r,o,0,1),(0,_e.hs)(h,s,i,0,1))}};function we(e,t,n){const r=(0,xe.DF)(n),i=Math.cos(r),o=Math.sin(r);return(n,r)=>[i*(n-e)+o*(r-t)+e,i*(r-t)-o*(n-e)+t]}(0,r._)([(0,c.MZ)({clonable:!1})],Me.prototype,"coords",null),(0,r._)([(0,c.MZ)({type:ve.A})],Me.prototype,"extent",void 0),(0,r._)([(0,c.MZ)({type:Number})],Me.prototype,"rotation",void 0),Me=(0,r._)([(0,p.$)("esri.layers.support.ExtentAndRotationGeoreference")],Me);const be=Me;n(59456);var Se=n(21325);function Ae(e,t){const n=(0,m.aB)(t);return function(e){return"media"===e?.type}(e)&&!!e.portalItem&&null!=n&&n>m.Gr.PORTAL_ITEM}const Ie={key:"type",base:$,typeMap:{"control-points":le,corners:ge,"extent-and-rotation":be}},Pe={key:"type",base:$,typeMap:{"control-points":le}};let Le=class extends((0,de.PH)((0,a.P)(me.A))){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return le.fromJSON(e)}writeGeoreference(e,t,n,r){const i=r?.resources?.pendingOperations,o=()=>{const i=function(e,t,n){if(!e||"control-points"===e.type)return e;const{coords:r}=e;if(5!==r?.rings[0]?.length)return null;const[i,o,s,a]=r.rings[0],{spatialReference:l}=r;return new le({controlPoints:[{mapPoint:new G.A({x:i[0],y:i[1],spatialReference:l}),sourcePoint:(0,B.tc)(0,n)},{mapPoint:new G.A({x:o[0],y:o[1],spatialReference:l}),sourcePoint:(0,B.tc)(0,0)},{mapPoint:new G.A({x:s[0],y:s[1],spatialReference:l}),sourcePoint:(0,B.tc)(t,0)},{mapPoint:new G.A({x:a[0],y:a[1],spatialReference:l}),sourcePoint:(0,B.tc)(t,n)}],width:t,height:n})}(this.georeference,this.contentWidth,this.contentHeight);i&&("control-points"!==e.type&&s.A.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),t[n]=i.write({},r))};if("control-points"!==e.type&&!this.loaded&&i)return t[n]={},void i.push(this.load().then(o));o()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:r}=this;if(null==e||null==t||0===n||0===r)return null;const i=t.toSourceNormalized(e);return null==i?null:(i.x*=n,i.y*=r,i)}};(0,r._)([(0,c.MZ)({types:Ie,json:{write:!0,types:Pe}})],Le.prototype,"georeference",void 0),(0,r._)([(0,h.w)("georeference")],Le.prototype,"readGeoreference",null),(0,r._)([(0,d.K)("georeference")],Le.prototype,"writeGeoreference",null),(0,r._)([(0,c.MZ)({json:{read:!1,write:!1}})],Le.prototype,"opacity",void 0),Le=(0,r._)([(0,p.$)("esri.layers.support.MediaElementBase")],Le);const Te=Le;var Oe=n(85648),Ee=n(97159);let Re=class extends Te{constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const e=this.image;if("string"==typeof e){const t=(0,ue.M5)(e).then((e=>{this._set("content",e)}));this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then((()=>{this._set("content",e)}));this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new o.A("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return(0,Ee.f)(t.url,n)}writeImage(e,t,n,r){if(null==e)return;const i=r?.portalItem,o=r?.resources;if(!i||!o)return void("string"==typeof e&&(t[n]=(0,Ee.t)(e,r)));const s=function(e){return"string"==typeof e&&!(0,he.DB)(e)&&!(0,he.w8)(e)}(e)?e:null;if(s){if(null==(0,Ee.i)(s))return void(t[n]=s);const e=(0,Ee.t)(s,{...r,verifyItemRelativeUrls:r?.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},Ee.M.NO);if(i&&e&&!(0,he.oP)(e))return o.toKeep.push({resource:i.resourceFromPath(e),compress:!1}),void(t[n]=e)}t[n]="<pending>",o.pendingOperations.push(async function(e){return"string"==typeof e?(0,he.DB)(e)?(0,he.N9)(e):(await(0,ce.A)(e,{responseType:"blob"})).data:new Promise((t=>function(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,r=document.createElement("canvas"),i=r.getContext("2d");return r.width=t,r.height=n,e instanceof HTMLImageElement?i.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&i.putImageData(e,0,0),r}(e).toBlob(t)))}(e).then((e=>{const r=function(e,t){const n=(0,pe.lk)(),r=`${(0,he.fj)("media",n)}.${(0,Oe.n)({type:"blob",blob:e})}`;return t.resourceFromPath(r)}(e,i);t[n]=r.itemRelativeUrl,o.toAdd.push({resource:r,content:{type:"blob",blob:e},compress:!1,finish:e=>{this.image=e.url}})})))}write(e,t){const n=super.write(e,t);return"mediaType"in n&&!n.url&&delete n.mediaType,n}};(0,r._)([(0,c.MZ)()],Re.prototype,"animationOptions",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],Re.prototype,"content",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],Re.prototype,"contentWidth",null),(0,r._)([(0,c.MZ)({readOnly:!0})],Re.prototype,"contentHeight",null),(0,r._)([(0,c.MZ)({json:{name:"url",type:String,write:{overridePolicy:(e,t,n)=>({enabled:!Ae(n?.layer,n?.origin)})}}})],Re.prototype,"image",void 0),(0,r._)([(0,h.w)("image",["url"])],Re.prototype,"readImage",null),(0,r._)([(0,d.K)("image")],Re.prototype,"writeImage",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:{target:"mediaType",ignoreOrigin:!0}}})],Re.prototype,"type",void 0),Re=(0,r._)([(0,p.$)("esri.layers.support.ImageElement")],Re);const Be=Re;var Ze=n(62885),Ge=n(65529),Ce=n(61893),je=n(36708),Ue=n(19419),Ne=n(12176),$e=n(6518),Ye=n(69622),De=n(537),Xe=n(95108),He=n(65864),Fe=n(80754);function Ve(e,t,n){if(Array.isArray(e)){const r=e[0];if(r>t){const n=(0,Fe.kd)(r,t);e[0]=r+n*(-2*t)}else if(r<n){const t=(0,Fe.kd)(r,n);e[0]=r+t*(-2*n)}}else{const r=e.x;if(r>t){const n=(0,Fe.kd)(r,t);e.x+=n*(-2*t)}else if(r<n){const t=(0,Fe.kd)(r,n);e.x+=t*(-2*n)}}return e}function We(e,t){const n=[],{ymin:r,ymax:i,xmin:o,xmax:s}=e,a=e.xmax-e.xmin,[l,c]=t.valid,{x:u,frameId:h}=ze(e.xmin,t),{x:p,frameId:d}=ze(e.xmax,t),m=u===p&&a>0;if(a>2*c){const e={xmin:o<s?u:p,ymin:r,xmax:c,ymax:i},t={xmin:l,ymin:r,xmax:o<s?p:u,ymax:i},a={xmin:0,ymin:r,xmax:c,ymax:i},m={xmin:l,ymin:r,xmax:0,ymax:i},f=[],y=[];ke(e,a)&&f.push(h),ke(e,m)&&y.push(h),ke(t,a)&&f.push(d),ke(t,m)&&y.push(d);for(let e=h+1;e<d;e++)f.push(e),y.push(e);n.push(new Je(e,[h]),new Je(t,[d]),new Je(a,f),new Je(m,y))}else u>p||m?n.push(new Je({xmin:u,ymin:r,xmax:c,ymax:i},[h]),new Je({xmin:l,ymin:r,xmax:p,ymax:i},[d])):n.push(new Je({xmin:u,ymin:r,xmax:p,ymax:i},[h]));return n}function ze(e,t){const[n,r]=t.valid,i=2*r;let o,s=0;return e>r?(o=Math.ceil(Math.abs(e-r)/i),e-=o*i,s=o):e<n&&(o=Math.ceil(Math.abs(e-n)/i),e+=o*i,s=-o),{x:e,frameId:s}}function ke(e,t){const{xmin:n,ymin:r,xmax:i,ymax:o}=t;return qe(e,n,r)&&qe(e,n,o)&&qe(e,i,o)&&qe(e,i,r)}function qe(e,t,n){return t>=e.xmin&&t<=e.xmax&&n>=e.ymin&&n<=e.ymax}function Ke(e,t,n=!0){const r=!(0,He.Rg)(e);if(r&&(0,Xe.m3)(e),n)return(new et).cut(e,t);const i=r?e.rings:e.paths,o=r?4:2,s=i.length,a=-2*t;for(let e=0;e<s;e++){const t=i[e];if(t&&t.length>=o){const e=[];for(const n of t)e.push([n[0]+a,n[1]]);i.push(e)}}return r?e.rings=i:e.paths=i,e}class Je{constructor(e,t){this.extent=e,this.frameIds=t}}const Qe=(0,Ue.vt)();class et{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,t){let n;if(this._xCut=t,e.rings)this._closed=!0,n=e.rings,this._minPts=4;else{if(!e.paths)return null;this._closed=!1,n=e.paths,this._minPts=2}for(const e of n){if(!e||e.length<this._minPts)continue;let t=!0;for(const n of e)t?(this.moveTo(n),t=!1):this.lineTo(n);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),n=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&n.push(e);const r=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=r;n.push(e)}return this._closed?e.rings=n:e.paths=n,e}moveTo(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e}lineTo(e){const t=this._side(e[0]);if(t*this._prevSide==-1){const n=this._intersect(this._prevPt,e);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e}close(){const e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,t,n){this._closed?(this._lineIn.push([n<=0?e:this._xCut,t]),this._lineOut.push([n>=0?e:this._xCut,t])):(n<=0&&this._lineIn.push([e,t]),n>=0&&this._lineOut.push([e,t]))}_lineTo(e,t,n){this._closed?(tt(this._lineIn,n<=0?e:this._xCut,t),tt(this._lineOut,n>=0?e:this._xCut,t)):n<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([e,t])):n>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([e,t])):this._prevSide<0?(this._lineIn.push([e,t]),this._lineOut.push([e,t])):this._prevSide>0&&(this._lineOut.push([e,t]),this._lineIn.push([e,t]))}_checkClosingPt(e){const t=e.length;t>3&&e[0][0]===this._xCut&&e[t-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[t-2][1],e.pop())}_side(e){return e<this._xCut?-1:e>this._xCut?1:0}_intersect(e,t){const n=(this._xCut-e[0])/(t[0]-e[0]);return e[1]+n*(t[1]-e[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function tt(e,t,n){const r=e.length;r>1&&e[r-1][0]===t&&e[r-2][0]===t?e[r-1][1]=n:e.push([t,n])}let nt=class extends Ye.A{constructor(e){super(e)}get bounds(){const e=this.coords;return null==e?.extent?null:(0,Ue.VY)(e.extent)}get coords(){const e=this.element.georeference?.coords;return(0,j.projectOrLoad)(e,this.spatialReference).geometry}get normalizedCoords(){return C.A.fromJSON(function(e,t){if(null==e)return null;const n=e.spatialReference,r=(0,Se.Vp)(n),i=(0,M.Wj)(e)?e.toJSON():e;if(!r)return i;const o=(0,Se.K8)(n)?102100:4326,s=Fe.j7[o].maxX,a=Fe.j7[o].minX;if((0,He.fT)(i))return Ve(i,s,a);if((0,He.U9)(i))return i.points=i.points.map((e=>Ve(e,s,a))),i;if((0,He.ZC)(i))return function(e,t){if(!t)return e;const n=We(e,t).map((e=>e.extent));return n.length<2?n[0]||e:n.length>2?(e.xmin=t.valid[0],e.xmax=t.valid[1],e):{rings:n.map((e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]))}}(i,r);if((0,He.Bi)(i)||(0,He.Rg)(i)){const e=(0,De.Rg)(Qe,i),n={xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]},r=(0,Fe.kd)(n.xmin,a)*(2*s),o=0===r?i:(0,Fe.kS)(i,r);return n.xmin+=r,n.xmax+=r,n.xmax>s?Ke(o,s,t):n.xmin<a?Ke(o,a,t):o}return i}(this.coords,!0))}get normalizedBounds(){const e=null!=this.normalizedCoords?this.normalizedCoords.extent:null;return null!=e?(0,Ue.VY)(e):null}};(0,r._)([(0,c.MZ)()],nt.prototype,"spatialReference",void 0),(0,r._)([(0,c.MZ)()],nt.prototype,"element",void 0),(0,r._)([(0,c.MZ)()],nt.prototype,"bounds",null),(0,r._)([(0,c.MZ)()],nt.prototype,"coords",null),(0,r._)([(0,c.MZ)()],nt.prototype,"normalizedCoords",null),(0,r._)([(0,c.MZ)()],nt.prototype,"normalizedBounds",null),nt=(0,r._)([(0,p.$)("esri.layers.support.MediaElementView")],nt);var rt=n(37955);let it=class extends Te{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;if("string"==typeof e){const t=document.createElement("video");t.src=e,t.crossOrigin="anonymous",t.autoplay=!0,t.muted=!0,t.loop=!0,t.playsInline=!0,this.addResolvingPromise(this._loadVideo(t).then((()=>{this._set("content",t)})))}else e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o.A("video-element:invalid-video-type","Invalid video type",{video:e})));return Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.A.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}_loadVideo(e){return new Promise(((t,n)=>{const r=(0,rt.Oo)(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()}));this.addHandles(r,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",e.src?.includes("blob:")||(e.src=e.src))}))}};(0,r._)([(0,c.MZ)()],it.prototype,"autoplay",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],it.prototype,"content",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],it.prototype,"contentWidth",null),(0,r._)([(0,c.MZ)({readOnly:!0})],it.prototype,"contentHeight",null),(0,r._)([(0,c.MZ)()],it.prototype,"video",null),it=(0,r._)([(0,p.$)("esri.layers.support.VideoElement")],it);const ot=it,st={key:"type",defaultKeyValue:"image",base:Te,typeMap:{image:Be,video:ot}},at=i.A.ofType(st);let lt=class extends(me.A.LoadableMixin((0,Ce.g)(Ge.A.EventedAccessor))){constructor(e){super(e),this._index=new $e.F,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=e=>{for(const t of e.removed){const e=this._elementViewsMap.get(t);this._elementViewsMap.delete(t),this._index.delete(e),this.removeHandles(e),e.destroy(),this.notifyChange("fullExtent")}const{spatialReference:t}=this;for(const n of e.added){if(this._elementViewsMap.get(n))continue;const e=new nt({spatialReference:t,element:n});this._elementViewsMap.set(n,e);const r=(0,je.wB)((()=>e.coords),(()=>this._updateIndexForElement(e,!1)));this._updateIndexForElement(e,!0),this.addHandles(r,e)}this._elementsIndexes.clear(),this.elements.forEach(((e,t)=>this._elementsIndexes.set(e,t))),this.emit("refresh")},this.elements=new at}async load(e){if((0,l.Te)(e),!this.spatialReference){const e=this.elements.find((e=>null!=e.georeference?.coords));this._set("spatialReference",e?e.georeference.coords.spatialReference:U.A.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",(0,Ze.V)(e,this._get("elements"),at))}get fullExtent(){if("not-loaded"===this.loadStatus)return null;const e=this._index.fullBounds;return null==e?null:new ve.A({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){"not-loaded"===this.loadStatus?this._set("spatialReference",e):s.A.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await(0,j.initializeProjection)(e.spatialReference,this.spatialReference,null,t);const n=(0,Se.aI)(e.spatialReference,this.spatialReference)?e:(0,j.project)(e,this.spatialReference);if(!n)return[];const r=n.normalize(),i=[];for(const e of r)this._index.forEachInBounds((0,Ue.VY)(e),(({normalizedCoords:t,element:n})=>{null!=t&&(0,Ne.fA)(e,t)&&i.push(n)}));return i.sort(((e,t)=>this._elementsIndexes.get(e)-this._elementsIndexes.get(t))),i}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,r=this._index.has(e),i=null!=n;this._index.delete(e),i&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(r!==i?this.emit("refresh"):this.emit("change",{element:e.element}))}};(0,r._)([(0,c.MZ)()],lt.prototype,"elements",null),(0,r._)([(0,c.MZ)({readOnly:!0})],lt.prototype,"fullExtent",null),(0,r._)([(0,c.MZ)()],lt.prototype,"spatialReference",null),lt=(0,r._)([(0,p.$)("esri.layers.support.LocalMediaElementSource")],lt);const ct=lt;var ut=n(92935);function ht(e){return"object"==typeof e&&null!=e&&"type"in e}function pt(e){return ht(e)&&"image"===e.type}let dt=class extends((0,y.dM)((0,x.j)((0,g.q)((0,_.A)((0,a.P)(f.A)))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=(0,l.sg)((async(e,t,r)=>{const{save:i,saveAs:o}=await n.e(3561).then(n.bind(n,63561));switch(e){case ut.X.SAVE:return i(this,t);case ut.X.SAVE_AS:return o(this,r,t)}})),this.source=new ct}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new o.A("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const r=ht(t)?new ct({elements:new i.A([t])}):t;this._set("effectiveSource",r),this.spatialReference&&(r.spatialReference=this.spatialReference),await r.load(e),this.spatialReference=r.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("source",e):s.A.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new ct({elements:new i.A(e)}):e instanceof i.A?new ct({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const r=this._createSource(t);return r?.read(t,n),r}writeSource(e,t,n,r){if(e&&e instanceof ct){const t=e.elements.length;if(1!==t)return void(r?.messages&&r.messages.push(new o.A("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${t}.`)));e=e.elements.at(0)}pt(e)?e.write(t,r):r?.messages&&(e?r.messages.push(new o.A("media-layer:unsupported-source","only media elements of type 'ImageElement' can be persisted")):r.messages.push(new o.A("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(ut.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ut.X.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Be;case"video":return new ot}return null}_getSourceOverride(e,t){if(ht(e)&&this.originIdOf("source")===m.Gr.PORTAL_ITEM&&t&&(this.originIdOf("georeference")===m.Gr.WEB_MAP||this.originIdOf("georeference")===m.Gr.WEB_SCENE)){const n=e.toJSON(),r=this._createSource(n);return r.read({...n},{origin:"portal-item"}),r.read({georeference:t},{origin:"web-map"}),r.read({georeference:t},{origin:"web-scene"}),r}return null}};(0,r._)([(0,c.MZ)({readOnly:!0})],dt.prototype,"effectiveSource",void 0),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],dt.prototype,"georeference",void 0),(0,r._)([(0,h.w)("web-document","georeference")],dt.prototype,"readGeoreference",null),(0,r._)([(0,c.MZ)({type:String})],dt.prototype,"copyright",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],dt.prototype,"fullExtent",null),(0,r._)([(0,c.MZ)({type:["MediaLayer"]})],dt.prototype,"operationalLayerType",void 0),(0,r._)([(0,c.MZ)({type:["show","hide"]})],dt.prototype,"listMode",void 0),(0,r._)([(0,c.MZ)({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image"]},georeference:{type:le}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Ae(this,n?.origin)&&pt(e)&&!!e.georeference&&e.originIdOf("georeference")>m.Gr.PORTAL_ITEM}}}}})],dt.prototype,"source",null),(0,r._)([(0,u.w)("source")],dt.prototype,"castSource",null),(0,r._)([(0,h.w)("source",["url"])],dt.prototype,"readSource",null),(0,r._)([(0,d.K)("source")],dt.prototype,"writeSource",null),(0,r._)([(0,c.MZ)()],dt.prototype,"spatialReference",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],dt.prototype,"type",void 0),dt=(0,r._)([(0,p.$)("esri.layers.MediaLayer")],dt);const mt=dt},6518:(e,t,n)=>{n.d(t,{F:()=>a});var r=n(44208),i=n(75503),o=n(19419);const s={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new i.w(9,(0,r.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((n,r)=>{e[t++]=r})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,o.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,n){(function(e){s.minX=e[0],s.minY=e[1],s.maxX=e[2],s.maxY=e[3]})(t),e.search(s,n)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},16131:(e,t,n)=>{n.d(t,{q:()=>v});var r=n(90237),i=n(60945),o=n(49186),s=n(84952),a=n(10107),l=n(56507),c=(n(87811),n(44208),n(36005)),u=n(40608),h=n(43937),p=n(89317),d=n(45917),m=n(49422);const f={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},y={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},g={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},_={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,Voxel:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":f,"web-map/basemap":y,"web-map/tables":g,"link-chart/operational-layers":{...f,LinkChartLayer:!0},"link-chart/basemap":y,"link-chart/tables":g,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0}};var x=n(10873);const v=e=>{let t=class extends e{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(e,t,n){return"Group Layer"===n?.portalItem?.type?void 0:e}writeListMode(e,t,n,r){(r&&"ground"===r.layerContainerType||e&&(0,m.R)(this,n,{},r))&&(t[n]=e)}writeOperationalLayerType(e,t,n,r){e&&"tables"!==r?.layerContainerType&&(t.layerType=e)}writeTitle(e,t){t.title=e??"Layer"}readTimeExtent(e){return e?i.A.fromArray(e):null}writeTimeExtent(e,t,n,r){e&&"tables"!==r.layerContainerType&&(e.isEmpty?r?.messages&&r.messages.push(new o.A("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):t[n]=e.toArray())}read(e,t){t&&(t.layer=this),(0,d.t)(this,e,(t=>super.read(e,t)),t)}write(e,t){if(!this.persistenceEnabled&&!t?.ignorePersistenceEnabled)return null;if(t?.origin){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`,n=_[e];let r=!!n?.[this.operationalLayerType];if("ArcGISTiledElevationServiceLayer"===this.operationalLayerType&&"web-scene/operational-layers"===e&&(r=!1),"ArcGISDimensionLayer"===this.operationalLayerType&&"web-map/operational-layers"===e&&(r=!1),!r)return t.messages?.push(new o.A("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this})),null}const n=super.write(e,{...t,layer:this}),r=!!t&&!!t.messages&&!!t.messages.filter((e=>e instanceof o.A&&"web-document-write:property-required"===e.name)).length;return(0,s.w8)(n?.url)?(t?.messages?.push(new o.A("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&r?null:n}beforeSave(){}};return(0,r._)([(0,a.MZ)({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],t.prototype,"id",void 0),(0,r._)([(0,c.w)("id",["id"])],t.prototype,"readId",null),(0,r._)([(0,a.MZ)(x.C1)],t.prototype,"listMode",void 0),(0,r._)([(0,h.K)("listMode")],t.prototype,"writeListMode",null),(0,r._)([(0,a.MZ)({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:p.K}}}}})],t.prototype,"operationalLayerType",void 0),(0,r._)([(0,h.K)("operationalLayerType")],t.prototype,"writeOperationalLayerType",null),(0,r._)([(0,a.MZ)(x.ke)],t.prototype,"opacity",void 0),(0,r._)([(0,a.MZ)({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),(0,r._)([(0,a.MZ)({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],t.prototype,"title",void 0),(0,r._)([(0,h.K)("title"),(0,h.K)(["web-scene"],"title")],t.prototype,"writeTitle",null),(0,r._)([(0,a.MZ)({type:i.A,json:{origins:{"web-scene":{write:{layerContainerTypes:p.K}}}}})],t.prototype,"visibilityTimeExtent",void 0),(0,r._)([(0,c.w)("visibilityTimeExtent")],t.prototype,"readTimeExtent",null),(0,r._)([(0,h.K)(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[l.jz,l.Uv]]}})],t.prototype,"writeTimeExtent",null),(0,r._)([(0,a.MZ)({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:p.K}}},name:"visibility",write:!0}})],t.prototype,"visible",void 0),t=(0,r._)([(0,u.$)("esri.layers.mixins.OperationalLayer")],t),t}},8303:(e,t,n)=>{n.d(t,{A:()=>w});var r=n(90237),i=n(92602),o=n(70333),s=n(78888),a=n(60999),l=n(49186),c=n(53966),u=n(97768),h=n(74887),p=n(84952),d=n(10107),m=(n(44208),n(87811),n(36005)),f=n(40608),y=n(43937),g=n(83531),_=n(20655),x=n(80812),v=n(41318),M=n(10407);const w=e=>{let t=class extends e{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,n){if(t.itemId)return new x.default({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:r}=await Promise.all([n.e(5356),n.e(1204)]).then(n.bind(n,41204));return(0,h.Te)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,h.zf)(e)||c.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,h.QP)(e),!0))))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:n,fullEdit:r},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,h.QP)(e)}}async _fetchUserPrivileges(e,t){let n=this.portalItem;if(!e||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=e===n.id;if(r&&n.portal.user)return(0,M.It)(n);let i,s;if(r)i=n.portal.url;else try{i=await(0,g.wI)(this.url,t)}catch(e){(0,h.QP)(e)}if(!i||!(0,p.b8)(i,n.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;s=await(o.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.QP)(e)}const a=!0,l=!1,c=!1;if(!s)return{features:{edit:a,fullEdit:l},content:{updateItem:c}};try{if(r?await n.reload():(n=new x.default({id:e,portal:{url:i}}),await n.load(t)),n.portal.user)return(0,M.It)(n)}catch(e){(0,h.QP)(e)}return{features:{edit:a,fullEdit:l},content:{updateItem:c}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?o.id?.findCredential(this.url):null;if(!t)return!0;const n=b.credential===t?b.user:await this._fetchEditingUser(e);return b.credential=t,b.user=n,null==n?.privileges||n.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const n=o.id?.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const r=`${n.owningSystemUrl}/sharing/rest`,i=_.A.getDefault();if(i&&i.loaded&&(0,p.S8)(i.restUrl)===(0,p.S8)(r))return i.user;const l=`${r}/community/self`,c=null!=e?e.signal:null,u=await(0,a.Ke)((0,s.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?v.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const n=t?.portal,r=this.portalItem?.id&&(this.portalItem.portal||_.A.getDefault());return n&&r&&!(0,p.ut)(r.restUrl,n.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,d.MZ)({type:x.default})],t.prototype,"portalItem",null),(0,r._)([(0,m.w)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.K)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,d.MZ)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,d.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,r._)([(0,d.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,r._)([(0,d.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,r._)([(0,f.$)("esri.layers.mixins.PortalLayer")],t),t},b={credential:null,user:null}},85648:(e,t,n)=>{n.d(t,{n:()=>i});var r=n(84952);function i(e){return o[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,r.Zo)(e);return l[t]||s}(e.url)}(e)]||a}const o={},s="text/plain",a=o[s],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)o[l[e]]=e},92935:(e,t,n)=>{var r;n.d(t,{X:()=>r}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(r||(r={}))}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7899,1053,3069],{60945:(e,t,n)=>{n.d(t,{A:()=>f});var r,i=n(90237),o=n(25482),s=n(88930),a=n(10107),l=(n(44208),n(53966),n(87811),n(36005)),c=n(40608),u=n(43937),h=n(56400);let p=r=class extends o.oY{static get allTime(){return d}static get empty(){return m}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,n=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,i=e.end?.getTime()??e.end;return t===r&&n===i}expandTo(e,t=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=(0,s.lL)(n,e,t));let i=this.end;if(i){const n=(0,s.lL)(i,e,t);i=i.getTime()===n.getTime()?n:(0,s.S1)(n,1,e,t)}return new r({start:n,end:i})}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,n=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,o=e.end?.getTime()??1/0;let s,a;return i>=t&&i<=n?s=i:t>=i&&t<=o&&(s=t),n>=i&&n<=o?a=n:o>=t&&o<=n&&(a=o),null==s||null==a||isNaN(s)||isNaN(a)?r.empty:new r({start:s===-1/0?null:new Date(s),end:a===1/0?null:new Date(a)})}offset(e,t,n=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();const i=new r,{start:o,end:a}=this;return null!=o&&(i.start=(0,s.S1)(o,e,t,n)),null!=a&&(i.end=(0,s.S1)(a,e,t,n)),i}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 d.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:n})}};(0,i._)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,i._)([(0,l.w)("end")],p.prototype,"readEnd",null),(0,i._)([(0,u.K)("end")],p.prototype,"writeEnd",null),(0,i._)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,i._)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,i._)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,i._)([(0,l.w)("start")],p.prototype,"readStart",null),(0,i._)([(0,u.K)("start")],p.prototype,"writeStart",null),p=r=(0,i._)([(0,c.$)("esri.TimeExtent")],p);const d=new p,m=new p({start:void 0,end:void 0}),f=p},11053:(e,t,n)=>{n.d(t,{c:()=>r,g:()=>i});var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},11006:(e,t,n)=>{n.d(t,{q:()=>l});var r,i,o,s=n(11053),a={exports:{}};r=a,i=function(){function e(n,r,i,o,s){for(;o>i;){if(o-i>600){var a=o-i+1,l=r-i+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-l*u/a+h)),Math.min(o,Math.floor(r+(a-l)*u/a+h)),s)}var p=n[r],d=i,m=o;for(t(n,i,r),s(n[o],p)>0&&t(n,i,o);d<m;){for(t(n,d,m),d++,m--;s(n[d],p)<0;)d++;for(;s(n[m],p)>0;)m--}0===s(n[i],p)?t(n,i,m):t(n,++m,o),m<=r&&(i=m+1),r<=m&&(o=m-1)}}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return e<t?-1:e>t?1:0}return function(t,r,i,o,s){e(t,r,i||0,o||t.length-1,s||n)}},void 0!==(o=i())&&(r.exports=o);const l=(0,s.g)(a.exports)},69540:(e,t,n)=>{n.d(t,{O:()=>u,P:()=>h});var r=n(90237),i=n(69622),o=(n(44208),n(4718)),s=(n(53966),n(97768)),a=n(35666),l=n(88620),c=n(40608);const u=e=>{let t=class extends e{clone(){const e=(0,l.oY)(this);(0,s.Lw)(e,"unable to clone instance of non-accessor class");const t=e.metadata,n=e.store,r={},i=new Map;for(const e in t){const s=t[e],l=n?.originOf(e),c=s.clonable;if(s.readOnly||!1===c||l!==a.Gr.USER&&l!==a.Gr.DEFAULTS&&l!==a.Gr.WEB_MAP&&l!==a.Gr.WEB_SCENE)continue;const u=this[e];let h=null;h="function"==typeof c?c(u):"reference"===c?u:(0,o.TU)(u),null!=u&&null==h||(l===a.Gr.DEFAULTS?i.set(e,h):r[e]=h)}const c=new(0,Object.getPrototypeOf(this).constructor)(r);if(i.size){const e=(0,l.oY)(c)?.store;if(e)for(const[t,n]of i)e.set(t,n,a.Gr.DEFAULTS)}return c}};return t=(0,r._)([(0,c.$)("esri.core.Clonable")],t),t};let h=class extends(u(i.A)){};h=(0,r._)([(0,c.$)("esri.core.Clonable")],h)},4902:(e,t,n)=>{n.d(t,{PH:()=>a,sA:()=>s});var r=n(90237),i=n(40608);let o=0;const s=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+o++})}};return t=(0,r._)([(0,i.$)("esri.core.Identifiable")],t),t},a=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:o++})}};return t=(0,r._)([(0,i.$)("esri.core.Identifiable.NumericIdentifiable")],t),t};let l=class extends(s(class{})){};l=(0,r._)([(0,i.$)("esri.core.Identifiable")],l)},92071:(e,t,n)=>{n.d(t,{P:()=>x,L:()=>v});var r=n(90237),i=n(69622),o=n(76953),s=n(4718),a=n(35666);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(a.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new l,n=this._originStores[a.Gr.DEFAULTS];n&&n.forEach(((e,n)=>{t.set(n,(0,s.o8)(e),a.Gr.DEFAULTS)}));for(let n=a.Gr.SERVICE;n<a.AU;n++){const r=this._originStores[n];r&&r.forEach(((r,i)=>{e&&e.has(i)||t.set(i,(0,s.o8)(r),n)}))}return t}get(e,t){const n=void 0===t?this._values:this._originStores[t];return n?n.get(e):void 0}keys(e){const t=null==e?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,n=a.Gr.USER){let r=this._originStores[n];if(r||(r=new Map,this._originStores[n]=r),r.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=n){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,n),r!==t}return!1}delete(e,t=a.Gr.USER){const n=this._originStores[t];if(!n)return;const r=n.get(e);if(n.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let n=t-1;n>=0;n--){const t=this._originStores[n];if(t&&t.has(e)){this._values.set(e,t.get(e)),this._propertyOriginMap.set(e,n);break}}}return r}has(e,t){const n=void 0===t?this._values:this._originStores[t];return!!n&&n.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const n=this._originStores[t],r=n?.get(e),i=this._values.get(e);return this._values.set(e,r),this._propertyOriginMap.set(e,t),i!==r}originOf(e){return this._propertyOriginMap.get(e)||a.Gr.DEFAULTS}forEach(e){this._values.forEach(e)}}var c=n(45917),u=n(88620),h=n(40608);const p=e=>{let t=class extends e{constructor(...e){super(...e);const t=(0,u.oY)(this),n=t.store,r=new l;t.store=r,(0,o.k)(t,n,r)}read(e,t){(0,c.L)(this,e,t)}getAtOrigin(e,t){const n=d(this),r=(0,a.aB)(t);if("string"==typeof e)return n.get(e,r);const i={};return e.forEach((e=>{i[e]=n.get(e,r)})),i}originOf(e){return(0,a.OL)(this.originIdOf(e))}originIdOf(e){return d(this).originOf(e)}revert(e,t){const n=d(this),r=(0,a.aB)(t),i=(0,u.oY)(this);let o;o="string"==typeof e?"*"===e?n.keys(r):[e]:e,o.forEach((e=>{i.invalidate(e),n.revert(e,r),i.commit(e)}))}};return t=(0,r._)([(0,h.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function d(e){return(0,u.oY)(e).store}let m=class extends(p(i.A)){};m=(0,r._)([(0,h.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],m);var f=n(16649),y=n(49422);const g=e=>{let t=class extends e{constructor(...e){super(...e)}clear(e,t="user"){return _(this).delete(e,(0,a.aB)(t))}write(e,t){return(0,y.M)(this,e=e||{},t),e}setAtOrigin(e,t,n){(0,u.oY)(this).setAtOrigin(e,t,(0,a.aB)(n))}removeOrigin(e){const t=_(this),n=(0,a.aB)(e),r=t.keys(n);for(const e of r)t.originOf(e)===n&&t.set(e,t.get(e,n),a.Gr.USER)}updateOrigin(e,t){const n=_(this),r=(0,a.aB)(t),i=(0,f.Jt)(this,e);for(let t=r+1;t<a.AU;++t)n.delete(e,t);n.set(e,i,r)}toJSON(e){return this.write({},e)}};return t=(0,r._)([(0,h.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function _(e){return(0,u.oY)(e).store}const x=e=>{let t=class extends(g(p(e))){constructor(...e){super(...e)}};return t=(0,r._)([(0,h.$)("esri.core.MultiOriginJSONSupport")],t),t};let v=class extends(x(i.A)){};v=(0,r._)([(0,h.$)("esri.core.MultiOriginJSONSupport")],v)},43668:(e,t,n)=>{n.d(t,{M5:()=>h,eV:()=>u});var r=n(78888),i=n(49186),o=n(74887),s=n(84952),a=n(26306);let l=null,c=!0;function u(e,t,n,r){if(!t||!n)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(e,t,n)}catch(e){c=!1}const i=function(e,t,n){return n||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),n=l),n.getContext("2d").createImageData(e,t)}(t,n,r);return i.data.set(e,0),i}async function h(e,t){const{arrayBuffer:l,mediaType:c}=await async function(e,t){const n=(0,s.r$)(e);if(n?.isBase64)return{arrayBuffer:(0,a.M)(n.data),mediaType:n.mediaType};const i=await(0,r.A)(e,{responseType:"array-buffer",...t});return{arrayBuffer:i.data,mediaType:i.getHeader?.("Content-Type")??""}}(e,t),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:e,parseGif:r}=await n.e(820).then(n.bind(n,10820));if(e(l))return r(l,t)}if(u){const{isAnimatedPNG:e,parseApng:r}=await n.e(2390).then(n.bind(n,22390));if(e(l))return r(l,t)}return async function(e,t){const n=window.URL.createObjectURL(e);try{const{data:e}=await(0,r.A)(n,{...t,responseType:"image"});return e}catch(e){if(!(0,o.zf)(e))throw new i.A("invalid-image",`Could not fetch requested image at ${n}`);throw e}finally{window.URL.revokeObjectURL(n)}}(new Blob([l],{type:c}),t)}},29242:(e,t,n)=>{function r(){return[1,0,0,0,1,0,0,0,1]}function i(e,t,n,r,i,o,s,a,l){return[e,t,n,r,i,o,s,a,l]}n.d(t,{fA:()=>i,vt:()=>r,zK:()=>o});const o=[1,0,0,0,1,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:o,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},create:r,createView:function(e,t){return new Float64Array(e,t,9)},fromValues:i},Symbol.toStringTag,{value:"Module"}))},48163:(e,t,n)=>{function r(){return[0,0]}function i(e,t){return[e,t]}function o(){return i(1,1)}function s(){return i(1,0)}function a(){return i(0,1)}n.d(t,{Un:()=>l,fA:()=>i,vt:()=>r});const l=o(),c=s(),u=a();Object.freeze(Object.defineProperty({__proto__:null,ONES:l,UNIT_X:c,UNIT_Y:u,ZEROS:[0,0],clone:function(e){return[e[0],e[1]]},create:r,createView:function(e,t){return new Float64Array(e,t,2)},fromArray:function(e,t=[0,0]){const n=Math.min(2,e.length);for(let r=0;r<n;++r)t[r]=e[r];return t},fromValues:i,ones:o,unitX:s,unitY:a,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},77690:(e,t,n)=>{n.d(t,{B8:()=>a,Ge:()=>p,I0:()=>h,KC:()=>l,hZ:()=>o,hs:()=>u,lw:()=>c,mg:()=>s,z0:()=>i});var r=n(34304);function i(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function o(e,t,n,r,i,o,s,a,l,c){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e}function s(e,t){if(e===t){const n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function a(e,t){const n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=u*s-a*c,p=-u*o+a*l,d=c*o-s*l;let m=n*h+r*p+i*d;return m?(m=1/m,e[0]=h*m,e[1]=(-u*r+i*c)*m,e[2]=(a*r-i*s)*m,e[3]=p*m,e[4]=(u*n-i*l)*m,e[5]=(-a*n+i*o)*m,e[6]=d*m,e[7]=(-c*n+r*l)*m,e[8]=(s*n-r*o)*m,e):null}function l(e,t){const n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8];return e[0]=s*u-a*c,e[1]=i*c-r*u,e[2]=r*a-i*s,e[3]=a*l-o*u,e[4]=n*u-i*l,e[5]=i*o-n*a,e[6]=o*c-s*l,e[7]=r*l-n*c,e[8]=n*s-r*o,e}function c(e,t,n){const r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=n[0],d=n[1],m=n[2],f=n[3],y=n[4],g=n[5],_=n[6],x=n[7],v=n[8];return e[0]=p*r+d*s+m*c,e[1]=p*i+d*a+m*u,e[2]=p*o+d*l+m*h,e[3]=f*r+y*s+g*c,e[4]=f*i+y*a+g*u,e[5]=f*o+y*l+g*h,e[6]=_*r+x*s+v*c,e[7]=_*i+x*a+v*u,e[8]=_*o+x*l+v*h,e}function u(e,t,n){const r=n[0],i=n[1],o=n[2];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=o*t[6],e[7]=o*t[7],e[8]=o*t[8],e}function h(e,t){const n=t[0],r=t[1],i=t[2],o=t[3],s=n+n,a=r+r,l=i+i,c=n*s,u=r*s,h=r*a,p=i*s,d=i*a,m=i*l,f=o*s,y=o*a,g=o*l;return e[0]=1-h-m,e[3]=u-g,e[6]=p+y,e[1]=u+g,e[4]=1-c-m,e[7]=d-f,e[2]=p-y,e[5]=d+f,e[8]=1-c-h,e}function p(e,t){const n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],d=t[11],m=t[12],f=t[13],y=t[14],g=t[15],_=n*a-r*s,x=n*l-i*s,v=n*c-o*s,M=r*l-i*a,w=r*c-o*a,b=i*c-o*l,S=u*f-h*m,A=u*y-p*m,I=u*g-d*m,P=h*y-p*f,L=h*g-d*f,T=p*g-d*y;let O=_*T-x*L+v*P+M*I-w*A+b*S;return O?(O=1/O,e[0]=(a*T-l*L+c*P)*O,e[1]=(l*I-s*T-c*A)*O,e[2]=(s*L-a*I+c*S)*O,e[3]=(i*L-r*T-o*P)*O,e[4]=(n*T-i*I+o*A)*O,e[5]=(r*I-n*L-o*S)*O,e[6]=(f*b-y*w+g*M)*O,e[7]=(y*v-m*b-g*x)*O,e[8]=(m*w-f*v+g*_)*O,e):null}function d(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e}const m=c,f=d;Object.freeze(Object.defineProperty({__proto__:null,add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e},adjoint:l,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},determinant:function(e){const t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8];return t*(c*o-s*l)+n*(-c*i+s*a)+r*(l*i-o*a)},equals:function(e,t){const n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],p=t[0],d=t[1],m=t[2],f=t[3],y=t[4],g=t[5],_=t[6],x=t[7],v=t[8],M=(0,r.FD)();return Math.abs(n-p)<=M*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(i-d)<=M*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-m)<=M*Math.max(1,Math.abs(o),Math.abs(m))&&Math.abs(s-f)<=M*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-y)<=M*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(l-g)<=M*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-_)<=M*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-x)<=M*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(h-v)<=M*Math.max(1,Math.abs(h),Math.abs(v))},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromMat4:i,fromQuat:h,fromRotation:function(e,t){const n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},invert:a,isOrthoNormal:function(e){const t=(0,r.FD)(),n=e[0],i=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8];return Math.abs(1-(n*n+s*s+c*c))<=t&&Math.abs(1-(i*i+a*a+u*u))<=t&&Math.abs(1-(o*o+l*l+h*h))<=t},mul:m,multiply:c,multiplyScalar:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e},multiplyScalarAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e},normalFromMat4:p,normalFromMat4Legacy:function(e,t){const n=t[0],r=t[1],i=t[2],o=t[4],s=t[5],a=t[6],l=t[8],c=t[9],u=t[10],h=u*s-a*c,p=-u*o+a*l,d=c*o-s*l,m=n*h+r*p+i*d;if(!m)return null;const f=1/m;return e[0]=h*f,e[1]=(-u*r+i*c)*f,e[2]=(a*r-i*s)*f,e[3]=p*f,e[4]=(u*n-i*l)*f,e[5]=(-a*n+i*o)*f,e[6]=d*f,e[7]=(-c*n+r*l)*f,e[8]=(s*n-r*o)*f,e},projection:function(e,t,n){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/n,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},rotate:function(e,t,n){const r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=Math.sin(n),d=Math.cos(n);return e[0]=d*r+p*s,e[1]=d*i+p*a,e[2]=d*o+p*l,e[3]=d*s-p*r,e[4]=d*a-p*i,e[5]=d*l-p*o,e[6]=c,e[7]=u,e[8]=h,e},scale:u,scaleByVec2:function(e,t,n){const r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e},set:o,str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},sub:f,subtract:d,translate:function(e,t,n){const r=t[0],i=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=n[0],d=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=p*r+d*s+c,e[7]=p*i+d*a+u,e[8]=p*o+d*l+h,e},transpose:s},Symbol.toStringTag,{value:"Module"}))},37585:(e,t,n)=>{n.d(t,{Cc:()=>f,Io:()=>u,S8:()=>m,WQ:()=>o,e$:()=>g,hZ:()=>i,hs:()=>c,jb:()=>x,l0:()=>y});var r=n(34304);function i(e,t,n){return e[0]=t,e[1]=n,e}function o(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function s(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e}function a(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e}function l(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e}function c(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function u(e,t){const n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)}function h(e,t){const n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function p(e){const t=e[0],n=e[1];return Math.sqrt(t*t+n*n)}function d(e){const t=e[0],n=e[1];return t*t+n*n}function m(e,t){const n=t[0],r=t[1];let i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e}function f(e,t,n,r){const i=t[0],o=t[1];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e}function y(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e}function g(e,t,n,r){const i=t[0]-n[0],o=t[1]-n[1],s=Math.sin(r),a=Math.cos(r);return e[0]=i*a-o*s+n[0],e[1]=i*s+o*a+n[1],e}const _=p,x=s,v=a,M=l,w=u,b=h,S=d;Object.freeze(Object.defineProperty({__proto__:null,add:o,angle:function(e,t){const n=e[0],r=e[1],i=t[0],o=t[1];let s=n*n+r*r;s>0&&(s=1/Math.sqrt(s));let a=i*i+o*o;a>0&&(a=1/Math.sqrt(a));const l=(n*i+r*o)*s*a;return l>1?0:l<-1?Math.PI:Math.acos(l)},ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},cross:function(e,t,n){const r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e},dist:w,distance:u,div:M,divide:l,dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},equals:function(e,t){const n=e[0],i=e[1],o=t[0],s=t[1],a=(0,r.FD)();return Math.abs(n-o)<=a*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=a*Math.max(1,Math.abs(i),Math.abs(s))},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]},floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},inverse:function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},len:_,length:p,lerp:f,max:function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e},min:function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},mul:v,multiply:a,negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},normalize:m,projectAndScale:function(e,t,n,r,i){let o=t[0]-n[0],s=t[1]-n[1];const a=(r[0]*o+r[1]*s)*(i-1);return o=r[0]*a,s=r[1]*a,e[0]=t[0]+o,e[1]=t[1]+s,e},random:function(e,t){t=t||1;const n=2*(0,r.Ov)()*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e},rotate:g,round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},scale:c,scaleAndAdd:function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},set:i,sqrDist:b,sqrLen:S,squaredDistance:h,squaredLength:d,str:function(e){return"vec2("+e[0]+", "+e[1]+")"},sub:x,subtract:s,transformMat2:function(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e},transformMat2d:y,transformMat3:function(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e},transformMat4:function(e,t,n){const r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e}},Symbol.toStringTag,{value:"Module"}))},75503:(e,t,n)=>{n.d(t,{w:()=>s});var r=n(4576),i=(n(44208),n(3694)),o=n(11006);class s{constructor(e=9,t){this._compareMinX=h,this._compareMinY=p,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),v.prune(),M.prune(),w.prune(),b.prune()}all(e){a(this._data,e)}search(e,t){let n=this._data;const r=this._toBBox;if(_(e,n))for(v.clear();n;){for(let i=0,o=n.children.length;i<o;i++){const o=n.children[i],s=n.leaf?r(o):o;_(e,s)&&(n.leaf?t(o):g(e,s)?a(o,t):v.push(o))}n=v.pop()}}collides(e){let t=this._data;const n=this._toBBox;if(!_(e,t))return!1;for(v.clear();t;){for(let r=0,i=t.children.length;r<i;r++){const i=t.children[r],o=t.leaf?n(i):i;if(_(e,o)){if(t.leaf||g(e,o))return!0;v.push(i)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,n=e.length;t<n;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new I([]),this}remove(e){if(!e)return this;let t,n=this._data,i=null,o=0,s=!1;const a=this._toBBox(e);for(w.clear(),b.clear();n||w.length>0;){if(n||(n=w.pop(),i=w.data[w.length-1],o=b.pop()??0,s=!0),n.leaf&&(t=(0,r.qh)(n.children,e,n.children.length,n.indexHint),-1!==t))return n.children.splice(t,1),w.push(n),this._condense(w),this;s||n.leaf||!g(n,a)?i?(o++,n=i.children[o],s=!1):n=null:(w.push(n),b.push(o),o=0,i=n,n=n.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,n,r){const i=n-t+1;let o=this._maxEntries;if(i<=o){const r=new I(e.slice(t,n+1));return l(r,this._toBBox),r}r||(r=Math.ceil(Math.log(i)/Math.log(o)),o=Math.ceil(i/o**(r-1)));const s=new P([]);s.height=r;const a=Math.ceil(i/o),c=a*Math.ceil(Math.sqrt(o));x(e,t,n,c,this._compareMinX);for(let i=t;i<=n;i+=c){const t=Math.min(i+c-1,n);x(e,i,t,a,this._compareMinY);for(let n=i;n<=t;n+=a){const i=Math.min(n+a-1,t);s.children.push(this._build(e,n,i,r-1))}}return l(s,this._toBBox),s}_insert(e,t,n){const r=this._toBBox,i=n?e:r(e);w.clear();const o=function(e,t,n,r){for(;r.push(t),!0!==t.leaf&&r.length-1!==n;){let n,r=1/0,i=1/0;for(let o=0,s=t.children.length;o<s;o++){const s=t.children[o],a=d(s),l=f(e,s)-a;l<i?(i=l,r=a<r?a:r,n=s):l===i&&a<r&&(r=a,n=s)}t=n||t.children[0]}return t}(i,this._data,t,w);for(o.children.push(e),u(o,i);t>=0&&w.data[t].children.length>this._maxEntries;)this._split(w,t),t--;!function(e,t,n){for(let r=n;r>=0;r--)u(t.data[r],e)}(i,w,t)}_split(e,t){const n=e.data[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r);if(!o)return;const s=n.children.splice(o,n.children.length-o),a=n.leaf?new I(s):new P(s);a.height=n.height,l(n,this._toBBox),l(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this._data=new P([e,t]),this._data.height=e.height+1,l(this._data,this._toBBox)}_chooseSplitIndex(e,t,n){let r,i,o;r=i=1/0;for(let s=t;s<=n-t;s++){const t=c(e,0,s,this._toBBox),a=c(e,s,n,this._toBBox),l=y(t,a),u=d(t)+d(a);l<r?(r=l,o=s,i=u<i?u:i):l===r&&u<i&&(i=u,o=s)}return o}_chooseSplitAxis(e,t,n){const r=e.leaf?this._compareMinX:h,i=e.leaf?this._compareMinY:p;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);const i=this._toBBox,o=c(e,0,t,i),s=c(e,n-t,n,i);let a=m(o)+m(s);for(let r=t;r<n-t;r++){const t=e.children[r];u(o,e.leaf?i(t):t),a+=m(o)}for(let r=n-t-1;r>=t;r--){const t=e.children[r];u(s,e.leaf?i(t):t),a+=m(s)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const n=e.data[t];if(0===n.children.length)if(t>0){const i=e.data[t-1],o=i.children;o.splice((0,r.qh)(o,n,o.length,i.indexHint),1)}else this.clear();else l(n,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function a(e,t){let n=e;for(M.clear();n;){if(!0===n.leaf)for(const e of n.children)t(e);else M.pushArray(n.children);n=M.pop()??null}}function l(e,t){c(e,0,e.children.length,t,e)}function c(e,t,n,r,i){i||(i=new I([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o,s=t;s<n;s++)o=e.children[s],u(i,e.leaf?r(o):o);return i}function u(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function h(e,t){return e.minX-t.minX}function p(e,t){return e.minY-t.minY}function d(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function m(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function y(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function _(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function x(e,t,n,r,i){const s=[t,n];for(;s.length;){const t=s.pop(),n=s.pop();if(t-n<=r)continue;const a=n+Math.ceil((t-n)/r/2)*r;(0,o.q)(e,a,n,t,i),s.push(n,a,a,t)}}const v=new i.A,M=new i.A,w=new i.A,b=new i.A({deallocator:void 0});class S{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class A extends S{constructor(){super(...arguments),this.height=1,this.indexHint=new r.vW}}class I extends A{constructor(e){super(),this.children=e,this.leaf=!0}}class P extends A{constructor(e){super(),this.children=e,this.leaf=!1}}},36708:(e,t,n)=>{n.d(t,{C_:()=>p,OH:()=>f,Vh:()=>y,on:()=>h,pc:()=>g,wB:()=>l,z7:()=>c}),n(60999),n(5503);var r=n(37955),i=n(36563),o=n(97768),s=n(74887),a=n(14012);function l(e,t,n={}){return u(e,t,n,d)}function c(e,t,n={}){return u(e,t,n,m)}function u(e,t,n={},r){let i=null;const s=n.once?(e,n)=>{r(e)&&((0,o.xt)(i),t(e,n))}:(e,n)=>{r(e)&&t(e,n)};if(i=(0,a.Cn)(e,s,n.sync,n.equals),n.initial){const t=e();s(t,t)}return i}function h(e,t,n,s={}){let a=null,c=null,u=null;function h(){a&&c&&(c.remove(),s.onListenerRemove?.(a),a=null,c=null)}function p(e){s.once&&s.once&&(0,o.xt)(u),n(e)}const d=l(e,((e,n)=>{h(),(0,r.wb)(e)&&(a=e,c=(0,r.on)(e,t,p),s.onListenerAdd?.(e))}),{sync:s.sync,initial:!0});return u=(0,i.hA)((()=>{d.remove(),h()})),u}function p(e,t){return function(e,t,n){if((0,s.G4)(n))return Promise.reject((0,s.NK)());const r=e();if(t?.(r))return Promise.resolve(r);let a=null;function l(){a=(0,o.xt)(a)}return new Promise(((r,o)=>{a=(0,i.vE)([(0,s.u7)(n,(()=>{l(),o((0,s.NK)())})),u(e,(e=>{l(),r(e)}),{sync:!1,once:!0},t??d)])}))}(e,m,t)}function d(e){return!0}function m(e){return!!e}n(80559);const f={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},13069:(e,t,n)=>{n.d(t,{lk:()=>i,vD:()=>s,yS:()=>o});const r="randomUUID"in crypto;function i(){if(r)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function o(){return`{${i().toUpperCase()}}`}function s(){return`{${i()}}`}},80754:(e,t,n)=>{n.d(t,{j7:()=>s,kS:()=>l,kd:()=>a,r8:()=>c});var r=n(82799),i=n(16930),o=n(65864);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator}),minus180Line:new r.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:i.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.A({paths:[[[180,-180],[180,180]]],spatialReference:i.A.WGS84}),minus180Line:new r.A({paths:[[[-180,-180],[-180,180]]],spatialReference:i.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const n=c(e);for(const e of n)for(const n of e)n[0]+=t;return e}function c(e){return(0,o.Bi)(e)?e.rings:e.paths}},4146:(e,t,n)=>{n.d(t,{A:()=>v});var r=n(90237),i=(n(59456),n(78888)),o=n(60945),s=n(49186),a=n(65529),l=n(4902),c=n(92474),u=n(53966),h=n(74887),p=n(84952),d=n(10107),m=(n(44208),n(87811),n(40608)),f=n(92602),y=n(5443),g=n(16930);let _=0,x=class extends(a.A.EventedMixin((0,l.sA)(c.A))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y.A(-180,-90,180,90,g.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+_++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=g.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await n.e(7982).then(n.bind(n,27982))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:r}=await n.e(5613).then(n.bind(n,45613));try{return await r(t)}catch(e){const n=t?.portalItem,r=n?.id||"unset",i=n?.portal?.url||f.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+r+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,h.zf)(e)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,p.An)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,i.A)(e,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,r._)([(0,d.MZ)({type:String})],x.prototype,"attributionDataUrl",void 0),(0,r._)([(0,d.MZ)({type:y.A})],x.prototype,"fullExtent",void 0),(0,r._)([(0,d.MZ)({readOnly:!0})],x.prototype,"hasAttributionData",null),(0,r._)([(0,d.MZ)({type:String,clonable:!1})],x.prototype,"id",void 0),(0,r._)([(0,d.MZ)({type:Boolean,nonNullable:!0})],x.prototype,"legendEnabled",void 0),(0,r._)([(0,d.MZ)({type:["show","hide","hide-children"]})],x.prototype,"listMode",void 0),(0,r._)([(0,d.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],x.prototype,"opacity",void 0),(0,r._)([(0,d.MZ)({clonable:!1})],x.prototype,"parent",void 0),(0,r._)([(0,d.MZ)({readOnly:!0})],x.prototype,"parsedUrl",null),(0,r._)([(0,d.MZ)({type:Boolean,readOnly:!0})],x.prototype,"persistenceEnabled",void 0),(0,r._)([(0,d.MZ)({type:Boolean})],x.prototype,"popupEnabled",void 0),(0,r._)([(0,d.MZ)({type:Boolean})],x.prototype,"attributionVisible",void 0),(0,r._)([(0,d.MZ)({type:g.A})],x.prototype,"spatialReference",void 0),(0,r._)([(0,d.MZ)({type:String})],x.prototype,"title",void 0),(0,r._)([(0,d.MZ)({readOnly:!0,json:{read:!1}})],x.prototype,"type",void 0),(0,r._)([(0,d.MZ)()],x.prototype,"url",void 0),(0,r._)([(0,d.MZ)({type:o.A})],x.prototype,"visibilityTimeExtent",void 0),(0,r._)([(0,d.MZ)({type:Boolean,nonNullable:!0})],x.prototype,"visible",void 0),x=(0,r._)([(0,m.$)("esri.layers.Layer")],x);const v=x},87899:(e,t,n)=>{n.r(t),n.d(t,{default:()=>mt});var r=n(90237),i=n(5503),o=n(49186),s=n(53966),a=n(92071),l=n(74887),c=n(10107),u=n(79901),h=(n(87811),n(44208),n(36005)),p=n(40608),d=n(43937),m=n(35666),f=n(4146),y=n(63074),g=n(16131),_=n(8303),x=n(25036),v=n(69540),M=n(25482),w=n(77690),b=n(29242),S=n(37585),A=n(38954);const I=(0,n(51850).vt)(),P=(0,b.vt)(),L=(0,b.vt)(),T=(0,b.vt)();function O(e,t,n){return(0,A.s)(I,t[0],t[1],1),(0,A.t)(I,I,(0,w.mg)(P,n)),0===I[2]?(0,S.hZ)(e,I[0],I[1]):(0,S.hZ)(e,I[0]/I[2],I[1]/I[2])}function E(e,t,n){return R(L,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),R(T,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),(0,w.lw)(e,(0,w.KC)(L,L),T),0!==e[8]&&(e[0]/=e[8],e[1]/=e[8],e[2]/=e[8],e[3]/=e[8],e[4]/=e[8],e[5]/=e[8],e[6]/=e[8],e[7]/=e[8],e[8]/=e[8]),e}function R(e,t,n,r,i,o,s,a,l){(0,w.hZ)(e,t,r,o,n,i,s,1,1,1),(0,A.s)(I,a,l,1),(0,w.KC)(P,e);const[c,u,h]=(0,A.t)(I,I,(0,w.mg)(P,P));return(0,w.hZ)(P,c,0,0,0,u,0,0,0,h),(0,w.lw)(e,P,e)}var B=n(90629),Z=n(48163),G=n(86738),C=n(39829),j=n(57251),U=n(16930);let N=class extends v.P{projectOrWarn(e,t){if(null==e)return e;const{geometry:n,pending:r}=(0,j.projectOrLoad)(e,t);return r?null:r||n?n:(s.A.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};N=(0,r._)([(0,p.$)("esri.layers.support.GeoreferenceBase")],N);const $=N,Y=(0,b.vt)(),D=(0,Z.vt)();let X=class extends M.oY{};(0,r._)([(0,c.MZ)({type:Number,json:{write:!0}})],X.prototype,"x",void 0),(0,r._)([(0,c.MZ)({type:Number,json:{write:!0}})],X.prototype,"y",void 0),X=(0,r._)([(0,p.$)("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],X);let H=class extends v.P{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};(0,r._)([(0,c.MZ)()],H.prototype,"sourcePoint",void 0),(0,r._)([(0,c.MZ)({type:G.A})],H.prototype,"mapPoint",void 0),H=(0,r._)([(0,p.$)("esri.layers.support.ControlPointsGeoreference.ControlPoint")],H);let F=class extends((0,M.Te)($)){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=U.A.fromJSON(t.spatialReference),r=(0,b.fA)(...t.coefficients,1);return e.map((e=>((0,S.hZ)(D,e.x,e.y),O(D,D,r),{sourcePoint:e,mapPoint:new G.A({x:D[0],y:D[1],spatialReference:n})})))}writeControlPoints(e,t,n,r){if(null!=this.transform)null!=e&&V(e[0])&&(t.controlPoints=e.map((e=>{const t=e.sourcePoint;return{x:t.x,y:t.y}})),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const e=new o.A("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration.",{layer:r?.layer,georeference:this});r?.messages?r.messages.push(e):s.A.getLogger(this).error(e.name,e.message)}}get coords(){if(null==this.controlPoints)return null;const e=this._updateTransform(Y);if(null==e||!V(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return function(e,t,n,r){const i=(0,Z.fA)(0,n),o=(0,Z.fA)(0,0),s=(0,Z.fA)(t,0),a=(0,Z.fA)(t,n);return O(i,i,e),O(o,o,e),O(s,s,e),O(a,a,e),new C.A({rings:[[i,o,s,a,i]],spatialReference:r})}(e,this.width,this.height,t)}set coords(e){if(null==this.controlPoints||!V(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if(null==(e=this.projectOrWarn(e,t)))return;const{width:n,height:r}=this,{rings:[[i,o,s,a]]}=e,l={sourcePoint:(0,B.tc)(0,r),mapPoint:new G.A({x:i[0],y:i[1],spatialReference:t})},c={sourcePoint:(0,B.tc)(0,0),mapPoint:new G.A({x:o[0],y:o[1],spatialReference:t})},u={sourcePoint:(0,B.tc)(n,0),mapPoint:new G.A({x:s[0],y:s[1],spatialReference:t})},h={sourcePoint:(0,B.tc)(n,r),mapPoint:new G.A({x:a[0],y:a[1],spatialReference:t})};V(l)&&V(c)&&V(u)&&V(h)&&(re(Y,l,c,u,h),this.controlPoints=this.controlPoints.map((({sourcePoint:e})=>((0,S.hZ)(D,e.x,e.y),O(D,D,Y),{sourcePoint:e,mapPoint:new G.A({x:D[0],y:D[1],spatialReference:t})}))))}get inverseTransform(){return null==this.transform?null:(0,w.B8)((0,b.vt)(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(null==e||null==this.transform||null==this.controlPoints||!V(this.controlPoints[0]))return null;(0,S.hZ)(D,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return O(D,D,this.transform),new G.A({x:D[0],y:D[1],spatialReference:t})}toSource(e){if(null==e||null==this.inverseTransform||null==this.controlPoints||!V(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),null==(e=(0,j.projectOrLoad)(e,t).geometry)?null:((0,S.hZ)(D,e.x,e.y),O(D,D,this.inverseTransform),(0,B.tc)(D[0],D[1]))}toSourceNormalized(e){const t=this.toSource(e);return null!=t&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:r}=this;if(!(null!=t&&n>0&&r>0))return null;const[i,o,s,a]=t;if(!V(i))return null;const l=i.mapPoint.spatialReference,c=this._projectControlPoint(o,l),u=this._projectControlPoint(s,l),h=this._projectControlPoint(a,l);if(!c.valid||!u.valid||!h.valid)return null;if(!V(c.controlPoint))return null;null==e&&(e=(0,b.vt)());let p=null;return p=V(u.controlPoint)&&V(h.controlPoint)?re(e,i,c.controlPoint,u.controlPoint,h.controlPoint):V(u.controlPoint)?function(e,t,n,r){return ne(W,K,t),ne(z,J,n),ne(k,Q,r),(0,S.Cc)(q,W,z,.5),(0,S.e$)(q,k,q,Math.PI),(0,S.Cc)(ee,K,J,.5),(0,S.e$)(ee,Q,ee,Math.PI),ae(e,W,z,k,q,K,J,Q,ee)}(e,i,c.controlPoint,u.controlPoint):function(e,t,n){return ne(W,K,t),ne(z,J,n),(0,S.e$)(k,z,W,te),(0,S.e$)(q,W,z,te),(0,S.e$)(Q,J,K,-te),(0,S.e$)(ee,K,J,-te),ae(e,W,z,k,q,K,J,Q,ee)}(e,i,c.controlPoint),p.every((e=>0===e))?null:p}_projectControlPoint(e,t){if(!V(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:r}=e,{geometry:i,pending:o}=(0,j.projectOrLoad)(r,t);return o?{valid:!1,controlPoint:null}:o||i?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:i}}:(s.A.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:r.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function V(e){return null!=e?.sourcePoint&&null!=e.mapPoint}(0,r._)([(0,c.MZ)({type:[H],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[X]},coefficients:{type:[Number]},spatialReference:{type:U.A}}}}})],F.prototype,"controlPoints",void 0),(0,r._)([(0,h.w)("controlPoints")],F.prototype,"readControlPoints",null),(0,r._)([(0,d.K)("controlPoints")],F.prototype,"writeControlPoints",null),(0,r._)([(0,c.MZ)({clonable:!1})],F.prototype,"coords",null),(0,r._)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],F.prototype,"height",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],F.prototype,"inverseTransform",null),(0,r._)([(0,c.MZ)({readOnly:!0})],F.prototype,"transform",null),(0,r._)([(0,c.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],F.prototype,"width",void 0),F=(0,r._)([(0,p.$)("esri.layers.support.ControlPointsGeoreference")],F);const W=(0,Z.vt)(),z=(0,Z.vt)(),k=(0,Z.vt)(),q=(0,Z.vt)(),K=(0,Z.vt)(),J=(0,Z.vt)(),Q=(0,Z.vt)(),ee=(0,Z.vt)(),te=Math.PI/2;function ne(e,t,n){(0,S.hZ)(e,n.sourcePoint.x,n.sourcePoint.y),(0,S.hZ)(t,n.mapPoint.x,n.mapPoint.y)}function re(e,t,n,r,i){return ne(W,K,t),ne(z,J,n),ne(k,Q,r),ne(q,ee,i),ae(e,W,z,k,q,K,J,Q,ee)}const ie=new Array(8).fill(0),oe=new Array(8).fill(0);function se(e,t,n,r,i){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=r[0],e[5]=r[1],e[6]=i[0],e[7]=i[1],e}function ae(e,t,n,r,i,o,s,a,l){return E(e,se(ie,t,n,r,i),se(oe,o,s,a,l))}const le=F;var ce=n(78888),ue=n(43668),he=n(84952),pe=n(13069),de=n(4902),me=n(92474);const fe=(0,Z.vt)();let ye=class extends ${constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:r}=this;if(null==e||null==t||null==n||null==r)return null;const i=e.spatialReference;return t=this.projectOrWarn(t,i),n=this.projectOrWarn(n,i),r=this.projectOrWarn(r,i),null==t||null==n||null==r?null:new C.A({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[r.x,r.y],[n.x,n.y]]],spatialReference:i})}set coords(e){const{topLeft:t}=this;if(null==t)return;const n=t.spatialReference;if(null==(e=this.projectOrWarn(e,n)))return;const{rings:[[r,i,o,s]]}=e;this.bottomLeft=new G.A({x:r[0],y:r[1],spatialReference:n}),this.topLeft=new G.A({x:i[0],y:i[1],spatialReference:n}),this.topRight=new G.A({x:o[0],y:o[1],spatialReference:n}),this.bottomRight=new G.A({x:s[0],y:s[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:r,bottomLeft:i}=this;if(null==e||null==t||null==n||null==r||null==i)return null;const o=t.spatialReference;e=e.normalize();const s=(0,j.projectOrLoad)(e,o).geometry;if(null==s)return null;(0,S.hZ)(fe,s.x,s.y);const a=E((0,b.vt)(),[t.x,t.y,i.x,i.y,n.x,n.y,r.x,r.y],[0,0,0,1,1,0,1,1]);return O(fe,fe,a),(0,B.tc)(fe[0],fe[1])}};(0,r._)([(0,c.MZ)({clonable:!1})],ye.prototype,"coords",null),(0,r._)([(0,c.MZ)({type:G.A})],ye.prototype,"bottomLeft",void 0),(0,r._)([(0,c.MZ)({type:G.A})],ye.prototype,"bottomRight",void 0),(0,r._)([(0,c.MZ)({type:G.A})],ye.prototype,"topLeft",void 0),(0,r._)([(0,c.MZ)({type:G.A})],ye.prototype,"topRight",void 0),ye=(0,r._)([(0,p.$)("esri.layers.support.CornersGeoreference")],ye);const ge=ye;var _e=n(34727),xe=n(34304),ve=n(5443);let Me=class extends ${constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(null==this.extent)return null;const{xmin:e,ymin:t,xmax:n,ymax:r,spatialReference:i}=this.extent;let o;if(this.rotation){const{x:i,y:s}=this.extent.center,a=we(i,s,this.rotation);o=[a(e,t),a(e,r),a(n,r),a(n,t)],o.push(o[0])}else o=[[e,t],[e,r],[n,r],[n,t],[e,t]];return new C.A({rings:[o],spatialReference:i})}set coords(e){if(null==e||null==this.extent)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),null==e?.extent)return;const{rings:[[n,r,i]],extent:{center:{x:o,y:s}}}=e,a=(0,_e.KJ)(Math.PI/2-Math.atan2(r[1]-n[1],r[0]-n[0])),l=we(o,s,-a),[c,u]=l(n[0],n[1]),[h,p]=l(i[0],i[1]);this.extent=new ve.A({xmin:c,ymin:u,xmax:h,ymax:p,spatialReference:t}),this.rotation=a}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(null==e||null==t)return null;const{xmin:r,ymin:i,xmax:o,ymax:s,center:a,spatialReference:l}=t;e=e.normalize();const c=(0,j.projectOrLoad)(e,l).geometry;if(null==c)return null;let u=c.x,h=c.y;return n&&([u,h]=we(a.x,a.y,-n)(u,h)),(0,B.tc)((0,_e.hs)(u,r,o,0,1),(0,_e.hs)(h,s,i,0,1))}};function we(e,t,n){const r=(0,xe.DF)(n),i=Math.cos(r),o=Math.sin(r);return(n,r)=>[i*(n-e)+o*(r-t)+e,i*(r-t)-o*(n-e)+t]}(0,r._)([(0,c.MZ)({clonable:!1})],Me.prototype,"coords",null),(0,r._)([(0,c.MZ)({type:ve.A})],Me.prototype,"extent",void 0),(0,r._)([(0,c.MZ)({type:Number})],Me.prototype,"rotation",void 0),Me=(0,r._)([(0,p.$)("esri.layers.support.ExtentAndRotationGeoreference")],Me);const be=Me;n(59456);var Se=n(21325);function Ae(e,t){const n=(0,m.aB)(t);return function(e){return"media"===e?.type}(e)&&!!e.portalItem&&null!=n&&n>m.Gr.PORTAL_ITEM}const Ie={key:"type",base:$,typeMap:{"control-points":le,corners:ge,"extent-and-rotation":be}},Pe={key:"type",base:$,typeMap:{"control-points":le}};let Le=class extends((0,de.PH)((0,a.P)(me.A))){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return le.fromJSON(e)}writeGeoreference(e,t,n,r){const i=r?.resources?.pendingOperations,a=()=>{const i=function(e,t,n){if(!e||"control-points"===e.type)return e;const{coords:r}=e;if(5!==r?.rings[0]?.length)return null;const[i,o,s,a]=r.rings[0],{spatialReference:l}=r;return new le({controlPoints:[{mapPoint:new G.A({x:i[0],y:i[1],spatialReference:l}),sourcePoint:(0,B.tc)(0,n)},{mapPoint:new G.A({x:o[0],y:o[1],spatialReference:l}),sourcePoint:(0,B.tc)(0,0)},{mapPoint:new G.A({x:s[0],y:s[1],spatialReference:l}),sourcePoint:(0,B.tc)(t,0)},{mapPoint:new G.A({x:a[0],y:a[1],spatialReference:l}),sourcePoint:(0,B.tc)(t,n)}],width:t,height:n})}(this.georeference,this.contentWidth,this.contentHeight);if(i){if("control-points"!==e.type&&s.A.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),4!==i.controlPoints?.length&&r?.messages)return void r.messages.push(new o.A("property:unsupported","only 'control-points' georeference with 4 control points may be persisted."));t[n]=i.write({},r)}};if("control-points"!==e.type&&!this.loaded&&i)return t[n]={},void i.push(this.load().then(a));a()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:r}=this;if(null==e||null==t||0===n||0===r)return null;const i=t.toSourceNormalized(e);return null==i?null:(i.x*=n,i.y*=r,i)}};(0,r._)([(0,c.MZ)({types:Ie,json:{write:!0,types:Pe}})],Le.prototype,"georeference",void 0),(0,r._)([(0,h.w)("georeference")],Le.prototype,"readGeoreference",null),(0,r._)([(0,d.K)("georeference")],Le.prototype,"writeGeoreference",null),(0,r._)([(0,c.MZ)({json:{read:!1,write:!1}})],Le.prototype,"opacity",void 0),Le=(0,r._)([(0,p.$)("esri.layers.support.MediaElementBase")],Le);const Te=Le;var Oe=n(85648),Ee=n(97159);let Re=class extends Te{constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const e=this.image;if("string"==typeof e){const t=(0,ue.M5)(e).then((e=>{this._set("content",e)}));this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then((()=>{this._set("content",e)}));this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new o.A("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return null==this.content?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return(0,Ee.f)(t.url,n)}writeImage(e,t,n,r){if(null==e)return;const i=r?.portalItem,o=r?.resources;if(!i||!o)return void("string"==typeof e&&(t[n]=(0,Ee.t)(e,r)));const s=function(e){return"string"==typeof e&&!(0,he.DB)(e)&&!(0,he.w8)(e)}(e)?e:null;if(s){if(null==(0,Ee.i)(s))return void(t[n]=s);const e=(0,Ee.t)(s,{...r,verifyItemRelativeUrls:r?.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},Ee.M.NO);if(i&&e&&!(0,he.oP)(e))return o.toKeep.push({resource:i.resourceFromPath(e),compress:!1}),void(t[n]=e)}t[n]="<pending>",o.pendingOperations.push(async function(e){return"string"==typeof e?(0,he.DB)(e)?(0,he.N9)(e):(await(0,ce.A)(e,{responseType:"blob"})).data:new Promise((t=>function(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,r=document.createElement("canvas"),i=r.getContext("2d");return r.width=t,r.height=n,e instanceof HTMLImageElement?i.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&i.putImageData(e,0,0),r}(e).toBlob(t)))}(e).then((e=>{const r=function(e,t){const n=(0,pe.lk)(),r=`${(0,he.fj)("media",n)}.${(0,Oe.n)({type:"blob",blob:e})}`;return t.resourceFromPath(r)}(e,i);t[n]=r.itemRelativeUrl,o.toAdd.push({resource:r,content:{type:"blob",blob:e},compress:!1,finish:e=>{this.image=e.url}})})))}write(e,t){const n=super.write(e,t);return"mediaType"in n&&!n.url&&delete n.mediaType,n}};(0,r._)([(0,c.MZ)()],Re.prototype,"animationOptions",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],Re.prototype,"content",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],Re.prototype,"contentWidth",null),(0,r._)([(0,c.MZ)({readOnly:!0})],Re.prototype,"contentHeight",null),(0,r._)([(0,c.MZ)({json:{name:"url",type:String,write:{overridePolicy:(e,t,n)=>({enabled:!Ae(n?.layer,n?.origin)})}}})],Re.prototype,"image",void 0),(0,r._)([(0,h.w)("image",["url"])],Re.prototype,"readImage",null),(0,r._)([(0,d.K)("image")],Re.prototype,"writeImage",null),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:{target:"mediaType",ignoreOrigin:!0}}})],Re.prototype,"type",void 0),Re=(0,r._)([(0,p.$)("esri.layers.support.ImageElement")],Re);const Be=Re;var Ze=n(62885),Ge=n(65529),Ce=n(61893),je=n(36708),Ue=n(19419),Ne=n(12176),$e=n(6518),Ye=n(69622),De=n(537),Xe=n(95108),He=n(65864),Fe=n(80754);function Ve(e,t,n){if(Array.isArray(e)){const r=e[0];if(r>t){const n=(0,Fe.kd)(r,t);e[0]=r+n*(-2*t)}else if(r<n){const t=(0,Fe.kd)(r,n);e[0]=r+t*(-2*n)}}else{const r=e.x;if(r>t){const n=(0,Fe.kd)(r,t);e.x+=n*(-2*t)}else if(r<n){const t=(0,Fe.kd)(r,n);e.x+=t*(-2*n)}}return e}function We(e,t){const n=[],{ymin:r,ymax:i,xmin:o,xmax:s}=e,a=e.xmax-e.xmin,[l,c]=t.valid,{x:u,frameId:h}=ze(e.xmin,t),{x:p,frameId:d}=ze(e.xmax,t),m=u===p&&a>0;if(a>2*c){const e={xmin:o<s?u:p,ymin:r,xmax:c,ymax:i},t={xmin:l,ymin:r,xmax:o<s?p:u,ymax:i},a={xmin:0,ymin:r,xmax:c,ymax:i},m={xmin:l,ymin:r,xmax:0,ymax:i},f=[],y=[];ke(e,a)&&f.push(h),ke(e,m)&&y.push(h),ke(t,a)&&f.push(d),ke(t,m)&&y.push(d);for(let e=h+1;e<d;e++)f.push(e),y.push(e);n.push(new Je(e,[h]),new Je(t,[d]),new Je(a,f),new Je(m,y))}else u>p||m?n.push(new Je({xmin:u,ymin:r,xmax:c,ymax:i},[h]),new Je({xmin:l,ymin:r,xmax:p,ymax:i},[d])):n.push(new Je({xmin:u,ymin:r,xmax:p,ymax:i},[h]));return n}function ze(e,t){const[n,r]=t.valid,i=2*r;let o,s=0;return e>r?(o=Math.ceil(Math.abs(e-r)/i),e-=o*i,s=o):e<n&&(o=Math.ceil(Math.abs(e-n)/i),e+=o*i,s=-o),{x:e,frameId:s}}function ke(e,t){const{xmin:n,ymin:r,xmax:i,ymax:o}=t;return qe(e,n,r)&&qe(e,n,o)&&qe(e,i,o)&&qe(e,i,r)}function qe(e,t,n){return t>=e.xmin&&t<=e.xmax&&n>=e.ymin&&n<=e.ymax}function Ke(e,t,n=!0){const r=!(0,He.Rg)(e);if(r&&(0,Xe.m3)(e),n)return(new et).cut(e,t);const i=r?e.rings:e.paths,o=r?4:2,s=i.length,a=-2*t;for(let e=0;e<s;e++){const t=i[e];if(t&&t.length>=o){const e=[];for(const n of t)e.push([n[0]+a,n[1]]);i.push(e)}}return r?e.rings=i:e.paths=i,e}class Je{constructor(e,t){this.extent=e,this.frameIds=t}}const Qe=(0,Ue.vt)();class et{constructor(){this._linesIn=[],this._linesOut=[]}cut(e,t){let n;if(this._xCut=t,e.rings)this._closed=!0,n=e.rings,this._minPts=4;else{if(!e.paths)return null;this._closed=!1,n=e.paths,this._minPts=2}for(const e of n){if(!e||e.length<this._minPts)continue;let t=!0;for(const n of e)t?(this.moveTo(n),t=!1):this.lineTo(n);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),n=[];for(const e of this._linesIn)e&&e.length>=this._minPts&&n.push(e);const r=-2*this._xCut;for(const e of this._linesOut)if(e&&e.length>=this._minPts){for(const t of e)t[0]+=r;n.push(e)}return this._closed?e.rings=n:e.paths=n,e}moveTo(e){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(e[0]),this._moveTo(e[0],e[1],this._prevSide),this._prevPt=e,this._firstPt=e}lineTo(e){const t=this._side(e[0]);if(t*this._prevSide==-1){const n=this._intersect(this._prevPt,e);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(e[0],e[1],t)}else this._lineTo(e[0],e[1],t);this._prevSide=t,this._prevPt=e}close(){const e=this._firstPt,t=this._prevPt;e[0]===t[0]&&e[1]===t[1]||this.lineTo(e),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(e,t,n){this._closed?(this._lineIn.push([n<=0?e:this._xCut,t]),this._lineOut.push([n>=0?e:this._xCut,t])):(n<=0&&this._lineIn.push([e,t]),n>=0&&this._lineOut.push([e,t]))}_lineTo(e,t,n){this._closed?(tt(this._lineIn,n<=0?e:this._xCut,t),tt(this._lineOut,n>=0?e:this._xCut,t)):n<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([e,t])):n>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([e,t])):this._prevSide<0?(this._lineIn.push([e,t]),this._lineOut.push([e,t])):this._prevSide>0&&(this._lineOut.push([e,t]),this._lineIn.push([e,t]))}_checkClosingPt(e){const t=e.length;t>3&&e[0][0]===this._xCut&&e[t-2][0]===this._xCut&&e[1][0]===this._xCut&&(e[0][1]=e[t-2][1],e.pop())}_side(e){return e<this._xCut?-1:e>this._xCut?1:0}_intersect(e,t){const n=(this._xCut-e[0])/(t[0]-e[0]);return e[1]+n*(t[1]-e[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}function tt(e,t,n){const r=e.length;r>1&&e[r-1][0]===t&&e[r-2][0]===t?e[r-1][1]=n:e.push([t,n])}let nt=class extends Ye.A{constructor(e){super(e)}get bounds(){const e=this.coords;return null==e?.extent?null:(0,Ue.VY)(e.extent)}get coords(){const e=this.element.georeference?.coords;return(0,j.projectOrLoad)(e,this.spatialReference).geometry}get normalizedCoords(){return C.A.fromJSON(function(e,t){if(null==e)return null;const n=e.spatialReference,r=(0,Se.Vp)(n),i=(0,M.Wj)(e)?e.toJSON():e;if(!r)return i;const o=(0,Se.K8)(n)?102100:4326,s=Fe.j7[o].maxX,a=Fe.j7[o].minX;if((0,He.fT)(i))return Ve(i,s,a);if((0,He.U9)(i))return i.points=i.points.map((e=>Ve(e,s,a))),i;if((0,He.ZC)(i))return function(e,t){if(!t)return e;const n=We(e,t).map((e=>e.extent));return n.length<2?n[0]||e:n.length>2?(e.xmin=t.valid[0],e.xmax=t.valid[1],e):{rings:n.map((e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]))}}(i,r);if((0,He.Bi)(i)||(0,He.Rg)(i)){const e=(0,De.Rg)(Qe,i),n={xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3]},r=(0,Fe.kd)(n.xmin,a)*(2*s),o=0===r?i:(0,Fe.kS)(i,r);return n.xmin+=r,n.xmax+=r,n.xmax>s?Ke(o,s,t):n.xmin<a?Ke(o,a,t):o}return i}(this.coords,!0))}get normalizedBounds(){const e=null!=this.normalizedCoords?this.normalizedCoords.extent:null;return null!=e?(0,Ue.VY)(e):null}};(0,r._)([(0,c.MZ)()],nt.prototype,"spatialReference",void 0),(0,r._)([(0,c.MZ)()],nt.prototype,"element",void 0),(0,r._)([(0,c.MZ)()],nt.prototype,"bounds",null),(0,r._)([(0,c.MZ)()],nt.prototype,"coords",null),(0,r._)([(0,c.MZ)()],nt.prototype,"normalizedCoords",null),(0,r._)([(0,c.MZ)()],nt.prototype,"normalizedBounds",null),nt=(0,r._)([(0,p.$)("esri.layers.support.MediaElementView")],nt);var rt=n(37955);let it=class extends Te{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;if("string"==typeof e){const t=document.createElement("video");t.src=e,t.crossOrigin="anonymous",t.autoplay=!0,t.muted=!0,t.loop=!0,t.playsInline=!0,this.addResolvingPromise(this._loadVideo(t).then((()=>{this._set("content",t)})))}else e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o.A("video-element:invalid-video-type","Invalid video type",{video:e})));return Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.A.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}_loadVideo(e){return new Promise(((t,n)=>{const r=(0,rt.Oo)(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()}));this.addHandles(r,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",e.src?.includes("blob:")||(e.src=e.src))}))}};(0,r._)([(0,c.MZ)()],it.prototype,"autoplay",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],it.prototype,"content",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],it.prototype,"contentWidth",null),(0,r._)([(0,c.MZ)({readOnly:!0})],it.prototype,"contentHeight",null),(0,r._)([(0,c.MZ)()],it.prototype,"video",null),it=(0,r._)([(0,p.$)("esri.layers.support.VideoElement")],it);const ot=it,st={key:"type",defaultKeyValue:"image",base:Te,typeMap:{image:Be,video:ot}},at=i.A.ofType(st);let lt=class extends(me.A.LoadableMixin((0,Ce.g)(Ge.A.EventedAccessor))){constructor(e){super(e),this._index=new $e.F,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=e=>{for(const t of e.removed){const e=this._elementViewsMap.get(t);this._elementViewsMap.delete(t),this._index.delete(e),this.removeHandles(e),e.destroy(),this.notifyChange("fullExtent")}const{spatialReference:t}=this;for(const n of e.added){if(this._elementViewsMap.get(n))continue;const e=new nt({spatialReference:t,element:n});this._elementViewsMap.set(n,e);const r=(0,je.wB)((()=>e.coords),(()=>this._updateIndexForElement(e,!1)));this._updateIndexForElement(e,!0),this.addHandles(r,e)}this._elementsIndexes.clear(),this.elements.forEach(((e,t)=>this._elementsIndexes.set(e,t))),this.emit("refresh")},this.elements=new at}async load(e){if((0,l.Te)(e),!this.spatialReference){const e=this.elements.find((e=>null!=e.georeference?.coords));this._set("spatialReference",e?e.georeference.coords.spatialReference:U.A.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",(0,Ze.V)(e,this._get("elements"),at))}get fullExtent(){if("not-loaded"===this.loadStatus)return null;const e=this._index.fullBounds;return null==e?null:new ve.A({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){"not-loaded"===this.loadStatus?this._set("spatialReference",e):s.A.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await(0,j.initializeProjection)(e.spatialReference,this.spatialReference,null,t);const n=(0,Se.aI)(e.spatialReference,this.spatialReference)?e:(0,j.project)(e,this.spatialReference);if(!n)return[];const r=n.normalize(),i=[];for(const e of r)this._index.forEachInBounds((0,Ue.VY)(e),(({normalizedCoords:t,element:n})=>{null!=t&&(0,Ne.fA)(e,t)&&i.push(n)}));return i.sort(((e,t)=>this._elementsIndexes.get(e)-this._elementsIndexes.get(t))),i}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,r=this._index.has(e),i=null!=n;this._index.delete(e),i&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(r!==i?this.emit("refresh"):this.emit("change",{element:e.element}))}};(0,r._)([(0,c.MZ)()],lt.prototype,"elements",null),(0,r._)([(0,c.MZ)({readOnly:!0})],lt.prototype,"fullExtent",null),(0,r._)([(0,c.MZ)()],lt.prototype,"spatialReference",null),lt=(0,r._)([(0,p.$)("esri.layers.support.LocalMediaElementSource")],lt);const ct=lt;var ut=n(92935);function ht(e){return"object"==typeof e&&null!=e&&"type"in e}function pt(e){return ht(e)&&"image"===e.type}let dt=class extends((0,y.dM)((0,x.j)((0,g.q)((0,_.A)((0,a.P)(f.A)))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=(0,l.sg)((async(e,t,r)=>{const{save:i,saveAs:o}=await n.e(3561).then(n.bind(n,63561));switch(e){case ut.X.SAVE:return i(this,t);case ut.X.SAVE_AS:return o(this,r,t)}})),this.source=new ct}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new o.A("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const r=ht(t)?new ct({elements:new i.A([t])}):t;this._set("effectiveSource",r),this.spatialReference&&(r.spatialReference=this.spatialReference),await r.load(e),this.spatialReference=r.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("source",e):s.A.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new ct({elements:new i.A(e)}):e instanceof i.A?new ct({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const r=this._createSource(t);return r?.read(t,n),r}writeSource(e,t,n,r){if(e&&e instanceof ct){const t=e.elements.length;if(1!==t)return void(r?.messages&&r.messages.push(new o.A("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${t}.`)));e=e.elements.at(0)}pt(e)?e.write(t,r):r?.messages&&(e?r.messages.push(new o.A("media-layer:unsupported-source","only media elements of type 'ImageElement' can be persisted")):r.messages.push(new o.A("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(ut.X.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ut.X.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Be;case"video":return new ot}return null}_getSourceOverride(e,t){if(ht(e)&&this.originIdOf("source")===m.Gr.PORTAL_ITEM&&t&&(this.originIdOf("georeference")===m.Gr.WEB_MAP||this.originIdOf("georeference")===m.Gr.WEB_SCENE)){const n=e.toJSON(),r=this._createSource(n);return r.read({...n},{origin:"portal-item"}),r.read({georeference:t},{origin:"web-map"}),r.read({georeference:t},{origin:"web-scene"}),r}return null}};(0,r._)([(0,c.MZ)({readOnly:!0})],dt.prototype,"effectiveSource",void 0),(0,r._)([(0,c.MZ)({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],dt.prototype,"georeference",void 0),(0,r._)([(0,h.w)("web-document","georeference")],dt.prototype,"readGeoreference",null),(0,r._)([(0,c.MZ)({type:String})],dt.prototype,"copyright",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],dt.prototype,"fullExtent",null),(0,r._)([(0,c.MZ)({type:["MediaLayer"]})],dt.prototype,"operationalLayerType",void 0),(0,r._)([(0,c.MZ)({type:["show","hide"]})],dt.prototype,"listMode",void 0),(0,r._)([(0,c.MZ)({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image"]},georeference:{type:le}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Ae(this,n?.origin)&&pt(e)&&!!e.georeference&&e.originIdOf("georeference")>m.Gr.PORTAL_ITEM}}}}})],dt.prototype,"source",null),(0,r._)([(0,u.w)("source")],dt.prototype,"castSource",null),(0,r._)([(0,h.w)("source",["url"])],dt.prototype,"readSource",null),(0,r._)([(0,d.K)("source")],dt.prototype,"writeSource",null),(0,r._)([(0,c.MZ)()],dt.prototype,"spatialReference",void 0),(0,r._)([(0,c.MZ)({readOnly:!0})],dt.prototype,"type",void 0),dt=(0,r._)([(0,p.$)("esri.layers.MediaLayer")],dt);const mt=dt},6518:(e,t,n)=>{n.d(t,{F:()=>a});var r=n(44208),i=n(75503),o=n(19419);const s={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new i.w(9,(0,r.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((n,r)=>{e[t++]=r})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,o.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,n){(function(e){s.minX=e[0],s.minY=e[1],s.maxX=e[2],s.maxY=e[3]})(t),e.search(s,n)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},16131:(e,t,n)=>{n.d(t,{q:()=>v});var r=n(90237),i=n(60945),o=n(49186),s=n(84952),a=n(10107),l=n(56507),c=(n(87811),n(44208),n(36005)),u=n(40608),h=n(43937),p=n(89317),d=n(45917),m=n(49422);const f={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},y={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},g={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},_={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,Voxel:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":f,"web-map/basemap":y,"web-map/tables":g,"link-chart/operational-layers":{...f,LinkChartLayer:!0},"link-chart/basemap":y,"link-chart/tables":g,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0}};var x=n(10873);const v=e=>{let t=class extends e{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(e,t,n){return"Group Layer"===n?.portalItem?.type?void 0:e}writeListMode(e,t,n,r){(r&&"ground"===r.layerContainerType||e&&(0,m.R)(this,n,{},r))&&(t[n]=e)}writeOperationalLayerType(e,t,n,r){e&&"tables"!==r?.layerContainerType&&(t.layerType=e)}writeTitle(e,t){t.title=e??"Layer"}readTimeExtent(e){return e?i.A.fromArray(e):null}writeTimeExtent(e,t,n,r){e&&"tables"!==r.layerContainerType&&(e.isEmpty?r?.messages&&r.messages.push(new o.A("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):t[n]=e.toArray())}read(e,t){t&&(t.layer=this),(0,d.t)(this,e,(t=>super.read(e,t)),t)}write(e,t){if(!this.persistenceEnabled&&!t?.ignorePersistenceEnabled)return null;if(t?.origin){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`,n=_[e];let r=!!n?.[this.operationalLayerType];if("ArcGISTiledElevationServiceLayer"===this.operationalLayerType&&"web-scene/operational-layers"===e&&(r=!1),"ArcGISDimensionLayer"===this.operationalLayerType&&"web-map/operational-layers"===e&&(r=!1),!r)return t.messages?.push(new o.A("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this})),null}const n=super.write(e,{...t,layer:this}),r=!!t&&!!t.messages&&!!t.messages.filter((e=>e instanceof o.A&&"web-document-write:property-required"===e.name)).length;return(0,s.w8)(n?.url)?(t?.messages?.push(new o.A("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&r?null:n}beforeSave(){}};return(0,r._)([(0,a.MZ)({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],t.prototype,"id",void 0),(0,r._)([(0,c.w)("id",["id"])],t.prototype,"readId",null),(0,r._)([(0,a.MZ)(x.C1)],t.prototype,"listMode",void 0),(0,r._)([(0,h.K)("listMode")],t.prototype,"writeListMode",null),(0,r._)([(0,a.MZ)({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:p.K}}}}})],t.prototype,"operationalLayerType",void 0),(0,r._)([(0,h.K)("operationalLayerType")],t.prototype,"writeOperationalLayerType",null),(0,r._)([(0,a.MZ)(x.ke)],t.prototype,"opacity",void 0),(0,r._)([(0,a.MZ)({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),(0,r._)([(0,a.MZ)({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],t.prototype,"title",void 0),(0,r._)([(0,h.K)("title"),(0,h.K)(["web-scene"],"title")],t.prototype,"writeTitle",null),(0,r._)([(0,a.MZ)({type:i.A,json:{origins:{"web-scene":{write:{layerContainerTypes:p.K}}}}})],t.prototype,"visibilityTimeExtent",void 0),(0,r._)([(0,c.w)("visibilityTimeExtent")],t.prototype,"readTimeExtent",null),(0,r._)([(0,h.K)(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[l.jz,l.Uv]]}})],t.prototype,"writeTimeExtent",null),(0,r._)([(0,a.MZ)({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:p.K}}},name:"visibility",write:!0}})],t.prototype,"visible",void 0),t=(0,r._)([(0,u.$)("esri.layers.mixins.OperationalLayer")],t),t}},8303:(e,t,n)=>{n.d(t,{A:()=>w});var r=n(90237),i=n(92602),o=n(70333),s=n(78888),a=n(60999),l=n(49186),c=n(53966),u=n(97768),h=n(74887),p=n(84952),d=n(10107),m=(n(44208),n(87811),n(36005)),f=n(40608),y=n(43937),g=n(83531),_=n(20655),x=n(80812),v=n(41318),M=n(10407);const w=e=>{let t=class extends e{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,n){if(t.itemId)return new x.default({id:t.itemId,portal:n?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:r}=await Promise.all([n.e(5356),n.e(1204)]).then(n.bind(n,41204));return(0,h.Te)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,h.zf)(e)||c.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,h.QP)(e),!0))))}async setUserPrivileges(e,t){if(!i.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:n,fullEdit:r},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,h.QP)(e)}}async _fetchUserPrivileges(e,t){let n=this.portalItem;if(!e||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=e===n.id;if(r&&n.portal.user)return(0,M.It)(n);let i,s;if(r)i=n.portal.url;else try{i=await(0,g.wI)(this.url,t)}catch(e){(0,h.QP)(e)}if(!i||!(0,p.b8)(i,n.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;s=await(o.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.QP)(e)}const a=!0,l=!1,c=!1;if(!s)return{features:{edit:a,fullEdit:l},content:{updateItem:c}};try{if(r?await n.reload():(n=new x.default({id:e,portal:{url:i}}),await n.load(t)),n.portal.user)return(0,M.It)(n)}catch(e){(0,h.QP)(e)}return{features:{edit:a,fullEdit:l},content:{updateItem:c}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,h.QP)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?o.id?.findCredential(this.url):null;if(!t)return!0;const n=b.credential===t?b.user:await this._fetchEditingUser(e);return b.credential=t,b.user=n,null==n?.privileges||n.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const n=o.id?.findServerInfo(this.url??"");if(!n?.owningSystemUrl)return null;const r=`${n.owningSystemUrl}/sharing/rest`,i=_.A.getDefault();if(i&&i.loaded&&(0,p.S8)(i.restUrl)===(0,p.S8)(r))return i.user;const l=`${r}/community/self`,c=null!=e?e.signal:null,u=await(0,a.Ke)((0,s.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?v.A.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const n=t?.portal,r=this.portalItem?.id&&(this.portalItem.portal||_.A.getDefault());return n&&r&&!(0,p.ut)(r.restUrl,n.restUrl)?(t.messages&&t.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,r._)([(0,d.MZ)({type:x.default})],t.prototype,"portalItem",null),(0,r._)([(0,m.w)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,y.K)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,d.MZ)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,d.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,r._)([(0,d.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,r._)([(0,d.MZ)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,r._)([(0,f.$)("esri.layers.mixins.PortalLayer")],t),t},b={credential:null,user:null}},85648:(e,t,n)=>{n.d(t,{n:()=>i});var r=n(84952);function i(e){return o[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,r.Zo)(e);return l[t]||s}(e.url)}(e)]||a}const o={},s="text/plain",a=o[s],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)o[l[e]]=e},92935:(e,t,n)=>{var r;n.d(t,{X:()=>r}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(r||(r={}))}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5356,5613],{22429:(e,a,r)=>{r.d(a,{v:()=>n});var t=r(24183);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const r=this._serviceMetadatas.get(e);if(r)return r;const n=await(0,t.V)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const t=await e.fetchData();return r.set(a,t),t}async fetchCustomParameters(e,a){const r=await this.fetchItemData(e);return r&&"object"==typeof r&&(a?a(r):r.customParameters)||null}}},92009:(e,a,r)=>{r.d(a,{L:()=>o});var t=r(70333),n=r(78888),i=r(49186),s=r(74887),l=r(60694),c=r(20655),y=r(80812);async function o(e,a){const r=(0,l.qg)(e);if(!r)throw new i.A("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await u(e)).serviceItemId;if(!a)return null;const r=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.A)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.QP)(e)}return null}(e);null!=i&&(r.portal=new c.A({url:i}));try{return r.load({signal:e.signal})}catch(e){return(0,s.QP)(e),null}}(o),null==o.sceneLayerItem)return L(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const d=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new y.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.QP)(e),null}}(o);if(!d?.url)throw new i.A("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=d;const f=await L(d.url,o);return f.portalItem=d,f}async function u(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.A)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function L(e,a){const r=(0,l.qg)(e);if(!r)throw new i.A("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const c=u(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,L=e=>{const r={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.A)(t,r)},d=L("anonymous").catch((()=>L("no-prompt"))),[f,m]=await Promise.all([d,c]),p=m?.layers,S=f.data&&f.data.layers;if(!Array.isArray(S))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,S.length);e++)if(p[e].id===s)return{serverUrl:t,layerId:S[e].id}}else if(null!=s&&s<S.length)return{serverUrl:t,layerId:S[s].id};throw new Error("could not find matching associated sublayer")}},23154:(e,a,r)=>{r.d(a,{K:()=>L,Q:()=>i});var t=r(24183);const n=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function i(e,a){const{loadContext:r,...n}=a||{},i=r?await r.fetchServiceMetadata(e,n):await(0,t.V)(e,n);u(i),c(i);const s={serviceJSON:i};if((i.currentVersion??0)<10.5)return s;const l=`${e}/layers`,y=r?await r.fetchServiceMetadata(l,n):await(0,t.V)(l,n);return u(y),c(y),s.layersJSON={layers:y.layers,tables:y.tables},s}function s(e){const{type:a}=e;return!!a&&n.has(a)}function l(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(l)}function y(e){e.type||="Feature Layer"}function o(e){e.type||="Table"}function u(e){e.layers?.forEach(y),e.tables?.forEach(o)}function L(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},75356:(e,a,r)=>{r.d(a,{N:()=>T,populateOperationalLayers:()=>o});var t=r(5503),n=(r(44208),r(22429)),i=r(4513),s=r(80812);function l(e,a){return!(!e.layerType||"ArcGISFeatureLayer"!==e.layerType)&&e.featureCollectionType===a}var c=r(45613),y=r(8947);async function o(e,a,r){if(!a)return;const t=a.map((e=>async function(e,a){return async function(e,a,r){const t=new e;return t.read(a,r.context),"group"===t.type&&("GroupLayer"===a.layerType?await T(t,a,r):v(a)?function(e,a,r){a.itemId&&(e.portalItem=new s.default({id:a.itemId,portal:r?.portal}),e.when((()=>{const t=t=>{const n=t.layerId;G(t,e,a,n,r);const i=a.featureCollection?.layers?.[n];i&&t.read(i,r)};e.layers?.forEach(t),e.tables?.forEach(t)})))}(t,a,r.context):b(a)&&await async function(e,a,r){const t=i.S.FeatureLayer,n=await t(),s=a.featureCollection,l=s?.showLegend,c=s?.layers?.map(((t,i)=>{const s=new n;s.read(t,r);const c={...r,ignoreDefaults:!0};return G(s,e,a,i,c),null!=l&&s.read({showLegend:l},c),s}));e.layers.addMany(c??[])}(t,a,r.context)),await(0,y.L)(t,r.context),t}(await I(e,a),e,a)}(e,r))),n=await Promise.allSettled(t);for(const a of n)"rejected"===a.status||a.value&&e.add(a.value)}const u={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",Voxel:"VoxelLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},L={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},d={ArcGISFeatureLayer:"FeatureLayer"},f={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},m={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},p={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},S={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},w={...m,LinkChartLayer:"LinkChartLayer"},h={...p},g={...S};async function I(e,a){const r=a.context,t=M(r);let y=e.layerType||e.type;!y&&a?.defaultLayerType&&(y=a.defaultLayerType);const o=t[y];let u=o?i.S[o]:i.S.UnknownLayer;if(v(e)){const a=r?.portal;if(e.itemId){const r=new s.default({id:e.itemId,portal:a});await r.load();const t=(await(0,c.n)(r,new n.v)).className||"UnknownLayer";u=i.S[t]}}else"ArcGISFeatureLayer"===y?function(e){return l(e,"notes")}(e)||function(e){return l(e,"markup")}(e)?u=i.S.MapNotesLayer:function(e){return l(e,"route")}(e)?u=i.S.RouteLayer:b(e)&&(u=i.S.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?u=i.S.WMTSLayer:"WFS"===y&&"2.0.0"!==e.wfsInfo?.version&&(u=i.S.UnsupportedLayer);return u()}function b(e){return"ArcGISFeatureLayer"===e.layerType&&!v(e)&&(e.featureCollection?.layers?.length??0)>1}function v(e){return"Feature Collection"===e.type}function M(e){let a;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":a=f;break;case"ground":a=L;break;case"tables":a=d;break;default:a=u}break;case"link-chart":switch(e.layerContainerType){case"basemap":a=g;break;case"tables":a=h;break;default:a=w}break;default:switch(e.layerContainerType){case"basemap":a=S;break;case"tables":a=p;break;default:a=m}}return a}async function T(e,a,r){const n=new t.A,i=o(n,Array.isArray(a.layers)?a.layers:[],r);try{try{if(await i,"group"===e.type)return e.layers.addMany(n),e}catch(a){e.destroy();for(const e of n)e.destroy();throw a}}catch(e){throw e}}function G(e,a,r,t,n){e.read({id:`${a.id}-sublayer-${t}`,visibility:r.visibleLayers?.includes(t)??!0},n)}},4513:(e,a,r)=>{r.d(a,{S:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(3161),r.e(9257)]).then(r.bind(r,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(2944),r.e(8947),r.e(4850),r.e(7110),r.e(2931)]).then(r.bind(r,88303))).default,CSVLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(4174)]).then(r.bind(r,72256))).default,CatalogLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(9558),r.e(620),r.e(893),r.e(3622),r.e(2593),r.e(6107)]).then(r.bind(r,79003))).default,DimensionLayer:async()=>(await r.e(1493).then(r.bind(r,71493))).default,ElevationLayer:async()=>(await Promise.all([r.e(9186),r.e(5204)]).then(r.bind(r,5111))).default,FeatureLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(9377)]).then(r.bind(r,13600))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(3839)]).then(r.bind(r,17625))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(3161),r.e(1147),r.e(1874),r.e(6184)]).then(r.bind(r,63201))).default,GroupLayer:async()=>(await Promise.all([r.e(3161),r.e(7481)]).then(r.bind(r,85989))).default,ImageryLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(893),r.e(2876),r.e(8742),r.e(4135)]).then(r.bind(r,5159))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(2876),r.e(8488),r.e(8742),r.e(9082)]).then(r.bind(r,97327))).default,IntegratedMesh3DTilesLayer:async()=>(await r.e(1528).then(r.bind(r,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(8947),r.e(964),r.e(8003)]).then(r.bind(r,84453))).default,KMLLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(5494),r.e(2469)]).then(r.bind(r,79465))).default,KnowledgeGraphLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(835),r.e(3097),r.e(1932),r.e(6289),r.e(8692)]).then(r.bind(r,28692))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(964),r.e(7272)]).then(r.bind(r,42452))).default,LinkChartLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(835),r.e(3097),r.e(1932),r.e(6289),r.e(9519)]).then(r.bind(r,49519))).default,MapImageLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(9558),r.e(893),r.e(3622),r.e(591),r.e(7656)]).then(r.bind(r,7656))).default,MapNotesLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(8739)]).then(r.bind(r,35079))).default,MediaLayer:async()=>(await Promise.all([r.e(3161),r.e(7899)]).then(r.bind(r,87899))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(3089),r.e(4591)]).then(r.bind(r,87152))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(3161),r.e(7430),r.e(349)]).then(r.bind(r,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(3740)]).then(r.bind(r,16230))).default,PointCloudLayer:async()=>(await Promise.all([r.e(2829),r.e(8947),r.e(171)]).then(r.bind(r,76742))).default,RouteLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(5494),r.e(3920)]).then(r.bind(r,97550))).default,SceneLayer:async()=>(await Promise.all([r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(3030),r.e(2944),r.e(8947),r.e(964),r.e(4850),r.e(1535),r.e(7110),r.e(1737)]).then(r.bind(r,13899))).default,StreamLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(4761)]).then(r.bind(r,60683))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(9558),r.e(620),r.e(7e3)]).then(r.bind(r,70048))).default,TileLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(9558),r.e(893),r.e(3622),r.e(9186),r.e(591),r.e(1756)]).then(r.bind(r,71756))).default,UnknownLayer:async()=>(await r.e(146).then(r.bind(r,146))).default,UnsupportedLayer:async()=>(await r.e(5165).then(r.bind(r,45165))).default,VectorTileLayer:async()=>(await Promise.all([r.e(3161),r.e(9186),r.e(9976),r.e(8705),r.e(9885)]).then(r.bind(r,64152))).default,VideoLayer:async()=>(await Promise.all([r.e(3161),r.e(6875)]).then(r.bind(r,86875))).default,VoxelLayer:async()=>(await Promise.all([r.e(2829),r.e(8947),r.e(964),r.e(1389)]).then(r.bind(r,16183))).default,WFSLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(4322),r.e(9511)]).then(r.bind(r,16350))).default,WMSLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(5181)]).then(r.bind(r,51904))).default,WMTSLayer:async()=>(await Promise.all([r.e(3161),r.e(7430),r.e(309)]).then(r.bind(r,20309))).default,WebTileLayer:async()=>(await Promise.all([r.e(3161),r.e(7430)]).then(r.bind(r,47314))).default}},66964:(e,a,r)=>{r.d(a,{Ju:()=>y,K8:()=>L,XH:()=>o,_r:()=>i,bO:()=>s,iK:()=>u,nu:()=>d,pJ:()=>l,rc:()=>c});var t=r(92009),n=r(23154);function i(e){const a={id:e.id,name:e.name},r=(0,n.K)(e.type);return"FeatureLayer"!==r&&(a.layerType=r),a}async function s(e,a,r){if(null==e?.layers||null==e?.tables){const t=await r.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||t?.layers?.map(i),e.tables=e.tables||t?.tables?.map(i)}return e}function l(e){if(!e)return null;const{layers:a,tables:r}=e;return a?.length?a[0]:r?.length?r[0]:null}function c(e,a){return null==a?null:[...e.layers||[],...e.tables||[]].find((e=>e.id===a))}function y(e,a){return[...e.layers||[],...e.tables||[]].filter((({layerType:e})=>"FeatureLayer"===a?!e:e===a))}function o(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function u(e){switch(e){case"catalog":return"CatalogLayer";case"feature":return"FeatureLayer";case"oriented-imagery":return"OrientedImageryLayer";case"subtype-group":return"SubtypeGroupLayer"}return null}function L(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":return"SubtypeGroupLayer"}return"FeatureLayer"}async function d(e,a,r){if(!e?.url)return a??{};if(a??={},!a.layers){const t=await r.fetchServiceMetadata(e.url);a.layers=t.layers?.map(i)}const{serverUrl:n,portalItem:s}=await(0,t.L)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return a.tables=[],a;if(!a.tables&&s){const e=await s.fetchData();if(e?.tables)a.tables=e.tables.map(i);else{const t=await r.fetchServiceMetadata(n,{customParameters:l(e)?.customParameters});a.tables=t?.tables?.map(i)}}if(a.tables)for(const e of a.tables)e.url=`${n}/${e.id}`;return a}},45613:(e,a,r)=>{r.d(a,{fromItem:()=>L,n:()=>d});var t=r(49186),n=r(92009),i=r(23154),s=r(22429),l=r(83531),c=r(4513),y=r(80812),o=r(66964),u=r(10407);async function L(e){let{portalItem:a}=e;!a||a instanceof y.default||(a=new y.default(a));const r=await async function(e){await e.load();const a=new s.v;return async function(e){const a=e.className,r=c.S[a];return{constructor:await r(),properties:e.properties}}(await d(e,a))}(a);return new(0,r.constructor)({portalItem:a,...r.properties})}async function d(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,u.Y)(e,"Map Notes"),r=(0,u.Y)(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if((0,u.Y)(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===(0,o.XH)(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const r=await f(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const i=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),s=i.cacheType?.toLowerCase(),l=i.capabilities?.toLowerCase().includes("tilesonly");return"map"===s||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Knowledge Graph Layer":return{className:"KnowledgeGraphLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const r=await f(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:r}=await(0,n.L)(e.url,{sceneLayerItem:e}),t=await a.fetchServiceMetadata(r);return t?.tables??[]}catch{return[]}}));if("object"==typeof r){const t={};let n;if(null!=r.id?(t.layerId=r.id,n=`${e.url}/layers/${r.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(l.XX))if(e.typeKeywords.includes(a))return{className:l.XX[a]};const i=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{className:l.XX[i?.layerType]||"SceneLayer",properties:t}}if(!1===r){const r=await a.fetchServiceMetadata(e.url);if("Voxel"===r?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new t.A("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function f(e,a,r){const{url:t,type:n}=e,s="Feature Service"===n;if(!t)return{};if(/\/\d+$/.test(t)){if(s){const r=await a.fetchServiceMetadata(t,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{id:r.id,className:(0,i.K)(r.type),sourceJSON:r}}return{}}await e.load();let l=await a.fetchItemData(e);if(s){const e=await(0,o.bO)(l,t,a),r=m(e);if("object"==typeof r){const a=(0,o.rc)(e,r.id);r.className=(0,o.K8)(a?.layerType)}return r}if("Scene Service"===n&&(l=await(0,o.nu)(e,l,a)),(0,o.XH)(l)>0)return m(l);const c=await a.fetchServiceMetadata(t);return r&&(c.tables=await r()),m(c)}function m(e){return 1===(0,o.XH)(e)&&{id:(0,o.pJ)(e)?.id}}},8947:(e,a,r)=>{r.d(a,{L:()=>s});var t=r(60999),n=r(74887),i=r(67076);async function s(e,a,r){const s=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(s&&"unique-value"===s.type&&s.styleOrigin){const l=await(0,t.Ke)(s.populateFromStyle());if((0,n.Te)(r),!1===l.ok){const r=l.error;a?.messages&&a.messages.push(new i.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:a})),e.clear("renderer",a?.origin)}}}},24183:(e,a,r)=>{r.d(a,{V:()=>n});var t=r(78888);async function n(e,a){const{data:r}=await(0,t.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5356,5613],{22429:(e,a,r)=>{r.d(a,{v:()=>n});var t=r(24183);class n{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(e,a){const r=this._serviceMetadatas.get(e);if(r)return r;const n=await(0,t.V)(e,a);return this._serviceMetadatas.set(e,n),n}async fetchItemData(e){const{id:a}=e;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const t=await e.fetchData();return r.set(a,t),t}async fetchCustomParameters(e,a){const r=await this.fetchItemData(e);return r&&"object"==typeof r&&(a?a(r):r.customParameters)||null}}},92009:(e,a,r)=>{r.d(a,{L:()=>o});var t=r(70333),n=r(78888),i=r(49186),s=r(74887),l=r(60694),c=r(20655),y=r(80812);async function o(e,a){const r=(0,l.qg)(e);if(!r)throw new i.A("invalid-url","Invalid scene service url");const o={...a,sceneServerUrl:r.url.path,layerId:r.sublayer??void 0};if(o.sceneLayerItem??=await async function(e){const a=(await u(e)).serviceItemId;if(!a)return null;const r=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=t.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const r=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.A)(r,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,s.QP)(e)}return null}(e);null!=i&&(r.portal=new c.A({url:i}));try{return r.load({signal:e.signal})}catch(e){return(0,s.QP)(e),null}}(o),null==o.sceneLayerItem)return L(o.sceneServerUrl.replace("/SceneServer","/FeatureServer"),o);const d=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const r=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!r)return null;const t=new y.default({portal:r.portal,id:r.id});return await t.load(),t}catch(e){return(0,s.QP)(e),null}}(o);if(!d?.url)throw new i.A("related-service-not-found","Could not find feature service through portal item relationship");o.featureServiceItem=d;const f=await L(d.url,o);return f.portalItem=d,f}async function u(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const r=await(0,n.A)(e.sceneServerUrl,a);e.rootDocument=r.data}catch{e.rootDocument={}}return e.rootDocument}async function L(e,a){const r=(0,l.qg)(e);if(!r)throw new i.A("invalid-feature-service-url","Invalid feature service url");const t=r.url.path,s=a.layerId;if(null==s)return{serverUrl:t};const c=u(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,o=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,L=e=>{const r={query:{f:"json",...o},responseType:"json",authMode:e,signal:a.signal};return(0,n.A)(t,r)},d=L("anonymous").catch((()=>L("no-prompt"))),[f,m]=await Promise.all([d,c]),p=m?.layers,S=f.data&&f.data.layers;if(!Array.isArray(S))throw new Error("expected layers array");if(Array.isArray(p)){for(let e=0;e<Math.min(p.length,S.length);e++)if(p[e].id===s)return{serverUrl:t,layerId:S[e].id}}else if(null!=s&&s<S.length)return{serverUrl:t,layerId:S[s].id};throw new Error("could not find matching associated sublayer")}},23154:(e,a,r)=>{r.d(a,{K:()=>L,Q:()=>i});var t=r(24183);const n=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function i(e,a){const{loadContext:r,...n}=a||{},i=r?await r.fetchServiceMetadata(e,n):await(0,t.V)(e,n);u(i),c(i);const s={serviceJSON:i};if((i.currentVersion??0)<10.5)return s;const l=`${e}/layers`,y=r?await r.fetchServiceMetadata(l,n):await(0,t.V)(l,n);return u(y),c(y),s.layersJSON={layers:y.layers,tables:y.tables},s}function s(e){const{type:a}=e;return!!a&&n.has(a)}function l(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(l)}function y(e){e.type||="Feature Layer"}function o(e){e.type||="Table"}function u(e){e.layers?.forEach(y),e.tables?.forEach(o)}function L(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},75356:(e,a,r)=>{r.d(a,{N:()=>T,populateOperationalLayers:()=>o});var t=r(5503),n=(r(44208),r(22429)),i=r(4513),s=r(80812);function l(e,a){return!(!e.layerType||"ArcGISFeatureLayer"!==e.layerType)&&e.featureCollectionType===a}var c=r(45613),y=r(8947);async function o(e,a,r){if(!a)return;const t=a.map((e=>async function(e,a){return async function(e,a,r){const t=new e;return t.read(a,r.context),"group"===t.type&&("GroupLayer"===a.layerType?await T(t,a,r):v(a)?function(e,a,r){a.itemId&&(e.portalItem=new s.default({id:a.itemId,portal:r?.portal}),e.when((()=>{const t=t=>{const n=t.layerId;G(t,e,a,n,r);const i=a.featureCollection?.layers?.[n];i&&t.read(i,r)};e.layers?.forEach(t),e.tables?.forEach(t)})))}(t,a,r.context):b(a)&&await async function(e,a,r){const t=i.S.FeatureLayer,n=await t(),s=a.featureCollection,l=s?.showLegend,c=s?.layers?.map(((t,i)=>{const s=new n;s.read(t,r);const c={...r,ignoreDefaults:!0};return G(s,e,a,i,c),null!=l&&s.read({showLegend:l},c),s}));e.layers.addMany(c??[])}(t,a,r.context)),await(0,y.L)(t,r.context),t}(await I(e,a),e,a)}(e,r))),n=await Promise.allSettled(t);for(const a of n)"rejected"===a.status||a.value&&e.add(a.value)}const u={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",Voxel:"VoxelLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},L={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},d={ArcGISFeatureLayer:"FeatureLayer"},f={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},m={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},p={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},S={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},w={...m,LinkChartLayer:"LinkChartLayer"},h={...p},g={...S};async function I(e,a){const r=a.context,t=M(r);let y=e.layerType||e.type;!y&&a?.defaultLayerType&&(y=a.defaultLayerType);const o=t[y];let u=o?i.S[o]:i.S.UnknownLayer;if(v(e)){const a=r?.portal;if(e.itemId){const r=new s.default({id:e.itemId,portal:a});await r.load();const t=(await(0,c.n)(r,new n.v)).className||"UnknownLayer";u=i.S[t]}}else"ArcGISFeatureLayer"===y?function(e){return l(e,"notes")}(e)||function(e){return l(e,"markup")}(e)?u=i.S.MapNotesLayer:function(e){return l(e,"route")}(e)?u=i.S.RouteLayer:b(e)&&(u=i.S.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?u=i.S.WMTSLayer:"WFS"===y&&"2.0.0"!==e.wfsInfo?.version&&(u=i.S.UnsupportedLayer);return u()}function b(e){return"ArcGISFeatureLayer"===e.layerType&&!v(e)&&(e.featureCollection?.layers?.length??0)>1}function v(e){return"Feature Collection"===e.type}function M(e){let a;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":a=f;break;case"ground":a=L;break;case"tables":a=d;break;default:a=u}break;case"link-chart":switch(e.layerContainerType){case"basemap":a=g;break;case"tables":a=h;break;default:a=w}break;default:switch(e.layerContainerType){case"basemap":a=S;break;case"tables":a=p;break;default:a=m}}return a}async function T(e,a,r){const n=new t.A,i=o(n,Array.isArray(a.layers)?a.layers:[],r);try{try{if(await i,"group"===e.type)return e.layers.addMany(n),e}catch(a){e.destroy();for(const e of n)e.destroy();throw a}}catch(e){throw e}}function G(e,a,r,t,n){e.read({id:`${a.id}-sublayer-${t}`,visibility:r.visibleLayers?.includes(t)??!0},n)}},4513:(e,a,r)=>{r.d(a,{S:()=>t});const t={BingMapsLayer:async()=>(await Promise.all([r.e(3161),r.e(9257)]).then(r.bind(r,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(2944),r.e(8947),r.e(4850),r.e(7110),r.e(2931)]).then(r.bind(r,88303))).default,CSVLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(4174)]).then(r.bind(r,72256))).default,CatalogLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(9558),r.e(620),r.e(893),r.e(3622),r.e(2593),r.e(6107)]).then(r.bind(r,79003))).default,DimensionLayer:async()=>(await r.e(1493).then(r.bind(r,71493))).default,ElevationLayer:async()=>(await Promise.all([r.e(9186),r.e(5204)]).then(r.bind(r,5111))).default,FeatureLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(9377)]).then(r.bind(r,13600))).default,GeoJSONLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(3839)]).then(r.bind(r,17625))).default,GeoRSSLayer:async()=>(await Promise.all([r.e(3161),r.e(1147),r.e(1874),r.e(6184)]).then(r.bind(r,63201))).default,GroupLayer:async()=>(await Promise.all([r.e(3161),r.e(7481)]).then(r.bind(r,85989))).default,ImageryLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(893),r.e(2876),r.e(8742),r.e(4135)]).then(r.bind(r,5159))).default,ImageryTileLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(2876),r.e(8488),r.e(8742),r.e(9082)]).then(r.bind(r,97327))).default,IntegratedMesh3DTilesLayer:async()=>(await r.e(1528).then(r.bind(r,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([r.e(8947),r.e(964),r.e(8003)]).then(r.bind(r,84453))).default,KMLLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(5494),r.e(2469)]).then(r.bind(r,79465))).default,KnowledgeGraphLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(835),r.e(3097),r.e(1932),r.e(6289),r.e(8692)]).then(r.bind(r,28692))).default,LineOfSightLayer:async()=>(await Promise.all([r.e(964),r.e(7272)]).then(r.bind(r,42452))).default,LinkChartLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(835),r.e(3097),r.e(1932),r.e(6289),r.e(9519)]).then(r.bind(r,49519))).default,MapImageLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(9558),r.e(893),r.e(3622),r.e(591),r.e(7656)]).then(r.bind(r,7656))).default,MapNotesLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(8739)]).then(r.bind(r,35079))).default,MediaLayer:async()=>(await Promise.all([r.e(3161),r.e(7899)]).then(r.bind(r,87899))).default,OGCFeatureLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(3089),r.e(4591)]).then(r.bind(r,87152))).default,OpenStreetMapLayer:async()=>(await Promise.all([r.e(3161),r.e(7430),r.e(349)]).then(r.bind(r,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(9558),r.e(620),r.e(3600),r.e(3740)]).then(r.bind(r,16230))).default,PointCloudLayer:async()=>(await Promise.all([r.e(2829),r.e(8947),r.e(171)]).then(r.bind(r,76742))).default,RouteLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(5494),r.e(3920)]).then(r.bind(r,97550))).default,SceneLayer:async()=>(await Promise.all([r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(3030),r.e(2944),r.e(8947),r.e(964),r.e(4850),r.e(1535),r.e(7110),r.e(1737)]).then(r.bind(r,13899))).default,StreamLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(4761)]).then(r.bind(r,60683))).default,SubtypeGroupLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(9558),r.e(620),r.e(7e3)]).then(r.bind(r,70048))).default,TileLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(9558),r.e(893),r.e(3622),r.e(9186),r.e(591),r.e(1756)]).then(r.bind(r,71756))).default,UnknownLayer:async()=>(await r.e(146).then(r.bind(r,146))).default,UnsupportedLayer:async()=>(await r.e(5165).then(r.bind(r,45165))).default,VectorTileLayer:async()=>(await Promise.all([r.e(3161),r.e(9186),r.e(9976),r.e(8705),r.e(9885)]).then(r.bind(r,64152))).default,VideoLayer:async()=>(await Promise.all([r.e(3161),r.e(6875)]).then(r.bind(r,86875))).default,VoxelLayer:async()=>(await Promise.all([r.e(2829),r.e(8947),r.e(964),r.e(1389)]).then(r.bind(r,16183))).default,WFSLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(1132),r.e(9566),r.e(1956),r.e(5494),r.e(4796),r.e(5894),r.e(4322),r.e(9511)]).then(r.bind(r,16350))).default,WMSLayer:async()=>(await Promise.all([r.e(3161),r.e(2829),r.e(1147),r.e(1874),r.e(5181)]).then(r.bind(r,51904))).default,WMTSLayer:async()=>(await Promise.all([r.e(3161),r.e(7430),r.e(309)]).then(r.bind(r,20309))).default,WebTileLayer:async()=>(await Promise.all([r.e(3161),r.e(7430)]).then(r.bind(r,47314))).default}},66964:(e,a,r)=>{r.d(a,{Ju:()=>y,K8:()=>L,XH:()=>o,_r:()=>i,bO:()=>s,iK:()=>u,nu:()=>d,pJ:()=>l,rc:()=>c});var t=r(92009),n=r(23154);function i(e){const a={id:e.id,name:e.name},r=(0,n.K)(e.type);return"FeatureLayer"!==r&&(a.layerType=r),a}async function s(e,a,r){if(null==e?.layers||null==e?.tables){const t=await r.fetchServiceMetadata(a,{customParameters:l(e)?.customParameters});(e=e||{}).layers=e.layers||t?.layers?.map(i),e.tables=e.tables||t?.tables?.map(i)}return e}function l(e){if(!e)return null;const{layers:a,tables:r}=e;return a?.length?a[0]:r?.length?r[0]:null}function c(e,a){return null==a?null:[...e.layers||[],...e.tables||[]].find((e=>e.id===a))}function y(e,a){return[...e.layers||[],...e.tables||[]].filter((({layerType:e})=>e?e===a:"ArcGISFeatureLayer"===a))}function o(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function u(e){switch(e){case"catalog":return"CatalogLayer";case"feature":return"ArcGISFeatureLayer";case"oriented-imagery":return"OrientedImageryLayer";case"subtype-group":return"SubtypeGroupLayer"}return null}function L(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":return"SubtypeGroupLayer"}return"FeatureLayer"}async function d(e,a,r){if(!e?.url)return a??{};if(a??={},!a.layers){const t=await r.fetchServiceMetadata(e.url);a.layers=t.layers?.map(i)}const{serverUrl:n,portalItem:s}=await(0,t.L)(e.url,{sceneLayerItem:e,customParameters:l(a)?.customParameters}).catch((()=>({serverUrl:null,portalItem:null})));if(null==n)return a.tables=[],a;if(!a.tables&&s){const e=await s.fetchData();if(e?.tables)a.tables=e.tables.map(i);else{const t=await r.fetchServiceMetadata(n,{customParameters:l(e)?.customParameters});a.tables=t?.tables?.map(i)}}if(a.tables)for(const e of a.tables)e.url=`${n}/${e.id}`;return a}},45613:(e,a,r)=>{r.d(a,{fromItem:()=>L,n:()=>d});var t=r(49186),n=r(92009),i=r(23154),s=r(22429),l=r(83531),c=r(4513),y=r(80812),o=r(66964),u=r(10407);async function L(e){let{portalItem:a}=e;!a||a instanceof y.default||(a=new y.default(a));const r=await async function(e){await e.load();const a=new s.v;return async function(e){const a=e.className,r=c.S[a];return{constructor:await r(),properties:e.properties}}(await d(e,a))}(a);return new(0,r.constructor)({portalItem:a,...r.properties})}async function d(e,a){switch(e.type){case"3DTiles Service":return{className:"IntegratedMesh3DTilesLayer"};case"CSV":return{className:"CSVLayer"};case"Feature Collection":return async function(e){await e.load();const a=(0,u.Y)(e,"Map Notes"),r=(0,u.Y)(e,"Markup");if(a||r)return{className:"MapNotesLayer"};if((0,u.Y)(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return 1===(0,o.XH)(t)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Feature Service":return async function(e,a){const r=await f(e,a);if("object"==typeof r){const{sourceJSON:e,className:a}=r,t={sourceJSON:e};return null!=r.id&&(t.layerId=r.id),{className:a||"FeatureLayer",properties:t}}return{className:"GroupLayer"}}(e,a);case"Feed":case"Stream Service":return{className:"StreamLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"Group Layer":return{className:"GroupLayer"};case"Image Service":return async function(e,a){await e.load();const r=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const t=await a.fetchItemData(e),n=t?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const i=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)}),s=i.cacheType?.toLowerCase(),l=i.capabilities?.toLowerCase().includes("tilesonly");return"map"===s||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"KML":return{className:"KMLLayer"};case"Knowledge Graph Layer":return{className:"KnowledgeGraphLayer"};case"Map Service":return async function(e,a){return await async function(e,a){const{tileInfo:r}=await a.fetchServiceMetadata(e.url,{customParameters:await a.fetchCustomParameters(e)});return r}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Media Layer":return{className:"MediaLayer"};case"Scene Service":return async function(e,a){const r=await f(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:r}=await(0,n.L)(e.url,{sceneLayerItem:e}),t=await a.fetchServiceMetadata(r);return t?.tables??[]}catch{return[]}}));if("object"==typeof r){const t={};let n;if(null!=r.id?(t.layerId=r.id,n=`${e.url}/layers/${r.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(l.XX))if(e.typeKeywords.includes(a))return{className:l.XX[a]};const i=await a.fetchServiceMetadata(n,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{className:l.XX[i?.layerType]||"SceneLayer",properties:t}}if(!1===r){const r=await a.fetchServiceMetadata(e.url);if("Voxel"===r?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Vector Tile Service":return{className:"VectorTileLayer"};case"WFS":return{className:"WFSLayer"};case"WMS":return{className:"WMSLayer"};case"WMTS":return{className:"WMTSLayer"};default:throw new t.A("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function f(e,a,r){const{url:t,type:n}=e,s="Feature Service"===n;if(!t)return{};if(/\/\d+$/.test(t)){if(s){const r=await a.fetchServiceMetadata(t,{customParameters:await a.fetchCustomParameters(e,(e=>(0,o.pJ)(e)?.customParameters))});return{id:r.id,className:(0,i.K)(r.type),sourceJSON:r}}return{}}await e.load();let l=await a.fetchItemData(e);if(s){const e=await(0,o.bO)(l,t,a),r=m(e);if("object"==typeof r){const a=(0,o.rc)(e,r.id);r.className=(0,o.K8)(a?.layerType)}return r}if("Scene Service"===n&&(l=await(0,o.nu)(e,l,a)),(0,o.XH)(l)>0)return m(l);const c=await a.fetchServiceMetadata(t);return r&&(c.tables=await r()),m(c)}function m(e){return 1===(0,o.XH)(e)&&{id:(0,o.pJ)(e)?.id}}},8947:(e,a,r)=>{r.d(a,{L:()=>s});var t=r(60999),n=r(74887),i=r(67076);async function s(e,a,r){const s=e&&e.getAtOrigin&&e.getAtOrigin("renderer",a.origin);if(s&&"unique-value"===s.type&&s.styleOrigin){const l=await(0,t.Ke)(s.populateFromStyle());if((0,n.Te)(r),!1===l.ok){const r=l.error;a?.messages&&a.messages.push(new i.A("renderer:style-reference",`Failed to create unique value renderer from style reference: ${r.message}`,{error:r,context:a})),e.clear("renderer",a?.origin)}}}},24183:(e,a,r)=>{r.d(a,{V:()=>n});var t=r(78888);async function n(e,a){const{data:r}=await(0,t.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return r}}}]);
|