@arcgis/core 4.28.0-next.20230912 → 4.28.0-next.20230913

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 (47) hide show
  1. package/arcade/featureset/support/errorsupport.js +1 -1
  2. package/arcade.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{aa78ca83a4b582b6c2b6.js → 6d94b358e8d1cf79bba3.js} +1 -1
  5. package/assets/esri/core/workers/chunks/8aa7e994b74f66522c37.js +1 -0
  6. package/assets/esri/core/workers/chunks/a047fcf3c7307a69b63c.js +1 -0
  7. package/assets/esri/core/workers/chunks/c51233ad51823cb98c35.js +1 -0
  8. package/assets/esri/core/workers/chunks/dbf343d1fb746f99bb6e.js +1 -0
  9. package/assets/esri/core/workers/chunks/{271ec1d1666bf6dc3dda.js → dc74b4ec85e8e3de5b27.js} +1 -1
  10. package/assets/esri/themes/base/widgets/_Sketch.scss +0 -5
  11. package/assets/esri/themes/base/widgets/_SketchTooltipControls.scss +0 -5
  12. package/assets/esri/themes/dark/main.css +1 -1
  13. package/assets/esri/themes/light/main.css +1 -1
  14. package/assets/esri/themes/light/view.css +1 -1
  15. package/core/promiseUtils.js +1 -1
  16. package/core/sql/DateOnly.js +1 -1
  17. package/core/sql/TimeOnly.js +1 -1
  18. package/interfaces.d.ts +190 -144
  19. package/layers/SceneLayer.js +1 -1
  20. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  21. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  22. package/layers/support/TilemapCache.js +1 -1
  23. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  24. package/layers/video/VideoController.js +1 -1
  25. package/package.json +1 -1
  26. package/support/revision.js +1 -1
  27. package/views/2d/engine/webgl/DisplayId.js +1 -1
  28. package/views/2d/engine/webgl/Utils.js +1 -1
  29. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  30. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  31. package/views/3d/analysis/Dimension/LengthDimensionVisualization.js +1 -1
  32. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  33. package/views/3d/analysis/Dimension/settings.js +1 -1
  34. package/views/3d/interactive/editingTools/originGraphicVisualElementUtils.js +1 -1
  35. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  36. package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
  37. package/views/animation/easing.js +1 -1
  38. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  39. package/widgets/Feature/FeatureMedia.js +1 -1
  40. package/widgets/Features.js +1 -1
  41. package/widgets/support/SketchTooltipControls/SketchTooltipControlsViewModel.js +1 -1
  42. package/widgets/support/SketchTooltipControls.js +1 -1
  43. package/widgets/support/SnappingControls.js +1 -1
  44. package/assets/esri/core/workers/chunks/15056f91d87f11b00bcc.js +0 -1
  45. package/assets/esri/core/workers/chunks/877302d6e39a0d530aab.js +0 -1
  46. package/assets/esri/core/workers/chunks/aedb1f944b332b098933.js +0 -1
  47. package/assets/esri/core/workers/chunks/c8dd21a332559c99815c.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5913],{16306:(e,t,i)=>{i.d(t,{aX:()=>S});var n=i(68773),s=i(20102),r=i(92604),a=i(38913),o=i(58901),l=i(73913),c=i(8744),u=i(40488),h=(i(66577),i(3172)),f=i(33955),d=i(11282),p=i(17452);async function m(e,t,i){const n="string"==typeof e?(0,p.mN)(e):e,s=t[0].spatialReference,r=(0,f.Ji)(t[0]),a={...i,query:{...n.query,f:"json",sr:s.wkid??JSON.stringify(s),geometries:JSON.stringify((l=t,{geometryType:(0,f.Ji)(l[0]),geometries:l.map((e=>e.toJSON()))}))}},{data:o}=await(0,h.Z)(n.path+"/simplify",a);var l;return function(e,t,i){const n=(0,f.q9)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=i,t}))}(o.geometries,r,s)}const y=r.Z.getLogger("esri.geometry.support.normalizeUtils");function g(e){return"polygon"===e[0].type}function x(e){return"polyline"===e[0].type}function w(e,t,i){if(t){const t=function(e,t){if(!(e instanceof o.Z||e instanceof a.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw y.error(e),new s.Z(e)}const i=(0,l.x3)(e),n=[];for(const e of i){const i=[];n.push(i),i.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const s=e[n][0],r=e[n][1],a=e[n+1][0],o=e[n+1][1],l=Math.sqrt((a-s)*(a-s)+(o-r)*(o-r)),c=(o-r)/l,u=(a-s)/l,h=l/t;if(h>1){for(let e=1;e<=h-1;e++){const n=e*t,a=u*n+s,o=c*n+r;i.push([a,o])}const e=(l+Math.floor(h-1)*t)/2,n=u*e+s,a=c*e+r;i.push([n,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new a.Z({rings:n,spatialReference:e.spatialReference}):new o.Z({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,u.Sx)(t,!0)}return i&&(e=(0,l.Sy)(e,i)),e}function b(e,t,i){if(Array.isArray(e)){const n=e[0];if(n>t){const i=(0,l.XZ)(n,t);e[0]=n+i*(-2*t)}else if(n<i){const t=(0,l.XZ)(n,i);e[0]=n+t*(-2*i)}}else{const n=e.x;if(n>t){const i=(0,l.XZ)(n,t);e=e.clone().offset(i*(-2*t),0)}else if(n<i){const t=(0,l.XZ)(n,i);e=e.clone().offset(t*(-2*i),0)}}return e}function I(e,t){let i=-1;for(let n=0;n<t.cutIndexes.length;n++){const s=t.cutIndexes[n],r=t.geometries[n],a=(0,l.x3)(r);for(let e=0;e<a.length;e++){const t=a[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const n=t[e][0];i=n>i?n:i}i=Number(i.toFixed(9));const n=-360*(0,l.XZ)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(n,0))}return!0}}))}if(s===i){if(g(e))for(const t of(0,l.x3)(r))e[s]=e[s].addRing(t);else if(x(e))for(const t of(0,l.x3)(r))e[s]=e[s].addPath(t)}else i=s,e[s]=r}return e}async function S(e,t,i){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&y.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??n.default.geometryServiceUrl;let r,p,g,x,_,R,v,T,C=0;const k=[],F=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,p=(0,c.C5)(r),g=r.isWebMercator,R=g?102100:4326,x=l.UZ[R].maxX,_=l.UZ[R].minX,v=l.UZ[R].plus180Line,T=l.UZ[R].minus180Line),p)if("mesh"===t.type)F.push(t);else if("point"===t.type)F.push(b(t.clone(),x,_));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>b(e,x,_))),F.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,p);F.push(e.rings?new a.Z(e):e)}else if(t.extent){const e=t.extent,i=(0,l.XZ)(e.xmin,_)*(2*x);let n=0===i?t.clone():(0,l.Sy)(t.clone(),i);e.offset(i,0),e.intersects(v)&&e.xmax!==x?(C=e.xmax>C?e.xmax:C,n=w(n,g),k.push(n),F.push("cut")):e.intersects(T)&&e.xmin!==_?(C=e.xmax*(2*x)>C?e.xmax*(2*x):C,n=w(n,g,360),k.push(n),F.push("cut")):F.push(n)}else F.push(t.clone());else F.push(t);else F.push(t);let M=(0,l.XZ)(C,x),P=-90;const O=M,Z=new o.Z;for(;M>0;){const e=360*M-180;Z.addPath([[e,P],[e,-1*P]]),P*=-1,M--}if(k.length>0&&O>0){const t=I(k,await async function(e,t,i,n){const s=(0,d.en)(e),r=t[0].spatialReference,a={...n,query:{...s.query,f:"json",sr:JSON.stringify(r),target:JSON.stringify({geometryType:(0,f.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,h.Z)(s.path+"/cut",a),{cutIndexes:l,geometries:c=[]}=o.data;return{cutIndexes:l,geometries:c.map((e=>{const t=(0,f.im)(e);return t.spatialReference=r,t}))}}(s,k,Z,i)),n=[],r=[];for(let i=0;i<F.length;i++){const s=F[i];if("cut"!==s)r.push(s);else{const s=t.shift(),a=e[i];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&s.rings.length>=a.rings.length?(n.push(s),r.push("simplify")):r.push(g?(0,u.$)(s):s)}}if(!n.length)return r;const a=await m(s,n,i),o=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?o.push(t):o.push(g?(0,u.$)(a.shift()):a.shift())}return o}const D=[];for(let e=0;e<F.length;e++){const t=F[e];if("cut"!==t)D.push(t);else{const e=k.shift();D.push(!0===g?(0,u.$)(e):e)}}return D}},73913:(e,t,i)=>{i.d(t,{Sy:()=>l,UZ:()=>a,XZ:()=>o,x3:()=>c});var n=i(58901),s=i(82971),r=i(33955);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.Z.WebMercator}),minus180Line:new n.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.Z({paths:[[[180,-180],[180,180]]],spatialReference:s.Z.WGS84}),minus180Line:new n.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:s.Z.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=c(e);for(const e of i)for(const i of e)i[0]+=t;return e}function c(e){return(0,r.oU)(e)?e.rings:e.paths}},74878:(e,t,i)=>{i.r(t),i.d(t,{default:()=>ft});var n=i(43697),s=i(51773),r=i(2368),a=i(20102),o=i(92604),l=i(16453),c=i(95330),u=i(17445),h=i(5600),f=i(75215),d=i(67676),p=i(80442),m=i(36030),y=i(52011),g=i(87085),x=i(17287),w=i(71612),b=i(17017),I=(i(66577),i(30030)),S=i(3172),_=i(71715),R=i(8744),v=i(66677),T=i(21506),C=i(35956),k=i(29876),F=i(45663),M=i(88281),P=i(11145),O=i(96674),Z=i(609),D=i(39450),B=i(36679),J=i(99815),N=i(73506),z=i(94139);const A=new Map,E=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,n=this._cachedBlocks;if(n.has(i)){const e=n.get(i);return e.refCount--,e.refCount<=0&&(n.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,n=this._cachedBlocks;if(n.has(i)){const e=n.get(i);return e.ts=Date.now(),e.refCount++,n.delete(i),n.set(i,e),e.block}return null}putBlock(e,t,i,n){const s=this._cachedBlocks,r=e+"/"+t;if(s.has(r)){const e=s.get(r);e.ts=Date.now(),e.refCount++}else s.set(r,{block:i,ts:Date.now(),refCount:1,controller:n});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,n=e+"/"+t;i.has(n)&&i.delete(n)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let n=0;n<t.length&&t[n][1].ts<=i-this._duration;n++)e.delete(t[n][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function H(e,t){return null==t?e:`${e}?sliceId=${t}`}function L(e,t,i){const n=A.get(e);if(!n)return null==t?E.decreaseRefCount(e,i):0;if(null==t||null==n[t])return E.decreaseRefCount(e,i);const s=n[t]?.cache,r=s?.get(i);if(s&&r){if(r.refCount--,0===r.refCount){s.delete(i);for(let e=0;e<n.length;e++)n[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function W(e,t,i){const n=A.get(e);if(!n)return null==t?E.getBlock(e,i):null;if(null==t||null==n[t]){for(let e=0;e<n.length;e++){const t=n[e]?.cache.get(i);if(t)return t.refCount++,t.block}return E.getBlock(e,i)}const s=n[t]?.cache.get(i);if(s)return s.refCount++,s.block;for(let e=0;e<n.length;e++){if(e===t||!n[e])continue;const s=n[e]?.cache,r=s?.get(i);if(s&&r)return r.refCount++,s.set(i,r),r.block}return null}function q(e,t,i,n,s=null){const r=A.get(e);if(!r)return void(null==t&&E.putBlock(e,i,n,s));if(null==t||null==r[t])return void E.putBlock(e,i,n,s);const a={refCount:1,block:n,isResolved:!1,isRejected:!1,controller:s};n.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),r[t]?.cache.set(i,a)}function j(e,t,i){const n=A.get(e);n?null!=t&&null!=n[t]?n[t]?.cache.delete(i):E.deleteBlock(e,i):null==t&&E.deleteBlock(e,i)}var G=i(81578),U=i(75993),V=i(55914),$=i(80676),X=i(6570);let Y=class extends((0,Z.v)(O.wq)){constructor(){super(...arguments),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,N.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:P.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,N.ut)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),"Function"===this.datasetFormat&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}set url(e){this._set("url",(0,v.Nm)(e,o.Z.getLogger(this)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,i,n={}){const s=n.tileInfo||this.rasterInfo.storageInfo.tileInfo,r=this.getTileExtentFromTileInfo(e,t,i,s);return this.fetchPixels(r,s.size[0],s.size[1],n)}async identify(e,t={}){e=(0,f.TJ)(z.Z,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:n}=t,{rasterInfo:s}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:a}=s;let{transposedVariableName:o}=t;const l=null!=a&&r&&(null!=n||(0,J.WU)(i));l&&!o&&(o=null!=i&&i.length>0?i[0].variableName??void 0:a.variables[0].name,t={...t,transposedVariableName:o}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=s,{datumTransformation:h}=t;let d=(0,N.nF)(e,c,h);if(!u.intersects(d))return{location:d,value:null};if(null!=s.transform){const e=s.transform.inverseTransform(d);if(!s.nativeExtent.intersects(e))return{location:e,value:null};d=e}let p=0;const m=null!=o&&null!=a&&s.hasMultidimensionalTranspose;if("Function"===this.datasetFormat){const e=this.primaryRasters.rasters[0];if(m)return e.identify(d,t);const{pixelSize:i}=s,n=3,r=i.x*n/2,a=i.y*n/2,o=new X.Z({xmin:d.x-r,xmax:d.x+r,ymin:d.y-a,ymax:d.y+a,spatialReference:c}),l={interpolation:"nearest"},{pixelBlock:u}=await e.fetchPixels(o,n,n,l),{pixelBlock:h}=await this.fetchPixels(o,n,n,l);if(null==u)return{location:d,value:null};const f=Math.floor(n*n*.5),p=!u.mask||u.mask[f]?u.pixels.map((e=>e[f])):null;let y;return null!=h&&(y=!h.mask||h.mask[f]?h.pixels.map((e=>e[f])):void 0),{location:d,value:p,processedValue:y,pyramidLevel:0}}if(!m)if(t.srcResolution)p=(0,N.kr)(t.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(p=await this.computeBestPyramidLevelForLocation(e,t),null==p)return{location:d,value:null};const y=this.identifyPixelLocation(d,p,null,m);if(null===y)return{location:d,value:null};const{row:g,col:x,rowOffset:w,colOffset:b,blockWidth:I}=y,S=o??t.sliceId,_=H(this.url,S),R=`${p}/${g}/${x}`;let v=W(_,null,R);null==v&&(v=this.fetchRawTile(p,g,x,t),q(_,null,R,v));const T=await v;if(null==T||!T.pixels?.length)return{location:d,value:null};const C=w*I+b;return this._processIdentifyResult(T,{srcLocation:d,position:C,pyramidLevel:p,useTransposedTile:!!m,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,i,n={}){e=(0,N.Fi)(e),n=this._getRequestOptionsWithSliceId(n);const{_hasNoneOrGCSShiftTransform:s}=this;if(n.requestRawData&&s)return this._fetchPixels(e,t,i,n);const r=(0,N.ut)(e.spatialReference),a=(0,N.Hq)(e);if(null==r||0===a||1===a&&this._isGlobalWrappableSource&&s)return this._fetchPixels(e,t,i,n);if(a>=3)return{extent:e,pixelBlock:null};const o=[],{xmin:l,xmax:c}=e,u=Math.round(r/(c-l)*t),h=u-Math.round((r/2-l)/(c-l)*t);let f=0;const d=[];for(let s=0;s<=a;s++){const p=new X.Z({xmin:0===s?l:-r/2,xmax:s===a?c-r*s:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===s?u-h:s===a?t-f:u;f+=m,d.push(m);const y=n.disableWrapAround&&s>0?null:this._fetchPixels(p,m,i,n);o.push(y)}const p=(await Promise.all(o)).map((e=>e?.pixelBlock));let m=null;const y={width:t,height:i};return m=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},n)).pixelBlock:(0,V.us)(p,y,{blockWidths:d}),{extent:e,srcExtent:(0,N.tB)(e,this.rasterInfo.spatialReference,n.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,i,n={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const s=await this._fetchRawTiles(e,t,i,n),{nativeExtent:r,nativePixelSize:a,storageInfo:o}=this.rasterInfo,l=2**e,c=a.x*l,u=a.y*l,h=new X.Z({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!s)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:f,mosaicSize:d}=s;if(1===f.length&&null!=f[0]&&f[0].width===i.width&&f[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:s.pixelBlocks[0]};const p=e>0?o.pyramidBlockWidth:o.blockWidth,m=e>0?o.pyramidBlockHeight:o.blockHeight,y={x:t.x%p,y:t.y%m};let g;return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:d,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:n.interpolation,alignmentInfo:null,blockWidths:null},n)).pixelBlock:(0,V.us)(f,d,{clipOffset:y,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:g}}fetchRawTile(e,t,i,n){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,N.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,U.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:n}=this.ioConfig,{range:s,query:r,headers:a}=t;i=i??t.retryCount??this.ioConfig.retryCount;const o=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await(0,S.Z)(e,{...t,query:{...r,...n},headers:{...a,...o}})}catch(n){if(i>0)return i--,this.request(e,t,i);throw n}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,J.gk)(e,t)}getTileExtentFromTileInfo(e,t,i,n){const s=n.lodAt(e);return this.getTileExtent({x:s.resolution,y:s.resolution},t,i,n.origin,n.spatialReference,n.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:n}=this.rasterInfo;if(!e.tileInfo){const s=[],r=e.maximumPyramidLevel||0;let a=Math.max(n.x,n.y),o=1/.0254*96*a;for(let e=0;e<=r;e++)s.unshift(new D.Z({level:r-e,resolution:a,scale:o})),a*=2,o*=2;const l=new z.Z({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new P.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:s}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,n){const{width:s,height:r,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new z.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==n&&(n=Math.max(0,Math.round(Math.log(Math.max(s,r))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],n);e.storageInfo=new B.Z({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:n,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,n,s,r=0,a=2){if(1===s.length&&r>0){s=[...s];let{x:e,y:t}=s[0];for(let i=0;i<r;i++)e*=a,t*=a,s.push({x:e,y:t})}const o=[],{x:l,y:c}=n;for(let n=0;n<s.length;n++){const{x:r,y:a}=s[n];o.push({minCol:Math.floor((e.xmin-l+.1*r)/t/r),maxCol:Math.floor((e.xmax-l-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*a)/i/a),maxRow:Math.floor((c-e.ymin-.1*a)/i/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:n}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const s=n**e;return{x:t.x*s,y:t.y*s}}identifyPixelLocation(e,t,i,n){const{spatialReference:s,nativeExtent:r,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:o,origin:l,transposeInfo:c}=a,u=n&&null!=c?c.tileSize[0]:a.blockWidth,h=n&&null!=c?c.tileSize[1]:a.blockHeight,f=(0,N.nF)(e,s,i);if(!r.intersects(f))return null;if(t<0||t>o)return null;const d=this.getPyramidPixelSize(t),{x:p,y:m}=d,y=(l.y-f.y)/m/h,g=(f.x-l.x)/p/u,x=Math.min(h-1,Math.floor((y-Math.floor(y))*h)),w=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(g),rowOffset:x,colOffset:w,blockWidth:u,srcLocation:f}}getTileExtent(e,t,i,n,s,r){const[a,o]=r,l=n.x+i*a*e.x,c=l+a*e.x,u=n.y-t*o*e.y,h=u-o*e.y;return new X.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:s})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const n=this.rasterInfo.storageInfo.blockBoundary[e];return!n||n.maxRow<t||n.maxCol<i||n.minRow>t||n.minCol>i}async _fetchPixels(e,t,i,n={}){let s=(0,N.Hq)(e);if(s>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,n),{pyramidLevel:a,srcResolution:o,srcExtent:l,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:l,pixelBlock:null};const{rasterInfo:f}=this,d=f.transform,p="gcs-shift"===d?.type,m=null!=(0,N.ut)(e.spatialReference);!p&&m||(s=(0,N.Hq)(r.srcExtent,p));const y=await this._fetchRawTiles(a,h,{width:c,height:u,wrapCount:s},n);if(!y)return{extent:e,srcExtent:l,pixelBlock:null};const g=f.storageInfo,x=a>0?g.pyramidBlockWidth:g.blockWidth,w=a>0?g.pyramidBlockHeight:g.blockHeight;let{x:b,y:I}=f.pixelSize;if(a>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=g;if(null!=e&&e[a-1])({x:b,y:I}=e[a-1]);else{const e=t**a;b*=e,I*=e}}const S=f.spatialReference,_=new z.Z({x:b,y:I,spatialReference:S}),R=x===c&&w===u&&h.x%x==0&&h.y%w==0,v=new z.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(S),C=S.isGeographic?1e-9:1e-4,{datumTransformation:k}=n;if(!T&&R&&1===y.pixelBlocks.length&&x===t&&w===i&&this._isSameResolution(o,v,C))return{extent:e,srcExtent:l,srcTilePixelSize:_,pixelBlock:y.pixelBlocks[0]};const F=m&&null!=(0,N.ut)(l.spatialReference)&&this._hasNoneOrGCSShiftTransform,M=n.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");M&&!this.rasterJobHandler&&await(0,N.zD)();const P=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:v.toJSON(),datumTransformation:k,rasterTransform:d,hasWrapAround:s>0||F,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:M},n):(0,N.Qp)({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:v,datumTransformation:k,rasterTransform:d,hasWrapAround:s>0||F,isAdaptive:!1,includeGCSGrid:M});let O;const Z=!n.requestRawData,D={rows:P.spacing[0],cols:P.spacing[1]},B=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(a,y.extent.xmin):void 0,{pixelBlocks:J,mosaicSize:A,isPartiallyFilled:E}=y;let H=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:J,srcMosaicSize:A,destDimension:Z?{width:t,height:i}:null,coefs:Z?P.coefficients:null,sampleSpacing:Z?D:null,projectDirections:M,gcsGrid:M?P.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:n.interpolation,alignmentInfo:B,blockWidths:null},n);({pixelBlock:O,localNorthDirections:H}=e)}else{const e=(0,V.us)(J,A,{alignmentInfo:B});O=Z?(0,V.Uk)(e,{width:t,height:i},P.coefficients,D,n.interpolation):e,M&&P.gcsGrid&&(H=(0,V.Qh)({width:t,height:i},P.gcsGrid),O=(0,$.xQ)(O,this.rasterInfo.dataType,H))}return n.requestRawData||M?{extent:e,srcExtent:l,srcTilePixelSize:_,pixelBlock:O,transformGrid:P,localNorthDirections:H,isPartiallyFilled:E}:{extent:e,srcExtent:l,srcTilePixelSize:_,pixelBlock:O}}async _fetchRawTiles(e,t,i,n){const{origin:s,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:o}=this.getBlockWidthHeight(e);let{x:l,y:c}=t,{width:u,height:h,wrapCount:f}=i;const d=this._getRasterTileAlignmentInfo(e,0);n.buffer&&(l-=n.buffer.cols,c-=n.buffer.rows,u+=2*n.buffer.cols,h+=2*n.buffer.rows);let p=0,m=0,y=0;f&&null!=d&&(({worldColumnCountFromOrigin:m,originColumnOffset:y,rightPadding:p}=d),m*d.blockWidth-p>=l+u&&(p=0));const g=Math.floor(l/a),x=Math.floor(c/o),w=Math.floor((l+u+p-1)/a),b=Math.floor((c+h+p-1)/o),I=r[e];if(!I)return null;const{minRow:S,minCol:_,maxCol:R,maxRow:v}=I;if(0===f&&(b<S||w<_||x>v||g>R))return null;const T=new Array;let C=!1;const k=null==this.ioConfig.allowPartialFill?n.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=x;t<=b;t++)for(let i=g;i<=w;i++){let s=i;if(!n.disableWrapAround&&f&&null!=d&&m<=i&&(s=i-m-y),t>=S&&s>=_&&v>=t&&R>=s){const i=this._fetchRawTile(e,t,s,n);k?T.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{C=!0,e(null)}))}))):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;const F=await Promise.all(T),M={height:(b-x+1)*o,width:(w-g+1)*a},{spatialReference:P}=this.rasterInfo,O=this.getPyramidPixelSize(e),{x:Z,y:D}=O;return{extent:new X.Z({xmin:s.x+g*a*Z,xmax:s.x+(w+1)*a*Z,ymin:s.y-(b+1)*o*D,ymax:s.y-x*o*D,spatialReference:P}),pixelBlocks:F,mosaicSize:M,isPartiallyFilled:C}}_isSameResolution(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}_fetchRawTile(e,t,i,n){const s=this.rasterInfo.storageInfo.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:r,minCol:a,maxCol:o,maxRow:l}=s;if(t<r||i<a||t>l||i>o)return Promise.resolve(null);const u=H(this.url,n.sliceId),h=`${e}/${t}/${i}`;let f=W(u,n.registryId,h);if(null==f){const s=new AbortController;f=this.fetchRawTile(e,t,i,{...n,signal:s.signal}),q(u,n.registryId,h,f,s),f.catch((()=>j(u,n.registryId,h)))}return n.signal&&(0,c.fu)(n,(()=>{L(u,n.registryId,h)})),f}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const n=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[s,r]=e,a=[],o=[];for(let e=0;e<n;e++){const[t,i]=(0,$.Tg)([s[e],r[e]]);a.push(t),o.push(i)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,N.P_)(this.rasterInfo)),null==this._rasterTileAlighmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,n={}){const s={datumTransformation:n.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};n.srcResolution&&(s.srcResolution=n.srcResolution,this._updateSourceDataInfo(e,s));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=s,c=a/t,u=o/i,h=l<r&&c*u>=16,f=l===r&&this._requireTooManySrcTiles(a,o,t,i);if(h||f||0===a||0===o){const a=new z.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let o=(0,N.VO)(a,this.rasterInfo.spatialReference,e,s.datumTransformation);const f=!o||n.srcResolution&&o.x+o.y<n.srcResolution.x+n.srcResolution.y;if(h&&n.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-l+3>=e){const t=2**e;o={x:n.srcResolution.x*t,y:n.srcResolution.y*t}}}o&&(s.srcResolution=o,this._updateSourceDataInfo(e,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,t,i)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(e,t,i,n){const{tileInfo:s}=this.rasterInfo.storageInfo;return Math.ceil(e/s.size[0])*Math.ceil(t/s.size[1])>=256||e/i>8||t/n>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,n=i.spatialReference,{srcResolution:s,datumTransformation:r}=t,{pyramidLevel:a,pyramidResolution:o,excessiveReading:l}=(0,N.kr)(s,i,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,N.tB)(e,n,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:f}=i.storageInfo.origin,d=Math.floor((c.xmin-h)/o.x+.1),p=Math.floor((f-c.ymax)/o.y+.1),m=Math.floor((c.xmax-h)/o.x-.1),y=Math.floor((f-c.ymin)/o.y-.1),g=c.width<.1*o.x?0:m-d+1,x=c.height<.1*o.y?0:y-p+1;t.pyramidLevel=a,t.pyramidResolution=o,t.srcWidth=g,t.srcHeight=x,t.ul={x:d,y:p}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:n,pyramidLevel:s,useTransposedTile:r}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[n])return{location:i,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(null==o||!r){const t=e.pixels.map((e=>e[n])),r={location:i,value:t,pyramidLevel:s},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(r.magdirValue=a.map((e=>e[0]))),r}let l=e.pixels.map((e=>e.slice(n*a,n*a+a))),c=this._computeMagDirValues(l);const{requestSomeSlices:u,identifyOptions:h}=t;let f=(0,J.MO)(o,h.transposedVariableName);if(u){const e=(0,J.Ur)(f,h.multidimensionalDefinition,h.timeExtent);l=l.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),f=e.map((e=>f[e]))}const d=e.noDataValues||this.rasterInfo.noDataValue,p={pixels:l,pixelType:e.pixelType};let m;return null!=d&&((0,G.A)(p,d),m=p.mask),{location:i,value:null,dataSeries:f.map(((e,t)=>{const i={value:0===m?.[t]?null:l.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new C.Z({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:s}}};(0,n._)([(0,h.Cb)()],Y.prototype,"_rasterTileAlighmentInfo",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"_isGlobalWrappableSource",null),(0,n._)([(0,h.Cb)({readOnly:!0})],Y.prototype,"_hasNoneOrGCSShiftTransform",null),(0,n._)([(0,h.Cb)()],Y.prototype,"rasterJobHandler",null),(0,n._)([(0,h.Cb)(T.HQ)],Y.prototype,"url",null),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Y.prototype,"datasetName",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Y.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"hasUniqueSourceStorageInfo",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"rasterInfo",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"ioConfig",void 0),(0,n._)([(0,h.Cb)()],Y.prototype,"sourceJSON",void 0),Y=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.BaseRaster")],Y);const K=Y;var Q=i(74889);let ee=class extends K{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null}async open(e){await this.init();const{rasterFunction:t}=this;this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:n}=this.primaryRasters,s=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(s);const r=i.map((({rasterInfo:e})=>e)),o=t.bind({rasterInfos:r,rasterIds:n});if(!o.success||0===r.length)throw new a.Z("raster-function:open",`cannot bind the function: ${o.error??""}`);const l="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===l?.functionName&&(t.rasterInfo.attributeTable=Q.Z.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=r[0];this.hasUniqueSourceStorageInfo=1===r.length||r.slice(1).every((e=>this._hasSameStorageInfo(e,c))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo)}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async fetchPixels(e,t,i,n={}){const{rasters:s,rasterIds:r}=this.primaryRasters;let a=!1;const{interpolation:o}=n,l=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!n.requestRawData&&"bilinear"!==o&&l&&(a=1===s.length&&!n.skipRasterFunction,n={...n,interpolation:"bilinear",requestRawData:a});const c=s.map((s=>s.fetchPixels(e,t,i,n))),u=await Promise.all(c),h=u.map((e=>e.pixelBlock)),f=a||n.requestRawData?u.map((e=>e.srcTilePixelSize)):null;if(n.skipRasterFunction||h.every((e=>null==e)))return u[0];const d=u.find((e=>null!=e.pixelBlock))?.extent??e,p=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:r}),{transformGrid:m}=u[0];if(!a||null==p||null==m)return{...u[0],pixelBlock:p};const y={rows:m.spacing[0],cols:m.spacing[1]};let g;return g=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[p],srcMosaicSize:{width:p.width,height:p.height},destDimension:{width:t,height:i},coefs:m.coefficients,sampleSpacing:y,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:o,alignmentInfo:void 0,blockWidths:null},n)).pixelBlock:(0,V.Uk)(p,{width:t,height:i},m.coefficients,y,o),{extent:e,srcExtent:u[0].srcExtent,pixelBlock:g}}_hasSameStorageInfo(e,t){const{storageInfo:i,pixelSize:n,spatialReference:s,extent:r}=e,{storageInfo:a,pixelSize:o,spatialReference:l,extent:c}=t;return n.x===o.x&&n.y===o.y&&s.equals(l)&&r.equals(c)&&i.blockHeight===a.blockHeight&&i.blockWidth===a.blockWidth&&i.maximumPyramidLevel===a.maximumPyramidLevel}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],ee.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],ee.prototype,"tileType",void 0),(0,n._)([(0,h.Cb)()],ee.prototype,"rasterFunction",void 0),(0,n._)([(0,h.Cb)()],ee.prototype,"primaryRasters",void 0),ee=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.FunctionRaster")],ee);const te=ee;var ie=i(67900),ne=i(5847);var se=i(5154),re=i(15612),ae=i(67058),oe=i(72758),le=i(79681),ce=i(23808),ue=i(82971);const he=o.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),fe=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalSubset=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster="Function"===e[0]?.raster?.datasetFormat}get fullExtent(){return this.rasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,v.Nm)(e,he))}set renderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("renderer",e),this.updateRenderer())}readRenderer(e,t,i){const n=t?.layerDefinition?.drawingInfo?.renderer;return(0,I.ij)(n,i)||void 0}async convertVectorFieldData(e,t){if(null==e||!this.rasterInfo)return null;const i=this._rasterJobHandler.instance,n=this.rasterInfo.dataType;return i?i.convertVectorFieldData({pixelBlock:e,dataType:n},t):(0,$.KC)(e,n)}async computeStatisticsHistograms(e,t){e=(0,f.TJ)(le.Z,e).clone();const{rasterInfo:n}=this,{geometry:s}=e;if(null==s)throw new a.Z("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let r=s;const{spatialReference:o}=n;s.spatialReference.equals(o)||(await(0,N.zD)(),r="extent"===s.type?(0,N.tB)(s,o):(0,N.Wt)(s,o));const l=e.pixelSize??new z.Z({x:n.pixelSize.x,y:n.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=function(e,t,i,n=!0){const{spatialReference:s}=e,{x:r,y:a}=function(e,t){if(e.spatialReference.equals(t))return e;const i=(0,ie.c9)(e.spatialReference),n=(0,ie.c9)(t);if(i===n)return e;const s=i/n;return{x:e.x*s,y:e.y*s}}(i,s);let o,l,c;const u="extent"===t.type?t:t.extent;let{xmin:h,xmax:f,ymax:d,ymin:p}=u;const{xmin:m,ymax:y}=e.extent;return n?(h=m+(h>m?r*Math.round((h-m)/r):0),d=y-(d<y?a*Math.round((y-d)/a):0),f=m+(f>m?r*Math.round((f-m)/r):0),p=y-(p<y?a*Math.round((y-p)/a):0),o=new X.Z({xmin:h,ymax:d,xmax:f,ymin:p,spatialReference:s}),l=Math.round(o.width/r),c=Math.round(o.height/a)):(l=Math.floor((f-h)/r+.8),c=Math.floor((d-p)/a+.8),h=m+(h>m?r*Math.floor((h-m)/r+.1):0),d=y-(d<y?a*Math.floor((y-d)/a+.1):0),f=h+l*r,p=d-c*a,o=new X.Z({xmin:h,ymax:d,xmax:f,ymin:p,spatialReference:s})),{extent:o,width:l,height:c}}(n,r,l),d=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new a.Z("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const p=await async function(e,t,n){if("extent"===n.type)return function(e,t,i){const{width:n,height:s}=e,r=new Uint8Array(n*s),a=t.width/n,o=t.height/s;if(i.width/a<.5||i.height/o<.5)return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]});const{xmin:l,xmax:c,ymin:u,ymax:h}=t,{xmin:f,xmax:d,ymin:p,ymax:m}=i,y=Math.max(l,f),g=Math.min(c,d),x=Math.max(u,p),w=Math.min(h,m),b=.5*a,I=.5*o;if(g-y<b||w-x<I||g<l+b||y>c-b||x>h-I||w<u+I)return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]});const S=Math.max(0,(y-l)/a),_=Math.min(n,Math.max(0,(g-l)/a)),R=Math.max(0,(h-w)/o),v=Math.min(s,Math.max(0,(h-x)/o)),T=Math.round(S),C=Math.round(_)-1,k=Math.round(R),F=Math.round(v)-1;if(T===C&&S%1>.5&&_%1<.5||k===F&&R%1>.5&&v%1<.5)return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]});if(0===T&&0===k&&C===n&&F===s)return e;const M=e.mask;for(let e=k;e<=F;e++)for(let t=T;t<=C;t++){const i=e*n+t;r[i]=M?M[i]:255}return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]})}(e,t,n);const{width:s,height:r}=e,a=new Uint8Array(s*r),{contains:o,intersects:l}=await Promise.all([i.e(5837),i.e(1433)]).then(i.bind(i,61433));return l(t,n)?"polyline"===n.type?function(e,t,i){const{width:n,height:s}=e,r=new Uint8Array(n*s),a=t.width/n,o=t.height/s,{xmin:l,ymax:c}=t,{paths:u}=i,h=e.mask;for(let e=0;e<u.length;e++){const t=u[e];for(let e=0;e<t.length-1;e++){const[i,u]=t[e],[f,d]=t[e+1];let p=Math.floor((c-u)/o),m=Math.floor((c-d)/o);if(m<p){const e=p;p=m,m=e}p=Math.max(0,p),m=Math.min(s-1,m);const y=(f-i)/(d-u);for(let e=p;e<=m;e++){const t=e===p?Math.max(u,d):(s+1-e)*o,c=e===m?Math.min(u,d):t-o;let g=d===u?Math.floor((i-l)/a):Math.floor((y*(t-u)+i-l)/a),x=d===u?Math.floor((f-l)/a):Math.floor((y*(c-u)+i-l)/a);if(x<g){const e=g;g=x,x=e}const w=e*n;g=Math.max(0,g),x=Math.min(n-1,x);for(let e=w+g;e<=w+x;e++)r[e]=h?h[e]:255}}}return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:r,pixels:[...e.pixels]})}(e,t,n):o(n,t)?e:function(e,t,i){if(!e)return e;const{width:n,height:s}=e,r=t.width/n,a=t.height/s,{xmin:o,ymax:l}=t;let c;if("extent"===i.type){const e=(i.xmin-o)/r,t=(i.xmax-o)/r,n=(l-i.ymax)/a,s=(l-i.ymin)/a;c=[[[e,n],[e,s],[t,s],[t,n],[e,n]]]}else c=i.rings.map((e=>e.map((([e,t])=>[(e-o)/r,(l-t)/a]))));const u=document.createElement("canvas");u.width=n,u.height=s;const h=u.getContext("2d");h.fillStyle="#f00",c.forEach((e=>{h.beginPath(),h.moveTo(e[0][0],e[0][1]);for(let t=0;t<e.length;t++)h.lineTo(e[t][0],e[t][1]);h.closePath(),h.fill()}));const f=h.getImageData(0,0,n,s).data,d=e.mask,p=n*s,m=new Uint8Array(p);for(let e=0;e<p;e++)d&&!d[e]||(m[e]=f[4*e+3]>127?255:0);return new ne.Z({pixelType:e.pixelType,width:n,height:s,mask:m,maskIsAlpha:!1,pixels:[...e.pixels]})}(e,t,n):new ne.Z({pixelType:e.pixelType,width:s,height:r,mask:a,maskIsAlpha:!1,pixels:[...e.pixels]})}(d.pixelBlock,c,r),m=this._rasterJobHandler.instance;return m?m.computeStatisticsHistograms({pixelBlock:p},t):(0,re.js)(p)}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,ce.GE)(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo??{};if(null==t)return e;let i=e.multidimensionalDefinition||this.multidimensionalDefinition;null!=i&&i.length||(i=(0,J.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=e.timeExtent||this.timeExtent;if(null!=i&&null!=n&&(null!=n.start||null!=n.end)){i=i.map((e=>e.clone()));const s=t.variables.find((({name:e})=>e===i[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),r=i.find((({dimensionName:e})=>"StdTime"===e));if(!s||!r)return{...e,multidimensionalDefinition:null};const{start:a,end:o}=n,l=null==a?null:a.getTime(),c=null==o?null:o.getTime(),u=l??c,h=c??l;if(null!=s.values){const e=s.values.filter((e=>{if(Array.isArray(e)){if(u===h)return e[0]<=u&&e[1]>=u;const t=e[0]<=u&&e[1]>u||e[0]<h&&e[1]>=h,i=e[0]>=u&&e[1]<=h||e[0]<u&&e[1]>h;return t||i}return u===h?e===u:e>=u&&e<=h}));if(e.length){const t=e.sort(((e,t)=>{const i=Array.isArray(e)?e[0]:e,n=Array.isArray(e)?e[1]:e,s=Array.isArray(t)?t[0]:t,r=Array.isArray(t)?t[1]:t;return u===h?i-s:Math.abs(n-h)-Math.abs(r-h)}))[0];r.values=[t]}else i=null}else if(s.hasRegularIntervals&&s.extent){const[e,t]=s.extent;u>t||h<e?i=null:r.values=u===h?[u]:[Math.max(e,u),Math.min(t,h)]}}return null!=i&&(0,J.nb)(i,this.multidimensionalSubset)?{...e,multidimensionalDefinition:null}:{...e,multidimensionalDefinition:i}}async updateRasterFunction(){if(!this.loaded||"imagery-tile"!==this.type||!this.rasterFunction&&!this._cachedRasterFunctionJson||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;if(this._isConstructedFromFunctionRaster&&"Function"===this.raster.datasetFormat){const e=this.raster.rasterFunction.toJSON();return!this.rasterFunction&&e&&this._set("rasterFunction",F.Z.fromJSON(e)),void(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON())}let e,t=this.raster,i=!1;"Function"===t.datasetFormat?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:n}=this;if(n){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=(0,se.Ue)(n.functionDefinition?.toJSON()??n.toJSON(),i),r=new te({rasterFunction:s});r.rasterJobHandler=this._rasterJobHandler.instance,await r.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=r}else this.raster=t,this._cachedRasterFunctionJson=null,await t.when();if(this._cachedRendererJson=null,!i&&!n)return;const{bandIds:s}=this,{bandCount:r}=this.raster.rasterInfo,a=s?.length?s.some((e=>e>=r)):r>=3;s&&(a||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t||!this.renderer)return;const{rasterInfo:i}=this.raster,n=(0,J.WY)(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=n?.name,r=(0,ae.ol)({...this.renderer.toJSON(),variableName:s});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(r))return;const a=this._rasterJobHandler.instance;a&&(t.rasterInfo=(0,ae.FI)(i,s),t.rendererJSON=r,t.bind(),await a.updateSymbolizer(t),this._cachedRendererJson=r)}async applyRenderer(e,t){const i=e&&e.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;let n;await this.updateRenderer();const s=this._rasterJobHandler.instance,r=this.bandIds??[];return n=s?await s.symbolize({...e,simpleStretchParams:t,bandIds:r}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:r}),n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const n=(0,R.C5)(e);return P.Z.create({size:256,spatialReference:e,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,n={}){if(s(this),n.requestAsImageElement){const s=this.getTileUrl(e,t,i);return(0,S.Z)(s,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then((e=>e.data))}const{rasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition){const s=n.tileInfo||r.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,i,s),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,n)}async fetchPixels(e,t,i,n={}){return null!=this.rasterInfo.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,n))}async identify(e,t={}){const{raster:i,rasterInfo:n}=this;if(null!=n.multidimensionalInfo&&!(n.hasMultidimensionalTranspose&&((0,J.WU)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const s=this.multidimensionalSubset?.areaOfInterest;if(s&&!s.contains(e))throw new a.Z("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.rasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(e){const t=e??this.rasterInfo?.multidimensionalInfo;return(0,J.jj)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,J.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&"Function"===this.raster.datasetFormat&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new M.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((async()=>{s(this),this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,"Function"===this.raster.datasetFormat&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{})),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){if(null==this.interpolation){s(this);const{raster:e}=this,t=(0,ae.In)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){s(this);const{rasterInfo:t}=this.raster;!this.bandIds&&t.bandCount>1&&(this.bandIds=(0,ae.YD)(t));const i=(0,J.WY)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=i?.name;if(!this.renderer||"override"===e){const e=(0,ae.Ob)(t,{bandIds:this.bandIds,variableName:n}),i=t.statistics,s=i&&i.length>0?i[0]:null,r=s?.max??0,a=s?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===e.type&&(r>1e24||a<-1e24)&&(e.dynamicRangeAdjustment=!0,e.statistics=null,"none"===e.stretchType&&(e.stretchType="min-max")),this.renderer=e}const r=(0,ae.ol)({...this.renderer.toJSON(),variableName:n}),a=(0,ae.FI)(t,n);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=a):this.symbolizer=new oe.Z({rendererJSON:r,rasterInfo:a});const o=this.symbolizer.bind();if(o.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,ae.Ob)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.statistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else he.warn("imagery-tile-mixin",o.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}};function s(e){if(!e.raster||!e.rasterInfo)throw new a.Z("imagery-tile","no raster")}return(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_cachedRasterFunctionJson",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_compatibleFullExtent",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"bandIds",void 0),(0,n._)([(0,h.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,n._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,n._)([(0,h.Cb)()],t.prototype,"interpolation",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"ioConfig",void 0),(0,n._)([(0,h.Cb)({type:[C.Z],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,n._)([(0,h.Cb)({type:k.Z,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"raster",void 0),(0,n._)([(0,h.Cb)({type:F.Z,json:{name:"renderingRule",write:!0}})],t.prototype,"rasterFunction",null),(0,n._)([(0,h.Cb)()],t.prototype,"rasterInfo",void 0),(0,n._)([(0,h.Cb)()],t.prototype,"sourceJSON",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,type:ue.Z,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,n._)([(0,h.Cb)({type:P.Z})],t.prototype,"tileInfo",void 0),(0,n._)([(0,h.Cb)(T.HQ)],t.prototype,"url",null),(0,n._)([(0,h.Cb)({types:I.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:I.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,n._)([(0,_.r)("renderer")],t.prototype,"readRenderer",null),(0,n._)([(0,h.Cb)({clonable:!1})],t.prototype,"symbolizer",void 0),t=(0,n._)([(0,y.j)("esri.layers.ImageryTileMixin")],t),t};var de=i(38009),pe=i(16859),me=i(34760),ye=i(72965),ge=i(28294),xe=i(1231),we=i(69608),be=i(25972),Ie=i(20095);function Se(e){const t=e.fields,i=e.records,n=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",s=[{name:n,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),r=s.map((e=>e.name)),a=[];let o=0,l=0;return i.forEach((e=>{const t={};for(t[n]=o++,l=1;l<r.length;l++)t[r[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:s,features:a}}class _e{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const n=t.getUint32(4,!0),s=t.getUint16(8,!0),r=t.getUint16(10,!0),a={version:i,recordCount:n,headerByteCount:s,recordByteCount:r};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,Ie.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<n&&e.byteLength-o>r;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)i.push((0,Ie.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const n=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(n.substring(0,4),10),parseInt(n.substring(4,6),10)-1,parseInt(n.substring(6,8),10)))}o+=t.length})),c.push(i)):o+=r}}return{header:a,fields:l,records:c,recordSet:Se({fields:l,records:c})}}}var Re=i(87521);const ve=new Map;ve.set("int16","esriFieldTypeSmallInteger"),ve.set("int32","esriFieldTypeInteger"),ve.set("int64","esriFieldTypeInteger"),ve.set("float32","esriFieldTypeSingle"),ve.set("float64","esriFieldTypeDouble"),ve.set("text","esriFieldTypeString");let Te=class extends K{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:i,rasterInfo:n}=this._parseHeader(t);if("thematic"===n.dataType){const e=await this._fetchAuxiliaryInformation();n.attributeTable=e}this._set("storageInfo",i),this._set("rasterInfo",n),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,i,n={}){const{transposeInfo:s}=this.rasterInfo.storageInfo,{transposedVariableName:r}=n,a=!(!s||!r),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,i,n.multidimensionalDefinition,r),c=this._getIndexRecordFromBundle(t,i,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:n.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,c);if(0===f.recordSize)return null;const d=await this.request(l,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:n.signal});if(!d)return null;const[p,m]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:p,height:m,planes:null,pixelType:null,returnInterleaved:a})}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:i,colormap:n,blockWidth:s,blockHeight:r,firstPyramidLevel:a,maximumPyramidLevel:o}=e,l=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),c=e.histograms?.[0]?.counts?.length?e.histograms:null,u=e.extent.spatialReference,h=e.geodataXform?.spatialReference,f=new ue.Z(u?.wkid||u?.wkt?u:h);let d=new X.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const p=new z.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),m=Math.round((d.xmax-d.xmin)/p.x),y=Math.round((d.ymax-d.ymin)/p.y),g=this._parseTransform(e.geodataXform),x=g?d:null;g&&(d=g.forwardTransform(d),p.x=(d.xmax-d.xmin)/m,p.y=(d.ymax-d.ymin)/y);const w=e.properties??{},b=e.format.toLowerCase().replace("cache/",""),I=new z.Z(e.origin.x,e.origin.y,f);let S,_,R,v;if(n&&n.colors)for(S=[],_=0;_<n.colors.length;_++)R=n.colors[_],v=n.values?n.values[_]:_,S.push([v,255&R,R<<16>>>24,R<<8>>>24,R>>>24]);const T=e.LODInfos,C=[];for(_=0;_<T.levels.length;_++)C.push(new D.Z({level:T.levels[_],resolution:T.resolutions[_],scale:96/.0254*T.resolutions[_]}));const k=new P.Z({dpi:96,lods:C,format:b,origin:I,size:[s,r],spatialReference:f}),F={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},M=[{maxCol:Math.ceil(m/s)-1,maxRow:Math.ceil(y/r)-1,minCol:0,minRow:0}];let O=2;if(o>0)for(_=0;_<o;_++)M.push({maxCol:Math.ceil(m/O/s)-1,maxRow:Math.ceil(y/O/r)-1,minCol:0,minRow:0}),O*=2;const Z=e.mdInfo;let J=null;if(Z&&w._yxs){const e=w._yxs;J={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:F,rasterInfo:new be.Z({width:m,height:y,pixelType:t,bandCount:i,extent:d,nativeExtent:x,transform:g,spatialReference:f,pixelSize:p,keyProperties:w,statistics:l,histograms:c,multidimensionalInfo:Z,colormap:S,storageInfo:new B.Z({blockWidth:s,blockHeight:r,pyramidBlockWidth:s,pyramidBlockHeight:r,origin:I,tileInfo:k,transposeInfo:J,firstPyramidLevel:a,maximumPyramidLevel:o,blockBoundary:M})})}}_parseTransform(e){if(!(0,Re.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,Re.c)(e);if("identity"===t.type)return null;if("polynomial"!==t.type||!t.forwardCoefficients?.length||!t.inverseCoefficients?.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return t}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),i=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),n=await Promise.all([t,i]);let s;if(n[0]){let e=n[0].fields;const t=n[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":ve.get(e.type),name:e.name,alias:e.alias||e.name})));const i=t.map((e=>({attributes:e})));e&&t&&(s={fields:e,features:i})}}return!s&&n[1]&&(s=_e.parse(n[1]).recordSet),Q.Z.fromJSON(s)}_buildCacheFilePath(e,t,i,n,s){const r=this._getPackageSize(!!s),a=Math.floor(t/r)*r,o=Math.floor(i/r)*r,l="R"+this._toHexString4(a)+"C"+this._toHexString4(o);let c="L";c+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,h=n?.[0];if(null==u||!h)return`${this.url}/_alllayers/${c}/${l}.bundle`;let f="_yxs";if(!s){f=u.variables.find((e=>e.name===h.variableName)).dimensions[0].values.indexOf(h.values[0]).toString(16);const e=4-f.length;for(let t=0;t<e;t++)f="0"+f;f="S"+f}const d=this._getVariableFolderName(s||h.variableName);return`${this.url}/_alllayers/${d}/${f}/${c}/${l}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&null!=t?t.packetSize??0:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:i}=t;return e&&null!=i?i.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replaceAll(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,i=!1){const n=this._getPackageSize(i),s=n*(e%n)+t%n;if(s<0)throw new Error("Invalid level / row / col");return 20+s*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const i=e.subarray(t,t+8);let n,s=0;for(n=0;n<5;n++)s|=(255&i[n])<<8*n;const r=0xffffffffff&s;for(s=0,n=5;n<8;n++)s|=(255&i[n])<<8*(n-5);return{position:r,recordSize:0xffffffffff&s}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,n._)([(0,h.Cb)({readOnly:!0})],Te.prototype,"storageInfo",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Te.prototype,"datasetFormat",void 0),Te=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.CloudRaster")],Te);const Ce=Te;let ke=class extends K{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){await this.init();const t=this.data,{pixelBlock:i,statistics:n,histograms:s,name:r,keyProperties:a,nativeExtent:o,transform:l}=this.data,{width:c,height:u,pixelType:h}=i,f=t.extent??new X.Z({xmin:-.5,ymin:.5,xmax:c-.5,ymax:u-.5,spatialReference:new ue.Z({wkid:3857})}),d=t.isPseudoSpatialReference??!t.extent,p={x:f.width/c,y:f.height/u},m=new be.Z({width:c,height:u,pixelType:h,extent:f,nativeExtent:o,transform:l,pixelSize:p,spatialReference:f.spatialReference,bandCount:i.pixels.length,keyProperties:a||{},statistics:n,isPseudoSpatialReference:d,histograms:s});this.createRemoteDatasetStorageInfo(m,512,512),this._set("rasterInfo",m),this.updateTileInfo(),await this._buildInMemoryRaster(i,{width:512,height:512},e),this.datasetName=r,this.url="/InMemory/"+r}fetchRawTile(e,t,i,n={}){const s=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(s)}async _buildInMemoryRaster(e,t,i){const n=this.rasterInfo.storageInfo.maximumPyramidLevel,s=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:n},i):Promise.resolve((0,V.Vl)(e,t,n)),r=null!=this.rasterInfo.statistics,o=null!=this.rasterInfo.histograms,l=r?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,re.Hv)(e)),u=await(0,c.as)([s,l]);if(!u[0].value&&u[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,r||(this.rasterInfo.statistics=u[1].value?.statistics),o||(this.rasterInfo.histograms=u[1].value?.histograms)}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],ke.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],ke.prototype,"data",void 0),ke=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],ke);const Fe=ke;function Me(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const s=Me(e,i);for(let e=0;e<s.length;e++)Me(s[e],t).forEach((e=>n.push(e)));return n}const s=e.getElementsByTagNameNS("*",i);if(!s||0===s.length)return[];for(let e=0;e<s.length;e++)n.push(s[e]||s.item(e));return n}function Pe(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=Me(e,i);return n.length>0?t?Pe(n[0],t):n[0]:null}function Oe(e,t=null){const i=t?Pe(e,t):e;let n;return i?(n=i.textContent||i.nodeValue,n?n.trim():null):null}function Ze(e,t){return function(e,t){const i=Me(e,t),n=[];let s;for(let e=0;e<i.length;e++)s=i[e].textContent||i[e].nodeValue,s&&(s=s.trim(),""!==s&&n.push(s));return n}(e,t).map((e=>Number(e)))}function De(e,t){const i=Oe(e,t);return Number(i)}function Be(e,t){const i=e?.nodeName?.toLowerCase(),n=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===n}var Je=i(87390);function Ne(e,t){if(!e||!t)return null;const i=[];for(let n=0;n<e.length;n++)i.push(e[n]),i.push(t[n]);return i}function ze(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new ue.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const i=e.indexOf("VERTCS"),n=e.indexOf("PROJCS"),s=n>-1?n:e.indexOf("GEOGCS");if(-1===s)return null;const r=e.slice(s,e.lastIndexOf("]",i)+1).trim(),a=e.slice(i,e.lastIndexOf("]")).trim();t=Ae(r);const o=new ue.Z(t?{wkid:t}:{wkt:r}),l=Ae(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Ae(e),new ue.Z(0!==t?{wkid:t}:{wkt:e})):null}function Ae(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map((e=>e.trim())).filter((e=>""!==e)),i=t[t.length-1].split(","),n=i[0]?.toLowerCase();if(("epsg"===n||"esri"===n)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Ee(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(Be(e,"SRS")){if(!t.spatialReference){const i=Oe(e);t.spatialReference=ze(i)}}else if(Be(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:n}=function(e){const t=Pe(e,"GeodataXform"),i=ze(De(t,"SpatialReference/WKID")||Oe(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const n=De(t,"PolynomialOrder")??1,s=Ze(t,"CoeffX/Double"),r=Ze(t,"CoeffY/Double"),a=Ze(t,"InverseCoeffX/Double"),o=Ze(t,"InverseCoeffY/Double"),l=Ne(s,r),c=Ne(a,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new Je.Z({spatialReference:i,polynomialOrder:n,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=n,t.spatialReference||(t.spatialReference=i)}else Me(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=Oe(e)));else if(Be(e,"PAMRasterBand")){const i=function(e){const t=De(e,"NoDataValue"),i=Pe(e,"Histograms/HistItem"),n=De(i,"HistMin"),s=De(i,"HistMax"),r=De(i,"BucketCount"),a=Oe(i,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;Me(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const h=De(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=n&&null!=s?{min:n,max:s,size:r||a.length,counts:a}:null,sourceBandIndex:h,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}}));const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map((e=>e.statistics)).filter(d.pC):null;const n=!!i[0].histogram;t.histograms=n?i.map((e=>e.histogram)).filter(d.pC):null}return t}let He=class extends K{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:i,statistics:n,histograms:s,transform:r}=await this._fetchAuxiliaryData(e);const a=!i;a&&(i=new ue.Z({wkid:3857})),s?.length&&null==n&&(n=(0,re.Oh)(s));const{width:o,height:l}=t;let c=new X.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=r?r.forwardTransform(c):c;let h=!0;if(r){const e=r.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(r=null,c=u)}const f=new Fe({data:{extent:u,nativeExtent:c,transform:r,pixelBlock:t,statistics:n,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),f.data=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,i,n={}){return this._inMemoryRaster.fetchRawTile(e,t,i,n)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,U.y)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new a.Z("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const n=i.toLowerCase(),s="gif"===n||"bmp"===n||!(0,p.Z)("ios"),r=await this.decodePixelBlock(t,{format:n,useCanvas:s,hasNoZlibMask:!0});if(null==r)throw new a.Z("image-aux-raster:open","the data cannot be decoded");return r}async _fetchAuxiliaryData(e){const t=e?.signal,i=this.ioConfig.skipExtensions??[],n=i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,r="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,a=r&&i.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:t}),o=await(0,c.as)([n,a]);if(t?.aborted)throw(0,c.zE)();const l=Ee(o[0].value?.data);if(!l.transform){const e=o[1].value?o[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;l.transform=6===e?.length?new Je.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return l}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],He.prototype,"datasetFormat",void 0),He=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],He);const Le=He;var We=i(70586),qe=i(17452),je=i(28589),Ge=i(29680),Ue=i(26059);let Ve=class extends K{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(e){await this.init();const t=e&&e.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const n=i.data;if(this.sourceJSON=n,!n)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!n.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=n.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(n.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===n.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=n.name?.slice(n.name.indexOf("/")+1)??"";const s=await this._fetchRasterInfo({signal:t});if(null==s)throw new a.Z("image-server-raster:open","cannot initialize image service");(0,Ue.n$)(s,n);const r="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:i,maxScale:n,minLOD:s,maxLOD:r}=t;if(null!=s&&null!=r)return P.Z.fromJSON({...e,lods:e.lods.filter((({level:e})=>null!=e&&e>=s&&e<=r))});if(0!==i&&0!==n){const t=e=>Math.round(1e4*e)/1e4,s=i?t(i):1/0,r=n?t(n):-1/0;return P.Z.fromJSON({...e,lods:e.lods.filter((e=>{const i=t(e.scale);return i<=s&&i>=r}))})}return P.Z.fromJSON(e)}(n.tileInfo,n):P.Z.fromJSON(n.tileInfo);(0,We.O3)(r);const[o,l]=this._computeMinMaxLOD(s,r),{extent:c,pixelSize:u}=s,h=.5/s.width*u.x,f=Math.max(u.x,u.y),{lods:d}=r;("Map"!==this.tileType&&0!==n.maxScale||Math.abs(u.x-u.y)>h||!d.some((e=>Math.abs(e.resolution-f)<h)))&&(u.x=u.y=o.resolution,s.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),s.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const p=o.level-l.level,[m,y]=r.size,g=[],x=[];d.forEach(((e,t)=>{e.level>=l.level&&e.level<=o.level&&g.push({x:e.resolution,y:e.resolution}),t<d.length-1&&x.push(Math.round(10*e.resolution/d[t+1].resolution)/10)})),g.sort(((e,t)=>e.x-t.x));const w=this.computeBlockBoundary(c,m,y,r.origin,g,p),b=g.length>1?g.slice(1):null;let I;n.transposeInfo&&(I={tileSize:[n.transposeInfo.rows,n.transposeInfo.cols],packetSize:s.keyProperties?._yxs.PacketSize??0});const S=x.length<=1||x.length>=3&&x.slice(0,-1).every((e=>e===x[0]))?x[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/p))/10;if(s.storageInfo=new B.Z({blockWidth:r.size[0],blockHeight:r.size[1],pyramidBlockWidth:r.size[0],pyramidBlockHeight:r.size[1],pyramidResolutions:b,pyramidScalingFactor:S,compression:r.format,origin:r.origin,firstPyramidLevel:1,maximumPyramidLevel:p,tileInfo:r,transposeInfo:I,blockBoundary:w}),this._fixGCSShift(s),this._set("rasterInfo",s),n.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:s.storageInfo.tileInfo,parsedUrl:(0,qe.mN)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new je.y({layer:e})}}async fetchRawTile(e,t,i,n={}){const{storageInfo:s,extent:r}=this.rasterInfo,{transposeInfo:a}=s,o=null!=a&&!!n.transposedVariableName;if(this._slices&&!o&&null==n.sliceId)return null;const l=o?0:s.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:n.transposedVariableName}:{sliceId:n.sliceId||0}:null,{data:h}=await this.request(c,{query:u,responseType:"array-buffer",signal:n.signal});if(!h)return null;const f=o?a.tileSize:s.tileInfo.size,d=await this.decodePixelBlock(h,{width:f[0],height:f[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const p=s.blockBoundary[e];if("jpg"!==s.compression||i>p.minCol&&i<p.maxCol&&t>p.minRow&&t<p.maxRow)return d;const{origin:m,blockWidth:y,blockHeight:g}=s,{x,y:w}=this.getPyramidPixelSize(e),b=Math.round((r.xmin-m.x)/x)%y,I=Math.round((r.xmax-m.x)/x)%y||y,S=Math.round((m.y-r.ymax)/w)%g,_=Math.round((m.y-r.ymin)/w)%g||g,R=i===p.minCol?b:0,v=t===p.minRow?S:0,T=i===p.maxCol?I:y,C=t===p.maxRow?_:g;return(0,V.pW)(d,{x:R,y:v},{width:T-R,height:C-v}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),n=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([i,n]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),s[1]?.[0]?.counts?.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let n=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let r=s-n+this._levelOffset;const a=i.srcLocation;for(;r>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(r,i.row,i.col,t))break}catch{}if(r--,n++,i=this.identifyPixelLocation(a,n,t.datumTransformation),null===i)return null}return-1===r||null==i?null:n}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),n=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),s=ue.Z.fromJSON(t.spatialReference||e.spatialReference),r=new z.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:s});return new be.Z({width:i,height:n,bandCount:3,extent:X.Z.fromJSON(e),spatialReference:s,pixelSize:r,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,n=(0,Ue.gh)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),s=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,r=await Promise.all([n,s]);return this._slices=r[1],r[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Ge.Z,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,n=.5/e.width*i.x,{lods:s}=t,r=t.lodAt(Math.max.apply(null,s.map((e=>e.level)))),a=t.lodAt(Math.min.apply(null,s.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=s[0].level,[r,a];if("Raster"===o)return[s.find((e=>e.resolution===i.x))??r,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=r;c>0&&(u=s.find((e=>Math.abs(e.scale-c)<n)),u||(u=s.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??r));let h=a;return l>0&&(h=s.find((e=>Math.abs(e.scale-l)<n))??a,this._levelOffset=h.level-a.level),[u,h]}};(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Ve.prototype,"datasetFormat",void 0),(0,n._)([(0,h.Cb)()],Ve.prototype,"tileType",void 0),Ve=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Ve);const $e=Ve;var Xe=i(48279);const Ye=new Map;Ye.set("Int8","s8"),Ye.set("UInt8","u8"),Ye.set("Int16","s16"),Ye.set("UInt16","u16"),Ye.set("Int32","s32"),Ye.set("UInt32","u32"),Ye.set("Float32","f32"),Ye.set("Float64","f32"),Ye.set("Double64","f32");const Ke=new Map;Ke.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ke.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ke.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ke.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let Qe=class extends K{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:n,files:s}=this._parseHeader(i.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(n.statistics=t.statistics??n.statistics,n.histograms=t.histograms,t.histograms&&null==n.statistics&&(n.statistics=(0,re.Oh)(t.histograms)))}this._set("rasterInfo",n),this._files=s;const r=await this.request(s.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(r.data);const{blockWidth:a,blockHeight:o}=this.rasterInfo.storageInfo,l=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:c,height:u}=this.rasterInfo,h=[],f=this._getBandSegmentCount();let d=0,p=-1;for(;d<this._storageIndex.length;){p++;const e=Math.ceil(c/a/l**p)-1,t=Math.ceil(u/o/l**p)-1;d+=(e+1)*(t+1)*f*4,h.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=h,p>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}async fetchRawTile(e,t,i,n={}){const{blockWidth:s,blockHeight:r,blockBoundary:a}=this.rasterInfo.storageInfo,o=a[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:h,actualTileHeight:f}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(s*r);return new ne.Z({width:s,height:r,pixels:null,mask:e,validPixelCount:0})}const{bandIds:d}=this.ioConfig,p=this._getBandSegmentCount(),m=[];let y=0;for(y=0;y<p;y++)d&&!d.includes(y)||m.push(this.request(this._files.data,{range:{from:u[y].from,to:u[y].to},responseType:"array-buffer",signal:n.signal}));const g=await Promise.all(m),x=g.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),w=new Uint8Array(x);let b=0;for(y=0;y<p;y++)w.set(new Uint8Array(g[y].data),b),b+=g[y].data.byteLength;const I=Ke.get(this.rasterInfo.storageInfo.compression).decoderFormat,S=await this.decodePixelBlock(w.buffer,{width:s,height:r,format:I,planes:d?.length||l,pixelType:c});if(null==S)return null;let{noDataValue:_}=this.rasterInfo;if(null!=_&&"lerc"!==I&&!S.mask&&(_=_[0],null!=_)){const e=S.width*S.height,t=new Uint8Array(e);if(Math.abs(_)>1e24)for(y=0;y<e;y++)Math.abs((S.pixels[0][y]-_)/_)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)S.pixels[0][y]!==_&&(t[y]=1);S.mask=t}let R=0,v=0;if(h!==s||f!==r){let e=S.mask;if(e)for(y=0;y<r;y++)if(v=y*s,y<f)for(R=h;R<s;R++)e[v+R]=0;else for(R=0;R<s;R++)e[v+R]=0;else for(e=new Uint8Array(s*r),S.mask=e,y=0;y<f;y++)for(v=y*s,R=0;R<h;R++)e[v+R]=1}return S}_parseIndex(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,n,s,r,a;if(Xe.f){for(i=new Uint8Array(e),s=new ArrayBuffer(e.byteLength),n=new Uint8Array(s),r=0;r<e.byteLength/4;r++)for(a=0;a<4;a++)n[4*r+a]=i[4*r+3-a];t=new Uint32Array(s)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ke.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:n,blockHeight:s,pyramidScalingFactor:r}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,f=0,d=0;for(h=0;h<e;h++)d=r**h,c=Math.ceil(a/n/d),u=Math.ceil(o/s/d),f+=c*u;d=r**e,c=Math.ceil(a/n/d),u=Math.ceil(o/s/d),f+=t*c+i,f*=4*l;const p=this._storageIndex.subarray(f,f+4*l);let m=0,y=0;const g=[];for(let e=0;e<l;e++)m=p[4*e]*2**32+p[4*e+1],y=m+p[4*e+2]*2**32+p[4*e+3],g.push({from:m,to:y});return{ranges:g,actualTileWidth:i<c-1?n:Math.ceil(a/d)-n*(c-1),actualTileHeight:t<u-1?s:Math.ceil(o/d)-s*(u-1)}}_parseHeader(e){const t=Pe(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const i=Pe(t,"Size"),n=parseInt(i.getAttribute("x"),10),s=parseInt(i.getAttribute("y"),10),r=parseInt(i.getAttribute("c"),10),o=(Oe(t,"Compression")||"none").toLowerCase();if(!Ke.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=Oe(t,"DataType")||"UInt8",c=Ye.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=Pe(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),d=Pe(t,"DataValues");let p,m;if(d&&(m=d.getAttribute("NoData"),null!=m&&(p=m.trim().split(" ").map((e=>parseFloat(e))))),Pe(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const y=Pe(e,"MRF_META/GeoTags"),g=Pe(y,"BoundingBox");let x,w=!1;if(null!=g){const e=parseFloat(g.getAttribute("minx")),t=parseFloat(g.getAttribute("miny")),i=parseFloat(g.getAttribute("maxx")),n=parseFloat(g.getAttribute("maxy")),s=Oe(y,"Projection")||"";let r=ue.Z.WGS84;if("LOCAL_CS[]"!==s)if(s.toLowerCase().startsWith("epsg:")){const e=Number(s.slice(5));isNaN(e)||0===e||(r=new ue.Z({wkid:e}))}else r=ze(s)??ue.Z.WGS84;else w=!0,r=new ue.Z({wkid:3857});x=new X.Z(e,t,i,n),x.spatialReference=r}else w=!0,x=new X.Z({xmin:-.5,ymin:.5-s,xmax:n-.5,ymax:.5,spatialReference:new ue.Z({wkid:3857})});const b=Pe(e,"MRF_META/Rsets"),I=parseInt(b&&b.getAttribute("scale")||"2",10),S=x.spatialReference,_=new B.Z({origin:new z.Z({x:x.xmin,y:x.ymax,spatialReference:S}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:I}),R=new z.Z({x:x.width/n,y:x.height/s,spatialReference:S}),v=new be.Z({width:n,height:s,extent:x,isPseudoSpatialReference:w,spatialReference:S,bandCount:r,pixelType:c,pixelSize:R,noDataValue:p,storageInfo:_}),T=Oe(e,"datafile"),C=Oe(e,"IndexFile");return{rasterInfo:v,files:{mrf:this.url,index:C||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Ke.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ee(t)}catch{return null}}};(0,n._)([(0,h.Cb)()],Qe.prototype,"_files",void 0),(0,n._)([(0,h.Cb)()],Qe.prototype,"_storageIndex",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],Qe.prototype,"datasetFormat",void 0),Qe=(0,n._)([(0,y.j)("esri.layers.support.rasterIO.MRFRaster")],Qe);const et=Qe;var tt=i(94793),it=i(9832);const nt=(e,t)=>e.get(t)?.values,st=(e,t)=>e.get(t)?.values?.[0];let rt=class extends K{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:n,firstIFDPos:s,isBigTiff:r}=(0,tt.cK)(i),l=[];await this._readIFDs(l,i,n,s,0,r?8:4,t);const{imageInfo:c,rasterInfo:u}=this._parseIFDs(l),h=(0,tt.ee)(l),f=(0,tt.I7)(l);if(this._headerInfo={littleEndian:n,isBigTiff:r,ifds:l,pyramidIFDs:h,maskIFDs:f,...c},this._set("rasterInfo",u),!c.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+c.message);if(!c.tileWidth)throw new a.Z("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");u.isPseudoSpatialReference&&o.Z.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const d=l[0].get("PREDICTOR")?.values?.[0],p=l[0].get("SAMPLEFORMAT")?.values?.[0];if(3===p&&2===d)throw new a.Z("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floatting point data");const{skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&this._processPAMInfo(t,u)}m.includes("vat.dbf")||1!==u.bandCount||"u8"!==u.pixelType||(u.attributeTable=await this._fetchAuxiliaryTable(e),null!=u.attributeTable&&(u.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(e,t,i,n={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const s=await this._fetchRawTiffTile(e,t,i,!1,n);if(null!=s&&this._headerInfo.hasMaskBand){const r=await this._fetchRawTiffTile(e,t,i,!0,n);null!=r&&r.pixels[0]instanceof Uint8Array&&(s.mask=r.pixels[0])}return s}_parseIFDs(e){const t=(0,tt.FI)(e),{width:i,height:n,tileWidth:s,tileHeight:r,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:h,pyramidBlockHeight:f,tileBoundary:d,affine:p,metadata:m}=t;let y=ze(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),g=!!t.isPseudoGeographic;null==y&&(g=!0,y=new ue.Z({wkid:3857}));const x=new X.Z({...t.extent,spatialReference:y}),w=new z.Z(x?{x:x.xmin,y:x.ymax,spatialReference:y}:{x:0,y:0}),b=new B.Z({blockWidth:s,blockHeight:r,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:l,origin:w,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:d}),I=new z.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/n,spatialReference:y}),S=m?{BandProperties:m.bandProperties,DataType:m.dataType}:{};let _=null;const R=st(e[0],"PHOTOMETRICINTERPRETATION"),v=nt(e[0],"COLORMAP");if(R<=3&&v?.length>3&&v.length%3==0){_=[];const e=v.length/3;for(let t=0;t<e;t++)_.push([t,v[t]>>>8,v[t+e]>>>8,v[t+2*e]>>>8])}const T=new be.Z({width:i,height:n,bandCount:a,pixelType:o,pixelSize:I,storageInfo:b,spatialReference:y,isPseudoSpatialReference:g,keyProperties:S,extent:x,colormap:_,statistics:m?m.statistics:null});return p?.length&&(T.nativeExtent=new X.Z({xmin:-.5,ymin:.5-n,xmax:i-.5,ymax:.5,spatialReference:y}),T.transform=new Je.Z({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),T.extent=T.transform.forwardTransform(T.nativeExtent),T.pixelSize=new z.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/n,spatialReference:y}),b.origin.x=-.5,b.origin.y=.5),{imageInfo:t,rasterInfo:T}}_processPAMInfo(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,re.Oh)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new z.Z({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}async _readIFDs(e,t,i,n,s,r=4,a){if(!n)return null;(n>=t.byteLength||n<0)&&(t=(await this.request(this.url,{range:{from:n+s,to:n+s+this._bufferSize},responseType:"array-buffer",signal:a})).data,s=n+s,n=0);const o=await this._readIFD(t,i,n,s,it.Z.tiffTags,r,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,i,o.nextIFD-s,s,r,a)}async _readIFD(e,t,i,n,s=it.Z.tiffTags,r=4,a){if(!e)return null;const o=(0,tt.vr)(e,t,i,n,s,r);if(o.success){const i=[];if(o.ifd?.forEach((e=>{e.values||i.push(e)})),i.length>0){const s=i.map((e=>e.offlineOffsetSize)).filter(d.pC),r=Math.min.apply(null,s.map((e=>e[0])));if(Math.min.apply(null,s.map((e=>e[0]+e[1])))-r<=this._bufferSize){const{data:s}=await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:a});e=s,n=r,i.forEach((i=>(0,tt.Dq)(e,t,i,n)))}}if(o.ifd?.has("GEOKEYDIRECTORY")){const i=o.ifd.get("GEOKEYDIRECTORY"),s=i?.values;if(s&&s.length>4){const r=s[0]+"."+s[1]+"."+s[2],o=await this._readIFD(e,t,i.valueOffset+6-n,n,it.Z.geoKeys,2,a);i.data=o.ifd,i.data&&i.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const i=await this.request(this.url,{range:{from:n,to:n+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=i.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,n,it.Z.tiffTags,4,a)}}async _fetchRawTiffTile(e,t,i,n,s={}){const r=this._getTileLocation(e,t,i,n);if(!r)return null;const{ranges:a,actualTileWidth:o,actualTileHeight:l,ifd:c}=r,u=a.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:s.signal}))),h=await Promise.all(u),f=h.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),d=1===h.length?h[0].data:new ArrayBuffer(f),p=[0],m=[0];if(h.length>1){const e=new Uint8Array(d);for(let t=0,i=0;t<h.length;t++){const n=h[t].data;e.set(new Uint8Array(n),i),p[t]=i,i+=n.byteLength,m[t]=n.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(d,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:p,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;let w,b,I;if(o!==y||l!==g){let e=x.mask;if(e)for(w=0;w<g;w++)if(I=w*y,w<l)for(b=o;b<y;b++)e[I+b]=0;else for(b=0;b<y;b++)e[I+b]=0;else for(e=new Uint8Array(y*g),x.mask=e,w=0;w<l;w++)for(I=w*y,b=0;b<o;b++)e[I+b]=1}return x}_getTileLocation(e,t,i,n=!1){const{firstPyramidLevel:s,blockBoundary:r}=this.rasterInfo.storageInfo,a=0===e?0:e-(s-1),{_headerInfo:o}=this;if(!o)return null;const l=n?o.maskIFDs[a]:0===a?o?.ifds[0]:o?.pyramidIFDs[a-1];if(!l)return null;const c=(0,tt.If)(l,o),u=nt(l,"TILEOFFSETS");if(void 0===u)return null;const h=nt(l,"TILEBYTECOUNTS"),{minRow:f,minCol:d,maxRow:p,maxCol:m}=r[a];if(t>p||i>m||t<f||i<d)return null;const y=st(l,"IMAGEWIDTH"),g=st(l,"IMAGELENGTH"),x=st(l,"TILEWIDTH"),w=st(l,"TILELENGTH"),b=[];if(c){const{bandCount:e}=this.rasterInfo;for(let n=0;n<e;n++){const e=n*(p+1)*(m+1)+t*(m+1)+i;b[n]={from:u[e],to:u[e]+h[e]-1}}}else{const e=t*(m+1)+i;b.push({from:u[e],to:u[e]+h[e]-1})}for(let e=0;e<b.length;e++)if(null==b[e].from||!b[e].to||b[e].to<0)return null;return{ranges:b,ifd:l,actualTileWidth:i===m&&y%x||x,actualTileHeight:t===p&&g%w||w}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Ee(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=_e.parse(t);return i?.recordSet?Q.Z.fromJSON(i.recordSet):null}catch{return null}}};(0,n._)([(0,h.Cb)()],rt.prototype,"_files",void 0),(0,n._)([(0,h.Cb)()],rt.prototype,"_headerInfo",void 0),(0,n._)([(0,h.Cb)()],rt.prototype,"_bufferSize",void 0),(0,n._)([(0,h.Cb)({type:String,json:{write:!0}})],rt.prototype,"datasetFormat",void 0),rt=(0,n._)([(0,y.j)("esri.layers.support.rasterDatasets.TIFFRaster")],rt);const at=rt,ot=new Map;ot.set("CRF",{desc:"Cloud Raster Format",constructor:Ce}),ot.set("MRF",{desc:"Meta Raster Format",constructor:et}),ot.set("TIFF",{desc:"GeoTIFF",constructor:at}),ot.set("RasterTileServer",{desc:"Raster Tile Server",constructor:$e}),ot.set("JPG",{desc:"JPG Raster Format",constructor:Le}),ot.set("PNG",{desc:"PNG Raster Format",constructor:Le}),ot.set("GIF",{desc:"GIF Raster Format",constructor:Le}),ot.set("BMP",{desc:"BMP Raster Format",constructor:Le});class lt{static get supportedFormats(){const e=new Set;return ot.forEach(((t,i)=>e.add(i))),e}static async open(e){const{url:t,ioConfig:i,sourceJSON:n}=e;let s=e.datasetFormat;null==s&&t.lastIndexOf(".")&&(s=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===s||"TIF"===s?s="TIFF":"JPG"!==s&&"JPEG"!==s&&"JFIF"!==s||(s="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(s="RasterTileServer");const r={url:t,sourceJSON:n,datasetFormat:s,ioConfig:i??{bandIds:null,sampling:null}};let o,l;if(s&&this.supportedFormats.has(s)){if("CRF"===s&&!i?.enableCRF)throw new a.Z("rasterfactory:open",`cannot open raster: ${t}`);return o=ot.get(s).constructor,l=new o(r),await l.open({signal:e.signal}),l}if(s)throw new a.Z("rasterfactory:open","not a supported format "+s);const c=Array.from(ot.keys());let u=0;const h=()=>(s=c[u++],s&&("CRF"!==s||i?.enableCRF)?(o=ot.get(s).constructor,l=new o(r),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null);return h()}static register(e,t,i){ot.has(e.toUpperCase())||ot.set(e.toUpperCase(),{desc:t,constructor:i})}}var ct=i(32163),ut=i(12259);let ht=class extends((0,w.h)((0,ye.M)((0,de.q)((0,pe.I)((0,b.N)(fe((0,ge.n)((0,x.Y)((0,me.Q)((0,l.R)((0,r.J)(g.Z)))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=(0,c.Ds)((async(e,t,n)=>{const{save:s,saveAs:r}=await i.e(4697).then(i.bind(i,64697));switch(e){case ut.x.SAVE:return s(this,t);case ut.x.SAVE_AS:return r(this,n,t)}}))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[new xe.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new xe.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],{rasterInfo:t}=this,i=t?.attributeTable,n=null!=i?i.fields:null;if(n){const t=n.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e.push(...t)}const s=t?.dataType,r=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=r){const t=r.variables[0].unit?.trim(),i="Magnitude"+(t?` (${t})`:"");e.push(new xe.Z({name:"Raster.Magnitude",alias:i,domain:null,editable:!1,type:"double"})),e.push(new xe.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}createPopupTemplate(e){const{rasterFields:t}=this,i=new Set(t.map((({name:e})=>e)).filter((e=>"raster.servicepixelvalue.raw"!==e.toLowerCase())));return(0,ct.eZ)({fields:t,title:this.title},{...e,visibleFieldNames:i})}async generateRasterInfo(e,t){if(!(e=(0,f.TJ)(F.Z,e)))return this.rasterInfo;try{const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((e=>i[e.url]=e));const n=(0,se.Ue)(e.functionDefinition?.toJSON()??e.toJSON(),i),s=new te({rasterFunction:n});return await s.open(t),s.rasterInfo}catch(e){if(e instanceof a.Z)throw e;throw new a.Z("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(ut.x.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ut.x.SAVE_AS,t,e)}write(e,t){const i=this._primaryRasters[0]??this.raster;if(this.loaded?"RasterTileServer"===i.datasetFormat&&("Raster"===i.tileType||"Map"===i.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)this.raster.rasterInfo||await this.raster.open(),"Function"===this.raster.datasetFormat?(t=!0,this._primaryRasters=this.raster.primaryRasters.rasters):this._primaryRasters=[this.raster],this.url=this.raster.url;else{const{rasterFunction:t}=this,i=[this.url];t&&(0,se.G8)(t.toJSON(),i);const n=await Promise.all(i.map((t=>lt.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e})))),s=n.findIndex((e=>null==e));if(s>-1)throw new a.Z("imagery-tile-layer:open",`cannot open raster: ${i[s]}`);if(this._primaryRasters=n,t){const e={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach((t=>e[t.url]=t));const i=(0,se.Ue)(t.functionDefinition?.toJSON()??t.toJSON(),e),s=new te({rasterFunction:i});try{await s.open(),this.raster=s}catch(e){const t=o.Z.getLogger(this);e instanceof a.Z&&t.error("imagery-tile-layer:open",e.message),t.warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=n[0]}}else this.raster=n[0]}const i=this.raster.rasterInfo;if(!i)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("rasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.rasterInfo.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,u.YP)((()=>this.customParameters),(e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)})))}};(0,n._)([(0,h.Cb)({clonable:!1})],ht.prototype,"_primaryRasters",void 0),(0,n._)([(0,h.Cb)({type:[f.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],ht.prototype,"bandIds",void 0),(0,n._)([(0,h.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,m.J)(we.cl)],ht.prototype,"interpolation",void 0),(0,n._)([(0,h.Cb)(T.rn)],ht.prototype,"legendEnabled",void 0),(0,n._)([(0,h.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],ht.prototype,"isReference",void 0),(0,n._)([(0,h.Cb)({type:["show","hide"]})],ht.prototype,"listMode",void 0),(0,n._)([(0,h.Cb)({json:{read:!0,write:!0}})],ht.prototype,"blendMode",void 0),(0,n._)([(0,h.Cb)()],ht.prototype,"sourceJSON",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],ht.prototype,"version",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],ht.prototype,"type",void 0),(0,n._)([(0,h.Cb)({type:["ArcGISTiledImageServiceLayer"]})],ht.prototype,"operationalLayerType",void 0),(0,n._)([(0,h.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],ht.prototype,"popupEnabled",void 0),(0,n._)([(0,h.Cb)({type:s.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],ht.prototype,"popupTemplate",void 0),(0,n._)([(0,h.Cb)({readOnly:!0})],ht.prototype,"defaultPopupTemplate",null),(0,n._)([(0,h.Cb)({readOnly:!0,type:[xe.Z]})],ht.prototype,"fields",void 0),(0,n._)([(0,h.Cb)({readOnly:!0,type:[xe.Z]})],ht.prototype,"rasterFields",null),ht=(0,n._)([(0,y.j)("esri.layers.ImageryTileLayer")],ht);const ft=ht},11282:(e,t,i)=>{i.d(t,{cv:()=>o,en:()=>a,lA:()=>r}),i(68773),i(40330);var n=i(22974),s=i(17452);function r(e,t){return t?{...t,query:{...e??{},...t.query}}:{query:e}}function a(e){return"string"==typeof e?(0,s.mN)(e):(0,n.d9)(e)}function o(e,t,i){const n={};for(const s in e){if("declaredClass"===s)continue;const r=e[s];if(null!=r&&"function"!=typeof r)if(Array.isArray(r)){n[s]=[];for(let e=0;e<r.length;e++)n[s][e]=o(r[e])}else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i&&i[s]);n[s]=t?e:JSON.stringify(e)}else n[s]=t?r:JSON.stringify(r);else n[s]=r}return n}i(71058)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9387],{83932:(e,t,r)=>{r.d(t,{B:()=>u});var o=r(22021),n=r(52138),s=r(65617);function i(e,t,r){const o=Math.sin(e),n=Math.cos(e),s=Math.sin(t),i=Math.cos(t),a=r;return a[0]=-o,a[4]=-s*n,a[8]=i*n,a[12]=0,a[1]=n,a[5]=-s*o,a[9]=i*o,a[13]=0,a[2]=0,a[6]=i,a[10]=s,a[14]=0,a[3]=0,a[7]=0,a[11]=0,a[15]=1,a}var a=r(29166),l=r(8744);function u(e,t,r,o){if(null==e||null==o)return!1;const s=(0,a.eT)(e,a.Jz),u=(0,a.eT)(o,a.sp);if(s===u&&!p(u)&&(s!==a.Ej.UNKNOWN||(0,l.fS)(e,o)))return(0,n.d)(r,t),!0;if(p(u)){const e=a.rf[s][a.Ej.LON_LAT],o=a.rf[a.Ej.LON_LAT][u];return null!=e&&null!=o&&(e(t,0,d,0),o(d,0,y,0),i(c*d[0],c*d[1],r),r[12]=y[0],r[13]=y[1],r[14]=y[2],!0)}if((u===a.Ej.WEB_MERCATOR||u===a.Ej.PLATE_CARREE)&&(s===a.Ej.WGS84||s===a.Ej.CGCS2000&&u===a.Ej.PLATE_CARREE||s===a.Ej.SPHERICAL_ECEF||s===a.Ej.WEB_MERCATOR)){const e=a.rf[s][a.Ej.LON_LAT],o=a.rf[a.Ej.LON_LAT][u];return null!=e&&null!=o&&(e(t,0,d,0),o(d,0,y,0),s===a.Ej.SPHERICAL_ECEF?function(e,t,r){i(e,t,r),(0,n.t)(r,r)}(c*d[0],c*d[1],r):(0,n.g)(r),r[12]=y[0],r[13]=y[1],r[14]=y[2],!0)}return!1}function p(e){return e===a.Ej.SPHERICAL_ECEF||e===a.Ej.SPHERICAL_MARS_PCPF||e===a.Ej.SPHERICAL_MOON_PCPF}const c=(0,o.Vl)(1),d=(0,s.c)(),y=(0,s.c)()},58995:(e,t,r)=>{r.d(t,{rS:()=>u});var o=r(2109),n=r(82971),s=r(8744);const i=new n.Z(o.kU),a=new n.Z(o.JL),l=new n.Z(o.mM);function u(e){return e&&((0,s.BZ)(e)||(0,s.fS)(e,a))?a:e&&((0,s.V2)(e)||(0,s.fS)(e,l))?l:i}new n.Z(o.pn)},17017:(e,t,r)=>{r.d(t,{N:()=>i});var o=r(43697),n=r(5600),s=(r(75215),r(67676),r(80442),r(52011));const i=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return(0,o._)([(0,n.Cb)({type:Object,json:{write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0)})}}})],t.prototype,"customParameters",void 0),t=(0,o._)([(0,s.j)("esri.layers.mixins.CustomParametersMixin")],t),t}},70082:(e,t,r)=>{r.d(t,{Z:()=>c});var o=r(43697),n=r(2368),s=r(35454),i=r(96674),a=r(5600),l=(r(75215),r(67676),r(80442),r(52011));const u=new s.X({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let p=class extends((0,n.J)(i.wq)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,o._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"name",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"description",void 0),(0,o._)([(0,a.Cb)({json:{read:u.read,write:u.write}})],p.prototype,"drawingTool",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"prototype",void 0),(0,o._)([(0,a.Cb)({json:{write:!0}})],p.prototype,"thumbnail",void 0),p=(0,o._)([(0,l.j)("esri.layers.support.FeatureTemplate")],p);const c=p},16451:(e,t,r)=>{r.d(t,{Z:()=>y});var o=r(43697),n=r(2368),s=r(96674),i=r(5600),a=(r(75215),r(67676),r(80442),r(71715)),l=r(52011),u=r(30556),p=r(72729),c=r(70082);let d=class extends((0,n.J)(s.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,p.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,o._)([(0,i.Cb)({json:{write:!0}})],d.prototype,"id",void 0),(0,o._)([(0,i.Cb)({json:{write:!0}})],d.prototype,"name",void 0),(0,o._)([(0,i.Cb)({json:{write:!0}})],d.prototype,"domains",void 0),(0,o._)([(0,a.r)("domains")],d.prototype,"readDomains",null),(0,o._)([(0,u.c)("domains")],d.prototype,"writeDomains",null),(0,o._)([(0,i.Cb)({type:[c.Z],json:{write:!0}})],d.prototype,"templates",void 0),d=(0,o._)([(0,l.j)("esri.layers.support.FeatureType")],d);const y=d},14147:(e,t,r)=>{r.d(t,{W:()=>u});var o=r(40330),n=r(3172),s=r(95330),i=r(19238),a=r(48522),l=r(15235);class u{constructor(e,t,r,o){this._parsedUrl=e,this._portalItem=t,this._apiKey=r,this.signal=o,this._rootDocument=null;const n=this._parsedUrl?.path.match(/^(.*)\/SceneServer\/layers\/([\d]*)\/?$/i);n&&(this._urlParts={root:n[1],layerId:parseInt(n[2],10)})}async fetch(){if(!this._urlParts)return null;const e=this._portalItem??await this._portalItemFromServiceItemId();if(null==e)return this._loadFromUrl();const t=await this._findAndLoadRelatedPortalItem(e);return null==t?null:this._loadFeatureLayerFromPortalItem(t)}async fetchPortalItem(){if(!this._urlParts)return null;const e=this._portalItem??await this._portalItemFromServiceItemId();return null==e?null:this._findAndLoadRelatedPortalItem(e)}async _fetchRootDocument(){if(null!=this._rootDocument)return this._rootDocument;if(null==this._urlParts)return this._rootDocument={},{};const e={query:{f:"json",token:this._apiKey},responseType:"json",signal:this.signal},t=`${this._urlParts.root}/SceneServer`;try{const r=await(0,n.Z)(t,e);this._rootDocument=r.data}catch{this._rootDocument={}}return this._rootDocument}async _fetchServiceOwningPortalUrl(){const e=this._parsedUrl?.path,t=e?o.id?.findServerInfo(e):null;if(t?.owningSystemUrl)return t.owningSystemUrl;const r=e?e.replace(/(.*\/rest)\/.*/i,"$1")+"/info":null;try{const e=(await(0,n.Z)(r,{query:{f:"json"},responseType:"json",signal:this.signal})).data.owningSystemUrl;if(e)return e}catch(e){(0,s.r9)(e)}return null}async _findAndLoadRelatedPortalItem(e){try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:this.signal})).find((e=>"Feature Service"===e.type))||null;if(!t)return null;const r=new l.default({portal:t.portal,id:t.id});return await r.load(),r}catch(e){return(0,s.r9)(e),null}}async _loadFeatureLayerFromPortalItem(e){await e.load({signal:this.signal});const t=await this._findMatchingAssociatedSublayerUrl(e.url??"");return new i.default({url:t,portalItem:e}).load({signal:this.signal})}async _loadFromUrl(){const e=await this._findMatchingAssociatedSublayerUrl(`${this._urlParts?.root}/FeatureServer`);return new i.default({url:e}).load({signal:this.signal})}async _findMatchingAssociatedSublayerUrl(e){const t=e.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i,"$1"),r=this._urlParts?.layerId,o=this._fetchRootDocument(),s=e=>{const r={query:{f:"json"},responseType:"json",authMode:e,signal:this.signal};return(0,n.Z)(t,r)},i=s("anonymous").catch((()=>s("no-prompt"))),[a,l]=await Promise.all([i,o]),u=l&&l.layers,p=a.data&&a.data.layers;if(!Array.isArray(p))throw new Error("expected layers array");if(Array.isArray(u)){for(let e=0;e<Math.min(u.length,p.length);e++)if(u[e].id===r)return`${t}/${p[e].id}`}else if(null!=r&&r<p.length)return`${t}/${p[r].id}`;throw new Error("could not find matching associated sublayer")}async _portalItemFromServiceItemId(){const e=(await this._fetchRootDocument()).serviceItemId;if(!e)return null;const t=new l.default({id:e,apiKey:this._apiKey}),r=await this._fetchServiceOwningPortalUrl();null!=r&&(t.portal=new a.Z({url:r}));try{return t.load({signal:this.signal})}catch(e){return(0,s.r9)(e),null}}}},51161:(e,t,r)=>{r.d(t,{H3:()=>g,QI:()=>c,U4:()=>l,Yh:()=>y});var o=r(43697),n=r(96674),s=r(5600),i=(r(75215),r(67676),r(80442),r(36030)),a=r(52011);let l=class extends n.wq{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};(0,o._)([(0,s.Cb)({type:Number})],l.prototype,"nodesPerPage",void 0),(0,o._)([(0,s.Cb)({type:Number})],l.prototype,"rootIndex",void 0),(0,o._)([(0,s.Cb)({type:String})],l.prototype,"lodSelectionMetricType",void 0),l=(0,o._)([(0,a.j)("esri.layer.support.I3SNodePageDefinition")],l);let u=class extends n.wq{constructor(){super(...arguments),this.factor=1}};(0,o._)([(0,s.Cb)({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],u.prototype,"id",void 0),(0,o._)([(0,s.Cb)({type:Number})],u.prototype,"factor",void 0),u=(0,o._)([(0,a.j)("esri.layer.support.I3SMaterialTexture")],u);let p=class extends n.wq{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};(0,o._)([(0,s.Cb)({type:[Number]})],p.prototype,"baseColorFactor",void 0),(0,o._)([(0,s.Cb)({type:u})],p.prototype,"baseColorTexture",void 0),(0,o._)([(0,s.Cb)({type:u})],p.prototype,"metallicRoughnessTexture",void 0),(0,o._)([(0,s.Cb)({type:Number})],p.prototype,"metallicFactor",void 0),(0,o._)([(0,s.Cb)({type:Number})],p.prototype,"roughnessFactor",void 0),p=(0,o._)([(0,a.j)("esri.layer.support.I3SMaterialPBRMetallicRoughness")],p);let c=class extends n.wq{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};(0,o._)([(0,i.J)({opaque:"opaque",mask:"mask",blend:"blend"})],c.prototype,"alphaMode",void 0),(0,o._)([(0,s.Cb)({type:Number})],c.prototype,"alphaCutoff",void 0),(0,o._)([(0,s.Cb)({type:Boolean})],c.prototype,"doubleSided",void 0),(0,o._)([(0,i.J)({none:"none",back:"back",front:"front"})],c.prototype,"cullFace",void 0),(0,o._)([(0,s.Cb)({type:u})],c.prototype,"normalTexture",void 0),(0,o._)([(0,s.Cb)({type:u})],c.prototype,"occlusionTexture",void 0),(0,o._)([(0,s.Cb)({type:u})],c.prototype,"emissiveTexture",void 0),(0,o._)([(0,s.Cb)({type:[Number]})],c.prototype,"emissiveFactor",void 0),(0,o._)([(0,s.Cb)({type:p})],c.prototype,"pbrMetallicRoughness",void 0),c=(0,o._)([(0,a.j)("esri.layer.support.I3SMaterialDefinition")],c);let d=class extends n.wq{};(0,o._)([(0,s.Cb)({type:String,json:{read:{source:["name","index"],reader:(e,t)=>null!=e?e:`${t.index}`}}})],d.prototype,"name",void 0),(0,o._)([(0,i.J)({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],d.prototype,"format",void 0),d=(0,o._)([(0,a.j)("esri.layer.support.I3STextureFormat")],d);let y=class extends n.wq{constructor(){super(...arguments),this.atlas=!1}};(0,o._)([(0,s.Cb)({type:[d]})],y.prototype,"formats",void 0),(0,o._)([(0,s.Cb)({type:Boolean})],y.prototype,"atlas",void 0),y=(0,o._)([(0,a.j)("esri.layer.support.I3STextureSetDefinition")],y);let f=class extends n.wq{};(0,o._)([(0,i.J)({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],f.prototype,"type",void 0),(0,o._)([(0,s.Cb)({type:Number})],f.prototype,"component",void 0),f=(0,o._)([(0,a.j)("esri.layer.support.I3SGeometryAttribute")],f);let h=class extends n.wq{};(0,o._)([(0,i.J)({draco:"draco"})],h.prototype,"encoding",void 0),(0,o._)([(0,s.Cb)({type:[String]})],h.prototype,"attributes",void 0),h=(0,o._)([(0,a.j)("esri.layer.support.I3SGeometryCompressedAttributes")],h);let m=class extends n.wq{constructor(){super(...arguments),this.offset=0}};(0,o._)([(0,s.Cb)({type:Number})],m.prototype,"offset",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"position",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"normal",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"uv0",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"color",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"uvRegion",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"featureId",void 0),(0,o._)([(0,s.Cb)({type:f})],m.prototype,"faceRange",void 0),(0,o._)([(0,s.Cb)({type:h})],m.prototype,"compressedAttributes",void 0),m=(0,o._)([(0,a.j)("esri.layer.support.I3SGeometryBuffer")],m);let g=class extends n.wq{};(0,o._)([(0,i.J)({triangle:"triangle"})],g.prototype,"topology",void 0),(0,o._)([(0,s.Cb)()],g.prototype,"geometryBuffers",void 0),g=(0,o._)([(0,a.j)("esri.layer.support.I3SGeometryDefinition")],g)},56765:(e,t,r)=>{r.d(t,{Z:()=>p});var o,n=r(43697),s=r(46791),i=r(96674),a=r(5600),l=(r(75215),r(67676),r(80442),r(52011));let u=o=class extends i.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new s.Z}clone(){return new o({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],u.prototype,"floorField",void 0),(0,n._)([(0,a.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllMode",void 0),(0,n._)([(0,a.Cb)({json:{read:!1,write:!1}})],u.prototype,"viewAllLevelIds",void 0),u=o=(0,n._)([(0,l.j)("esri.layers.support.LayerFloorInfo")],u);const p=u},15506:(e,t,r)=>{r.d(t,{C:()=>o});const o={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}}},30707:(e,t,r)=>{r.d(t,{a:()=>c,r:()=>u});var o=r(20102),n=r(22974),s=r(92604),i=r(54306);const a=s.Z.getLogger("esri.layers.support.labelingInfo"),l=/\[([^\[\]]+)\]/gi;function u(e,t,r){return e?e.map((e=>{const o=new i.Z;if(o.read(e,r),o.labelExpression){const e=t.fields||t.layerDefinition&&t.layerDefinition.fields||this.fields;o.labelExpression=o.labelExpression.replaceAll(l,((t,r)=>`[${function(e,t){if(!t)return e;const r=e.toLowerCase();for(let e=0;e<t.length;e++){const o=t[e].name;if(o.toLowerCase()===r)return o}return e}(r,e)}]`))}return o})):null}const p={esriGeometryPoint:["above-right","above-center","above-left","center-center","center-left","center-right","below-center","below-left","below-right"],esriGeometryPolygon:["always-horizontal"],esriGeometryPolyline:["center-along"],esriGeometryMultipoint:null};function c(e,t){const r=(0,n.d9)(e);return r.some((e=>function(e,t){const r=e.labelPlacement,n=p[t];if(!e.symbol)return a.warn("No ILabelClass symbol specified."),!0;if(!n)return a.error(new o.Z("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${t}' is not supported`)),!0;if(!n.includes(r)){const o=n[0];r&&a.warn(`Found invalid label placement type ${r} for ${t}. Defaulting to ${o}`),e.labelPlacement=o}return!1}(e,t)))?[]:r}},54275:(e,t,r)=>{r.d(t,{h:()=>c});var o=r(80442),n=r(66677);function s(e,t,r){return!!a(e,t,r)}function i(e,t,r){return a(e,t,r)}function a(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}const l={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function u(e){const t=e?.supportedSpatialAggregationStatistics?.map((e=>e.toLowerCase()));return{envelope:!!t?.includes("envelopeaggregate"),centroid:!!t?.includes("centroidaggregate"),convexHull:!!t?.includes("convexhullaggregate")}}function p(e,t){const r=e?.supportedOperationsWithCacheHint?.map((e=>e.toLowerCase()));return!!r?.includes(t.toLowerCase())}function c(e,t){return{analytics:d(e),attachment:y(e),data:f(e),metadata:h(e),operations:m(e.capabilities,e,t),query:g(e,t),queryRelated:w(e),queryTopFeatures:b(e),editing:C(e)}}function d(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryAnalytics")}}function y(e){const t=e.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:p(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:s(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach((e=>{const t=l[e.name];t&&(r[t]=!!e.isEnabled)})),r}function f(e){return{isVersioned:s(e,"isDataVersioned",!1),supportsAttachment:s(e,"hasAttachments",!1),supportsM:s(e,"hasM",!1),supportsZ:s(e,"hasZ",!1)}}function h(e){return{supportsAdvancedFieldProperties:s(e,"supportsFieldDescriptionProperty",!1)}}function m(e,t,r){const o=e?e.toLowerCase().split(",").map((e=>e.trim())):[],i=r?(0,n.Qc)(r):null,a=o.includes(null!=i&&"MapServer"===i.serverType?"data":"query"),l=o.includes("editing")&&!t.datesInUnknownTimezone;let u=l&&o.includes("create"),p=l&&o.includes("delete"),c=l&&o.includes("update");const d=o.includes("changetracking"),y=t.advancedQueryCapabilities;return l&&!(u||p||c)&&(u=p=c=!0),{supportsCalculate:s(t,"supportsCalculate",!1),supportsTruncate:s(t,"supportsTruncate",!1),supportsValidateSql:s(t,"supportsValidateSql",!1),supportsAdd:u,supportsDelete:p,supportsEditing:l,supportsChangeTracking:d,supportsQuery:a,supportsQueryAnalytics:s(y,"supportsQueryAnalytic",!1),supportsQueryAttachments:s(y,"supportsQueryAttachments",!1),supportsQueryTopFeatures:s(y,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:s(t,"supportsAttachmentsResizing",!1),supportsSync:o.includes("sync"),supportsUpdate:c,supportsExceedsLimitStatistics:s(t,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:s(t,"supportsAsyncConvert3D",!1)}}function g(e,t){const r=e.advancedQueryCapabilities,a=e.ownershipBasedAccessControlForFeatures,l=e.archivingInfo,c=e.currentVersion,d=t?.includes("MapServer"),y=!d||c>=(0,o.Z)("mapserver-pbf-version-support"),f=(0,n.M8)(t),h=new Set((e.supportedQueryFormats??"").split(",").map((e=>e.toLowerCase().trim())));return{supportsStatistics:s(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:s(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:s(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:u(r),supportsCentroid:s(r,"supportsReturningGeometryCentroid",!1),supportsDistance:s(r,"supportsQueryWithDistance",!1),supportsDistinct:s(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:s(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:s(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:s(r,"supportsHavingClause",!1),supportsOrderBy:s(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:s(r,"supportsPagination",!1),supportsQuantization:s(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:s(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:s(e,"supportsReturningQueryGeometry",!1),supportsResultType:s(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:s(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:s(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:s(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:s(r,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:s(a,"allowAnonymousToQuery",!0),supportsQueryByOthers:s(a,"allowOthersToQuery",!0),supportsHistoricMoment:s(l,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:y&&h.has("pbf"),supportsDisjointSpatialRelationship:s(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:s(r,"supportsQueryWithCacheHint",!1)||p(r,"query"),supportsDefaultSpatialReference:s(r,"supportsDefaultSR",!1),supportsCompactGeometry:f,supportsFullTextSearch:s(r,"supportsFullTextSearch",!1),maxRecordCountFactor:i(e,"maxRecordCountFactor",void 0),maxRecordCount:i(e,"maxRecordCount",void 0),standardMaxRecordCount:i(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:i(e,"tileMaxRecordCount",void 0)}}function w(e){const t=e.advancedQueryCapabilities,r=s(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:s(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:p(t,"queryRelated")}}function b(e){return{supportsCacheHint:p(e.advancedQueryCapabilities,"queryTopFilter")}}function C(e){const t=e.ownershipBasedAccessControlForFeatures,r=e?e.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:s(e,"allowGeometryUpdates",!0),supportsGlobalId:s(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:s(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:s(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:s(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:s(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:s(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:s(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:s(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:s(t,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:s(r,"supportsAsyncApplyEdits",!1)}}},28694:(e,t,r)=>{r.d(t,{p:()=>n});var o=r(69285);function n(e,t,r){if(!r||!r.features||!r.hasZ)return;const n=(0,o.k)(r.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of r.features)n(e.geometry)}},74889:(e,t,r)=>{r.d(t,{Z:()=>b});var o,n=r(43697),s=r(66577),i=r(38171),a=r(35454),l=r(96674),u=r(22974),p=r(5600),c=(r(75215),r(71715)),d=r(52011),y=r(30556),f=r(82971),h=r(33955),m=r(1231);const g=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=o=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=f.Z.fromJSON(t.spatialReference),o=[];for(let t=0;t<e.length;t++){const n=e[t],s=i.Z.fromJSON(n),a=n.geometry&&n.geometry.spatialReference;null==s.geometry||a||(s.geometry.spatialReference=r);const l=n.aggregateGeometries,u=s.aggregateGeometries;if(l&&null!=u)for(const e in u){const t=u[e],o=l[e],n=o?.spatialReference;null==t||n||(t.spatialReference=r)}o.push(s)}return o}writeGeometryType(e,t,r,o){if(e)return void g.write(e,t,r,o);const{features:n}=this;if(n)for(const e of n)if(e&&null!=e.geometry)return void g.write(e.geometry.type,t,r,o)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,o=(0,h.im)(e);return o&&!r&&t.spatialReference&&(o.spatialReference=f.Z.fromJSON(t.spatialReference)),o}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&null!=e.geometry&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new o(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const o=t.features[r];if(o.geometry){const t=e&&e[r];o.geometry=t&&t.toJSON()||o.geometry}}return t}quantize(e){const{scale:[t,r],translate:[o,n]}=e,s=this.features,i=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-o)/t)),(e=>Math.round((n-e)/r)));for(let e=0,t=s.length;e<t;e++)i?.(s[e].geometry)||(s.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[o,n],scale:[s,i]}=r;let a=null,l=null;if(this.hasZ&&null!=r?.scale?.[2]){const{translate:[,,e],scale:[,,t]}=r;a=r=>r*t+e}if(this.hasM&&null!=r?.scale?.[3]){const{translate:[,,,e],scale:[,,,t]}=r;l=r=>null==r?r:r*t+e}const u=this._getHydrationFunction(e,(e=>e*s+o),(e=>n-e*i),a,l);for(const{geometry:e}of t)null!=e&&u&&u(e);return this.transform=null,this}_quantizePoints(e,t,r){let o,n;const s=[];for(let i=0,a=e.length;i<a;i++){const a=e[i];if(i>0){const e=t(a[0]),i=r(a[1]);e===o&&i===n||(s.push([e-o,i-n]),o=e,n=i)}else o=t(a[0]),n=r(a[1]),s.push([o,n])}return s.length>0?s:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const o=(0,h.oU)(e)?e.rings:e.paths,n=[];for(let e=0,s=o.length;e<s;e++){const s=o[e],i=this._quantizePoints(s,t,r);i&&n.push(i)}return n.length>0?((0,h.oU)(e)?e.rings=n:e.paths=n,e):null}:"multipoint"===e?e=>{const o=this._quantizePoints(e.points,t,r);return o&&o.length>0?(e.points=o,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r,o,n){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y),o&&(e.z=o(e.z))}:"polyline"===e||"polygon"===e?e=>{const s=(0,h.oU)(e)?e.rings:e.paths;let i,a;for(let e=0,o=s.length;e<o;e++){const o=s[e];for(let e=0,n=o.length;e<n;e++){const n=o[e];e>0?(i+=n[0],a+=n[1]):(i=n[0],a=n[1]),n[0]=t(i),n[1]=r(a)}}if(o&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2]),r[3]=n(r[3])}}else if(o)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=o(r[2])}}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];for(let e=0,r=t.length;e<r;e++){const r=t[e];r[2]=n(r[2])}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax),o&&null!=e.zmax&&null!=e.zmin&&(e.zmax=o(e.zmax),e.zmin=o(e.zmin)),n&&null!=e.mmax&&null!=e.mmin&&(e.mmax=n(e.mmax),e.mmin=n(e.mmin))}:"multipoint"===e?e=>{const s=e.points;let i,a;for(let e=0,o=s.length;e<o;e++){const o=s[e];e>0?(i+=o[0],a+=o[1]):(i=o[0],a=o[1]),o[0]=t(i),o[1]=r(a)}if(o&&n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=o(t[2]),t[3]=n(t[3])}else if(o)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=o(t[2])}else if(n)for(let e=0,t=s.length;e<t;e++){const t=s[e];t[2]=n(t[2])}}:null}};(0,n._)([(0,p.Cb)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,n._)([(0,p.Cb)({type:[i.Z],json:{write:!0}})],w.prototype,"features",void 0),(0,n._)([(0,c.r)("features")],w.prototype,"readFeatures",null),(0,n._)([(0,p.Cb)({type:[m.Z],json:{write:!0}})],w.prototype,"fields",void 0),(0,n._)([(0,p.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:g.read}}})],w.prototype,"geometryType",void 0),(0,n._)([(0,y.c)("geometryType")],w.prototype,"writeGeometryType",null),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,n._)([(0,p.Cb)({types:s.qM,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,n._)([(0,c.r)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,n._)([(0,p.Cb)({type:f.Z,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,n._)([(0,y.c)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,n._)([(0,p.Cb)({json:{write:!0}})],w.prototype,"transform",void 0),w=o=(0,n._)([(0,d.j)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const b=w},36405:(e,t,r)=>{function o(e,t){return null!=t&&t.mode?t.mode:function(e){return e?u:p}(e).mode}function n(e,t){return o(null!=e&&e.hasZ,t)}function s(e,t,r){return r&&r.mode!==t?`${e} only support ${t} elevation mode`:null}function i(e,t,r){return r?.mode===t?`${e} do not support ${t} elevation mode`:null}function a(e,t){return null!=t?.featureExpressionInfo&&"0"!==t.featureExpressionInfo.expression?`${e} do not support featureExpressionInfo`:null}function l(e,t){t&&e.warn(".elevationInfo=",t)}r.d(t,{LR:()=>l,Uy:()=>s,VW:()=>n,Wb:()=>i,kf:()=>a}),r(12541);const u={mode:"absolute-height",offset:0},p={mode:"on-the-ground",offset:null}},58333:(e,t,r)=>{r.d(t,{ET:()=>s,I4:()=>n,eG:()=>l,lF:()=>i,lj:()=>p,qP:()=>a,wW:()=>u});const o=[252,146,31,255],n={type:"esriSMS",style:"esriSMSCircle",size:6,color:o,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},s={type:"esriSLS",style:"esriSLSSolid",width:.75,color:o},i={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},a={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},l={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},u={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},p={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}},91891:(e,t,r)=>{r.d(t,{I_:()=>d,W7:()=>h,qM:()=>g});var o=r(20102),n=r(22974),s=r(92604),i=r(25683),a=r(35065);const l=s.Z.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function u(e,t,r){let n="",s=0;for(;s<r;){const i=e[t+s];if(i<128)n+=String.fromCharCode(i),s++;else if(i>=192&&i<224){if(s+1>=r)throw new o.Z("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const a=(31&i)<<6|63&e[t+s+1];n+=String.fromCharCode(a),s+=2}else if(i>=224&&i<240){if(s+2>=r)throw new o.Z("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(15&i)<<12|(63&e[t+s+1])<<6|63&e[t+s+2];n+=String.fromCharCode(a),s+=3}else{if(!(i>=240&&i<248))throw new o.Z("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(s+3>=r)throw new o.Z("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const a=(7&i)<<18|(63&e[t+s+1])<<12|(63&e[t+s+2])<<6|63&e[t+s+3];if(a>=65536){const e=55296+(a-65536>>10),t=56320+(1023&a);n+=String.fromCharCode(e,t)}else n+=String.fromCharCode(a);s+=4}}}return n}function p(e,t){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let o=0;for(let n=0;n<t.length;n++){const s=t[n],i=s.valueType||s.type,a=b[i];r.fields[s.property]=a(e,o),o+=w[i].BYTES_PER_ELEMENT}return r.byteCount=o,r}function c(e,t,r){const n=[];let s,i,a=0;for(i=0;i<e;i+=1){if(s=t[i],s>0){if(n.push(u(r,a,s-1)),0!==r[a+s-1])throw new o.Z("string-array-error","Invalid string array: missing null termination.")}else n.push(null);a+=s}return n}function d(e,t){return new(0,w[t.valueType])(e,t.byteOffset,t.count*t.valuesPerElement)}function y(e,t,r){const s=null!=t.header?p(e,t.header):{byteOffset:0,byteCount:0,fields:{count:r}},i={header:s,byteOffset:s.byteCount,byteCount:0,entries:Object.create(null)};let a=s.byteCount;for(let e=0;e<t.ordering.length;e++){const r=t.ordering[e],l=(0,n.d9)(t[r]);if(l.count=s.fields.count??0,"String"===l.valueType){if(l.byteOffset=a,l.byteCount=s.fields[r+"ByteCount"],"UTF-8"!==l.encoding)throw new o.Z("unsupported-encoding","Unsupported String encoding.",{encoding:l.encoding});if(l.timeEncoding&&"ECMA_ISO8601"!==l.timeEncoding)throw new o.Z("unsupported-time-encoding","Unsupported time encoding.",{timeEncoding:l.timeEncoding})}else{if(!C(l.valueType))throw new o.Z("unsupported-value-type","Unsupported binary valueType",{valueType:l.valueType});{const e=v(l.valueType);a+=a%e!=0?e-a%e:0,l.byteOffset=a,l.byteCount=e*l.valuesPerElement*l.count}}a+=l.byteCount??0,i.entries[r]=l}return i.byteCount=a-i.byteOffset,i}function f(e,t,r){if(t!==e&&l.error(`Invalid ${r} buffer size\n expected: ${e}, actual: ${t})`),t<e)throw new o.Z("buffer-too-small","Binary buffer is too small",{expectedSize:e,actualSize:t})}function h(e,t){const r=p(e,t&&t.header);let o=r.byteCount;const n={isDraco:!1,header:r,byteOffset:r.byteCount,byteCount:0,vertexAttributes:{}},s=r.fields,i=null!=s.vertexCount?s.vertexCount:s.count;for(const e of t.ordering){if(!t.vertexAttributes[e])continue;const r={...t.vertexAttributes[e],byteOffset:o,count:i},s=m[e]||"_"+e;n.vertexAttributes[s]=r,o+=v(r.valueType)*r.valuesPerElement*i}const a=s.faceCount;if(t.faces&&a){n.faces={};for(const e of t.ordering){if(!t.faces[e])continue;const r={...t.faces[e],byteOffset:o,count:a};n.faces[e]=r,o+=v(r.valueType)*r.valuesPerElement*a}}const l=s.featureCount;if(t.featureAttributes&&t.featureAttributeOrder&&l){n.featureAttributes={};for(const e of t.featureAttributeOrder){if(!t.featureAttributes[e])continue;const r={...t.featureAttributes[e],byteOffset:o,count:l};n.featureAttributes[e]=r,o+=("UInt64"===r.valueType?8:v(r.valueType))*r.valuesPerElement*l}}return f(o,e.byteLength,"geometry"),n.byteCount=o-n.byteOffset,n}const m={position:a.T.POSITION,normal:a.T.NORMAL,color:a.T.COLOR,uv0:a.T.UV0,region:a.T.UVREGION};function g(e,t,r){if("lepcc-rgb"===e.encoding)return(0,i.IT)(t);if("lepcc-intensity"===e.encoding)return(0,i.ti)(t);if(null!=e.encoding&&""!==e.encoding)throw new o.Z("unknown-attribute-storage-info-encoding","Unknown Attribute Storage Info Encoding");e["attributeByteCounts "]&&!e.attributeByteCounts&&(l.warn("Warning: Trailing space in 'attributeByteCounts '."),e.attributeByteCounts=e["attributeByteCounts "]),"ObjectIds"===e.ordering[0]&&e.hasOwnProperty("objectIds")&&(l.warn("Warning: Case error in objectIds"),e.ordering[0]="objectIds");const n=y(t,e,r);f(n.byteOffset+n.byteCount,t.byteLength,"attribute");const s=n.entries.attributeValues||n.entries.objectIds;if(s){if("String"===s.valueType){const e=n.entries.attributeByteCounts,r=d(t,e),o=function(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}(t,s);return s.timeEncoding?function(e,t,r){return c(e,t,r).map((e=>{const t=e?Date.parse(e):null;return t&&!Number.isNaN(t)?t:null}))}(e.count,r,o):c(e.count,r,o)}return d(t,s)}throw new o.Z("bad-attribute-storage-info","Bad attributeStorageInfo specification.")}const w={Float32:Float32Array,Float64:Float64Array,UInt8:Uint8Array,Int8:Int8Array,UInt16:Uint16Array,Int16:Int16Array,UInt32:Uint32Array,Int32:Int32Array},b={Float32:(e,t)=>new DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function C(e){return w.hasOwnProperty(e)}function v(e){return C(e)?w[e].BYTES_PER_ELEMENT:0}},2358:(e,t,r)=>{r.d(t,{xe:()=>w});var o=r(3172),n=(r(67676),r(20102),r(80442),r(1533)),s=(r(21787),r(46521)),i=(r(52138),r(13598)),a=(r(51305),r(94961)),l=(r(17896),r(65617));r(2109),r(73615),r(82971),r(58995),r(83932),r(87360),(0,l.c)();var u=r(24470),p=(r(8744),r(14165),r(91891));r(22303);var c,d,y=r(88669);(d=c||(c={}))[d.INVISIBLE=0]="INVISIBLE",d[d.TRANSPARENT=1]="TRANSPARENT",d[d.OPAQUE=2]="OPAQUE";(0,y.f)(0,0,0,.2),c.OPAQUE;(0,y.f)(0,0,0,.2),c.OPAQUE,r(6206);var f,h,m=r(87951),g=r(51417);async function w(e,t,r,n,s){const i=[];for(const o of t)if(o&&s.includes(o.name)){const t=`${e}/nodes/${r}/attributes/${o.key}/0`;i.push({url:t,storageInfo:o})}const a=await Promise.allSettled(i.map((e=>(0,o.Z)(e.url,{responseType:"array-buffer"}).then((t=>(0,p.qM)(e.storageInfo,t.data)))))),l=[];for(const e of n){const t={};for(let r=0;r<a.length;r++){const o=a[r];if("fulfilled"===o.status){const n=o.value;t[i[r].storageInfo.name]=v(n,e)}}l.push(t)}return l}(0,u.Ue)(),(h=f||(f={}))[h.OUTSIDE=0]="OUTSIDE",h[h.INTERSECTS_CENTER_OUTSIDE=1]="INTERSECTS_CENTER_OUTSIDE",h[h.INTERSECTS_CENTER_INSIDE=2]="INTERSECTS_CENTER_INSIDE",h[h.INSIDE=3]="INSIDE";const b=-32768,C=-(2**31);function v(e,t){if(!e)return null;const r=e[t];return(0,n.z3)(e)?r===b?null:r:(0,n.Hx)(e)?r===C?null:r:r!=r?null:r}const S=new Array(24);new g.a(S,3,!0),(0,l.c)(),(0,l.c)(),(0,s.a)(),(0,i.a)(),(0,a.a)(),(0,u.Ue)(),(0,u.Ue)(),(0,m.Ue)(),(0,l.c)(),new Array(72),(0,i.a)()},25683:(e,t,r)=>{r.d(t,{Gi:()=>u,IT:()=>f,ti:()=>g});var o=r(20102);const n=!0,s={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function i(e,t,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(e,r+s.identifierOffset,s.identifierLength)),version:t.getUint16(r+s.versionOffset,n),checksum:t.getUint32(r+s.checksumOffset,n)}}const a={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function l(e,t){return{sizeLo:e.getUint32(t+a.sizeLo,n),sizeHi:e.getUint32(t+a.sizeHi,n),minX:e.getFloat64(t+a.minX,n),minY:e.getFloat64(t+a.minY,n),minZ:e.getFloat64(t+a.minZ,n),maxX:e.getFloat64(t+a.maxX,n),maxY:e.getFloat64(t+a.maxY,n),maxZ:e.getFloat64(t+a.maxZ,n),errorX:e.getFloat64(t+a.errorX,n),errorY:e.getFloat64(t+a.errorY,n),errorZ:e.getFloat64(t+a.errorZ,n),count:e.getUint32(t+a.count,n),reserved:e.getUint32(t+a.reserved,n)}}function u(e){const t=new DataView(e,0);let r=0;const{identifier:n,version:u}=i(e,t,r);if(r+=s.byteCount,"LEPCC "!==n)throw new o.Z("lepcc-decode-error","Bad identifier");if(u>1)throw new o.Z("lepcc-decode-error","Unknown version");const c=l(t,r);if(r+=a.byteCount,c.sizeHi*2**32+c.sizeLo!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");const d=new Float64Array(3*c.count),y=[],f=[],h=[],m=[];if(r=p(e,r,y),r=p(e,r,f),r=p(e,r,h),r=p(e,r,m),r!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad length");let g=0,w=0;for(let e=0;e<y.length;e++){w+=y[e];let t=0;for(let r=0;r<f[e];r++){t+=h[g];const e=m[g];d[3*g]=Math.min(c.maxX,c.minX+2*c.errorX*t),d[3*g+1]=Math.min(c.maxY,c.minY+2*c.errorY*w),d[3*g+2]=Math.min(c.maxZ,c.minZ+2*c.errorZ*e),g++}}return{errorX:c.errorX,errorY:c.errorY,errorZ:c.errorZ,result:d}}function p(e,t,r){const o=[];t=c(e,t,o);const n=[];for(let s=0;s<o.length;s++){n.length=0,t=c(e,t,n);for(let e=0;e<n.length;e++)r.push(n[e]+o[s])}return t}function c(e,t,r){const s=new DataView(e,t),i=s.getUint8(0),a=31&i,l=!!(32&i),u=(192&i)>>6;let p=0;if(0===u)p=s.getUint32(1,n),t+=5;else if(1===u)p=s.getUint16(1,n),t+=3;else{if(2!==u)throw new o.Z("lepcc-decode-error","Bad count type");p=s.getUint8(1),t+=2}if(l)throw new o.Z("lepcc-decode-error","LUT not implemented");const c=Math.ceil(p*a/8),d=new Uint8Array(e,t,c);let y=0,f=0,h=0;const m=-1>>>32-a;for(let e=0;e<p;e++){for(;f<a;)y|=d[h]<<f,f+=8,h+=1;r[e]=y&m,y>>>=a,f-=a,f+a>32&&(y|=d[h-1]>>8-f)}return t+h}const d={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function y(e,t){return{sizeLo:e.getUint32(t+d.sizeLo,n),sizeHi:e.getUint32(t+d.sizeHi,n),count:e.getUint32(t+d.count,n),colorMapCount:e.getUint16(t+d.colorMapCount,n),lookupMethod:e.getUint8(t+d.lookupMethod),compressionMethod:e.getUint8(t+d.compressionMethod)}}function f(e){const t=new DataView(e,0);let r=0;const{identifier:n,version:a}=i(e,t,r);if(r+=s.byteCount,"ClusterRGB"!==n)throw new o.Z("lepcc-decode-error","Bad identifier");if(a>1)throw new o.Z("lepcc-decode-error","Unknown version");const l=y(t,r);if(r+=d.byteCount,l.sizeHi*2**32+l.sizeLo!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");if((2===l.lookupMethod||1===l.lookupMethod)&&0===l.compressionMethod){if(3*l.colorMapCount+l.count+r!==e.byteLength||l.colorMapCount>256)throw new o.Z("lepcc-decode-error","Bad count");const t=new Uint8Array(e,r,3*l.colorMapCount),n=new Uint8Array(e,r+3*l.colorMapCount,l.count),s=new Uint8Array(3*l.count);for(let e=0;e<l.count;e++){const r=n[e];s[3*e]=t[3*r],s[3*e+1]=t[3*r+1],s[3*e+2]=t[3*r+2]}return s}if(0===l.lookupMethod&&0===l.compressionMethod){if(3*l.count+r!==e.byteLength||0!==l.colorMapCount)throw new o.Z("lepcc-decode-error","Bad count");return new Uint8Array(e,r).slice()}if(l.lookupMethod<=2&&1===l.compressionMethod){if(r+3!==e.byteLength||1!==l.colorMapCount)throw new o.Z("lepcc-decode-error","Bad count");const n=t.getUint8(r),s=t.getUint8(r+1),i=t.getUint8(r+2),a=new Uint8Array(3*l.count);for(let e=0;e<l.count;e++)a[3*e]=n,a[3*e+1]=s,a[3*e+2]=i;return a}throw new o.Z("lepcc-decode-error","Bad method "+l.lookupMethod+","+l.compressionMethod)}const h={sizeLo:0,sizeHi:4,count:8,scaleFactor:12,bitsPerPoint:14,reserved:15,byteCount:16};function m(e,t){return{sizeLo:e.getUint32(t+h.sizeLo,n),sizeHi:e.getUint32(t+h.sizeHi,n),count:e.getUint32(t+h.count,n),scaleFactor:e.getUint16(t+h.scaleFactor,n),bitsPerPoint:e.getUint8(t+h.bitsPerPoint),reserved:e.getUint8(t+h.reserved)}}function g(e){const t=new DataView(e,0);let r=0;const{identifier:n,version:a}=i(e,t,r);if(r+=s.byteCount,"Intensity "!==n)throw new o.Z("lepcc-decode-error","Bad identifier");if(a>1)throw new o.Z("lepcc-decode-error","Unknown version");const l=m(t,r);if(r+=h.byteCount,l.sizeHi*2**32+l.sizeLo!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");const u=new Uint16Array(l.count);if(8===l.bitsPerPoint){if(l.count+r!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");const t=new Uint8Array(e,r,l.count);for(let e=0;e<l.count;e++)u[e]=t[e]*l.scaleFactor}else if(16===l.bitsPerPoint){if(2*l.count+r!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");const t=new Uint16Array(e,r,l.count);for(let e=0;e<l.count;e++)u[e]=t[e]*l.scaleFactor}else{const t=[];if(c(e,r,t)!==e.byteLength)throw new o.Z("lepcc-decode-error","Bad size");for(let e=0;e<l.count;e++)u[e]=t[e]*l.scaleFactor}return u}},19833:(e,t,r)=>{r.d(t,{V5:()=>s,e7:()=>n});var o=r(35671);async function n(e,t=e.popupTemplate){if(null==t)return[];const r=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:n}=t,{objectIdField:s,typeIdField:i,globalIdField:a,relationships:l}=e;if(r.includes("*"))return["*"];const u=n?await(0,o.CH)(e):[],p=(0,o.Q0)(e.fieldsIndex,[...r,...u]);return i&&p.push(i),p&&s&&e.fieldsIndex?.has(s)&&!p.includes(s)&&p.push(s),p&&a&&e.fieldsIndex?.has(a)&&!p.includes(a)&&p.push(a),l&&l.forEach((t=>{const{keyField:r}=t;p&&r&&e.fieldsIndex?.has(r)&&!p.includes(r)&&p.push(r)})),p}function s(e,t){return e.popupTemplate?e.popupTemplate:null!=t&&t.defaultPopupTemplateEnabled&&null!=e.defaultPopupTemplate?e.defaultPopupTemplate:null}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7476],{28576:(e,t,r)=>{r.d(t,{B:()=>y});var i=r(20102),s=r(44543),o=r(81153),a=r(17452),n=r(41123),l=r(7628),p=r(31263),d=r(5600),c=r(66094),u=r(25929);function y(e){const t=e?.origins??[void 0];return(r,i)=>{const s=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const i=(0,l.Oe)(t,r);return{type:String,read:(e,t,r)=>{const s=(0,u.r)(e,t,r);return i.type===String?s:"function"==typeof i.type?new i.type({url:s}):void 0},write:{writer(t,s,n,l){if(!l||!l.resources)return"string"==typeof t?void(s[n]=(0,u.t)(t,l)):void(s[n]=t.write({},l));const d=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),y=(0,u.t)(d,{...l,verifyItemRelativeUrls:l&&l.verifyItemRelativeUrls?{writtenUrls:l.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},u.M.NO),m=i.type!==String&&(!(0,o.l)(this)||l&&l.origin&&this.originIdOf(r)>(0,p.M9)(l.origin)),b={object:this,propertyName:r,value:t,targetUrl:y,dest:s,targetPropertyName:n,context:l,params:e};l&&l.portalItem&&y&&!(0,a.YP)(y)?m&&e?.contentAddressed?h(b):m?function(e){const{context:t,targetUrl:r,params:i,value:s,dest:o,targetPropertyName:n}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),p=g(s,r,t),d=(0,c.B)(p),u=(0,a.Ml)(l.path),y=i?.compress??!1;d===u?(t.resources&&f({...e,resource:l,content:p,compress:y,updates:t.resources.toUpdate}),o[n]=r):h(e)}(b):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(b):l&&l.portalItem&&(null==y||null!=(0,u.i)(y)||(0,a.jc)(y)||m)?h(b):s[n]=y}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=u.a;return{read:e,write:t}}}}(e,r,i);for(const e of t){const t=(0,d.CJ)(r,e,i);for(const e in s)t[e]=s[e]}}}function h(e){const{targetUrl:t,params:r,value:o,context:l,dest:p,targetPropertyName:d}=e;if(!l.portalItem)return;const y=(0,u.p)(t),h=g(o,t,l);if(r?.contentAddressed&&"json"!==h.type)return void l.messages?.push(new i.Z("persistable:contentAddressingUnsupported",`Property "${d}" is trying to serializing a resource with content of type ${h.type} with content addressing. Content addressing is only supported for json resources.`,{content:h}));const m=r?.contentAddressed&&"json"===h.type?(0,s.F)(h.jsonString):y?.filename??(0,n.D)(),b=(0,a.v_)(r?.prefix??y?.prefix,m),v=`${b}.${(0,c.B)(h)}`;if(r?.contentAddressed&&l.resources&&"json"===h.type){const e=l.resources.toKeep.find((e=>e.resource.path===v))??l.resources.toAdd.find((e=>e.resource.path===v));if(e)return void(p[d]=e.resource.itemRelativeUrl)}const w=l.portalItem.resourceFromPath(v);(0,a.jc)(t)&&l.resources&&l.resources.pendingOperations.push((0,a.gi)(t).then((e=>{w.path=`${b}.${(0,c.B)({type:"blob",blob:e})}`,p[d]=w.itemRelativeUrl})).catch((()=>{})));const _=r?.compress??!1;l.resources&&f({...e,resource:w,content:h,compress:_,updates:l.resources.toAdd}),p[d]=w.itemRelativeUrl}function f({object:e,propertyName:t,updates:r,resource:i,content:s,compress:o}){r.push({resource:i,content:s,compress:o,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function g(e,t,r){return"string"==typeof e?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(r))}}},57476:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ge});var i=r(43697),s=r(38171),o=r(51773),a=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),n=r(3172),l=r(2368),p=r(46791),d=r(20102),c=r(92604),u=r(16453),y=r(95330),h=r(17445),f=r(17452),g=r(5600),m=(r(75215),r(67676),r(80442),r(1153)),b=r(71715),v=r(52011),w=r(31263),_=r(87085),I=r(54295),L=r(17287),S=r(54253),F=r(38009),C=r(16859),j=r(72965),O=r(20559),x=r(66677),A=r(15506),E=r(21506),R=r(50957),P=r(61960),T=r(85857),Z=r(14147),N=r(53518),U=r(99514),D=r(35671),q=r(51161),G=r(54306),Q=r(30707),k=r(56765),V=r(96674);let J=class extends V.wq{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,i._)([(0,g.Cb)({type:String,json:{read:!0,write:!0}})],J.prototype,"name",void 0),(0,i._)([(0,g.Cb)({type:String,json:{read:!0,write:!0}})],J.prototype,"field",void 0),(0,i._)([(0,g.Cb)({type:[Number],json:{read:!0,write:!0}})],J.prototype,"currentRangeExtent",void 0),(0,i._)([(0,g.Cb)({type:[Number],json:{read:!0,write:!0}})],J.prototype,"fullRangeExtent",void 0),(0,i._)([(0,g.Cb)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],J.prototype,"type",void 0),J=(0,i._)([(0,v.j)("esri.layers.support.RangeInfo")],J);var M,$=r(22974),z=r(28576),H=r(20941),K=r(38913),B=r(73615);let W=M=class extends((0,V.eC)(p.Z.ofType(K.Z))){constructor(e){super(e)}clone(){return new M(this.items.map((e=>e.clone())))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map((r=>{if(!t.equals(r.spatialReference)){if(!(0,B.canProjectWithoutEngine)(r.spatialReference,t))return e&&e.messages&&e.messages.push(new H.Z("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const i=new K.Z;(0,B.projectPolygon)(r,i,t),r=i}const i=r.toJSON(e);return delete i.spatialReference,i})).filter((e=>null!=e)):(e?.messages&&e.messages.push(new H.Z("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((t=>t.toJSON(e))))}static fromJSON(e,t){const r=new M;return e.forEach((e=>r.add(K.Z.fromJSON(e,t)))),r}};W=M=(0,i._)([(0,v.j)("esri.layers.support.PolygonCollection")],W);const Y=W;var X,ee=r(25929);let te=X=class extends V.wq{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new Y,this._geometriesSource=null}initialize(){this.addHandles((0,h.on)((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),h.Z_))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=Y.fromJSON(e,r):this._geometriesSource={url:(0,ee.f)(e,r),context:r}}async loadGeometries(e,t){if(null==this._geometriesSource)return;const{url:r,context:i}=this._geometriesSource,s=await(0,n.Z)(r,{responseType:"json",signal:t?.signal}),o=e.toJSON(),a=s.data.map((e=>({...e,spatialReference:o})));this.geometries=Y.fromJSON(a,i),this._geometriesSource=null}clone(){const e=new X({geometries:(0,$.d9)(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};(0,i._)([(0,g.Cb)({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],te.prototype,"spatialRelationship",void 0),(0,i._)([(0,g.Cb)({type:Y,nonNullable:!0,json:{write:!0}}),(0,z.B)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],te.prototype,"geometries",void 0),(0,i._)([(0,b.r)(["web-scene","portal-item"],"geometries")],te.prototype,"readGeometries",null),te=X=(0,i._)([(0,v.j)("esri.layers.support.SceneFilter")],te);const re=te;var ie=r(40555),se=r(14165),oe=r(36405),ae=r(72245),ne=r(32163),le=r(2358),pe=r(19833),de=r(65242);const ce=["3DObject","Point"],ue=(0,N.v)();let ye=class extends((0,S.o1)((0,O.Vt)((0,L.Y)((0,F.q)((0,C.I)((0,j.M)((0,u.R)((0,I.V)((0,l.J)(_.Z)))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new p.Z,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new U.Z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:q.U4.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&(0,R.sX)(this.associatedLayer)}get geometryType(){return fe[this.profile]||"mesh"}set renderer(e){(0,D.YN)(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:A.C;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:c},operations:{supportsEditing:u,supportsAdd:y,supportsUpdate:h,supportsDelete:f,supportsQuery:g,supportsQueryAttachments:m,supportsAsyncConvert3D:b}}=e,v=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D&&(0,ae.Rx)();return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:c,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:g,supportsQueryAttachments:m,supportsEditing:u&&v,supportsAdd:w&&y&&v,supportsDelete:w&&f&&v,supportsUpdate:h&&v,supportsAsyncConvert3D:b}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&he[r]?he[r]:(c.Z.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y.r9),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),await this._validateElevationInfo(),await this._applyAssociatedLayerOverrides(),await this._populateFieldUsageInfo(),await(0,ie.y)(this,{origin:"service"},t),await(0,D.YN)(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){c.Z.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new se.Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=(0,D.Lk)(this.fieldsIndex,await(0,pe.e7)(this,(0,pe.V5)(this)));return(0,le.xe)(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new d.Z("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new s.Z;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(c.Z.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,ne.eZ)(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d.Z("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new d.Z("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new d.Z("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const e of this.statisticsInfo)if(e.name===r.name){const r=(0,f.v_)(this.parsedUrl.path,e.href);return(0,n.Z)(r,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new d.Z("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(O.xp.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(O.xp.SAVE,e)}async applyEdits(e,t){const{applyEdits:i}=await r.e(1444).then(r.bind(r,14720));if(await this.load(),!this.associatedLayer)throw new d.Z(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),i(this,this.associatedLayer.source,e,t)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new d.Z(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!ce.includes(e.layerType))throw new d.Z("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d.Z("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d.Z("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new d.Z("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new d.Z("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new d.Z("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=(0,m.vw)(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(o===w.s3.SERVICE||o===w.s3.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.editingInfo?.lastEditDate,t=this.associatedLayer?.serverGens,r=this.associatedLayer?.getAtOrigin("fullExtent","service");(0,ae.Rx)()&&null!=this.associatedLayer?.infoFor3D&&r&&(0,x.M8)(this.associatedLayer?.url)&&e&&this.serviceUpdateTimeStamp?.lastUpdate!==e.getTime()&&(this.serviceUpdateTimeStamp||t?.minServerGen!==t?.serverGen)&&(0,m.vw)(this).setAtOrigin("fullExtent",r.clone(),w.s3.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(!["mesh-pyramids","points"].includes(this.profile))return;const t=new Z.W(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedLayer=await t.fetch()}catch(e){(0,y.D_)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await(0,h.N1)((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?c.Z.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):c.Z.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&(0,oe.LR)(c.Z.getLogger(this),(0,oe.Wb)("Mesh scene layers","relative-to-scene",e)),(0,oe.LR)(c.Z.getLogger(this),(0,oe.kf)("Scene layers",e))}};(0,i._)([(0,g.Cb)({types:{key:"type",base:P.B,typeMap:{selection:T.Z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],ye.prototype,"featureReduction",void 0),(0,i._)([(0,g.Cb)({type:[J],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],ye.prototype,"rangeInfos",void 0),(0,i._)([(0,g.Cb)({json:{read:!1}})],ye.prototype,"associatedLayer",void 0),(0,i._)([(0,g.Cb)({type:["show","hide"]})],ye.prototype,"listMode",void 0),(0,i._)([(0,g.Cb)({type:["ArcGISSceneServiceLayer"]})],ye.prototype,"operationalLayerType",void 0),(0,i._)([(0,g.Cb)({json:{read:!1},readOnly:!0})],ye.prototype,"type",void 0),(0,i._)([(0,g.Cb)({...ue.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ye.prototype,"fields",void 0),(0,i._)([(0,g.Cb)()],ye.prototype,"types",null),(0,i._)([(0,g.Cb)()],ye.prototype,"typeIdField",null),(0,i._)([(0,g.Cb)()],ye.prototype,"templates",null),(0,i._)([(0,g.Cb)()],ye.prototype,"formTemplate",null),(0,i._)([(0,g.Cb)({readOnly:!0})],ye.prototype,"fieldsIndex",null),(0,i._)([(0,g.Cb)({type:k.Z,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],ye.prototype,"floorInfo",void 0),(0,i._)([(0,g.Cb)(ue.outFields)],ye.prototype,"outFields",void 0),(0,i._)([(0,g.Cb)({type:q.U4,readOnly:!0,json:{read:!1}})],ye.prototype,"nodePages",void 0),(0,i._)([(0,b.r)("service","nodePages",["nodePages","pointNodePages"])],ye.prototype,"readNodePages",null),(0,i._)([(0,g.Cb)({type:[q.QI],readOnly:!0})],ye.prototype,"materialDefinitions",void 0),(0,i._)([(0,g.Cb)({type:[q.Yh],readOnly:!0})],ye.prototype,"textureSetDefinitions",void 0),(0,i._)([(0,g.Cb)({type:[q.H3],readOnly:!0})],ye.prototype,"geometryDefinitions",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],ye.prototype,"serviceUpdateTimeStamp",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],ye.prototype,"attributeStorageInfo",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],ye.prototype,"statisticsInfo",void 0),(0,i._)([(0,g.Cb)({type:p.Z.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],ye.prototype,"excludeObjectIds",void 0),(0,i._)([(0,g.Cb)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],ye.prototype,"definitionExpression",void 0),(0,i._)([(0,g.Cb)({type:re,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],ye.prototype,"filter",void 0),(0,i._)([(0,g.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ye.prototype,"path",void 0),(0,i._)([(0,g.Cb)(E.PV)],ye.prototype,"elevationInfo",null),(0,i._)([(0,g.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"effectiveCapabilities",null),(0,i._)([(0,g.Cb)({readOnly:!0})],ye.prototype,"effectiveEditingEnabled",null),(0,i._)([(0,g.Cb)({type:String})],ye.prototype,"geometryType",null),(0,i._)([(0,g.Cb)(E.iR)],ye.prototype,"labelsVisible",void 0),(0,i._)([(0,g.Cb)({type:[G.Z],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:Q.r},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Q.r},write:!0}})],ye.prototype,"labelingInfo",void 0),(0,i._)([(0,g.Cb)(E.rn)],ye.prototype,"legendEnabled",void 0),(0,i._)([(0,g.Cb)({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?(0,de.b)(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],ye.prototype,"opacity",void 0),(0,i._)([(0,g.Cb)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ye.prototype,"priority",void 0),(0,i._)([(0,g.Cb)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ye.prototype,"semantic",void 0),(0,i._)([(0,g.Cb)({types:a.o,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],ye.prototype,"renderer",null),(0,i._)([(0,g.Cb)({json:{read:!1}})],ye.prototype,"cachedDrawingInfo",void 0),(0,i._)([(0,b.r)("service","cachedDrawingInfo")],ye.prototype,"readCachedDrawingInfo",null),(0,i._)([(0,g.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"capabilities",null),(0,i._)([(0,g.Cb)({type:Boolean,json:{read:!1}})],ye.prototype,"editingEnabled",null),(0,i._)([(0,g.Cb)({readOnly:!0,json:{write:!1,read:!1}})],ye.prototype,"infoFor3D",null),(0,i._)([(0,g.Cb)({readOnly:!0,json:{write:!1,read:!1}})],ye.prototype,"relationships",null),(0,i._)([(0,g.Cb)(E.C_)],ye.prototype,"popupEnabled",void 0),(0,i._)([(0,g.Cb)({type:o.Z,json:{name:"popupInfo",write:!0}})],ye.prototype,"popupTemplate",void 0),(0,i._)([(0,g.Cb)({readOnly:!0,json:{read:!1}})],ye.prototype,"defaultPopupTemplate",null),(0,i._)([(0,g.Cb)({type:String,json:{read:!1}})],ye.prototype,"objectIdField",void 0),(0,i._)([(0,b.r)("service","objectIdField",["objectIdField","fields"])],ye.prototype,"readObjectIdField",null),(0,i._)([(0,g.Cb)({type:String,json:{read:!1}})],ye.prototype,"globalIdField",void 0),(0,i._)([(0,b.r)("service","globalIdField",["globalIdField","fields"])],ye.prototype,"readGlobalIdField",null),(0,i._)([(0,g.Cb)({readOnly:!0,type:String,json:{read:!1}})],ye.prototype,"displayField",null),(0,i._)([(0,g.Cb)({type:String,json:{read:!1}})],ye.prototype,"profile",void 0),(0,i._)([(0,b.r)("service","profile",["store.profile"])],ye.prototype,"readProfile",null),(0,i._)([(0,g.Cb)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],ye.prototype,"normalReferenceFrame",void 0),(0,i._)([(0,g.Cb)(E.YI)],ye.prototype,"screenSizePerspectiveEnabled",void 0),(0,i._)([(0,g.Cb)({json:{read:!1,origins:{service:{read:!0}}}})],ye.prototype,"serviceItemId",void 0),ye=(0,i._)([(0,v.j)("esri.layers.SceneLayer")],ye);const he={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},fe={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},ge=ye},66094:(e,t,r)=>{r.d(t,{B:()=>s});var i=r(17452);function s(e){return o[function(e){return"json"===e.type?"application/json":"blob"===e.type?e.blob.type:function(e){const t=(0,i.Ml)(e);return l[t]||a}(e.url)}(e)]||n}const o={},a="text/plain",n=o[a],l={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in l)o[l[e]]=e}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[223],{91303:(e,t,i)=>{var r;i.d(t,{Y:()=>r}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(r||(r={}))},17287:(e,t,i)=>{i.d(t,{Y:()=>o});var r=i(43697),l=i(92604),s=i(5600),n=(i(75215),i(67676),i(80442),i(52011)),a=i(66677);const o=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,a.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,a.Nm)(e,l.Z.getLogger(this)))}};return(0,r._)([(0,s.Cb)()],t.prototype,"title",null),(0,r._)([(0,s.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,n.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,i)=>{i.d(t,{I:()=>I});var r=i(43697),l=i(68773),s=i(40330),n=i(3172),a=i(66643),o=i(20102),c=i(92604),u=i(70586),h=i(95330),p=i(17452),d=i(5600),f=(i(75215),i(67676),i(80442),i(71715)),v=i(52011),m=i(30556),y=i(84230),g=i(48522),w=i(15235),_=i(86082),b=i(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,u.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,i){if(t.itemId)return new w.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const{load:r}=await i.e(8062).then(i.bind(i,18062));return(0,h.k_)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,h.D_)(e)||c.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,h.r9)(e),!0))))}async setUserPrivileges(e,t){if(!l.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:i,fullEdit:r},content:{updateItem:l}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",l)}catch(e){(0,h.r9)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=e===i.id;if(r&&i.portal.user)return(0,b.Ss)(i);let l,n;if(r)l=i.portal.url;else try{l=await(0,y.oP)(this.url,t)}catch(e){(0,h.r9)(e)}if(!l||!(0,p.Zo)(l,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;n=await(s.id?.getCredential(`${l}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.r9)(e)}if(!n)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(r?await i.reload():(i=new w.default({id:e,portal:{url:l}}),await i.load(t)),i.portal.user)return(0,b.Ss)(i)}catch(e){(0,h.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,h.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const i=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=i,null==i||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=s.id.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,l=g.Z.getDefault();if(l&&l.loaded&&(0,p.Fv)(l.restUrl)===(0,p.Fv)(r))return l.user;const o=`${r}/community/self`,c=null!=e?e.signal:null,u=await(0,a.q6)((0,n.Z)(o,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?_.Z.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||g.Z.getDefault());return i&&r&&!(0,p.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new o.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,r._)([(0,d.Cb)({type:w.default})],t.prototype,"portalItem",null),(0,r._)([(0,f.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,r._)([(0,v.j)("esri.layers.mixins.PortalLayer")],t),t},S={credential:null,user:null}},39450:(e,t,i)=>{i.d(t,{Z:()=>u});var r,l=i(43697),s=i(96674),n=i(5600),a=i(75215),o=(i(67676),i(80442),i(52011));let c=r=class extends s.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,l._)([(0,n.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,l._)([(0,n.Cb)({type:a.z8,json:{write:!0}})],c.prototype,"level",void 0),(0,l._)([(0,n.Cb)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,l._)([(0,n.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,l._)([(0,n.Cb)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,l._)([(0,n.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,l._)([(0,n.Cb)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=r=(0,l._)([(0,o.j)("esri.layers.support.LOD")],c);const u=c},11145:(e,t,i)=>{i.d(t,{Z:()=>O});var r,l=i(43697),s=i(35454),n=i(96674),a=i(67900),o=i(5600),c=i(75215),u=(i(67676),i(80442),i(71715)),h=i(52011),p=i(30556),d=i(94139),f=i(82971),v=i(24470),m=i(8744),y=i(40488),g=i(39450),w=i(43077);const _=new s.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let b=r=class extends n.wq{static create(e={}){const{resolutionFactor:t=1,scales:i,size:l=256,spatialReference:s=f.Z.WebMercator,numLODs:n=24}=e;if(!(0,m.JY)(s)){const e=[];if(i)for(let t=0;t<i.length;t++){const r=i[t];e.push(new g.Z({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=n-1;i>=0;i--)e.unshift(new g.Z({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new d.Z(0,0,s),size:[l,l],spatialReference:s})}const o=(0,m.C5)(s),c=e.origin?new d.Z({x:e.origin.x,y:e.origin.y,spatialReference:s}):new d.Z(o?{x:o.origin[0],y:o.origin[1],spatialReference:s}:{x:0,y:0,spatialReference:s}),u=1/(39.37*(0,a.c9)(s)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],r=t*u;h.push(new g.Z({level:e,scale:t,resolution:r}))}else{let e=(0,m.sT)(s)?512/l*591657527.5917094:256/l*591657527.591555;const i=Math.ceil(n/t);h.push(new g.Z({level:0,scale:e,resolution:e*u}));for(let r=1;r<i;r++){const i=e/2**t,l=i*u;h.push(new g.Z({level:r,scale:i,resolution:l})),e=i}}return new r({dpi:96,lods:h,origin:c,size:[l,l],spatialReference:s})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,m.C5)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return d.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const r=[],l=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach((e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,l[e.level]=e}))),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let r=0;for(;r<i;r++){const i=t[r],l=t[r+1];if(i<=e)return r;if(l===e)return r+1;if(i>e&&l<e)return r+Math.log(i/e)/Math.log(i/l)}return r}snapScale(e,t=.95){const i=this.scaleToZoom(e);return i%Math.floor(i)>=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,r){const l=this.lodAt(e);if(!l)return null;let s,n;if("number"==typeof t)s=t,n=i;else if((0,m.fS)(t.spatialReference,this.spatialReference))s=t.x,n=t.y,r=i;else{const e=(0,y.iV)(t,this.spatialReference);if(null==e)return null;s=e.x,n=e.y,r=i}const a=l.resolution*this.size[0],o=l.resolution*this.size[1];return r||(r=new w.f(null,0,0,0,(0,v.Ue)())),r.level=e,r.row=Math.floor((this.origin.y-n)/o+.001),r.col=Math.floor((s-this.origin.x)/a+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=r.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===r.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const l=e.level-i.level,s=i.resolution*this.size[0]/2**l,n=i.resolution*this.size[1]/2**l;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,v.Ue)()),e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+n}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:r}=i,l=r*this.size[0],s=r*this.size[1];return e[0]=this.origin.x+t.col*l,e[1]=this.origin.y-(t.row+1)*s,e[2]=e[0]+l,e[3]=e[1]+s,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const i=[],l=this.lods.length;for(let e=0;e<l;e++){const r=this.lods[e],l=r.resolution*t;i.push(new g.Z({level:r.level,scale:r.scale,resolution:l}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};var I,S;(0,l._)([(0,o.Cb)({type:Number,json:{write:!0}})],b.prototype,"compressionQuality",void 0),(0,l._)([(0,o.Cb)({type:Number,json:{write:!0}})],b.prototype,"dpi",void 0),(0,l._)([(0,o.Cb)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],b.prototype,"format",void 0),(0,l._)([(0,o.Cb)({readOnly:!0})],b.prototype,"isWrappable",null),(0,l._)([(0,o.Cb)({type:d.Z,json:{write:!0}})],b.prototype,"origin",void 0),(0,l._)([(0,u.r)("origin")],b.prototype,"readOrigin",null),(0,l._)([(0,o.Cb)({type:[g.Z],value:null,json:{write:!0}})],b.prototype,"lods",null),(0,l._)([(0,o.Cb)({readOnly:!0})],b.prototype,"scales",void 0),(0,l._)([(0,o.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],b.prototype,"size",void 0),(0,l._)([(0,u.r)("size",["rows","cols"])],b.prototype,"readSize",null),(0,l._)([(0,p.c)("size",{cols:{type:c.z8},rows:{type:c.z8}})],b.prototype,"writeSize",null),(0,l._)([(0,o.Cb)({type:f.Z,json:{write:!0}})],b.prototype,"spatialReference",void 0),b=r=(0,l._)([(0,h.j)("esri.layers.support.TileInfo")],b),(S=(I=b||(b={})).ExtrapolateOptions||(I.ExtrapolateOptions={}))[S.NONE=0]="NONE",S[S.POWER_OF_TWO=1]="POWER_OF_TWO";const O=b},43077:(e,t,i)=>{i.d(t,{f:()=>r});class r{constructor(e,t,i,r,l=void 0){this.id=e,this.level=t,this.row=i,this.col=r,this.extent=l}}},28589:(e,t,i)=>{i.d(t,{y:()=>O});var r,l=i(43697),s=i(3172),n=i(92036),a=i(91303),o=i(20102),c=i(50758),u=i(13867),h=i(44553),p=i(95330),d=i(17445),f=i(1654),v=i(17452),m=i(5600),y=(i(75215),i(67676)),g=(i(80442),i(52011)),w=i(43077),_=i(22974),b=i(1533);class I{constructor(e){this._validateJSON(e);const{location:t,data:i}=e;this.location=Object.freeze((0,_.d9)(t));const r=this.location.width,l=this.location.height;let s=!0,n=!0;const a=function(e,t=!1){return e<=b.c8?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(r*l/32));let o=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(n=!1,a[o]|=1<<t):s=!1,31===t&&++o}n?(this._availability="unavailable",this.byteSize=40):s?(this._availability="available",this.byteSize=40):(this._availability=a,this.byteSize=40+(0,b.Xw)(a))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),r=i%32,l=i>>5,s=this._availability;return l<0||l>s.length?"unknown":s[l]&1<<r?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||s.Z,{row:r,col:l,width:n,height:a}=e,c={query:{f:"json"}};return t=t?{...c,...t}:c,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then((e=>e.data)).catch((e=>{if(e&&e.details&&422===e.details.httpStatus)return{location:{top:r,left:l,width:n,height:a},valid:!0,data:(0,y.a9)(n*a,0)};throw e})).then((e=>{if(e.location&&(e.location.top!==r||e.location.left!==l||e.location.width!==n||e.location.height!==a))throw new o.Z("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:r,left:l,width:n,height:a}});return I.fromJSON(e)}))}static fromJSON(e){return Object.freeze(new I(e))}_validateJSON(e){if(!e||!e.location)throw new o.Z("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new o.Z("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new o.Z("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new o.Z("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new o.Z("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function S(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}let O=r=class extends n.Z{constructor(e){super(e),this._pendingTilemapRequests={},this.request=s.Z,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new u.z(2*a.Y.MEGABYTES),this.addHandles([(0,d.YP)((()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]}),(()=>this._initializeTilemapDefinition()),d.nn)])}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}fetchTilemap(e,t,i,r){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new o.Z("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,s=this._tilemapFromCache(e,t,i,l);if(s)return Promise.resolve(s);const n=r&&r.signal;return r={...r,signal:null},new Promise(((e,t)=>{(0,p.fu)(n,(()=>t((0,p.zE)())));const i=S(l);let s=this._pendingTilemapRequests[i];if(!s){s=I.fromDefinition(l,r).then((e=>(this._tilemapCache.put(i,e,e.byteSize),e)));const e=()=>delete this._pendingTilemapRequests[i];this._pendingTilemapRequests[i]=s,s.then(e,e)}s.then(e,t)}))}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(new o.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})):this.fetchTilemap(e,t,i,r).catch((e=>e)).then((r=>{if(r instanceof I){const l=r.getAvailability(t,i);if("unavailable"===l)throw new o.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return l}if((0,p.D_)(r))throw r;return"unknown"}))}fetchAvailabilityUpsample(e,t,i,r,l){r.level=e,r.row=t,r.col=i;const s=this.layer.tileInfo;s.updateTileInfo(r);const n=this.fetchAvailability(e,t,i,l).catch((e=>{if((0,p.D_)(e))throw e;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,l);throw e}));return this._fetchAvailabilityUpsamplePrefetch(r.id,e,t,i,l,n),n}async _fetchAvailabilityUpsamplePrefetch(e,t,i,l,s,n){if(!this._prefetchingEnabled||null==e)return;const a=`prefetch-${e}`;if(this.hasHandles(a))return;const o=new AbortController;n.then((()=>o.abort()),(()=>o.abort()));let u=!1;const h=(0,c.kB)((()=>{u||(u=!0,o.abort())}));if(this.addHandles(h,a),await(0,f.MU)(10,o.signal).catch((()=>{})),u||(u=!0,this.removeHandles(a)),(0,p.Hc)(o))return;const d=new w.f(e,t,i,l),v={...s,signal:o.signal},m=this.layer.tileInfo;for(let e=0;r._prefetches.length<r._maxPrefetch&&m.upsampleTile(d);++e){const e=this.fetchAvailability(d.level,d.row,d.col,v);r._prefetches.push(e);const t=()=>{r._prefetches.removeUnordered(e)};e.then(t,t)}}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,v.B7)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;const l=S(r);return this._tilemapCache.get(l)}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(t){e._prefetchingEnabled=t},hasTilemap:(t,i,r)=>!!e._tilemapFromCache(t,i,r,e._tmpTilemapDefinition)}}};O._maxPrefetch=4,O._prefetches=new h.Z({initialSize:r._maxPrefetch}),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"layer",void 0),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"minLOD",void 0),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"maxLOD",void 0),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"request",void 0),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"size",void 0),O=r=(0,l._)([(0,g.j)("esri.layers.support.TilemapCache")],O)},66677:(e,t,i)=>{i.d(t,{B5:()=>u,DR:()=>p,G:()=>w,M8:()=>v,Nm:()=>m,Qc:()=>h,XG:()=>y,a7:()=>f,ld:()=>d,wH:()=>g});var r=i(17452),l=i(25929);const s={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},n=Object.values(s),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${n.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),o=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${n.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),c=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function u(e){return!!a.test(e)}function h(e){if(null==e)return null;const t=(0,r.mN)(e),i=t.path.match(a)||t.path.match(o);if(!i)return null;const[,l,n,c,u]=i,h=n.indexOf("/");return{title:d(-1!==h?n.slice(h+1):n),serverType:s[c.toLowerCase()],sublayer:null!=u&&""!==u?parseInt(u,10):null,url:{path:l}}}function p(e){const t=(0,r.mN)(e).path.match(c);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function d(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function f(e,t){const i=[];if(e){const t=h(e);null!=t&&t.title&&i.push(t.title)}if(t){const e=d(t);i.push(e)}if(2===i.length){if(i[0].toLowerCase().includes(i[1].toLowerCase()))return i[0];if(i[1].toLowerCase().includes(i[0].toLowerCase()))return i[1]}return i.join(" - ")}function v(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),i=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&i}function m(e,t){return e?(0,r.Qj)((0,r.Hu)(e,t)):e}function y(e){let{url:t}=e;if(!t)return{url:t};t=(0,r.Hu)(t,e.logger);const i=(0,r.mN)(t),l=h(i.path);let s;if(null!=l)null!=l.sublayer&&null==e.layer.layerId&&(s=l.sublayer),t=l.url.path;else if(e.nonStandardUrlAllowed){const e=p(i.path);null!=e&&(t=e.serviceUrl,s=e.sublayerId)}return{url:(0,r.Qj)(t),layerId:s}}function g(e,t,i,s,n){(0,l.w)(t,s,"url",n),s.url&&null!=e.layerId&&(s.url=(0,r.v_)(s.url,i,e.layerId.toString()))}function w(e){if(!e)return!1;const t=e.toLowerCase(),i=t.includes("/services/"),r=t.includes("/mapserver/wmsserver"),l=t.includes("/imageserver/wmsserver"),s=t.includes("/wmsserver");return i&&(r||l||s)}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[223],{91303:(e,t,i)=>{var r;i.d(t,{Y:()=>r}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(r||(r={}))},17287:(e,t,i)=>{i.d(t,{Y:()=>o});var r=i(43697),l=i(92604),s=i(5600),n=(i(75215),i(67676),i(80442),i(52011)),a=i(66677);const o=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,a.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,a.Nm)(e,l.Z.getLogger(this)))}};return(0,r._)([(0,s.Cb)()],t.prototype,"title",null),(0,r._)([(0,s.Cb)({type:String})],t.prototype,"url",null),t=(0,r._)([(0,n.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,i)=>{i.d(t,{I:()=>I});var r=i(43697),l=i(68773),s=i(40330),n=i(3172),a=i(66643),o=i(20102),c=i(92604),u=i(70586),h=i(95330),p=i(17452),d=i(5600),f=(i(75215),i(67676),i(80442),i(71715)),v=i(52011),m=i(30556),y=i(84230),g=i(48522),w=i(15235),_=i(86082),b=i(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,u.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,i){if(t.itemId)return new w.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const{load:r}=await i.e(8062).then(i.bind(i,18062));return(0,h.k_)(t),await r({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData,layerModuleTypeMap:e.layerModuleTypeMap},t)}catch(e){throw(0,h.D_)(e)||c.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,h.r9)(e),!0))))}async setUserPrivileges(e,t){if(!l.default.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(t);if(this.url)try{const{features:{edit:i,fullEdit:r},content:{updateItem:l}}=await this._fetchUserPrivileges(e,t);this._set("userHasEditingPrivileges",i),this._set("userHasFullEditingPrivileges",r),this._set("userHasUpdateItemPrivileges",l)}catch(e){(0,h.r9)(e)}}async _fetchUserPrivileges(e,t){let i=this.portalItem;if(!e||!i||!i.loaded||i.sourceUrl)return this._fetchFallbackUserPrivileges(t);const r=e===i.id;if(r&&i.portal.user)return(0,b.Ss)(i);let l,n;if(r)l=i.portal.url;else try{l=await(0,y.oP)(this.url,t)}catch(e){(0,h.r9)(e)}if(!l||!(0,p.Zo)(l,i.portal.url))return this._fetchFallbackUserPrivileges(t);try{const e=null!=t?t.signal:null;n=await(s.id?.getCredential(`${l}/sharing`,{prompt:!1,signal:e}))}catch(e){(0,h.r9)(e)}if(!n)return{features:{edit:!0,fullEdit:!1},content:{updateItem:!1}};try{if(r?await i.reload():(i=new w.default({id:e,portal:{url:l}}),await i.load(t)),i.portal.user)return(0,b.Ss)(i)}catch(e){(0,h.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,h.r9)(e)}return{features:{edit:t,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(e){const t=this.url?s.id?.findCredential(this.url):null;if(!t)return!0;const i=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=i,null==i||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){const t=this.portalItem?.portal?.user;if(t)return t;const i=s.id.findServerInfo(this.url??"");if(!i?.owningSystemUrl)return null;const r=`${i.owningSystemUrl}/sharing/rest`,l=g.Z.getDefault();if(l&&l.loaded&&(0,p.Fv)(l.restUrl)===(0,p.Fv)(r))return l.user;const o=`${r}/community/self`,c=null!=e?e.signal:null,u=await(0,a.q6)((0,n.Z)(o,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?_.Z.fromJSON(u.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,r=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||g.Z.getDefault());return i&&r&&!(0,p.tm)(r.restUrl,i.restUrl)?(t.messages&&t.messages.push(new o.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,r._)([(0,d.Cb)({type:w.default})],t.prototype,"portalItem",null),(0,r._)([(0,f.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,r._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,r._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),(0,r._)([(0,d.Cb)({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=(0,r._)([(0,v.j)("esri.layers.mixins.PortalLayer")],t),t},S={credential:null,user:null}},39450:(e,t,i)=>{i.d(t,{Z:()=>u});var r,l=i(43697),s=i(96674),n=i(5600),a=i(75215),o=(i(67676),i(80442),i(52011));let c=r=class extends s.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,l._)([(0,n.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,l._)([(0,n.Cb)({type:a.z8,json:{write:!0}})],c.prototype,"level",void 0),(0,l._)([(0,n.Cb)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,l._)([(0,n.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,l._)([(0,n.Cb)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,l._)([(0,n.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,l._)([(0,n.Cb)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=r=(0,l._)([(0,o.j)("esri.layers.support.LOD")],c);const u=c},11145:(e,t,i)=>{i.d(t,{Z:()=>O});var r,l=i(43697),s=i(35454),n=i(96674),a=i(67900),o=i(5600),c=i(75215),u=(i(67676),i(80442),i(71715)),h=i(52011),p=i(30556),d=i(94139),f=i(82971),v=i(24470),m=i(8744),y=i(40488),g=i(39450),w=i(43077);const _=new s.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let b=r=class extends n.wq{static create(e={}){const{resolutionFactor:t=1,scales:i,size:l=256,spatialReference:s=f.Z.WebMercator,numLODs:n=24}=e;if(!(0,m.JY)(s)){const e=[];if(i)for(let t=0;t<i.length;t++){const r=i[t];e.push(new g.Z({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=n-1;i>=0;i--)e.unshift(new g.Z({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new d.Z(0,0,s),size:[l,l],spatialReference:s})}const o=(0,m.C5)(s),c=e.origin?new d.Z({x:e.origin.x,y:e.origin.y,spatialReference:s}):new d.Z(o?{x:o.origin[0],y:o.origin[1],spatialReference:s}:{x:0,y:0,spatialReference:s}),u=1/(39.37*(0,a.c9)(s)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],r=t*u;h.push(new g.Z({level:e,scale:t,resolution:r}))}else{let e=(0,m.sT)(s)?512/l*591657527.5917094:256/l*591657527.591555;const i=Math.ceil(n/t);h.push(new g.Z({level:0,scale:e,resolution:e*u}));for(let r=1;r<i;r++){const i=e/2**t,l=i*u;h.push(new g.Z({level:r,scale:i,resolution:l})),e=i}}return new r({dpi:96,lods:h,origin:c,size:[l,l],spatialReference:s})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,m.C5)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return d.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const r=[],l=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach((e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,l[e.level]=e}))),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let r=0;for(;r<i;r++){const i=t[r],l=t[r+1];if(i<=e)return r;if(l===e)return r+1;if(i>e&&l<e)return r+Math.log(i/e)/Math.log(i/l)}return r}snapScale(e,t=.95){const i=this.scaleToZoom(e);return i%Math.floor(i)>=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,r){const l=this.lodAt(e);if(!l)return null;let s,n;if("number"==typeof t)s=t,n=i;else if((0,m.fS)(t.spatialReference,this.spatialReference))s=t.x,n=t.y,r=i;else{const e=(0,y.iV)(t,this.spatialReference);if(null==e)return null;s=e.x,n=e.y,r=i}const a=l.resolution*this.size[0],o=l.resolution*this.size[1];return r||(r=new w.f(null,0,0,0,(0,v.Ue)())),r.level=e,r.row=Math.floor((this.origin.y-n)/o+.001),r.col=Math.floor((s-this.origin.x)/a+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=r.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===r.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const l=e.level-i.level,s=i.resolution*this.size[0]/2**l,n=i.resolution*this.size[1]/2**l;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,v.Ue)()),e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+n}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:r}=i,l=r*this.size[0],s=r*this.size[1];return e[0]=this.origin.x+t.col*l,e[1]=this.origin.y-(t.row+1)*s,e[2]=e[0]+l,e[3]=e[1]+s,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const i=[],l=this.lods.length;for(let e=0;e<l;e++){const r=this.lods[e],l=r.resolution*t;i.push(new g.Z({level:r.level,scale:r.scale,resolution:l}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};var I,S;(0,l._)([(0,o.Cb)({type:Number,json:{write:!0}})],b.prototype,"compressionQuality",void 0),(0,l._)([(0,o.Cb)({type:Number,json:{write:!0}})],b.prototype,"dpi",void 0),(0,l._)([(0,o.Cb)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],b.prototype,"format",void 0),(0,l._)([(0,o.Cb)({readOnly:!0})],b.prototype,"isWrappable",null),(0,l._)([(0,o.Cb)({type:d.Z,json:{write:!0}})],b.prototype,"origin",void 0),(0,l._)([(0,u.r)("origin")],b.prototype,"readOrigin",null),(0,l._)([(0,o.Cb)({type:[g.Z],value:null,json:{write:!0}})],b.prototype,"lods",null),(0,l._)([(0,o.Cb)({readOnly:!0})],b.prototype,"scales",void 0),(0,l._)([(0,o.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],b.prototype,"size",void 0),(0,l._)([(0,u.r)("size",["rows","cols"])],b.prototype,"readSize",null),(0,l._)([(0,p.c)("size",{cols:{type:c.z8},rows:{type:c.z8}})],b.prototype,"writeSize",null),(0,l._)([(0,o.Cb)({type:f.Z,json:{write:!0}})],b.prototype,"spatialReference",void 0),b=r=(0,l._)([(0,h.j)("esri.layers.support.TileInfo")],b),(S=(I=b||(b={})).ExtrapolateOptions||(I.ExtrapolateOptions={}))[S.NONE=0]="NONE",S[S.POWER_OF_TWO=1]="POWER_OF_TWO";const O=b},43077:(e,t,i)=>{i.d(t,{f:()=>r});class r{constructor(e,t,i,r,l=void 0){this.id=e,this.level=t,this.row=i,this.col=r,this.extent=l}}},28589:(e,t,i)=>{i.d(t,{y:()=>O});var r,l=i(43697),s=i(3172),n=i(92036),a=i(91303),o=i(20102),c=i(50758),u=i(13867),h=i(44553),p=i(95330),d=i(17445),f=i(1654),v=i(17452),m=i(5600),y=(i(75215),i(67676)),g=(i(80442),i(52011)),w=i(43077),_=i(22974),b=i(1533);class I{constructor(e){this._validateJSON(e);const{location:t,data:i}=e;this.location=Object.freeze((0,_.d9)(t));const r=this.location.width,l=this.location.height;let s=!0,n=!0;const a=function(e,t=!1){return e<=b.c8?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(r*l/32));let o=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(n=!1,a[o]|=1<<t):s=!1,31===t&&++o}n?(this._availability="unavailable",this.byteSize=40):s?(this._availability="available",this.byteSize=40):(this._availability=a,this.byteSize=40+(0,b.Xw)(a))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),r=i%32,l=i>>5,s=this._availability;return l<0||l>s.length?"unknown":s[l]&1<<r?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||s.Z,{row:r,col:l,width:n,height:a}=e,c={query:{f:"json"}};return t=t?{...c,...t}:c,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then((e=>e.data)).catch((e=>{if(e&&e.details&&422===e.details.httpStatus)return{location:{top:r,left:l,width:n,height:a},valid:!0,data:(0,y.a9)(n*a,0)};throw e})).then((e=>{if(e.location&&(e.location.top!==r||e.location.left!==l||e.location.width!==n||e.location.height!==a))throw new o.Z("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:r,left:l,width:n,height:a}});return I.fromJSON(e)}))}static fromJSON(e){return Object.freeze(new I(e))}_validateJSON(e){if(!e||!e.location)throw new o.Z("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new o.Z("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new o.Z("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new o.Z("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new o.Z("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function S(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}let O=r=class extends n.Z{constructor(e){super(e),this._pendingTilemapRequests={},this.request=s.Z,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new u.z(2*a.Y.MEGABYTES),this.addHandles([(0,d.YP)((()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]}),(()=>this._initializeTilemapDefinition()),d.nn)])}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}fetchTilemap(e,t,i,r){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new o.Z("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,s=this._tilemapFromCache(e,t,i,l);if(s)return Promise.resolve(s);const n=r&&r.signal;return r={...r,signal:null},new Promise(((e,t)=>{(0,p.fu)(n,(()=>t((0,p.zE)())));const i=S(l);let s=this._pendingTilemapRequests[i];if(!s){s=I.fromDefinition(l,r).then((e=>(this._tilemapCache.put(i,e,e.byteSize),e)));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=s,s.then(e,e)}s.then(e,t)}))}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const r=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return r?r.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,r){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(new o.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})):this.fetchTilemap(e,t,i,r).catch((e=>e)).then((r=>{if(r instanceof I){const l=r.getAvailability(t,i);if("unavailable"===l)throw new o.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return l}if((0,p.D_)(r))throw r;return"unknown"}))}fetchAvailabilityUpsample(e,t,i,r,l){r.level=e,r.row=t,r.col=i;const s=this.layer.tileInfo;s.updateTileInfo(r);const n=this.fetchAvailability(e,t,i,l).catch((e=>{if((0,p.D_)(e))throw e;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,l);throw e}));return this._fetchAvailabilityUpsamplePrefetch(r.id,e,t,i,l,n),n}async _fetchAvailabilityUpsamplePrefetch(e,t,i,l,s,n){if(!this._prefetchingEnabled||null==e)return;const a=`prefetch-${e}`;if(this.hasHandles(a))return;const o=new AbortController;n.then((()=>o.abort()),(()=>o.abort()));let u=!1;const h=(0,c.kB)((()=>{u||(u=!0,o.abort())}));if(this.addHandles(h,a),await(0,f.MU)(10,o.signal).catch((()=>{})),u||(u=!0,this.removeHandles(a)),(0,p.Hc)(o))return;const d=new w.f(e,t,i,l),v={...s,signal:o.signal},m=this.layer.tileInfo;for(let e=0;r._prefetches.length<r._maxPrefetch&&m.upsampleTile(d);++e){const e=this.fetchAvailability(d.level,d.row,d.col,v);r._prefetches.push(e);const t=()=>{r._prefetches.removeUnordered(e)};e.then(t,t)}}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,v.B7)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,r){r.level=e,r.row=t-t%this.size,r.col=i-i%this.size;const l=S(r);return this._tilemapCache.get(l)}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(t){e._prefetchingEnabled=t},hasTilemap:(t,i,r)=>!!e._tilemapFromCache(t,i,r,e._tmpTilemapDefinition)}}};O._maxPrefetch=4,O._prefetches=new h.Z({initialSize:r._maxPrefetch}),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"layer",void 0),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"minLOD",void 0),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"maxLOD",void 0),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"request",void 0),(0,l._)([(0,m.Cb)({constructOnly:!0})],O.prototype,"size",void 0),O=r=(0,l._)([(0,g.j)("esri.layers.support.TilemapCache")],O)},66677:(e,t,i)=>{i.d(t,{B5:()=>u,DR:()=>p,G:()=>w,M8:()=>v,Nm:()=>m,Qc:()=>h,XG:()=>y,a7:()=>f,ld:()=>d,wH:()=>g});var r=i(17452),l=i(25929);const s={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},n=Object.values(s),a=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${n.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),o=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${n.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),c=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function u(e){return!!a.test(e)}function h(e){if(null==e)return null;const t=(0,r.mN)(e),i=t.path.match(a)||t.path.match(o);if(!i)return null;const[,l,n,c,u]=i,h=n.indexOf("/");return{title:d(-1!==h?n.slice(h+1):n),serverType:s[c.toLowerCase()],sublayer:null!=u&&""!==u?parseInt(u,10):null,url:{path:l}}}function p(e){const t=(0,r.mN)(e).path.match(c);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function d(e){return(e=e.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function f(e,t){const i=[];if(e){const t=h(e);null!=t&&t.title&&i.push(t.title)}if(t){const e=d(t);i.push(e)}if(2===i.length){if(i[0].toLowerCase().includes(i[1].toLowerCase()))return i[0];if(i[1].toLowerCase().includes(i[0].toLowerCase()))return i[1]}return i.join(" - ")}function v(e){if(!e)return!1;const t=(e=e.toLowerCase()).includes(".arcgis.com/"),i=e.includes("//services")||e.includes("//tiles")||e.includes("//features");return t&&i}function m(e,t){return e?(0,r.Qj)((0,r.Hu)(e,t)):e}function y(e){let{url:t}=e;if(!t)return{url:t};t=(0,r.Hu)(t,e.logger);const i=(0,r.mN)(t),l=h(i.path);let s;if(null!=l)null!=l.sublayer&&null==e.layer.layerId&&(s=l.sublayer),t=l.url.path;else if(e.nonStandardUrlAllowed){const e=p(i.path);null!=e&&(t=e.serviceUrl,s=e.sublayerId)}return{url:(0,r.Qj)(t),layerId:s}}function g(e,t,i,s,n){(0,l.w)(t,s,"url",n),s.url&&null!=e.layerId&&(s.url=(0,r.v_)(s.url,i,e.layerId.toString()))}function w(e){if(!e)return!1;const t=e.toLowerCase(),i=t.includes("/services/"),r=t.includes("/mapserver/wmsserver"),l=t.includes("/imageserver/wmsserver"),s=t.includes("/wmsserver");return i&&(r||l||s)}}}]);
@@ -4,11 +4,6 @@
4
4
  .esri-sketch {
5
5
  display: flex;
6
6
  flex-flow: column wrap;
7
-
8
- .esri-snapping-controls__panel {
9
- display: flex;
10
- width: auto;
11
- }
12
7
  }
13
8
 
14
9
  .esri-expand__content {
@@ -3,11 +3,6 @@
3
3
  display: flex;
4
4
  flex-flow: column wrap;
5
5
 
6
- &__panel {
7
- display: flex;
8
- width: auto;
9
- }
10
-
11
6
  &__block {
12
7
  margin-top: 0;
13
8
  }