@arcgis/core 4.28.8 → 4.28.10

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/README.md +14 -108
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/332f807c109f3c566316.js +1 -0
  4. package/assets/esri/core/workers/chunks/3b44696ed6608cfdef34.js +1 -0
  5. package/assets/esri/core/workers/chunks/5b416d7ef5f3f57b052c.js +1 -0
  6. package/assets/esri/core/workers/chunks/7e79ffd645f94ebf07a7.js +1 -0
  7. package/assets/esri/core/workers/chunks/{df7267892b6e0493e1d7.js → 95ce288362649909ffe6.js} +1 -1
  8. package/assets/esri/core/workers/chunks/a48cb80b8f10522ccba4.js +1 -0
  9. package/assets/esri/core/workers/chunks/aa3bb965d4495ee3dfe0.js +1 -0
  10. package/assets/esri/core/workers/chunks/afc396fd3afbebd39a93.js +1 -0
  11. package/assets/esri/core/workers/chunks/{9979ff59a144fe1df80b.js → b2eb4308afc34e3e0acb.js} +1 -1
  12. package/assets/esri/core/workers/chunks/b4bbace5b409b804a52f.js +1 -0
  13. package/assets/esri/core/workers/chunks/b5b04f8380197abb50ab.js +1 -0
  14. package/assets/esri/core/workers/chunks/{c3b8b40115be5a2b960e.js → c6d1a6db8cfa0a7e3bd2.js} +1 -1
  15. package/assets/esri/core/workers/chunks/d5e6676cd2de77527c92.js +1 -0
  16. package/assets/esri/core/workers/chunks/d8482a5aa176426352bf.js +1 -0
  17. package/assets/esri/core/workers/chunks/ead02c933d1af20cbaa0.js +1 -0
  18. package/assets/esri/core/workers/chunks/f1152b991c33d8c94219.js +1 -0
  19. package/assets/esri/core/workers/chunks/faa2da66e9934f7fee04.js +1 -0
  20. package/core/uuid.js +1 -1
  21. package/interfaces.d.ts +13 -7
  22. package/kernel.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
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[6882,9379],{13598:(e,t,r)=>{function s(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(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:()=>s,b:()=>a,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:a,create:s,createView:n,fromValues:function(e,t,r,s,a,n,i,o,l,u,d,p,c,y,h,f){return[e,t,r,s,a,n,i,o,l,u,d,p,c,y,h,f]}},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>o,b:()=>i,c:()=>a,d:()=>d,e:()=>l,n:()=>p,s:()=>u,t:()=>n});var s=r(72220);function a(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,a=3,n=a){if(e.length/a!==Math.ceil(t.length/n))return s.c.error("source and destination buffers need to have the same number of elements"),e;const i=e.length/a,o=r[0],l=r[1],u=r[2],d=r[4],p=r[5],c=r[6],y=r[8],h=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],s=t[w+1],i=t[w+2];e[F]=o*r+d*s+y*i+m,e[F+1]=l*r+p*s+h*i+g,e[F+2]=u*r+c*s+f*i+b,w+=n,F+=a}return e}function i(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,a=3,n=a){if(e.length/a!==Math.ceil(t.length/n))return void s.c.error("source and destination buffers need to have the same number of elements");const i=e.length/a,o=r[0],l=r[1],u=r[2],d=r[3],p=r[4],c=r[5],y=r[6],h=r[7],f=r[8];let m=0,g=0;for(let r=0;r<i;r++){const r=t[m],s=t[m+1],i=t[m+2];e[g]=o*r+d*s+y*i,e[g+1]=l*r+p*s+h*i,e[g+2]=u*r+c*s+f*i,m+=n,g+=a}}function l(e,t,r){u(e.typedBuffer,t,r,e.typedBufferStride)}function u(e,t,r,s=3){const a=Math.min(e.length/s,t.count),n=t.typedBuffer,i=t.typedBufferStride;let o=0,l=0;for(let t=0;t<a;t++)e[l]=r*n[o],e[l+1]=r*n[o+1],e[l+2]=r*n[o+2],o+=i,l+=s}function d(e,t){p(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function p(e,t,r=3,s=r){const a=Math.min(e.length/r,t.length/s);let n=0,i=0;for(let o=0;o<a;o++){const a=t[n],o=t[n+1],l=t[n+2],u=a*a+o*o+l*l;if(u>0){const t=1/Math.sqrt(u);e[i]=t*a,e[i+1]=t*o,e[i+2]=t*l}n+=s,i+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:p,normalizeView:d,scale:u,scaleView:l,shiftRight:function(e,t,r){const s=Math.min(e.count,t.count),a=e.typedBuffer,n=e.typedBufferStride,i=t.typedBuffer,o=t.typedBufferStride;let l=0,u=0;for(let e=0;e<s;e++)a[u]=i[l]>>r,a[u+1]=i[l+1]>>r,a[u+2]=i[l+2]>>r,l+=o,u+=n},transformMat3:o,transformMat3View:i,transformMat4:n,transformMat4View:a},Symbol.toStringTag,{value:"Module"}))},85872:(e,t,r)=>{r.d(t,{Z:()=>c});var s=r(43697),a=r(2368),n=r(96674),i=r(5600),o=(r(75215),r(67676),r(80442),r(36030)),l=r(52011),u=r(65617),d=r(94139);let p=class extends((0,a.J)(n.wq)){constructor(e){super(e),this.type="georeferenced-relative",this.isRelative=!0,this.isGeoreferenced=!0,this.origin=(0,u.c)()}getOriginPoint(e){const[t,r,s]=this.origin;return new d.Z({x:t,y:r,z:s,spatialReference:e})}setOriginFromPoint({x:e,y:t,z:r}){this.origin=(0,u.f)(e,t,r??0)}};(0,s._)([(0,o.J)({georeferencedRelative:"georeferenced-relative"},{readOnly:!0})],p.prototype,"type",void 0),(0,s._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],p.prototype,"origin",void 0),p=(0,s._)([(0,l.j)("esri.geometry.support.MeshGeoreferencedRelativeVertexSpace")],p);const c=p},72220:(e,t,r)=>{r.d(t,{c:()=>s});const s=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},84470:(e,t,r)=>{r.d(t,{CP:()=>o,JG:()=>h,LL:()=>l,NZ:()=>u,fV:()=>f,vj:()=>g,yT:()=>w,zE:()=>b});var s=r(3172),a=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,a.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 l{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,s.Z)(this.partUrl,{responseType:"blob"});return(0,n.k_)(e),t}}function u(e){return function(e){return!!e&&(Array.isArray(e)?e.some(y):y(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 y(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 h(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:s}=t;if(r===s)return!0;if(d(r)&&d(s)){if(r.length!==s.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...r].sort(e),a=[...s].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(a[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:()=>s});const s={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 s=r(38171),a=r(46791),n=r(20102),i=r(22974),o=r(92604),l=r(95330),u=r(17452),d=r(41123),p=r(16306),c=r(66361),y=r(69165),h=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,s={}){let u;const p="gdbVersion"in e?e.gdbVersion:null,y=s.gdbVersion??p;if((0,c.lQ)(e)&&e.url)u=(0,c.jF)(e.url,e.layerId,y,"original-and-current-features"===s.returnServiceEditsOption);else{u=(0,l.hh)(),u.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:u.promise};e.emit("apply-edits",t)}try{const{results:l,edits:p}=await async function(e,t,r,s){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:l}=await async function(e,t,r){const s=(0,f.S1)(e),i=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),l=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),u=null!=e.infoFor3D;if(function(e,t,r,s,a,i){if(!e||!s&&!a)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&&a)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&&a)throw new n.Z(`${i}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}(t,s,r,!!i,!!l,`${e.type}-layer`),!s.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(!s.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||s.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),!s.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 s=function(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&a.Z.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new n.Z(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new n.Z(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new n.Z(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(O),s.updateFeatures=s.updateFeatures.map(O),s.addAssetFeatures=[],s}(t,s,`${e.type}-layer`),y=r?.globalIdUsed||u,m=e.fields.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(y){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.zS)())}(e,t)))}return c.addFeatures.forEach((t=>function(e,t,r,s){R(e,t,r,s),v(e,t)}(t,e,y,m))),c.updateFeatures.forEach((t=>function(e,t,r,s){R(e,t,r,s),v(e,t);const a=(0,f.S1)(t);if("geometry"in e&&null!=e.geometry&&!a?.editing.supportsGeometryUpdate)throw new n.Z(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}(t,e,y,m))),c.deleteFeatures.forEach((t=>function(e,t,r,s){R(e,t,r,s)}(t,e,y,m))),c.addAttachments.forEach((t=>A(t,e))),c.updateAttachments.forEach((t=>A(t,e))),u&&await async function(e,t){if(null==t.infoFor3D)return;const{infoFor3D:r}=t,s=(0,h.S0)("model/gltf-binary",r.supportedFormats)??(0,h.Ow)("glb",r.supportedFormats);if(!s||!r.editFormats.includes(s))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:a}=e;for(const t of e.addFeatures??[])E(t)&&a.push(t);for(const t of e.updateFeatures??[])E(t)&&a.push(t)}(c,e),{edits:await I(c),options:p}}(e,r,s);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,l)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}(e,t,r,s),c=e=>e.filter((e=>!e.error)).map(i.d9),y={edits:p,addedFeatures:c(l.addFeatureResults),updatedFeatures:c(l.updateFeatureResults),deletedFeatures:c(l.deleteFeatureResults),addedAttachments:c(l.addAttachmentResults),updatedAttachments:c(l.updateAttachmentResults),deletedAttachments:c(l.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:l.editMoment?new Date(l.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return l.editedFeatureResults?.length&&(y.editedFeatures=l.editedFeatureResults),u.resolve(y),l}catch(e){throw u.reject(e),e}}function R(e,t,r,s){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(s.length&&"attributes"in e)for(const r of s){const s=e.attributes[r.name];if(void 0!==s&&!(0,y.d2)(r,s))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 A(e,t){const{feature:r,attachment:s}=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(!s.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&s.data.name||s.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&&s.uploadId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=(0,u.sJ)(s.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??[],s=t.concat(r).map((e=>e.geometry)),a=await(0,p.aX)(s),n=t.length,i=r.length;return a.slice(0,n).forEach(((e,r)=>t[r].geometry=e)),a.slice(n,n+i).forEach(((e,t)=>r[t].geometry=e)),e}function O(e){const t=new s.Z;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}function E(e){return"mesh"===e?.geometry?.type}function q(e,t,r,s){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,s)}},49379:(e,t,r)=>{r.r(t),r.d(t,{default:()=>K});var s=r(43697),a=(r(66577),r(40330)),n=r(3172),i=r(92835),o=r(67676),l=r(20102),u=r(80442),d=r(35454),p=r(83379),c=r(92604),y=r(78286),h=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),R=r(85872),v=r(20773);function A(e){const{vertexSpace:t}=e;if(t.isRelative)return e.clone();const{anchor:r}=e,s=r.clone(),a=(0,F.d)(I,[-s.x,-s.y,-s.z]),n=new R.Z({origin:[s.x,s.y,s.z]}),i=e.cloneWithVertexSpace(n),{position:o}=i.vertexAttributes;return i.vertexAttributes.position=(0,v.t)(new Float64Array(o.length),o,a),i.vertexAttributesChanged(),i}const I=(0,S.a)();var O=r(84470),E=r(38171),q=r(67900),x=r(73615),_=r(33955),Z=r(14720);async function T(e,t,r){const{geometry:s}=t,a={...t.attributes};if(null!=r&&"mesh"===s?.type){const{transformFieldRoles:t}=r,{origin:n,spatialReference:i,transform:o}=s,l=e.spatialReference;await(0,x.initializeProjection)(i,l);const u=(0,x.project)(n,l);if(a[t.originX]=u.x,a[t.originY]=u.y,a[t.originZ]=u.z??0,null!=o){const{translation:e,scale:r,rotation:n}=o,{vertexSpace:u}=s,d=u.isGeoreferenced?1:(0,q.r6)(i)/(0,q.r6)(l);a[t.translationX]=e[0]*d,a[t.translationY]=e[2]*d,a[t.translationZ]=-e[1]*d,a[t.scaleX]=r[0],a[t.scaleY]=r[2],a[t.scaleZ]=r[1],a[t.rotationX]=n[0],a[t.rotationY]=n[2],a[t.rotationZ]=-n[1],a[t.rotationDeg]=n[3]}return{attributes:a}}return null==s?{attributes:a}:"mesh"===s.type||"extent"===s.type?null:{geometry:s.toJSON(),attributes:a}}async function M(e,t){const r=await Promise.all((t.addAttachments??[]).map((t=>C(e,t)))),s=await Promise.all((t.updateAttachments??[]).map((t=>C(e,t)))),a=t.deleteAttachments??[];return r.length||s.length||a.length?{adds:r,updates:s,deletes:[...a]}:null}async function C(e,t){const{feature:r,attachment:s}=t,{globalId:a,name:n,contentType:i,data:o,uploadId:l}=s,u={globalId:a};if(r&&("attributes"in r?u.parentGlobalId=r.attributes?.[e.globalIdField]:r.globalId&&(u.parentGlobalId=r.globalId)),l)u.uploadId=l;else if(o){const e=await(0,f.IR)(o);e&&(u.contentType=e.mediaType,u.data=e.data),o instanceof File&&(u.name=o.name)}return n&&(u.name=n),i&&(u.contentType=i),u}function N(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 l.Z("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}function $(e,t){return new E.Z({attributes:e.attributes,geometry:(0,_.im)({...e.geometry,spatialReference:t})})}function U(e,t){return{adds:e?.adds?.map((e=>$(e,t)))||[],updates:e?.updates?.map((e=>({original:$(e[0],t),current:$(e[1],t)})))||[],deletes:e?.deletes?.map((e=>$(e,t)))||[],spatialReference:t}}var j=r(25278),B=r(49735),P=r(66677),k=r(45574),G=r(2981),J=r(4967),z=r(59431),L=r(14165),D=r(18596),Q=r(82971);const V=new d.X({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),H=new Set(["Feature Layer","Oriented Imagery Layer","Table"]),X=new d.X({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let W=class extends p.Z{constructor(){super(...arguments),this.type="feature-layer",this.refresh=(0,h.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:s,gdbVersion:a,spatialReference:n,fieldsIndex:i}=this.layer,o=(0,u.Z)("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==s,l=e?.operations?.supportsQueryAttachments??!1;return new B.Z({url:t.path,pbfSupported:o,fieldsIndex:i,infoFor3D:s,dynamicDataSource:r,gdbVersion:a,sourceSpatialReference:n,queryAttachmentsSupported:l})}async addAttachment(e,t){await this.load();const{layer:r}=this;await(0,k.nU)(r,"editing");const s=e.attributes[r.objectIdField],a=r.parsedUrl.path+"/"+s+"/addAttachment",i=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,i.query);try{return N((await(0,n.Z)(a,{body:o})).data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(s,e)}}async updateAttachment(e,t,r){await this.load();const{layer:s}=this;await(0,k.nU)(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),l=this._getFormDataForAttachment(r,o.query);try{return N((await(0,n.Z)(i,{body:l})).data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(a,e)}}async applyEdits(e,t){await this.load();const{layer:r}=this;await(0,k.nU)(r,"editing");const s=r.infoFor3D,i=null!=s,l=i||(t?.globalIdUsed??!1),u=i?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,d=e.addFeatures?.map((e=>T(this.layer,e,s)))??[],p=(await Promise.all(d)).filter(o.pC),c=e.updateFeatures?.map((e=>T(this.layer,e,s)))??[],y=(await Promise.all(c)).filter(o.pC),h=function(e,t,r){if(!t||0===t.length)return[];if(r&&(0,Z.Ey)(t))return t.map((e=>e.globalId));if((0,Z.aw)(t))return t.map((e=>e.objectId));const s=r?e.globalIdField:e.objectIdField;return s?t.map((e=>e.getAttribute(s))):[]}(this.layer,e.deleteFeatures,l);(0,z.P)(p,y,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:l,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,async:m};await(0,D.Px)(this.layer.url,g,!0);const w=(0,D.JV)(this.layer.url,g||null);t?.returnServiceEditsOption?(b.edits=JSON.stringify([{id:r.layerId,adds:p,updates:y,deletes:h,attachments:f,assetMaps:u}]),b.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),b.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(b.adds=p.length?JSON.stringify(p):null,b.updates=y.length?JSON.stringify(y):null,b.deletes=h.length?l?JSON.stringify(h):h.join(","):null,b.attachments=f&&JSON.stringify(f),b.assetMaps=null!=u?JSON.stringify(u):void 0);const F=this._getLayerRequestOptions({method:"post",query:b});w&&(F.authMode="immediate",F.query.returnEditMoment=!0,F.query.sessionId=D.U8);const S=t?.returnServiceEditsOption?r.url:r.parsedUrl.path;let R;try{R=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,s=+t.extendedCode;return 500===r&&(-2147217144===s||-2147467261===s)}(e))throw e;F.authMode="immediate",R=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=a.id?.findCredential(r.url);await(e?.refreshToken())}return this._createEditsResult(R)}async deleteAttachments(e,t){await this.load();const{layer:r}=this;await(0,k.nU)(r,"editing");const s=e.attributes[r.objectIdField],a=r.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await(0,n.Z)(a,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(N)}catch(e){throw this._createAttachmentErrorResult(s,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:s}=this.layer,{data:a}=await(0,n.Z)(`${s}/${r}`,t),{id:o,extent:l,fullExtent:u,timeExtent:d}=a,p=l||u;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,P.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 X.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:s}=await r.e(2046).then(r.bind(r,2046));return s(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 l.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 l.Z("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await(0,h.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,u.Z)("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());const{data:s}=await(0,n.Z)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=s}this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const r=e.type;if(!H.has(r))throw new l.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,j.bU)(e.geometryType).renderer;(0,y.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,h.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 s=new Array,a=new Map;for(const e of r){const{geometry:t}=e,{vertexSpace:r}=t;if(r.isRelative)s.push(t);else{const r=A(t);a.set(r,t),e.geometry=r,s.push(r)}}await this.uploadAssets(s);for(const[e,t]of a)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(r),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:n}=e,i=n.getExternalSourcesOnService(s),o=a.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:l}=i.find(O.yT)??i[0],{vertexSpace:u}=e,d=u.isGeoreferenced?["PROJECT_VERTICES"]:[];for(const e of l)1===e.parts.length?t.push({globalId:(0,m.zS)(),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,s=[];let a=null;if(Array.isArray(t))for(const e of t)s.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===r&&(a={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else a=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,s={addFeatureResults:e?.addResults?.map(N)??[],updateFeatureResults:e?.updateResults?.map(N)??[],deleteFeatureResults:e?.deleteResults?.map(N)??[],addAttachmentResults:r?.addResults?r.addResults.map(N):[],updateAttachmentResults:r?.updateResults?r.updateResults.map(N):[],deleteAttachmentResults:r?.deleteResults?r.deleteResults.map(N):[]};return e?.editMoment&&(s.editMoment=e.editMoment),s}(a);if(s.length>0){n.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new Q.Z(t.spatialReference):null;n.editedFeatureResults.push({layerId:e.id,editedFeatures:U(t,r)})}}return n}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new l.Z("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const e in t){const s=t[e];null!=s&&(r.set?r.set(e,s):r.append(e,s))}return r}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:r,dynamicDataSource:s}=this.layer;return{...e,query:{gdbVersion:r,layer:s?JSON.stringify({source:s}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _filterRedundantAssetMaps(e){const{layer:t}=this,{globalIdField:r,infoFor3D:s,parsedUrl:a}=t;if(null==s||null==r)return e;const n=(0,G.$6)(s);if(null==n)return e;const i=(0,f.v_)(a.path,`../${n.id}`),l=new Array,u=new Array;for(const t of e)t.geometry.metadata.getExternalSourcesOnService(a).length>0?u.push(t):l.push(t);const d=u.map((e=>e.getAttribute(r))).filter(o.pC);if(0===d.length)return e;const{assetMapFieldRoles:{parentGlobalId:p,assetHash:c}}=s,y=new L.Z;y.where=`${p} IN (${d.map((e=>`'${e}'`))})`,y.outFields=[c,p],y.returnGeometry=!1;const h=await(0,J.e)(i,y),{features:m}=h;return 0===m.length?e:[...l,...u.filter((e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=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 s.getExternalSourcesOnService(a).flatMap((({source:e})=>e.flatMap((e=>e.parts.map((e=>e.partHash)))))).some((e=>i.every((t=>e!==t))))}))]}};(0,s._)([(0,g.Cb)()],W.prototype,"type",void 0),(0,s._)([(0,g.Cb)({constructOnly:!0})],W.prototype,"layer",void 0),(0,s._)([(0,g.Cb)({readOnly:!0})],W.prototype,"queryTask",null),W=(0,s._)([(0,b.j)("esri.layers.graphics.sources.FeatureLayerSource")],W);const Y=1e3,K=W},25278:(e,t,r)=>{r.d(t,{Dm:()=>d,Hq:()=>p,MS:()=>c,bU:()=>o});var s=r(80442),a=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 l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function d(e,t){if((0,s.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this.${t} = null;`;for(const t in e)r+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new s}catch(r){return()=>({[t]:null,...e})}}function p(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,a.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}}}},59431:(e,t,r)=>{r.d(t,{P:()=>i});var s=r(67900),a=r(8744);function n(e,t,r){if(null==e.hasM||e.hasZ)for(const e of t)for(const t of e)t.length>2&&(t[2]*=r)}function i(e,t,r){if(!e&&!t||!r)return;const a=(0,s._R)(r);o(e,r,a),o(t,r,a)}function o(e,t,r){if(e)for(const s of e)l(s.geometry,t,r)}function l(e,t,r){if(!e?.spatialReference||(0,a.fS)(e.spatialReference,t))return;const i=(0,s._R)(e.spatialReference)/r;if(1!==i)if("x"in e)null!=e.z&&(e.z*=i);else if("rings"in e)n(e,e.rings,i);else if("paths"in e)n(e,e.paths,i);else if("points"in e&&(null==e.hasM||e.hasZ))for(const t of e.points)t.length>2&&(t[2]*=i)}},28694:(e,t,r)=>{r.d(t,{p:()=>a});var s=r(69285);function a(e,t,r){if(!r?.features||!r.hasZ)return;const a=(0,s.k)(r.geometryType,t,e.outSpatialReference);if(null!=a)for(const e of r.features)a(e.geometry)}},74889:(e,t,r)=>{r.d(t,{Z:()=>w});var s,a=r(43697),n=r(66577),i=r(38171),o=r(35454),l=r(96674),u=r(22974),d=r(5600),p=(r(75215),r(71715)),c=r(52011),y=r(30556),h=r(82971),f=r(33955),m=r(1231);const g=new o.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 a=e[t],n=i.Z.fromJSON(a),o=a.geometry?.spatialReference;null==n.geometry||o||(n.geometry.spatialReference=r);const l=a.aggregateGeometries,u=n.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],s=l[e],a=s?.spatialReference;null==t||a||(t.spatialReference=r)}s.push(n)}return s}writeGeometryType(e,t,r,s){if(e)return void g.write(e,t,r,s);const{features:a}=this;if(a)for(const e of a)if(null!=e?.geometry)return void g.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,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const 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,a]}=e,n=this.features,i=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-s)/t)),(e=>Math.round((a-e)/r)));for(let e=0,t=n.length;e<t;e++)i?.(n[e].geometry)||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,a],scale:[n,i]}=r;let o=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;o=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*n+s),(e=>a-e*i),o,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,r){let s,a;const n=[];for(let i=0,o=e.length;i<o;i++){const o=e[i];if(i>0){const e=t(o[0]),i=r(o[1]);e===s&&i===a||(n.push([e-s,i-a]),s=e,a=i)}else s=t(o[0]),a=r(o[1]),n.push([s,a])}return n.length>0?n:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,f.oU)(e)?e.rings:e.paths,a=[];for(let e=0,n=s.length;e<n;e++){const n=s[e],i=this._quantizePoints(n,t,r);i&&a.push(i)}return a.length>0?((0,f.oU)(e)?e.rings=a:e.paths=a,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,a){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),s&&(e.z=s(e.z))}:"polyline"===e||"polygon"===e?e=>{const n=(0,f.oU)(e)?e.rings:e.paths;let i,o;for(let e=0,s=n.length;e<s;e++){const s=n[e];for(let e=0,a=s.length;e<a;e++){const a=s[e];e>0?(i+=a[0],o+=a[1]):(i=a[0],o=a[1]),a[0]=t(i),a[1]=r(o)}}if(s&&a)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2]),r[3]=a(r[3])}}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=s(r[2])}}else if(a)for(let e=0,t=n.length;e<t;e++){const t=n[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=a(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)),a&&null!=e.mmax&&null!=e.mmin&&(e.mmax=a(e.mmax),e.mmin=a(e.mmin))}:"multipoint"===e?e=>{const n=e.points;let i,o;for(let e=0,s=n.length;e<s;e++){const s=n[e];e>0?(i+=s[0],o+=s[1]):(i=s[0],o=s[1]),s[0]=t(i),s[1]=r(o)}if(s&&a)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=s(t[2]),t[3]=a(t[3])}else if(s)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=s(t[2])}else if(a)for(let e=0,t=n.length;e<t;e++){const t=n[e];t[2]=a(t[2])}}:null}};(0,a._)([(0,d.Cb)({type:String,json:{write:!0}})],b.prototype,"displayFieldName",void 0),(0,a._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"exceededTransferLimit",void 0),(0,a._)([(0,d.Cb)({type:[i.Z],json:{write:!0}})],b.prototype,"features",void 0),(0,a._)([(0,p.r)("features")],b.prototype,"readFeatures",null),(0,a._)([(0,d.Cb)({type:[m.Z],json:{write:!0}})],b.prototype,"fields",void 0),(0,a._)([(0,d.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],b.prototype,"geometryType",void 0),(0,a._)([(0,y.c)("geometryType")],b.prototype,"writeGeometryType",null),(0,a._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasM",void 0),(0,a._)([(0,d.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],b.prototype,"hasZ",void 0),(0,a._)([(0,d.Cb)({types:n.qM,json:{write:!0}})],b.prototype,"queryGeometry",void 0),(0,a._)([(0,p.r)("queryGeometry")],b.prototype,"readQueryGeometry",null),(0,a._)([(0,d.Cb)({type:h.Z,json:{write:!0}})],b.prototype,"spatialReference",void 0),(0,a._)([(0,y.c)("spatialReference")],b.prototype,"writeSpatialReference",null),(0,a._)([(0,d.Cb)({json:{write:!0}})],b.prototype,"transform",void 0),b=s=(0,a._)([(0,c.j)("esri.rest.support.FeatureSet")],b),b.prototype.toJSON.isDefaultToJSON=!0;const w=b}}]);
@@ -0,0 +1 @@
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,{DO:()=>i,dG:()=>a,zS:()=>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().toUpperCase()}}`}function a(){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),U=r(15650);let x=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,U.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:[]})],x.prototype,"allLayers",void 0),(0,s._)([(0,d.Cb)({readOnly:!0})],x.prototype,"allTables",void 0),(0,s._)([(0,d.Cb)({json:{read:!0,write:!0}})],x.prototype,"blendMode",void 0),(0,s._)([(0,d.Cb)()],x.prototype,"fullExtent",void 0),(0,s._)([(0,d.Cb)({readOnly:!0})],x.prototype,"sourceIsPortalItem",null),(0,s._)([(0,d.Cb)({json:{read:!1,write:{ignoreOrigin:!0}}})],x.prototype,"layers",void 0),(0,s._)([(0,y.c)("layers")],x.prototype,"_writeLayers",null),(0,s._)([(0,d.Cb)({type:["GroupLayer"]})],x.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}}}})],x.prototype,"portalItem",null),(0,s._)([(0,p.r)("web-map","portalItem",["itemId"])],x.prototype,"readPortalItem",null),(0,s._)([(0,y.c)("web-map","portalItem",{itemId:{type:String}})],x.prototype,"writePortalItem",null),(0,s._)([(0,d.Cb)()],x.prototype,"spatialReference",void 0),(0,s._)([(0,d.Cb)({json:{read:!1},readOnly:!0,value:"group"})],x.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)}}}}})],x.prototype,"visibilityMode",null),x=(0,s._)([(0,h.j)("esri.layers.GroupLayer")],x);const Z=x},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.DO)());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)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9059,7873,5732,7865],{92835:(e,t,r)=>{r.d(t,{Z:()=>f});var s,i=r(43697),n=r(96674),o=r(35463),a=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,o.JE)(r,e,t));let i=this.end;if(i){const r=(0,o.JE)(i,e,t);i=i.getTime()===r.getTime()?r:(0,o.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 o,a;if(i>=t&&i<=r?o=i:t>=i&&t<=n&&(o=t),r>=i&&r<=n?a=r:n>=t&&n<=r&&(a=n),null!=o&&null!=a&&!isNaN(o)&&!isNaN(a)){const e=new s;return e.start=o===-1/0?null:new Date(o),e.end=a===1/0?null:new Date(a),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:a}=this;return null!=n&&(i.start=(0,o.Nm)(n,e,t,r)),null!=a&&(i.end=(0,o.Nm)(a,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,a.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,a.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,i._)([(0,a.Cb)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,i._)([(0,a.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)),o=r(5600),a=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,o.Cb)()],l.prototype,"getCollections",void 0),(0,s._)([(0,o.Cb)()],l.prototype,"getChildrenFunction",void 0),(0,s._)([(0,o.Cb)()],l.prototype,"itemFilterFunction",void 0),l=(0,s._)([(0,a.j)("esri.core.CollectionFlattener")],l);const u=l},10699:(e,t,r)=>{r.d(t,{IG:()=>o,iv:()=>a});var s=r(43697),i=r(52011);let n=0;const o=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+n++})}};return t=(0,s._)([(0,i.j)("esri.core.Identifiable")],t),t},a=e=>{let t=class extends e{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:n++})}};return t=(0,s._)([(0,i.j)("esri.core.NumericIdentifiable")],t),t};let l=class extends(o(class{})){};l=(0,s._)([(0,i.j)("esri.core.Identifiable")],l)},17445:(e,t,r)=>{r.d(t,{N1:()=>p,YP:()=>l,Z_:()=>f,gx:()=>u,nn:()=>m,on:()=>c,tX:()=>b}),r(66643),r(46791);var s=r(91460),i=r(50758),n=r(70586),o=r(95330),a=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 o=r.once?(e,r)=>{s(e)&&((0,n.hw)(i),t(e,r))}:(e,r)=>{s(e)&&t(e,r)};if(i=(0,a.aQ)(e,o,r.sync,r.equals),r.initial){const t=e();o(t,t)}return i}function c(e,t,r,o={}){let a=null,u=null,d=null;function c(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function p(e){o.once&&o.once&&(0,n.hw)(d),r(e)}const h=l(e,((e,r)=>{c(),(0,s.vT)(e)&&(a=e,u=(0,s.on)(e,t,p),o.onListenerAdd?.(e))}),{sync:o.sync,initial:!0});return d=(0,i.kB)((()=>{h.remove(),c()})),d}function p(e,t){return function(e,t,r){if((0,o.Hc)(r))return Promise.reject((0,o.zE)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function l(){a=(0,n.hw)(a)}return new Promise(((s,n)=>{a=(0,i.AL)([(0,o.fu)(r,(()=>{l(),n((0,o.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},b={sync:!0,initial:!0}},41123:(e,t,r)=>{r.d(t,{DO:()=>i,dG:()=>o,zS:()=>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().toUpperCase()}}`}function o(){return`{${i()}}`}},40504:(e,t,r)=>{r.r(t),r.d(t,{default:()=>F});var s=r(43697),i=r(57435),n=r(68668),o=r(92604),a=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),b=r(71612),v=r(38009),g=r(16859),w=r(72965),_=r(87344),I=r(15235),C=r(46791),P=r(70921);function E(e,t,r){let s,i;if(e)for(let n=0,o=e.length;n<o;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 S=e=>{let t=class extends e{constructor(...e){super(...e),this.layers=new C.Z;const t=e=>{e.parent=this,this.layerAdded(e),"elevation"!==e.type&&"base-elevation"!==e.type||o.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,P.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)})):o.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 T(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=T(i.tables,t,r);if(e)return e}}}const L=e=>{let t=class extends e{constructor(...e){super(...e),this.tables=new C.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&&o.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,P.Z)(e,this._get("tables")))}findTableById(e){return T(this.tables,"id",e)}findTableByUid(e){return T(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},A=Symbol("WebScene");var O=r(12259),U=r(35755),x=r(15650);let Z=class extends((0,b.h)((0,w.M)((0,v.q)((0,g.I)(L(S((0,a.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&&A 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(),o.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,U.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:[]})],Z.prototype,"allLayers",void 0),(0,s._)([(0,d.Cb)({readOnly:!0})],Z.prototype,"allTables",void 0),(0,s._)([(0,d.Cb)({json:{read:!0,write:!0}})],Z.prototype,"blendMode",void 0),(0,s._)([(0,d.Cb)()],Z.prototype,"fullExtent",void 0),(0,s._)([(0,d.Cb)({readOnly:!0})],Z.prototype,"sourceIsPortalItem",null),(0,s._)([(0,d.Cb)({json:{read:!1,write:{ignoreOrigin:!0}}})],Z.prototype,"layers",void 0),(0,s._)([(0,y.c)("layers")],Z.prototype,"_writeLayers",null),(0,s._)([(0,d.Cb)({type:["GroupLayer"]})],Z.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}}}})],Z.prototype,"portalItem",null),(0,s._)([(0,p.r)("web-map","portalItem",["itemId"])],Z.prototype,"readPortalItem",null),(0,s._)([(0,y.c)("web-map","portalItem",{itemId:{type:String}})],Z.prototype,"writePortalItem",null),(0,s._)([(0,d.Cb)()],Z.prototype,"spatialReference",void 0),(0,s._)([(0,d.Cb)({json:{read:!1},readOnly:!0,value:"group"})],Z.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)}}}}})],Z.prototype,"visibilityMode",null),Z=(0,s._)([(0,h.j)("esri.layers.GroupLayer")],Z);const F=Z},87085:(e,t,r)=>{r.d(t,{Z:()=>g});var s=r(43697),i=(r(66577),r(3172)),n=r(20102),o=r(32448),a=r(10699),l=r(83379),u=r(92604),d=r(95330),c=r(17452),p=r(5600),h=(r(75215),r(67676),r(80442),r(52011)),y=r(68773),f=r(6570),m=r(82971);let b=0,v=class extends(o.Z.EventedMixin((0,a.IG)(l.Z))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.Z(-180,-90,180,90,m.Z.WGS84),this.id=Date.now().toString(16)+"-layer-"+b++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=m.Z.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await r.e(3529).then(r.bind(r,63529))).fromUrl(t)}static fromPortalItem(e){return async function(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:s}=await r.e(8008).then(r.bind(r,28008));try{return await s(t)}catch(e){const r=t&&t.portalItem,s=r?.id||"unset",i=r&&r.portal&&r.portal.url||y.default.portalUrl;throw u.Z.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+i+"', id: '"+s+"')",e),e}}(e)}initialize(){this.when().catch((e=>{(0,d.D_)(e)||u.Z.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,c.mN)(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await(0,i.Z)(e,{query:{f:"json"},responseType:"json"})).data;throw new n.Z("layer:no-attribution-data","Layer does not have attribution data")}};(0,s._)([(0,p.Cb)({type:String})],v.prototype,"attributionDataUrl",void 0),(0,s._)([(0,p.Cb)({type:f.Z})],v.prototype,"fullExtent",void 0),(0,s._)([(0,p.Cb)({readOnly:!0})],v.prototype,"hasAttributionData",null),(0,s._)([(0,p.Cb)({type:String,clonable:!1})],v.prototype,"id",void 0),(0,s._)([(0,p.Cb)({type:Boolean,nonNullable:!0})],v.prototype,"legendEnabled",void 0),(0,s._)([(0,p.Cb)({type:["show","hide","hide-children"]})],v.prototype,"listMode",void 0),(0,s._)([(0,p.Cb)({type:Number,range:{min:0,max:1},nonNullable:!0})],v.prototype,"opacity",void 0),(0,s._)([(0,p.Cb)({clonable:!1})],v.prototype,"parent",void 0),(0,s._)([(0,p.Cb)({readOnly:!0})],v.prototype,"parsedUrl",null),(0,s._)([(0,p.Cb)({type:Boolean,readOnly:!0})],v.prototype,"persistenceEnabled",void 0),(0,s._)([(0,p.Cb)({type:Boolean})],v.prototype,"popupEnabled",void 0),(0,s._)([(0,p.Cb)({type:Boolean})],v.prototype,"attributionVisible",void 0),(0,s._)([(0,p.Cb)({type:m.Z})],v.prototype,"spatialReference",void 0),(0,s._)([(0,p.Cb)({type:String})],v.prototype,"title",void 0),(0,s._)([(0,p.Cb)({readOnly:!0,json:{read:!1}})],v.prototype,"type",void 0),(0,s._)([(0,p.Cb)()],v.prototype,"url",void 0),(0,s._)([(0,p.Cb)({type:Boolean,nonNullable:!0})],v.prototype,"visible",void 0),v=(0,s._)([(0,h.j)("esri.layers.Layer")],v);const g=v},16859:(e,t,r)=>{r.d(t,{I:()=>I});var s=r(43697),i=r(68773),n=r(40330),o=r(3172),a=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),b=r(84230),v=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,o;if(s)i=r.portal.url;else try{i=await(0,b.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;o=await(n.id?.getCredential(`${i}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,c.r9)(e)}if(!o)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=C.credential===t?C.user:await this._fetchEditingUser(e);return C.credential=t,C.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=v.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,a.q6)((0,o.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||v.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},C={credential:null,user:null}},97873:(e,t,r)=>{r.d(t,{FO:()=>c,W7:()=>p,addOrUpdateResource:()=>a,fetchResources:()=>o,removeAllResources:()=>u,removeResource:()=>l});var s=r(3172),i=r(20102),n=r(17452);async function o(e,t={},r){await e.load(r);const s=(0,n.v_)(e.itemUrl,"resources"),{start:i=1,num:o=10,sortOrder:a="asc",sortField:l="created"}=t,u={query:{start:i,num:o,sortOrder:a,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 a(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 o=e.portalItem;await o.load(s);const a=(0,n.v_)(o.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 o.portal.request(a,{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),o=r(41123),a=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,a.W7)(t,(0,o.DO)());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,a.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,a.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)}}}]);
@@ -0,0 +1 @@
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.zS)())}(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.zS)(),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}}}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1767,7873],{65845:(e,t,r)=>{r.d(t,{D:()=>a});var o=r(81153);function a(e){e?.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,o.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function o(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>o})},54295:(e,t,r)=>{r.d(t,{V:()=>i});var o=r(43697),a=r(5600),s=(r(75215),r(67676),r(80442),r(52011));const i=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,o._)([(0,a.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,o._)([(0,s.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,r)=>{r.d(t,{Y:()=>l});var o=r(43697),a=r(92604),s=r(5600),i=(r(75215),r(67676),r(80442),r(52011)),n=r(66677);const l=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,n.Qc)(this.url);if(null!=e&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Nm)(e,a.Z.getLogger(this)))}};return(0,o._)([(0,s.Cb)()],t.prototype,"title",null),(0,o._)([(0,s.Cb)({type:String})],t.prototype,"url",null),t=(0,o._)([(0,i.j)("esri.layers.mixins.ArcGISService")],t),t}},37253:(e,t,r)=>{r.d(t,{xp:()=>P,Vt:()=>O});var o=r(43697),a=r(3172),s=r(20102),i=r(92604),n=r(95330),l=r(17452),p=r(5600),c=(r(75215),r(67676),r(80442),r(71715)),u=r(52011),d=r(30556),h=r(65845),y=r(6570),m=r(79235),f=r(82971),v=r(66677),g=r(21506),w=r(61064);var S=r(48522),I=r(15235),_=r(14769),x=r(35755);const b="esri.layers.mixins.SceneService",R=i.Z.getLogger(b),O=e=>{let t=class extends e{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=(0,n.Ds)((async(e,t,r)=>{switch(e){case P.SAVE:return this._save(t);case P.SAVE_AS:return this._saveAs(r,t)}}))}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(null!=e.spatialReference)return f.Z.fromJSON(e.spatialReference);{const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.substring(r.lastIndexOf("/")+1,r.length),10);return null!=o?new f.Z(o):null}}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:this._readSpatialReference(t)}:e;return y.Z.fromJSON(o,r)}const o=t.store,a=this._readSpatialReference(t);return null==a||null==o?.extent||!Array.isArray(o.extent)||o.extent.some((e=>e<Z))?null:new y.Z({xmin:o.extent[0],ymin:o.extent[1],xmax:o.extent[2],ymax:o.extent[3],spatialReference:a})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():"";return this.parseVersionString(o)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return(0,v.a7)(this.url,t.name);let o=t.name;if(!o&&this.url){const e=(0,v.Qc)(this.url);null!=e&&(o=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(o=r+" - "+o),(0,v.ld)(o)}set url(e){const t=(0,v.XG)({layer:this,url:e,nonStandardUrlAllowed:!1,logger:R});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,o){(0,v.wH)(this,e,"layers",t,o)}get parsedUrl(){const e=this._get("url"),t=(0,l.mN)(e);return null!=this.layerId&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,w.T)(this.parsedUrl.path,this.rootNode,e,this.apiKey,R,t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,r=e.rootPage?.nodes?.[t];if(null==r?.obb?.center||null==r.obb.halfSize)throw new s.Z("sceneservice:invalid-node-page","Invalid node page.");if(r.obb.center[0]<Z||null==this.fullExtent||this.fullExtent.hasZ)return;const o=r.obb.halfSize,a=r.obb.center[2],i=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);this.fullExtent.zmin=a-i,this.fullExtent.zmax=a+i}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<Z)return;const r=t[2],o=t[3],{fullExtent:a}=this;a&&(a.zmin=r-o,a.zmax=r+o)}}async _fetchService(e){if(null==this.url)throw new s.Z("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,a.Z)(this.url,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,a.Z)(this.parsedUrl?.path??"",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const o=t.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const t=(await(0,a.Z)(this.parsedUrl?.path+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const t of o)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)),r===A.newItem&&(e.typeKeywords=e.typeKeywords.filter((e=>"Hosted Service"!==e))))}async _saveAs(e,t){const r={...N,...t};let o=I.default.from(e);if(!o)throw new s.Z("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");(0,_.w)(o),o.id&&(o=o.clone(),o.id=null);const a=o.portal||S.Z.getDefault();await this._ensureLoadBeforeSave(),o.type=C,o.portal=a;const i={origin:"portal-item",url:null,messages:[],portal:a,portalItem:o,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},n={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(n,i,r),o.url=this.url,o.title||(o.title=this.title),this._updateTypeKeywords(o,r,A.newItem),await a.signIn(),await(a.user?.addItem({item:o,folder:r?.folder,data:n})),await(0,x.Hn)(this.resourceReferences,i,null),this.portalItem=o,(0,h.D)(i),i.portalItem=o,o}async _save(e){const t={...N,...e};if(!this.portalItem)throw new s.Z("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if((0,_.w)(this.portalItem),this.portalItem.type!==C)throw new s.Z("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${C}"`);await this._ensureLoadBeforeSave();const r={origin:"portal-item",url:this.portalItem.itemUrl&&(0,l.mN)(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||S.Z.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},o={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(o,r,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,A.existingItem),await(0,x.bx)(this.portalItem,o,this.resourceReferences,r,null),(0,h.D)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,r){let o=t.messages?.filter((e=>"error"===e.type)).map((e=>new s.Z(e.name,e.message,e.details)))??[];r?.validationOptions?.ignoreUnsupported&&(o=o.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name)));const a=r?.validationOptions,i=a?.enabled,n=null;if(i&&n){const t=(await n()).validate(e,r.portalItemLayerType);if(t.length>0){const e=`Layer item did not validate:\n${t.join("\n")}`;if(R.error(`_validateAgainstJSONSchema(): ${e}`),"throw"===a.failPolicy){const e=t.map((e=>new s.Z("sceneservice:schema-validation",e))).concat(o);throw new s.Z("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:e})}}}if(o.length>0)throw new s.Z("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:o})}};return(0,o._)([(0,p.Cb)(g.id)],t.prototype,"id",void 0),(0,o._)([(0,p.Cb)({type:f.Z})],t.prototype,"spatialReference",void 0),(0,o._)([(0,c.r)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readSpatialReference",null),(0,o._)([(0,p.Cb)({type:y.Z})],t.prototype,"fullExtent",void 0),(0,o._)([(0,c.r)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readFullExtent",null),(0,o._)([(0,p.Cb)({readOnly:!0,type:m.Z})],t.prototype,"heightModelInfo",void 0),(0,o._)([(0,p.Cb)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],t.prototype,"minScale",void 0),(0,o._)([(0,p.Cb)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],t.prototype,"maxScale",void 0),(0,o._)([(0,p.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,o._)([(0,c.r)("version",["store.version"])],t.prototype,"readVersion",null),(0,o._)([(0,p.Cb)({type:String,json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,o._)([(0,p.Cb)({type:String,json:{read:!1}})],t.prototype,"sublayerTitleMode",void 0),(0,o._)([(0,p.Cb)({type:String})],t.prototype,"title",void 0),(0,o._)([(0,c.r)("portal-item","title")],t.prototype,"readTitlePortalItem",null),(0,o._)([(0,c.r)("service","title",["name"])],t.prototype,"readTitleService",null),(0,o._)([(0,p.Cb)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],t.prototype,"layerId",void 0),(0,o._)([(0,p.Cb)(g.HQ)],t.prototype,"url",null),(0,o._)([(0,d.c)("url")],t.prototype,"writeUrl",null),(0,o._)([(0,p.Cb)()],t.prototype,"parsedUrl",null),(0,o._)([(0,p.Cb)({readOnly:!0})],t.prototype,"store",void 0),(0,o._)([(0,p.Cb)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],t.prototype,"rootNode",void 0),t=(0,o._)([(0,u.j)(b)],t),t},Z=-1e38;var A,K;(K=A||(A={}))[K.existingItem=0]="existingItem",K[K.newItem=1]="newItem";const C="Scene Service",N={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var P;!function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(P||(P={}))},61064:(e,t,r)=>{r.d(t,{T:()=>s});var o=r(3172),a=r(20102);async function s(e,t,r,s,i,n){let l=null;if(null!=r){const t=`${e}/nodepages/`,a=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,o.Z)(a,{query:{f:"json",token:s},responseType:"json",signal:n})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){null!=i&&i.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",a,e),l=e}}if(!t)return null;const p=t?.split("/").pop(),c=`${e}/nodes/`,u=c+p;try{return{type:"node",rootNode:(await(0,o.Z)(u,{query:{f:"json",token:s},responseType:"json",signal:n})).data,urlPrefix:c}}catch(e){throw new a.Z("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:e,url:u})}}},97873:(e,t,r)=>{r.d(t,{FO:()=>u,W7:()=>d,addOrUpdateResource:()=>n,fetchResources:()=>i,removeAllResources:()=>p,removeResource:()=>l});var o=r(3172),a=r(20102),s=r(17452);async function i(e,t={},r){await e.load(r);const o=(0,s.v_)(e.itemUrl,"resources"),{start:a=1,num:i=10,sortOrder:n="asc",sortField:l="created"}=t,p={query:{start:a,num:i,sortOrder:n,sortField:l,token:e.apiKey},signal:r?.signal},c=await e.portal.request(o,p);return{total:c.total,nextStart:c.nextStart,resources:c.resources.map((({created:t,size:r,resource:o})=>({created:new Date(t),size:r,resource:e.resourceFromPath(o)})))}}async function n(e,t,r,o){if(!e.hasPath())throw new a.Z(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const i=e.portalItem;await i.load(o);const n=(0,s.v_)(i.userItemUrl,"add"===t?"addResources":"updateResources"),[l,p]=c(e.path),u=new FormData;return l&&"."!==l&&u.append("resourcesPrefix",l),null!=o&&o.compress&&u.append("compress","true"),u.append("fileName",p),u.append("file",r,p),u.append("f","json"),o?.access&&u.append("access",o.access),await i.portal.request(n,{method:"post",body:u,signal:o?.signal}),e}async function l(e,t,r){if(!t.hasPath())throw new a.Z("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const o=(0,s.v_)(e.userItemUrl,"removeResources");await e.portal.request(o,{method:"post",query:{resource:t.path},signal:r?.signal}),t.portalItem=null}async function p(e,t){await e.load(t);const r=(0,s.v_)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function c(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}async function u(e){return"blob"===e.type?e.blob:"json"===e.type?new Blob([e.jsonString],{type:"application/json"}):(await(0,o.Z)(e.url,{responseType:"blob"})).data}function d(e,t){if(!e.hasPath())return null;const[r,,o]=function(e){const[t,r]=function(e){const t=(0,s.Ml)(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[o,a]=c(t);return[o,a,r]}(e.path);return e.portalItem.resourceFromPath((0,s.v_)(r,t+o))}},14769:(e,t,r)=>{r.d(t,{w:()=>i});var o=r(68773),a=r(20102),s=r(71058);function i(e){if(o.default.apiKey&&(0,s.r)(e.portal.url))throw new a.Z("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${e.portal.url} when using an api key`)}},35755:(e,t,r)=>{r.d(t,{Hn:()=>l,Pl:()=>y,bx:()=>p});var o=r(66643),a=r(20102),s=r(95330),i=r(41123),n=r(97873);async function l(e,t,r=null){const o=await c(e,t,r);await u(o,t,r)}async function p(e,t,r,o,a=null){const s=await c(r,o,a);await e.update({data:t}),await u(s,o,a)}async function c(e,t,r=null){if(!t?.resources)return;const o=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))),p=new Set,c=[];l.forEach((t=>{o.delete(t),e.paths.push(t)}));for(const a of t.resources.toUpdate)if(o.delete(a.resource.path),l.has(a.resource.path)||p.has(a.resource.path)){const{resource:t,content:o,finish:s,error:l}=a,p=(0,n.W7)(t,(0,i.D)());e.paths.push(p.path),c.push(d({resource:p,content:o,compress:a.compress,finish:s,error:l},r))}else e.paths.push(a.resource.path),c.push(h(a,r)),p.add(a.resource.path);for(const a of t.resources.toAdd)e.paths.push(a.resource.path),o.has(a.resource.path)?o.delete(a.resource.path):c.push(d(a,r));if(0===c.length)return o;const u=await(0,s.UO)(c);if((0,s.k_)(r),u.length>0)throw new a.Z("save:resources","Failed to save one or more resources",{errors:u});return o}async function u(e,t,r=null){if(!e||!t.portalItem)return;const o=[];for(const a of e){const e=t.portalItem.resourceFromPath(a);o.push(e.portalItem.removeResource(e,r))}await(0,s.as)(o)}async function d(e,t){const r={...null!=t?t:{},compress:e.compress},a=await(0,o.q6)(e.resource.portalItem.addResource(e.resource,await(0,n.FO)(e.content),r));if(!0!==a.ok)throw e.error?.(a.error),a.error;e.finish?.(e.resource)}async function h(e,t){const r=await(0,o.q6)(e.resource.update(await(0,n.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
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1767,7873],{65845:(e,t,r)=>{r.d(t,{D:()=>a});var o=r(81153);function a(e){e?.writtenProperties&&e.writtenProperties.forEach((({target:e,propName:t,newOrigin:r})=>{(0,o.l)(e)&&r&&e.originOf(t)!==r&&e.updateOrigin(t,r)}))}},81153:(e,t,r)=>{function o(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>o})},54295:(e,t,r)=>{r.d(t,{V:()=>i});var o=r(43697),a=r(5600),s=(r(75215),r(67676),r(80442),r(52011));const i=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,o._)([(0,a.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,o._)([(0,s.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,r)=>{r.d(t,{Y:()=>l});var o=r(43697),a=r(92604),s=r(5600),i=(r(75215),r(67676),r(80442),r(52011)),n=r(66677);const l=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,n.Qc)(this.url);if(null!=e&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Nm)(e,a.Z.getLogger(this)))}};return(0,o._)([(0,s.Cb)()],t.prototype,"title",null),(0,o._)([(0,s.Cb)({type:String})],t.prototype,"url",null),t=(0,o._)([(0,i.j)("esri.layers.mixins.ArcGISService")],t),t}},37253:(e,t,r)=>{r.d(t,{xp:()=>P,Vt:()=>O});var o=r(43697),a=r(3172),s=r(20102),i=r(92604),n=r(95330),l=r(17452),p=r(5600),c=(r(75215),r(67676),r(80442),r(71715)),u=r(52011),d=r(30556),h=r(65845),y=r(6570),m=r(79235),f=r(82971),v=r(66677),g=r(21506),w=r(61064);var S=r(48522),I=r(15235),_=r(14769),x=r(35755);const b="esri.layers.mixins.SceneService",R=i.Z.getLogger(b),O=e=>{let t=class extends e{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=(0,n.Ds)((async(e,t,r)=>{switch(e){case P.SAVE:return this._save(t);case P.SAVE_AS:return this._saveAs(r,t)}}))}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(null!=e.spatialReference)return f.Z.fromJSON(e.spatialReference);{const t=e.store,r=t.indexCRS||t.geographicCRS,o=r&&parseInt(r.substring(r.lastIndexOf("/")+1,r.length),10);return null!=o?new f.Z(o):null}}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const o=null==e.spatialReference?{...e,spatialReference:this._readSpatialReference(t)}:e;return y.Z.fromJSON(o,r)}const o=t.store,a=this._readSpatialReference(t);return null==a||null==o?.extent||!Array.isArray(o.extent)||o.extent.some((e=>e<Z))?null:new y.Z({xmin:o.extent[0],ymin:o.extent[1],xmax:o.extent[2],ymax:o.extent[3],spatialReference:a})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,o=null!=r.version?r.version.toString():"";return this.parseVersionString(o)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem?.title;if("item-title"===this.sublayerTitleMode)return(0,v.a7)(this.url,t.name);let o=t.name;if(!o&&this.url){const e=(0,v.Qc)(this.url);null!=e&&(o=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(o=r+" - "+o),(0,v.ld)(o)}set url(e){const t=(0,v.XG)({layer:this,url:e,nonStandardUrlAllowed:!1,logger:R});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,o){(0,v.wH)(this,e,"layers",t,o)}get parsedUrl(){const e=this._get("url"),t=(0,l.mN)(e);return null!=this.layerId&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,w.T)(this.parsedUrl.path,this.rootNode,e,this.apiKey,R,t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===e?.type){const t=e.rootIndex%e.pageSize,r=e.rootPage?.nodes?.[t];if(null==r?.obb?.center||null==r.obb.halfSize)throw new s.Z("sceneservice:invalid-node-page","Invalid node page.");if(r.obb.center[0]<Z||null==this.fullExtent||this.fullExtent.hasZ)return;const o=r.obb.halfSize,a=r.obb.center[2],i=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);this.fullExtent.zmin=a-i,this.fullExtent.zmax=a+i}else if("node"===e?.type){const t=e.rootNode?.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<Z)return;const r=t[2],o=t[3],{fullExtent:a}=this;a&&(a.zmin=r-o,a.zmax=r+o)}}async _fetchService(e){if(null==this.url)throw new s.Z("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,a.Z)(this.url,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,a.Z)(this.parsedUrl?.path??"",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const o=t.data;this.read(o,this._getServiceContext()),this.validateLayer(o)}async _fetchVoxelServiceLayer(e){const t=(await(0,a.Z)(this.parsedUrl?.path+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const o=t.getTypeKeywords();for(const t of o)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)),r===A.newItem&&(e.typeKeywords=e.typeKeywords.filter((e=>"Hosted Service"!==e))))}async _saveAs(e,t){const r={...N,...t};let o=I.default.from(e);if(!o)throw new s.Z("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");(0,_.w)(o),o.id&&(o=o.clone(),o.id=null);const a=o.portal||S.Z.getDefault();await this._ensureLoadBeforeSave(),o.type=C,o.portal=a;const i={origin:"portal-item",url:null,messages:[],portal:a,portalItem:o,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},n={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(n,i,r),o.url=this.url,o.title||(o.title=this.title),this._updateTypeKeywords(o,r,A.newItem),await a.signIn(),await(a.user?.addItem({item:o,folder:r?.folder,data:n})),await(0,x.Hn)(this.resourceReferences,i,null),this.portalItem=o,(0,h.D)(i),i.portalItem=o,o}async _save(e){const t={...N,...e};if(!this.portalItem)throw new s.Z("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if((0,_.w)(this.portalItem),this.portalItem.type!==C)throw new s.Z("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${C}"`);await this._ensureLoadBeforeSave();const r={origin:"portal-item",url:this.portalItem.itemUrl&&(0,l.mN)(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||S.Z.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},o={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(o,r,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,A.existingItem),await(0,x.bx)(this.portalItem,o,this.resourceReferences,r,null),(0,h.D)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,r){let o=t.messages?.filter((e=>"error"===e.type)).map((e=>new s.Z(e.name,e.message,e.details)))??[];r?.validationOptions?.ignoreUnsupported&&(o=o.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name)));const a=r?.validationOptions,i=a?.enabled,n=null;if(i&&n){const t=(await n()).validate(e,r.portalItemLayerType);if(t.length>0){const e=`Layer item did not validate:\n${t.join("\n")}`;if(R.error(`_validateAgainstJSONSchema(): ${e}`),"throw"===a.failPolicy){const e=t.map((e=>new s.Z("sceneservice:schema-validation",e))).concat(o);throw new s.Z("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:e})}}}if(o.length>0)throw new s.Z("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:o})}};return(0,o._)([(0,p.Cb)(g.id)],t.prototype,"id",void 0),(0,o._)([(0,p.Cb)({type:f.Z})],t.prototype,"spatialReference",void 0),(0,o._)([(0,c.r)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readSpatialReference",null),(0,o._)([(0,p.Cb)({type:y.Z})],t.prototype,"fullExtent",void 0),(0,o._)([(0,c.r)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readFullExtent",null),(0,o._)([(0,p.Cb)({readOnly:!0,type:m.Z})],t.prototype,"heightModelInfo",void 0),(0,o._)([(0,p.Cb)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],t.prototype,"minScale",void 0),(0,o._)([(0,p.Cb)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],t.prototype,"maxScale",void 0),(0,o._)([(0,p.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,o._)([(0,c.r)("version",["store.version"])],t.prototype,"readVersion",null),(0,o._)([(0,p.Cb)({type:String,json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,o._)([(0,p.Cb)({type:String,json:{read:!1}})],t.prototype,"sublayerTitleMode",void 0),(0,o._)([(0,p.Cb)({type:String})],t.prototype,"title",void 0),(0,o._)([(0,c.r)("portal-item","title")],t.prototype,"readTitlePortalItem",null),(0,o._)([(0,c.r)("service","title",["name"])],t.prototype,"readTitleService",null),(0,o._)([(0,p.Cb)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],t.prototype,"layerId",void 0),(0,o._)([(0,p.Cb)(g.HQ)],t.prototype,"url",null),(0,o._)([(0,d.c)("url")],t.prototype,"writeUrl",null),(0,o._)([(0,p.Cb)()],t.prototype,"parsedUrl",null),(0,o._)([(0,p.Cb)({readOnly:!0})],t.prototype,"store",void 0),(0,o._)([(0,p.Cb)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],t.prototype,"rootNode",void 0),t=(0,o._)([(0,u.j)(b)],t),t},Z=-1e38;var A,K;(K=A||(A={}))[K.existingItem=0]="existingItem",K[K.newItem=1]="newItem";const C="Scene Service",N={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var P;!function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(P||(P={}))},61064:(e,t,r)=>{r.d(t,{T:()=>s});var o=r(3172),a=r(20102);async function s(e,t,r,s,i,n){let l=null;if(null!=r){const t=`${e}/nodepages/`,a=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,o.Z)(a,{query:{f:"json",token:s},responseType:"json",signal:n})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){null!=i&&i.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",a,e),l=e}}if(!t)return null;const p=t?.split("/").pop(),c=`${e}/nodes/`,u=c+p;try{return{type:"node",rootNode:(await(0,o.Z)(u,{query:{f:"json",token:s},responseType:"json",signal:n})).data,urlPrefix:c}}catch(e){throw new a.Z("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:e,url:u})}}},97873:(e,t,r)=>{r.d(t,{FO:()=>u,W7:()=>d,addOrUpdateResource:()=>n,fetchResources:()=>i,removeAllResources:()=>p,removeResource:()=>l});var o=r(3172),a=r(20102),s=r(17452);async function i(e,t={},r){await e.load(r);const o=(0,s.v_)(e.itemUrl,"resources"),{start:a=1,num:i=10,sortOrder:n="asc",sortField:l="created"}=t,p={query:{start:a,num:i,sortOrder:n,sortField:l,token:e.apiKey},signal:r?.signal},c=await e.portal.request(o,p);return{total:c.total,nextStart:c.nextStart,resources:c.resources.map((({created:t,size:r,resource:o})=>({created:new Date(t),size:r,resource:e.resourceFromPath(o)})))}}async function n(e,t,r,o){if(!e.hasPath())throw new a.Z(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const i=e.portalItem;await i.load(o);const n=(0,s.v_)(i.userItemUrl,"add"===t?"addResources":"updateResources"),[l,p]=c(e.path),u=new FormData;return l&&"."!==l&&u.append("resourcesPrefix",l),null!=o&&o.compress&&u.append("compress","true"),u.append("fileName",p),u.append("file",r,p),u.append("f","json"),o?.access&&u.append("access",o.access),await i.portal.request(n,{method:"post",body:u,signal:o?.signal}),e}async function l(e,t,r){if(!t.hasPath())throw new a.Z("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const o=(0,s.v_)(e.userItemUrl,"removeResources");await e.portal.request(o,{method:"post",query:{resource:t.path},signal:r?.signal}),t.portalItem=null}async function p(e,t){await e.load(t);const r=(0,s.v_)(e.userItemUrl,"removeResources");return e.portal.request(r,{method:"post",query:{deleteAll:!0},signal:t?.signal})}function c(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}async function u(e){return"blob"===e.type?e.blob:"json"===e.type?new Blob([e.jsonString],{type:"application/json"}):(await(0,o.Z)(e.url,{responseType:"blob"})).data}function d(e,t){if(!e.hasPath())return null;const[r,,o]=function(e){const[t,r]=function(e){const t=(0,s.Ml)(e);return null==t?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[o,a]=c(t);return[o,a,r]}(e.path);return e.portalItem.resourceFromPath((0,s.v_)(r,t+o))}},14769:(e,t,r)=>{r.d(t,{w:()=>i});var o=r(68773),a=r(20102),s=r(71058);function i(e){if(o.default.apiKey&&(0,s.r)(e.portal.url))throw new a.Z("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${e.portal.url} when using an api key`)}},35755:(e,t,r)=>{r.d(t,{Hn:()=>l,Pl:()=>y,bx:()=>p});var o=r(66643),a=r(20102),s=r(95330),i=r(41123),n=r(97873);async function l(e,t,r=null){const o=await c(e,t,r);await u(o,t,r)}async function p(e,t,r,o,a=null){const s=await c(r,o,a);await e.update({data:t}),await u(s,o,a)}async function c(e,t,r=null){if(!t?.resources)return;const o=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))),p=new Set,c=[];l.forEach((t=>{o.delete(t),e.paths.push(t)}));for(const a of t.resources.toUpdate)if(o.delete(a.resource.path),l.has(a.resource.path)||p.has(a.resource.path)){const{resource:t,content:o,finish:s,error:l}=a,p=(0,n.W7)(t,(0,i.DO)());e.paths.push(p.path),c.push(d({resource:p,content:o,compress:a.compress,finish:s,error:l},r))}else e.paths.push(a.resource.path),c.push(h(a,r)),p.add(a.resource.path);for(const a of t.resources.toAdd)e.paths.push(a.resource.path),o.has(a.resource.path)?o.delete(a.resource.path):c.push(d(a,r));if(0===c.length)return o;const u=await(0,s.UO)(c);if((0,s.k_)(r),u.length>0)throw new a.Z("save:resources","Failed to save one or more resources",{errors:u});return o}async function u(e,t,r=null){if(!e||!t.portalItem)return;const o=[];for(const a of e){const e=t.portalItem.resourceFromPath(a);o.push(e.portalItem.removeResource(e,r))}await(0,s.as)(o)}async function d(e,t){const r={...null!=t?t:{},compress:e.compress},a=await(0,o.q6)(e.resource.portalItem.addResource(e.resource,await(0,n.FO)(e.content),r));if(!0!==a.ok)throw e.error?.(a.error),a.error;e.finish?.(e.resource)}async function h(e,t){const r=await(0,o.q6)(e.resource.update(await(0,n.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)}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4828,5732],{92835:(t,e,n)=>{n.d(e,{Z:()=>m});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 f}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,f=new d({start:void 0,end:void 0}),m=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 f=n*h+i*d+o*p;return f?(f=1/f,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):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],f=n[2],m=n[3],y=n[4],_=n[5],x=n[6],g=n[7],b=n[8];return t[0]=d*i+p*s+f*c,t[1]=d*o+p*a+f*u,t[2]=d*r+p*l+f*h,t[3]=m*i+y*s+_*c,t[4]=m*o+y*a+_*u,t[5]=m*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],f=e[12],m=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*m-h*f,C=u*y-d*f,R=u*_-p*f,I=h*y-d*m,S=h*_-p*m,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]=(m*w-y*M+_*v)*j,t[7]=(y*b-f*w-_*g)*j,t[8]=(f*M-m*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,f=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],f=e[2],m=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-f)<=v*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(s-m)<=v*Math.max(1,Math.abs(s),Math.abs(m))&&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,f=o*l,m=r*s,y=r*a,_=r*l;return t[0]=1-h-f,t[3]=u-_,t[6]=d+y,t[1]=u+_,t[4]=1-c-f,t[7]=p-m,t[2]=d-y,t[5]=p+m,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,f=n*h+i*d+o*p;if(!f)return null;const m=1/f;return 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},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:f,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,f=r;for(e(n,o,i),s(n[r],d)>0&&e(n,o,r);p<f;){for(e(n,p,f),p++,f--;s(n[p],d)<0;)p++;for(;s(n[f],d)>0;)f--}0===s(n[o],d)?e(n,o,f):e(n,++f,r),f<=i&&(o=f+1),i<=f&&(r=f-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:()=>f,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 f(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 m=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:m,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:f,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=f(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=m(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 f(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 m(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_:()=>m,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,f)}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,f,e)}function p(t){return!0}function f(t){return!!t}n(87538);const m={sync:!0},y={initial:!0},_={sync:!0,initial:!0}},41123:(t,e,n)=>{n.d(e,{DO:()=>o,dG:()=>s,zS:()=>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().toUpperCase()}}`}function s(){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)),f=n(68773),m=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 m.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||f.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:m.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),f=n(71612),m=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),U=n(73615),D=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,U.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=D.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,U.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,U.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,U.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 ft=pt;var mt=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,mt.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,U.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,mt.bA)(u,i,r,0,1),(0,mt.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:ft,"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.DO)(),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 Ut(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 Dt(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),f=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},f={xmin:l,ymin:i,xmax:0,ymax:o},m=[],y=[];Ht(t,a)&&m.push(h),Ht(t,f)&&y.push(h),Ht(e,a)&&m.push(p),Ht(e,f)&&y.push(p);for(let t=h+1;t<p;t++)m.push(t),y.push(t);n.push(new Vt(t,[h]),new Vt(e,[p]),new Vt(a,m),new Vt(f,y))}else u>d||f?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,U.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 Ut(o,s,a);if((0,At.aW)(o))return o.points=o.points.map((t=>Ut(t,s,a))),o;if((0,At.YX)(o))return function(t,e){if(!e)return t;const n=Dt(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:D.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,U.initializeProjection)(t.spatialReference,this.spatialReference,null,e);const n=(0,Lt.fS)(t.spatialReference,this.spatialReference)?t:(0,U.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,f.h)((0,y.M)((0,m.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}}]);