@arcgis/core 4.28.8 → 4.28.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/3b44696ed6608cfdef34.js +1 -0
  3. package/assets/esri/core/workers/chunks/53b8712979f551ac0101.js +1 -0
  4. package/assets/esri/core/workers/chunks/5b416d7ef5f3f57b052c.js +1 -0
  5. package/assets/esri/core/workers/chunks/5d50d061b080d93539ea.js +1 -0
  6. package/assets/esri/core/workers/chunks/{df7267892b6e0493e1d7.js → 95ce288362649909ffe6.js} +1 -1
  7. package/assets/esri/core/workers/chunks/a48cb80b8f10522ccba4.js +1 -0
  8. package/assets/esri/core/workers/chunks/aa3bb965d4495ee3dfe0.js +1 -0
  9. package/assets/esri/core/workers/chunks/afc396fd3afbebd39a93.js +1 -0
  10. package/assets/esri/core/workers/chunks/b4bbace5b409b804a52f.js +1 -0
  11. package/assets/esri/core/workers/chunks/{9979ff59a144fe1df80b.js → b91af6a65d382b92b162.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{c3b8b40115be5a2b960e.js → c6d1a6db8cfa0a7e3bd2.js} +1 -1
  13. package/assets/esri/core/workers/chunks/d5e6676cd2de77527c92.js +1 -0
  14. package/assets/esri/core/workers/chunks/d7637c89848ee4f5f4db.js +1 -0
  15. package/assets/esri/core/workers/chunks/d8482a5aa176426352bf.js +1 -0
  16. package/assets/esri/core/workers/chunks/ead02c933d1af20cbaa0.js +1 -0
  17. package/assets/esri/core/workers/chunks/f1152b991c33d8c94219.js +1 -0
  18. package/assets/esri/core/workers/chunks/faa2da66e9934f7fee04.js +1 -0
  19. package/core/uuid.js +1 -1
  20. package/interfaces.d.ts +10 -4
  21. package/kernel.js +1 -1
  22. package/layers/graphics/editingSupport.js +1 -1
  23. package/package.json +1 -1
  24. package/support/revision.js +1 -1
  25. package/versionManagement/support/versionManagementUtils.js +1 -1
  26. package/views/3d/layers/VoxelWasm.js +1 -1
  27. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  28. package/assets/esri/core/workers/chunks/175bbe8a048f17dd482b.js +0 -1
  29. package/assets/esri/core/workers/chunks/19c9966f74d287750aaa.js +0 -1
  30. package/assets/esri/core/workers/chunks/30776102fbab294bfe7b.js +0 -1
  31. package/assets/esri/core/workers/chunks/30d3b31df52d40e5b2e6.js +0 -1
  32. package/assets/esri/core/workers/chunks/4564a7885d045a850887.js +0 -1
  33. package/assets/esri/core/workers/chunks/4bd342f13002888b6467.js +0 -1
  34. package/assets/esri/core/workers/chunks/633b34a5817f1f719e22.js +0 -1
  35. package/assets/esri/core/workers/chunks/70eba80261d7fdc624ad.js +0 -1
  36. package/assets/esri/core/workers/chunks/9ef3746c545296565ef6.js +0 -1
  37. package/assets/esri/core/workers/chunks/a3bbf5da4f7830d2a2a1.js +0 -1
  38. package/assets/esri/core/workers/chunks/a47f74fc959b11f029a5.js +0 -1
  39. package/assets/esri/core/workers/chunks/bdc751a752a7ff1387de.js +0 -1
  40. package/assets/esri/core/workers/chunks/c3ddf5dbc34f118002df.js +0 -1
  41. package/assets/esri/core/workers/chunks/f85107720159b855a469.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4828,5732],{92835:(t,e,n)=>{n.d(e,{Z:()=>f});var i,o=n(43697),r=n(96674),s=n(35463),a=n(5600),l=(n(75215),n(67676),n(80442),n(71715)),c=n(52011),u=n(30556),h=n(25031);let d=i=class extends r.wq{static get allTime(){return p}static get empty(){return m}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,i=t.start?.getTime()??t.start,o=t.end?.getTime()??t.end;return e===i&&n===o}expandTo(t,e=h.By){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=(0,s.JE)(n,t,e));let o=this.end;if(o){const n=(0,s.JE)(o,t,e);o=o.getTime()===n.getTime()?n:(0,s.Nm)(n,1,t,e)}return new i({start:n,end:o})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return i.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,o=t.start?.getTime()??-1/0,r=t.end?.getTime()??1/0;let s,a;if(o>=e&&o<=n?s=o:e>=o&&e<=r&&(s=e),n>=o&&n<=r?a=n:r>=e&&r<=n&&(a=r),null!=s&&null!=a&&!isNaN(s)&&!isNaN(a)){const t=new i;return t.start=s===-1/0?null:new Date(s),t.end=a===1/0?null:new Date(a),t}return i.empty}offset(t,e,n=h.By){if(this.isEmpty||this.isAllTime)return this.clone();const o=new i,{start:r,end:a}=this;return null!=r&&(o.start=(0,s.Nm)(r,t,e,n)),null!=a&&(o.end=(0,s.Nm)(a,t,e,n)),o}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return p.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,n=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new i({start:e,end:n})}};(0,o._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,o._)([(0,l.r)("end")],d.prototype,"readEnd",null),(0,o._)([(0,u.c)("end")],d.prototype,"writeEnd",null),(0,o._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,o._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,o._)([(0,a.Cb)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,o._)([(0,l.r)("start")],d.prototype,"readStart",null),(0,o._)([(0,u.c)("start")],d.prototype,"writeStart",null),d=i=(0,o._)([(0,c.j)("esri.TimeExtent")],d);const p=new d,m=new d({start:void 0,end:void 0}),f=d},5732:(t,e,n)=>{n.d(e,{c:()=>i,g:()=>o});var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}},21787:(t,e,n)=>{n.d(e,{a:()=>l,d:()=>a,f:()=>o,i:()=>d,m:()=>c,n:()=>u,s:()=>r,t:()=>s});var i=n(46851);function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function r(t,e,n,i,o,r,s,a,l,c){return t[0]=e,t[1]=n,t[2]=i,t[3]=o,t[4]=r,t[5]=s,t[6]=a,t[7]=l,t[8]=c,t}function s(t,e){if(t===e){const n=e[1],i=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=i,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function a(t,e){const n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*s-a*c,d=-u*r+a*l,p=c*r-s*l;let m=n*h+i*d+o*p;return m?(m=1/m,t[0]=h*m,t[1]=(-u*i+o*c)*m,t[2]=(a*i-o*s)*m,t[3]=d*m,t[4]=(u*n-o*l)*m,t[5]=(-a*n+o*r)*m,t[6]=p*m,t[7]=(-c*n+i*l)*m,t[8]=(s*n-i*r)*m,t):null}function l(t,e){const n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t[0]=s*u-a*c,t[1]=o*c-i*u,t[2]=i*a-o*s,t[3]=a*l-r*u,t[4]=n*u-o*l,t[5]=o*r-n*a,t[6]=r*c-s*l,t[7]=i*l-n*c,t[8]=n*s-i*r,t}function c(t,e,n){const i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=n[0],p=n[1],m=n[2],f=n[3],y=n[4],_=n[5],x=n[6],g=n[7],b=n[8];return t[0]=d*i+p*s+m*c,t[1]=d*o+p*a+m*u,t[2]=d*r+p*l+m*h,t[3]=f*i+y*s+_*c,t[4]=f*o+y*a+_*u,t[5]=f*r+y*l+_*h,t[6]=x*i+g*s+b*c,t[7]=x*o+g*a+b*u,t[8]=x*r+g*l+b*h,t}function u(t,e){const n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],m=e[12],f=e[13],y=e[14],_=e[15],x=n*a-i*s,g=n*l-o*s,b=n*c-r*s,v=i*l-o*a,M=i*c-r*a,w=o*c-r*l,P=u*f-h*m,C=u*y-d*m,R=u*_-p*m,I=h*y-d*f,S=h*_-p*f,B=d*_-p*y;let j=x*B-g*S+b*I+v*R-M*C+w*P;return j?(j=1/j,t[0]=(a*B-l*S+c*I)*j,t[1]=(l*R-s*B-c*C)*j,t[2]=(s*S-a*R+c*P)*j,t[3]=(o*S-i*B-r*I)*j,t[4]=(n*B-o*R+r*C)*j,t[5]=(i*R-n*S-r*P)*j,t[6]=(f*w-y*M+_*v)*j,t[7]=(y*b-m*w-_*g)*j,t[8]=(m*M-f*b+_*x)*j,t):null}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function d(t){const e=(0,i.g)(),n=t[0],o=t[1],r=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8];return Math.abs(1-(n*n+s*s+c*c))<=e&&Math.abs(1-(o*o+a*a+u*u))<=e&&Math.abs(1-(r*r+l*l+h*h))<=e}const p=c,m=h;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t},adjoint:l,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},determinant:function(t){const e=t[0],n=t[1],i=t[2],o=t[3],r=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*(c*r-s*l)+n*(-c*o+s*a)+i*(l*o-r*a)},equals:function(t,e){const n=t[0],o=t[1],r=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=e[0],p=e[1],m=e[2],f=e[3],y=e[4],_=e[5],x=e[6],g=e[7],b=e[8],v=(0,i.g)();return Math.abs(n-d)<=v*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-p)<=v*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(r-m)<=v*Math.max(1,Math.abs(r),Math.abs(m))&&Math.abs(s-f)<=v*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-y)<=v*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(l-_)<=v*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(c-x)<=v*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(u-g)<=v*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(h-b)<=v*Math.max(1,Math.abs(h),Math.abs(b))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},frob:function(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)},fromMat2d:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},fromMat4:o,fromQuat:function(t,e){const n=e[0],i=e[1],o=e[2],r=e[3],s=n+n,a=i+i,l=o+o,c=n*s,u=i*s,h=i*a,d=o*s,p=o*a,m=o*l,f=r*s,y=r*a,_=r*l;return t[0]=1-h-m,t[3]=u-_,t[6]=d+y,t[1]=u+_,t[4]=1-c-m,t[7]=p-f,t[2]=d-y,t[5]=p+f,t[8]=1-c-h,t},fromRotation:function(t,e){const n=Math.sin(e),i=Math.cos(e);return t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromTranslation:function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},invert:a,isOrthoNormal:d,mul:p,multiply:c,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t},multiplyScalarAndAdd:function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t},normalFromMat4:u,normalFromMat4Legacy:function(t,e){const n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],l=e[8],c=e[9],u=e[10],h=u*s-a*c,d=-u*r+a*l,p=c*r-s*l,m=n*h+i*d+o*p;if(!m)return null;const f=1/m;return t[0]=h*f,t[1]=(-u*i+o*c)*f,t[2]=(a*i-o*s)*f,t[3]=d*f,t[4]=(u*n-o*l)*f,t[5]=(-a*n+o*r)*f,t[6]=p*f,t[7]=(-c*n+i*l)*f,t[8]=(s*n-i*r)*f,t},projection:function(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},rotate:function(t,e,n){const i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=Math.sin(n),p=Math.cos(n);return t[0]=p*i+d*s,t[1]=p*o+d*a,t[2]=p*r+d*l,t[3]=p*s-d*i,t[4]=p*a-d*o,t[5]=p*l-d*r,t[6]=c,t[7]=u,t[8]=h,t},scale:function(t,e,n){const i=n[0],o=n[1],r=n[2];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=r*e[6],t[7]=r*e[7],t[8]=r*e[8],t},scaleByVec2:function(t,e,n){const i=n[0],o=n[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t},set:r,str:function(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},sub:m,subtract:h,translate:function(t,e,n){const i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=n[0],p=n[1];return t[0]=i,t[1]=o,t[2]=r,t[3]=s,t[4]=a,t[5]=l,t[6]=d*i+p*s+c,t[7]=d*o+p*a+u,t[8]=d*r+p*l+h,t},transpose:s},Symbol.toStringTag,{value:"Module"}))},46521:(t,e,n)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function o(t,e,n,i,o,r,s,a,l){return[t,e,n,i,o,r,s,a,l]}function r(t,e){return new Float64Array(t,e,9)}n.d(e,{a:()=>i,c:()=>r,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},create:i,createView:r,fromValues:o},Symbol.toStringTag,{value:"Module"}))},88764:(t,e,n)=>{n.d(e,{q:()=>l});var i,o,r,s=n(5732),a={exports:{}};i=a,o=function(){function t(n,i,o,r,s){for(;r>o;){if(r-o>600){var a=r-o+1,l=i-o+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);t(n,i,Math.max(o,Math.floor(i-l*u/a+h)),Math.min(r,Math.floor(i+(a-l)*u/a+h)),s)}var d=n[i],p=o,m=r;for(e(n,o,i),s(n[r],d)>0&&e(n,o,r);p<m;){for(e(n,p,m),p++,m--;s(n[p],d)<0;)p++;for(;s(n[m],d)>0;)m--}0===s(n[o],d)?e(n,o,m):e(n,++m,r),m<=i&&(o=m+1),i<=m&&(r=m-1)}}function e(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function n(t,e){return t<e?-1:t>e?1:0}return function(e,i,o,r,s){t(e,i,o||0,r||e.length-1,s||n)}},void 0!==(r=o())&&(i.exports=r);const l=(0,s.g)(a.exports)},4307:(t,e,n)=>{n.d(e,{d:()=>l,l:()=>d,r:()=>m,s:()=>o,t:()=>p});var i=n(46851);function o(t,e,n){return t[0]=e,t[1]=n,t}function r(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function s(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function a(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function l(t,e){const n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)}function c(t,e){const n=e[0]-t[0],i=e[1]-t[1];return n*n+i*i}function u(t){const e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}function h(t){const e=t[0],n=t[1];return e*e+n*n}function d(t,e,n,i){const o=e[0],r=e[1];return t[0]=o+i*(n[0]-o),t[1]=r+i*(n[1]-r),t}function p(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[2]*o+n[4],t[1]=n[1]*i+n[3]*o+n[5],t}function m(t,e,n,i){const o=e[0]-n[0],r=e[1]-n[1],s=Math.sin(i),a=Math.cos(i);return t[0]=o*a-r*s+n[0],t[1]=o*s+r*a+n[1],t}const f=u,y=r,_=s,x=a,g=l,b=c,v=h;Object.freeze(Object.defineProperty({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},angle:function(t,e){const n=t[0],i=t[1],o=e[0],r=e[1];let s=n*n+i*i;s>0&&(s=1/Math.sqrt(s));let a=o*o+r*r;a>0&&(a=1/Math.sqrt(a));const l=(n*o+i*r)*s*a;return l>1?0:l<-1?Math.PI:Math.acos(l)},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},cross:function(t,e,n){const i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},dist:g,distance:l,div:x,divide:a,dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},equals:function(t,e){const n=t[0],o=t[1],r=e[0],s=e[1],a=(0,i.g)();return Math.abs(n-r)<=a*Math.max(1,Math.abs(n),Math.abs(r))&&Math.abs(o-s)<=a*Math.max(1,Math.abs(o),Math.abs(s))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]},floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},inverse:function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},len:f,length:u,lerp:d,max:function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},min:function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},mul:_,multiply:s,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},normalize:function(t,e){const n=e[0],i=e[1];let o=n*n+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o),t},projectAndScale:function(t,e,n,i,o){let r=e[0]-n[0],s=e[1]-n[1];const a=(i[0]*r+i[1]*s)*(o-1);return r=i[0]*a,s=i[1]*a,t[0]=e[0]+r,t[1]=e[1]+s,t},random:function(t,e){e=e||1;const n=2*(0,i.R)()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},rotate:m,round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},scale:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},scaleAndAdd:function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},set:o,sqrDist:b,sqrLen:v,squaredDistance:c,squaredLength:h,str:function(t){return"vec2("+t[0]+", "+t[1]+")"},sub:y,subtract:r,transformMat2:function(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[2]*o,t[1]=n[1]*i+n[3]*o,t},transformMat2d:p,transformMat3:function(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[3]*o+n[6],t[1]=n[1]*i+n[4]*o+n[7],t},transformMat4:function(t,e,n){const i=e[0],o=e[1];return t[0]=n[0]*i+n[4]*o+n[12],t[1]=n[1]*i+n[5]*o+n[13],t}},Symbol.toStringTag,{value:"Module"}))},97323:(t,e,n)=>{function i(){return[0,0]}function o(t,e){return[t,e]}function r(t,e){return new Float64Array(t,e,2)}function s(){return o(1,1)}function a(){return o(1,0)}function l(){return o(0,1)}n.d(e,{a:()=>i,c:()=>r,f:()=>o});const c=s(),u=a(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:c,UNIT_X:u,UNIT_Y:h,ZEROS:[0,0],clone:function(t){return[t[0],t[1]]},create:i,createView:r,fromArray:function(t,e=[0,0]){const n=Math.min(2,t.length);for(let i=0;i<n;++i)e[i]=t[i];return e},fromValues:o,ones:s,unitX:a,unitY:l,zeros:function(){return[0,0]}},Symbol.toStringTag,{value:"Module"}))},2368:(t,e,n)=>{n.d(e,{J:()=>u,j:()=>h});var i=n(43697),o=n(92036),r=(n(80442),n(22974)),s=(n(92604),n(70586)),a=n(31263),l=n(1153),c=n(52011);const u=t=>{let e=class extends t{clone(){const t=(0,l.vw)(this);(0,s.O3)(t,"unable to clone instance of non-accessor class");const e=t.metadatas,n=t.store,i={},o=new Map;for(const t in e){const s=e[t],l=n?.originOf(t),c=s.clonable;if(s.readOnly||!1===c||l!==a.s3.USER&&l!==a.s3.DEFAULTS&&l!==a.s3.WEB_MAP&&l!==a.s3.WEB_SCENE)continue;const u=this[t];let h=null;h="function"==typeof c?c(u):"reference"===c?u:(0,r.Vo)(u),null!=u&&null==h||(l===a.s3.DEFAULTS?o.set(t,h):i[t]=h)}const c=new(0,Object.getPrototypeOf(this).constructor)(i);if(o.size){const t=(0,l.vw)(c)?.store;if(t)for(const[e,n]of o)t.set(e,n,a.s3.DEFAULTS)}return c}};return e=(0,i._)([(0,c.j)("esri.core.Clonable")],e),e};let h=class extends(u(o.Z)){};h=(0,i._)([(0,c.j)("esri.core.Clonable")],h)},10699:(t,e,n)=>{n.d(e,{IG:()=>s,iv:()=>a});var i=n(43697),o=n(52011);let r=0;const s=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+r++})}};return e=(0,i._)([(0,o.j)("esri.core.Identifiable")],e),e},a=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:r++})}};return e=(0,i._)([(0,o.j)("esri.core.NumericIdentifiable")],e),e};let l=class extends(s(class{})){};l=(0,i._)([(0,o.j)("esri.core.Identifiable")],l)},70163:(t,e,n)=>{n.d(e,{Jl:()=>u,n$:()=>h});var i=n(3172),o=n(20102),r=n(95330),s=n(17452),a=n(49917);let l=null,c=!0;function u(t,e,n,i){if(!e||!n)throw new Error("Cannot construct image data without dimensions");if(c)try{return new ImageData(t,e,n)}catch(t){c=!1}const o=function(t,e,n){return n||(l||(l=document.createElement("canvas"),l.width=1,l.height=1),n=l),n.getContext("2d").createImageData(t,e)}(e,n,i);return o.data.set(t,0),o}async function h(t,e){const{arrayBuffer:l,mediaType:c}=await async function(t,e){const n=(0,s.sJ)(t);if(n?.isBase64)return{arrayBuffer:(0,a.R)(n.data),mediaType:n.mediaType};const o=await(0,i.Z)(t,{responseType:"array-buffer",...e});return{arrayBuffer:o.data,mediaType:o.getHeader("Content-Type")}}(t,e),u="image/png"===c;if("image/gif"===c){const{isAnimatedGIF:t,parseGif:i}=await n.e(3310).then(n.bind(n,83310));if(t(l))return i(l,e)}if(u){const{isAnimatedPNG:t,parseApng:i}=await n.e(4492).then(n.bind(n,54492));if(t(l))return i(l,e)}return async function(t,e){const n=window.URL.createObjectURL(t);try{const{data:t}=await(0,i.Z)(n,{...e,responseType:"image"});return t}catch(t){if(!(0,r.D_)(t))throw new o.Z("invalid-image",`Could not fetch requested image at ${n}`);throw t}finally{window.URL.revokeObjectURL(n)}}(new Blob([l],{type:c}),e)}},24133:(t,e,n)=>{n.d(e,{Q:()=>s});var i=n(67676),o=n(44553),r=n(88764);class s{constructor(t=9,e){this._compareMinX=u,this._compareMinY=h,this._toBBox=t=>t,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&("function"==typeof e?this._toBBox=e:this._initFormat(e)),this.clear()}destroy(){this.clear(),g.prune(),b.prune(),v.prune(),M.prune()}all(t){this._all(this._data,t)}search(t,e){let n=this._data;const i=this._toBBox;if(_(t,n))for(g.clear();n;){for(let o=0,r=n.children.length;o<r;o++){const r=n.children[o],s=n.leaf?i(r):r;_(t,s)&&(n.leaf?e(r):y(t,s)?this._all(r,e):g.push(r))}n=g.pop()}}collides(t){let e=this._data;const n=this._toBBox;if(!_(t,e))return!1;for(g.clear();e;){for(let i=0,o=e.children.length;i<o;i++){const o=e.children[i],r=e.leaf?n(o):o;if(_(t,r)){if(e.leaf||y(t,r))return!0;g.push(o)}}e=g.pop()}return!1}load(t){if(!t.length)return this;if(t.length<this._minEntries){for(let e=0,n=t.length;e<n;e++)this.insert(t[e]);return this}let e=this._build(t.slice(0,t.length),0,t.length-1,0);if(this._data.children.length)if(this._data.height===e.height)this._splitRoot(this._data,e);else{if(this._data.height<e.height){const t=this._data;this._data=e,e=t}this._insert(e,this._data.height-e.height-1,!0)}else this._data=e;return this}insert(t){return t&&this._insert(t,this._data.height-1),this}clear(){return this._data=new C([]),this}remove(t){if(!t)return this;let e,n=this._data,o=null,r=0,s=!1;const a=this._toBBox(t);for(v.clear(),M.clear();n||v.length>0;){if(n||(n=v.pop(),o=v.data[v.length-1],r=M.pop()??0,s=!0),n.leaf&&(e=(0,i.cq)(n.children,t,n.children.length,n.indexHint),-1!==e))return n.children.splice(e,1),v.push(n),this._condense(v),this;s||n.leaf||!y(n,a)?o?(r++,n=o.children[r],s=!1):n=null:(v.push(n),M.push(r),r=0,o=n,n=n.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,e){let n=t;for(b.clear();n;){if(!0===n.leaf)for(const t of n.children)e(t);else b.pushArray(n.children);n=b.pop()??null}}_build(t,e,n,i){const o=n-e+1;let r=this._maxEntries;if(o<=r){const i=new C(t.slice(e,n+1));return a(i,this._toBBox),i}i||(i=Math.ceil(Math.log(o)/Math.log(r)),r=Math.ceil(o/r**(i-1)));const s=new R([]);s.height=i;const l=Math.ceil(o/r),c=l*Math.ceil(Math.sqrt(r));x(t,e,n,c,this._compareMinX);for(let o=e;o<=n;o+=c){const e=Math.min(o+c-1,n);x(t,o,e,l,this._compareMinY);for(let n=o;n<=e;n+=l){const o=Math.min(n+l-1,e);s.children.push(this._build(t,n,o,i-1))}}return a(s,this._toBBox),s}_chooseSubtree(t,e,n,i){for(;i.push(e),!0!==e.leaf&&i.length-1!==n;){let n,i=1/0,o=1/0;for(let r=0,s=e.children.length;r<s;r++){const s=e.children[r],a=d(s),l=m(t,s)-a;l<o?(o=l,i=a<i?a:i,n=s):l===o&&a<i&&(i=a,n=s)}e=n||e.children[0]}return e}_insert(t,e,n){const i=this._toBBox,o=n?t:i(t);v.clear();const r=this._chooseSubtree(o,this._data,e,v);for(r.children.push(t),c(r,o);e>=0&&v.data[e].children.length>this._maxEntries;)this._split(v,e),e--;this._adjustParentBBoxes(o,v,e)}_split(t,e){const n=t.data[e],i=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,i);const r=this._chooseSplitIndex(n,o,i);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const s=n.children.splice(r,n.children.length-r),l=n.leaf?new C(s):new R(s);l.height=n.height,a(n,this._toBBox),a(l,this._toBBox),e?t.data[e-1].children.push(l):this._splitRoot(n,l)}_splitRoot(t,e){this._data=new R([t,e]),this._data.height=t.height+1,a(this._data,this._toBBox)}_chooseSplitIndex(t,e,n){let i,o,r;i=o=1/0;for(let s=e;s<=n-e;s++){const e=l(t,0,s,this._toBBox),a=l(t,s,n,this._toBBox),c=f(e,a),u=d(e)+d(a);c<i?(i=c,r=s,o=u<o?u:o):c===i&&u<o&&(o=u,r=s)}return r}_chooseSplitAxis(t,e,n){const i=t.leaf?this._compareMinX:u,o=t.leaf?this._compareMinY:h;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,o)&&t.children.sort(i)}_allDistMargin(t,e,n,i){t.children.sort(i);const o=this._toBBox,r=l(t,0,e,o),s=l(t,n-e,n,o);let a=p(r)+p(s);for(let i=e;i<n-e;i++){const e=t.children[i];c(r,t.leaf?o(e):e),a+=p(r)}for(let i=n-e-1;i>=e;i--){const e=t.children[i];c(s,t.leaf?o(e):e),a+=p(s)}return a}_adjustParentBBoxes(t,e,n){for(let i=n;i>=0;i--)c(e.data[i],t)}_condense(t){for(let e=t.length-1;e>=0;e--){const n=t.data[e];if(0===n.children.length)if(e>0){const o=t.data[e-1],r=o.children;r.splice((0,i.cq)(r,n,r.length,o.indexHint),1)}else this.clear();else a(n,this._toBBox)}}_initFormat(t){const e=["return a"," - b",";"];this._compareMinX=new Function("a","b",e.join(t[0])),this._compareMinY=new Function("a","b",e.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function a(t,e){l(t,0,t.children.length,e,t)}function l(t,e,n,i,o){o||(o=new C([])),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(let r,s=e;s<n;s++)r=t.children[s],c(o,t.leaf?i(r):r);return o}function c(t,e){t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY)}function u(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function d(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function m(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function f(t,e){const n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),o=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,o-n)*Math.max(0,r-i)}function y(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function _(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function x(t,e,n,i,o){const s=[e,n];for(;s.length;){const e=s.pop(),n=s.pop();if(e-n<=i)continue;const a=n+Math.ceil((e-n)/i/2)*i;(0,r.q)(t,a,n,e,o),s.push(n,a,a,e)}}const g=new o.Z,b=new o.Z,v=new o.Z,M=new o.Z({deallocator:void 0});class w{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class P extends w{constructor(){super(...arguments),this.height=1,this.indexHint=new i.SO}}class C extends P{constructor(t){super(),this.children=t,this.leaf=!0}}class R extends P{constructor(t){super(),this.children=t,this.leaf=!1}}},17445:(t,e,n)=>{n.d(e,{N1:()=>d,YP:()=>l,Z_:()=>f,gx:()=>c,nn:()=>y,on:()=>h,tX:()=>_}),n(66643),n(46791);var i=n(91460),o=n(50758),r=n(70586),s=n(95330),a=n(26258);function l(t,e,n={}){return u(t,e,n,p)}function c(t,e,n={}){return u(t,e,n,m)}function u(t,e,n={},i){let o=null;const s=n.once?(t,n)=>{i(t)&&((0,r.hw)(o),e(t,n))}:(t,n)=>{i(t)&&e(t,n)};if(o=(0,a.aQ)(t,s,n.sync,n.equals),n.initial){const e=t();s(e,e)}return o}function h(t,e,n,s={}){let a=null,c=null,u=null;function h(){a&&c&&(c.remove(),s.onListenerRemove?.(a),a=null,c=null)}function d(t){s.once&&s.once&&(0,r.hw)(u),n(t)}const p=l(t,((t,n)=>{h(),(0,i.vT)(t)&&(a=t,c=(0,i.on)(t,e,d),s.onListenerAdd?.(t))}),{sync:s.sync,initial:!0});return u=(0,o.kB)((()=>{p.remove(),h()})),u}function d(t,e){return function(t,e,n){if((0,s.Hc)(n))return Promise.reject((0,s.zE)());const i=t();if(e?.(i))return Promise.resolve(i);let a=null;function l(){a=(0,r.hw)(a)}return new Promise(((i,r)=>{a=(0,o.AL)([(0,s.fu)(n,(()=>{l(),r((0,s.zE)())})),u(t,(t=>{l(),i(t)}),{sync:!1,once:!0},e??p)])}))}(t,m,e)}function p(t){return!0}function m(t){return!!t}n(87538);const f={sync:!0},y={initial:!0},_={sync:!0,initial:!0}},41123:(t,e,n)=>{n.d(e,{D:()=>o,z:()=>r});const i="randomUUID"in crypto;function o(){if(i)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=e=>t[e].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function r(){return`{${o()}}`}},73913:(t,e,n)=>{n.d(e,{Sy:()=>l,UZ:()=>s,XZ:()=>a,x3:()=>c});var i=n(58901),o=n(82971),r=n(33955);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:o.Z.WebMercator}),minus180Line:new i.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:o.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.Z({paths:[[[180,-180],[180,180]]],spatialReference:o.Z.WGS84}),minus180Line:new i.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:o.Z.WGS84})}};function a(t,e){return Math.ceil((t-e)/(2*e))}function l(t,e){const n=c(t);for(const t of n)for(const n of t)n[0]+=e;return t}function c(t){return(0,r.oU)(t)?t.rings:t.paths}},87085:(t,e,n)=>{n.d(e,{Z:()=>g});var i=n(43697),o=(n(66577),n(3172)),r=n(20102),s=n(32448),a=n(10699),l=n(83379),c=n(92604),u=n(95330),h=n(17452),d=n(5600),p=(n(75215),n(67676),n(80442),n(52011)),m=n(68773),f=n(6570),y=n(82971);let _=0,x=class extends(s.Z.EventedMixin((0,a.IG)(l.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.Z(-180,-90,180,90,y.Z.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=y.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(t){const e="string"==typeof t?{url:t}:t;return(await n.e(3529).then(n.bind(n,63529))).fromUrl(e)}static fromPortalItem(t){return async function(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:i}=await n.e(8008).then(n.bind(n,28008));try{return await i(e)}catch(t){const n=e&&e.portalItem,i=n?.id||"unset",o=n&&n.portal&&n.portal.url||m.default.portalUrl;throw c.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+i+"')",t),t}}(t)}initialize(){this.when().catch((t=>{(0,u.D_)(t)||c.Z.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})}))}destroy(){const t=this.parent;if(t){const e=this;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"referenceLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,h.mN)(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await(0,o.Z)(t,{query:{f:"json"},responseType:"json"})).data;throw new r.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,i._)([(0,d.Cb)({type:String})],x.prototype,"attributionDataUrl",void 0),(0,i._)([(0,d.Cb)({type:f.Z})],x.prototype,"fullExtent",void 0),(0,i._)([(0,d.Cb)({readOnly:!0})],x.prototype,"hasAttributionData",null),(0,i._)([(0,d.Cb)({type:String,clonable:!1})],x.prototype,"id",void 0),(0,i._)([(0,d.Cb)({type:Boolean,nonNullable:!0})],x.prototype,"legendEnabled",void 0),(0,i._)([(0,d.Cb)({type:["show","hide","hide-children"]})],x.prototype,"listMode",void 0),(0,i._)([(0,d.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],x.prototype,"opacity",void 0),(0,i._)([(0,d.Cb)({clonable:!1})],x.prototype,"parent",void 0),(0,i._)([(0,d.Cb)({readOnly:!0})],x.prototype,"parsedUrl",null),(0,i._)([(0,d.Cb)({type:Boolean,readOnly:!0})],x.prototype,"persistenceEnabled",void 0),(0,i._)([(0,d.Cb)({type:Boolean})],x.prototype,"popupEnabled",void 0),(0,i._)([(0,d.Cb)({type:Boolean})],x.prototype,"attributionVisible",void 0),(0,i._)([(0,d.Cb)({type:y.Z})],x.prototype,"spatialReference",void 0),(0,i._)([(0,d.Cb)({type:String})],x.prototype,"title",void 0),(0,i._)([(0,d.Cb)({readOnly:!0,json:{read:!1}})],x.prototype,"type",void 0),(0,i._)([(0,d.Cb)()],x.prototype,"url",void 0),(0,i._)([(0,d.Cb)({type:Boolean,nonNullable:!0})],x.prototype,"visible",void 0),x=(0,i._)([(0,p.j)("esri.layers.Layer")],x);const g=x},57765:(t,e,n)=>{n.r(e),n.d(e,{default:()=>re});var i=n(43697),o=n(46791),r=n(20102),s=n(92604),a=n(16453),l=n(5600),c=n(90578),u=(n(67676),n(80442),n(71715)),h=n(52011),d=n(30556),p=n(87085),m=n(71612),f=n(38009),y=n(72965),_=n(3172),x=n(70163),g=n(17452),b=n(41123),v=(n(75215),n(10699)),M=n(96674),w=n(83379),P=n(92036),C=n(21787),R=n(46521),I=n(4307),S=n(17896);const B=(0,n(65617).c)(),j=(0,R.a)(),T=(0,R.a)(),Z=(0,R.a)();function O(t,e,n){return(0,S.s)(B,e[0],e[1],1),(0,S.t)(B,B,(0,C.t)(j,n)),0===B[2]?(0,I.s)(t,B[0],B[1]):(0,I.s)(t,B[0]/B[2],B[1]/B[2])}function L(t,e,n){return E(T,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),E(Z,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),(0,C.m)(t,(0,C.a)(T,T),Z),0!==t[8]&&(t[0]/=t[8],t[1]/=t[8],t[2]/=t[8],t[3]/=t[8],t[4]/=t[8],t[5]/=t[8],t[6]/=t[8],t[7]/=t[8],t[8]/=t[8]),t}function E(t,e,n,i,o,r,s,a,l){(0,C.s)(t,e,i,r,n,o,s,1,1,1),(0,S.s)(B,a,l,1),(0,C.a)(j,t);const[c,u,h]=(0,S.t)(B,B,(0,C.t)(j,j));return(0,C.s)(j,c,0,0,0,u,0,0,0,h),(0,C.m)(t,j,t)}var X=n(62357),Y=n(97323),A=n(94139),N=n(38913),D=n(73615),U=n(82971),z=n(2368);let H=class extends z.j{projectOrWarn(t,e){if(null==t)return t;const{geometry:n,pending:i}=(0,D.projectOrLoad)(t,e);return i?null:i||n?n:(s.Z.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:t,sourceSpatialReference:t.spatialReference,targetSpatialReference:e}),null)}};H=(0,i._)([(0,h.j)("esri.layers.support.GeoreferenceBase")],H);const W=H,q=(0,R.a)(),V=(0,Y.a)();let F=class extends P.Z{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};(0,i._)([(0,l.Cb)()],F.prototype,"sourcePoint",void 0),(0,i._)([(0,l.Cb)({type:A.Z})],F.prototype,"mapPoint",void 0),F=(0,i._)([(0,h.j)("esri.layers.support.ControlPoint")],F);let G=class extends((0,M.eC)(W)){constructor(t){super(t),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(t,e){const n=U.Z.fromJSON(e.spatialReference),i=(0,R.f)(...e.coefficients,1);return t.map((t=>((0,I.s)(V,t.x,t.y),O(V,V,i),{sourcePoint:t,mapPoint:new A.Z({x:V[0],y:V[1],spatialReference:n})})))}writeControlPoints(t,e,n,i){if(null!=this.transform)null!=t&&J(t[0])&&(e.controlPoints=t.map((t=>{const e=t.sourcePoint;return{x:e.x,y:e.y}})),e.spatialReference=t[0].mapPoint.spatialReference.toJSON(),e.coefficients=this.transform.slice(0,8));else{const t=new r.Z("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration.",{layer:i?.layer,georeference:this});i?.messages?i.messages.push(t):s.Z.getLogger(this).error(t.name,t.message)}}get coords(){if(null==this.controlPoints)return null;const t=this._updateTransform(q);if(null==t||!J(this.controlPoints[0]))return null;const e=this.controlPoints[0].mapPoint.spatialReference;return function(t,e,n,i){const o=(0,Y.f)(0,n),r=(0,Y.f)(0,0),s=(0,Y.f)(e,0),a=(0,Y.f)(e,n);return O(o,o,t),O(r,r,t),O(s,s,t),O(a,a,t),new N.Z({rings:[[o,r,s,a,o]],spatialReference:i})}(t,this.width,this.height,e)}set coords(t){if(null==this.controlPoints||!J(this.controlPoints[0]))return;const e=this.controlPoints[0].mapPoint.spatialReference;if(null==(t=this.projectOrWarn(t,e)))return;const{width:n,height:i}=this,{rings:[[o,r,s,a]]}=t,l={sourcePoint:(0,X.vW)(0,i),mapPoint:new A.Z({x:o[0],y:o[1],spatialReference:e})},c={sourcePoint:(0,X.vW)(0,0),mapPoint:new A.Z({x:r[0],y:r[1],spatialReference:e})},u={sourcePoint:(0,X.vW)(n,0),mapPoint:new A.Z({x:s[0],y:s[1],spatialReference:e})},h={sourcePoint:(0,X.vW)(n,i),mapPoint:new A.Z({x:a[0],y:a[1],spatialReference:e})};J(l)&&J(c)&&J(u)&&J(h)&&(st(q,l,c,u,h),this.controlPoints=this.controlPoints.map((({sourcePoint:t})=>((0,I.s)(V,t.x,t.y),O(V,V,q),{sourcePoint:t,mapPoint:new A.Z({x:V[0],y:V[1],spatialReference:e})}))))}get inverseTransform(){return null==this.transform?null:(0,C.d)((0,R.a)(),this.transform)}get transform(){return this._updateTransform()}toMap(t){if(null==t||null==this.transform||null==this.controlPoints||!J(this.controlPoints[0]))return null;(0,I.s)(V,t.x,t.y);const e=this.controlPoints[0].mapPoint.spatialReference;return O(V,V,this.transform),new A.Z({x:V[0],y:V[1],spatialReference:e})}toSource(t){if(null==t||null==this.inverseTransform||null==this.controlPoints||!J(this.controlPoints[0]))return null;const e=this.controlPoints[0].mapPoint.spatialReference;return t=t.normalize(),null==(t=(0,D.projectOrLoad)(t,e).geometry)?null:((0,I.s)(V,t.x,t.y),O(V,V,this.inverseTransform),(0,X.vW)(V[0],V[1]))}toSourceNormalized(t){const e=this.toSource(t);return null!=e&&(e.x/=this.width,e.y/=this.height),e}_updateTransform(t){const{controlPoints:e,width:n,height:i}=this;if(!(null!=e&&n>0&&i>0))return null;const[o,r,s,a]=e;if(!J(o))return null;const l=o.mapPoint.spatialReference,c=this._projectControlPoint(r,l),u=this._projectControlPoint(s,l),h=this._projectControlPoint(a,l);if(!c.valid||!u.valid||!h.valid)return null;if(!J(c.controlPoint))return null;null==t&&(t=(0,R.a)());let d=null;return d=J(u.controlPoint)&&J(h.controlPoint)?st(t,o,c.controlPoint,u.controlPoint,h.controlPoint):J(u.controlPoint)?function(t,e,n,i){return rt(k,tt,e),rt($,et,n),rt(K,nt,i),(0,I.l)(Q,k,$,.5),(0,I.r)(Q,K,Q,Math.PI),(0,I.l)(it,tt,et,.5),(0,I.r)(it,nt,it,Math.PI),ut(t,k,$,K,Q,tt,et,nt,it)}(t,o,c.controlPoint,u.controlPoint):function(t,e,n){return rt(k,tt,e),rt($,et,n),(0,I.r)(K,$,k,ot),(0,I.r)(Q,k,$,ot),(0,I.r)(nt,et,tt,-ot),(0,I.r)(it,tt,et,-ot),ut(t,k,$,K,Q,tt,et,nt,it)}(t,o,c.controlPoint),d.every((t=>0===t))?null:d}_projectControlPoint(t,e){if(!J(t))return{valid:!0,controlPoint:t};const{sourcePoint:n,mapPoint:i}=t,{geometry:o,pending:r}=(0,D.projectOrLoad)(i,e);return r?{valid:!1,controlPoint:null}:r||o?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:o}}:(s.Z.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:t,sourceSpatialReference:i.spatialReference,targetSpatialReference:e}),{valid:!1,controlPoint:null})}};function J(t){return null!=t?.sourcePoint&&null!=t.mapPoint}(0,i._)([(0,l.Cb)({type:[F],json:{write:{allowNull:!1,isRequired:!0}}})],G.prototype,"controlPoints",void 0),(0,i._)([(0,u.r)("controlPoints")],G.prototype,"readControlPoints",null),(0,i._)([(0,d.c)("controlPoints")],G.prototype,"writeControlPoints",null),(0,i._)([(0,l.Cb)()],G.prototype,"coords",null),(0,i._)([(0,l.Cb)({json:{write:!0}})],G.prototype,"height",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],G.prototype,"inverseTransform",null),(0,i._)([(0,l.Cb)({readOnly:!0})],G.prototype,"transform",null),(0,i._)([(0,l.Cb)({json:{write:!0}})],G.prototype,"width",void 0),G=(0,i._)([(0,h.j)("esri.layers.support.ControlPointsGeoreference")],G);const k=(0,Y.a)(),$=(0,Y.a)(),K=(0,Y.a)(),Q=(0,Y.a)(),tt=(0,Y.a)(),et=(0,Y.a)(),nt=(0,Y.a)(),it=(0,Y.a)(),ot=Math.PI/2;function rt(t,e,n){(0,I.s)(t,n.sourcePoint.x,n.sourcePoint.y),(0,I.s)(e,n.mapPoint.x,n.mapPoint.y)}function st(t,e,n,i,o){return rt(k,tt,e),rt($,et,n),rt(K,nt,i),rt(Q,it,o),ut(t,k,$,K,Q,tt,et,nt,it)}const at=new Array(8).fill(0),lt=new Array(8).fill(0);function ct(t,e,n,i,o){return t[0]=e[0],t[1]=e[1],t[2]=n[0],t[3]=n[1],t[4]=i[0],t[5]=i[1],t[6]=o[0],t[7]=o[1],t}function ut(t,e,n,i,o,r,s,a,l){return L(t,ct(at,e,n,i,o),ct(lt,r,s,a,l))}const ht=G,dt=(0,Y.a)();let pt=class extends W{constructor(t){super(t),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:t,topRight:e,bottomLeft:n,bottomRight:i}=this;if(null==t||null==e||null==n||null==i)return null;const o=t.spatialReference;return e=this.projectOrWarn(e,o),n=this.projectOrWarn(n,o),i=this.projectOrWarn(i,o),null==e||null==n||null==i?null:new N.Z({rings:[[[n.x,n.y],[t.x,t.y],[e.x,e.y],[i.x,i.y],[n.x,n.y]]],spatialReference:o})}set coords(t){const{topLeft:e}=this;if(null==e)return;const n=e.spatialReference;if(null==(t=this.projectOrWarn(t,n)))return;const{rings:[[i,o,r,s]]}=t;this.bottomLeft=new A.Z({x:i[0],y:i[1],spatialReference:n}),this.topLeft=new A.Z({x:o[0],y:o[1],spatialReference:n}),this.topRight=new A.Z({x:r[0],y:r[1],spatialReference:n}),this.bottomRight=new A.Z({x:s[0],y:s[1],spatialReference:n})}toSourceNormalized(t){const{topLeft:e,topRight:n,bottomRight:i,bottomLeft:o}=this;if(null==t||null==e||null==n||null==i||null==o)return null;const r=e.spatialReference;t=t.normalize();const s=(0,D.projectOrLoad)(t,r).geometry;if(null==s)return null;(0,I.s)(dt,s.x,s.y);const a=L((0,R.a)(),[e.x,e.y,o.x,o.y,n.x,n.y,i.x,i.y],[0,0,0,1,1,0,1,1]);return O(dt,dt,a),(0,X.vW)(dt[0],dt[1])}};(0,i._)([(0,l.Cb)()],pt.prototype,"coords",null),(0,i._)([(0,l.Cb)({type:A.Z})],pt.prototype,"bottomLeft",void 0),(0,i._)([(0,l.Cb)({type:A.Z})],pt.prototype,"bottomRight",void 0),(0,i._)([(0,l.Cb)({type:A.Z})],pt.prototype,"topLeft",void 0),(0,i._)([(0,l.Cb)({type:A.Z})],pt.prototype,"topRight",void 0),pt=(0,i._)([(0,h.j)("esri.layers.support.CornersGeoreference")],pt);const mt=pt;var ft=n(22021),yt=n(46851),_t=n(6570);let xt=class extends W{constructor(t){super(t),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(null==this.extent)return null;const{xmin:t,ymin:e,xmax:n,ymax:i,spatialReference:o}=this.extent;let r;if(this.rotation){const{x:o,y:s}=this.extent.center,a=gt(o,s,this.rotation);r=[a(t,e),a(t,i),a(n,i),a(n,e)],r.push(r[0])}else r=[[t,e],[t,i],[n,i],[n,e],[t,e]];return new N.Z({rings:[r],spatialReference:o})}set coords(t){if(null==t||null==this.extent)return;const e=this.extent.spatialReference;if(t=this.projectOrWarn(t,e),null==t?.extent)return;const{rings:[[n,i,o]],extent:{center:{x:r,y:s}}}=t,a=(0,ft.BV)(Math.PI/2-Math.atan2(i[1]-n[1],i[0]-n[0])),l=gt(r,s,-a),[c,u]=l(n[0],n[1]),[h,d]=l(o[0],o[1]);this.extent=new _t.Z({xmin:c,ymin:u,xmax:h,ymax:d,spatialReference:e}),this.rotation=a}toSourceNormalized(t){const{extent:e,rotation:n}=this;if(null==t||null==e)return null;const{xmin:i,ymin:o,xmax:r,ymax:s,center:a,spatialReference:l}=e;t=t.normalize();const c=(0,D.projectOrLoad)(t,l).geometry;if(null==c)return null;let u=c.x,h=c.y;return n&&([u,h]=gt(a.x,a.y,-n)(u,h)),(0,X.vW)((0,ft.bA)(u,i,r,0,1),(0,ft.bA)(h,s,o,0,1))}};function gt(t,e,n){const i=(0,yt.t)(n),o=Math.cos(i),r=Math.sin(i);return(n,i)=>[o*(n-t)+r*(i-e)+t,o*(i-e)-r*(n-t)+e]}(0,i._)([(0,l.Cb)()],xt.prototype,"coords",null),(0,i._)([(0,l.Cb)({type:_t.Z})],xt.prototype,"extent",void 0),(0,i._)([(0,l.Cb)({type:Number})],xt.prototype,"rotation",void 0),xt=(0,i._)([(0,h.j)("esri.layers.support.ExtentAndRotationGeoreference")],xt);const bt={key:"type",base:W,typeMap:{"control-points":ht,corners:mt,"extent-and-rotation":xt}};let vt=class extends((0,v.iv)((0,M.eC)(w.Z))){constructor(t){super(t),this.georeference=null,this.opacity=1}readGeoreference(t){return ht.fromJSON(t)}get contentWidth(){return 0}get contentHeight(){return 0}toSource(t){const{georeference:e,contentWidth:n,contentHeight:i}=this;if(null==t||null==e||0===n||0===i)return null;const o=e.toSourceNormalized(t);return null==o?null:(o.x*=n,o.y*=i,o)}};(0,i._)([(0,l.Cb)({types:bt,json:{write:!0}})],vt.prototype,"georeference",void 0),(0,i._)([(0,u.r)("georeference")],vt.prototype,"readGeoreference",null),(0,i._)([(0,l.Cb)()],vt.prototype,"opacity",void 0),vt=(0,i._)([(0,h.j)("esri.layers.support.MediaElementBase")],vt);const Mt=vt;var wt=n(66094),Pt=n(25929);let Ct=class extends Mt{constructor(t){super(t),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const t=this.image;if("string"==typeof t){const e=(0,x.n$)(t).then((t=>{this._set("content",t)}));this.addResolvingPromise(e)}else if(t instanceof HTMLImageElement){const e=t.decode().then((()=>{this._set("content",t)}));this.addResolvingPromise(e)}else t?this._set("content",t):this.addResolvingPromise(Promise.reject(new r.Z("image-element:invalid-image-type","Invalid image type",{image:t})));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(t,e,n){return(0,Pt.f)(e.url,n)}writeImage(t,e,n,i){if(null==t)return;const o=i?.portalItem,r=i?.resources;if(!o||!r)return void("string"==typeof t&&(e[n]=(0,Pt.t)(t,i)));const s="string"!=typeof t||(0,g.HK)(t)||(0,g.jc)(t)?null:t;if(s){if(null==(0,Pt.i)(s))return void(e[n]=s);const t=(0,Pt.t)(s,{...i,verifyItemRelativeUrls:i?.verifyItemRelativeUrls?{writtenUrls:i.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},Pt.M.NO);if(o&&t&&!(0,g.YP)(t))return r.toKeep.push({resource:o.resourceFromPath(t),compress:!1}),void(e[n]=t)}e[n]="<pending>",r.pendingOperations.push(async function(t){return"string"==typeof t?(0,g.HK)(t)?(0,g.fw)(t):(await(0,_.Z)(t,{responseType:"blob"})).data:new Promise((e=>function(t){if(t instanceof HTMLCanvasElement)return t;const e=t instanceof HTMLImageElement?t.naturalWidth:t.width,n=t instanceof HTMLImageElement?t.naturalHeight:t.height,i=document.createElement("canvas"),o=i.getContext("2d");return i.width=e,i.height=n,t instanceof HTMLImageElement?o.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&o.putImageData(t,0,0),i}(t).toBlob(e)))}(t).then((t=>{const i=function(t,e){const n=(0,b.D)(),i=`${(0,g.v_)("media",n)}.${(0,wt.B)({type:"blob",blob:t})}`;return e.resourceFromPath(i)}(t,o);e[n]=i.itemRelativeUrl,r.toAdd.push({resource:i,content:{type:"blob",blob:t},compress:!1,finish:t=>{this.image=t.url}})})))}};(0,i._)([(0,l.Cb)()],Ct.prototype,"animationOptions",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],Ct.prototype,"content",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],Ct.prototype,"contentWidth",null),(0,i._)([(0,l.Cb)({readOnly:!0})],Ct.prototype,"contentHeight",null),(0,i._)([(0,l.Cb)({json:{name:"url",type:String}})],Ct.prototype,"image",void 0),(0,i._)([(0,u.r)("image",["url"])],Ct.prototype,"readImage",null),(0,i._)([(0,d.c)("image")],Ct.prototype,"writeImage",null),(0,i._)([(0,l.Cb)({readOnly:!0,json:{name:"mediaType"}})],Ct.prototype,"type",void 0),Ct=(0,i._)([(0,h.j)("esri.layers.support.ImageElement")],Ct);const Rt=Ct;n(66577);var It=n(70921),St=n(32448),Bt=n(609),jt=n(95330),Tt=n(17445),Zt=n(24470),Ot=n(87416),Lt=n(8744),Et=n(37549),Xt=n(20322),Yt=n(86662),At=n(33955),Nt=n(73913);function Dt(t,e,n){if(Array.isArray(t)){const i=t[0];if(i>e){const n=(0,Nt.XZ)(i,e);t[0]=i+n*(-2*e)}else if(i<n){const e=(0,Nt.XZ)(i,n);t[0]=i+e*(-2*n)}}else{const i=t.x;if(i>e){const n=(0,Nt.XZ)(i,e);t.x+=n*(-2*e)}else if(i<n){const e=(0,Nt.XZ)(i,n);t.x+=e*(-2*n)}}return t}function Ut(t,e){const n=[],{ymin:i,ymax:o,xmin:r,xmax:s}=t,a=t.xmax-t.xmin,[l,c]=e.valid,{x:u,frameId:h}=zt(t.xmin,e),{x:d,frameId:p}=zt(t.xmax,e),m=u===d&&a>0;if(a>2*c){const t={xmin:r<s?u:d,ymin:i,xmax:c,ymax:o},e={xmin:l,ymin:i,xmax:r<s?d:u,ymax:o},a={xmin:0,ymin:i,xmax:c,ymax:o},m={xmin:l,ymin:i,xmax:0,ymax:o},f=[],y=[];Ht(t,a)&&f.push(h),Ht(t,m)&&y.push(h),Ht(e,a)&&f.push(p),Ht(e,m)&&y.push(p);for(let t=h+1;t<p;t++)f.push(t),y.push(t);n.push(new Vt(t,[h]),new Vt(e,[p]),new Vt(a,f),new Vt(m,y))}else u>d||m?n.push(new Vt({xmin:u,ymin:i,xmax:c,ymax:o},[h]),new Vt({xmin:l,ymin:i,xmax:d,ymax:o},[p])):n.push(new Vt({xmin:u,ymin:i,xmax:d,ymax:o},[h]));return n}function zt(t,e){const[n,i]=e.valid,o=2*i;let r,s=0;return t>i?(r=Math.ceil(Math.abs(t-i)/o),t-=r*o,s=r):t<n&&(r=Math.ceil(Math.abs(t-n)/o),t+=r*o,s=-r),{x:t,frameId:s}}function Ht(t,e){const{xmin:n,ymin:i,xmax:o,ymax:r}=e;return Wt(t,n,i)&&Wt(t,n,r)&&Wt(t,o,r)&&Wt(t,o,i)}function Wt(t,e,n){return e>=t.xmin&&e<=t.xmax&&n>=t.ymin&&n<=t.ymax}function qt(t,e,n=!0){const i=!(0,At.l9)(t);if(i&&(0,Yt.Zy)(t),n)return(new Gt).cut(t,e);const o=i?t.rings:t.paths,r=i?4:2,s=o.length,a=-2*e;for(let t=0;t<s;t++){const e=o[t];if(e&&e.length>=r){const t=[];for(const n of e)t.push([n[0]+a,n[1]]);o.push(t)}}return i?t.rings=o:t.paths=o,t}class Vt{constructor(t,e){this.extent=t,this.frameIds=e}}const Ft=(0,Zt.Ue)();class Gt{constructor(){this._linesIn=[],this._linesOut=[]}cut(t,e){let n;if(this._xCut=e,t.rings)this._closed=!0,n=t.rings,this._minPts=4;else{if(!t.paths)return null;this._closed=!1,n=t.paths,this._minPts=2}for(const t of n){if(!t||t.length<this._minPts)continue;let e=!0;for(const n of t)e?(this.moveTo(n),e=!1):this.lineTo(n);this._closed&&this.close()}this._pushLineIn(),this._pushLineOut(),n=[];for(const t of this._linesIn)t&&t.length>=this._minPts&&n.push(t);const i=-2*this._xCut;for(const t of this._linesOut)if(t&&t.length>=this._minPts){for(const e of t)e[0]+=i;n.push(t)}return this._closed?t.rings=n:t.paths=n,t}moveTo(t){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(t[0]),this._moveTo(t[0],t[1],this._prevSide),this._prevPt=t,this._firstPt=t}lineTo(t){const e=this._side(t[0]);if(e*this._prevSide==-1){const n=this._intersect(this._prevPt,t);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(t[0],t[1],e)}else this._lineTo(t[0],t[1],e);this._prevSide=e,this._prevPt=t}close(){const t=this._firstPt,e=this._prevPt;t[0]===e[0]&&t[1]===e[1]||this.lineTo(t),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(t,e,n){this._closed?(this._lineIn.push([n<=0?t:this._xCut,e]),this._lineOut.push([n>=0?t:this._xCut,e])):(n<=0&&this._lineIn.push([t,e]),n>=0&&this._lineOut.push([t,e]))}_lineTo(t,e,n){this._closed?(this._addPolyVertex(this._lineIn,n<=0?t:this._xCut,e),this._addPolyVertex(this._lineOut,n>=0?t:this._xCut,e)):n<0?(0===this._prevSide&&this._pushLineOut(),this._lineIn.push([t,e])):n>0?(0===this._prevSide&&this._pushLineIn(),this._lineOut.push([t,e])):this._prevSide<0?(this._lineIn.push([t,e]),this._lineOut.push([t,e])):this._prevSide>0&&(this._lineOut.push([t,e]),this._lineIn.push([t,e]))}_addPolyVertex(t,e,n){const i=t.length;i>1&&t[i-1][0]===e&&t[i-2][0]===e?t[i-1][1]=n:t.push([e,n])}_checkClosingPt(t){const e=t.length;e>3&&t[0][0]===this._xCut&&t[e-2][0]===this._xCut&&t[1][0]===this._xCut&&(t[0][1]=t[e-2][1],t.pop())}_side(t){return t<this._xCut?-1:t>this._xCut?1:0}_intersect(t,e){const n=(this._xCut-t[0])/(e[0]-t[0]);return t[1]+n*(e[1]-t[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=[]}}let Jt=class extends P.Z{constructor(t){super(t)}get bounds(){const t=this.coords;return null==t?.extent?null:(0,Zt.oJ)(t.extent)}get coords(){const t=this.element.georeference?.coords;return(0,D.projectOrLoad)(t,this.spatialReference).geometry}get normalizedCoords(){return N.Z.fromJSON(function(t,e){if(null==t)return null;const n=t.spatialReference,i=(0,Lt.C5)(n),o=(0,M.AK)(t)?t.toJSON():t;if(!i)return o;const r=(0,Lt.sS)(n)?102100:4326,s=Nt.UZ[r].maxX,a=Nt.UZ[r].minX;if((0,At.wp)(o))return Dt(o,s,a);if((0,At.aW)(o))return o.points=o.points.map((t=>Dt(t,s,a))),o;if((0,At.YX)(o))return function(t,e){if(!e)return t;const n=Ut(t,e).map((t=>t.extent));return n.length<2?n[0]||t:n.length>2?(t.xmin=e.valid[0],t.xmax=e.valid[1],t):{rings:n.map((t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]))}}(o,i);if((0,At.oU)(o)||(0,At.l9)(o)){const t=(0,Xt.$P)(Ft,o),n={xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]},i=(0,Nt.XZ)(n.xmin,a)*(2*s),r=0===i?o:(0,Nt.Sy)(o,i);return n.xmin+=i,n.xmax+=i,n.xmax>s?qt(r,s,e):n.xmin<a?qt(r,a,e):r}return o}(this.coords,!0))}get normalizedBounds(){const t=null!=this.normalizedCoords?this.normalizedCoords.extent:null;return null!=t?(0,Zt.oJ)(t):null}};(0,i._)([(0,l.Cb)()],Jt.prototype,"spatialReference",void 0),(0,i._)([(0,l.Cb)()],Jt.prototype,"element",void 0),(0,i._)([(0,l.Cb)()],Jt.prototype,"bounds",null),(0,i._)([(0,l.Cb)()],Jt.prototype,"coords",null),(0,i._)([(0,l.Cb)()],Jt.prototype,"normalizedCoords",null),(0,i._)([(0,l.Cb)()],Jt.prototype,"normalizedBounds",null),Jt=(0,i._)([(0,h.j)("esri.layers.support.MediaElementView")],Jt);var kt=n(91460);let $t=class extends Mt{constructor(t){super(t),this.autoplay=!0,this.content=null,this.type="video"}load(){const t=this.video;if("string"==typeof t){const e=document.createElement("video");e.src=t,e.crossOrigin="anonymous",e.autoplay=!0,e.muted=!0,e.loop=!0,this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)})))}else t instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(t).then((()=>{this._set("content",t)}))):this.addResolvingPromise(Promise.reject(new r.Z("video-element:invalid-video-type","Invalid video type",{video:t})));return Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(t){"not-loaded"===this.loadStatus?this._set("video",t):s.Z.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}_loadVideo(t){return new Promise(((e,n)=>{const i=(0,kt.IH)(t,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?t.play().then(e,n):e()}));this.addHandles(i,"canplay"),"anonymous"!==t.crossOrigin&&(t.crossOrigin="anonymous",t.src?.includes("blob:")||(t.src=t.src))}))}};(0,i._)([(0,l.Cb)()],$t.prototype,"autoplay",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],$t.prototype,"content",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],$t.prototype,"contentWidth",null),(0,i._)([(0,l.Cb)({readOnly:!0})],$t.prototype,"contentHeight",null),(0,i._)([(0,l.Cb)()],$t.prototype,"video",null),$t=(0,i._)([(0,h.j)("esri.layers.support.VideoElement")],$t);const Kt=$t,Qt={key:"type",defaultKeyValue:"image",base:Mt,typeMap:{image:Rt,video:Kt}},te=o.Z.ofType(Qt);let ee=class extends(w.Z.LoadableMixin((0,Bt.v)(St.Z.EventedAccessor))){constructor(t){super(t),this._index=new Et.H,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const e of t.removed){const t=this._elementViewsMap.get(e);this._elementViewsMap.delete(e),this._index.delete(t),this.removeHandles(t),t.destroy(),this.notifyChange("fullExtent")}const{spatialReference:e}=this;for(const n of t.added){if(this._elementViewsMap.get(n))continue;const t=new Jt({spatialReference:e,element:n});this._elementViewsMap.set(n,t);const i=(0,Tt.YP)((()=>t.coords),(()=>this._updateIndexForElement(t,!1)));this._updateIndexForElement(t,!0),this.addHandles(i,t)}this._elementsIndexes.clear(),this.elements.forEach(((t,e)=>this._elementsIndexes.set(t,e))),this.emit("refresh")},this.elements=new te}async load(t){if((0,jt.k_)(t),!this.spatialReference){const t=this.elements.find((t=>null!=t.georeference?.coords));this._set("spatialReference",t?t.georeference.coords.spatialReference:U.Z.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(t){this._set("elements",(0,It.Z)(t,this._get("elements"),te))}get fullExtent(){if("not-loaded"===this.loadStatus)return null;const t=this._index.fullBounds;return null==t?null:new _t.Z({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:this.spatialReference})}set spatialReference(t){"not-loaded"===this.loadStatus?this._set("spatialReference",t):s.Z.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(t,e){await this.load(),await(0,D.initializeProjection)(t.spatialReference,this.spatialReference,null,e);const n=(0,Lt.fS)(t.spatialReference,this.spatialReference)?t:(0,D.project)(t,this.spatialReference);if(!n)return[];const i=n.normalize(),o=[];for(const t of i)this._index.forEachInBounds((0,Zt.oJ)(t),(({normalizedCoords:e,element:n})=>{null!=e&&(0,Ot.Nl)(t,e)&&o.push(n)}));return o.sort(((t,e)=>this._elementsIndexes.get(t)-this._elementsIndexes.get(e))),o}_updateIndexForElement(t,e){const n=t.normalizedBounds,i=this._index.has(t),o=null!=n;this._index.delete(t),o&&this._index.set(t,n),this.notifyChange("fullExtent"),e||(i!==o?this.emit("refresh"):this.emit("change",{element:t.element}))}};(0,i._)([(0,l.Cb)()],ee.prototype,"elements",null),(0,i._)([(0,l.Cb)({readOnly:!0})],ee.prototype,"fullExtent",null),(0,i._)([(0,l.Cb)()],ee.prototype,"spatialReference",null),ee=(0,i._)([(0,h.j)("esri.layers.support.LocalMediaElementSource")],ee);const ne=ee;function ie(t){return"object"==typeof t&&null!=t&&"type"in t}let oe=class extends((0,m.h)((0,y.M)((0,f.q)((0,a.R)(p.Z))))){constructor(t){super(t),this.effectiveSource=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this.source=new ne}load(t){const e=this.source;if(!e)return this.addResolvingPromise(Promise.reject(new r.Z("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer."))),Promise.resolve(this);const n=ie(e)?new ne({elements:new o.Z([e])}):e;this._set("effectiveSource",n),this.spatialReference&&(n.spatialReference=this.spatialReference);const i=n.load(t).then((()=>{this.spatialReference=n.spatialReference}));return this.addResolvingPromise(i),Promise.resolve(this)}destroy(){this.effectiveSource?.destroy(),this.source?.destroy()}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(t){"not-loaded"===this.loadStatus?this._set("source",t):s.Z.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(t){return t?Array.isArray(t)?new ne({elements:new o.Z(t)}):t instanceof o.Z?new ne({elements:t}):t:null}readSource(t,e,n){const i="image"===e.mediaType?new Rt:"video"===e.mediaType?new Kt:null;return i?.read(e,n),i}writeSource(t,e,n,i){t&&ie(t)&&"image"===t.type?t.write(e,i):i?.messages&&i?.messages?.push(new r.Z("media-layer:unsupported-source","source must be an 'ImageElement'"))}};(0,i._)([(0,l.Cb)({readOnly:!0})],oe.prototype,"effectiveSource",void 0),(0,i._)([(0,l.Cb)({type:String})],oe.prototype,"copyright",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],oe.prototype,"fullExtent",null),(0,i._)([(0,l.Cb)({type:["MediaLayer"]})],oe.prototype,"operationalLayerType",void 0),(0,i._)([(0,l.Cb)({type:["show","hide"]})],oe.prototype,"listMode",void 0),(0,i._)([(0,l.Cb)({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1}}})],oe.prototype,"source",null),(0,i._)([(0,c.p)("source")],oe.prototype,"castSource",null),(0,i._)([(0,u.r)("source",["url"])],oe.prototype,"readSource",null),(0,i._)([(0,d.c)("source")],oe.prototype,"writeSource",null),(0,i._)([(0,l.Cb)()],oe.prototype,"spatialReference",void 0),(0,i._)([(0,l.Cb)({readOnly:!0})],oe.prototype,"type",void 0),oe=(0,i._)([(0,h.j)("esri.layers.MediaLayer")],oe);const re=oe},37549:(t,e,n)=>{n.d(e,{H:()=>a});var i=n(80442),o=n(24133),r=n(24470);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 o.Q(9,(0,i.Z)("esri-csp-restrictions")?t=>({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const t=new Array(this._idByBounds.size);let e=0;this._idByBounds.forEach(((n,i)=>{t[e++]=i})),this._indexInvalid=!1,this._index.clear(),this._index.load(t)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter((t=>this._idByBounds.has(t)))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const t=(0,r.cS)();for(const e of this._boundsById.values())e&&(t[0]=Math.min(e[0],t[0]),t[1]=Math.min(e[1],t[1]),t[2]=Math.max(e[2],t[2]),t[3]=Math.max(e[3],t[3]));return t}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(t){const e=this._boundsById.get(t);this._boundsById.delete(t),e&&(this._idByBounds.delete(e),this._indexInvalid||this._index.remove(e))}forEachInBounds(t,e){this._loadIndex(),function(t,e,n){(function(t){s.minX=t[0],s.minY=t[1],s.maxX=t[2],s.maxY=t[3]})(e),t.search(s,n)}(this._index,t,(t=>e(this._idByBounds.get(t))))}get(t){return this._boundsById.get(t)}has(t){return this._boundsById.has(t)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(t,e){if(!this._indexInvalid){const e=this._boundsById.get(t);e&&(this._index.remove(e),this._idByBounds.delete(e))}this._boundsById.set(t,e),e&&(this._idByBounds.set(e,t),this._indexInvalid||(this._boundsToLoad.push(e),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},66094:(t,e,n)=>{n.d(e,{B:()=>o});var i=n(17452);function o(t){return r[function(t){return"json"===t.type?"application/json":"blob"===t.type?t.blob.type:function(t){const e=(0,i.Ml)(t);return l[e]||s}(t.url)}(t)]||a}const r={},s="text/plain",a=r[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 t in l)r[l[t]]=t}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8853],{41993:e=>{function t(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=()=>[],t.resolve=t,t.id=41993,e.exports=t},35454:(e,t,r)=>{"use strict";r.d(t,{X:()=>i,w:()=>o});var s=r(78286);class i{constructor(e,t={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=t,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(e),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=e=>this.fromJSON(e),this.write=(e,t,r)=>{const i=this.toJSON(e);void 0!==i&&(0,s.RB)(r,i,t)},this.write.isJSONMapWriter=!0}toJSON(e){if(null==e)return null;if(this._apiToJSON.hasOwnProperty(e)){const t=this._apiToJSON[e];return this._options.useNumericKeys?+t:t}return this._options.ignoreUnknown?void 0:e}fromJSON(e){return null!=e&&this._jsonToAPI.hasOwnProperty(e)?this._jsonToAPI[e]:this._options.ignoreUnknown?void 0:e}_invertMap(e){const t={};for(const r in e)t[e[r]]=r;return t}_getKeysSorted(e){const t=[];for(const r in e)t.push(r);return t.sort(),t}}function o(){return function(e,t){return new i(e,{ignoreUnknown:!0,...t})}}},17445:(e,t,r)=>{"use strict";r.d(t,{N1:()=>p,YP:()=>l,Z_:()=>_,gx:()=>h,nn:()=>g,on:()=>c,tX:()=>v}),r(66643),r(46791);var s=r(91460),i=r(50758),o=r(70586),n=r(95330),a=r(26258);function l(e,t,r={}){return d(e,t,r,u)}function h(e,t,r={}){return d(e,t,r,f)}function d(e,t,r={},s){let i=null;const n=r.once?(e,r)=>{s(e)&&((0,o.hw)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.aQ)(e,n,r.sync,r.equals),r.initial){const t=e();n(t,t)}return i}function c(e,t,r,n={}){let a=null,h=null,d=null;function c(){a&&h&&(h.remove(),n.onListenerRemove?.(a),a=null,h=null)}function p(e){n.once&&n.once&&(0,o.hw)(d),r(e)}const u=l(e,((e,r)=>{c(),(0,s.vT)(e)&&(a=e,h=(0,s.on)(e,t,p),n.onListenerAdd?.(e))}),{sync:n.sync,initial:!0});return d=(0,i.kB)((()=>{u.remove(),c()})),d}function p(e,t){return function(e,t,r){if((0,n.Hc)(r))return Promise.reject((0,n.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,o.hw)(a)}return new Promise(((s,o)=>{a=(0,i.AL)([(0,n.fu)(r,(()=>{l(),o((0,n.zE)())})),d(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??u)])}))}(e,f,t)}function u(e){return!0}function f(e){return!!e}r(87538);const _={sync:!0},g={initial:!0},v={sync:!0,initial:!0}},41123:(e,t,r)=>{"use strict";r.d(t,{D:()=>i,z:()=>o});const s="randomUUID"in crypto;function i(){if(s)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()}}`}},53865:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>vt});var s=r(40330),i=r(43697),o=r(68773),n=r(3172),a=r(20102),l=r(32448),h=r(91460),d=r(22974),c=r(78286),p=r(95330),u=r(17445),f=r(17452),_=r(5600),g=(r(75215),r(52011)),v=(r(67676),r(80442),r(940)),m=(r(2587),r(60235));Element.prototype.closest;var y=r(92604),w=r(70586),S=r(609),I=r(41123),k=r(90578),A=r(58971),b=r(38805),U=r(8728),C=r(3894),T=r(50758);const x=new Map;function P(){x.clear()}function O(e){x.delete(e)}y.Z.getLogger("esri.widgets.support.widgetUtils");function R(e){const t=C.Z.acquire();for(let e=0;e<arguments.length;e++){const r=arguments[e],s=typeof r;if("string"===s)t.push(r);else if(Array.isArray(r))t.push.apply(t,r);else if("object"===s)for(const e in r)r[e]&&t.push(e)}const r=t.join(" ");return C.Z.release(t),r}function N(e){this[e.getAttribute("data-node-ref")]=e}(()=>{const e=new Map;new ResizeObserver((t=>{P();for(const r of t)e.get(r.target)?.(r)}))})();const D=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"].reduce(((e,t)=>(e[t]=[],e)),{}),j=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],E=new U.Z({whiteList:D,onTagAttr:(e,t,r)=>{const s=`${t}="${r}"`;if(j.includes(t))return s},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0),L="http://www.w3.org/",q=`${L}2000/svg`,F=`${L}1999/xlink`;let B=[],V=(e,t)=>{let r={};return Object.keys(e).forEach((t=>{r[t]=e[t]})),t&&Object.keys(t).forEach((e=>{r[e]=t[e]})),r},$=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),H=e=>{if("string"!=typeof e)throw new Error("Style values must be strings")},M=(e,t,r)=>{if(""!==t.vnodeSelector)for(let s=r;s<e.length;s++)if($(e[s],t))return s;return-1},z=(e,t,r,s)=>{let i=e[t];if(""===i.vnodeSelector)return;let o=i.properties;if(!(o?void 0===o.key?o.bind:o.key:void 0))for(let o=0;o<e.length;o++)if(o!==t){let t=e[o];if($(t,i))throw new Error(`${r.vnodeSelector} had a ${i.vnodeSelector} child ${"added"===s?s:"removed"}, but there is now more than one. You must add unique key properties to make them distinguishable.`)}},Z=e=>{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},J=[],W=!1,G=e=>{(e.children||[]).forEach(G),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},Y=()=>{W=!1,J.forEach(G),J.length=0},K=e=>{J.push(e),W||(W=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(Y,{timeout:16}):setTimeout(Y,16))},X=e=>{let t=e.domNode;if(e.properties){let r=e.properties.exitAnimation;if(r){t.style.pointerEvents="none";let s=()=>{t.parentNode&&(t.parentNode.removeChild(t),K(e))};return void r(t,s,e.properties)}}t.parentNode&&(t.parentNode.removeChild(t),K(e))},Q=(e,t,r)=>{if(!t)return;let s=r.eventHandlerInterceptor,i=Object.keys(t),o=i.length;for(let n=0;n<o;n++){let o=i[n],a=t[o];if("className"===o)throw new Error('Property "className" is not supported, use "class".');if("class"===o)ie(e,a,!0);else if("classes"===o){let t=Object.keys(a),r=t.length;for(let s=0;s<r;s++){let r=t[s];a[r]&&e.classList.add(r)}}else if("styles"===o){let t=Object.keys(a),s=t.length;for(let i=0;i<s;i++){let s=t[i],o=a[s];o&&(H(o),r.styleApplyer(e,s,o))}}else if("key"!==o&&null!=a){let i=typeof a;"function"===i?(0===o.lastIndexOf("on",0)&&(s&&(a=s(o,a,e,t)),"oninput"===o&&function(){let e=a;a=function(t){e.apply(this,[t]),t.target["oninput-value"]=t.target.value}}()),e[o]=a):r.namespace===q?"href"===o?e.setAttributeNS(F,o,a):e.setAttribute(o,a):"string"===i&&"value"!==o?"innerHTML"===o?e[o]=E.sanitize(a):ee(e)&&o in e?e[o]=a:e.setAttribute(o,a):e[o]=a}}};function ee(e){if(!(e instanceof Element&&e.tagName.includes("-")))return!1;const t=window.customElements.get(e.tagName.toLowerCase());return!!t&&e instanceof t}let te,re=(e,t,r)=>{((e,t,r)=>{if(t)for(let s of t)se(s,e,void 0,r)})(e,t.children,r),t.text&&(e.textContent=t.text),Q(e,t.properties,r),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,r,t.vnodeSelector,t.properties,t.children])},se=(e,t,r,s)=>{let i,o=0,n=e.vnodeSelector,a=t.ownerDocument;if(""===n)i=e.domNode=a.createTextNode(e.text),void 0!==r?t.insertBefore(i,r):t.appendChild(i);else{for(let l=0;l<=n.length;++l){let h=n.charAt(l);if(l===n.length||"."===h||"#"===h){let h=n.charAt(o-1),d=n.slice(o,l);"."===h?i.classList.add(d):"#"===h?i.id=d:("svg"===d&&(s=V(s,{namespace:q})),void 0!==s.namespace?i=e.domNode=a.createElementNS(s.namespace,d):(i=e.domNode=e.domNode||a.createElement(d),"input"===d&&e.properties&&void 0!==e.properties.type&&i.setAttribute("type",e.properties.type)),void 0!==r?t.insertBefore(i,r):i.parentNode!==t&&t.appendChild(i)),o=l+1}}re(i,e,s)}},ie=(e,t,r)=>{t&&t.split(" ").forEach((t=>{t&&e.classList.toggle(t,r)}))},oe=(e,t,r,s,i)=>{if(r===s)return!1;s=s||B;let o,n=(r=r||B).length,a=s.length,l=0,h=0,d=!1;for(;h<a;){let a=l<n?r[l]:void 0,c=s[h];if(void 0!==a&&$(a,c))d=te(a,c,i)||d,l++;else{let a=M(r,c,l+1);if(a>=0){for(o=l;o<a;o++)X(r[o]),z(r,o,e,"removed");d=te(r[a],c,i)||d,l=a+1}else se(c,t,l<n?r[l].domNode:void 0,i),Z(c),z(s,h,e,"added")}h++}if(n>l)for(o=l;o<n;o++)X(r[o]),z(r,o,e,"removed");return d};te=(e,t,r)=>{let s=e.domNode,i=!1;if(e===t)return!1;let o=!1;if(""===t.vnodeSelector){if(t.text!==e.text){let e=s.ownerDocument.createTextNode(t.text);return s.parentNode.replaceChild(e,s),t.domNode=e,i=!0,i}t.domNode=s}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(r=V(r,{namespace:q})),e.text!==t.text&&(o=!0,void 0===t.text?s.removeChild(s.firstChild):s.textContent=t.text),t.domNode=s,o=oe(t,s,e.children,t.children,r)||o,o=((e,t,r,s)=>{if(!r)return;let i=!1,o=Object.keys(r),n=o.length;for(let a=0;a<n;a++){let n=o[a],l=r[n],h=t[n];if("class"===n)h!==l&&(ie(e,h,!1),ie(e,l,!0));else if("classes"===n){let t=e.classList,r=Object.keys(l),s=r.length;for(let e=0;e<s;e++){let s=r[e],o=!!l[s];o!==!!h[s]&&(i=!0,o?t.add(s):t.remove(s))}}else if("styles"===n){let t=Object.keys(l),r=t.length;for(let o=0;o<r;o++){let r=t[o],n=l[r];n!==h[r]&&(i=!0,n?(H(n),s.styleApplyer(e,r,n)):s.styleApplyer(e,r,""))}}else if(l||"string"!=typeof h||(l=""),"value"!==n||ee(e)){if(l!==h){let t=typeof l;"function"===t&&s.eventHandlerInterceptor||(s.namespace===q?"href"===n?e.setAttributeNS(F,n,l):e.setAttribute(n,l):"string"===t?"innerHTML"===n?e[n]=E.sanitize(l):"role"===n&&""===l?e.removeAttribute(n):ee(e)&&n in e?e[n]=l:e.setAttribute(n,l):e[n]!==l&&(e[n]=l),i=!0)}}else{let t=e[n];t!==l&&(e["oninput-value"]?t===e["oninput-value"]:l!==h)&&(e[n]=l,e["oninput-value"]=void 0),l!==h&&(i=!0)}}return i})(s,e.properties,t.properties,r)||o,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[s,r,t.vnodeSelector,t.properties,t.children]);return o&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(s,t.properties,e.properties),i};let ne=(e,t)=>({getLastRender:()=>e,update:r=>{if(e.vnodeSelector!==r.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let s=e;e=r,te(s,r,t)},domNode:e.domNode});const ae={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}};let le,he=e=>V(ae,e),de=(e,t,r)=>(r=he(r),se(t,e,void 0,r),ne(t,r)),ce=(e,t,r)=>(r=he(r),se(t,e.parentNode,e,r),ne(t,r)),pe=(e,t,r)=>(r=he(r),t.domNode=e,re(e,t,r),ne(t,r)),ue=(e,t,r)=>(r=he(r),se(t,e.parentNode,e,r),e.parentNode.removeChild(e),ne(t,r));le=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];const fe={handleInterceptedEvent:(e,t,r,s)=>(e.scheduleRender(),t.properties[`on${s.type}`].apply(t.properties.bind||r,[s]))},_e={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,r)=>{"-"===t.charAt(0)?e.style.setProperty(t,r):e.style[t]=r}},ge=(e,t,r=!1)=>{let s=e;return t.forEach(((e,i)=>{const o=s?.children?((e,t)=>e.find(t))(s.children,(t=>t.domNode===e)):void 0;r&&!o&&i!==t.length-1||(s=o)})),s};var ve=r(65161),me=r(99880);let ye;ye="components/assets";const we=Symbol("widget"),Se=Symbol("widget-test-data"),Ie=[],ke={},Ae=new WeakMap;function be(e,t){let r=t.children;if(r?.length)for(let t=0;t<r.length;++t)r[t]=be(e,r[t]);else r=Ie;const s=t.vnodeSelector;if(xe(s)){const i=t.properties||ke,o=i.key||s;return{vnodeSelector:"div",properties:{key:o,afterCreate:Ue,afterUpdate:Ce,afterRemoved:Te,parentWidget:e,widgetConstructor:s,widgetProperties:{...i,key:o,children:r}},children:void 0,text:void 0,domNode:null}}return t}function Ue(e,t,r,{parentWidget:s,widgetConstructor:i,widgetProperties:o}){const n=new i(o);n.container=e,Ae.set(e,n),n.afterCreate?.(n,e),s.addHandles((0,T.kB)((()=>Te(e)))),queueMicrotask((()=>{n[Se].projector.renderNow()}))}function Ce(e,t,r,{widgetProperties:s}){const i=Ae.get(e);i&&(i.set(s),i.afterUpdate?.(i,e))}function Te(e){const t=Ae.get(e);t&&(t.afterRemoved?.(t,e),t.destroy(),Ae.delete(e))}function xe(e){return"function"==typeof e&&e[we]}const Pe=new Set;var Oe,Re=r(70171),Ne=r(94443);let De=0;const je="esri-icon-checkbox-unchecked";function Ee(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?Ee(e[r],t?.[r]):e[r]=t[r]);return e}const Le=(e=>{let t;const r={...fe,...e},s=(o=r,{..._e,...o}),i=s.performanceLogger;var o;let n,a=!0,l=!1;const h=[],d=[],c=(e,o,n)=>{let a;s.eventHandlerInterceptor=(e,s,o,n)=>function(e){let s;i("domEvent",e);const o=((e,t)=>{const r=[];for(;e&&e!==t;)r.push(e),e=e.parentNode;return r})(e.currentTarget,a.domNode),n=o.some((e=>customElements.get(e?.tagName?.toLowerCase())));if(e.eventPhase!==Event.CAPTURING_PHASE&&n){const t=e.composedPath(),r=t.slice(t.indexOf(e.currentTarget),t.indexOf(a.domNode)).reverse();s=ge(a.getLastRender(),r,!0)}else o.reverse(),s=ge(a.getLastRender(),o);let l;return s&&(l=r.handleInterceptedEvent(t,s,this,e)),i("domEventProcessed",e),l},r.postProcessProjectionOptions?.(s);const l=n();a=e(o,l,s),s.eventHandlerInterceptor=void 0,h.push(a),d.push(n),r.afterFirstVNodeRendered&&r.afterFirstVNodeRendered(a,l)};let p=()=>{if(n=void 0,a){a=!1,i("renderStart",void 0);for(let e=0;e<h.length;e++){const t=d[e]();i("rendered",void 0),h[e].update(t),i("patched",void 0)}i("renderDone",void 0),a=!0}};return r.modifyDoRenderImplementation&&(p=r.modifyDoRenderImplementation(p,h,d)),t={renderNow:p,scheduleRender:()=>{n||l||(n=requestAnimationFrame(p))},stop:()=>{n&&(cancelAnimationFrame(n),n=void 0),l=!0},resume:()=>{l=!1,a=!0,t.scheduleRender()},append:(e,t)=>{c(de,e,t)},insertBefore:(e,t)=>{c(ce,e,t)},merge:(e,t)=>{c(pe,e,t)},replace:(e,t)=>{c(ue,e,t)},detach:e=>{for(let t=0;t<d.length;t++)if(d[t]===e)return d.splice(t,1),h.splice(t,1)[0];throw new Error("renderFunction was not found")}},t})({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,s,i,o)=>{const n=t?.(e,s,i,o),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in i)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>n?.call(i,e);i.addEventListener(t,r,a);const s=()=>i.removeEventListener(t,r,a),l=o.afterRemoved;o.afterRemoved=e=>{l?.(e),s()}}return n}},handleInterceptedEvent(e,t,r,s){const{eventPhase:i,type:o}=s,n=i===Event.CAPTURING_PHASE;let a=`on${o}${n?"capture":""}`;const l=t.properties;(l&&a in l||(a=`on${o[0].toUpperCase()}${o.slice(1)}${n?"Capture":""}`,l&&a in l))&&(P(),e.scheduleRender(),l[a].call(l.bind||r,s))}});let qe=!1,Fe=class extends((0,S.v)(l.Z.EventedAccessor)){constructor(e,t){super(e,t),this._attached=!1,this._projector=Le,this._readyForTrueRender=!1,this.iconClass=je,this.icon=null,this.key=this,this._loadLocale=(0,p.Ds)((async()=>{if(this._messageBundleProps?.length){const e=await Promise.allSettled(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{if(this.destroyed)return;let r=await(0,Ne.ME)(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=Ee((0,d.d9)(r),this.uiStrings)),this[t]=r})));if(this.destroyed)return;for(const t of e)"rejected"===t.status&&y.Z.getLogger(this).error("widget-intl:locale-error",this.declaredClass,t.reason)}await this.loadLocale()})),function(){try{(0,ve.K3)(".")}catch{(0,ve.YY)((0,f.hF)((0,me.V)("components/assets")))}}();const r="esri-widget-uid-"+(0,I.D)(),s=this.render.bind(this);this._trackingTarget=new b.M((()=>this.scheduleRender()));const i=()=>{if(!this._readyForTrueRender||this.destroyed)return null;const e=s();let{properties:t}=e;t||(e.properties=t={});const{key:i}=t;if(i||(t.key=r),xe(e.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?t.styles||(t.styles={}):(t.class="",t.styles={display:"none"}),t.styles.display||(t.styles.display="");let o=0;return e.children?.forEach((e=>{if(xe(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${o++}`)})),be(this,e)};this.render=()=>{if(qe)return i();let e=function(e){return x.get(e)}(this)??null;if(e)return e;this._trackingTarget.clear(),qe=!0;try{e=(0,A.LJ)(this._trackingTarget,i)}catch(e){throw console.error(e),e}finally{qe=!1}return e&&function(e,t){x.set(e,t)}(this,e),e};const o=this.beforeFirstRender();var n;o?this._resourcesFetch=o.then((()=>{this._readyForTrueRender=!0,this._postInitialize()})):(this._resourcesFetch=Promise.resolve().then((()=>{this._postInitialize()})),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),n=this._resourcesFetch,Pe.add(n),n.finally((()=>Pe.delete(n)))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){const e=this.loadDependencies();return this._messageBundleProps?.length||e?Promise.all([e,this._loadLocale()]).then((()=>{})).catch(p.H9):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||((0,w.SC)(this._trackingTarget),(0,w.SC)(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,O(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return function(e){return"string"==typeof e?document.getElementById(e):e??null}(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){return this._get("id")||this.container?.id||Date.now().toString(16)+"-widget-"+De++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(Oe=we,Se)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(O(this),this._projector.scheduleRender())}own(e){(0,m.XV)(y.Z.getLogger(this.declaredClass),"`Widget.own()` is deprecated in favor of Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(e)}classes(...e){return R.apply(this,e)}renderNow(){O(this),this._projector.renderNow()}_postInitialize(){if(this.destroyed)return;this.scheduleRender(),this._delegatedEventNames?.length&&this.addHandles((0,u.YP)((()=>this.viewModel),((e,t)=>{t&&this.removeHandles("delegated-events"),e&&(0,h.vT)(e)&&this.addHandles(this._delegatedEventNames.map((t=>(0,h.on)(e,t,(e=>{this.emit(t,e)})))),"delegated-events")}),u.tX)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(p.H9),this.scheduleRender()};this.addHandles([(0,Re.qe)(e),(0,u.YP)((()=>this.uiStrings),e),(0,u.gx)((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){this._attached&&(this._projector.detach(this.render),this._attached=!1),e?.parentNode?.removeChild(e)}};Fe[Oe]=!0,(0,i._)([(0,_.Cb)()],Fe.prototype,"_readyForTrueRender",void 0),(0,i._)([(0,_.Cb)({value:null})],Fe.prototype,"container",null),(0,i._)([(0,k.p)("container")],Fe.prototype,"castContainer",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"iconClass",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"icon",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"id",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"label",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"renderable",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"uiStrings",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"viewModel",void 0),(0,i._)([(0,_.Cb)({value:!0})],Fe.prototype,"visible",null),(0,i._)([(0,_.Cb)()],Fe.prototype,"key",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"children",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"afterCreate",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"afterUpdate",void 0),(0,i._)([(0,_.Cb)()],Fe.prototype,"afterRemoved",void 0),Fe=(0,i._)([(0,g.j)("esri.widgets.Widget")],Fe);const Be=Fe;function Ve(e){return(t,r)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:r})}}var $e=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},He=function(e,t){for(var r=0,s=e.length;r<s;r++){var i=e[r];Array.isArray(i)?He(i,t):null!=i&&!1!==i&&(i.hasOwnProperty("vnodeSelector")||(i=$e(i)),t.push(i))}};function Me(e,t,...r){return"function"!=typeof e||xe(e)?function(e,t){for(var r=[],s=2;s<arguments.length;s++)r[s-2]=arguments[s];if(1===r.length&&"string"==typeof r[0])return{vnodeSelector:e,properties:t||void 0,children:void 0,text:r[0],domNode:null};var i=[];return He(r,i),{vnodeSelector:e,properties:t||void 0,children:i,text:void 0,domNode:null}}(e,t,...r):e(t,...r)}const ze="esri-identity-form",Ze={base:ze,group:`${ze}__group`,label:`${ze}__label`,footer:`${ze}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"};let Je=class extends Be{constructor(e,t){super(e,t),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:e,server:t,resource:r,signingIn:s,oAuthPrompt:i,messages:o}=this,n=Me("div",{class:Ze.group},(0,v.n)(i?o.oAuthInfo:o.info,{server:t&&/\.arcgis\.com/i.test(t)?"ArcGIS Online":t,resource:`(${r||o.lblItem})`})),a=i?null:Me("div",{class:Ze.group,key:"username"},Me("label",{class:Ze.label},o.lblUser,Me("input",{afterCreate:N,autocomplete:"off",bind:this,class:Ze.esriInput,"data-node-ref":"_usernameInputNode",required:!0,spellcheck:!1,type:"text",value:""}))),l=i?null:Me("div",{class:Ze.group,key:"password"},Me("label",{class:Ze.label},o.lblPwd,Me("input",{afterCreate:N,bind:this,class:Ze.esriInput,"data-node-ref":"_passwordInputNode",required:!0,type:"password",value:""}))),h=Me("div",{class:this.classes(Ze.group,Ze.footer)},Me("input",{class:Ze.esriButton,disabled:!!s,type:"submit",value:s?o.lblSigning:o.lblOk}),Me("input",{bind:this,class:this.classes(Ze.esriButton,Ze.esriButtonSecondary),onclick:this._cancel,type:"button",value:o.lblCancel})),d=e?Me("div",null,e.details?.httpStatus?o.invalidUser:o.noAuthService):null;return Me("form",{bind:this,class:Ze.base,onsubmit:this._submit},n,d,a,l,h)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",t)}};(0,i._)([(0,_.Cb)(),Ve("esri/identity/t9n/identity")],Je.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"signingIn",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"resource",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"error",void 0),(0,i._)([(0,_.Cb)()],Je.prototype,"oAuthPrompt",void 0),Je=(0,i._)([(0,g.j)("esri.identity.IdentityForm")],Je);const We=Je;var Ge=r(44291);const Ye="esri-identity-modal",Ke={base:Ye,open:`${Ye}--open`,closed:`${Ye}--closed`,title:`${Ye}__title`,dialog:`${Ye}__dialog`,content:`${Ye}__content`,closeButton:`${Ye}__close-button`,iconClose:"esri-icon-close"};let Xe=class extends Be{constructor(e,t){super(e,t),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles((0,u.YP)((()=>this.open),(()=>this._toggleFocusTrap())))}destroy(){this._destroyFocusTrap()}get title(){return this.messages?.auth.signIn}render(){const e=this.id,{open:t,content:r,title:s,messages:i}=this,o=t&&!!r,n={[Ke.open]:o,[Ke.closed]:!o},a=Me("button",{"aria-label":i.close,bind:this,class:Ke.closeButton,onclick:this._close,title:i.close,type:"button"},Me("span",{"aria-hidden":"true",class:Ke.iconClose})),l=`${e}_title`,h=`${e}_content`,d=s?Me("h1",{class:Ke.title,id:l},s):null,c=o?Me("div",{afterCreate:this._createFocusTrap,"aria-describedby":h,"aria-labelledby":l,bind:this,class:Ke.dialog,role:"dialog"},a,d,this._renderContent(h)):null;return Me("div",{class:this.classes(Ke.base,n),tabIndex:-1},c)}_destroyFocusTrap(){this._focusTrap?.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:e,open:t}=this;e&&(t?e.activate():e.deactivate())}_createFocusTrap(e){this._destroyFocusTrap();const t=requestAnimationFrame((()=>{this._focusTrap=(0,Ge.v)(e,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()}));this.addHandles((0,T.kB)((()=>cancelAnimationFrame(t))))}_renderContent(e){const t=this.content;return"string"==typeof t?Me("div",{class:Ke.content,id:e,innerHTML:t}):function(e){return e&&"function"==typeof e.render}(t)?Me("div",{class:Ke.content,id:e},t.render()):t instanceof HTMLElement?Me("div",{afterCreate:this._attachToNode,bind:t,class:Ke.content,id:e}):null}_attachToNode(e){e.appendChild(this)}};(0,i._)([(0,_.Cb)({readOnly:!0})],Xe.prototype,"container",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"content",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"open",void 0),(0,i._)([(0,_.Cb)(),Ve("esri/t9n/common")],Xe.prototype,"messages",void 0),(0,i._)([(0,_.Cb)()],Xe.prototype,"title",null),Xe=(0,i._)([(0,g.j)("esri.identity.IdentityModal")],Xe);const Qe=Xe,et="esriJSAPIOAuth";class tt{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token))if(null==this.expires&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(et,JSON.stringify(e))}catch(e){return console.warn(e),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t?.appId&&t?.portalUrl&&(null==this.expires||this.expires>Date.now())&&(this.refreshToken||this.token)){const e=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",t.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(e,r);else{const t=new XMLHttpRequest;t.open("POST",e),t.send(r)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(et,JSON.stringify(e))}catch(e){console.log(e)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(et);if(t)try{e=JSON.parse(t)}catch(e){console.warn(e)}}return e}}tt.prototype.declaredClass="esri.identity.OAuthCredential";var rt,st=r(96674);let it=rt=class extends st.wq{constructor(e){super(e),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return rt.fromJSON(this.toJSON())}};(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"appId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"authNamespace",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"expiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"flowType",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"forceLogin",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"forceUserId",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"locale",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"minTimeUntilExpiration",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popup",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popupCallbackUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"popupWindowFeatures",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"portalUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"preserveUrlHash",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],it.prototype,"userId",void 0),it=rt=(0,i._)([(0,g.j)("esri.identity.OAuthInfo")],it);const ot=it;let nt=class extends st.wq{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"adminTokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"currentVersion",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"hasPortal",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"hasServer",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"owningSystemUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"owningTenant",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"server",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"shortLivedTokenValidity",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"tokenServiceUrl",void 0),(0,i._)([(0,_.Cb)({json:{write:!0}})],nt.prototype,"webTierAuth",void 0),nt=(0,i._)([(0,g.j)("esri.identity.ServerInfo")],nt);const at=nt;var lt=r(19745);const ht={},dt=e=>{const t=new f.R9(e.owningSystemUrl).host,r=new f.R9(e.server).host,s=/.+\.arcgis\.com$/i;return s.test(t)&&s.test(r)},ct=(e,t)=>!!(dt(e)&&t&&t.some((t=>t.test(e.server))));let pt=null,ut=null;try{pt=window.localStorage,ut=window.sessionStorage}catch{}class ft extends l.Z{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.formConstructor=We,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin="null"!==window.origin?window.origin:window.location.origin,this._appUrlObj=(0,f.mN)(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",(e=>{this._pageShowHandler(e)}))}registerServers(e){const t=this.serverInfos;t?(e=e.filter((e=>!this.findServerInfo(e.server))),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach((e=>{e.owningSystemUrl&&this._portals.push(e.owningSystemUrl),e.hasPortal&&this._portals.push(e.server)}))}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const e=this.findOAuthInfo(r.portalUrl);e&&t.splice(t.indexOf(e),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let s,i=this.findServerInfo(t),o=!0;i||(i=new at,i.server=this._getServerInstanceRoot(t),r?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(t),i.hasPortal=!0),this.registerServers([i])),s=this._findCredential(t),s?(delete e.server,Object.assign(s,e),o=!1):(s=new _t({userId:e.userId,server:i.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),s.resources=[t],this.credentials.push(s)),s.emitTokenChange(!1),o||s.refreshServerTokens()}toJSON(){return(0,d.yd)({serverInfos:this.serverInfos.map((e=>e.toJSON())),oAuthInfos:this.oAuthInfos.map((e=>e.toJSON())),credentials:this.credentials.map((e=>e.toJSON()))})}initialize(e){if(!e)return;"string"==typeof e&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,s=e.credentials;if(t){const e=[];t.forEach((t=>{t.server&&t.tokenServiceUrl&&e.push(t.declaredClass?t:new at(t))})),e.length&&this.registerServers(e)}if(r){const e=[];r.forEach((t=>{t.appId&&e.push(t.declaredClass?t:new ot(t))})),e.length&&this.registerOAuthInfos(e)}s&&s.forEach((e=>{e.server&&e.token&&e.expires&&e.expires>Date.now()&&((e=e.declaredClass?e:new _t(e)).emitTokenChange(),this.credentials.push(e))}))}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const s=this._isServerRsrc(e)?"server":"portal";if(t){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&t===i.userId&&i.scope===s){r=i;break}}else for(const t of this.credentials)if(this._hasSameServerInstance(t.server,e)&&-1!==this._getIdenticalSvcIdx(e,t)&&t.scope===s){r=t;break}return r}getCredential(e,t){let r,s,i=!0;t&&(r=!!t.token,s=t.error,i=!1!==t.prompt),t={...t},e=this._sanitizeUrl(e);const o=new AbortController,n=(0,p.hh)();if(t.signal&&(0,p.fu)(t.signal,(()=>{o.abort()})),(0,p.fu)(o,(()=>{n.reject(new a.Z("identity-manager:user-aborted","ABORTED"))})),(0,p.Hc)(o))return n.promise;t.signal=o.signal;const l=this._isAdminResource(e),h=r?this.findCredential(e):null;let d;if(h&&s&&s.details&&498===s.details.httpStatus)h.destroy();else if(h)return d=new a.Z("identity-manager:not-authorized","You are currently signed in as: '"+h.userId+"'. You do not have access to this resource: "+e,{error:s}),n.reject(d),n.promise;const c=this._findCredential(e,t);if(c)return n.resolve(c),n.promise;let u=this.findServerInfo(e);if(u)!u.hasPortal&&u.server&&u.owningSystemUrl&&this._hasSameServerInstance(u.server,u.owningSystemUrl)&&(u.hasPortal=!0),!u.hasServer&&this._isServerRsrc(e)&&(u._restInfoPms=this._getTokenSvcUrl(e),u.hasServer=!0);else{const t=this._getTokenSvcUrl(e);if(!t)return d=new a.Z("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),n.reject(d),n.promise;u=new at,u.server=this._getServerInstanceRoot(e),"string"==typeof t?(u.tokenServiceUrl=t,u.hasPortal=!0):(u._restInfoPms=t,u.hasServer=!0),this.registerServers([u])}return u.hasPortal&&void 0===u._selfReq&&(i||(0,f.D6)(u.tokenServiceUrl,this._appOrigin)||this._gwDomains.some((e=>e.tokenServiceUrl===u.tokenServiceUrl)))&&(u._selfReq={owningTenant:t?.owningTenant,selfDfd:this._getPortalSelf(u.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,u,t,n,l)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const s=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new f.R9(this._appOrigin),o=e.shortLivedTokenValidity;let l,h,d,c,p,u,_,g;t&&(g=this.tokenValidity||o||this._defaultTokenValidity,g>o&&o>0&&(g=o)),r&&(l=r.isAdmin,h=r.serverUrl,d=r.token,u=r.signal,_=r.ssl,e.customParameters=r.customParameters),l?c=e.adminTokenServiceUrl:(c=e.tokenServiceUrl,p=new f.R9(c.toLowerCase()),e.webTierAuth&&r?.serverUrl&&!_&&"http"===i.scheme&&((0,f.D6)(i.uri,c,!0)||"https"===p.scheme&&i.host===p.host&&"7080"===i.port&&"7443"===p.port)&&(c=c.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:t?.username,password:t?.password,serverUrl:h,token:d,expiration:g,referer:l||s?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:u,...r?.ioArgs};return s||(v.withCredentials=!1),(0,n.Z)(c,v).then((r=>{const s=r.data;if(!s?.token)return new a.Z("identity-manager:authentication-failed","Unable to generate token");const i=e.server;return ht[i]||(ht[i]={}),t&&(ht[i][t.username]=t.password),s.validity=g,s}))}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then((e=>e.credential))}checkAppAccess(e,t,r){let s=!1;return this.getCredential(e,{prompt:!1}).then((i=>{let o;const l={f:"json"};if("portal"===i.scope)if(t&&(this._doPortalSignIn(e)||r?.force))o=i.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!i.token)return{credential:i};o=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};o=i.server+"/rest/services"}return i.token&&(l.token=i.token),(0,n.Z)(o,{query:l,authMode:"anonymous"}).then((e=>{if(!1===e.data.valid)throw new a.Z("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,e.data);return s=!!e.data.viewOnlyUserTypeApp,{credential:i}})).catch((e=>{if("identity-manager:not-authorized"===e.name)throw e;const t=e.details?.httpStatus;if(498===t)throw i.destroy(),new a.Z("identity-manager:not-authenticated","User is not signed in.");if(400===t)throw new a.Z("identity-manager:invalid-request");return{credential:i}}))})).then((e=>({credential:e.credential,viewOnly:s})))}setOAuthResponseHash(e){e&&("#"===e.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,f.u0)(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const s=(0,p.hh)(),i=()=>{l?.remove(),h?.remove(),d?.remove(),n?.destroy(),this.dialog?.destroy(),this.dialog=n=l=h=d=null},o=()=>{i(),this._oAuthDfd=null,s.reject(new a.Z("identity-manager:user-aborted","ABORTED"))};r.signal&&(0,p.fu)(r.signal,(()=>{o()}));let n=new this.formConstructor;n.resource=this.getResourceName(e),n.server=t.server,this.dialog=new Qe,this.dialog.content=n,this.dialog.open=!0,this.emit("dialog-create");let l=n.on("cancel",o),h=(0,u.YP)((()=>this.dialog.open),o),d=n.on("submit",(e=>{this.generateToken(t,e,{isAdmin:r.isAdmin,signal:r.signal}).then((o=>{i();const n=new _t({userId:e.username,server:t.server,token:o.token,expires:null!=o.expires?Number(o.expires):null,ssl:!!o.ssl,isAdmin:r.isAdmin,validity:o.validity});s.resolve(n)})).catch((e=>{n.error=e,n.signingIn=!1}))}));return s.promise}oAuthSignIn(e,t,r,s){this._oAuthDfd=(0,p.hh)();const i=this._oAuthDfd;let o;s?.signal&&(0,p.fu)(s.signal,(()=>{const e=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;e&&!e.closed?e.close():this.dialog&&_()})),i.resUrl_=e,i.sinfo_=t,i.oinfo_=r;const n=r._oAuthCred;if(n.storage&&("authorization-code"===r.flowType||"auto"===r.flowType&&t.currentVersion>=8.4)){let e=crypto.getRandomValues(new Uint8Array(32));o=(0,f.rS)(e),n.codeVerifier=o,e=crypto.getRandomValues(new Uint8Array(32)),n.stateUID=(0,f.rS)(e),n.save()||(n.codeVerifier=o=null)}else n.codeVerifier=null;let l,h,d,c;this._getCodeChallenge(o).then((i=>{const o=!s||!1!==s.oAuthPopupConfirmation;r.popup&&o?(l=new this.formConstructor,l.oAuthPrompt=!0,l.server=t.server,this.dialog=new Qe,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create"),h=l.on("cancel",_),d=(0,u.YP)((()=>this.dialog.open),_),c=l.on("submit",(()=>{g(),this._doOAuthSignIn(e,t,r,i)}))):this._doOAuthSignIn(e,t,r,i)}));const _=()=>{g(),this._oAuthDfd=null,i.reject(new a.Z("identity-manager:user-aborted","ABORTED"))},g=()=>{h?.remove(),d?.remove(),c?.remove(),l?.destroy(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach((e=>{e.destroy()})),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=(0,h.on)(window,"message",(t=>{if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&"arcgis:auth:requestCredential"===t.data?.type){const r=t.source;this.getCredential(e).then((e=>{r.postMessage({type:"arcgis:auth:credential",credential:{expires:e.expires,server:e.server,ssl:e.ssl,token:e.token,userId:e.userId}},t.origin)})).catch((e=>{r.postMessage({type:"arcgis:auth:error",error:{name:e.name,message:e.message}},t.origin)}))}}))}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){"#"===e.charAt(0)&&(e=e.substring(1));const t=(0,f.u0)(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),"access_denied"===t.error&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let t=window.location.search;if(t){"?"===t.charAt(0)&&(t=t.substring(1));const e=(0,f.u0)(t);let r=!1;if(e.code&&e.state)try{e.state=JSON.parse(e.state),e.state.portalUrl&&e.state.uid&&(this._oAuthLocationParams=e,r=!0)}catch{}else if(e.error&&e.error_description&&(console.log("IdentityManager OAuth Error: ",e.error," - ",e.error_description),"access_denied"===e.error&&(r=!0,e.state)))try{e.state=JSON.parse(e.state)}catch{}if(r){const t={...e};["code","error","error_description","message_code","persist","state"].forEach((e=>{delete t[e]}));const r=(0,f.B7)(t),s=window.location.pathname+(r?`?${r}`:"")+(e.state?.hash||"");window.history.replaceState(window.history.state,"",s)}}}_getOAuthToken(e,t,r,s,i){return e=e.replace(/^http:/i,"https:"),(0,n.Z)(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:s&&i?{grant_type:"authorization_code",code:t,redirect_uri:s,client_id:r,code_verifier:i}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then((e=>e.data))}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=(new TextEncoder).encode(e);return crypto.subtle.digest("SHA-256",t).then((e=>(0,f.rS)(new Uint8Array(e))))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const e=new a.Z("identity-manager:user-aborted","ABORTED");this._errbackFunc(e)}}_findCredential(e,t){let r,s,i,o,n=-1;const a=t?.token,l=t?.resource,h=this._isServerRsrc(e)?"server":"portal",d=this.credentials.filter((t=>this._hasSameServerInstance(t.server,e)&&t.scope===h));if(e=l||e,d.length)if(1===d.length){if(r=d[0],i=this.findServerInfo(r.server),s=i?.owningSystemUrl,o=s?this.findCredential(s,r.userId):void 0,n=this._getIdenticalSvcIdx(e,r),!a)return-1===n&&r.resources.push(e),this._addResource(e,o),r;-1!==n&&(r.resources.splice(n,1),this._removeResource(e,o))}else{let t,r;if(d.some((a=>(r=this._getIdenticalSvcIdx(e,a),-1!==r&&(t=a,i=this.findServerInfo(t.server),s=i?.owningSystemUrl,o=s?this.findCredential(s,t.userId):void 0,n=r,!0)))),a)t&&(t.resources.splice(n,1),this._removeResource(e,o));else if(t)return this._addResource(e,o),t}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t)for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}return t}_addResource(e,t){t&&-1===this._getIdenticalSvcIdx(e,t)&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return t?.isAdmin&&!(0,f.D6)(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&"10.1"===String(e.currentVersion)&&!(0,f.D6)(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new f.R9(e);return t.scheme+"://"+t.host+(null!=t.port?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return-1===r&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),-1!==r||(0,lt.P)(t)||(r=t.indexOf("/sharing")),-1===r&&"/"===t.substr(-1)&&(r=t.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,t){return"/"===e.substr(-1)&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===t.substr(t.indexOf(":"))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,s=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):s.test(e)&&(e=e.replace(s,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(o.default.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return-1!==r&&(e=e.substring(r+t.length+1)),e=(0,f.Fv)(e),(0,f.mN)(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const s=this._getSuffix(e).toLowerCase(),i=this._getSuffix(t).toLowerCase();if(r=s===i,!r){const e=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=s.replaceAll(e,"$1")===i.replaceAll(e,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new f.R9(e.toLowerCase()),r=this._portalConfig;let s=this._gwDomains.some((e=>e.regex.test(t.uri)));return!s&&r&&(s=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),s||o.default.portalUrl&&(s=(0,f.D6)(t,o.default.portalUrl,!0)),s||(s=this._portals.some((e=>this._hasSameServerInstance(e,t.uri)))),s=s||this._agsPortal.test(t.path),s}_isIdProvider(e,t){let r=-1,s=-1;this._gwDomains.forEach(((i,o)=>{-1===r&&i.regex.test(e)&&(r=o),-1===s&&i.regex.test(t)&&(s=o)}));let i=!1;if(r>-1&&s>-1&&(0===r||4===r?0!==s&&4!==s||(i=!0):1===r?1!==s&&2!==s||(i=!0):2===r?2===s&&(i=!0):3===r&&3===s&&(i=!0)),!i){const r=this.findServerInfo(t),s=r?.owningSystemUrl;s&&dt(r)&&this._isPortalDomain(s)&&this._isIdProvider(e,s)&&(i=!0)}return i}_getIdenticalSvcIdx(e,t){let r=-1;for(let s=0;s<t.resources.length;s++){const i=t.resources[s];if(this._isIdenticalService(e,i)){r=s;break}}return r}_getSuffix(e){return e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"$1")}_getTokenSvcUrl(e){let t,r,s;if(this._isRESTService(e)||this._isAdminResource(e)){const s=this._getServerInstanceRoot(e);return t=s+"/admin/generateToken",r=(0,n.Z)(e=s+"/rest/info",{query:{f:"json"}}).then((e=>e.data)),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let t="";if(this._gwDomains.some((r=>(r.regex.test(e)&&(t=r.tokenServiceUrl),!!t))),t||this._portals.some((r=>(this._hasSameServerInstance(r,e)&&(t=r+this._gwTokenUrl),!!t))),t||(s=e.toLowerCase().indexOf("/sharing"),-1!==s&&(t=e.substring(0,s)+this._gwTokenUrl)),t||(t=this._getOrigin(e)+this._gwTokenUrl),t){const r=new f.R9(e).port;/^http:\/\//i.test(e)&&"7080"===r&&(t=t.replace(/:7080/i,":7443")),t=t.replace(/http:/i,"https:")}return t}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,r){const s=t._oAuthCred;if(e.code){const i=s.codeVerifier;return s.codeVerifier=null,s.stateUID=null,s.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),i).then((i=>{const o=new _t({userId:i.username,server:r.server,token:i.access_token,expires:Date.now()+1e3*i.expires_in,ssl:i.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=o.userId,s.storage=i.persist?pt:ut,s.refreshToken=i.refresh_token,s.token=null,s.expires=i.refresh_token_expires_in?Date.now()+1e3*i.refresh_token_expires_in:null,s.userId=o.userId,s.ssl=o.ssl,s.save(),o}))}const i=new _t({userId:e.username,server:r.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:"true"===e.ssl,oAuthState:e.state,_oAuthCred:s});return t.userId=i.userId,s.storage=e.persist?pt:ut,s.refreshToken=null,s.token=i.token,s.expires=i.expires,s.userId=i.userId,s.ssl=i.ssl,s.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const r="access_denied"===e.error,s=new a.Z(r?"identity-manager:user-aborted":"identity-manager:authentication-failed",r?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then((e=>{t.resolve(e)})).catch((e=>{t.reject(e)}))}_setOAuthResponseQueryString(e){e&&("?"===e.charAt(0)&&(e=e.substring(1)),this._processOAuthPopupParams((0,f.u0)(e)))}_exchangeToken(e,t,r){return(0,n.Z)(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}}).then((e=>e.data.token))}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),(0,n.Z)(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then((e=>e.data))}_getPortalSelf(e,t){let r;return this._gwDomains.some((t=>(t.regex.test(e)&&(r=t.customBaseUrl),!!r))),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),(0,n.Z)(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then((e=>e.data)))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,s=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(s?s.hasPortal||s.owningSystemUrl&&this._isPortalDomain(s.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||(0,f.D6)(r,e,!0)))}_checkProtocol(e,t,r,s){let i=!0;const o=s?t.adminTokenServiceUrl:t.tokenServiceUrl;return o.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&(0,f.ed)(o)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!i)&&r(new a.Z("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,t,r,s,i,o){return s||(s=(0,p.hh)()),s.resUrl_=e,s.sinfo_=t,s.options_=r,s.admin_=i,s.refresh_=o,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(s)):this._xoReqs.push(s):this._doSignIn(s),s.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=t=>{const r=e.options_?.resource,s=e.resUrl_,i=e.refresh_;let o=!1;this.credentials.includes(t)||(i&&this.credentials.includes(i)?(i.userId=t.userId,i.token=t.token,i.expires=t.expires,i.validity=t.validity,i.ssl=t.ssl,i.creationTime=t.creationTime,o=!0,t=i):this.credentials.push(t)),t.resources||(t.resources=[]),t.resources.includes(r||s)||t.resources.push(r||s),t.scope=this._isServerRsrc(s)?"server":"portal",t.emitTokenChange();const n=this._soReqs,a={};this._soReqs=[],n.forEach((e=>{if(!this._isIdenticalService(s,e.resUrl_)){const r=this._getSuffix(e.resUrl_);a[r]||(a[r]=!0,t.resources.push(e.resUrl_))}})),e.resolve(t),n.forEach((e=>{this._hasSameServerInstance(this._getServerInstanceRoot(s),e.resUrl_)?e.resolve(t):this._soReqs.push(e)})),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,o||this.emit("credential-create",{credential:t}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=t=>{e.reject(t),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=(i,o,n,l)=>{const d=e.sinfo_,c=!e.options_||!1!==e.options_.prompt,u=d.hasPortal&&this._findOAuthInfo(e.resUrl_);let _,g;if(i)t(new _t({userId:i,server:d.server,token:n||null,expires:null!=l?Number(l):null,ssl:!!o}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const s=(0,h.on)(window,"message",(e=>{e.source===window.parent&&e.data&&("arcgis:auth:credential"===e.data.type?(s.remove(),e.data.credential.expires<Date.now()?r(new a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):t(new _t(e.data.credential))):"arcgis:auth:error"===e.data.type&&(s.remove(),"tokenExpiredError"===e.data.error.name?r(new a.Z("identity-manager:credential-request-failed","Parent application's token has expired.")):r(a.Z.fromJSON(e.data.error))))}));(0,p.fu)(e.options_?.signal,(()=>{s.remove()}))}else if(u){let i=u._oAuthCred;if(!i){const e=new tt(u,pt),t=new tt(u,ut);e.isValid()&&t.isValid()?e.expires>t.expires?(i=e,t.destroy()):(i=t,e.destroy()):i=e.isValid()?e:t,u._oAuthCred=i}if(i.isValid()){_=new _t({userId:i.userId,server:d.server,token:i.token,expires:i.expires,ssl:i.ssl,_oAuthCred:i});const r=u.appId!==i.appId&&this._doPortalSignIn(e.resUrl_);r||i.refreshToken?(e._pendingDfd=i.refreshToken?this._getOAuthToken(d.server,i.refreshToken,i.appId).then((e=>(_.expires=Date.now()+1e3*e.expires_in,_.token=e.access_token,_))):Promise.resolve(_),e._pendingDfd.then((e=>r?this._exchangeToken(e.server,u.appId,e.token).then((t=>(e.token=t,e))).catch((()=>e)):e)).then((e=>{t(e)})).catch((()=>{i?.destroy(),s()}))):t(_)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(u.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===i.stateUID&&i.codeVerifier)){const s=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(s,u,d).then((e=>{t(e)})).catch(r)}else{const s=()=>{c?e._pendingDfd=this.oAuthSignIn(e.resUrl_,d,u,e.options_).then(t,r):(g=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(g))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(d.server,u.appId).then((e=>{(0,f.D6)(e.portalUrl,this._appOrigin,!0)?(_=new _t({userId:e.username,server:d.server,expires:Date.now()+1e3*e.expires_in,token:e.token}),t(_)):s()})).catch(s):s()}}else if(c){if(this._checkProtocol(e.resUrl_,d,r,e.admin_)){let s=e.options_;e.admin_&&(s=s||{},s.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,d,s).then(t,r)}}else g=new a.Z("identity-manager:not-authenticated","User is not signed in."),r(g)},i=()=>{const s=e.sinfo_,i=s.owningSystemUrl,o=e.options_;let n,a,l,h;if(o&&(n=o.token,a=o.error,l=o.prompt),h=this._findCredential(i,{token:n,resource:e.resUrl_}),!h)for(const e of this.credentials)if(this._isIdProvider(i,e.server)){h=e;break}if(h){const i=this.findCredential(e.resUrl_,h.userId);if(i)t(i);else if(ct(s,this._legacyFed)){const e=h.toJSON();e.server=s.server,e.resources=null,t(new _t(e))}else(e._pendingDfd=this.generateToken(this.findServerInfo(h.server),null,{serverUrl:e.resUrl_,token:h.token,signal:e.options_.signal,ssl:h.ssl})).then((r=>{t(new _t({userId:h?.userId,server:s.server,token:r.token,expires:null!=r.expires?Number(r.expires):null,ssl:!!r.ssl,isAdmin:e.admin_,validity:r.validity}))}),r)}else this._busy=null,n&&(e.options_.token=null),(e._pendingDfd=this.getCredential(i.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:s.owningTenant,signal:e.options_.signal,token:n,error:a,prompt:l})).then((()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)}),(t=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(t)}))};this._errbackFunc=r;const o=e.sinfo_.owningSystemUrl,n=this._isServerRsrc(e.resUrl_),l=e.sinfo_._restInfoPms;l?l.promise.then((t=>{const r=e.sinfo_;if(r._restInfoPms){r.adminTokenServiceUrl=r._restInfoPms.adminUrl,r._restInfoPms=null,r.tokenServiceUrl=((0,c.hS)("authInfo.tokenServicesUrl",t)||(0,c.hS)("authInfo.tokenServiceUrl",t)||(0,c.hS)("tokenServiceUrl",t))??null,r.shortLivedTokenValidity=(0,c.hS)("authInfo.shortLivedTokenValidity",t)??null,r.currentVersion=t.currentVersion,r.owningTenant=t.owningTenant;const e=r.owningSystemUrl=t.owningSystemUrl;e&&this._portals.push(e)}n&&r.owningSystemUrl?i():s()}),(()=>{e.sinfo_._restInfoPms=null;const t=new a.Z("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(t)})):n&&o?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then((t=>{const r={};let s,i,o,n;return t&&(s=t.user?.username,r.username=s,r.allSSL=t.allSSL,i=t.supportsOAuth,n=parseFloat(t.currentVersion),"multitenant"===t.portalMode&&(o=t.customBaseUrl),e.sinfo_.currentVersion=n),e.sinfo_.webTierAuth=!!s,s&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:r.allSSL}).catch((()=>null)).then((e=>(r.portalToken=e&&e.token,r.tokenExpiration=e&&e.expires,r))):!s&&i&&n>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:o,owningTenant:e.sinfo_._selfReq.owningTenant}).catch((()=>null)).then((()=>r)):r})).catch((()=>null)).then((t=>{e.sinfo_._selfReq=null,t?s(t.username,t.allSSL,t.portalToken,t.tokenExpiration):s()})):s()}_generateOAuthInfo(e){let t,r=null,s=e.portalUrl;const i=e.customBaseUrl,o=e.owningTenant,a=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(a){r=window.location.href;let e=r.indexOf("?");e>-1&&(r=r.slice(0,e)),e=r.search(/\/(apps|home)\//),r=e>-1?r.slice(0,e):null}return a&&r?(this._hasTestedIfAppIsOnPortal=!0,t=(0,n.Z)(r+"/sharing/rest",{query:{f:"json"}}).then((()=>{this._defaultOAuthInfo=new ot({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})}))):t=Promise.resolve(),t.then((()=>{if(this._defaultOAuthInfo)return s=s.replace(/^http:/i,"https:"),(0,n.Z)(s+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:o,client_id:this._defaultOAuthInfo.appId,redirect_uri:(0,f.hF)(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then((e=>{if(e.data.valid){const t=this._defaultOAuthInfo.clone();e.data.urlKey&&i?t.portalUrl="https://"+e.data.urlKey.toLowerCase()+"."+i:t.portalUrl=s,t.popup=window!==window.top||!((0,f.D6)(s,this._appOrigin)||this._gwDomains.some((e=>e.regex.test(s)&&e.regex.test(this._appOrigin)))),this.oAuthInfos.push(t)}}))}))}_doOAuthSignIn(e,t,r,s){const i=r._oAuthCred,o={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(o.hash=window.location.hash),i.stateUID&&(o.uid=i.stateUID);const n={client_id:r.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(o),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!i.codeVerifier)};r.forceLogin&&(n.force_login=!0),r.forceUserId&&r.userId&&(n.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(n.redirectToUserOrgUrl=!0),i.codeVerifier&&(n.code_challenge=s||i.codeVerifier,n.code_challenge_method=s?"S256":"plain");const l=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",d=l+"?"+(0,f.B7)(n);if(r.popup){const e=window.open(d,"esriJSAPIOAuth",r.popupWindowFeatures);if(e)e.focus(),this._oAuthDfd.oAuthWin_=e,this._oAuthIntervalId=setInterval((()=>{if(e.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const e=this._oAuthDfd;if(e){const t=new a.Z("identity-manager:user-aborted","ABORTED");e.reject(t)}}}),500),this._oAuthOnPopupHandle=(0,h.on)(window,["arcgis:auth:hash","arcgis:auth:location:search"],(e=>{"arcgis:auth:hash"===e.type?this.setOAuthResponseHash(e.detail):this._setOAuthResponseQueryString(e.detail)}));else{const e=new a.Z("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(e)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:n,authorizeUrl:l,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=d}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return(0,f.hF)(e.popupCallbackUrl);if(t){const e=(0,f.mN)(r);return e.query&&["code","error","error_description","message_code","persist","state"].forEach((t=>{delete e.query[t]})),(0,f.fl)(e.path,e.query)}return r}}ft.prototype.declaredClass="esri.identity.IdentityManagerBase";let _t=class extends l.Z.EventedAccessor{constructor(e){super(e),this._oAuthCred=null,this.tokenRefreshBuffer=2,e?._oAuthCred&&(this._oAuthCred=e._oAuthCred)}initialize(){this.resources=this.resources||[],null==this.creationTime&&(this.creationTime=Date.now())}refreshToken(){const e=s.id.findServerInfo(this.server),t=e?.owningSystemUrl,r=!!t&&"server"===this.scope,i=r&&ct(e,s.id._legacyFed),o=e.webTierAuth,n=o&&s.id.normalizeWebTierAuth,a=ht[this.server],l=a?.[this.userId];let h,d=this.resources&&this.resources[0],c=r?s.id.findServerInfo(t):null,p={username:this.userId,password:l};if(o&&!n)return;r&&!c&&s.id.serverInfos.some((e=>(s.id._isIdProvider(t,e.server)&&(c=e),!!c)));const u=c?s.id.findCredential(c.server,this.userId):null;if(!r||u){if(!i){if(r)h={serverUrl:d,token:u?.token,ssl:u&&u.ssl};else if(n)p=null,h={ssl:this.ssl};else{if(!l){let t;return d&&(d=s.id._sanitizeUrl(d),this._enqueued=1,t=s.id._enqueue(d,e,null,null,this.isAdmin,this),t.then((()=>{this._enqueued=0,this.refreshServerTokens()})).catch((()=>{this._enqueued=0}))),t}this.isAdmin&&(h={isAdmin:!0})}return s.id.generateToken(r?c:e,r?null:p,h).then((e=>{this.token=e.token,this.expires=null!=e.expires?Number(e.expires):null,this.creationTime=Date.now(),this.validity=e.validity,this.emitTokenChange(),this.refreshServerTokens()})).catch((()=>{}))}u?.refreshToken()}}refreshServerTokens(){"portal"===this.scope&&s.id.credentials.forEach((e=>{const t=s.id.findServerInfo(e.server),r=t?.owningSystemUrl;e!==this&&e.userId===this.userId&&r&&"server"===e.scope&&(s.id._hasSameServerInstance(this.server,r)||s.id._isIdProvider(r,this.server))&&(ct(t,s.id._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())}))}emitTokenChange(e){clearTimeout(this._refreshTimer);const t=this.server?s.id.findServerInfo(this.server):null,r=t?.owningSystemUrl,i=r?s.id.findServerInfo(r):null;!1===e||r&&"portal"!==this.scope&&(!i?.webTierAuth||s.id.normalizeWebTierAuth)||null==this.expires&&null==this.validity||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const e=s.id.credentials.indexOf(this);e>-1&&s.id.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const e=(0,d.yd)({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),t=this.resources;return t&&t.length>0&&(e.resources=t.slice()),e}_startRefreshTimer(){clearTimeout(this._refreshTimer);const e=6e4*this.tokenRefreshBuffer,t=2**31-1;let r=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();r<0?r=0:r>t&&(r=t),this._refreshTimer=setTimeout(this.refreshToken.bind(this),r>e?r-e:r)}};(0,i._)([(0,_.Cb)()],_t.prototype,"creationTime",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"expires",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"isAdmin",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"oAuthState",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"resources",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"scope",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"server",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"ssl",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"token",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"tokenRefreshBuffer",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"userId",void 0),(0,i._)([(0,_.Cb)()],_t.prototype,"validity",void 0),_t=(0,i._)([(0,g.j)("esri.identity.Credential")],_t);class gt extends ft{}gt.prototype.declaredClass="esri.identity.IdentityManager";const vt=new gt;(0,s.qh)(vt)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7865,7873,5732],{92835:(e,t,r)=>{r.d(t,{Z:()=>f});var s,i=r(43697),n=r(96674),a=r(35463),o=r(5600),l=(r(75215),r(67676),r(80442),r(71715)),u=r(52011),d=r(30556),c=r(25031);let p=s=class extends n.wq{static get allTime(){return h}static get empty(){return y}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(s.allTime)}get isEmpty(){return this.equals(s.empty)}readStart(e,t){return null!=t.start?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new s({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,i=e.end?.getTime()??e.end;return t===s&&r===i}expandTo(e,t=c.By){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,a.JE)(r,e,t));let i=this.end;if(i){const r=(0,a.JE)(i,e,t);i=i.getTime()===r.getTime()?r:(0,a.Nm)(r,1,e,t)}return new s({start:r,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return s.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,i=e.start?.getTime()??-1/0,n=e.end?.getTime()??1/0;let a,o;if(i>=t&&i<=r?a=i:t>=i&&t<=n&&(a=t),r>=i&&r<=n?o=r:n>=t&&n<=r&&(o=n),null!=a&&null!=o&&!isNaN(a)&&!isNaN(o)){const e=new s;return e.start=a===-1/0?null:new Date(a),e.end=o===1/0?null:new Date(o),e}return s.empty}offset(e,t,r=c.By){if(this.isEmpty||this.isAllTime)return this.clone();const i=new s,{start:n,end:o}=this;return null!=n&&(i.start=(0,a.Nm)(n,e,t,r)),null!=o&&(i.end=(0,a.Nm)(o,e,t,r)),i}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return h.clone();const t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,r=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new s({start:t,end:r})}};(0,i._)([(0,o.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,i._)([(0,l.r)("end")],p.prototype,"readEnd",null),(0,i._)([(0,d.c)("end")],p.prototype,"writeEnd",null),(0,i._)([(0,o.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,i._)([(0,o.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,i._)([(0,o.Cb)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,i._)([(0,l.r)("start")],p.prototype,"readStart",null),(0,i._)([(0,d.c)("start")],p.prototype,"writeStart",null),p=s=(0,i._)([(0,u.j)("esri.TimeExtent")],p);const h=new p,y=new p({start:void 0,end:void 0}),f=p},5732:(e,t,r)=>{r.d(t,{c:()=>s,g:()=>i});var s="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}},57435:(e,t,r)=>{r.d(t,{Z:()=>u});var s=r(43697),i=r(46791),n=(r(66643),r(20102),r(92604),r(26258),r(87538)),a=r(5600),o=r(52011);let l=class extends i.Z{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,n.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=null!=this.getCollections?this.getCollections():null;if(null==e)return void this.removeAll();let t=0;for(const r of e)null!=r&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new i.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(e=>!!e);for(const s of t)if(s){if(r(s)){const t=this.indexOf(s,e);t>=0?t!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(s);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,s._)([(0,a.Cb)()],l.prototype,"getCollections",void 0),(0,s._)([(0,a.Cb)()],l.prototype,"getChildrenFunction",void 0),(0,s._)([(0,a.Cb)()],l.prototype,"itemFilterFunction",void 0),l=(0,s._)([(0,o.j)("esri.core.CollectionFlattener")],l);const u=l},17445:(e,t,r)=>{r.d(t,{N1:()=>p,YP:()=>l,Z_:()=>f,gx:()=>u,nn:()=>m,on:()=>c,tX:()=>v}),r(66643),r(46791);var s=r(91460),i=r(50758),n=r(70586),a=r(95330),o=r(26258);function l(e,t,r={}){return d(e,t,r,h)}function u(e,t,r={}){return d(e,t,r,y)}function d(e,t,r={},s){let i=null;const a=r.once?(e,r)=>{s(e)&&((0,n.hw)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,o.aQ)(e,a,r.sync,r.equals),r.initial){const t=e();a(t,t)}return i}function c(e,t,r,a={}){let o=null,u=null,d=null;function c(){o&&u&&(u.remove(),a.onListenerRemove?.(o),o=null,u=null)}function p(e){a.once&&a.once&&(0,n.hw)(d),r(e)}const h=l(e,((e,r)=>{c(),(0,s.vT)(e)&&(o=e,u=(0,s.on)(e,t,p),a.onListenerAdd?.(e))}),{sync:a.sync,initial:!0});return d=(0,i.kB)((()=>{h.remove(),c()})),d}function p(e,t){return function(e,t,r){if((0,a.Hc)(r))return Promise.reject((0,a.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let o=null;function l(){o=(0,n.hw)(o)}return new Promise(((s,n)=>{o=(0,i.AL)([(0,a.fu)(r,(()=>{l(),n((0,a.zE)())})),d(e,(e=>{l(),s(e)}),{sync:!1,once:!0},t??h)])}))}(e,y,t)}function h(e){return!0}function y(e){return!!e}r(87538);const f={sync:!0},m={initial:!0},v={sync:!0,initial:!0}},41123:(e,t,r)=>{r.d(t,{D:()=>i,z:()=>n});const s="randomUUID"in crypto;function i(){if(s)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 n(){return`{${i()}}`}},40504:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Z});var s=r(43697),i=r(57435),n=r(68668),a=r(92604),o=r(16453),l=r(95330),u=r(17445),d=r(5600),c=(r(75215),r(67676),r(80442),r(1153)),p=r(71715),h=r(52011),y=r(30556),f=r(31263),m=r(87085),v=r(71612),b=r(38009),g=r(16859),w=r(72965),_=r(87344),I=r(15235),P=r(46791),C=r(70921);function E(e,t,r){let s,i;if(e)for(let n=0,a=e.length;n<a;n++){if(s=e.at(n),s?.[t]===r)return s;if("group"===s?.type&&(i=E(s.layers,t,r),i))return i}}const T=e=>{let t=class extends e{constructor(...e){super(...e),this.layers=new P.Z;const t=e=>{e.parent=this,this.layerAdded(e),"elevation"!==e.type&&"base-elevation"!==e.type||a.Z.getLogger(this).error(`Layer 'title:${e.title}, id:${e.id}' of type '${e.type}' is not supported as an operational layer and will therefore be ignored.`)},r=e=>{e.parent=null,this.layerRemoved(e)};this.addHandles([this.layers.on("before-add",(e=>(e=>{e.parent&&"remove"in e.parent&&e.parent.remove(e)})(e.item))),this.layers.on("after-add",(e=>t(e.item))),this.layers.on("after-remove",(e=>r(e.item)))])}destroy(){const e=this.layers.toArray();for(const t of e)t.destroy();this.layers.destroy()}set layers(e){this._set("layers",(0,C.Z)(e,this._get("layers")))}add(e,t){const r=this.layers;if(t=r.getNextIndex(t),e instanceof m.Z){const s=e;s.parent===this?this.reorder(s,t):r.add(s,t)}else(0,l.y8)(e)?e.then((e=>{this.destroyed||this.add(e,t)})):a.Z.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(e,t){const r=this.layers;let s=r.getNextIndex(t);e.slice().forEach((e=>{e.parent!==this?(r.add(e,s),s+=1):this.reorder(e,s)}))}findLayerById(e){return E(this.layers,"id",e)}findLayerByUid(e){return E(this.layers,"uid",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,t){return this.layers.reorder(e,t)}layerAdded(e){}layerRemoved(e){}};return(0,s._)([(0,d.Cb)()],t.prototype,"layers",null),t=(0,s._)([(0,h.j)("esri.support.LayersMixin")],t),t};function S(e,t,r){if(e)for(let s=0,i=e.length;s<i;s++){const i=e.at(s);if(i[t]===r)return i;if("group"===i?.type){const e=S(i.tables,t,r);if(e)return e}}}const A=e=>{let t=class extends e{constructor(...e){super(...e),this.tables=new P.Z,this.addHandles([this.tables.on("after-add",(e=>{const t=e.item;t.parent&&t.parent!==this&&"tables"in t.parent&&t.parent.tables.remove(t),t.parent=this,"feature"!==t.type&&a.Z.getLogger(this).error(`Layer 'title:${t.title}, id:${t.id}' of type '${t.type}' is not supported as a table and will therefore be ignored.`)})),this.tables.on("after-remove",(e=>{e.item.parent=null}))])}destroy(){const e=this.tables.toArray();for(const t of e)t.destroy();this.tables.destroy()}set tables(e){this._set("tables",(0,C.Z)(e,this._get("tables")))}findTableById(e){return S(this.tables,"id",e)}findTableByUid(e){return S(this.tables,"uid",e)}};return(0,s._)([(0,d.Cb)()],t.prototype,"tables",null),t=(0,s._)([(0,h.j)("esri.support.TablesMixin")],t),t},L=Symbol("WebScene");var O=r(12259),F=r(35755),x=r(15650);let U=class extends((0,v.h)((0,w.M)((0,b.q)((0,g.I)(A(T((0,o.R)(m.Z)))))))){constructor(e){var t;super(e),this.allLayers=new i.Z({getCollections:()=>[this.layers],getChildrenFunction:e=>"layers"in e?e.layers:null}),this.allTables=(t=this,new i.Z({getCollections:()=>[t.tables,t.layers],getChildrenFunction:e=>{const t=[];return"tables"in e&&t.push(e.tables),"layers"in e&&t.push(e.layers),t},itemFilterFunction:e=>{const t=e.parent;return!!t&&"tables"in t&&t.tables.includes(e)}})),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=(0,l.Ds)((async(e,t,s)=>{const{save:i,saveAs:n}=await r.e(821).then(r.bind(r,30821));switch(e){case O.x.SAVE:return i(this,t);case O.x.SAVE_AS:return n(this,s,t)}}))}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([(0,u.YP)((()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&L in e}),(e=>{const t="prevent-adding-tables";this.removeHandles(t),e&&(this.tables.removeAll(),this.addHandles((0,u.on)((()=>this.tables),"before-add",(e=>{e.preventDefault(),a.Z.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")})),t))}),u.tX),(0,u.YP)((()=>this.visible),this._onVisibilityChange.bind(this),u.Z_)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===f.s3.USER}_writeLayers(e,t,r,s){const i=[];if(!e)return i;e.forEach((e=>{const t=(0,x.Nw)(e,s.webmap?s.webmap.getLayerJSONFromResourceInfo(e):null,s);t?.layerType&&i.push(t)})),t.layers=i}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,t,r){const{itemId:s,layerType:i}=t;if("GroupLayer"===i&&s)return new I.default({id:s,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}set visibilityMode(e){const t=this._get("visibilityMode")!==e;this._set("visibilityMode",e),t&&this._enforceVisibility(e,this.visible)}async beforeSave(){return(0,F.Pl)(this)}load(e){const t=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:_.T},e).catch((e=>{if((0,l.r9)(e),this.sourceIsPortalItem)throw e}));return this.addResolvingPromise(t),Promise.resolve(this)}async loadAll(){return(0,n.G)(this,(e=>{e(this.layers,this.tables)}))}async save(e){return this._debouncedSaveOperations(O.x.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(O.x.SAVE_AS,t,e)}layerAdded(e){e.visible&&"exclusive"===this.visibilityMode?this._turnOffOtherLayers(e):"inherited"===this.visibilityMode&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer readded to Grouplayer: uid=${e.uid}`):this.addHandles((0,u.YP)((()=>e.visible),(t=>this._onChildVisibilityChange(e,t)),u.Z_),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach((t=>{t!==e&&(t.visible=!1)}))}_enforceVisibility(e,t){if(!(0,c.vw)(this).initialized)return;const r=this.layers;let s=r.find((e=>e.visible));switch(e){case"exclusive":r.length&&!s&&(s=r.at(0),s.visible=!0),this._turnOffOtherLayers(s);break;case"inherited":r.forEach((e=>{e.visible=t}))}}_onVisibilityChange(e){"inherited"===this.visibilityMode&&this.layers.forEach((t=>{t.visible=e}))}_onChildVisibilityChange(e,t){switch(this.visibilityMode){case"exclusive":t?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some((e=>e.visible))}};(0,s._)([(0,d.Cb)({readOnly:!0,dependsOn:[]})],U.prototype,"allLayers",void 0),(0,s._)([(0,d.Cb)({readOnly:!0})],U.prototype,"allTables",void 0),(0,s._)([(0,d.Cb)({json:{read:!0,write:!0}})],U.prototype,"blendMode",void 0),(0,s._)([(0,d.Cb)()],U.prototype,"fullExtent",void 0),(0,s._)([(0,d.Cb)({readOnly:!0})],U.prototype,"sourceIsPortalItem",null),(0,s._)([(0,d.Cb)({json:{read:!1,write:{ignoreOrigin:!0}}})],U.prototype,"layers",void 0),(0,s._)([(0,y.c)("layers")],U.prototype,"_writeLayers",null),(0,s._)([(0,d.Cb)({type:["GroupLayer"]})],U.prototype,"operationalLayerType",void 0),(0,s._)([(0,d.Cb)({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,t,r){return{enabled:"Group Layer"===e?.type&&r?.initiator!==this}}}},"web-scene":{read:!1,write:!1}}}})],U.prototype,"portalItem",null),(0,s._)([(0,p.r)("web-map","portalItem",["itemId"])],U.prototype,"readPortalItem",null),(0,s._)([(0,y.c)("web-map","portalItem",{itemId:{type:String}})],U.prototype,"writePortalItem",null),(0,s._)([(0,d.Cb)()],U.prototype,"spatialReference",void 0),(0,s._)([(0,d.Cb)({json:{read:!1},readOnly:!0,value:"group"})],U.prototype,"type",void 0),(0,s._)([(0,d.Cb)({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,t,r)=>{"inherited"!==e&&(t[r]=e)}}}}})],U.prototype,"visibilityMode",null),U=(0,s._)([(0,h.j)("esri.layers.GroupLayer")],U);const Z=U},16859:(e,t,r)=>{r.d(t,{I:()=>I});var s=r(43697),i=r(68773),n=r(40330),a=r(3172),o=r(66643),l=r(20102),u=r(92604),d=r(70586),c=r(95330),p=r(17452),h=r(5600),y=(r(75215),r(67676),r(80442),r(71715)),f=r(52011),m=r(30556),v=r(84230),b=r(48522),g=r(15235),w=r(86082),_=r(14661);const I=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,d.SC)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r?.portal})}writePortalItem(e,t){e?.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem?.id)try{const{load:s}=await r.e(8062).then(r.bind(r,18062));return(0,c.k_)(t),await s({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,c.D_)(e)||u.Z.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.r9)(e),!0))))}async setUserPrivileges(e,t){if(!i.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:r,fullEdit:s},content:{updateItem:i}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",i)}catch(e){(0,c.r9)(e)}}async _fetchUserPrivileges(e,t){let r=this.portalItem;if(!e||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(t);const s=e===r.id;if(s&&r.portal.user)return(0,_.Ss)(r);let i,a;if(s)i=r.portal.url;else try{i=await(0,v.oP)(this.url,t)}catch(e){(0,c.r9)(e)}if(!i||!(0,p.Zo)(i,r.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;a=await(n.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.r9)(e)}if(!a)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(s?await r.reload():(r=new g.default({id:e,portal:{url:i}}),await r.load(t)),r.portal.user)return(0,_.Ss)(r)}catch(e){(0,c.r9)(e)}return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}}}async _fetchFallbackUserPrivileges(e){let t=!0;try{t=await this._fetchUserHasEditingPrivileges(e)}catch(e){(0,c.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?n.id?.findCredential(this.url):null;if(!t)return!0;const r=P.credential===t?P.user:await this._fetchEditingUser(e);return P.credential=t,P.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const r=n.id.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const s=`${r.owningSystemUrl}/sharing/rest`,i=b.Z.getDefault();if(i&&i.loaded&&(0,p.Fv)(i.restUrl)===(0,p.Fv)(s))return i.user;const l=`${s}/community/self`,u=null!=e?e.signal:null,d=await(0,o.q6)((0,a.Z)(l,{authMode:"no-prompt",query:{f:"json"},signal:u}));return d.ok?w.Z.fromJSON(d.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t?.portal,s=this.portalItem?.id&&(this.portalItem.portal||b.Z.getDefault());return r&&s&&!(0,p.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,h.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,s._)([(0,y.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,h.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,h.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,s._)([(0,h.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,s._)([(0,h.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,s._)([(0,f.j)("esri.layers.mixins.PortalLayer")],t),t},P={credential:null,user:null}},97873:(e,t,r)=>{r.d(t,{FO:()=>c,W7:()=>p,addOrUpdateResource:()=>o,fetchResources:()=>a,removeAllResources:()=>u,removeResource:()=>l});var s=r(3172),i=r(20102),n=r(17452);async function a(e,t={},r){await e.load(r);const s=(0,n.v_)(e.itemUrl,"resources"),{start:i=1,num:a=10,sortOrder:o="asc",sortField:l="created"}=t,u={query:{start:i,num:a,sortOrder:o,sortField:l,token:e.apiKey},signal:r?.signal},d=await e.portal.request(s,u);return{total:d.total,nextStart:d.nextStart,resources:d.resources.map((({created:t,size:r,resource:s})=>({created:new Date(t),size:r,resource:e.resourceFromPath(s)})))}}async function o(e,t,r,s){if(!e.hasPath())throw new i.Z(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const a=e.portalItem;await a.load(s);const o=(0,n.v_)(a.userItemUrl,"add"===t?"addResources":"updateResources"),[l,u]=d(e.path),c=new FormData;return l&&"."!==l&&c.append("resourcesPrefix",l),null!=s&&s.compress&&c.append("compress","true"),c.append("fileName",u),c.append("file",r,u),c.append("f","json"),s?.access&&c.append("access",s.access),await a.portal.request(o,{method:"post",body:c,signal:s?.signal}),e}async function l(e,t,r){if(!t.hasPath())throw new i.Z("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const s=(0,n.v_)(e.userItemUrl,"removeResources");await e.portal.request(s,{method:"post",query:{resource:t.path},signal:r?.signal}),t.portalItem=null}async function u(e,t){await e.load(t);const r=(0,n.v_)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function d(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}async function c(e){return"blob"===e.type?e.blob:"json"===e.type?new Blob([e.jsonString],{type:"application/json"}):(await(0,s.Z)(e.url,{responseType:"blob"})).data}function p(e,t){if(!e.hasPath())return null;const[r,,s]=function(e){const[t,r]=function(e){const t=(0,n.Ml)(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[s,i]=d(t);return[s,i,r]}(e.path);return e.portalItem.resourceFromPath((0,n.v_)(r,t+s))}},12259:(e,t,r)=>{var s;r.d(t,{x:()=>s}),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(s||(s={}))},35755:(e,t,r)=>{r.d(t,{Hn:()=>l,Pl:()=>y,bx:()=>u});var s=r(66643),i=r(20102),n=r(95330),a=r(41123),o=r(97873);async function l(e,t,r=null){const s=await d(e,t,r);await c(s,t,r)}async function u(e,t,r,s,i=null){const n=await d(r,s,i);await e.update({data:t}),await c(n,s,i)}async function d(e,t,r=null){if(!t?.resources)return;const s=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const l=new Set(t.resources.toKeep.map((e=>e.resource.path))),u=new Set,d=[];l.forEach((t=>{s.delete(t),e.paths.push(t)}));for(const i of t.resources.toUpdate)if(s.delete(i.resource.path),l.has(i.resource.path)||u.has(i.resource.path)){const{resource:t,content:s,finish:n,error:l}=i,u=(0,o.W7)(t,(0,a.D)());e.paths.push(u.path),d.push(p({resource:u,content:s,compress:i.compress,finish:n,error:l},r))}else e.paths.push(i.resource.path),d.push(h(i,r)),u.add(i.resource.path);for(const i of t.resources.toAdd)e.paths.push(i.resource.path),s.has(i.resource.path)?s.delete(i.resource.path):d.push(p(i,r));if(0===d.length)return s;const c=await(0,n.UO)(d);if((0,n.k_)(r),c.length>0)throw new i.Z("save:resources","Failed to save one or more resources",{errors:c});return s}async function c(e,t,r=null){if(!e||!t.portalItem)return;const s=[];for(const i of e){const e=t.portalItem.resourceFromPath(i);s.push(e.portalItem.removeResource(e,r))}await(0,n.as)(s)}async function p(e,t){const r={...null!=t?t:{},compress:e.compress},i=await(0,s.q6)(e.resource.portalItem.addResource(e.resource,await(0,o.FO)(e.content),r));if(!0!==i.ok)throw e.error?.(i.error),i.error;e.finish?.(e.resource)}async function h(e,t){const r=await(0,s.q6)(e.resource.update(await(0,o.FO)(e.content),t));if(!0!==r.ok)throw e.error?.(r.error),r.error;e.finish?.(e.resource)}async function y(e){const t=[];for(const r of e.allLayers)if("beforeSave"in r&&"function"==typeof r.beforeSave){const e=r.beforeSave();e&&t.push(e)}await Promise.allSettled(t)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3554,5732],{5732:(e,t,r)=>{r.d(t,{c:()=>s,g:()=>o});var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},57435:(e,t,r)=>{r.d(t,{Z:()=>p});var s=r(43697),o=r(46791),i=(r(66643),r(20102),r(92604),r(26258),r(87538)),n=r(5600),a=r(52011);let l=class extends o.Z{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles((0,i.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=null!=this.getCollections?this.getCollections():null;if(null==e)return void this.removeAll();let t=0;for(const r of e)null!=r&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new o.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction??(e=>!!e);for(const s of t)if(s){if(r(s)){const t=this.indexOf(s,e);t>=0?t!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(s);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,s._)([(0,n.Cb)()],l.prototype,"getCollections",void 0),(0,s._)([(0,n.Cb)()],l.prototype,"getChildrenFunction",void 0),(0,s._)([(0,n.Cb)()],l.prototype,"itemFilterFunction",void 0),l=(0,s._)([(0,a.j)("esri.core.CollectionFlattener")],l);const p=l},30223:(e,t,r)=>{r.r(t),r.d(t,{default:()=>$e});var s=r(43697),o=r(46791),i=r(57435),n=r(20102),a=r(22974),l=r(68668),p=r(92604),u=r(16453),d=r(95330),y=r(17452),c=r(5600),h=r(75215),f=r(71715),g=r(52011),m=r(82971),b=r(87085),v=r(38171),w=r(51773),_=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),C=r(3172),S=r(35454),x=r(83379),F=r(609),T=(r(67676),r(80442),r(36030)),j=r(6570),O=r(19238),R=r(10699),I=r(21506);let A=class extends((0,R.IG)(u.w)){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(e,t){return"string"==typeof t.alias?t.alias:"string"==typeof t.name?t.name:""}readIdOnlyOnce(e){return-1!==this.id?this.id:"number"==typeof e?e:-1}};(0,s._)([(0,c.Cb)({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],A.prototype,"title",void 0),(0,s._)([(0,f.r)("service","title",["alias","name"])],A.prototype,"readTitle",null),(0,s._)([(0,c.Cb)()],A.prototype,"layer",void 0),(0,s._)([(0,c.Cb)({type:h.z8,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],A.prototype,"id",void 0),(0,s._)([(0,f.r)("service","id")],A.prototype,"readIdOnlyOnce",null),(0,s._)([(0,c.Cb)((0,I.Lx)(String))],A.prototype,"modelName",void 0),(0,s._)([(0,c.Cb)((0,I.Lx)(Boolean))],A.prototype,"isEmpty",void 0),(0,s._)([(0,c.Cb)({type:Boolean,nonNullable:!0})],A.prototype,"legendEnabled",void 0),(0,s._)([(0,c.Cb)({type:Boolean,json:{name:"visibility",write:!0}})],A.prototype,"visible",void 0),(0,s._)([(0,c.Cb)({type:Number,json:{write:!0}})],A.prototype,"opacity",void 0),A=(0,s._)([(0,g.j)("esri.layers.buildingSublayers.BuildingSublayer")],A);const L=A;var E=r(15506),q=r(53518),Z=r(99514),P=r(69165),Q=r(61064),B=r(51161),M=r(14165),N=r(32163),D=r(86787),k=r(2358),z=r(19833);const U="esri.layers.buildingSublayers.BuildingComponentSublayer",G=p.Z.getLogger(U),H=(0,q.v)();let V=class extends(x.Z.LoadableMixin((0,F.v)(L))){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new Z.Z(this.fields)}readAssociatedLayer(e,t){const r=this.layer.associatedFeatureServiceItem,s=t.associatedLayerID;return null!=r&&"number"==typeof s?new O.default({portalItem:r,layerId:s}):null}get objectIdField(){if(null!=this.fields)for(const e of this.fields)if("oid"===e.type)return e.name;return null}get displayField(){return null!=this.associatedLayer?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const t=null!=e?e.signal:null,r=this._fetchService(t).then((()=>{this.indexInfo=(0,Q.T)(this.parsedUrl.path,this.rootNode,this.nodePages,this.apiKey,G,t)}));return this.addResolvingPromise(r),Promise.resolve(this)}createPopupTemplate(e){return(0,N.eZ)(this,e)}async _fetchService(e){const t=(await(0,C.Z)(this.parsedUrl.path,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&null!=this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return null!=this.associatedLayer?this.associatedLayer.types??[]:[]}get typeIdField(){return null!=this.associatedLayer?this.associatedLayer.typeIdField:null}get geometryType(){return"3d-object"===this.layerType?"mesh":"point"}get profile(){return"3d-object"===this.layerType?"mesh-pyramids":"points"}get capabilities(){const e=null!=this.associatedLayer&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:E.C,{query:t,data:{supportsZ:r,supportsM:s,isVersioned:o}}=e;return{query:t,data:{supportsZ:r,supportsM:s,isVersioned:o}}}createQuery(){const e=new M.Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this.layer,t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}async queryCachedAttributes(e,t){const r=(0,P.Lk)(this.fieldsIndex,await(0,z.e7)(this,(0,z.V5)(this)));return(0,k.xe)(this.parsedUrl.path,this.attributeStorageInfo,e,t,r)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new n.Z("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new v.Z;return s.attributes=r[0],s.layer=this,s.sourceLayer=this,s}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:null!=this.associatedLayer}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return null!=e&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),null==this.associatedLayer)throw new n.Z("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new n.Z("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};(0,s._)([(0,c.Cb)({readOnly:!0})],V.prototype,"parsedUrl",null),(0,s._)([(0,c.Cb)({type:B.U4,readOnly:!0})],V.prototype,"nodePages",void 0),(0,s._)([(0,c.Cb)({type:[B.QI],readOnly:!0})],V.prototype,"materialDefinitions",void 0),(0,s._)([(0,c.Cb)({type:[B.Yh],readOnly:!0})],V.prototype,"textureSetDefinitions",void 0),(0,s._)([(0,c.Cb)({type:[B.H3],readOnly:!0})],V.prototype,"geometryDefinitions",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],V.prototype,"serviceUpdateTimeStamp",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],V.prototype,"store",void 0),(0,s._)([(0,c.Cb)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],V.prototype,"rootNode",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],V.prototype,"attributeStorageInfo",void 0),(0,s._)([(0,c.Cb)(H.fields)],V.prototype,"fields",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],V.prototype,"fieldsIndex",null),(0,s._)([(0,c.Cb)({readOnly:!0,type:O.default})],V.prototype,"associatedLayer",void 0),(0,s._)([(0,f.r)("service","associatedLayer",["associatedLayerID"])],V.prototype,"readAssociatedLayer",null),(0,s._)([(0,c.Cb)(H.outFields)],V.prototype,"outFields",void 0),(0,s._)([(0,c.Cb)({type:String,readOnly:!0})],V.prototype,"objectIdField",null),(0,s._)([(0,c.Cb)({readOnly:!0,type:String,json:{read:!1}})],V.prototype,"displayField",null),(0,s._)([(0,c.Cb)({readOnly:!0,type:String})],V.prototype,"apiKey",null),(0,s._)([(0,c.Cb)({readOnly:!0,type:j.Z})],V.prototype,"fullExtent",null),(0,s._)([(0,c.Cb)({readOnly:!0,type:m.Z})],V.prototype,"spatialReference",null),(0,s._)([(0,c.Cb)({readOnly:!0})],V.prototype,"version",null),(0,s._)([(0,c.Cb)({readOnly:!0,type:D.Z})],V.prototype,"elevationInfo",null),(0,s._)([(0,c.Cb)({readOnly:!0,type:Number})],V.prototype,"minScale",null),(0,s._)([(0,c.Cb)({readOnly:!0,type:Number})],V.prototype,"maxScale",null),(0,s._)([(0,c.Cb)({readOnly:!0,type:Number})],V.prototype,"effectiveScaleRange",null),(0,s._)([(0,c.Cb)({type:["hide","show"],json:{write:!0}})],V.prototype,"listMode",void 0),(0,s._)([(0,c.Cb)({types:_.o,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],V.prototype,"renderer",void 0),(0,s._)([(0,c.Cb)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],V.prototype,"definitionExpression",void 0),(0,s._)([(0,c.Cb)(I.C_)],V.prototype,"popupEnabled",void 0),(0,s._)([(0,c.Cb)({type:w.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],V.prototype,"popupTemplate",void 0),(0,s._)([(0,c.Cb)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],V.prototype,"normalReferenceFrame",void 0),(0,s._)([(0,c.Cb)({readOnly:!0,json:{read:!1}})],V.prototype,"defaultPopupTemplate",null),(0,s._)([(0,c.Cb)()],V.prototype,"types",null),(0,s._)([(0,c.Cb)()],V.prototype,"typeIdField",null),(0,s._)([(0,c.Cb)({json:{write:!1}}),(0,T.J)(new S.X({"3DObject":"3d-object",Point:"point"}))],V.prototype,"layerType",void 0),(0,s._)([(0,c.Cb)()],V.prototype,"geometryType",null),(0,s._)([(0,c.Cb)()],V.prototype,"profile",null),(0,s._)([(0,c.Cb)({readOnly:!0,json:{read:!1}})],V.prototype,"capabilities",null),V=(0,s._)([(0,g.j)(U)],V);const J=V;var K,W=r(20941);const X={type:o.Z,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:$}}},read:!1}};function $(e,t,r){if(e&&Array.isArray(e))return new o.Z(e.map((e=>{const t=function(e){return"group"===e.layerType?Y:J}(e);if(t){const s=new t;return s.read(e,r),s}return r?.messages&&e&&r.messages.push(new W.Z("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:r})),null})))}let Y=K=class extends L{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return(0,l.w)(this,(e=>K.forEachSublayer(this.sublayers,(t=>{"building-group"!==t.type&&e(t)}))))}};var ee;(0,s._)([(0,c.Cb)({type:["hide","show","hide-children"],json:{write:!0}})],Y.prototype,"listMode",void 0),(0,s._)([(0,c.Cb)(X)],Y.prototype,"sublayers",void 0),Y=K=(0,s._)([(0,g.j)("esri.layers.buildingSublayers.BuildingGroupSublayer")],Y),(ee=Y||(Y={})).sublayersProperty=X,ee.readSublayers=$,ee.forEachSublayer=function e(t,r){t.forEach((t=>{r(t),"building-group"===t.type&&e(t.sublayers,r)}))};const te=Y;var re=r(54295),se=r(17287),oe=r(38009),ie=r(16859),ne=r(72965),ae=r(37253),le=r(71592),pe=r(96674),ue=r(41123);let de=class extends pe.wq{constructor(){super(...arguments),this.type=null}};(0,s._)([(0,c.Cb)({type:String,readOnly:!0,json:{write:!0}})],de.prototype,"type",void 0),de=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilterAuthoringInfo")],de);const ye=de;var ce;let he=ce=class extends pe.wq{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new ce({filterType:this.filterType,filterValues:(0,a.d9)(this.filterValues)})}};(0,s._)([(0,c.Cb)({type:String,json:{write:!0}})],he.prototype,"filterType",void 0),(0,s._)([(0,c.Cb)({type:[String],json:{write:!0}})],he.prototype,"filterValues",void 0),he=ce=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilterAuthoringInfoType")],he);const fe=he;var ge;const me=o.Z.ofType(fe);let be=ge=class extends pe.wq{clone(){return new ge({filterTypes:(0,a.d9)(this.filterTypes)})}};(0,s._)([(0,c.Cb)({type:me,json:{write:!0}})],be.prototype,"filterTypes",void 0),be=ge=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilterAuthoringInfoBlock")],be);const ve=be;var we;const _e=o.Z.ofType(ve);let Ce=we=class extends ye{constructor(){super(...arguments),this.type="checkbox"}clone(){return new we({filterBlocks:(0,a.d9)(this.filterBlocks)})}};(0,s._)([(0,c.Cb)({type:["checkbox"]})],Ce.prototype,"type",void 0),(0,s._)([(0,c.Cb)({type:_e,json:{write:!0}})],Ce.prototype,"filterBlocks",void 0),Ce=we=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],Ce);const Se=Ce;let xe=class extends pe.wq{};(0,s._)([(0,c.Cb)({readOnly:!0,json:{read:!1}})],xe.prototype,"type",void 0),xe=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilterMode")],xe);const Fe=xe;var Te;let je=Te=class extends Fe{constructor(){super(...arguments),this.type="solid"}clone(){return new Te}};(0,s._)([(0,c.Cb)({type:["solid"],readOnly:!0,json:{write:!0}})],je.prototype,"type",void 0),je=Te=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilterModeSolid")],je);const Oe=je;var Re,Ie=r(56332);let Ae=Re=class extends Fe{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new Re({edges:(0,a.d9)(this.edges)})}};(0,s._)([(0,T.J)({wireFrame:"wire-frame"})],Ae.prototype,"type",void 0),(0,s._)([(0,c.Cb)(Ie.Z)],Ae.prototype,"edges",void 0),Ae=Re=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilterModeWireFrame")],Ae);const Le=Ae;var Ee;let qe=Ee=class extends Fe{constructor(){super(...arguments),this.type="x-ray"}clone(){return new Ee}};(0,s._)([(0,c.Cb)({type:["x-ray"],readOnly:!0,json:{write:!0}})],qe.prototype,"type",void 0),qe=Ee=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilterModeXRay")],qe);const Ze=qe;var Pe;const Qe={nonNullable:!0,types:{key:"type",base:Fe,typeMap:{solid:Oe,"wire-frame":Le,"x-ray":Ze}},json:{read:e=>{switch(e?.type){case"solid":return Oe.fromJSON(e);case"wireFrame":return Le.fromJSON(e);case"x-ray":return Ze.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let Be=Pe=class extends pe.wq{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new Oe,this.title=""}clone(){return new Pe({filterExpression:this.filterExpression,filterMode:(0,a.d9)(this.filterMode),title:this.title})}};(0,s._)([(0,c.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],Be.prototype,"filterExpression",void 0),(0,s._)([(0,c.Cb)(Qe)],Be.prototype,"filterMode",void 0),(0,s._)([(0,c.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],Be.prototype,"title",void 0),Be=Pe=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilterBlock")],Be);const Me=Be;var Ne;const De=o.Z.ofType(Me);let ke=Ne=class extends pe.wq{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=(0,ue.D)(),this.name=null}clone(){return new Ne({description:this.description,filterBlocks:(0,a.d9)(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:(0,a.d9)(this.filterAuthoringInfo)})}};(0,s._)([(0,c.Cb)({type:String,json:{write:!0}})],ke.prototype,"description",void 0),(0,s._)([(0,c.Cb)({type:De,json:{write:{enabled:!0,isRequired:!0}}})],ke.prototype,"filterBlocks",void 0),(0,s._)([(0,c.Cb)({types:{key:"type",base:ye,typeMap:{checkbox:Se}},json:{read:e=>"checkbox"===e?.type?Se.fromJSON(e):null,write:!0}})],ke.prototype,"filterAuthoringInfo",void 0),(0,s._)([(0,c.Cb)({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],ke.prototype,"id",void 0),(0,s._)([(0,c.Cb)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],ke.prototype,"name",void 0),ke=Ne=(0,s._)([(0,g.j)("esri.layers.support.BuildingFilter")],ke);const ze=ke;let Ue=class extends pe.wq{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};(0,s._)([(0,c.Cb)({type:String})],Ue.prototype,"fieldName",void 0),(0,s._)([(0,c.Cb)({type:String})],Ue.prototype,"modelName",void 0),(0,s._)([(0,c.Cb)({type:String})],Ue.prototype,"label",void 0),(0,s._)([(0,c.Cb)({type:Number})],Ue.prototype,"min",void 0),(0,s._)([(0,c.Cb)({type:Number})],Ue.prototype,"max",void 0),(0,s._)([(0,c.Cb)({json:{read:e=>Array.isArray(e)&&(e.every((e=>"string"==typeof e))||e.every((e=>"number"==typeof e)))?e.slice():null}})],Ue.prototype,"mostFrequentValues",void 0),(0,s._)([(0,c.Cb)({type:[Number]})],Ue.prototype,"subLayerIds",void 0),Ue=(0,s._)([(0,g.j)("esri.layers.support.BuildingFieldStatistics")],Ue);let Ge=class extends(x.Z.LoadableMixin((0,F.v)(pe.wq))){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||"loading"===this.loadStatus?this._get("fields"):(p.Z.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._fetchService(t)),Promise.resolve(this)}async _fetchService(e){const t=(await(0,C.Z)(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(t,{origin:"service"})}};(0,s._)([(0,c.Cb)({constructOnly:!0,type:String})],Ge.prototype,"url",void 0),(0,s._)([(0,c.Cb)({readOnly:!0,type:[Ue],json:{read:{source:"summary"}}})],Ge.prototype,"fields",null),Ge=(0,s._)([(0,g.j)("esri.layers.support.BuildingSummaryStatistics")],Ge);const He=Ge;var Ve=r(36405);const Je=o.Z.ofType(ze),Ke=(0,a.d9)(te.sublayersProperty),We=Ke.json?.origins;We&&(We["web-scene"]={type:[J],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},We["portal-item"]={type:[J],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let Xe=class extends((0,ae.Vt)((0,se.Y)((0,oe.q)((0,ie.I)((0,ne.M)((0,u.R)((0,re.V)(b.Z)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new i.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>"building-group"===e.type?e.sublayers:null}),this.sublayers=null,this._sublayerOverrides=null,this.filters=new Je,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return"string"==typeof e?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,t,r){const s=te.readSublayers(e,t,r);return te.forEachSublayer(s,(e=>e.layer=this)),this._sublayerOverrides&&(this.applySublayerOverrides(s,this._sublayerOverrides),this._sublayerOverrides=null),s}applySublayerOverrides(e,{overrides:t,context:r}){te.forEachSublayer(e,(e=>e.read(t.get(e.id),r)))}readSublayerOverrides(e,t){const r=new Map;for(const s of e)null!=s&&"object"==typeof s&&"number"==typeof s.id?r.set(s.id,s):t.messages?.push(new n.Z("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:s}));return{overrides:r,context:t}}writeSublayerOverrides(e,t,r){const s=[];te.forEachSublayer(this.sublayers,(e=>{const t=e.write({},r);Object.keys(t).length>1&&s.push(t)})),s.length>0&&(t.sublayers=s)}writeUnappliedOverrides(e,t){t.sublayers=[],e.overrides.forEach((e=>{t.sublayers.push((0,a.d9)(e))}))}write(e,t){return e=super.write(e,t),!t||"web-scene"!==t.origin&&"portal-item"!==t.origin||(this.sublayers?this.writeSublayerOverrides(this.sublayers,e,t):this._sublayerOverrides&&this.writeUnappliedOverrides(this._sublayerOverrides,e)),e}read(e,t){if(super.read(e,t),t&&("web-scene"===t.origin||"portal-item"===t.origin)&&null!=e&&Array.isArray(e.sublayers)){const r=this.readSublayerOverrides(e.sublayers,t);this.sublayers?this.applySublayerOverrides(this.sublayers,r):this._sublayerOverrides=r}}readSummaryStatistics(e,t){if("string"==typeof t.statisticsHRef){const e=(0,y.v_)(this.parsedUrl?.path,t.statisticsHRef);return new He({url:e})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const t=null!=e?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d.r9).then((()=>this._fetchService(t))).then((()=>this._fetchAssociatedFeatureService(t)));return this.addResolvingPromise(r),Promise.resolve(this)}loadAll(){return(0,l.G)(this,(e=>{te.forEachSublayer(this.sublayers,(t=>{"building-group"!==t.type&&e(t)})),this.summaryStatistics&&e(this.summaryStatistics)}))}async saveAs(e,t){return this._debouncedSaveOperations(ae.xp.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(ae.xp.SAVE,e)}validateLayer(e){if(!e.layerType||"Building"!==e.layerType)throw new n.Z("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:t}=await(0,le.w)(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=t}catch(e){p.Z.getLogger(this).warn("Associated feature service item could not be loaded",e)}}_validateElevationInfo(){const e=this.elevationInfo,t="Building scene layers";(0,Ve.LR)(p.Z.getLogger(this),(0,Ve.Uy)(t,"absolute-height",e)),(0,Ve.LR)(p.Z.getLogger(this),(0,Ve.kf)(t,e))}};(0,s._)([(0,c.Cb)({type:["BuildingSceneLayer"]})],Xe.prototype,"operationalLayerType",void 0),(0,s._)([(0,c.Cb)({readOnly:!0})],Xe.prototype,"allSublayers",void 0),(0,s._)([(0,c.Cb)(Ke)],Xe.prototype,"sublayers",void 0),(0,s._)([(0,f.r)("service","sublayers")],Xe.prototype,"readSublayers",null),(0,s._)([(0,c.Cb)({type:Je,nonNullable:!0,json:{write:!0}})],Xe.prototype,"filters",void 0),(0,s._)([(0,c.Cb)({type:String,json:{write:!0}})],Xe.prototype,"activeFilterId",void 0),(0,s._)([(0,c.Cb)({readOnly:!0,type:He})],Xe.prototype,"summaryStatistics",void 0),(0,s._)([(0,f.r)("summaryStatistics",["statisticsHRef"])],Xe.prototype,"readSummaryStatistics",null),(0,s._)([(0,c.Cb)({type:[String],json:{read:!1}})],Xe.prototype,"outFields",void 0),(0,s._)([(0,c.Cb)(I.vg)],Xe.prototype,"fullExtent",void 0),(0,s._)([(0,c.Cb)(I.rn)],Xe.prototype,"legendEnabled",void 0),(0,s._)([(0,c.Cb)({type:["show","hide","hide-children"]})],Xe.prototype,"listMode",void 0),(0,s._)([(0,c.Cb)((0,I.Lx)(m.Z))],Xe.prototype,"spatialReference",void 0),(0,s._)([(0,c.Cb)(I.PV)],Xe.prototype,"elevationInfo",null),(0,s._)([(0,c.Cb)({json:{read:!1},readOnly:!0})],Xe.prototype,"type",void 0),(0,s._)([(0,c.Cb)()],Xe.prototype,"associatedFeatureServiceItem",void 0),Xe=(0,s._)([(0,g.j)("esri.layers.BuildingSceneLayer")],Xe);const $e=Xe},17017:(e,t,r)=>{r.d(t,{N:()=>n});var s=r(43697),o=r(5600),i=(r(75215),r(67676),r(80442),r(52011));const n=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,s._)([(0,o.Cb)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,s._)([(0,i.j)("esri.layers.mixins.CustomParametersMixin")],t),t}},34760:(e,t,r)=>{r.d(t,{Q:()=>v});var s=r(43697),o=r(92604),i=r(95330),n=r(5600),a=r(90578),l=(r(67676),r(80442),r(52011)),p=r(82960),u=r(46791),d=(r(66643),r(20102),r(26258),r(87538));const y=new u.Z,c=new WeakMap;function h(e){(function(e){return null!=e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e})(e)&&y.push(new WeakRef(e))}function f(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:f(t,e%t):0}let g=0,m=0;function b(){const e=Date.now();let t=!1;for(const r of y){const s=r.deref();s?s.refreshInterval&&e-(c.get(s)??0)+5>=6e4*s.refreshInterval&&(c.set(s,e),s.refresh(e)):t=!0}if(t)for(let e=y.length-1;e>=0;e--)y.at(e).deref()||y.removeAt(e)}(0,d.EH)((()=>{const e=Date.now();let t=0;for(const r of y){const s=r.deref();s&&(t=f(Math.round(6e4*s.refreshInterval),t),s.refreshInterval?c.get(s)||c.set(s,e):c.delete(s))}if(t!==m){if(m=t,clearInterval(g),0===m)return void(g=0);g=setInterval(b,m)}}));const v=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,i.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{this.destroyed||h(this)}),(()=>{}))}destroy(){!function(e){const t=y.find((t=>t.deref()===e));t&&y.remove(t)}(this)}castRefreshInterval(e){return e>=.1?e:e<=0?0:.1}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,i.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{o.Z.getLogger(this).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}get test(){const e=this;return{set refreshInterval(t){e._set("refreshInterval",t)}}}};return(0,s._)([(0,n.Cb)({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:p.C}}}}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,a.p)("refreshInterval")],t.prototype,"castRefreshInterval",null),(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"refreshParameters",null),t=(0,s._)([(0,l.j)("esri.layers.mixins.RefreshableLayer")],t),t}},70082:(e,t,r)=>{r.d(t,{Z:()=>d});var s=r(43697),o=r(2368),i=r(35454),n=r(96674),a=r(5600),l=(r(75215),r(67676),r(80442),r(52011));const p=new i.X({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let u=class extends((0,o.J)(n.wq)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,s._)([(0,a.Cb)({json:{write:!0}})],u.prototype,"name",void 0),(0,s._)([(0,a.Cb)({json:{write:!0}})],u.prototype,"description",void 0),(0,s._)([(0,a.Cb)({json:{read:p.read,write:p.write}})],u.prototype,"drawingTool",void 0),(0,s._)([(0,a.Cb)({json:{write:!0}})],u.prototype,"prototype",void 0),(0,s._)([(0,a.Cb)({json:{write:!0}})],u.prototype,"thumbnail",void 0),u=(0,s._)([(0,l.j)("esri.layers.support.FeatureTemplate")],u);const d=u},16451:(e,t,r)=>{r.d(t,{Z:()=>c});var s=r(43697),o=r(2368),i=r(96674),n=r(5600),a=(r(75215),r(67676),r(80442),r(71715)),l=r(52011),p=r(30556),u=r(72729),d=r(70082);let y=class extends((0,o.J)(i.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,u.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,s._)([(0,n.Cb)({json:{write:!0}})],y.prototype,"id",void 0),(0,s._)([(0,n.Cb)({json:{write:!0}})],y.prototype,"name",void 0),(0,s._)([(0,n.Cb)({json:{write:!0}})],y.prototype,"domains",void 0),(0,s._)([(0,a.r)("domains")],y.prototype,"readDomains",null),(0,s._)([(0,p.c)("domains")],y.prototype,"writeDomains",null),(0,s._)([(0,n.Cb)({type:[d.Z],json:{write:!0}})],y.prototype,"templates",void 0),y=(0,s._)([(0,l.j)("esri.layers.support.FeatureType")],y);const c=y},54275:(e,t,r)=>{r.d(t,{h:()=>d});var s=r(80442),o=r(66677);function i(e,t,r){return!!a(e,t,r)}function n(e,t,r){return a(e,t,r)}function a(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}const l={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function p(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function u(e,t){const r=e?.supportedOperationsWithCacheHint?.map((e=>e.toLowerCase()));return!!r?.includes(t.toLowerCase())}function d(e,t){return{analytics:y(e),attachment:c(e),data:h(e),metadata:f(e),operations:g(e.capabilities,e,t),query:m(e,t),queryRelated:b(e),queryTopFeatures:v(e),editing:w(e)}}function y(e){return{supportsCacheHint:u(e.advancedQueryCapabilities,"queryAnalytics")}}function c(e){const t=e.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:u(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:i(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach((e=>{const t=l[e.name];t&&(r[t]=!!e.isEnabled)})),r}function h(e){return{isVersioned:i(e,"isDataVersioned",!1),supportsAttachment:i(e,"hasAttachments",!1),supportsM:i(e,"hasM",!1),supportsZ:i(e,"hasZ",!1)}}function f(e){return{supportsAdvancedFieldProperties:i(e,"supportsFieldDescriptionProperty",!1)}}function g(e,t,r){const s=e?e.toLowerCase().split(",").map((e=>e.trim())):[],n=r?(0,o.Qc)(r):null,a=s.includes(null!=n&&"MapServer"===n.serverType?"data":"query"),l=s.includes("editing")&&!t.datesInUnknownTimezone;let p=l&&s.includes("create"),u=l&&s.includes("delete"),d=l&&s.includes("update");const y=s.includes("changetracking"),c=t.advancedQueryCapabilities;return l&&!(p||u||d)&&(p=u=d=!0),{supportsCalculate:i(t,"supportsCalculate",!1),supportsTruncate:i(t,"supportsTruncate",!1),supportsValidateSql:i(t,"supportsValidateSql",!1),supportsAdd:p,supportsDelete:u,supportsEditing:l,supportsChangeTracking:y,supportsQuery:a,supportsQueryAnalytics:i(c,"supportsQueryAnalytic",!1),supportsQueryAttachments:i(c,"supportsQueryAttachments",!1),supportsQueryTopFeatures:i(c,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:i(t,"supportsAttachmentsResizing",!1),supportsSync:s.includes("sync"),supportsUpdate:d,supportsExceedsLimitStatistics:i(t,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:i(t,"supportsAsyncConvert3D",!1)}}function m(e,t){const r=e.advancedQueryCapabilities,a=e.ownershipBasedAccessControlForFeatures,l=e.archivingInfo,d=e.currentVersion,y=t?.includes("MapServer"),c=!y||d>=(0,s.Z)("mapserver-pbf-version-support"),h=(0,o.M8)(t),f=new Set((e.supportedQueryFormats??"").split(",").map((e=>e.toLowerCase().trim())));return{supportsStatistics:i(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:i(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:i(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:p(r),supportsCentroid:i(r,"supportsReturningGeometryCentroid",!1),supportsDistance:i(r,"supportsQueryWithDistance",!1),supportsDistinct:i(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:i(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:i(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:i(r,"supportsHavingClause",!1),supportsOrderBy:i(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:i(r,"supportsPagination",!1),supportsQuantization:i(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:i(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:i(e,"supportsReturningQueryGeometry",!1),supportsResultType:i(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:i(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:i(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:i(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:i(r,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:i(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:i(a,"allowOthersToQuery",!0),supportsHistoricMoment:i(l,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:c&&f.has("pbf"),supportsDisjointSpatialRelationship:i(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:i(r,"supportsQueryWithCacheHint",!1)||u(r,"query"),supportsDefaultSpatialReference:i(r,"supportsDefaultSR",!1),supportsCompactGeometry:h,supportsFullTextSearch:i(r,"supportsFullTextSearch",!1),maxRecordCountFactor:n(e,"maxRecordCountFactor",void 0),maxRecordCount:n(e,"maxRecordCount",void 0),standardMaxRecordCount:n(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:n(e,"tileMaxRecordCount",void 0)}}function b(e){const t=e.advancedQueryCapabilities,r=i(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:i(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:u(t,"queryRelated")}}function v(e){return{supportsCacheHint:u(e.advancedQueryCapabilities,"queryTopFilter")}}function w(e){const t=e.ownershipBasedAccessControlForFeatures,r=e?e.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:i(e,"allowGeometryUpdates",!0),supportsGlobalId:i(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:i(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:i(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:i(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:i(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:i(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:i(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:i(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:i(t,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:i(r,"supportsAsyncApplyEdits",!1),zDefault:n(e,"zDefault",void 0)}}},28694:(e,t,r)=>{r.d(t,{p:()=>o});var s=r(69285);function o(e,t,r){if(!r?.features||!r.hasZ)return;const o=(0,s.k)(r.geometryType,t,e.outSpatialReference);if(null!=o)for(const e of r.features)o(e.geometry)}},74889:(e,t,r)=>{r.d(t,{Z:()=>v});var s,o=r(43697),i=r(66577),n=r(38171),a=r(35454),l=r(96674),p=r(22974),u=r(5600),d=(r(75215),r(71715)),y=r(52011),c=r(30556),h=r(82971),f=r(33955),g=r(1231);const m=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let b=s=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=h.Z.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){const o=e[t],i=n.Z.fromJSON(o),a=o.geometry?.spatialReference;null==i.geometry||a||(i.geometry.spatialReference=r);const l=o.aggregateGeometries,p=i.aggregateGeometries;if(l&&null!=p)for(const e in p){const t=p[e],s=l[e],o=s?.spatialReference;null==t||o||(t.spatialReference=r)}s.push(i)}return s}writeGeometryType(e,t,r,s){if(e)return void m.write(e,t,r,s);const{features:o}=this;if(o)for(const e of o)if(null!=e?.geometry)return void m.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,f.im)(e);return s&&!r&&t.spatialReference&&(s.spatialReference=h.Z.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(this.cloneProperties())}cloneProperties(){return(0,p.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e?.[r];s.geometry=t?.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,o]}=e,i=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-s)/t)),(e=>Math.round((o-e)/r)));for(let e=0,t=i.length;e<t;e++)n?.(i[e].geometry)||(i.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,o],scale:[i,n]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const p=this._getHydrationFunction(e,(e=>e*i+s),(e=>o-e*n),a,l);for(const{geometry:e}of t)null!=e&&p&&p(e);return this.transform=null,this}_quantizePoints(e,t,r){let s,o;const i=[];for(let n=0,a=e.length;n<a;n++){const a=e[n];if(n>0){const e=t(a[0]),n=r(a[1]);e===s&&n===o||(i.push([e-s,n-o]),s=e,o=n)}else s=t(a[0]),o=r(a[1]),i.push([s,o])}return i.length>0?i:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,f.oU)(e)?e.rings:e.paths,o=[];for(let e=0,i=s.length;e<i;e++){const i=s[e],n=this._quantizePoints(i,t,r);n&&o.push(n)}return o.length>0?((0,f.oU)(e)?e.rings=o:e.paths=o,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s&&s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,s,o){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),s&&(e.z=s(e.z))}:"polyline"===e||"polygon"===e?e=>{const i=(0,f.oU)(e)?e.rings:e.paths;let n,a;for(let e=0,s=i.length;e<s;e++){const s=i[e];for(let e=0,o=s.length;e<o;e++){const o=s[e];e>0?(n+=o[0],a+=o[1]):(n=o[0],a=o[1]),o[0]=t(n),o[1]=r(a)}}if(s&&o)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2]),r[3]=o(r[3])}}else if(s)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}else if(o)for(let e=0,t=i.length;e<t;e++){const t=i[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),s&&null!=e.zmax&&null!=e.zmin&&(e.zmax=s(e.zmax),e.zmin=s(e.zmin)),o&&null!=e.mmax&&null!=e.mmin&&(e.mmax=o(e.mmax),e.mmin=o(e.mmin))}:"multipoint"===e?e=>{const i=e.points;let n,a;for(let e=0,s=i.length;e<s;e++){const s=i[e];e>0?(n+=s[0],a+=s[1]):(n=s[0],a=s[1]),s[0]=t(n),s[1]=r(a)}if(s&&o)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=s(t[2]),t[3]=o(t[3])}else if(s)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=s(t[2])}else if(o)for(let e=0,t=i.length;e<t;e++){const t=i[e];t[2]=o(t[2])}}:null}};(0,o._)([(0,u.Cb)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,o._)([(0,u.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,o._)([(0,u.Cb)({type:[n.Z],json:{write:!0}})],b.prototype,"features",void 0),(0,o._)([(0,d.r)("features")],b.prototype,"readFeatures",null),(0,o._)([(0,u.Cb)({type:[g.Z],json:{write:!0}})],b.prototype,"fields",void 0),(0,o._)([(0,u.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:m.read}}})],b.prototype,"geometryType",void 0),(0,o._)([(0,c.c)("geometryType")],b.prototype,"writeGeometryType",null),(0,o._)([(0,u.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,o._)([(0,u.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,o._)([(0,u.Cb)({types:i.qM,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,o._)([(0,d.r)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,o._)([(0,u.Cb)({type:h.Z,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,o._)([(0,c.c)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,o._)([(0,u.Cb)({json:{write:!0}})],b.prototype,"transform",void 0),b=s=(0,o._)([(0,y.j)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0;const v=b}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9379],{13598:(e,t,r)=>{function a(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}function n(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>i,a:()=>a,b:()=>s,c:()=>n});const i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:s,create:a,createView:n,fromValues:function(e,t,r,a,s,n,i,o,u,l,d,p,c,h,y,f){return[e,t,r,a,s,n,i,o,u,l,d,p,c,h,y,f]}},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>o,b:()=>i,c:()=>s,d:()=>d,e:()=>u,n:()=>p,s:()=>l,t:()=>n});var a=r(72220);function s(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,s=3,n=s){if(e.length/s!==Math.ceil(t.length/n))return a.c.error("source and destination buffers need to have the same number of elements"),e;const i=e.length/s,o=r[0],u=r[1],l=r[2],d=r[4],p=r[5],c=r[6],h=r[8],y=r[9],f=r[10],m=r[12],g=r[13],b=r[14];let w=0,F=0;for(let r=0;r<i;r++){const r=t[w],a=t[w+1],i=t[w+2];e[F]=o*r+d*a+h*i+m,e[F+1]=u*r+p*a+y*i+g,e[F+2]=l*r+c*a+f*i+b,w+=n,F+=s}return e}function i(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,s=3,n=s){if(e.length/s!==Math.ceil(t.length/n))return void a.c.error("source and destination buffers need to have the same number of elements");const i=e.length/s,o=r[0],u=r[1],l=r[2],d=r[3],p=r[4],c=r[5],h=r[6],y=r[7],f=r[8];let m=0,g=0;for(let r=0;r<i;r++){const r=t[m],a=t[m+1],i=t[m+2];e[g]=o*r+d*a+h*i,e[g+1]=u*r+p*a+y*i,e[g+2]=l*r+c*a+f*i,m+=n,g+=s}}function u(e,t,r){l(e.typedBuffer,t,r,e.typedBufferStride)}function l(e,t,r,a=3){const s=Math.min(e.length/a,t.count),n=t.typedBuffer,i=t.typedBufferStride;let o=0,u=0;for(let t=0;t<s;t++)e[u]=r*n[o],e[u+1]=r*n[o+1],e[u+2]=r*n[o+2],o+=i,u+=a}function d(e,t){p(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function p(e,t,r=3,a=r){const s=Math.min(e.length/r,t.length/a);let n=0,i=0;for(let o=0;o<s;o++){const s=t[n],o=t[n+1],u=t[n+2],l=s*s+o*o+u*u;if(l>0){const t=1/Math.sqrt(l);e[i]=t*s,e[i+1]=t*o,e[i+2]=t*u}n+=a,i+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:p,normalizeView:d,scale:l,scaleView:u,shiftRight:function(e,t,r){const a=Math.min(e.count,t.count),s=e.typedBuffer,n=e.typedBufferStride,i=t.typedBuffer,o=t.typedBufferStride;let u=0,l=0;for(let e=0;e<a;e++)s[l]=i[u]>>r,s[l+1]=i[u+1]>>r,s[l+2]=i[u+2]>>r,u+=o,l+=n},transformMat3:o,transformMat3View:i,transformMat4:n,transformMat4View:s},Symbol.toStringTag,{value:"Module"}))},85872:(e,t,r)=>{r.d(t,{Z:()=>c});var a=r(43697),s=r(2368),n=r(96674),i=r(5600),o=(r(75215),r(67676),r(80442),r(36030)),u=r(52011),l=r(65617),d=r(94139);let p=class extends((0,s.J)(n.wq)){constructor(e){super(e),this.type="georeferenced-relative",this.isRelative=!0,this.isGeoreferenced=!0,this.origin=(0,l.c)()}getOriginPoint(e){const[t,r,a]=this.origin;return new d.Z({x:t,y:r,z:a,spatialReference:e})}setOriginFromPoint({x:e,y:t,z:r}){this.origin=(0,l.f)(e,t,r??0)}};(0,a._)([(0,o.J)({georeferencedRelative:"georeferenced-relative"},{readOnly:!0})],p.prototype,"type",void 0),(0,a._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],p.prototype,"origin",void 0),p=(0,a._)([(0,u.j)("esri.geometry.support.MeshGeoreferencedRelativeVertexSpace")],p);const c=p},72220:(e,t,r)=>{r.d(t,{c:()=>a});const a=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},84470:(e,t,r)=>{r.d(t,{CP:()=>o,JG:()=>y,LL:()=>u,NZ:()=>l,fV:()=>f,vj:()=>g,yT:()=>w,zE:()=>b});var a=r(3172),s=r(67676),n=r(95330),i=r(2981);class o{constructor(e,t,r){this.assetName=e,this.assetMimeType=t,this.parts=r}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,s.fS)(this.parts,e.parts,((e,t)=>e.equals(t)))}isOnService(e){return this.parts.every((t=>t.isOnService(e)))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(1===t.length)return t[0].toBlob(e);const r=await Promise.all(t.map((t=>t.toBlob(e))));return(0,n.k_)(e),new Blob(r)}}class u{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await(0,a.Z)(this.partUrl,{responseType:"blob"});return(0,n.k_)(e),t}}function l(e){return function(e){return!!e&&(Array.isArray(e)?e.some(h):h(e))}(e?.source)}function d(e){return!!Array.isArray(e)&&e.every((e=>e instanceof o))}const p=/^(model\/gltf\+json)|(model\/gltf-binary)$/,c=/\.(gltf|glb)/i;function h(e){if(e instanceof File){const{type:t,name:r}=e;return p.test(t)||c.test(r)}return p.test(e.assetMimeType)||c.test(e.assetName)}function y(e,t){if(!e)return!1;const{source:r}=e;return function(e,t){if(Array.isArray(e)){const r=e;return r.length>0&&r.every((e=>m(e,t)))}return m(e,t)}(r,t)}function f(e,t){if(e===t)return!0;const{source:r}=e,{source:a}=t;if(r===a)return!0;if(d(r)&&d(a)){if(r.length!==a.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...r].sort(e),s=[...a].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(s[e]))return!1;return!0}return!1}function m(e,t){return e instanceof o&&e.isOnService(t)}function g(e,t){return e instanceof File?(0,i.dm)(e,t):(0,i.S0)(e.assetMimeType,t)??(0,i.Ow)(e.assetName,t)}function b(e){return Array.isArray(e)?e:[e]}function w(e){return!!e.original}},61159:(e,t,r)=>{r.d(t,{g:()=>a});const a={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},14720:(e,t,r)=>{r.d(t,{Ey:()=>F,applyEdits:()=>S,aw:()=>b,uploadAssets:()=>q});var a=r(38171),s=r(46791),n=r(20102),i=r(22974),o=r(92604),u=r(95330),l=r(17452),d=r(41123),p=r(16306),c=r(66361),h=r(69165),y=r(2981),f=r(84230);function m(e){return null!=e?.applyEdits}function g(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function b(e){return e.every(g)}function w(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function F(e){return e.every(w)}async function S(e,t,r,a={}){let l;const p="gdbVersion"in e?e.gdbVersion:null,h=a.gdbVersion??p;if((0,c.lQ)(e)&&e.url)l=(0,c.jF)(e.url,e.layerId,h,"original-and-current-features"===a.returnServiceEditsOption);else{l=(0,u.hh)(),l.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:l.promise};e.emit("apply-edits",t)}try{const{results:u,edits:p}=await async function(e,t,r,a){if(await e.load(),!m(t))throw new n.Z(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!(0,f.ln)(e))throw new n.Z(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:u}=await async function(e,t,r){const a=(0,f.S1)(e),i=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),u=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),l=null!=e.infoFor3D;if(function(e,t,r,a,s,i){if(!e||!a&&!s)throw new n.Z(`${i}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new n.Z(`${i}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new n.Z(`${i}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&s)throw new n.Z(`${i}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}(t,a,r,!!i,!!u,`${e.type}-layer`),!a.data.isVersioned&&r?.gdbVersion)throw new n.Z(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!a.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new n.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const p={...r};if(null!=p.rollbackOnFailureEnabled||a.editing.supportsRollbackOnFailure||(p.rollbackOnFailureEnabled=!0),p.rollbackOnFailureEnabled||"original-and-current-features"!==p.returnServiceEditsOption||(!1===p.rollbackOnFailureEnabled&&o.Z.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwrritten and set to true."),p.rollbackOnFailureEnabled=!0),!a.editing.supportsReturnServiceEditsInSourceSpatialReference&&p.returnServiceEditsInSourceSR)throw new n.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(p.returnServiceEditsInSourceSR&&"original-and-current-features"!==p.returnServiceEditsOption)throw new n.Z(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const c=function(e,t,r){const a=function(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&s.Z.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}(e);if(a.addFeatures?.length&&!t.operations.supportsAdd)throw new n.Z(`${r}:unsupported-operation`,"Layer does not support adding features.");if(a.updateFeatures?.length&&!t.operations.supportsUpdate)throw new n.Z(`${r}:unsupported-operation`,"Layer does not support updating features.");if(a.deleteFeatures?.length&&!t.operations.supportsDelete)throw new n.Z(`${r}:unsupported-operation`,"Layer does not support deleting features.");return a.addFeatures=a.addFeatures.map(E),a.updateFeatures=a.updateFeatures.map(E),a.addAssetFeatures=[],a}(t,a,`${e.type}-layer`),h=r?.globalIdUsed||l,m=e.fields.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(h){const{globalIdField:t}=e;if(null==t)throw new n.Z(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");c.addFeatures.forEach((e=>function(e,t){const{attributes:r}=e;null==r[t]&&(r[t]=(0,d.z)())}(e,t)))}return c.addFeatures.forEach((t=>function(e,t,r,a){A(e,t,r,a),v(e,t)}(t,e,h,m))),c.updateFeatures.forEach((t=>function(e,t,r,a){A(e,t,r,a),v(e,t);const s=(0,f.S1)(t);if("geometry"in e&&null!=e.geometry&&!s?.editing.supportsGeometryUpdate)throw new n.Z(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}(t,e,h,m))),c.deleteFeatures.forEach((t=>function(e,t,r,a){A(e,t,r,a)}(t,e,h,m))),c.addAttachments.forEach((t=>R(t,e))),c.updateAttachments.forEach((t=>R(t,e))),l&&await async function(e,t){if(null==t.infoFor3D)return;const{infoFor3D:r}=t,a=(0,y.S0)("model/gltf-binary",r.supportedFormats)??(0,y.Ow)("glb",r.supportedFormats);if(!a||!r.editFormats.includes(a))throw new n.Z(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:s}=e;for(const t of e.addFeatures??[])O(t)&&s.push(t);for(const t of e.updateFeatures??[])O(t)&&s.push(t)}(c,e),{edits:await I(c),options:p}}(e,r,a);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,u)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}(e,t,r,a),c=e=>e.filter((e=>!e.error)).map(i.d9),h={edits:p,addedFeatures:c(u.addFeatureResults),updatedFeatures:c(u.updateFeatureResults),deletedFeatures:c(u.deleteFeatureResults),addedAttachments:c(u.addAttachmentResults),updatedAttachments:c(u.updateAttachmentResults),deletedAttachments:c(u.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:u.editMoment?new Date(u.editMoment):null,globalIdToObjectId:a.globalIdToObjectId};return u.editedFeatureResults?.length&&(h.editedFeatures=u.editedFeatureResults),l.resolve(h),u}catch(e){throw l.reject(e),e}}function A(e,t,r,a){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new n.Z(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(a.length&&"attributes"in e)for(const r of a){const a=e.attributes[r.name];if(void 0!==a&&!(0,h.d2)(r,a))throw new n.Z(`${t.type}-layer:invalid-parameter`,`Big-integer field '${r.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new n.Z(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new n.Z(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function v(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D){const{geometry:r}=e;if(r.vertexSpace.isGeoreferenced)throw new n.Z(`${t.type}-layer:georeferenced-mesh-unsupported`,"Uploading georeferenced meshes to a layer is not supported.")}}function R(e,t){const{feature:r,attachment:a}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!a.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!a.data&&!a.uploadId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(a.data instanceof File&&a.data.name||a.name))throw new n.Z(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&a.uploadId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof a.data){const e=(0,l.sJ)(a.data);if(e&&!e.isBase64)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function I(e){const t=e.addFeatures??[],r=e.updateFeatures??[],a=t.concat(r).map((e=>e.geometry)),s=await(0,p.aX)(a),n=t.length,i=r.length;return s.slice(0,n).forEach(((e,r)=>t[r].geometry=e)),s.slice(n,n+i).forEach(((e,t)=>r[t].geometry=e)),e}function E(e){const t=new a.Z;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}function O(e){return"mesh"===e?.geometry?.type}function q(e,t,r,a){if(!m(t))throw new n.Z(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new n.Z(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,a)}},49379:(e,t,r)=>{r.r(t),r.d(t,{default:()=>K});var a=r(43697),s=(r(66577),r(40330)),n=r(3172),i=r(92835),o=r(67676),u=r(20102),l=r(80442),d=r(35454),p=r(83379),c=r(92604),h=r(78286),y=r(95330),f=r(17452),m=r(41123),g=r(5600),b=(r(75215),r(52011)),w=r(6570),F=r(52138),S=r(13598),A=r(85872),v=r(20773);function R(e){const{vertexSpace:t}=e;if(t.isRelative)return e.clone();const{anchor:r}=e,a=r.clone(),s=(0,F.d)(I,[-a.x,-a.y,-a.z]),n=new A.Z({origin:[a.x,a.y,a.z]}),i=e.cloneWithVertexSpace(n),{position:o}=i.vertexAttributes;return i.vertexAttributes.position=(0,v.t)(new Float64Array(o.length),o,s),i.vertexAttributesChanged(),i}const I=(0,S.a)();var E=r(84470),O=r(38171),q=r(67900),Z=r(73615),_=r(33955),x=r(14720);async function T(e,t,r){const{geometry:a}=t,s={...t.attributes};if(null!=r&&"mesh"===a?.type){const{transformFieldRoles:t}=r,{origin:n,spatialReference:i,transform:o}=a,u=e.spatialReference;await(0,Z.initializeProjection)(i,u);const l=(0,Z.project)(n,u);if(s[t.originX]=l.x,s[t.originY]=l.y,s[t.originZ]=l.z??0,null!=o){const{translation:e,scale:r,rotation:n}=o,{vertexSpace:l}=a,d=l.isGeoreferenced?1:(0,q.r6)(i)/(0,q.r6)(u);s[t.translationX]=e[0]*d,s[t.translationY]=e[2]*d,s[t.translationZ]=-e[1]*d,s[t.scaleX]=r[0],s[t.scaleY]=r[2],s[t.scaleZ]=r[1],s[t.rotationX]=n[0],s[t.rotationY]=n[2],s[t.rotationZ]=-n[1],s[t.rotationDeg]=n[3]}return{attributes:s}}return null==a?{attributes:s}:"mesh"===a.type||"extent"===a.type?null:{geometry:a.toJSON(),attributes:s}}async function M(e,t){const r=await Promise.all((t.addAttachments??[]).map((t=>$(e,t)))),a=await Promise.all((t.updateAttachments??[]).map((t=>$(e,t)))),s=t.deleteAttachments??[];return r.length||a.length||s.length?{adds:r,updates:a,deletes:[...s]}:null}async function $(e,t){const{feature:r,attachment:a}=t,{globalId:s,name:n,contentType:i,data:o,uploadId:u}=a,l={globalId:s};if(r&&("attributes"in r?l.parentGlobalId=r.attributes?.[e.globalIdField]:r.globalId&&(l.parentGlobalId=r.globalId)),u)l.uploadId=u;else if(o){const e=await(0,f.IR)(o);e&&(l.contentType=e.mediaType,l.data=e.data),o instanceof File&&(l.name=o.name)}return n&&(l.name=n),i&&(l.contentType=i),l}function C(e){const t=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new u.Z("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}function U(e,t){return new O.Z({attributes:e.attributes,geometry:(0,_.im)({...e.geometry,spatialReference:t})})}function N(e,t){return{adds:e?.adds?.map((e=>U(e,t)))||[],updates:e?.updates?.map((e=>({original:U(e[0],t),current:U(e[1],t)})))||[],deletes:e?.deletes?.map((e=>U(e,t)))||[],spatialReference:t}}var B=r(25278),k=r(49735),j=r(66677),D=r(45574),L=r(2981),P=r(4967),J=r(59431),Q=r(14165),G=r(18596),V=r(82971);const z=new d.X({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),H=new Set(["Feature Layer","Oriented Imagery Layer","Table"]),W=new d.X({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let X=class extends p.Z{constructor(){super(...arguments),this.type="feature-layer",this.refresh=(0,y.Ds)((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then((()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e))).then((()=>this._ensureLatestMetadata(e)));return this.addResolvingPromise(r),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:r,infoFor3D:a,gdbVersion:s,spatialReference:n,fieldsIndex:i}=this.layer,o=(0,l.Z)("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==a,u=e?.operations?.supportsQueryAttachments??!1;return new k.Z({url:t.path,pbfSupported:o,fieldsIndex:i,infoFor3D:a,dynamicDataSource:r,gdbVersion:s,sourceSpatialReference:n,queryAttachmentsSupported:u})}async addAttachment(e,t){await this.load();const{layer:r}=this;await(0,D.nU)(r,"editing");const a=e.attributes[r.objectIdField],s=r.parsedUrl.path+"/"+a+"/addAttachment",i=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,i.query);try{return C((await(0,n.Z)(s,{body:o})).data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(a,e)}}async updateAttachment(e,t,r){await this.load();const{layer:a}=this;await(0,D.nU)(a,"editing");const s=e.attributes[a.objectIdField],i=a.parsedUrl.path+"/"+s+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(r,o.query);try{return C((await(0,n.Z)(i,{body:u})).data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(s,e)}}async applyEdits(e,t){await this.load();const{layer:r}=this;await(0,D.nU)(r,"editing");const a=r.infoFor3D,i=null!=a,u=i||(t?.globalIdUsed??!1),l=i?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,d=e.addFeatures?.map((e=>T(this.layer,e,a)))??[],p=(await Promise.all(d)).filter(o.pC),c=e.updateFeatures?.map((e=>T(this.layer,e,a)))??[],h=(await Promise.all(c)).filter(o.pC),y=function(e,t,r){if(!t||0===t.length)return[];if(r&&(0,x.Ey)(t))return t.map((e=>e.globalId));if((0,x.aw)(t))return t.map((e=>e.objectId));const a=r?e.globalIdField:e.objectIdField;return a?t.map((e=>e.getAttribute(a))):[]}(this.layer,e.deleteFeatures,u);(0,J.P)(p,h,r.spatialReference);const f=await M(this.layer,e),m=r.capabilities.editing.supportsAsyncApplyEdits&&i,g=t?.gdbVersion||r.gdbVersion,b={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,async:m};await(0,G.Px)(this.layer.url,g,!0);const w=(0,G.JV)(this.layer.url,g||null);t?.returnServiceEditsOption?(b.edits=JSON.stringify([{id:r.layerId,adds:p,updates:h,deletes:y,attachments:f,assetMaps:l}]),b.returnServiceEditsOption=z.toJSON(t?.returnServiceEditsOption),b.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(b.adds=p.length?JSON.stringify(p):null,b.updates=h.length?JSON.stringify(h):null,b.deletes=y.length?u?JSON.stringify(y):y.join(","):null,b.attachments=f&&JSON.stringify(f),b.assetMaps=null!=l?JSON.stringify(l):void 0);const F=this._getLayerRequestOptions({method:"post",query:b});w&&(F.authMode="immediate",F.query.returnEditMoment=!0,F.query.sessionId=G.U8);const S=t?.returnServiceEditsOption?r.url:r.parsedUrl.path;let A;try{A=m?await this._asyncApplyEdits(S+"/applyEdits",F):await(0,n.Z)(S+"/applyEdits",F)}catch(e){if(!function(e){const t=e.details.raw,r=+t.code,a=+t.extendedCode;return 500===r&&(-2147217144===a||-2147467261===a)}(e))throw e;F.authMode="immediate",A=m?await this._asyncApplyEdits(S+"/applyEdits",F):await(0,n.Z)(S+"/applyEdits",F)}if(!r.capabilities.operations?.supportsEditing&&r.effectiveCapabilities?.operations?.supportsEditing){const e=s.id?.findCredential(r.url);await(e?.refreshToken())}return this._createEditsResult(A)}async deleteAttachments(e,t){await this.load();const{layer:r}=this;await(0,D.nU)(r,"editing");const a=e.attributes[r.objectIdField],s=r.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await(0,n.Z)(s,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(C)}catch(e){throw this._createAttachmentErrorResult(a,e)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:a}=this.layer,{data:s}=await(0,n.Z)(`${a}/${r}`,t),{id:o,extent:u,fullExtent:l,timeExtent:d}=s,p=u||l;return{id:o,fullExtent:p&&w.Z.fromJSON(p),timeExtent:d&&i.Z.fromJSON({start:d[0],end:d[1]})}}))}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});return e.outStatistics?.length&&r.features.length&&r.features.forEach((t=>{const r=t.attributes;e.outStatistics?.forEach((({outStatisticFieldName:e})=>{if(e){const t=e.toLowerCase();t&&t in r&&e!==t&&(r[e]=r[t],delete r[t])}}))})),r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!(0,j.M8)(this.layer.url))return"unavailable";const e=(0,f.v_)(this.layer.url,"status"),t=await(0,n.Z)(e,{query:{f:"json"}});return W.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:a}=await r.e(2046).then(r.bind(r,2046));return a(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}async _asyncApplyEdits(e,t){const r=(await(0,n.Z)(e,t)).data.statusUrl;for(;;){const e=(await(0,n.Z)(r,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return(0,n.Z)(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new u.Z("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new u.Z("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await(0,y.e4)(Y)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const r={};(0,l.Z)("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());const{data:a}=await(0,n.Z)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=a}this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const r=e.type;if(!H.has(r))throw new u.Z("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=(0,B.bU)(e.geometryType).renderer;(0,h.RB)("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:r}=await(0,n.Z)(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(e){(0,y.r9)(e)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;const r=await this._filterRedundantAssetMaps(t);if(!t?.length)return null;const a=new Array,s=new Map;for(const e of r){const{geometry:t}=e,{vertexSpace:r}=t;if(r.isRelative)a.push(t);else{const r=R(t);s.set(r,t),e.geometry=r,a.push(r)}}await this.uploadAssets(a);for(const[e,t]of s)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(r),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,a=this.layer.parsedUrl;for(const s of e){const e=s.geometry,{metadata:n}=e,i=n.getExternalSourcesOnService(a),o=s.getAttribute(r);if(0===i.length){c.Z.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:u}=i.find(E.yT)??i[0],{vertexSpace:l}=e,d=l.isGeoreferenced?["PROJECT_VERTICES"]:[];for(const e of u)1===e.parts.length?t.push({globalId:(0,m.z)(),parentGlobalId:o,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:d}):c.Z.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,a=[];let s=null;if(Array.isArray(t))for(const e of t)a.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===r&&(s={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else s=t;const n=function(e){const t=e?.assetMaps;if(t){for(const e of t.addResults)e.success||c.Z.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`);for(const e of t.updateResults)e.success||c.Z.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${e.globalId}.`)}const r=e?.attachments,a={addFeatureResults:e?.addResults?.map(C)??[],updateFeatureResults:e?.updateResults?.map(C)??[],deleteFeatureResults:e?.deleteResults?.map(C)??[],addAttachmentResults:r?.addResults?r.addResults.map(C):[],updateAttachmentResults:r?.updateResults?r.updateResults.map(C):[],deleteAttachmentResults:r?.deleteResults?r.deleteResults.map(C):[]};return e?.editMoment&&(a.editMoment=e.editMoment),a}(s);if(a.length>0){n.editedFeatureResults=[];for(const e of a){const{editedFeatures:t}=e,r=t?.spatialReference?new V.Z(t.spatialReference):null;n.editedFeatureResults.push({layerId:e.id,editedFeatures:N(t,r)})}}return n}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,a=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new u.Z("feature-layer-source:attachment-failure",r,{code:a})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const e in t){const a=t[e];null!=a&&(r.set?r.set(e,a):r.append(e,a))}return r}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:r,dynamicDataSource:a}=this.layer;return{...e,query:{gdbVersion:r,layer:a?JSON.stringify({source:a}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _filterRedundantAssetMaps(e){const{layer:t}=this,{globalIdField:r,infoFor3D:a,parsedUrl:s}=t;if(null==a||null==r)return e;const n=(0,L.$6)(a);if(null==n)return e;const i=(0,f.v_)(s.path,`../${n.id}`),u=new Array,l=new Array;for(const t of e)t.geometry.metadata.getExternalSourcesOnService(s).length>0?l.push(t):u.push(t);const d=l.map((e=>e.getAttribute(r))).filter(o.pC);if(0===d.length)return e;const{assetMapFieldRoles:{parentGlobalId:p,assetHash:c}}=a,h=new Q.Z;h.where=`${p} IN (${d.map((e=>`'${e}'`))})`,h.outFields=[c,p],h.returnGeometry=!1;const y=await(0,P.e)(i,h),{features:m}=y;return 0===m.length?e:[...u,...l.filter((e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:a}=e.geometry,n=m.filter((e=>e.getAttribute(p)===t));if(0===n.length)return!0;const i=n.map((e=>e.getAttribute(c)));return a.getExternalSourcesOnService(s).flatMap((({source:e})=>e.flatMap((e=>e.parts.map((e=>e.partHash)))))).some((e=>i.every((t=>e!==t))))}))]}};(0,a._)([(0,g.Cb)()],X.prototype,"type",void 0),(0,a._)([(0,g.Cb)({constructOnly:!0})],X.prototype,"layer",void 0),(0,a._)([(0,g.Cb)({readOnly:!0})],X.prototype,"queryTask",null),X=(0,a._)([(0,b.j)("esri.layers.graphics.sources.FeatureLayerSource")],X);const Y=1e3,K=X},25278:(e,t,r)=>{r.d(t,{Dm:()=>d,Hq:()=>p,MS:()=>c,bU:()=>o});var a=r(80442),s=r(22974),n=r(61159),i=r(58333);function o(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?i.I4:"esriGeometryPolyline"===e?i.ET:i.lF}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function d(e,t){if((0,a.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this.${t} = null;`;for(const t in e)r+=`this${u.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const a=new Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new a}catch(r){return()=>({[t]:null,...e})}}function p(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,s.d9)(e)}}]}function c(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:n.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}}}]);