@arcgis/core 4.25.0-next.20221021 → 4.25.0-next.20221023
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WebMap.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{0b0f3e93f658a012d5f0.js → 00df1053d3a8761fc0a3.js} +1 -1
- package/assets/esri/core/workers/chunks/0de7eca7acf74947cf2e.js +1 -0
- package/assets/esri/core/workers/chunks/{2474f0e8b8abc1387106.js → 2600954826b42f2b70c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{af3f30f968363bb3930c.js → 353c4a51be72c4a77e1f.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d8201f0f33ba66bb96b.js → 5f46751fa500a9dfacf9.js} +1 -1
- package/assets/esri/core/workers/chunks/{b9e93d9ea80361716f1d.js → 64190294f3dc9237b420.js} +1 -1
- package/assets/esri/core/workers/chunks/{883cfe319b15ebabf71e.js → 73ad8f3d3feff5882988.js} +1 -1
- package/assets/esri/core/workers/chunks/{177c8d5e2531c6f64581.js → 796504f93100aea7c6f5.js} +1 -1
- package/assets/esri/core/workers/chunks/8435ae4fe5a5332b1076.js +1 -0
- package/assets/esri/core/workers/chunks/{c8c0f091aab41e4effa5.js → 85690fabbfe60681f5e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{942da417257f8fd8e4cf.js → 858970a88406562a26cc.js} +1 -1
- package/assets/esri/core/workers/chunks/a17d20ffaa47d430d98c.js +1 -0
- package/assets/esri/core/workers/chunks/ac2903c5f1587dec2f80.js +1 -0
- package/assets/esri/core/workers/chunks/{7ba0cfe4d1c214f44fc7.js → b6d9750b16bbf8ce5307.js} +1 -1
- package/assets/esri/core/workers/chunks/{7f40f4ac6e2af4b333f5.js → c4e5b929b152f8d36cc3.js} +1 -1
- package/assets/esri/core/workers/chunks/c7de993c0a85594a1969.js +1 -0
- package/assets/esri/core/workers/chunks/ca92022f53080fda75fe.js +1 -0
- package/assets/esri/core/workers/chunks/d7668e81467833a5a53d.js +1 -0
- package/assets/esri/core/workers/chunks/de83b062359c0459585f.js +1 -0
- package/assets/esri/core/workers/chunks/f57c3343f93d87423856.js +1 -0
- package/assets/esri/core/workers/chunks/f704ed07c514a0f436ec.js +1 -0
- package/assets/esri/themes/base/_color.scss +1 -0
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +58 -14
- package/assets/esri/themes/base/widgets/_LayerList.scss +57 -13
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/geometry/support/normalizeUtils.js +1 -1
- package/interfaces.d.ts +109 -6
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/Rasterizer.js +1 -1
- package/symbols/cim/rasterizingUtils.js +5 -0
- package/views/2d/engine/brushes.js +1 -1
- package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
- package/views/2d/engine/vtlBrushes.js +5 -0
- package/views/2d/engine/webgl/mesh/bufcut.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/FeatureForm/FormExpressionArcadeExecutor.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/LayerList/LayerListViewModel.js +1 -1
- package/widgets/LayerList/ListItem.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/assets/esri/core/workers/chunks/0cfb97b9f38c31b3b33a.js +0 -1
- package/assets/esri/core/workers/chunks/2a63949c3aad9ace1b44.js +0 -1
- package/assets/esri/core/workers/chunks/3b5be512567d9c1c6fe6.js +0 -1
- package/assets/esri/core/workers/chunks/4450f17444947fe2f27f.js +0 -1
- package/assets/esri/core/workers/chunks/5abda500f5d5607155ab.js +0 -1
- package/assets/esri/core/workers/chunks/81139c01e8016cbbe324.js +0 -1
- package/assets/esri/core/workers/chunks/94027976cfca4ad5789b.js +0 -1
- package/assets/esri/core/workers/chunks/9d410721f42259efe666.js +0 -1
- package/assets/esri/core/workers/chunks/b17ff3dfdc638f9f5705.js +0 -1
- package/assets/esri/core/workers/chunks/d6eb078d94171fb9d3d4.js +0 -1
- package/rest/geometry/cut.js +0 -5
- package/rest/geometry/simplify.js +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3548],{13867:(e,t,i)=>{i.d(t,{Z:()=>r});var s=i(69801);class r{constructor(e,t){this._storage=new s.WJ,this._storage.maxSize=e,t&&this._storage.registerRemoveFunc("",t)}put(e,t,i){this._storage.put(e,t,i,1)}pop(e){return this._storage.pop(e)}get(e){return this._storage.get(e)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}}},82526:(e,t,i)=>{i.d(t,{aX:()=>R});var s=i(68773),r=i(20102),n=i(92604),a=i(70586),o=i(38913),l=i(58901),c=i(82971),u=i(33955);const h={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new l.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:c.Z.WebMercator}),minus180Line:new l.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:c.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new l.Z({paths:[[[180,-180],[180,180]]],spatialReference:c.Z.WGS84}),minus180Line:new l.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:c.Z.WGS84})}};function f(e,t){return Math.ceil((e-t)/(2*t))}function d(e,t){const i=p(e);for(const e of i)for(const i of e)i[0]+=t;return e}function p(e){return(0,u.oU)(e)?e.rings:e.paths}var m=i(8744),y=i(40488),g=(i(66577),i(3172)),x=i(17452);function I(e){return{geometryType:(0,u.Ji)(e[0]),geometries:e.map((e=>e.toJSON()))}}const b=n.Z.getLogger("esri.geometry.support.normalizeUtils");function w(e){return"polygon"===e[0].type}function _(e){return"polyline"===e[0].type}function S(e,t,i){if(t){const t=function(e,t){if(!(e instanceof l.Z||e instanceof o.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw b.error(e),new r.Z(e)}const i=p(e),s=[];for(const e of i){const i=[];s.push(i),i.push([e[0][0],e[0][1]]);for(let s=0;s<e.length-1;s++){const r=e[s][0],n=e[s][1],a=e[s+1][0],o=e[s+1][1],l=Math.sqrt((a-r)*(a-r)+(o-n)*(o-n)),c=(o-n)/l,u=(a-r)/l,h=l/t;if(h>1){for(let e=1;e<=h-1;e++){const s=e*t,a=u*s+r,o=c*s+n;i.push([a,o])}const e=(l+Math.floor(h-1)*t)/2,s=u*e+r,a=c*e+n;i.push([s,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new o.Z({rings:s,spatialReference:e.spatialReference}):new l.Z({paths:s,spatialReference:e.spatialReference})}(e,1e6);e=(0,y.Sx)(t,!0)}return i&&(e=d(e,i)),e}function v(e,t,i){if(Array.isArray(e)){const s=e[0];if(s>t){const i=f(s,t);e[0]=s+i*(-2*t)}else if(s<i){const t=f(s,i);e[0]=s+t*(-2*i)}}else{const s=e.x;if(s>t){const i=f(s,t);e=e.clone().offset(i*(-2*t),0)}else if(s<i){const t=f(s,i);e=e.clone().offset(t*(-2*i),0)}}return e}function C(e,t){let i=-1;for(let s=0;s<t.cutIndexes.length;s++){const r=t.cutIndexes[s],n=t.geometries[s],a=p(n);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 s=t[e][0];i=s>i?s:i}i=Number(i.toFixed(9));const s=-360*f(i,180);for(let i=0;i<t.length;i++){const t=n.getPoint(e,i);n.setPoint(e,i,t.clone().offset(s,0))}return!0}}))}if(r===i){if(w(e))for(const t of p(n))e[r]=e[r].addRing(t);else if(_(e))for(const t of p(n))e[r]=e[r].addPath(t)}else i=r,e[r]=n}return e}async function R(e,t,i){if(!Array.isArray(e))return R([e],t);t&&"string"!=typeof t&&b.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const r="string"==typeof t?t:t?.url??s.Z.geometryServiceUrl;let n,c,p,w,_,T,k,F,P=0;const M=[],O=[];for(const t of e)if((0,a.Wi)(t))O.push(t);else if(n||(n=t.spatialReference,c=(0,m.C5)(n),p=n.isWebMercator,T=p?102100:4326,w=h[T].maxX,_=h[T].minX,k=h[T].plus180Line,F=h[T].minus180Line),c)if("mesh"===t.type)O.push(t);else if("point"===t.type)O.push(v(t.clone(),w,_));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>v(e,w,_))),O.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,c);O.push(e.rings?new o.Z(e):e)}else if(t.extent){const e=t.extent,i=f(e.xmin,_)*(2*w);let s=0===i?t.clone():d(t.clone(),i);e.offset(i,0),e.intersects(k)&&e.xmax!==w?(P=e.xmax>P?e.xmax:P,s=S(s,p),M.push(s),O.push("cut")):e.intersects(F)&&e.xmin!==_?(P=e.xmax*(2*w)>P?e.xmax*(2*w):P,s=S(s,p,360),M.push(s),O.push("cut")):O.push(s)}else O.push(t.clone());else O.push(t);let B=f(P,w),D=-90;const z=B,J=new l.Z;for(;B>0;){const e=360*B-180;J.addPath([[e,D],[e,-1*D]]),D*=-1,B--}if(M.length>0&&z>0){const t=C(M,await async function(e,t,i,s){const r="string"==typeof e?(0,x.mN)(e):e,n=t[0].spatialReference,a={...s,query:{...r.query,f:"json",sr:JSON.stringify(n),target:JSON.stringify({geometryType:(0,u.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,g.default)(r.path+"/cut",a),{cutIndexes:l,geometries:c=[]}=o.data;return{cutIndexes:l,geometries:c.map((e=>{const t=(0,u.im)(e);return t.spatialReference=n,t}))}}(r,M,J,i)),s=[],n=[];for(let i=0;i<O.length;i++){const r=O[i];if("cut"!==r)n.push(r);else{const r=t.shift(),o=e[i];(0,a.pC)(o)&&"polygon"===o.type&&o.rings&&o.rings.length>1&&r.rings.length>=o.rings.length?(s.push(r),n.push("simplify")):n.push(p?(0,y.$)(r):r)}}if(!s.length)return n;const o=await async function(e,t,i){const s="string"==typeof e?(0,x.mN)(e):e,r=t[0].spatialReference,n=(0,u.Ji)(t[0]),a={...i,query:{...s.query,f:"json",sr:r.wkid?r.wkid:JSON.stringify(r),geometries:JSON.stringify(I(t))}};return function(e,t,i){const s=(0,u.q9)(t);return e.map((e=>{const t=s.fromJSON(e);return t.spatialReference=i,t}))}((await(0,g.default)(s.path+"/simplify",a)).data,n,r)}(r,s,i),l=[];for(let e=0;e<n.length;e++){const t=n[e];"simplify"!==t?l.push(t):l.push(p?(0,y.$)(o.shift()):o.shift())}return l}const N=[];for(let e=0;e<O.length;e++){const t=O[e];if("cut"!==t)N.push(t);else{const e=M.shift();N.push(!0===p?(0,y.$)(e):e)}}return N}},92045:(e,t,i)=>{i.r(t),i.d(t,{default:()=>nt});var s=i(43697),r=i(51773),n=i(30030),a=i(20102),o=i(70586),l=i(16453),c=i(95330),u=i(17445),h=i(5600),f=(i(67676),i(75215)),d=i(36030),p=i(71715),m=i(52011),y=i(87085),g=i(71612),x=i(17017),I=(i(66577),i(3172)),b=i(92604),w=i(8744),_=i(66677),S=i(21506),v=i(35956),C=i(29876),R=i(40297),T=i(88281),k=i(11145),F=i(96674),P=i(609),M=i(36679),O=i(99815),B=i(73506),D=i(94139);const z=new Map,J=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,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const r=this._cachedBlocks,n=e+"/"+t;if(r.has(n)){const e=r.get(n);e.ts=Date.now(),e.refCount++}else r.set(n,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}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 s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][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 N(e,t){return null==t?e:`${e}?sliceId=${t}`}function W(e,t,i){const s=z.get(e);if(!s)return null==t?J.decreaseRefCount(e,i):0;if(null==t||null==s[t])return J.decreaseRefCount(e,i);const r=s[t]?.cache,n=r?.get(i);if(r&&n){if(n.refCount--,0===n.refCount){r.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);n.controller&&n.controller.abort()}return n.refCount}return 0}function E(e,t,i){const s=z.get(e);if(!s)return null==t?J.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return J.getBlock(e,i)}const r=s[t]?.cache.get(i);if(r)return r.refCount++,r.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const r=s[e]?.cache,n=r?.get(i);if(r&&n)return n.refCount++,r.set(i,n),n.block}return null}function H(e,t,i,s,r=null){const n=z.get(e);if(!n)return void(null==t&&J.putBlock(e,i,s,r));if(null==t||null==n[t])return void J.putBlock(e,i,s,r);const a={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:r};s.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),n[t]?.cache.set(i,a)}function Z(e,t,i){const s=z.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):J.deleteBlock(e,i):null==t&&J.deleteBlock(e,i)}var A=i(75993),L=i(55914),j=i(80676),q=i(6570);let G=class extends((0,P.v)(F.wq)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,B.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:k.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,B.ut)(e.spatialReference);return(0,o.pC)(t)&&e.extent.width>=t/2}set url(e){this._set("url",(0,_.Nm)(e,b.Z.getLogger(this.declaredClass)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,i,s={}){const r=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,t,i,r);return this.fetchPixels(n,r.size[0],r.size[1],s)}async identify(e,t={}){e=(0,f.TJ)(D.Z,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{hasMultidimensionalTranspose:r,multidimensionalInfo:n}=this.rasterInfo;let{transposedVariableName:a}=t;const l=(0,o.pC)(n)&&r&&(null!=s||(0,O.WU)(i));l&&!a&&(a=(0,o.pC)(i)&&i.length>0?i[0].variableName??void 0:n.variables[0].name,t={...t,transposedVariableName:a}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=this.rasterInfo,{datumTransformation:h}=t;let d=(0,B.nF)(e,c,h);if(!u.intersects(d))return{location:d,value:null};if((0,o.pC)(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(d);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};d=e}let p=0;const m=(0,o.pC)(a)&&(0,o.pC)(n)&&this.rasterInfo.hasMultidimensionalTranspose;if(!m)if(t.srcResolution)p=(0,B.kr)(t.srcResolution,this.rasterInfo,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:I,colOffset:b,blockWidth:w}=y,_=a??(0,o.Wg)(t.sliceId),S=N(this.url,_),v=`${p}/${g}/${x}`;let C=E(S,null,v);(0,o.Wi)(C)&&(C=this.fetchRawTile(p,g,x,t),H(S,null,v,C));const R=await C;if((0,o.Wi)(R)||!R.pixels?.length)return{location:d,value:null};const T=I*w+b;return this._processIdentifyResult(R,{srcLocation:d,position:T,pyramidLevel:p,useTransposedTile:!!m,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,i,s={}){if(e=(0,B.kZ)(e),(s=this._getRequestOptionsWithSliceId(s)).requestRawData)return this._fetchPixels(e,t,i,s);const r=(0,B.ut)(e.spatialReference),n=(0,B.Hq)(e);if((0,o.Wi)(r)||0===n||1===n&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,i,s);if(n>=3)return{extent:e,pixelBlock:null};const a=[],{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 o=0;o<=n;o++){const p=new q.Z({xmin:0===o?l:-r/2,xmax:o===n?c-r*o:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===o?u-h:o===n?t-f:u;f+=m,d.push(m);const y=s.disableWrapAround&&o>0?null:this._fetchPixels(p,m,i,s);a.push(y)}const p=(await Promise.all(a)).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},s)).pixelBlock:(0,L.us)(p,y,{blockWidths:d}),{extent:e,srcExtent:(0,B.tB)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,i,s),{nativeExtent:n,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,u=a.x*c,h=a.y*c,f=new q.Z({xmin:n.xmin+u*t.x,xmax:n.xmin+u*(t.x+i.width-1),ymin:n.ymax-h*(t.y+i.height-1),ymax:n.ymax-h*t.y,spatialReference:n.spatialReference});if(!r)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:d,mosaicSize:p}=r;if(1===d.length&&(0,o.pC)(d[0])&&d[0].width===i.width&&d[0].height===i.height)return{extent:f,srcExtent:f,pixelBlock:r.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,y=e>0?l.pyramidBlockHeight:l.blockHeight,g={x:t.x%m,y:t.y%y};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:p,destDimension:i,clipOffset:g,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,L.us)(d,p,{clipOffset:g,clipSize:i}),{extent:f,srcExtent:f,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,B.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,A.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:r,query:n,headers:a}=t;i=i??t.retryCount??this.ioConfig.retryCount;const o=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await(0,I.default)(e,{...t,query:{...n,...s},headers:{...a,...o}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return(0,o.Wi)(t)||(0,o.Wi)(e)||0===e.length?null:(0,O.gk)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const r=(0,o.s3)(s.lodAt(e));return this.getTileExtent({x:r.resolution,y:r.resolution},t,i,s.origin,s.spatialReference,s.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo;if(!e.tileInfo){const r=[],n=e.maximumPyramidLevel||0;let a=Math.max(s.x,s.y),o=1/.0254*96*a;for(let e=0;e<=n;e++)r.push({level:n-e,resolution:a,scale:o}),a*=2,o*=2;const l=new D.Z({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new k.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:r,height:n,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new D.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],s);e.storageInfo=new M.Z({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,r,n=0,a=2){if(1===r.length&&n>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;i<n;i++)e*=a,t*=a,r.push({x:e,y:t})}const o=[],{x:l,y:c}=s;for(let s=0;s<r.length;s++){const{x:n,y:a}=r[s];o.push({minCol:Math.floor((e.xmin-l+.1*n)/t/n),maxCol:Math.floor((e.xmax-l-.1*n)/t/n),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:s}=this.rasterInfo.storageInfo;if(0===e)return t;if((0,o.pC)(i)&&i.length)return i[e-1];const r=s**e;return{x:t.x*r,y:t.y*r}}identifyPixelLocation(e,t,i,s){const{spatialReference:r,nativeExtent:n,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:l,origin:c,transposeInfo:u}=a,h=s&&(0,o.pC)(u)?u.tileSize[0]:a.blockWidth,f=s&&(0,o.pC)(u)?u.tileSize[1]:a.blockHeight,d=(0,B.nF)(e,r,i);if(!n.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:m,y}=p,g=(c.y-d.y)/y/f,x=(d.x-c.x)/m/h,I=Math.min(f-1,Math.floor((g-Math.floor(g))*f)),b=Math.min(h-1,Math.floor((x-Math.floor(x))*h));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(x),rowOffset:I,colOffset:b,blockWidth:h,srcLocation:d}}getTileExtent(e,t,i,s,r,n){const[a,o]=n,l=s.x+i*a*e.x,c=l+a*e.x,u=s.y-t*o*e.y,h=u-o*e.y;return new q.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:r})}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 s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}async _fetchPixels(e,t,i,s={}){let r=(0,B.Hq)(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:a,pyramidResolution:l,srcResolution:c,srcExtent:u,srcWidth:h,srcHeight:f}=n;if(0===h||0===f)return{extent:e,srcExtent:u,pixelBlock:null};const d=(0,o.Wg)(this.rasterInfo.transform),p="gcs-shift"===d?.type,m=(0,o.pC)((0,B.ut)(e.spatialReference));!p&&m||(r=(0,B.Hq)(n.srcExtent,p));const y=this.rasterInfo.storageInfo,g={x:Math.floor((u.xmin-y.origin.x)/l.x+.1),y:Math.floor((y.origin.y-u.ymax)/l.y+.1)},x=await this._fetchRawTiles(a,g,{width:h,height:f,wrapCount:r},s);if(!x)return{extent:e,srcExtent:u,pixelBlock:null};const I=a>0?y.pyramidBlockWidth:y.blockWidth,b=a>0?y.pyramidBlockHeight:y.blockHeight,w=I===h&&b===f&&g.x%I==0&&g.y%b==0,_=new D.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),S=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:v}=s;if(!S&&w&&1===x.pixelBlocks.length&&I===t&&b===i&&c.x===_.x&&c.y===_.y)return{extent:e,srcExtent:u,pixelBlock:x.pixelBlocks[0]};const C=m&&(0,o.pC)((0,B.ut)(u.spatialReference)),R=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");R&&!this.rasterJobHandler&&await(0,B.zD)();const T=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:_.toJSON(),datumTransformation:v,rasterTransform:d,hasWrapAround:r>0||C,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:R},s):(0,B.Qp)({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:_,datumTransformation:v,rasterTransform:d,hasWrapAround:r>0||C,isAdaptive:!1,includeGCSGrid:R});let k;const F=!s.requestRawData,P={rows:T.spacing[0],cols:T.spacing[1]},M=(0,o.Wg)(this._getRasterTileAlignmentInfo(a,x.extent.xmin)),{pixelBlocks:O,mosaicSize:z,isPartiallyFilled:J}=x;let N=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:O,srcMosaicSize:z,destDimension:F?{width:t,height:i}:null,coefs:F?T.coefficients:null,sampleSpacing:F?P:null,projectDirections:R,gcsGrid:R?T.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:M,blockWidths:null},s);({pixelBlock:k,localNorthDirections:N}=e)}else{const e=(0,L.us)(O,z,{alignmentInfo:M});k=F?(0,L.Uk)(e,{width:t,height:i},T.coefficients,P,s.interpolation):e,R&&T.gcsGrid&&(N=(0,L.Qh)({width:t,height:i},T.gcsGrid),k=(0,j.xQ)(k,this.rasterInfo.dataType,N))}return s.requestRawData||R?{srcExtent:u,pixelBlock:k,transformGrid:T,localNorthDirections:N,extent:e,isPartiallyFilled:J}:{srcExtent:u,extent:e,pixelBlock:k}}async _fetchRawTiles(e,t,i,s){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:u}=t,{width:h,height:f,wrapCount:d}=i;const p=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(c-=s.buffer.cols,u-=s.buffer.rows,h+=2*s.buffer.cols,f+=2*s.buffer.rows);let m=0,y=0,g=0;d&&(0,o.pC)(p)&&(({worldColumnCountFromOrigin:y,originColumnOffset:g,rightPadding:m}=p),y*p.blockWidth-m>=c+h&&(m=0));const x=Math.floor(c/a),I=Math.floor(u/l),b=Math.floor((c+h+m-1)/a),w=Math.floor((u+f+m-1)/l),_=n[e];if(!_)return null;const{minRow:S,minCol:v,maxCol:C,maxRow:R}=_;if(0===d&&(w<S||b<v||I>R||x>C))return null;const T=new Array;let k=!1;const F=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=I;t<=w;t++)for(let i=x;i<=b;i++){let r=i;if(!s.disableWrapAround&&d&&(0,o.pC)(p)&&y<=i&&(r=i-y-g),t>=S&&r>=v&&R>=t&&C>=r){const i=this._fetchRawTile(e,t,r,s);F?T.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{k=!0,e(null)}))}))):T.push(i)}else T.push(Promise.resolve(null))}if(0===T.length)return null;const P=await Promise.all(T),M={height:(w-I+1)*l,width:(b-x+1)*a},{spatialReference:O}=this.rasterInfo,B=this.getPyramidPixelSize(e),{x:D,y:z}=B;return{extent:new q.Z({xmin:r.x+x*a*D,xmax:r.x+(b+1)*a*D,ymin:r.y-(w+1)*l*z,ymax:r.y-I*l*z,spatialReference:O}),pixelBlocks:P,mosaicSize:M,isPartiallyFilled:k}}_fetchRawTile(e,t,i,s){const r=this.rasterInfo.storageInfo.blockBoundary[e];if(!r)return Promise.resolve(null);const{minRow:n,minCol:a,maxCol:l,maxRow:u}=r;if(t<n||i<a||t>u||i>l)return Promise.resolve(null);const h=N(this.url,s.sliceId),f=`${e}/${t}/${i}`;let d=E(h,s.registryId,f);if((0,o.Wi)(d)){const r=new AbortController;d=this.fetchRawTile(e,t,i,{...s,signal:r.signal}),H(h,s.registryId,f,d,r),d.catch((()=>Z(h,s.registryId,f)))}return s.signal&&(0,c.fu)(s,(()=>{W(h,s.registryId,f)})),d}_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 s=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[r,n]=e,a=[],o=[];for(let e=0;e<s;e++){const[t,i]=(0,j.Tg)([r[e],n[e]]);a.push(t),o.push(i)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,B.P_)(this.rasterInfo)),(0,o.Wi)(this._rasterTileAlighmentInfo.pyramidsInfo)?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const r={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};s.srcResolution&&(r.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,r));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=r,c=a/t,u=o/i,h=l<n&&c*u>=16;if(h||l===n&&(c>8||u>8)||0===a||0===o){const a=new D.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let o=(0,B.VO)(a,this.rasterInfo.spatialReference,e,r.datumTransformation);const f=!o||s.srcResolution&&o.x+o.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(n-l+3>=e){const t=2**e;o={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}o&&(r.srcResolution=o,this._updateSourceDataInfo(e,r))}return(r.srcWidth/t>8||r.srcHeight/i>8)&&(r.srcWidth=0,r.srcHeight=0),r}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const i=this.rasterInfo.spatialReference,{srcResolution:s,datumTransformation:r}=t,{pyramidLevel:n,pyramidResolution:a,excessiveReading:l}=(0,B.kr)(s,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,B.tB)(e,i,r);if(null==c)return;const u=(0,o.Wg)(this.rasterInfo.transform);u&&(c=u.inverseTransform(c)),t.srcExtent=c;const h=Math.ceil((c.xmax-c.xmin)/a.x-.1),f=Math.ceil((c.ymax-c.ymin)/a.y-.1);t.pyramidLevel=n,t.pyramidResolution=a,t.srcWidth=h,t.srcHeight=f}_getRequestOptionsWithSliceId(e){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:r,useTransposedTile:n}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if((0,o.Wi)(l)||!n){const t=e.pixels.map((e=>e[s])),n={location:i,value:t,pyramidLevel:r},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(n.magdirValue=a.map((e=>e[0]))),n}let c=e.pixels.map((e=>Array.prototype.slice.call(e,s*a,s*a+a))),u=this._computeMagDirValues(c);const{requestSomeSlices:h,identifyOptions:f}=t;let d=(0,O.MO)(l,f.transposedVariableName);if(h){const e=(0,O.Ur)(d,(0,o.Wg)(f.multidimensionalDefinition),(0,o.Wg)(f.timeExtent));c=c.map((t=>e.map((e=>t[e])))),u=u?.map((t=>e.map((e=>t[e])))),d=e.map((e=>d[e]))}return{location:i,value:null,dataSeries:d.map(((e,t)=>{const i={value:c.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new v.Z({...e,isSlice:!0})))};return u?.length&&(i.magdirValue=[u[0][t],u[1][t]]),i})),pyramidLevel:r}}};(0,s._)([(0,h.Cb)()],G.prototype,"_rasterTileAlighmentInfo",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],G.prototype,"_isGlobalWrappableSource",null),(0,s._)([(0,h.Cb)(S.HQ)],G.prototype,"url",null),(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],G.prototype,"datasetName",void 0),(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],G.prototype,"datasetFormat",void 0),(0,s._)([(0,h.Cb)()],G.prototype,"rasterInfo",void 0),(0,s._)([(0,h.Cb)()],G.prototype,"ioConfig",void 0),(0,s._)([(0,h.Cb)()],G.prototype,"sourceJSON",void 0),G=(0,s._)([(0,m.j)("esri.layers.support.rasterDatasets.BaseRaster")],G);const U=G;let $=class extends U{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._primaryRasters=null}async open(e){await this.init();const{rasterFunction:t}=this,{rasters:i,rasterIds:s}=t.getPrimaryRasters(),r=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(r);const n=i.map((({rasterInfo:e})=>e)),o=t.bind({rasterInfos:n,rasterIds:s});if(!o.success)throw new a.Z("raster-function:open",`cannot bind the function: ${o.error??""}`);await this.syncJobHandler(),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo)}async syncJobHandler(){const{rasterFunction:e}=this;if(this._primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler)return this.rasterJobHandler.updateRasterFunction(e)}async fetchPixels(e,t,i,s={}){const{rasters:r,rasterIds:n}=this._primaryRasters,a=r.map((r=>r.fetchPixels(e,t,i,s))),l=await Promise.all(a),c=l.map((e=>e.pixelBlock));if(c.every((e=>(0,o.Wi)(e))))return l[0];const u=l.find((e=>(0,o.pC)(e.pixelBlock)))?.extent??e,h=this.rasterJobHandler?await this.rasterJobHandler.process({extent:u,primaryPixelBlocks:c,primaryRasterIds:n}):this.rasterFunction.process({extent:u,primaryPixelBlocks:c,primaryRasterIds:n});return{...l[0],pixelBlock:h}}};(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],$.prototype,"datasetFormat",void 0),(0,s._)([(0,h.Cb)()],$.prototype,"tileType",void 0),(0,s._)([(0,h.Cb)()],$.prototype,"rasterFunction",void 0),$=(0,s._)([(0,m.j)("esri.layers.support.rasterDatasets.FunctionRaster")],$);const V=$;var X=i(55444),Y=i(67058),K=i(72758),Q=i(23808),ee=i(82971);const te=b.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),ie=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalDefinition=null,this.multidimensionalSubset=null,this.raster=null,this.rasterFunction=null,this.sourceJSON=null,this.symbolizer=null}get fullExtent(){return this.rasterInfo?.extent}get rasterInfo(){return this.raster?.rasterInfo}get spatialReference(){return this.rasterInfo?.spatialReference??ee.Z.WGS84}get tileInfo(){return this.rasterInfo?.storageInfo.tileInfo}set url(e){this._set("url",(0,_.Nm)(e,te))}set renderer(e){this._set("renderer",e),this.updateRenderer()}async convertVectorFieldData(e,t){if((0,o.Wi)(e)||!this.rasterInfo)return null;const i=this._rasterJobHandler.instance,s=this.rasterInfo.dataType;return i?i.convertVectorFieldData({pixelBlock:e,dataType:s},t):(0,j.KC)(e,s)}async createFlowMesh(e,t){const i=this._rasterJobHandler.instance;return i?i.createFlowMesh(e,t):(0,Q.GE)(e.meshType,e.simulationSettings,e.flowData,(0,o.pC)(t.signal)?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo??{};if((0,o.Wi)(t))return e;let i=e.multidimensionalDefinition||this.multidimensionalDefinition;!(0,o.Wi)(i)&&i.length||(i=(0,O.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const s=e.timeExtent||this.timeExtent;if((0,o.pC)(i)&&(0,o.pC)(s)&&((0,o.pC)(s.start)||(0,o.pC)(s.end))){i=i.map((e=>e.clone()));const r=t.variables.find((({name:e})=>e===i[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),n=i.find((({dimensionName:e})=>"StdTime"===e));if(!r||!n)return{...e,multidimensionalDefinition:null};const{start:a,end:l}=s,c=(0,o.Wi)(a)?null:a.getTime(),u=(0,o.Wi)(l)?null:l.getTime(),h=c??u,f=u??c;if((0,o.pC)(r.values)){const e=r.values.filter((e=>{if(Array.isArray(e)){if(h===f)return e[0]<=h&&e[1]>=h;const t=e[0]<=h&&e[1]>h||e[0]<f&&e[1]>=f,i=e[0]>=h&&e[1]<=f||e[0]<h&&e[1]>f;return t||i}return h===f?e===h:e>=h&&e<=f}));if(e.length){const t=e.sort(((e,t)=>h===f?(e[0]??e)-(t[0]??t):Math.abs((e[1]??e)-f)-Math.abs((t[1]??t)-f)))[0];n.values=[t]}else i=null}else if(r.hasRegularIntervals&&r.extent){const[e,t]=r.extent;h>t||f<e?i=null:n.values=h===f?[h]:[Math.max(e,h),Math.min(t,f)]}}return(0,o.pC)(i)&&(0,O.nb)(i,this.multidimensionalSubset)?{...e,multidimensionalDefinition:null}:{...e,multidimensionalDefinition:i}}async updateRenderer(){const{loaded:e,symbolizer:t}=this;if(!e||!t)return;if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(this.renderer))return;const i=this._rasterJobHandler.instance;i&&(t.rendererJSON=(0,Y.ol)(this.renderer.toJSON()),t.bind(),await i.updateSymbolizer(t),this._cachedRendererJson=this.renderer.toJSON())}async applyRenderer(e,t){const i=e&&e.pixelBlock;if(!((0,o.pC)(i)&&i.pixels&&i.pixels.length>0))return null;let s;await this.updateRenderer();const r=this._rasterJobHandler.instance,n=this.bandIds??[];return s=r?await r.symbolize({...e,simpleStretchParams:t,bandIds:n}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:n}),s}getTileUrl(e,t,i){return"RasterTileServer"===this.raster?.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||(0,o.Wi)(t))return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,w.C5)(e);return k.Z.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.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,s,r={}){if(i(this),r.requestAsImageElement){const i=this.getTileUrl(e,t,s);return(0,I.default)(i,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:r.signal}).then((e=>e.data))}if((0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(r=this.normalizeRasterFetchOptions(r),(0,o.Wi)(r.multidimensionalDefinition))){const i=r.tileInfo||this.rasterInfo.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,s,i),pixelBlock:null}}return await this._initJobHandler(),await this._updateRasterFunction(),"raster-shaded-relief"===this.renderer.type&&(r={...r,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,s,r)}async fetchPixels(e,t,i,s={}){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(s=this.normalizeRasterFetchOptions(s),(0,o.Wi)(s.multidimensionalDefinition))?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this._updateRasterFunction(),this.raster.fetchPixels(e,t,i,s))}async identify(e,t={}){return i(this),!(0,o.pC)(this.rasterInfo.multidimensionalInfo)||this.rasterInfo.hasMultidimensionalTranspose&&((0,O.WU)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||(t=this.normalizeRasterFetchOptions(t),!(0,o.Wi)(t.multidimensionalDefinition))?this.raster.identify(e,t):{location:e,value:null}}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo?.multidimensionalInfo;if((0,o.Wi)(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,O.jj)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,O.Tj)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new T.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{i(this),this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,this.renderer&&this.updateRenderer(),"Function"===this.raster.datasetFormat&&this.raster.syncJobHandler()})).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){i(this);const e=(0,Y.In)(this.rasterInfo,this.raster.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",e)}}_configDefaultRenderer(){i(this);const e=this.raster.rasterInfo;if(this.bandIds||(this.bandIds=(0,Y.YD)(e)),!this.renderer){const t=(0,Y.Ob)(e,{bandIds:this.bandIds,variableName:(0,o.pC)(this.multidimensionalDefinition)?this.multidimensionalDefinition[0]?.variableName:null});"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===t.type&&((e.statistics?.[0].max??0)>1e24||(e.statistics?.[0].min??0)<-1e24)&&(t.dynamicRangeAdjustment=!0,t.statistics=null,"none"===t.stretchType&&(t.stretchType="min-max")),this.renderer=t}this.symbolizer?(this.symbolizer.rendererJSON=(0,Y.ol)(this.renderer.toJSON()),this.symbolizer.rasterInfo=e):this.symbolizer=new K.Z({rendererJSON:this.renderer.toJSON(),rasterInfo:e});const t=this.symbolizer.bind();t.success||te.warn("imagery-tile-mixin",t.error||"The given renderer is not supported by the layer.")}async _updateRasterFunction(){if("imagery-tile"!==this.type||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;let e=this.raster;if("Function"===e?.datasetFormat){const t=e.rasterFunction.getPrimaryRasters();e=t.rasters[0]}const{rasterFunction:t}=this;if(t){const i=(0,X.Ue)(t.toJSON(),{raster:e}),s=new V({rasterFunction:i});s.rasterJobHandler=this._rasterJobHandler.instance,await s.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=s}else this.raster=e}};function i(e){if(!e.raster||!e.rasterInfo)throw new a.Z("imagery-tile","no raster")}return(0,s._)([(0,h.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,s._)([(0,h.Cb)()],t.prototype,"_cachedRasterFunctionJson",void 0),(0,s._)([(0,h.Cb)()],t.prototype,"_compatibleFullExtent",void 0),(0,s._)([(0,h.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,s._)([(0,h.Cb)()],t.prototype,"bandIds",void 0),(0,s._)([(0,h.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,s._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,s._)([(0,h.Cb)()],t.prototype,"interpolation",void 0),(0,s._)([(0,h.Cb)()],t.prototype,"ioConfig",void 0),(0,s._)([(0,h.Cb)({type:[v.Z]})],t.prototype,"multidimensionalDefinition",void 0),(0,s._)([(0,h.Cb)({type:C.Z,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,s._)([(0,h.Cb)()],t.prototype,"raster",void 0),(0,s._)([(0,h.Cb)({type:R.Z})],t.prototype,"rasterFunction",void 0),(0,s._)([(0,h.Cb)()],t.prototype,"rasterInfo",null),(0,s._)([(0,h.Cb)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"spatialReference",null),(0,s._)([(0,h.Cb)({json:{read:!1}})],t.prototype,"tileInfo",null),(0,s._)([(0,h.Cb)(S.HQ)],t.prototype,"url",null),(0,s._)([(0,h.Cb)({types:n.dr})],t.prototype,"renderer",null),(0,s._)([(0,h.Cb)()],t.prototype,"symbolizer",void 0),t=(0,s._)([(0,m.j)("esri.layers.ImageryTileMixin")],t),t};var se=i(38009),re=i(16859),ne=i(34760),ae=i(72965),oe=i(28294),le=i(1231),ce=i(69608),ue=i(48526),he=i(20095);function fe(e){const t=e.fields,i=e.records,s=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",r=[{name:s,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),n=r.map((e=>e.name)),a=[];let o=0,l=0;return i.forEach((e=>{const t={};for(t[s]=o++,l=1;l<n.length;l++)t[n[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:r,features:a}}class de{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 s=t.getUint32(4,!0),r=t.getUint16(8,!0),n=t.getUint16(10,!0),a={version:i,recordCount:s,headerByteCount:r,recordByteCount:n};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,he.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<s&&e.byteLength-o>n;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)i.push((0,he.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 s=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(s.substring(0,4),10),parseInt(s.substring(4,6),10)-1,parseInt(s.substring(6,8),10)))}o+=t.length})),c.push(i)):o+=n}}return{header:a,fields:l,records:c,recordSet:fe({fields:l,records:c})}}}var pe=i(87521),me=i(74889);const ye=new Map;ye.set("int16","esriFieldTypeSmallInteger"),ye.set("int32","esriFieldTypeInteger"),ye.set("int64","esriFieldTypeInteger"),ye.set("float32","esriFieldTypeSingle"),ye.set("float64","esriFieldTypeDouble"),ye.set("text","esriFieldTypeString");let ge=class extends U{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:s}=this._parseHeader(t);if("thematic"===s.dataType){const e=await this._fetchAuxiliaryInformation();s.attributeTable=e}this._set("storageInfo",i),this._set("rasterInfo",s),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,i,s={}){const{transposeInfo:r}=this.rasterInfo.storageInfo,{transposedVariableName:n}=s,a=!(!r||!n),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,i,s.multidimensionalDefinition,n),c=this._getIndexRecordFromBundle(t,i,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:s.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:s.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,histograms:s,colormap:r,blockWidth:n,blockHeight:a,firstPyramidLevel:o,maximumPyramidLevel:l}=e,c=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),u=e.extent.spatialReference,h=e.geodataXform?.spatialReference,f=new ee.Z(u?.wkid||u?.wkt?u:h);let d=new q.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const p=new D.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 I=e.properties??{},b=e.format.toLowerCase().replace("cache/",""),w=new D.Z(e.origin.x,e.origin.y,f);let _,S,v,C;if(r&&r.colors)for(_=[],S=0;S<r.colors.length;S++)v=r.colors[S],C=r.values?r.values[S]:S,_.push([C,255&v,v<<16>>>24,v<<8>>>24,v>>>24]);const R=e.LODInfos,T=[];for(S=0;S<R.levels.length;S++)T.push({level:R.levels[S],resolution:R.resolutions[S],scale:96/.0254*R.resolutions[S]});const F=new k.Z({dpi:96,lods:T,format:b,origin:w,size:[n,a],spatialReference:f}),P={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},O=[{maxCol:Math.ceil(m/n)-1,maxRow:Math.ceil(y/a)-1,minCol:0,minRow:0}];let B=2;if(l>0)for(S=0;S<l;S++)O.push({maxCol:Math.ceil(m/B/n)-1,maxRow:Math.ceil(y/B/a)-1,minCol:0,minRow:0}),B*=2;const z=e.mdInfo;let J=null;if(z&&I._yxs){const e=I._yxs;J={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:P,rasterInfo:new ue.Z({width:m,height:y,pixelType:t,bandCount:i,extent:d,nativeExtent:x,transform:g,spatialReference:f,pixelSize:p,keyProperties:I,statistics:c,histograms:s,multidimensionalInfo:z,colormap:_,storageInfo:new M.Z({blockWidth:n,blockHeight:a,pyramidBlockWidth:n,pyramidBlockHeight:a,origin:w,tileInfo:F,transposeInfo:J,firstPyramidLevel:o,maximumPyramidLevel:l,blockBoundary:O})})}}_parseTransform(e){if(!(0,pe.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,pe.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)),s=await Promise.all([t,i]);let r;if(s[0]){let e=s[0].fields;const t=s[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":ye.get(e.type),name:e.name,alias:e.alias||e.name})));const i=t.map((e=>({attributes:e})));e&&t&&(r={fields:e,features:i})}}return!r&&s[1]&&(r=de.parse(s[1]).recordSet),me.default.fromJSON(r)}_buildCacheFilePath(e,t,i,s,r){const n=this._getPackageSize(!!r),a=Math.floor(t/n)*n,l=Math.floor(i/n)*n,c="R"+this._toHexString4(a)+"C"+this._toHexString4(l);let u="L";u+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:h}=this.rasterInfo,f=s?.[0];if((0,o.Wi)(h)||!f)return`${this.url}/_alllayers/${u}/${c}.bundle`;let d="_yxs";if(!r){d=h.variables.find((e=>e.name===f.variableName)).dimensions[0].values.indexOf(f.values[0]).toString(16);const e=4-d.length;for(let t=0;t<e;t++)d="0"+d;d="S"+d}const p=this._getVariableFolderName(r||f.variableName);return`${this.url}/_alllayers/${p}/${d}/${u}/${c}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&(0,o.pC)(t)?t.packetSize??0:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:i}=t;return e&&(0,o.pC)(i)?i.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replace(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,i=!1){const s=this._getPackageSize(i),r=s*(e%s)+t%s;if(r<0)throw"Invalid level / row / col";return 20+r*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const i=e.subarray(t,t+8);let s,r=0;for(s=0;s<5;s++)r|=(255&i[s])<<8*s;const n=0xffffffffff&r;for(r=0,s=5;s<8;s++)r|=(255&i[s])<<8*(s-5);return{position:n,recordSize:0xffffffffff&r}}_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,s._)([(0,h.Cb)({readOnly:!0})],ge.prototype,"storageInfo",void 0),(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],ge.prototype,"datasetFormat",void 0),ge=(0,s._)([(0,m.j)("esri.layers.support.rasterDatasets.CloudRaster")],ge);const xe=ge;var Ie=i(80442),be=i(15612);let we=class extends U{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){await this.init();const t=this.data,{pixelBlock:i,statistics:s,histograms:r,name:n,keyProperties:a,nativeExtent:o,transform:l}=this.data,{width:c,height:u,pixelType:h}=i,f=t.extent??new q.Z({xmin:-.5,ymin:.5,xmax:c-.5,ymax:u-.5,spatialReference:new ee.Z({wkid:3857})}),d=t.isPseudoSpatialReference??!t.extent,p={x:f.width/c,y:f.height/u},m=new ue.Z({width:c,height:u,pixelType:h,extent:f,nativeExtent:o,transform:l,pixelSize:p,spatialReference:f.spatialReference,bandCount:3,keyProperties:a||{},statistics:s,isPseudoSpatialReference:d,histograms:r});this.createRemoteDatasetStorageInfo(m,512,512),this._set("rasterInfo",m),this.updateTileInfo(),await this._buildInMemoryRaster(i,{width:512,height:512},e),this.datasetName=n,this.url="/InMemory/"+n}fetchRawTile(e,t,i,s={}){const r=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(r)}async _buildInMemoryRaster(e,t,i){const s=this.rasterInfo.storageInfo.maximumPyramidLevel,r=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:s},i):Promise.resolve((0,L.Vl)(e,t,s)),n=(0,o.pC)(this.rasterInfo.statistics),l=(0,o.pC)(this.rasterInfo.histograms),u=n?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,be.Hv)(e)),h=await(0,c.as)([r,u]);if(!h[0].value&&h[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,n||(this.rasterInfo.statistics=h[1].value?.statistics),l||(this.rasterInfo.histograms=h[1].value?.histograms)}};(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],we.prototype,"datasetFormat",void 0),(0,s._)([(0,h.Cb)()],we.prototype,"data",void 0),we=(0,s._)([(0,m.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],we);const _e=we;function Se(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 s=[];if(t){const r=Se(e,i);for(let e=0;e<r.length;e++)Se(r[e],t).forEach((e=>s.push(e)));return s}const r=e.getElementsByTagNameNS("*",i);if(!r||0===r.length)return[];for(let e=0;e<r.length;e++)s.push(r[e]||r.item[e]);return s}function ve(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 s=Se(e,i);return s.length>0?t?ve(s[0],t):s[0]:null}function Ce(e,t=null){const i=t?ve(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function Re(e,t){return function(e,t){const i=Se(e,t),s=[];let r;for(let e=0;e<i.length;e++)r=i[e].textContent||i[e].nodeValue,r&&(r=r.trim(),""!==r&&s.push(r));return s}(e,t).map((e=>Number(e)))}function Te(e,t){const i=Ce(e,t);return Number(i)}function ke(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}var Fe=i(87390);function Pe(e,t){if(!e||!t)return null;const i=[];for(let s=0;s<e.length;s++)i.push(e[s]),i.push(t[s]);return i}function Me(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new ee.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"),s=e.indexOf("PROJCS"),r=s>-1?s:e.indexOf("GEOGCS");if(-1===r)return null;const n=e.slice(r,e.lastIndexOf("]",i)+1).trim(),a=e.slice(i,e.lastIndexOf("]")).trim();t=Oe(n);const o=new ee.Z(t?{wkid:t}:{wkt:n}),l=Oe(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Oe(e),new ee.Z(0!==t?{wkid:t}:{wkt:e})):null}function Oe(e){const t=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),i=t[t.length-1].split(","),s=i[0]?.toLowerCase();if(("epsg"===s||"esri"===s)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Be(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(ke(e,"SRS")){if(!t.spatialReference){const i=Ce(e);t.spatialReference=Me(i)}}else if(ke(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:s}=function(e){const t=ve(e,"GeodataXform"),i=Me(Te(t,"SpatialReference/WKID")||Ce(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const s=Te(t,"PolynomialOrder")??1,r=Re(t,"CoeffX/Double"),n=Re(t,"CoeffY/Double"),a=Re(t,"InverseCoeffX/Double"),o=Re(t,"InverseCoeffY/Double"),l=Pe(r,n),c=Pe(a,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new Fe.Z({spatialReference:i,polynomialOrder:s,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=s,t.spatialReference||(t.spatialReference=i)}else Se(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=Ce(e)));else if(ke(e,"PAMRasterBand")){const i=function(e){const t=Te(e,"NoDataValue"),i=ve(e,"Histograms/HistItem"),s=Te(i,"HistMin"),r=Te(i,"HistMax"),n=Te(i,"BucketCount"),a=Ce(i,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;Se(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=Te(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=s&&null!=r?{min:s,max:r,size:n||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(o.pC):null;const s=!!i[0].histogram;t.histograms=s?i.map((e=>e.histogram)).filter(o.pC):null}return t}let De=class extends U{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:i,statistics:s,histograms:r,transform:n}=await this._fetchAuxiliaryData(e);const a=!i;a&&(i=new ee.Z({wkid:3857})),r?.length&&null==s&&(s=(0,be.Oh)(r));const{width:o,height:l}=t;let c=new q.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=n?n.forwardTransform(c):c;let h=!0;if(n){const e=n.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(n=null,c=u)}const f=new _e({data:{extent:u,nativeExtent:c,transform:n,pixelBlock:t,statistics:s,histograms:r,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),f.data=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,A.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 s=i.toLowerCase(),r="gif"===s||"bmp"===s||!(0,Ie.Z)("ios");return await this.decodePixelBlock(t,{format:s,useCanvas:r,hasNoZlibMask:!0})}async _fetchAuxiliaryData(e){const t=(0,o.Wg)(e?.signal),i=this.ioConfig.skipExtensions??[],s=i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),r=this.datasetFormat,n="JPG"===r?"jgw":"PNG"===r?"pgw":"BMP"===r?"bpw":null,a=n&&i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),l=await(0,c.as)([s,a]);if(t?.aborted)throw(0,c.zE)();const u=Be(l[0].value?.data);if(!u.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;u.transform=6===e?.length?new Fe.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],De.prototype,"datasetFormat",void 0),De=(0,s._)([(0,m.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],De);const ze=De;var Je=i(17452),Ne=i(45322),We=i(56608),Ee=i(29680),He=i(26059);let Ze=class extends U{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 s=i.data;if(this.sourceJSON=s,!s)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!s.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=s.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(s.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===s.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=s.name?.slice(s.name.indexOf("/")+1)??"";const r=await this._fetchRasterInfo({signal:t});if((0,o.Wi)(r))throw new a.Z("image-server-raster:open","cannot initialize image service");const n="Map"===this.tileType?(0,Ne.d)(s.tileInfo,s):k.Z.fromJSON(s.tileInfo);(0,o.O3)(n);const[l,c]=this._computeMinMaxLOD(r,n),{extent:u,pixelSize:h}=r,f=.5/r.width*h.x,d=Math.max(h.x,h.y),{lods:p}=n;("Map"!==this.tileType&&0!==s.maxScale||Math.abs(h.x-h.y)>f||!p.some((e=>Math.abs(e.resolution-d)<f)))&&(h.x=h.y=l.resolution,r.width=Math.ceil((u.xmax-u.xmin)/h.x-.1),r.height=Math.ceil((u.ymax-u.ymin)/h.y-.1));const m=l.level-c.level,[y,g]=n.size,x=[];p.forEach((e=>{e.level>=c.level&&e.level<=l.level&&x.push({x:e.resolution,y:e.resolution})})),x.sort(((e,t)=>e.x-t.x));const I=this.computeBlockBoundary(u,y,g,n.origin,x,m),b=x.length>1?x.slice(1):null;let w;if(s.transposeInfo&&(w={tileSize:[s.transposeInfo.rows,s.transposeInfo.cols],packetSize:r.keyProperties?._yxs.PacketSize??0}),r.storageInfo=new M.Z({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:b,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:m,tileInfo:n,transposeInfo:w,blockBoundary:I}),this._fixGCSShift(r),this._set("rasterInfo",r),s.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:r.storageInfo.tileInfo,parsedUrl:(0,Je.mN)(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new We.y({layer:e})}}async fetchRawTile(e,t,i,s={}){const{storageInfo:r,extent:n}=this.rasterInfo,{transposeInfo:a}=r,l=(0,o.pC)(a)&&!!s.transposedVariableName;if(this._slices&&!l&&null==s.sliceId)return null;const c=l?0:r.maximumPyramidLevel-e+this._levelOffset,u=`${this.url}/tile/${c}/${t}/${i}`,h=this._slices?l?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null,{data:f}=await this.request(u,{query:h,responseType:"array-buffer",signal:s.signal});if(!f)return null;const d=l?a.tileSize:r.tileInfo.size,p=await this.decodePixelBlock(f,{width:d[0],height:d[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:l}),m=r.blockBoundary[e];if("jpg"!==r.compression||i>m.minCol&&i<m.maxCol&&t>m.minRow&&t<m.maxRow)return p;const{origin:y,blockWidth:g,blockHeight:x}=r,{x:I,y:b}=this.getPyramidPixelSize(e),w=Math.round((n.xmin-y.x)/I)%g,_=Math.round((n.xmax-y.x)/I)%g||g,S=Math.round((y.y-n.ymax)/b)%x,v=Math.round((y.y-n.ymin)/b)%x||x,C=i===m.minCol?w:0,R=t===m.minRow?S:0,T=i===m.maxCol?_:g,k=t===m.maxRow?v:x;return(0,L.pW)(p,{x:C,y:R},{width:T-C,height:k-R}),p}getSliceIndex(e){if(!this._slices||(0,o.Wi)(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)),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),r=await Promise.all([i,s]);return r[0]&&r[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,(0,o.Wg)(t.datumTransformation));if(null===i)return null;let s=0;const{maximumPyramidLevel:r}=this.rasterInfo.storageInfo;let n=r-s+this._levelOffset;const a=i.srcLocation;for(;n>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(n,i.row,i.col,t))break}catch{}if(n--,s++,i=this.identifyPixelLocation(a,s,(0,o.Wg)(t.datumTransformation)),null===i)return null}return-1===n||null==i?null:s}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),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=ee.Z.fromJSON(t.spatialReference||e.spatialReference),n=new D.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new ue.Z({width:i,height:s,bandCount:3,extent:q.Z.fromJSON(e),spatialReference:r,pixelSize:n,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,s=(0,He.g)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),r=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,n=await Promise.all([s,r]);return this._slices=n[1],n[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 Ee.Z,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:r}=t,n=t.lodAt(Math.max.apply(null,r.map((e=>e.level)))),a=t.lodAt(Math.min.apply(null,r.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=r[0].level,[n,a];if("Raster"===o)return[r.find((e=>e.resolution===i.x))??n,a];const{minScale:l,maxScale:c}=this.sourceJSON;let u=n;c>0&&(u=r.find((e=>Math.abs(e.scale-c)<s)),u||(u=r.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??n));let h=a;return l>0&&(h=r.find((e=>Math.abs(e.scale-l)<s))??a,this._levelOffset=h.level-a.level),[u,h]}};(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],Ze.prototype,"datasetFormat",void 0),(0,s._)([(0,h.Cb)()],Ze.prototype,"tileType",void 0),Ze=(0,s._)([(0,m.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Ze);const Ae=Ze;var Le=i(5847),je=i(48279);const qe=new Map;qe.set("Int8","s8"),qe.set("UInt8","u8"),qe.set("Int16","s16"),qe.set("UInt16","u16"),qe.set("Int32","s32"),qe.set("UInt32","u32"),qe.set("Float32","f32"),qe.set("Float64","f32"),qe.set("Double64","f32");const Ge=new Map;Ge.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Ge.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Ge.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Ge.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let Ue=class extends U{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?(0,o.Wg)(e.signal):null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:s,files:r}=this._parseHeader(i.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(s.statistics=t.statistics??s.statistics,s.histograms=t.histograms,t.histograms&&(0,o.Wi)(s.statistics)&&(s.statistics=(0,be.Oh)(t.histograms)))}this._set("rasterInfo",s),this._files=r;const n=await this.request(r.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(n.data);const{blockWidth:a,blockHeight:l}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:h}=this.rasterInfo,f=[],d=this._getBandSegmentCount();let p=0,m=-1;for(;p<this._storageIndex.length;){m++;const e=Math.ceil(u/a/c**m)-1,t=Math.ceil(h/l/c**m)-1;p+=(e+1)*(t+1)*d*4,f.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=f,m>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=m),this.updateTileInfo()}async fetchRawTile(e,t,i,s={}){const{blockWidth:r,blockHeight:n,blockBoundary:a}=this.rasterInfo.storageInfo,l=a[e];if(!l||l.maxRow<t||l.maxCol<i||l.minRow>t||l.minCol>i)return null;const{bandCount:c,pixelType:u}=this.rasterInfo,{ranges:h,actualTileWidth:f,actualTileHeight:d}=this._getTileLocation(e,t,i);if(!h||0===h.length)return null;if(0===h[0].from&&0===h[0].to){const e=new Uint8Array(r*n);return new Le.Z({width:r,height:n,pixels:null,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,m=this._getBandSegmentCount(),y=[];let g=0;for(g=0;g<m;g++)(!p||p.indexOf[g]>-1)&&y.push(this.request(this._files.data,{range:{from:h[g].from,to:h[g].to},responseType:"array-buffer",signal:s.signal}));const x=await Promise.all(y),I=x.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),b=new Uint8Array(I);let w=0;for(g=0;g<m;g++)b.set(new Uint8Array(x[g].data),w),w+=x[g].data.byteLength;const _=Ge.get(this.rasterInfo.storageInfo.compression).decoderFormat,S=await this.decodePixelBlock(b.buffer,{width:r,height:n,format:_,planes:p?.length||c,pixelType:u});if((0,o.pC)(this.rasterInfo.noDataValue)&&"lerc"!==_&&!S.mask){const e=this.rasterInfo.noDataValue[0];if(null!=e){const t=S.width*S.height,i=new Uint8Array(t);if(Math.abs(e)>1e24)for(g=0;g<t;g++)Math.abs((S.pixels[0][g]-e)/e)>1e-6&&(i[g]=1);else for(g=0;g<t;g++)S.pixels[0][g]!==e&&(i[g]=1);S.mask=i}}let v=0,C=0;if(f!==r||d!==n){let e=S.mask;if(e)for(g=0;g<n;g++)if(C=g*r,g<d)for(v=f;v<r;v++)e[C+v]=0;else for(v=0;v<r;v++)e[C+v]=0;else for(e=new Uint8Array(r*n),S.mask=e,g=0;g<d;g++)for(C=g*r,v=0;v<f;v++)e[C+v]=1}return S}_parseIndex(e){if(e.byteLength%16>0)throw"invalid array buffer must be multiples of 16";let t,i,s,r,n,a;if(je.f){for(i=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),s=new Uint8Array(r),n=0;n<e.byteLength/4;n++)for(a=0;a<4;a++)s[4*n+a]=i[4*n+3-a];t=new Uint32Array(r)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Ge.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:s,blockHeight:r,pyramidScalingFactor:n}=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=n**h,c=Math.ceil(a/s/d),u=Math.ceil(o/r/d),f+=c*u;d=n**e,c=Math.ceil(a/s/d),u=Math.ceil(o/r/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+0]*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?s:Math.ceil(a/d)-s*(c-1),actualTileHeight:t<u-1?r:Math.ceil(o/d)-r*(u-1)}}_parseHeader(e){const t=ve(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const i=ve(t,"Size"),s=parseInt(i.getAttribute("x"),10),r=parseInt(i.getAttribute("y"),10),n=parseInt(i.getAttribute("c"),10),o=(Ce(t,"Compression")||"none").toLowerCase();if(!Ge.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=Ce(t,"DataType")||"UInt8",c=qe.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=ve(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),d=ve(t,"DataValues");let p,m;if(d&&(m=d.getAttribute("NoData"),null!=m&&(p=m.trim().split(" ").map((e=>parseFloat(e))))),ve(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const y=ve(e,"MRF_META/GeoTags"),g=ve(y,"BoundingBox");let x,I=!1;if(null!=g){const e=parseFloat(g.getAttribute("minx")),t=parseFloat(g.getAttribute("miny")),i=parseFloat(g.getAttribute("maxx")),s=parseFloat(g.getAttribute("maxy")),r=Ce(y,"Projection")||"";let n=ee.Z.WGS84;if("LOCAL_CS[]"!==r)if(r.toLowerCase().startsWith("epsg:")){const e=Number(r.slice(5));isNaN(e)||0===e||(n=new ee.Z({wkid:e}))}else n=Me(r)??ee.Z.WGS84;else I=!0,n=new ee.Z({wkid:3857});x=new q.Z(e,t,i,s),x.spatialReference=n}else I=!0,x=new q.Z({xmin:-.5,ymin:.5-r,xmax:s-.5,ymax:.5,spatialReference:new ee.Z({wkid:3857})});const b=ve(e,"MRF_META/Rsets"),w=parseInt(b&&b.getAttribute("scale")||"2",10),_=x.spatialReference,S=new M.Z({origin:new D.Z({x:x.xmin,y:x.ymax,spatialReference:_}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:w}),v=new D.Z({x:x.width/s,y:x.height/r,spatialReference:_}),C=new ue.Z({width:s,height:r,extent:x,isPseudoSpatialReference:I,spatialReference:_,bandCount:n,pixelType:c,pixelSize:v,noDataValue:p,storageInfo:S}),R=Ce(e,"datafile"),T=Ce(e,"IndexFile");return{rasterInfo:C,files:{mrf:this.url,index:T||this.url.replace(".mrf",".idx"),data:R||this.url.replace(".mrf",Ge.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Be(t)}catch{return null}}};(0,s._)([(0,h.Cb)()],Ue.prototype,"_files",void 0),(0,s._)([(0,h.Cb)()],Ue.prototype,"_storageIndex",void 0),(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],Ue.prototype,"datasetFormat",void 0),Ue=(0,s._)([(0,m.j)("esri.layers.support.rasterIO.MRFRaster")],Ue);const $e=Ue;var Ve=i(94793),Xe=i(9832);const Ye=(e,t)=>e.get(t)?.values,Ke=(e,t)=>e.get(t)?.values?.[0];let Qe=class extends U{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?(0,o.Wg)(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);const{littleEndian:s,firstIFDPos:r,isBigTiff:n}=(0,Ve.cK)(i),l=[];await this._readIFDs(l,i,s,r,0,n?8:4,t);const{imageInfo:c,rasterInfo:u}=this._parseIFDs(l);if(this._headerInfo={littleEndian:s,isBigTiff:n,ifds:l,...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.");const{skipExtensions:h=[]}=this.ioConfig;if(!h.includes("aux.xml")){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&this._processPAMInfo(t,u)}h.includes("vat.dbf")||1!==u.bandCount||"u8"!==u.pixelType||(u.attributeTable=await this._fetchAuxiliaryTable(e),(0,o.pC)(u.attributeTable)&&(u.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(e,t,i,s={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const r=this._getTileLocation(e,t,i);if(!r)return null;const{ranges:n,actualTileWidth:a,actualTileHeight:o,ifd:l}=r,c=n.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:s.signal}))),u=await Promise.all(c),h=u.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),f=1===u.length?u[0].data:new ArrayBuffer(h),d=[0],p=[0];if(u.length>1){const e=new Uint8Array(f);for(let t=0,i=0;t<u.length;t++){const s=u[t].data;e.set(new Uint8Array(s),i),d[t]=i,i+=s.byteLength,p[t]=s.byteLength}}const{blockWidth:m,blockHeight:y}=this.getBlockWidthHeight(e),g=await this.decodePixelBlock(f,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:p},width:m,height:y,planes:null,pixelType:null});let x,I,b;if(a!==m||o!==y){let e=g.mask;if(e)for(x=0;x<y;x++)if(b=x*m,x<o)for(I=a;I<m;I++)e[b+I]=0;else for(I=0;I<m;I++)e[b+I]=0;else for(e=new Uint8Array(m*y),g.mask=e,x=0;x<o;x++)for(b=x*m,I=0;I<a;I++)e[b+I]=1}return g}_parseIFDs(e){const t=(0,Ve.FI)(e),{width:i,height:s,tileWidth:r,tileHeight:n,planes:a,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:h,pyramidBlockHeight:f,tileBoundary:d,affine:p,metadata:m}=t;let y=Me(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),g=!1;null==y&&(g=!0,y=new ee.Z({wkid:3857}));const x=new q.Z({...t.extent,spatialReference:y}),I=new D.Z(x?{x:x.xmin,y:x.ymax,spatialReference:y}:{x:0,y:0}),b=new M.Z({blockWidth:r,blockHeight:n,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:l,origin:I,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:d}),w=new D.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/s,spatialReference:y}),_=m?{BandProperties:m.bandProperties,DataType:m.dataType}:{};let S=null;const v=Ke(e[0],"PHOTOMETRICINTERPRETATION"),C=Ye(e[0],"COLORMAP");if(3===v&&C?.length>3&&C.length%3==0){S=[];const e=C.length/3;for(let t=0;t<e;t++)S.push([t,C[t]>>>8,C[t+e]>>>8,C[t+2*e]>>>8])}const R=new ue.Z({width:i,height:s,bandCount:a,pixelType:o,pixelSize:w,storageInfo:b,spatialReference:y,isPseudoSpatialReference:g,keyProperties:_,extent:x,colormap:S,statistics:m?m.statistics:null});return p?.length&&(R.nativeExtent=new q.Z({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:y}),R.transform=new Fe.Z({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),R.extent=R.transform.forwardTransform(R.nativeExtent),R.pixelSize=new D.Z({x:(x.xmax-x.xmin)/i,y:(x.ymax-x.ymin)/s,spatialReference:y}),b.origin.x=-.5,b.origin.y=.5),{imageInfo:t,rasterInfo:R}}_processPAMInfo(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&(0,o.Wi)(t.statistics)&&(t.statistics=(0,be.Oh)(e.histograms)),e.transform&&(0,o.Wi)(t.transform)){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new D.Z({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.spatialReference||(t.spatialReference=e.spatialReference)}async _readIFDs(e,t,i,s,r,n=4,a){if(!s)return null;(s>=t.byteLength||s<0)&&(t=(await this.request(this.url,{range:{from:s+r,to:s+r+this._bufferSize},responseType:"array-buffer",signal:a})).data,r=s+r,s=0);const o=await this._readIFD(t,i,s,r,Xe.Z.TIFF_TAGS,n,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,i,o.nextIFD-r,r,n,a)}async _readIFD(e,t,i,s,r=Xe.Z.TIFF_TAGS,n=4,a){if(!e)return null;const l=(0,Ve.vr)(e,t,i,s,r,n);if(l.success){const i=[];if(l.ifd?.forEach((e=>{e.values||i.push(e)})),i.length>0){const r=i.map((e=>e.offlineOffsetSize)).filter(o.pC),n=Math.min.apply(null,r.map((e=>e[0])));if(Math.min.apply(null,r.map((e=>e[0]+e[1])))-n<=this._bufferSize){const{data:r}=await this.request(this.url,{range:{from:n,to:n+this._bufferSize},responseType:"array-buffer",signal:a});e=r,s=n,i.forEach((i=>(0,Ve.Dq)(e,t,i,s)))}}if(l.ifd?.has("GEOKEYDIRECTORY")){const i=l.ifd.get("GEOKEYDIRECTORY"),r=i?.values;if(r&&r.length>4){const n=r[0]+"."+r[1]+"."+r[2],o=await this._readIFD(e,t,i.valueOffset+6-s,s,Xe.Z.GEO_KEYS,2,a);i.data=o.ifd,i.data&&i.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==e.byteLength){const i=await this.request(this.url,{range:{from:s,to:s+l.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=i.data).byteLength<l.requiredBufferSize?null:this._readIFD(e,t,0,s,Xe.Z.TIFF_TAGS,4,a)}}_getTileLocation(e,t,i){const{firstPyramidLevel:s,blockBoundary:r}=this.rasterInfo.storageInfo,n=0===e?0:e-(s-1),a=this._headerInfo?.ifds[n];if(!a)return null;const o=(0,Ve.If)(a,this._headerInfo),l=Ye(a,"TILEOFFSETS");if(void 0===l)return null;const c=Ye(a,"TILEBYTECOUNTS"),{minRow:u,minCol:h,maxRow:f,maxCol:d}=r[n];if(t>f||i>d||t<u||i<h)return null;const p=Ke(a,"IMAGEWIDTH"),m=Ke(a,"IMAGELENGTH"),y=Ke(a,"TILEWIDTH"),g=Ke(a,"TILELENGTH"),x=o?this.rasterInfo.bandCount:1,I=x*t*(d+1)+i,b=[{from:l[I],to:l[I+x-1]+c[I+x-1]-1}];if(o){let e=!0;for(let t=0;t<x;t++)if(l[I+t]+c[I+t]!==l[I+t+1]){e=!1;break}if(!e)for(let e=0;e<x;e++)b[e]={from:l[I+e],to:l[I+e]+c[I+e]-1}}const w=l[I],_=c[I];return null==w||null==_?null:{ranges:b,ifd:a,actualTileWidth:i===d&&p%y||y,actualTileHeight:t===f&&m%g||g}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Be(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=de.parse(t);return i?.recordSet?me.default.fromJSON(i.recordSet):null}catch{return null}}};(0,s._)([(0,h.Cb)()],Qe.prototype,"_files",void 0),(0,s._)([(0,h.Cb)()],Qe.prototype,"_headerInfo",void 0),(0,s._)([(0,h.Cb)()],Qe.prototype,"_bufferSize",void 0),(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],Qe.prototype,"datasetFormat",void 0),Qe=(0,s._)([(0,m.j)("esri.layers.support.rasterDatasets.TIFFRaster")],Qe);const et=Qe,tt=new Map;tt.set("CRF",{desc:"Cloud Raster Format",constructor:xe}),tt.set("MRF",{desc:"Meta Raster Format",constructor:$e}),tt.set("TIFF",{desc:"GeoTIFF",constructor:et}),tt.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Ae}),tt.set("JPG",{desc:"JPG Raster Format",constructor:ze}),tt.set("PNG",{desc:"PNG Raster Format",constructor:ze}),tt.set("GIF",{desc:"GIF Raster Format",constructor:ze}),tt.set("BMP",{desc:"BMP Raster Format",constructor:ze});class it{static get supportedFormats(){const e=new Set;return tt.forEach(((t,i)=>e.add(i))),e}static async open(e){const{url:t,ioConfig:i,sourceJSON:s}=e;let r=e.datasetFormat;null==r&&t.lastIndexOf(".")&&(r=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===r||"TIF"===r?r="TIFF":"JPG"!==r&&"JPEG"!==r&&"JFIF"!==r||(r="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(r="RasterTileServer");const n={url:t,sourceJSON:s,datasetFormat:r,ioConfig:i??{bandIds:null,sampling:null}};let o,l;if(r&&this.supportedFormats.has(r)){if("CRF"===r&&!i?.enableCRF)throw new a.Z("rasterfactory:open",`cannot open raster: ${t}`);return o=tt.get(r).constructor,l=new o(n),await l.open({signal:e.signal}),l}if(r)throw new a.Z("rasterfactory:open","not a supported format "+r);const c=Array.from(tt.keys());let u=0;const h=()=>(r=c[u++],r&&("CRF"!==r||i?.enableCRF)?(o=tt.get(r).constructor,l=new o(n),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null);return h()}static register(e,t,i){tt.has(e.toUpperCase())||tt.set(e.toUpperCase(),{desc:t,constructor:i})}}var st=i(32163);let rt=class extends((0,g.h)((0,ae.M)((0,se.q)((0,re.I)((0,x.N)(ie((0,oe.n)((0,ne.Q)((0,l.R)(y.Z)))))))))){constructor(...e){super(...e),this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.title=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,o.pC)(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(){let e=[new le.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"})];const{rasterInfo:t}=this,{attributeTable:i}=t,s=(0,o.pC)(i)?i.fields:null;if(s){const t=s.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e=e.concat(t)}const{dataType:r,multidimensionalInfo:n}=t;if(("vector-magdir"===r||"vector-uv"===r)&&(0,o.pC)(n)){const t=n.variables[0].unit?.trim(),i="Magnitude"+(t?` (${t})`:"");e.push(new le.Z({name:"Raster.Magnitude",alias:i,domain:null,editable:!1,type:"double"})),e.push(new le.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}set renderer(e){this._set("renderer",e),this.updateRenderer()}readRenderer(e,t,i){const s=t&&t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.renderer,r=(0,n.ij)(s,i)||void 0;if(null!=r)return r}createPopupTemplate(e){return(0,st.eZ)({fields:this.rasterFields,title:this.title},e)}write(e,t){const{raster:i}=this;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){if(this.raster)this.raster.rasterInfo||await this.raster.open(),this.url=this.raster.url;else{const t=await it.open({url:this.url,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(this.rasterFunction){const e=(0,X.Ue)(this.rasterFunction.toJSON(),{raster:t}),i=new V({rasterFunction:e});await i.open(),this.raster=i}else this.raster=t}const{rasterInfo:t}=this.raster;if(!t)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(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"})}null==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.ioConfig.customFetchParameters=e})))}};(0,s._)([(0,h.Cb)({type:[f.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],rt.prototype,"bandIds",void 0),(0,s._)([(0,h.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,d.J)(ce.c)],rt.prototype,"interpolation",void 0),(0,s._)([(0,h.Cb)({json:{write:!0}})],rt.prototype,"multidimensionalDefinition",void 0),(0,s._)([(0,h.Cb)(S.rn)],rt.prototype,"legendEnabled",void 0),(0,s._)([(0,h.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],rt.prototype,"isReference",void 0),(0,s._)([(0,h.Cb)({type:["show","hide"]})],rt.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)({json:{read:!0,write:!0}})],rt.prototype,"blendMode",void 0),(0,s._)([(0,h.Cb)()],rt.prototype,"sourceJSON",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],rt.prototype,"version",void 0),(0,s._)([(0,h.Cb)()],rt.prototype,"title",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],rt.prototype,"type",void 0),(0,s._)([(0,h.Cb)({type:["ArcGISTiledImageServiceLayer"]})],rt.prototype,"operationalLayerType",void 0),(0,s._)([(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}}}})],rt.prototype,"popupEnabled",void 0),(0,s._)([(0,h.Cb)({type:r.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],rt.prototype,"popupTemplate",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],rt.prototype,"defaultPopupTemplate",null),(0,s._)([(0,h.Cb)({readOnly:!0,type:[le.Z]})],rt.prototype,"fields",void 0),(0,s._)([(0,h.Cb)({readOnly:!0,type:[le.Z]})],rt.prototype,"rasterFields",null),(0,s._)([(0,h.Cb)({types:n.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:n.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],rt.prototype,"renderer",null),(0,s._)([(0,p.r)("renderer")],rt.prototype,"readRenderer",null),rt=(0,s._)([(0,m.j)("esri.layers.ImageryTileLayer")],rt);const nt=rt}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4599],{45091:(e,t,s)=>{s.d(t,{Z:()=>l});var r,n,i=s(80442),a=s(71143);(n=r||(r={}))[n.varint=0]="varint",n[n.fixed64=1]="fixed64",n[n.delimited=2]="delimited",n[n.fixed32=5]="fixed32",n[n.unknown=99]="unknown";const o=4294967296,u=new TextDecoder("utf-8"),c=(0,i.Z)("safari")||(0,i.Z)("ios")?6:(0,i.Z)("ff")?12:32;class l{constructor(e,t,s=0,n=(e?e.byteLength:0)){this._tag=0,this._dataType=r.unknown,this._init(e,t,s,n)}_init(e,t,s,r){this._data=e,this._dataView=t,this._pos=s,this._end=r}asUnsafe(){return this}clone(){return new l(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(e){this._pos=e}nextTag(e){for(;;){if(this._pos===this._end)return!1;const t=this._decodeVarint();if(this._tag=t>>3,this._dataType=7&t,!e||e===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const e=this._decodeVarint();return this._tag=e>>3,this._dataType=7&e,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let e=4294967295;return e=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?e:(e=(e|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?e:(e=(e|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?e:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const e=this.getUInt32();if(void 0!==e)return e>>>1^-(1&e)|0}getSInt64(){return this._decodeSVarint()}getBool(){const e=0!==this._data[this._pos];return this._skip(1),e}getEnum(){return this._decodeVarint()}getFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getUint32(t+4,!0)*o;return this._skip(8),s}getSFixed64(){const e=this._dataView,t=this._pos,s=e.getUint32(t,!0)+e.getInt32(t+4,!0)*o;return this._skip(8),s}getDouble(){const e=this._dataView.getFloat64(this._pos,!0);return this._skip(8),e}getFixed32(){const e=this._dataView.getUint32(this._pos,!0);return this._skip(4),e}getSFixed32(){const e=this._dataView.getInt32(this._pos,!0);return this._skip(4),e}getFloat(){const e=this._dataView.getFloat32(this._pos,!0);return this._skip(4),e}getString(){const e=this._getLength(),t=this._pos,s=this._toString(this._data,t,t+e);return this._skip(e),s}getBytes(){const e=this._getLength(),t=this._pos,s=this._toBytes(this._data,t,t+e);return this._skip(e),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(e,t,s,r){const n=this.getMessage(),i=e(n,t,s,r);return n.release(),i}processMessage(e){const t=this.getMessage(),s=e(t);return t.release(),s}getMessage(){const e=this._getLength(),t=l.pool.acquire();return t._init(this._data,this._dataView,this._pos,this._pos+e),this._skip(e),t}release(){l.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case r.varint:this._decodeVarint();break;case r.fixed64:this._skip(8);break;case r.delimited:this._skip(this._getLength());break;case r.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(e){this._skip(e)}_skip(e){if(this._pos+e>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=e}_decodeVarint(){const e=this._data;let t=this._pos,s=0,r=0;if(this._end-t>=10)do{if(r=e[t++],s|=127&r,0==(128&r))break;if(r=e[t++],s|=(127&r)<<7,0==(128&r))break;if(r=e[t++],s|=(127&r)<<14,0==(128&r))break;if(r=e[t++],s|=(127&r)<<21,0==(128&r))break;if(r=e[t++],s+=268435456*(127&r),0==(128&r))break;if(r=e[t++],s+=34359738368*(127&r),0==(128&r))break;if(r=e[t++],s+=4398046511104*(127&r),0==(128&r))break;if(r=e[t++],s+=562949953421312*(127&r),0==(128&r))break;if(r=e[t++],s+=72057594037927940*(127&r),0==(128&r))break;if(r=e[t++],s+=0x8000000000000000*(127&r),0==(128&r))break;throw new Error("Varint too long!")}while(0);else{let n=1;for(;t!==this._end&&(r=e[t],0!=(128&r));)++t,s+=(127&r)*n,n*=128;if(t===this._end)throw new Error("Varint overrun!");++t,s+=r*n}return this._pos=t,s}_decodeSVarint(){const e=this._data;let t=this._pos,s=0,r=0;const n=1&e[t];if(this._end-t>=10)do{if(r=e[t++],s|=127&r,0==(128&r))break;if(r=e[t++],s|=(127&r)<<7,0==(128&r))break;if(r=e[t++],s|=(127&r)<<14,0==(128&r))break;if(r=e[t++],s|=(127&r)<<21,0==(128&r))break;if(r=e[t++],s+=268435456*(127&r),0==(128&r))break;if(r=e[t++],s+=34359738368*(127&r),0==(128&r))break;if(r=e[t++],s+=4398046511104*(127&r),0==(128&r))break;if(r=e[t++],s+=562949953421312*(127&r),0==(128&r))break;if(r=e[t++],s+=72057594037927940*(127&r),0==(128&r))break;if(r=e[t++],s+=0x8000000000000000*(127&r),0==(128&r))break;throw new Error("Varint too long!")}while(0);else{let n=1;for(;t!==this._end&&(r=e[t],0!=(128&r));)++t,s+=(127&r)*n,n*=128;if(t===this._end)throw new Error("Varint overrun!");++t,s+=r*n}return this._pos=t,n?-(s+1)/2:s/2}_getLength(){if(this._dataType!==r.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(e,t,s){if((s=Math.min(this._end,s))-t>c){const r=e.subarray(t,s);return u.decode(r)}let r="",n="";for(let i=t;i<s;++i){const t=e[i];128&t?n+="%"+t.toString(16):(r+=decodeURIComponent(n)+String.fromCharCode(t),n="")}return n.length&&(r+=decodeURIComponent(n)),r}_toBytes(e,t,s){return s=Math.min(this._end,s),new Uint8Array(e.buffer,t,s-t)}}l.pool=new a.Z(l,void 0,(e=>{e._data=null,e._dataView=null}))},82526:(e,t,s)=>{s.d(t,{aX:()=>q});var r=s(68773),n=s(20102),i=s(92604),a=s(70586),o=s(38913),u=s(58901),c=s(82971),l=s(33955);const p={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new u.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:c.Z.WebMercator}),minus180Line:new u.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:c.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new u.Z({paths:[[[180,-180],[180,180]]],spatialReference:c.Z.WGS84}),minus180Line:new u.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:c.Z.WGS84})}};function f(e,t){return Math.ceil((e-t)/(2*t))}function d(e,t){const s=h(e);for(const e of s)for(const s of e)s[0]+=t;return e}function h(e){return(0,l.oU)(e)?e.rings:e.paths}var g=s(8744),y=s(40488),m=(s(66577),s(3172)),_=s(17452);function k(e){return{geometryType:(0,l.Ji)(e[0]),geometries:e.map((e=>e.toJSON()))}}const b=i.Z.getLogger("esri.geometry.support.normalizeUtils");function x(e){return"polygon"===e[0].type}function S(e){return"polyline"===e[0].type}function w(e,t,s){if(t){const t=function(e,t){if(!(e instanceof u.Z||e instanceof o.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw b.error(e),new n.Z(e)}const s=h(e),r=[];for(const e of s){const s=[];r.push(s),s.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const n=e[r][0],i=e[r][1],a=e[r+1][0],o=e[r+1][1],u=Math.sqrt((a-n)*(a-n)+(o-i)*(o-i)),c=(o-i)/u,l=(a-n)/u,p=u/t;if(p>1){for(let e=1;e<=p-1;e++){const r=e*t,a=l*r+n,o=c*r+i;s.push([a,o])}const e=(u+Math.floor(p-1)*t)/2,r=l*e+n,a=c*e+i;s.push([r,a])}s.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new o.Z({rings:r,spatialReference:e.spatialReference}):new u.Z({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,y.Sx)(t,!0)}return s&&(e=d(e,s)),e}function T(e,t,s){if(Array.isArray(e)){const r=e[0];if(r>t){const s=f(r,t);e[0]=r+s*(-2*t)}else if(r<s){const t=f(r,s);e[0]=r+t*(-2*s)}}else{const r=e.x;if(r>t){const s=f(r,t);e=e.clone().offset(s*(-2*t),0)}else if(r<s){const t=f(r,s);e=e.clone().offset(t*(-2*s),0)}}return e}function F(e,t){let s=-1;for(let r=0;r<t.cutIndexes.length;r++){const n=t.cutIndexes[r],i=t.geometries[r],a=h(i);for(let e=0;e<a.length;e++){const t=a[e];t.some((s=>{if(s[0]<180)return!0;{let s=0;for(let e=0;e<t.length;e++){const r=t[e][0];s=r>s?r:s}s=Number(s.toFixed(9));const r=-360*f(s,180);for(let s=0;s<t.length;s++){const t=i.getPoint(e,s);i.setPoint(e,s,t.clone().offset(r,0))}return!0}}))}if(n===s){if(x(e))for(const t of h(i))e[n]=e[n].addRing(t);else if(S(e))for(const t of h(i))e[n]=e[n].addPath(t)}else s=n,e[n]=i}return e}async function q(e,t,s){if(!Array.isArray(e))return q([e],t);t&&"string"!=typeof t&&b.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??r.Z.geometryServiceUrl;let i,c,h,x,S,R,I,U,E=0;const V=[],C=[];for(const t of e)if((0,a.Wi)(t))C.push(t);else if(i||(i=t.spatialReference,c=(0,g.C5)(i),h=i.isWebMercator,R=h?102100:4326,x=p[R].maxX,S=p[R].minX,I=p[R].plus180Line,U=p[R].minus180Line),c)if("mesh"===t.type)C.push(t);else if("point"===t.type)C.push(T(t.clone(),x,S));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>T(e,x,S))),C.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,c);C.push(e.rings?new o.Z(e):e)}else if(t.extent){const e=t.extent,s=f(e.xmin,S)*(2*x);let r=0===s?t.clone():d(t.clone(),s);e.offset(s,0),e.intersects(I)&&e.xmax!==x?(E=e.xmax>E?e.xmax:E,r=w(r,h),V.push(r),C.push("cut")):e.intersects(U)&&e.xmin!==S?(E=e.xmax*(2*x)>E?e.xmax*(2*x):E,r=w(r,h,360),V.push(r),C.push("cut")):C.push(r)}else C.push(t.clone());else C.push(t);let G=f(E,x),N=-90;const M=G,P=new u.Z;for(;G>0;){const e=360*G-180;P.addPath([[e,N],[e,-1*N]]),N*=-1,G--}if(V.length>0&&M>0){const t=F(V,await async function(e,t,s,r){const n="string"==typeof e?(0,_.mN)(e):e,i=t[0].spatialReference,a={...r,query:{...n.query,f:"json",sr:JSON.stringify(i),target:JSON.stringify({geometryType:(0,l.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(s)}},o=await(0,m.default)(n.path+"/cut",a),{cutIndexes:u,geometries:c=[]}=o.data;return{cutIndexes:u,geometries:c.map((e=>{const t=(0,l.im)(e);return t.spatialReference=i,t}))}}(n,V,P,s)),r=[],i=[];for(let s=0;s<C.length;s++){const n=C[s];if("cut"!==n)i.push(n);else{const n=t.shift(),o=e[s];(0,a.pC)(o)&&"polygon"===o.type&&o.rings&&o.rings.length>1&&n.rings.length>=o.rings.length?(r.push(n),i.push("simplify")):i.push(h?(0,y.$)(n):n)}}if(!r.length)return i;const o=await async function(e,t,s){const r="string"==typeof e?(0,_.mN)(e):e,n=t[0].spatialReference,i=(0,l.Ji)(t[0]),a={...s,query:{...r.query,f:"json",sr:n.wkid?n.wkid:JSON.stringify(n),geometries:JSON.stringify(k(t))}};return function(e,t,s){const r=(0,l.q9)(t);return e.map((e=>{const t=r.fromJSON(e);return t.spatialReference=s,t}))}((await(0,m.default)(r.path+"/simplify",a)).data,i,n)}(n,r,s),u=[];for(let e=0;e<i.length;e++){const t=i[e];"simplify"!==t?u.push(t):u.push(h?(0,y.$)(o.shift()):o.shift())}return u}const O=[];for(let e=0;e<C.length;e++){const t=C[e];if("cut"!==t)O.push(t);else{const e=V.shift();O.push(!0===h?(0,y.$)(e):e)}}return O}},76497:(e,t,s)=>{function r(e){const t={};for(const s in e){if("declaredClass"===s)continue;const n=e[s];if(null!=n&&"function"!=typeof n)if(Array.isArray(n)){t[s]=[];for(let e=0;e<n.length;e++)t[s][e]=r(n[e])}else"object"==typeof n?n.toJSON&&(t[s]=JSON.stringify(n)):t[s]=n}return t}s.d(t,{A:()=>r})},77863:(e,t,s)=>{s.d(t,{G$:()=>T,K9:()=>U,O7:()=>p});var r=s(20102),n=s(70586),i=s(45091),a=s(5428),o=s(78760);const u=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],c=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],l=["upperLeft","lowerLeft"];function p(e){return e>=u.length?null:u[e]}function f(e){return e>=c.length?null:c[e]}function d(e){return e>=l.length?null:l[e]}function h(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function g(e,t,s){const r=e.asUnsafe(),n=t.createPointGeometry(s);for(;r.next();)switch(r.tag()){case 3:{const e=r.getUInt32(),s=r.pos()+e;let i=0;for(;r.pos()<s;)t.addCoordinatePoint(n,r.getSInt64(),i++);break}default:r.skip()}return n}function y(e,t,s){const r=e.asUnsafe(),n=t.createGeometry(s),i=2+(s.hasZ?1:0)+(s.hasM?1:0);for(;r.next();)switch(r.tag()){case 2:{const e=r.getUInt32(),s=r.pos()+e;let i=0;for(;r.pos()<s;)t.addLength(n,r.getUInt32(),i++);break}case 3:{const e=r.getUInt32(),s=r.pos()+e;let a=0;for(t.allocateCoordinates(n);r.pos()<s;)t.addCoordinate(n,r.getSInt64(),a),a++,a===i&&(a=0);break}default:r.skip()}return n}function m(e){const t=e.asUnsafe(),s=new a.Z;let r="esriGeometryPoint";for(;t.next();)switch(t.tag()){case 2:{const e=t.getUInt32(),r=t.pos()+e;for(;t.pos()<r;)s.lengths.push(t.getUInt32());break}case 3:{const e=t.getUInt32(),r=t.pos()+e;for(;t.pos()<r;)s.coords.push(t.getSInt64());break}case 1:r=o.A[t.getEnum()];break;default:t.skip()}return{queryGeometry:s,queryGeometryType:r}}function _(e){const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:return t.getString();case 2:return t.getFloat();case 3:return t.getDouble();case 4:return t.getSInt32();case 5:return t.getUInt32();case 6:return t.getInt64();case 7:return t.getUInt64();case 8:return t.getSInt64();case 9:return t.getBool();default:return t.skip(),null}return null}function k(e){const t=e.asUnsafe(),s={type:p(0)};for(;t.next();)switch(t.tag()){case 1:s.name=t.getString();break;case 2:s.type=p(t.getEnum());break;case 3:s.alias=t.getString();break;case 4:s.sqlType=f(t.getEnum());break;case 5:default:t.skip();break;case 6:s.defaultValue=t.getString()}return s}function b(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.name=s.getString();break;case 2:t.isSystemMaintained=s.getBool();break;default:s.skip()}return t}function x(e,t,s,r){const n=t.createFeature(s);let i=0;for(;e.next();)switch(e.tag()){case 1:{const t=r[i++].name;n.attributes[t]=e.processMessage(_);break}case 2:n.geometry=e.processMessageWithArgs(y,t,s);break;case 4:n.centroid=e.processMessageWithArgs(g,t,s);break;default:e.skip()}return n}function S(e){const t=[1,1,1,1],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function w(e){const t=[0,0,0,0],s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t[0]=s.getDouble();break;case 2:t[1]=s.getDouble();break;case 4:t[2]=s.getDouble();break;case 3:t[3]=s.getDouble();break;default:s.skip()}return t}function T(e){const t={originPosition:d(0)},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.originPosition=d(s.getEnum());break;case 2:t.scale=s.processMessage(S);break;case 3:t.translate=s.processMessage(w);break;default:s.skip()}return t}function F(e){const t={},s=e.asUnsafe();for(;s.next();)switch(s.tag()){case 1:t.shapeAreaFieldName=s.getString();break;case 2:t.shapeLengthFieldName=s.getString();break;case 3:t.units=s.getString();break;default:s.skip()}return t}function q(e,t){const s=t.createSpatialReference();for(;e.next();)switch(e.tag()){case 1:s.wkid=e.getUInt32();break;case 5:s.wkt=e.getString();break;case 2:s.latestWkid=e.getUInt32();break;case 3:s.vcsWkid=e.getUInt32();break;case 4:s.latestVcsWkid=e.getUInt32();break;default:e.skip()}return s}function R(e,t){const s=t.createFeatureResult(),r=e.asUnsafe();s.geometryType=h(t,0);let n=!1;for(;r.next();)switch(r.tag()){case 1:s.objectIdFieldName=r.getString();break;case 3:s.globalIdFieldName=r.getString();break;case 4:s.geohashFieldName=r.getString();break;case 5:s.geometryProperties=r.processMessage(F);break;case 7:s.geometryType=h(t,r.getEnum());break;case 8:s.spatialReference=r.processMessageWithArgs(q,t);break;case 10:s.hasZ=r.getBool();break;case 11:s.hasM=r.getBool();break;case 12:s.transform=r.processMessage(T);break;case 9:{const e=r.getBool();s.exceededTransferLimit=e;break}case 13:t.addField(s,r.processMessage(k));break;case 15:n||(t.prepareFeatures(s),n=!0),t.addFeature(s,r.processMessageWithArgs(x,t,s,s.fields));break;case 2:s.uniqueIdField=r.processMessage(b);break;default:r.skip()}return t.finishFeatureResult(s),s}function I(e,t){const s={};let r=null;for(;e.next();)switch(e.tag()){case 4:r=e.processMessageWithArgs(m);break;case 1:s.featureResult=e.processMessageWithArgs(R,t);break;default:e.skip()}return(0,n.pC)(r)&&s.featureResult&&t.addQueryGeometry(s,r),s}function U(e,t){try{const s=2,r=new i.Z(new Uint8Array(e),new DataView(e)),n={};for(;r.next();)r.tag()===s?n.queryResult=r.processMessageWithArgs(I,t):r.skip();return n}catch(e){throw new r.Z("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:e})}}},78760:(e,t,s)=>{s.d(t,{A:()=>u,J:()=>c});var r=s(67900),n=s(8744),i=s(70272),a=s(44876),o=s(5428);const u=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];class c{constructor(e){this._options=e,this.geometryTypes=u,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new a.Z}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!e||!e.features||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||(0,n.fS)(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const t=(0,r._R)(this._options.sourceSpatialReference)/(0,r._R)(e.spatialReference);if(1!==t)for(const s of e.features){if(!(0,i.S6)(s))continue;const e=s.geometry.coords;for(let s=2;s<e.length;s+=3)e[s]*=t}}addFeature(e,t){e.features.push(t)}createFeature(){return new i.u_}createSpatialReference(){return{wkid:0}}createGeometry(){return new o.Z}addField(e,t){e.fields.push(t)}allocateCoordinates(e){e.coords.length=e.lengths.reduce(((e,t)=>e+t),0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,t){e.coords[this._coordinatePtr++]=t}addCoordinatePoint(e,t){e.coords.push(t)}addLength(e,t){e.lengths.push(t)}addQueryGeometry(e,t){e.queryGeometry=t.queryGeometry,e.queryGeometryType=t.queryGeometryType}createPointGeometry(){return new o.Z}}},45178:(e,t,s)=>{s.d(t,{C:()=>n});var r=s(77863);function n(e,t){const s=(0,r.K9)(e,t),n=s.queryResult.featureResult,i=s.queryResult.queryGeometry,a=s.queryResult.queryGeometryType;if(n&&n.features&&n.features.length&&n.objectIdFieldName){const e=n.objectIdFieldName;for(const t of n.features)t.attributes&&(t.objectId=t.attributes[e])}return n&&(n.queryGeometry=i,n.queryGeometryType=a),n}},34599:(e,t,s)=>{s.r(t),s.d(t,{encodeGeometry:()=>f,executeQuery:()=>h,executeQueryForCount:()=>_,executeQueryForExtent:()=>k,executeQueryForIds:()=>m,executeQueryPBF:()=>g,executeQueryPBFBuffer:()=>y,queryToQueryStringParameters:()=>d,runQuery:()=>b});var r=s(3172),n=s(70586),i=s(17452),a=s(33955),o=s(82526),u=s(76497),c=s(45178),l=s(28694);const p="Layer does not support extent calculation.";function f(e,t){if(t&&"extent"===e.type)return`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`;if(t&&"point"===e.type)return`${e.x},${e.y}`;const s=e.toJSON();return delete s.spatialReference,JSON.stringify(s)}function d(e,t){const s=e.geometry,r=e.toJSON();delete r.compactGeometryEnabled,delete r.defaultSpatialReferenceEnabled;const i=r;let o,u,c;if((0,n.pC)(s)&&(u=s.spatialReference,c=s.spatialReference.wkid||JSON.stringify(s.spatialReference),i.geometryType=(0,a.Ji)(s),i.geometry=f(s,e.compactGeometryEnabled),i.inSR=c),r.groupByFieldsForStatistics&&(i.groupByFieldsForStatistics=r.groupByFieldsForStatistics.join(",")),r.objectIds&&(i.objectIds=r.objectIds.join(",")),r.orderByFields&&(i.orderByFields=r.orderByFields.join(",")),!r.outFields||!r.returnDistinctValues&&(t?.returnCountOnly||t?.returnExtentOnly||t?.returnIdsOnly)?delete i.outFields:r.outFields.includes("*")?i.outFields="*":i.outFields=r.outFields.join(","),r.outSR?(i.outSR=r.outSR.wkid||JSON.stringify(r.outSR),o=e.outSpatialReference):s&&(r.returnGeometry||r.returnCentroid)&&(i.outSR=i.inSR,o=u),r.returnGeometry&&delete r.returnGeometry,r.outStatistics&&(i.outStatistics=JSON.stringify(r.outStatistics)),r.pixelSize&&(i.pixelSize=JSON.stringify(r.pixelSize)),r.quantizationParameters&&(e.defaultSpatialReferenceEnabled&&(0,n.pC)(u)&&(0,n.pC)(e.quantizationParameters)&&(0,n.pC)(e.quantizationParameters.extent)&&u.equals(e.quantizationParameters.extent.spatialReference)&&delete r.quantizationParameters.extent.spatialReference,i.quantizationParameters=JSON.stringify(r.quantizationParameters)),r.parameterValues&&(i.parameterValues=JSON.stringify(r.parameterValues)),r.rangeValues&&(i.rangeValues=JSON.stringify(r.rangeValues)),r.dynamicDataSource&&(i.layer=JSON.stringify({source:r.dynamicDataSource}),delete r.dynamicDataSource),r.timeExtent){const e=r.timeExtent,{start:t,end:s}=e;null==t&&null==s||(i.time=t===s?t:`${t??"null"},${s??"null"}`),delete r.timeExtent}return e.defaultSpatialReferenceEnabled&&(0,n.pC)(u)&&(0,n.pC)(o)&&u.equals(o)&&(i.defaultSR=i.inSR,delete i.inSR,delete i.outSR),i}async function h(e,t,s,r){const i=(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?{data:{features:[]}}:await b(e,t,"json",r);return(0,l.p)(t,s,i.data),i}async function g(e,t,s,r){if((0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty)return{data:s.createFeatureResult()};const i=await y(e,t,r),a=i;return a.data=(0,c.C)(i.data,s),a}function y(e,t,s){return b(e,t,"pbf",s)}function m(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{objectIds:[]}}):b(e,t,"json",s,{returnIdsOnly:!0})}function _(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):b(e,t,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function k(e,t,s){return(0,n.pC)(t.timeExtent)&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0,extent:null}}):b(e,t,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then((e=>{const t=e.data;if(t.hasOwnProperty("extent"))return e;if(t.features)throw new Error(p);if(t.hasOwnProperty("count"))throw new Error(p);return e}))}function b(e,t,s,a={},c={}){const l="string"==typeof e?(0,i.mN)(e):e,p=t.geometry?[t.geometry]:[];return a.responseType="pbf"===s?"array-buffer":"json",(0,o.aX)(p,null,a).then((e=>{const o=e&&e[0];(0,n.pC)(o)&&((t=t.clone()).geometry=o);const p=(0,u.A)({...l.query,f:s,...c,...d(t,c)});return(0,r.default)((0,i.v_)(l.path,"query"),{...a,query:{...p,...a.query}})}))}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9956,4202,8694,3492],{3920:(e,t,r)=>{r.d(t,{p:()=>p,r:()=>u});var n=r(43697),i=r(15923),o=r(61247),s=r(5600),l=r(52011),a=r(72762);const p=e=>{let t=class extends e{destroy(){this.destroyed||(this._get("handles")?.destroy(),this._get("updatingHandles")?.destroy())}get handles(){return this._get("handles")||new o.Z}get updatingHandles(){return this._get("updatingHandles")||new a.t}};return(0,n._)([(0,s.Cb)({readOnly:!0})],t.prototype,"handles",null),(0,n._)([(0,s.Cb)({readOnly:!0})],t.prototype,"updatingHandles",null),t=(0,n._)([(0,l.j)("esri.core.HandleOwner")],t),t};let u=class extends(p(i.Z)){};u=(0,n._)([(0,l.j)("esri.core.HandleOwner")],u)},17445:(e,t,r)=>{r.d(t,{N1:()=>c,YP:()=>a,Z_:()=>f,gx:()=>p,nn:()=>m,on:()=>y,tX:()=>g});var n=r(91460),i=r(50758),o=r(70586),s=r(95330),l=r(26258);function a(e,t,r={}){return u(e,t,r,d)}function p(e,t,r={}){return u(e,t,r,h)}function u(e,t,r={},n){let i=null;const s=r.once?(e,r)=>{n(e)&&((0,o.hw)(i),t(e,r))}:(e,r)=>{n(e)&&t(e,r)};if(i=(0,l.aQ)(e,s,r.sync,r.equals),r.initial){const t=e();s(t,t)}return i}function y(e,t,r,s={}){let l=null,p=null,u=null;function y(){l&&p&&(p.remove(),s.onListenerRemove?.(l),l=null,p=null)}function c(e){s.once&&s.once&&(0,o.hw)(u),r(e)}const d=a(e,((e,r)=>{y(),(0,n.vT)(e)&&(l=e,p=(0,n.on)(e,t,c),s.onListenerAdd?.(e))}),{sync:s.sync,initial:!0});return u=(0,i.kB)((()=>{d.remove(),y()})),u}function c(e,t){return function(e,t,r){if((0,s.Hc)(r))return Promise.reject((0,s.zE)());const n=e();if(t?.(n))return Promise.resolve(n);let l=null;function a(){l=(0,o.hw)(l)}return new Promise(((n,o)=>{l=(0,i.AL)([(0,s.fu)(r,(()=>{a(),o((0,s.zE)())})),u(e,(e=>{a(),n(e)}),{sync:!1,once:!0},t??d)])}))}(e,h,t)}function d(e){return!0}function h(e){return!!e}r(87538);const f={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},42033:(e,t,r)=>{r.d(t,{E:()=>i,_:()=>o});var n=r(70586);async function i(e,t){const{WhereClause:n}=await r.e(1534).then(r.bind(r,41534));return n.create(e,t)}function o(e,t){return(0,n.pC)(e)?(0,n.pC)(t)?`(${e}) AND (${t})`:e:t}},72762:(e,t,r)=>{r.d(t,{t:()=>y});var n=r(43697),i=r(15923),o=r(61247),s=r(70586),l=r(17445),a=r(1654),p=r(5600),u=r(52011);let y=class extends i.Z{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new o.Z,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,t,r={}){return this._installWatch(e,t,r,l.YP)}addWhen(e,t,r={}){return this._installWatch(e,t,r,l.gx)}addOnCollectionChange(e,t,{initial:r=!1,final:n=!1}={}){const i=++this._handleId;return this._handles.add([(0,l.on)(e,"after-changes",this._createSyncUpdatingCallback(),l.Z_),(0,l.on)(e,"change",t,{onListenerAdd:r?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:n?e=>t({added:[],removed:e.toArray()}):void 0})],i),{remove:()=>this._handles.remove(i)}}addPromise(e){if((0,s.Wi)(e))return e;const t=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(0!==this._pendingPromises.size||this._handles.has(c)||this._set("updating",!1))}},t),this._pendingPromises.add(e),this._set("updating",!0);const r=()=>this._handles.remove(t);return e.then(r,r),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,t,r={},n){const i=++this._handleId;r.sync||this._installSyncUpdatingWatch(e,i);const o=n(e,t,r);return this._handles.add(o,i),{remove:()=>this._handles.remove(i)}}_installSyncUpdatingWatch(e,t){const r=this._createSyncUpdatingCallback(),n=(0,l.YP)(e,r,{sync:!0,equals:()=>!1});return this._handles.add(n,t),n}_createSyncUpdatingCallback(){return()=>{this._handles.remove(c),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add((0,a.Os)((()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(c))})),c)}}};(0,n._)([(0,p.Cb)({readOnly:!0})],y.prototype,"updating",void 0),y=(0,n._)([(0,u.j)("esri.core.support.WatchUpdatingTracking")],y);const c=-42},82526:(e,t,r)=>{r.d(t,{aX:()=>T});var n=r(68773),i=r(20102),o=r(92604),s=r(70586),l=r(38913),a=r(58901),p=r(82971),u=r(33955);const y={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new a.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:p.Z.WebMercator}),minus180Line:new a.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:p.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new a.Z({paths:[[[180,-180],[180,180]]],spatialReference:p.Z.WGS84}),minus180Line:new a.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:p.Z.WGS84})}};function c(e,t){return Math.ceil((e-t)/(2*t))}function d(e,t){const r=h(e);for(const e of r)for(const r of e)r[0]+=t;return e}function h(e){return(0,u.oU)(e)?e.rings:e.paths}var f=r(8744),m=r(40488),g=(r(66577),r(3172)),S=r(17452);function _(e){return{geometryType:(0,u.Ji)(e[0]),geometries:e.map((e=>e.toJSON()))}}const b=o.Z.getLogger("esri.geometry.support.normalizeUtils");function w(e){return"polygon"===e[0].type}function v(e){return"polyline"===e[0].type}function C(e,t,r){if(t){const t=function(e,t){if(!(e instanceof a.Z||e instanceof l.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw b.error(e),new i.Z(e)}const r=h(e),n=[];for(const e of r){const r=[];n.push(r),r.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const i=e[n][0],o=e[n][1],s=e[n+1][0],l=e[n+1][1],a=Math.sqrt((s-i)*(s-i)+(l-o)*(l-o)),p=(l-o)/a,u=(s-i)/a,y=a/t;if(y>1){for(let e=1;e<=y-1;e++){const n=e*t,s=u*n+i,l=p*n+o;r.push([s,l])}const e=(a+Math.floor(y-1)*t)/2,n=u*e+i,s=p*e+o;r.push([n,s])}r.push([s,l])}}return function(e){return"polygon"===e.type}(e)?new l.Z({rings:n,spatialReference:e.spatialReference}):new a.Z({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,m.Sx)(t,!0)}return r&&(e=d(e,r)),e}function x(e,t,r){if(Array.isArray(e)){const n=e[0];if(n>t){const r=c(n,t);e[0]=n+r*(-2*t)}else if(n<r){const t=c(n,r);e[0]=n+t*(-2*r)}}else{const n=e.x;if(n>t){const r=c(n,t);e=e.clone().offset(r*(-2*t),0)}else if(n<r){const t=c(n,r);e=e.clone().offset(t*(-2*r),0)}}return e}function O(e,t){let r=-1;for(let n=0;n<t.cutIndexes.length;n++){const i=t.cutIndexes[n],o=t.geometries[n],s=h(o);for(let e=0;e<s.length;e++){const t=s[e];t.some((r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const n=t[e][0];r=n>r?n:r}r=Number(r.toFixed(9));const n=-360*c(r,180);for(let r=0;r<t.length;r++){const t=o.getPoint(e,r);o.setPoint(e,r,t.clone().offset(n,0))}return!0}}))}if(i===r){if(w(e))for(const t of h(o))e[i]=e[i].addRing(t);else if(v(e))for(const t of h(o))e[i]=e[i].addPath(t)}else r=i,e[i]=o}return e}async function T(e,t,r){if(!Array.isArray(e))return T([e],t);t&&"string"!=typeof t&&b.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const i="string"==typeof t?t:t?.url??n.Z.geometryServiceUrl;let o,p,h,w,v,L,N,Z,I=0;const M=[],j=[];for(const t of e)if((0,s.Wi)(t))j.push(t);else if(o||(o=t.spatialReference,p=(0,f.C5)(o),h=o.isWebMercator,L=h?102100:4326,w=y[L].maxX,v=y[L].minX,N=y[L].plus180Line,Z=y[L].minus180Line),p)if("mesh"===t.type)j.push(t);else if("point"===t.type)j.push(x(t.clone(),w,v));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>x(e,w,v))),j.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,p);j.push(e.rings?new l.Z(e):e)}else if(t.extent){const e=t.extent,r=c(e.xmin,v)*(2*w);let n=0===r?t.clone():d(t.clone(),r);e.offset(r,0),e.intersects(N)&&e.xmax!==w?(I=e.xmax>I?e.xmax:I,n=C(n,h),M.push(n),j.push("cut")):e.intersects(Z)&&e.xmin!==v?(I=e.xmax*(2*w)>I?e.xmax*(2*w):I,n=C(n,h,360),M.push(n),j.push("cut")):j.push(n)}else j.push(t.clone());else j.push(t);let J=c(I,w),R=-90;const E=J,A=new a.Z;for(;J>0;){const e=360*J-180;A.addPath([[e,R],[e,-1*R]]),R*=-1,J--}if(M.length>0&&E>0){const t=O(M,await async function(e,t,r,n){const i="string"==typeof e?(0,S.mN)(e):e,o=t[0].spatialReference,s={...n,query:{...i.query,f:"json",sr:JSON.stringify(o),target:JSON.stringify({geometryType:(0,u.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},l=await(0,g.default)(i.path+"/cut",s),{cutIndexes:a,geometries:p=[]}=l.data;return{cutIndexes:a,geometries:p.map((e=>{const t=(0,u.im)(e);return t.spatialReference=o,t}))}}(i,M,A,r)),n=[],o=[];for(let r=0;r<j.length;r++){const i=j[r];if("cut"!==i)o.push(i);else{const i=t.shift(),l=e[r];(0,s.pC)(l)&&"polygon"===l.type&&l.rings&&l.rings.length>1&&i.rings.length>=l.rings.length?(n.push(i),o.push("simplify")):o.push(h?(0,m.$)(i):i)}}if(!n.length)return o;const l=await async function(e,t,r){const n="string"==typeof e?(0,S.mN)(e):e,i=t[0].spatialReference,o=(0,u.Ji)(t[0]),s={...r,query:{...n.query,f:"json",sr:i.wkid?i.wkid:JSON.stringify(i),geometries:JSON.stringify(_(t))}};return function(e,t,r){const n=(0,u.q9)(t);return e.map((e=>{const t=n.fromJSON(e);return t.spatialReference=r,t}))}((await(0,g.default)(n.path+"/simplify",s)).data,o,i)}(i,n,r),a=[];for(let e=0;e<o.length;e++){const t=o[e];"simplify"!==t?a.push(t):a.push(h?(0,m.$)(l.shift()):l.shift())}return a}const F=[];for(let e=0;e<j.length;e++){const t=j[e];if("cut"!==t)F.push(t);else{const e=M.shift();F.push(!0===h?(0,m.$)(e):e)}}return F}},69285:(e,t,r)=>{r.d(t,{k:()=>s});var n=r(70586),i=r(67900),o=r(8744);function s(e,t,r){if((0,n.Wi)(t)||(0,n.Wi)(r)||r.vcsWkid||(0,o.fS)(t,r))return null;const s=(0,i._R)(t)/(0,i._R)(r);if(1===s)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){e&&null!=e.z&&(e.z*=t)}(e,s);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const r of e.paths)for(const e of r)e.length>2&&(e[2]*=t)}(e,s);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const r of e.rings)for(const e of r)e.length>2&&(e[2]*=t)}(e,s);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const r of e.points)r.length>2&&(r[2]*=t)}(e,s);case"extent":case"esriGeometryExtent":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,s);default:return null}}},62128:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Q});var n=r(43697),i=(r(66577),r(38171)),o=(r(9790),r(46791)),s=r(20102),l=r(22974),a=r(70586),p=r(16453),u=r(78286),y=r(20941),c=r(5600),d=r(75215),h=r(71715),f=r(52011),m=r(30556),g=r(44547),S=r(24470),_=r(82526),b=r(8744),w=r(19238),v=(r(67676),r(70921)),C=r(3920);r(80442),r(92604);let x=class extends((0,C.p)(o.Z)){constructor(e){super(e),this.handles.add([this.on("before-add",(e=>{(0,a.Wi)(e.item)&&e.preventDefault()})),this.on("after-add",(e=>this._own(e.item))),this.on("after-remove",(e=>this._release(e.item)))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(o.Z.ofType(this.itemType.Type))(e):new o.Z(e)}};(0,n._)([(0,c.Cb)()],x.prototype,"owner",null),x=(0,n._)([(0,f.j)("esri.core.support.OwningCollection")],x);var O=r(87085),T=r(71612),L=r(72965),N=r(52421);let Z=class extends x{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};(0,n._)([(0,N.c)({Type:i.Z,ensureType:(0,d.se)(i.Z)})],Z.prototype,"itemType",void 0),Z=(0,n._)([(0,f.j)("esri.support.GraphicsCollection")],Z);var I=r(86787);let M=class extends((0,T.h)((0,L.M)(O.Z))){constructor(e){super(e),this.elevationInfo=null,this.graphics=new Z,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,t){return super.on(e,t)}graphicChanged(e){this.emit("graphic-update",e)}};var j,J;(0,n._)([(0,c.Cb)({type:I.Z})],M.prototype,"elevationInfo",void 0),(0,n._)([(0,c.Cb)((j=Z,J="graphics",{type:j,cast:v.R,set(e){const t=(0,v.Z)(e,this._get(J),j);t.owner=this,this._set(J,t)}}))],M.prototype,"graphics",void 0),(0,n._)([(0,c.Cb)({type:["show","hide"]})],M.prototype,"listMode",void 0),(0,n._)([(0,c.Cb)()],M.prototype,"screenSizePerspectiveEnabled",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],M.prototype,"type",void 0),(0,n._)([(0,c.Cb)({constructOnly:!0})],M.prototype,"internal",void 0),M=(0,n._)([(0,f.j)("esri.layers.GraphicsLayer")],M);const R=M;var E=r(92908),A=r(38009),F=r(16859),P=r(1231),z=r(20256),W=r(4095),k=r(77987),D=r(78724),G=r(82971),U=r(6570);function H(e){return"markup"===e.featureCollectionType||e.layers.some((e=>null!=e.layerDefinition.visibilityField||!q(e)))}function q({layerDefinition:e,featureSet:t}){const r=e.geometryType??t.geometryType;return $.find((t=>r===t.geometryTypeJSON&&e.drawingInfo?.renderer?.symbol?.type===t.identifyingSymbol.type))}function X(){return new U.Z({xmin:-180,ymin:-90,xmax:180,ymax:90})}const K=new P.Z({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),B=new P.Z({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0});let V=class extends R{constructor(e){super(e),this.visibilityMode="inherited"}initialize(){for(const e of this.graphics)e.sourceLayer=this.layer;this.graphics.on("after-add",(e=>{e.item.sourceLayer=this.layer})),this.graphics.on("after-remove",(e=>{e.item.sourceLayer=null}))}get fullExtent(){const e=this.layer.spatialReference,t=this.fullBounds;return(0,a.Wi)(t)?(0,g.dz)(X(),e).geometry:(0,S.HH)(t,e)}get fullBounds(){const e=this.layer.spatialReference,t=(0,S.cS)();return this.graphics.forEach((r=>{const n=(0,a.pC)(r.geometry)?(0,g.dz)(r.geometry,e).geometry:null;(0,a.pC)(n)&&(0,S.jn)(t,"point"===n.type?n:n.extent,t)})),(0,S.fS)(t,S.Gv)?null:t}get sublayers(){return this.graphics}};(0,n._)([(0,c.Cb)({readOnly:!0})],V.prototype,"fullExtent",null),(0,n._)([(0,c.Cb)({readOnly:!0})],V.prototype,"fullBounds",null),(0,n._)([(0,c.Cb)({readOnly:!0})],V.prototype,"sublayers",null),(0,n._)([(0,c.Cb)()],V.prototype,"layer",void 0),(0,n._)([(0,c.Cb)()],V.prototype,"layerId",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],V.prototype,"visibilityMode",void 0),V=(0,n._)([(0,f.j)("esri.layers.MapNotesLayer.MapNotesSublayer")],V);const $=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:(new z.Z).toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:(new W.Z).toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:(new k.Z).toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:(new k.Z).toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:(new D.Z).toJSON()}];let Y=class extends((0,T.h)((0,L.M)((0,A.q)((0,F.I)((0,p.R)(O.Z)))))){constructor(e){super(e),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=G.Z.WGS84,this.sublayers=new o.Z($.map((e=>new V({id:e.id,layerId:e.layerId,title:e.title,layer:this})))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(e,t,r){return{operations:{supportsMapNotesEditing:!H(t)&&"portal-item"!==r?.origin}}}readFeatureCollections(e,t,r){if(!H(t))return null;const n=t.layers.map((e=>{const t=new w.default;return t.read(e,r),t}));return new o.Z({items:n})}readLegacyfeatureCollectionJSON(e,t){return H(t)?(0,l.d9)(t.featureCollection):null}get fullExtent(){const e=this.spatialReference,t=(0,S.cS)();return(0,a.pC)(this.sublayers)?this.sublayers.forEach((({fullBounds:e})=>(0,a.pC)(e)?(0,S.jn)(t,e,t):t),t):this.featureCollectionJSON?.layers.some((e=>e.layerDefinition.extent))&&this.featureCollectionJSON.layers.forEach((r=>{const n=(0,g.dz)(r.layerDefinition.extent,e).geometry;(0,a.pC)(n)&&(0,S.jn)(t,n,t)})),(0,S.fS)(t,S.Gv)?(0,g.dz)(X(),e).geometry:(0,S.HH)(t,e)}readMinScale(e,t){for(const e of t.layers)if(null!=e.layerDefinition.minScale)return e.layerDefinition.minScale;return 0}readMaxScale(e,t){for(const e of t.layers)if(null!=e.layerDefinition.maxScale)return e.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(e,t){return t.layers.length?G.Z.fromJSON(t.layers[0].layerDefinition.spatialReference):G.Z.WGS84}readSublayers(e,t,r){if(H(t))return null;const n=[];let s=t.layers.reduce(((e,t)=>Math.max(e,t.layerDefinition.id??-1)),-1)+1;for(const e of t.layers){const{layerDefinition:t,featureSet:r}=e,o=t.id??s++,l=q(e);if((0,a.pC)(l)){const e=new V({id:l.id,title:t.name,layerId:o,layer:this,graphics:r.features.map((({geometry:e,symbol:t,attributes:r,popupInfo:n})=>i.Z.fromJSON({attributes:r,geometry:e,symbol:t,popupTemplate:n})))});n.push(e)}}return new o.Z(n)}writeSublayers(e,t,r,n){const{minScale:i,maxScale:o}=this;if((0,a.Wi)(e))return;const l=e.some((e=>e.graphics.length>0));if(!this.capabilities.operations.supportsMapNotesEditing)return void(l&&n?.messages?.push(new s.Z("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const p=[];let y=this.spatialReference.toJSON();e:for(const t of e)for(const e of t.graphics)if((0,a.pC)(e.geometry)){y=e.geometry.spatialReference.toJSON();break e}for(const t of $){const r=e.find((e=>t.id===e.id));this._writeMapNoteSublayer(p,r,t,i,o,y,n)}(0,u.RB)("featureCollection.layers",p,t)}get textLayer(){return this._findSublayer("textLayer")}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}read(e,t){"featureCollection"in e&&(e=(0,l.d9)(e),Object.assign(e,e.featureCollection)),super.read(e,t)}async beforeSave(){if((0,a.Wi)(this.sublayers))return;let e=null;const t=[];for(const r of this.sublayers)for(const n of r.graphics)if((0,a.pC)(n.geometry)){const r=n.geometry;e?(0,b.fS)(r.spatialReference,e)||((0,g.Up)(r.spatialReference,e)||(0,g.kR)()||await(0,g.zD)(),n.geometry=(0,g.iV)(r,e)):e=r.spatialReference,t.push(n)}const r=await(0,_.aX)(t.map((e=>e.geometry)));t.forEach(((e,t)=>e.geometry=r[t]))}_findSublayer(e){return(0,a.Wi)(this.sublayers)?null:this.sublayers?.find((t=>t.id===e))??null}_writeMapNoteSublayer(e,t,r,n,i,o,s){const p=[];if(!(0,a.Wi)(t)){for(const e of t.graphics)this._writeMapNote(p,e,r.geometryType,s);this._normalizeObjectIds(p,K),e.push({layerDefinition:{name:t.title,drawingInfo:{renderer:{type:"simple",symbol:(0,l.d9)(r.identifyingSymbol)}},id:t.layerId,geometryType:r.geometryTypeJSON,minScale:n,maxScale:i,objectIdField:"OBJECTID",fields:[K.toJSON(),B.toJSON()],spatialReference:o},featureSet:{features:p,geometryType:r.geometryTypeJSON}})}}_writeMapNote(e,t,r,n){if((0,a.Wi)(t))return;const{geometry:i,symbol:o,popupTemplate:s}=t;if((0,a.Wi)(i))return;if(i.type!==r)return void n?.messages?.push(new y.Z("map-notes-layer:invalid-geometry-type",`Geometry "${i.type}" cannot be saved in "${r}" layer`,{graphic:t}));if((0,a.Wi)(o))return void n?.messages?.push(new y.Z("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:t}));const l={attributes:{...t.attributes},geometry:i.toJSON(),symbol:o.toJSON()};(0,a.pC)(s)&&(l.popupInfo=s.toJSON()),e.push(l)}_normalizeObjectIds(e,t){const r=t.name;let n=(0,E.S)(r,e)+1;const i=new Set;for(const t of e){t.attributes||(t.attributes={});const{attributes:e}=t;(null==e[r]||i.has(e[r]))&&(e[r]=n++),i.add(e[r])}}};(0,n._)([(0,c.Cb)({readOnly:!0})],Y.prototype,"capabilities",void 0),(0,n._)([(0,h.r)(["portal-item","web-map"],"capabilities",["layers"])],Y.prototype,"readCapabilities",null),(0,n._)([(0,c.Cb)({readOnly:!0})],Y.prototype,"featureCollections",void 0),(0,n._)([(0,h.r)(["web-map","portal-item"],"featureCollections",["layers"])],Y.prototype,"readFeatureCollections",null),(0,n._)([(0,c.Cb)({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],Y.prototype,"featureCollectionJSON",void 0),(0,n._)([(0,h.r)(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],Y.prototype,"readLegacyfeatureCollectionJSON",null),(0,n._)([(0,c.Cb)({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],Y.prototype,"featureCollectionType",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Y.prototype,"fullExtent",null),(0,n._)([(0,c.Cb)({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:null!=this.featureCollectionJSON}}}}}}})],Y.prototype,"legendEnabled",void 0),(0,n._)([(0,c.Cb)({type:["show","hide","hide-children"]})],Y.prototype,"listMode",void 0),(0,n._)([(0,c.Cb)({type:Number,nonNullable:!0,json:{write:!1}})],Y.prototype,"minScale",void 0),(0,n._)([(0,h.r)(["web-map","portal-item"],"minScale",["layers"])],Y.prototype,"readMinScale",null),(0,n._)([(0,c.Cb)({type:Number,nonNullable:!0,json:{write:!1}})],Y.prototype,"maxScale",void 0),(0,n._)([(0,h.r)(["web-map","portal-item"],"maxScale",["layers"])],Y.prototype,"readMaxScale",null),(0,n._)([(0,c.Cb)({readOnly:!0})],Y.prototype,"multipointLayer",null),(0,n._)([(0,c.Cb)({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],Y.prototype,"operationalLayerType",void 0),(0,n._)([(0,c.Cb)({readOnly:!0})],Y.prototype,"pointLayer",null),(0,n._)([(0,c.Cb)({readOnly:!0})],Y.prototype,"polygonLayer",null),(0,n._)([(0,c.Cb)({readOnly:!0})],Y.prototype,"polylineLayer",null),(0,n._)([(0,c.Cb)({type:G.Z})],Y.prototype,"spatialReference",void 0),(0,n._)([(0,h.r)(["web-map","portal-item"],"spatialReference",["layers"])],Y.prototype,"readSpatialReference",null),(0,n._)([(0,c.Cb)({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],Y.prototype,"sublayers",void 0),(0,n._)([(0,h.r)("web-map","sublayers",["layers"])],Y.prototype,"readSublayers",null),(0,n._)([(0,m.c)("web-map","sublayers")],Y.prototype,"writeSublayers",null),(0,n._)([(0,c.Cb)({readOnly:!0})],Y.prototype,"textLayer",null),(0,n._)([(0,c.Cb)()],Y.prototype,"title",void 0),(0,n._)([(0,c.Cb)({readOnly:!0,json:{read:!1}})],Y.prototype,"type",void 0),Y=(0,n._)([(0,f.j)("esri.layers.MapNotesLayer")],Y);const Q=Y},92908:(e,t,r)=>{r.d(t,{S:()=>i,X:()=>n});const n=1;function i(e,t){let r=0;for(const n of t){const t=n.attributes?.[e];"number"==typeof t&&isFinite(t)&&(r=Math.max(r,t))}return r}},54295:(e,t,r)=>{r.d(t,{V:()=>s});var n=r(43697),i=r(5600),o=(r(67676),r(75215),r(52011));const s=e=>{let t=class extends e{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,n._)([(0,i.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,n._)([(0,o.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,r)=>{r.d(t,{Y:()=>p});var n=r(43697),i=r(92604),o=r(70586),s=r(5600),l=(r(67676),r(75215),r(52011)),a=r(66677);const p=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((0,o.pC)(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,i.Z.getLogger(this.declaredClass)))}};return(0,n._)([(0,s.Cb)()],t.prototype,"title",null),(0,n._)([(0,s.Cb)({type:String})],t.prototype,"url",null),t=(0,n._)([(0,l.j)("esri.layers.mixins.ArcGISService")],t),t}},70082:(e,t,r)=>{r.d(t,{Z:()=>y});var n=r(43697),i=r(2368),o=r(35454),s=r(96674),l=r(5600),a=(r(67676),r(75215),r(52011));const p=new o.X({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let u=class extends((0,i.J)(s.wq)){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};(0,n._)([(0,l.Cb)({json:{write:!0}})],u.prototype,"name",void 0),(0,n._)([(0,l.Cb)({json:{write:!0}})],u.prototype,"description",void 0),(0,n._)([(0,l.Cb)({json:{read:p.read,write:p.write}})],u.prototype,"drawingTool",void 0),(0,n._)([(0,l.Cb)({json:{write:!0}})],u.prototype,"prototype",void 0),(0,n._)([(0,l.Cb)({json:{write:!0}})],u.prototype,"thumbnail",void 0),u=(0,n._)([(0,a.j)("esri.layers.support.FeatureTemplate")],u);const y=u},16451:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r(43697),i=r(2368),o=r(96674),s=r(5600),l=(r(67676),r(75215),r(71715)),a=r(52011),p=r(30556),u=r(72729),y=r(70082);let c=class extends((0,i.J)(o.wq)){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const r of Object.keys(e))t[r]=(0,u.im)(e[r]);return t}writeDomains(e,t){const r={};for(const t of Object.keys(e))e[t]&&(r[t]=e[t]?.toJSON());t.domains=r}};(0,n._)([(0,s.Cb)({json:{write:!0}})],c.prototype,"id",void 0),(0,n._)([(0,s.Cb)({json:{write:!0}})],c.prototype,"name",void 0),(0,n._)([(0,s.Cb)({json:{write:!0}})],c.prototype,"domains",void 0),(0,n._)([(0,l.r)("domains")],c.prototype,"readDomains",null),(0,n._)([(0,p.c)("domains")],c.prototype,"writeDomains",null),(0,n._)([(0,s.Cb)({type:[y.Z],json:{write:!0}})],c.prototype,"templates",void 0),c=(0,n._)([(0,a.j)("esri.layers.support.FeatureType")],c);const d=c},56765:(e,t,r)=>{r.d(t,{Z:()=>u});var n,i=r(43697),o=r(46791),s=r(96674),l=r(5600),a=(r(67676),r(75215),r(52011));let p=n=class extends s.wq{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new o.Z}clone(){return new n({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};(0,i._)([(0,l.Cb)({type:String,json:{write:!0}})],p.prototype,"floorField",void 0),(0,i._)([(0,l.Cb)({json:{read:!1,write:!1}})],p.prototype,"viewAllMode",void 0),(0,i._)([(0,l.Cb)({json:{read:!1,write:!1}})],p.prototype,"viewAllLevelIds",void 0),p=n=(0,i._)([(0,a.j)("esri.layers.support.LayerFloorInfo")],p);const u=p},51706:(e,t,r)=>{var n,i;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function s(e){return null!=e&&!isNaN(e)&&isFinite(e)}function l(e){return e.valueExpression?n.Expression:e.field&&"string"==typeof e.field?n.Field:n.Unknown}function a(e,t){const r=t||l(e),o=e.valueUnit||"unknown";return r===n.Unknown?i.Constant:e.stops?i.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?i.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?i.Proportional:i.Additive:i.Identity:i.RealWorldSize}r.d(t,{PS:()=>l,QW:()=>a,RY:()=>n,hL:()=>i,iY:()=>o,qh:()=>s}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(n||(n={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(i||(i={}))},28694:(e,t,r)=>{r.d(t,{p:()=>o});var n=r(70586),i=r(69285);function o(e,t,r){if(!r||!r.features||!r.hasZ)return;const o=(0,i.k)(r.geometryType,t,e.outSpatialReference);if(!(0,n.Wi)(o))for(const e of r.features)o(e.geometry)}},58333:(e,t,r)=>{r.d(t,{ET:()=>o,I4:()=>i,eG:()=>a,lF:()=>s,lj:()=>u,qP:()=>l,wW:()=>p});const n=[252,146,31,255],i={type:"esriSMS",style:"esriSMSCircle",size:6,color:n,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:n},s={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},l={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},a={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},p={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},u={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7541],{82526:(e,t,a)=>{a.d(t,{aX:()=>S});var r=a(68773),s=a(20102),n=a(92604),i=a(70586),o=a(38913),l=a(58901),u=a(82971),d=a(33955);const p={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new l.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:u.Z.WebMercator}),minus180Line:new l.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:u.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new l.Z({paths:[[[180,-180],[180,180]]],spatialReference:u.Z.WGS84}),minus180Line:new l.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:u.Z.WGS84})}};function c(e,t){return Math.ceil((e-t)/(2*t))}function f(e,t){const a=h(e);for(const e of a)for(const a of e)a[0]+=t;return e}function h(e){return(0,d.oU)(e)?e.rings:e.paths}var y=a(8744),m=a(40488),g=(a(66577),a(3172)),b=a(17452);function w(e){return{geometryType:(0,d.Ji)(e[0]),geometries:e.map((e=>e.toJSON()))}}const F=n.Z.getLogger("esri.geometry.support.normalizeUtils");function A(e){return"polygon"===e[0].type}function Z(e){return"polyline"===e[0].type}function R(e,t,a){if(t){const t=function(e,t){if(!(e instanceof l.Z||e instanceof o.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw F.error(e),new s.Z(e)}const a=h(e),r=[];for(const e of a){const a=[];r.push(a),a.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const s=e[r][0],n=e[r][1],i=e[r+1][0],o=e[r+1][1],l=Math.sqrt((i-s)*(i-s)+(o-n)*(o-n)),u=(o-n)/l,d=(i-s)/l,p=l/t;if(p>1){for(let e=1;e<=p-1;e++){const r=e*t,i=d*r+s,o=u*r+n;a.push([i,o])}const e=(l+Math.floor(p-1)*t)/2,r=d*e+s,i=u*e+n;a.push([r,i])}a.push([i,o])}}return function(e){return"polygon"===e.type}(e)?new o.Z({rings:r,spatialReference:e.spatialReference}):new l.Z({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,m.Sx)(t,!0)}return a&&(e=f(e,a)),e}function I(e,t,a){if(Array.isArray(e)){const r=e[0];if(r>t){const a=c(r,t);e[0]=r+a*(-2*t)}else if(r<a){const t=c(r,a);e[0]=r+t*(-2*a)}}else{const r=e.x;if(r>t){const a=c(r,t);e=e.clone().offset(a*(-2*t),0)}else if(r<a){const t=c(r,a);e=e.clone().offset(t*(-2*a),0)}}return e}function v(e,t){let a=-1;for(let r=0;r<t.cutIndexes.length;r++){const s=t.cutIndexes[r],n=t.geometries[r],i=h(n);for(let e=0;e<i.length;e++){const t=i[e];t.some((a=>{if(a[0]<180)return!0;{let a=0;for(let e=0;e<t.length;e++){const r=t[e][0];a=r>a?r:a}a=Number(a.toFixed(9));const r=-360*c(a,180);for(let a=0;a<t.length;a++){const t=n.getPoint(e,a);n.setPoint(e,a,t.clone().offset(r,0))}return!0}}))}if(s===a){if(A(e))for(const t of h(n))e[s]=e[s].addRing(t);else if(Z(e))for(const t of h(n))e[s]=e[s].addPath(t)}else a=s,e[s]=n}return e}async function S(e,t,a){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&F.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??r.Z.geometryServiceUrl;let n,u,h,A,Z,E,$,x,O=0;const L=[],C=[];for(const t of e)if((0,i.Wi)(t))C.push(t);else if(n||(n=t.spatialReference,u=(0,y.C5)(n),h=n.isWebMercator,E=h?102100:4326,A=p[E].maxX,Z=p[E].minX,$=p[E].plus180Line,x=p[E].minus180Line),u)if("mesh"===t.type)C.push(t);else if("point"===t.type)C.push(I(t.clone(),A,Z));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>I(e,A,Z))),C.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,u);C.push(e.rings?new o.Z(e):e)}else if(t.extent){const e=t.extent,a=c(e.xmin,Z)*(2*A);let r=0===a?t.clone():f(t.clone(),a);e.offset(a,0),e.intersects($)&&e.xmax!==A?(O=e.xmax>O?e.xmax:O,r=R(r,h),L.push(r),C.push("cut")):e.intersects(x)&&e.xmin!==Z?(O=e.xmax*(2*A)>O?e.xmax*(2*A):O,r=R(r,h,360),L.push(r),C.push("cut")):C.push(r)}else C.push(t.clone());else C.push(t);let T=c(O,A),U=-90;const k=T,N=new l.Z;for(;T>0;){const e=360*T-180;N.addPath([[e,U],[e,-1*U]]),U*=-1,T--}if(L.length>0&&k>0){const t=v(L,await async function(e,t,a,r){const s="string"==typeof e?(0,b.mN)(e):e,n=t[0].spatialReference,i={...r,query:{...s.query,f:"json",sr:JSON.stringify(n),target:JSON.stringify({geometryType:(0,d.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(a)}},o=await(0,g.default)(s.path+"/cut",i),{cutIndexes:l,geometries:u=[]}=o.data;return{cutIndexes:l,geometries:u.map((e=>{const t=(0,d.im)(e);return t.spatialReference=n,t}))}}(s,L,N,a)),r=[],n=[];for(let a=0;a<C.length;a++){const s=C[a];if("cut"!==s)n.push(s);else{const s=t.shift(),o=e[a];(0,i.pC)(o)&&"polygon"===o.type&&o.rings&&o.rings.length>1&&s.rings.length>=o.rings.length?(r.push(s),n.push("simplify")):n.push(h?(0,m.$)(s):s)}}if(!r.length)return n;const o=await async function(e,t,a){const r="string"==typeof e?(0,b.mN)(e):e,s=t[0].spatialReference,n=(0,d.Ji)(t[0]),i={...a,query:{...r.query,f:"json",sr:s.wkid?s.wkid:JSON.stringify(s),geometries:JSON.stringify(w(t))}};return function(e,t,a){const r=(0,d.q9)(t);return e.map((e=>{const t=r.fromJSON(e);return t.spatialReference=a,t}))}((await(0,g.default)(r.path+"/simplify",i)).data,n,s)}(s,r,a),l=[];for(let e=0;e<n.length;e++){const t=n[e];"simplify"!==t?l.push(t):l.push(h?(0,m.$)(o.shift()):o.shift())}return l}const G=[];for(let e=0;e<C.length;e++){const t=C[e];if("cut"!==t)G.push(t);else{const e=L.shift();G.push(!0===h?(0,m.$)(e):e)}}return G}},87269:(e,t,a)=>{a.r(t),a.d(t,{AssetMapEditFlags:()=>s,applyEdits:()=>y});var r,s,n,i=a(38171),o=a(46791),l=a(20102),u=a(22974),d=a(70586),p=a(17452),c=a(41123),f=a(82526),h=a(66361);async function y(e,t,a,s={}){let n,i;const p={edits:a,result:new Promise(((e,t)=>{n=e,i=t}))};e.emit("apply-edits",p);try{const{results:i,edits:p}=await async function(e,t,a,s){if(await e.load(),!function(e){return e&&null!=e.applyEdits}(t))throw new l.Z(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!e.editingEnabled)throw new l.Z(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:n,options:i}=await async function(e,t,a){const s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),i=(0,d.pC)(e.infoFor3D);if(!t||!s&&!n)throw new l.Z(`${e.type}-layer:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!e.capabilities.data.isVersioned&&a&&a.gdbVersion)throw new l.Z(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!e.capabilities.editing.supportsRollbackOnFailure&&a&&a.rollbackOnFailureEnabled)throw new l.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");if(!e.capabilities.editing.supportsGlobalId&&a&&a.globalIdUsed)throw new l.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!e.capabilities.editing.supportsGlobalId&&n)throw new l.Z(`${e.type}-layer:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if((!a||!a.globalIdUsed)&&n)throw new l.Z(`${e.type}-layer:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true");const u={...a};if(null!=u.rollbackOnFailureEnabled||e.capabilities.editing.supportsRollbackOnFailure||(u.rollbackOnFailureEnabled=!0),!1===u.rollbackOnFailureEnabled&&"original-and-current-features"===u.returnServiceEditsOption)throw new l.Z(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true.");if(!e.capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference&&u.returnServiceEditsInSourceSR)throw new l.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(u.returnServiceEditsInSourceSR&&"original-and-current-features"!==u.returnServiceEditsOption)throw new l.Z(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsOption' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const p={...t};if(p.addFeatures=t&&o.Z.isCollection(t.addFeatures)?t.addFeatures.toArray():p.addFeatures||[],p.updateFeatures=t&&o.Z.isCollection(t.updateFeatures)?t.updateFeatures.toArray():p.updateFeatures||[],p.deleteFeatures=t&&o.Z.isCollection(t.deleteFeatures)?t.deleteFeatures.toArray():p.deleteFeatures||[],p.addFeatures.length&&!e.capabilities.operations.supportsAdd)throw new l.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support adding features.");if(p.updateFeatures.length&&!e.capabilities.operations.supportsUpdate)throw new l.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support updating features.");if(p.deleteFeatures.length&&!e.capabilities.operations.supportsDelete)throw new l.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support deleting features.");p.addAttachments=p.addAttachments||[],p.updateAttachments=p.updateAttachments||[],p.deleteAttachments=p.deleteAttachments||[],p.addFeatures=p.addFeatures.map(w),p.updateFeatures=p.updateFeatures.map(w),p.addAssets=[];const c=a&&a.globalIdUsed||i;return p.addFeatures.forEach((t=>function(e,t,a){m(e,t,a)}(t,e,c))),p.updateFeatures.forEach((t=>function(e,t,a){if(m(e,t,a),"geometry"in e&&(0,d.pC)(e.geometry)&&!t.capabilities.editing.supportsGeometryUpdate)throw new l.Z(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}(t,e,c))),p.deleteFeatures.forEach((t=>function(e,t,a){m(e,t,a)}(t,e,c))),p.addAttachments.forEach((t=>g(t,e))),p.updateAttachments.forEach((t=>g(t,e))),i&&await async function(e,t){if((0,d.Wi)(t.infoFor3D))return;const{infoFor3D:a}=t;let s=!1;for(const{id:e}of a.editFormats)if(e===r.GLTF_BINARY){s=!0;break}const n=[];for(const a of e.addFeatures)n.push(F(a,e,t,s));for(const a of e.updateFeatures)n.push(F(a,e,t,s));const i=await Promise.allSettled(n);for(const e of i)if("rejected"===e.status)throw e.reason}(p,e),{edits:await b(p),options:u}}(e,a,s);return n.addFeatures.length||n.updateFeatures.length||n.deleteFeatures.length||n.addAttachments.length||n.updateAttachments.length||n.deleteAttachments.length?{edits:n,results:await t.applyEdits(n,i)}:{edits:n,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}(e,t,a,s),c=e=>e.filter((e=>!e.error)).map(u.d9),f={edits:p,addedFeatures:c(i.addFeatureResults),updatedFeatures:c(i.updateFeatureResults),deletedFeatures:c(i.deleteFeatureResults),addedAttachments:c(i.addAttachmentResults),updatedAttachments:c(i.updateAttachmentResults),deletedAttachments:c(i.deleteAttachmentResults)};return i.editedFeatureResults?.length&&(f.editedFeatures=i.editedFeatureResults),(f.addedFeatures.length||f.updatedFeatures.length||f.deletedFeatures.length||f.addedAttachments.length||f.updatedAttachments.length||f.deletedAttachments.length)&&(e.emit("edits",f),(0,h.lQ)(e)&&h.dU.emit("edits",{layer:e,event:f})),n(f),i}catch(e){throw i(e),e}}function m(e,t,a){if(a){if("attributes"in e&&!e.attributes[t.globalIdField])throw new l.Z(`${t.type}-layer:invalid-parameter`,"Feature should have 'globalId' when 'globalIdUsed' is true");if(!("attributes"in e)&&!e.globalId)throw new l.Z(`${t.type}-layer:invalid-parameter`,"'globalId' of the feature should be passed when 'globalIdUsed' is true")}if("geometry"in e&&(0,d.pC)(e.geometry)){if(e.geometry.hasZ&&!1===t.capabilities.data.supportsZ)throw new l.Z(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities.data.supportsM)throw new l.Z(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function g(e,t){const{feature:a,attachment:r}=e;if(!a||"attributes"in a&&!a.attributes[t.globalIdField])throw new l.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in a)&&!a.globalId)throw new l.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new l.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new l.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name||r.name))throw new l.Z(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities.editing.supportsUploadWithItemId&&r.uploadId)throw new l.Z(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof r.data){const e=(0,p.sJ)(r.data);if(e&&!e.isBase64)throw new l.Z(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function b(e){const t=e.addFeatures,a=e.updateFeatures,r=t.concat(a).map((e=>e.geometry)),s=await(0,f.aX)(r),n=t.length,i=a.length;return s.slice(0,n).forEach(((t,a)=>e.addFeatures[a].geometry=t)),s.slice(n,n+i).forEach(((t,a)=>e.updateFeatures[a].geometry=t)),e}function w(e){const t=new i.Z;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function F(e,t,a,s){if((0,d.Wi)(e.geometry)||"mesh"!==e.geometry.type)return;const n=e.geometry,i=a.globalIdField;if((0,d.pC)(a.parsedUrl)&&(0,d.pC)(n.external)&&"string"==typeof n.external.source&&n.external.source.startsWith(a.parsedUrl.path))return;if(!s)throw new l.Z(`${a.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");const o=await n.toBinaryGLTF(),u=await o.buffer(),p=`{${(0,c.D)()}}`,f=`${p}.glb`;t.addAssets.push({featureGlobalId:e.getAttribute(i),assetMapGlobalId:p,assetName:f,flags:0,data:u.data,mimeType:u.type,assetType:r.GLTF_BINARY,feature:e})}!function(e){e.GLTF_BINARY="3D_glb",e.GLTF_JSON="3D_gltf"}(r||(r={})),(n=s||(s={}))[n.PROJECT_VERTICES=1]="PROJECT_VERTICES"}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8850,5732],{5732:(e,t,i)=>{i.d(t,{a:()=>r,c:()=>s,g:()=>n});var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}},69801:(e,t,i)=>{i.d(t,{WJ:()=>l,Xq:()=>a});var s,n,r=i(70586),o=i(44553);(n=s||(s={}))[n.ALL=0]="ALL",n[n.SOME=1]="SOME";class a{constructor(e,t,i){this._namespace=e,this._storage=t,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),this._namespace+=":",i&&(this._storage.registerRemoveFunc(this._namespace,i),this._removeFunc=!0)}destroy(){this._storage.clear(this._namespace),this._removeFunc&&this._storage.deregisterRemoveFunc(this._namespace),this._storage.deregister(this),this._storage=null}get namespace(){return this._namespace.slice(0,-1)}get hitRate(){return this._hit/(this._hit+this._miss)}get size(){return this._storage.size}get maxSize(){return this._storage.maxSize}resetHitRate(){this._hit=this._miss=0}put(e,t,i,s=0){this._storage.put(this._namespace+e,t,i,s)}get(e){const t=this._storage.get(this._namespace+e);return void 0===t?++this._miss:++this._hit,t}pop(e){const t=this._storage.pop(this._namespace+e);return void 0===t?++this._miss:++this._hit,t}updateSize(e,t,i){this._storage.updateSize(this._namespace+e,t,i)}clear(){this._storage.clear(this._namespace)}clearAll(){this._storage.clearAll()}getStats(){return this._storage.getStats()}resetStats(){this._storage.resetStats()}}class l{constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new o.Z,this._users=new o.Z}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,t){this._removeFuncs.push([e,t])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace((t=>t[0]!==e))}get size(){return this._size}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimit()}put(e,t,i,n){const r=this._db.get(e);if(r&&(this._size-=r.size,this._db.delete(e),r.entry!==t&&this._notifyRemove(e,r.entry,s.ALL)),i>this._maxSize)return void this._notifyRemove(e,t,s.ALL);if(void 0===t)return void console.warn("Refusing to cache undefined entry ");if(!i||i<0)return void console.warn("Refusing to cache entry with invalid size "+i);const o=1+Math.max(n,-3)- -3;this._db.set(e,{entry:t,size:i,lifetime:o,lives:o}),this._size+=i,this._checkSizeLimit()}updateSize(e,t,i){const n=this._db.get(e);if(n&&n.entry===t){for(this._size-=n.size;i>this._maxSize;){const n=this._notifyRemove(e,t,s.SOME);if(!((0,r.pC)(n)&&n>0))return void this._db.delete(e);i=n}n.size=i,this._size+=i,this._checkSizeLimit()}}pop(e){const t=this._db.get(e);if(t)return this._size-=t.size,this._db.delete(e),++this._hit,t.entry;++this._miss}get(e){const t=this._db.get(e);if(void 0!==t)return this._db.delete(e),t.lives=t.lifetime,this._db.set(e,t),++this._hit,t.entry;++this._miss}getStats(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=new Array;this._db.forEach(((e,s)=>{const n=e.lifetime;i[n]=(i[n]||0)+e.size,this._users.forAll((i=>{const n=i.namespace;if(s.startsWith(n)){const i=t[n]||0;t[n]=i+e.size}}))}));const s={};this._users.forAll((e=>{const i=e.namespace;if(!isNaN(e.hitRate)&&e.hitRate>0){const n=t[i]||0;t[i]=n,s[i]=Math.round(100*e.hitRate)+"%"}else s[i]="0%"}));const n=Object.keys(t);n.sort(((e,i)=>t[i]-t[e])),n.forEach((i=>e[i]=Math.round(t[i]/2**20)+"MB / "+s[i]));for(let t=i.length-1;t>=0;--t){const s=i[t];s&&(e["Priority "+(t+-3-1)]=Math.round(s/this.size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll((e=>e.resetHitRate()))}clear(e){this._db.forEach(((t,i)=>{i.startsWith(e)&&(this._size-=t.size,this._db.delete(i),this._notifyRemove(i,t.entry,s.ALL))}))}clearAll(){this._db.forEach(((e,t)=>this._notifyRemove(t,e.entry,s.ALL))),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i){let s;return this._removeFuncs.some((n=>{if(e.startsWith(n[0])){const e=n[1](t,i);return"number"==typeof e&&(s=e),!0}return!1})),s}_checkSizeLimit(){if(!(this._size<=this._maxSize))for(const[e,t]of this._db){if(this._db.delete(e),t.lives<=1){this._size-=t.size;const i=this._notifyRemove(e,t.entry,s.SOME);(0,r.pC)(i)&&i>0&&(this._size+=i,t.lives=t.lifetime,t.size=i,this._db.set(e,t))}else--t.lives,this._db.set(e,t);if(this._size<=.9*this.maxSize)return}}}},66643:(e,t,i)=>{i.d(t,{Ed:()=>u,UI:()=>c,mt:()=>p,q6:()=>f,vr:()=>m});var s=i(43697),n=i(15923),r=i(70586),o=i(95330),a=i(5600),l=(i(67676),i(75215),i(52011));function u(e,t,i){return(0,o.as)(e.map(((e,s)=>t.apply(i,[e,s]))))}async function c(e,t,i){return(await(0,o.as)(e.map(((e,s)=>t.apply(i,[e,s]))))).map((e=>e.value))}function d(e){return{ok:!0,value:e}}function h(e){return{ok:!1,error:e}}async function f(e){if((0,r.Wi)(e))return{ok:!1,error:new Error("no promise provided")};try{return d(await e)}catch(e){return h(e)}}async function p(e){try{return d(await e)}catch(e){return(0,o.r9)(e),h(e)}}function m(e,t){return new g(e,t)}let g=class extends n.Z{constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,r.IM)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then((e=>{this._result=d(e),this._cleanup()}),(e=>{this._result=h(e),this._cleanup()})),this._abortHandle=(0,o.fu)(t,this.abort)}get value(){return e=this._result,(0,r.pC)(e)&&!0===e.ok?e.value:null;var e}get error(){return e=this._result,(0,r.pC)(e)&&!1===e.ok?e.error:null;var e}get finished(){return(0,r.pC)(this._result)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,r.hw)(this._abortHandle),this._abortController=null}};(0,s._)([(0,a.Cb)()],g.prototype,"value",null),(0,s._)([(0,a.Cb)()],g.prototype,"error",null),(0,s._)([(0,a.Cb)()],g.prototype,"finished",null),(0,s._)([(0,a.Cb)()],g.prototype,"promise",void 0),(0,s._)([(0,a.Cb)()],g.prototype,"_result",void 0),g=(0,s._)([(0,l.j)("esri.core.asyncUtils.ReactiveTask")],g)},14808:(e,t,i)=>{i.d(t,{Qc:()=>c,WU:()=>a,lt:()=>u});var s=i(19153),n=i(70171);const r={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function o(e){e||(e=(0,n.Kd)());let t=e in r;if(!t){const i=e.split("-");i.length>1&&i[0]in r&&(e=i[0],t=!0),t||(e="en")}const[i,s,o="#,##0.###"]=r[e];return{decimal:i,group:s,pattern:o}}function a(e,t){const i=o((t={...t}).locale);t.customs=i;const s=t.pattern||i.pattern;return isNaN(e)||Math.abs(e)===1/0?null:function(e,t,i){const s=(i=i||{}).customs.group,n=i.customs.decimal,r=t.split(";"),o=r[0];if((t=r[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const a=l,u=o.match(a);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return!1===i.fractional&&(i.places=0),t.replace(a,function(e,t,i){!0===(i=i||{}).places&&(i.places=0),i.places===1/0&&(i.places=6);const s=t.split("."),n="string"==typeof i.places&&i.places.indexOf(",");let r=i.places;n?r=i.places.substring(n+1):r>=0||(r=(s[1]||[]).length),i.round<0||(e=Number(e.toFixed(Number(r))));const o=String(Math.abs(e)).split("."),a=o[1]||"";if(s[1]||i.places){n&&(i.places=i.places.substring(0,n));const e=void 0!==i.places?i.places:s[1]&&s[1].lastIndexOf("0")+1;e>a.length&&(o[1]=a.padEnd(Number(e),"0")),r<a.length&&(o[1]=a.substr(0,Number(r)))}else o[1]&&o.pop();const l=s[0].replace(",","");let u=l.indexOf("0");-1!==u&&(u=l.length-u,u>o[0].length&&(o[0]=o[0].padStart(u,"0")),l.includes("#")||(o[0]=o[0].substr(o[0].length-u)));let c,d,h=s[0].lastIndexOf(",");if(-1!==h){c=s[0].length-h-1;const e=s[0].substr(0,h);h=e.lastIndexOf(","),-1!==h&&(d=e.length-h-1)}const f=[];for(let e=o[0];e;){const t=e.length-c;f.push(t>0?e.substr(t):e),e=t>0?e.slice(0,t):"",d&&(c=d,d=void 0)}return o[0]=f.reverse().join(i.group||","),o.join(i.decimal||".")}(e,u[0],{decimal:n,group:s,places:i.places,round:i.round}))}(e,s,t)}const l=/[#0,]*[#0](?:\.0*#*)?/;function u(e){const t=o((e=e||{}).locale),i=e.pattern||t.pattern,n=t.group,r=t.decimal;let a=1;if(i.includes("%"))a/=100;else if(i.includes("‰"))a/=1e3;else if(i.includes("¤"))throw new Error("currency notation not supported");const u=i.split(";");1===u.length&&u.push("-"+u[0]);const c=h(u,(t=>(t="(?:"+(0,s.Qs)(t,".")+")").replace(l,(t=>{const i={signed:!1,separator:e.strict?n:[n,""],fractional:e.fractional,decimal:r,exponent:!1},s=t.split(".");let o=e.places;1===s.length&&1!==a&&(s[1]="###"),1===s.length||0===o?i.fractional=!1:(void 0===o&&(o=e.pattern?s[1].lastIndexOf("0")+1:1/0),o&&null==e.fractional&&(i.fractional=!0),!e.places&&o<s[1].length&&(o+=","+s[1].length),i.places=o);const l=s[0].split(",");return l.length>1&&(i.groupSize=l.pop().length,l.length>1&&(i.groupSize2=l.pop().length)),"("+function(e){"places"in(e=e||{})||(e.places=1/0),"string"!=typeof e.decimal&&(e.decimal="."),"fractional"in e&&!/^0/.test(String(e.places))||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=d(e),i=h(e.fractional,(t=>{let i="";return t&&0!==e.places&&(i="\\"+e.decimal,e.places===1/0?i="(?:"+i+"\\d+)?":i+="\\d{"+e.places+"}"),i}),!0);let s=t+i;return i&&(s="(?:(?:"+s+")|(?:"+i+"))"),s+h(e.exponent,(t=>t?"([eE]"+d({signed:e.eSigned})+")":""))}(i)+")"}))),!0);return{regexp:c.replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:n,decimal:r,factor:a}}function c(e,t){const i=u(t),s=new RegExp("^"+i.regexp+"$").exec(e);if(!s)return NaN;let n=s[1];if(!s[1]){if(!s[2])return NaN;n=s[2],i.factor*=-1}return n=n.replace(new RegExp("["+i.group+"\\s\\xa0]","g"),"").replace(i.decimal,"."),Number(n)*i.factor}function d(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",h(e.signed,(e=>e?"[-+]":""),!0)+h(e.separator,(t=>{if(!t)return"(?:\\d+)";" "===(t=(0,s.Qs)(t))?t="\\s":" "===t&&(t="\\s\\xa0");const i=e.groupSize,n=e.groupSize2;if(n){const e="(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*["+t+"]\\d{"+i+"})";return i-n>0?"(?:"+e+"|(?:0|[1-9]\\d{0,"+(i-1)+"}))":e}return"(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+t+"]\\d{"+i+"})*)"}),!0)}const h=(e,t,i)=>{if(!(e instanceof Array))return t(e);const s=[];for(let i=0;i<e.length;i++)s.push(t(e[i]));return f(s.join("|"),Boolean(i))},f=(e,t)=>"("+(t?"?:":"")+e+")"},60437:(e,t,i)=>{i.d(t,{Gv:()=>_,HH:()=>a,JR:()=>m,TC:()=>l,Tn:()=>h,Ue:()=>r,al:()=>o,cS:()=>p,dp:()=>c,fS:()=>y,op:()=>d,pp:()=>u,t8:()=>f});var s=i(70586),n=i(6570);function r(e=b){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t,i,s,n,o,a=r()){return a[0]=e,a[1]=t,a[2]=i,a[3]=s,a[4]=n,a[5]=o,a}function a(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new n.Z(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function u(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function c(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function d(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function h(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function f(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function p(e){return e?f(e,_):r(_)}function m(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function g(e){return 6===e.length}function y(e,t,i){if((0,s.Wi)(e)||(0,s.Wi)(t))return e===t;if(!g(e)||!g(t))return!1;if(i){for(let s=0;s<e.length;s++)if(!i(e[s],t[s]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}i(24470);const _=[1/0,1/0,1/0,-1/0,-1/0,-1/0],b=[0,0,0,0,0,0];r()},82526:(e,t,i)=>{i.d(t,{aX:()=>N});var s=i(68773),n=i(20102),r=i(92604),o=i(70586),a=i(38913),l=i(58901),u=i(82971),c=i(33955);const d={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new l.Z({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:u.Z.WebMercator}),minus180Line:new l.Z({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:u.Z.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new l.Z({paths:[[[180,-180],[180,180]]],spatialReference:u.Z.WGS84}),minus180Line:new l.Z({paths:[[[-180,-180],[-180,180]]],spatialReference:u.Z.WGS84})}};function h(e,t){return Math.ceil((e-t)/(2*t))}function f(e,t){const i=p(e);for(const e of i)for(const i of e)i[0]+=t;return e}function p(e){return(0,c.oU)(e)?e.rings:e.paths}var m=i(8744),g=i(40488),y=(i(66577),i(3172)),_=i(17452);function b(e){return{geometryType:(0,c.Ji)(e[0]),geometries:e.map((e=>e.toJSON()))}}const x=r.Z.getLogger("esri.geometry.support.normalizeUtils");function S(e){return"polygon"===e[0].type}function I(e){return"polyline"===e[0].type}function v(e,t,i){if(t){const t=function(e,t){if(!(e instanceof l.Z||e instanceof a.Z)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x.error(e),new n.Z(e)}const i=p(e),s=[];for(const e of i){const i=[];s.push(i),i.push([e[0][0],e[0][1]]);for(let s=0;s<e.length-1;s++){const n=e[s][0],r=e[s][1],o=e[s+1][0],a=e[s+1][1],l=Math.sqrt((o-n)*(o-n)+(a-r)*(a-r)),u=(a-r)/l,c=(o-n)/l,d=l/t;if(d>1){for(let e=1;e<=d-1;e++){const s=e*t,o=c*s+n,a=u*s+r;i.push([o,a])}const e=(l+Math.floor(d-1)*t)/2,s=c*e+n,o=u*e+r;i.push([s,o])}i.push([o,a])}}return function(e){return"polygon"===e.type}(e)?new a.Z({rings:s,spatialReference:e.spatialReference}):new l.Z({paths:s,spatialReference:e.spatialReference})}(e,1e6);e=(0,g.Sx)(t,!0)}return i&&(e=f(e,i)),e}function w(e,t,i){if(Array.isArray(e)){const s=e[0];if(s>t){const i=h(s,t);e[0]=s+i*(-2*t)}else if(s<i){const t=h(s,i);e[0]=s+t*(-2*i)}}else{const s=e.x;if(s>t){const i=h(s,t);e=e.clone().offset(i*(-2*t),0)}else if(s<i){const t=h(s,i);e=e.clone().offset(t*(-2*i),0)}}return e}function F(e,t){let i=-1;for(let s=0;s<t.cutIndexes.length;s++){const n=t.cutIndexes[s],r=t.geometries[s],o=p(r);for(let e=0;e<o.length;e++){const t=o[e];t.some((i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const s=t[e][0];i=s>i?s:i}i=Number(i.toFixed(9));const s=-360*h(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(s,0))}return!0}}))}if(n===i){if(S(e))for(const t of p(r))e[n]=e[n].addRing(t);else if(I(e))for(const t of p(r))e[n]=e[n].addPath(t)}else i=n,e[n]=r}return e}async function N(e,t,i){if(!Array.isArray(e))return N([e],t);t&&"string"!=typeof t&&x.warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??s.Z.geometryServiceUrl;let r,u,p,S,I,E,T,z,C=0;const M=[],B=[];for(const t of e)if((0,o.Wi)(t))B.push(t);else if(r||(r=t.spatialReference,u=(0,m.C5)(r),p=r.isWebMercator,E=p?102100:4326,S=d[E].maxX,I=d[E].minX,T=d[E].plus180Line,z=d[E].minus180Line),u)if("mesh"===t.type)B.push(t);else if("point"===t.type)B.push(w(t.clone(),S,I));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map((e=>w(e,S,I))),B.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,u);B.push(e.rings?new a.Z(e):e)}else if(t.extent){const e=t.extent,i=h(e.xmin,I)*(2*S);let s=0===i?t.clone():f(t.clone(),i);e.offset(i,0),e.intersects(T)&&e.xmax!==S?(C=e.xmax>C?e.xmax:C,s=v(s,p),M.push(s),B.push("cut")):e.intersects(z)&&e.xmin!==I?(C=e.xmax*(2*S)>C?e.xmax*(2*S):C,s=v(s,p,360),M.push(s),B.push("cut")):B.push(s)}else B.push(t.clone());else B.push(t);let R=h(C,S),Z=-90;const q=R,O=new l.Z;for(;R>0;){const e=360*R-180;O.addPath([[e,Z],[e,-1*Z]]),Z*=-1,R--}if(M.length>0&&q>0){const t=F(M,await async function(e,t,i,s){const n="string"==typeof e?(0,_.mN)(e):e,r=t[0].spatialReference,o={...s,query:{...n.query,f:"json",sr:JSON.stringify(r),target:JSON.stringify({geometryType:(0,c.Ji)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},a=await(0,y.default)(n.path+"/cut",o),{cutIndexes:l,geometries:u=[]}=a.data;return{cutIndexes:l,geometries:u.map((e=>{const t=(0,c.im)(e);return t.spatialReference=r,t}))}}(n,M,O,i)),s=[],r=[];for(let i=0;i<B.length;i++){const n=B[i];if("cut"!==n)r.push(n);else{const n=t.shift(),a=e[i];(0,o.pC)(a)&&"polygon"===a.type&&a.rings&&a.rings.length>1&&n.rings.length>=a.rings.length?(s.push(n),r.push("simplify")):r.push(p?(0,g.$)(n):n)}}if(!s.length)return r;const a=await async function(e,t,i){const s="string"==typeof e?(0,_.mN)(e):e,n=t[0].spatialReference,r=(0,c.Ji)(t[0]),o={...i,query:{...s.query,f:"json",sr:n.wkid?n.wkid:JSON.stringify(n),geometries:JSON.stringify(b(t))}};return function(e,t,i){const s=(0,c.q9)(t);return e.map((e=>{const t=s.fromJSON(e);return t.spatialReference=i,t}))}((await(0,y.default)(s.path+"/simplify",o)).data,r,n)}(n,s,i),l=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?l.push(t):l.push(p?(0,g.$)(a.shift()):a.shift())}return l}const k=[];for(let e=0;e<B.length;e++){const t=B[e];if("cut"!==t)k.push(t);else{const e=M.shift();k.push(!0===p?(0,g.$)(e):e)}}return k}},70171:(e,t,i)=>{let s;i.d(t,{Kd:()=>o,Ze:()=>c,qe:()=>l});const n=globalThis.esriConfig?.locale??globalThis.dojoConfig?.locale;function r(){return n??globalThis.navigator?.language??"en"}function o(){return void 0===s&&(s=r()),s}const a=[];function l(e){return a.push(e),{remove(){a.splice(a.indexOf(e),1)}}}const u=[];function c(e){return u.push(e),{remove(){a.splice(u.indexOf(e),1)}}}globalThis.addEventListener?.("languagechange",(function(){const e=r();s!==e&&(s=e,[...u].forEach((t=>{t.call(null,e)})),[...a].forEach((t=>{t.call(null,e)})))}))},37549:(e,t,i)=>{i.d(t,{H:()=>a});var s=i(80442),n=i(24133),r=i(24470);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new n.Q(9,(0,s.Z)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach(((i,s)=>{e[t++]=s})),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(this._boundsToLoad.filter((e=>this._idByBounds.has(e)))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.cS)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,(e=>t(this._idByBounds.get(e))))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},57191:(e,t,i)=>{i.d(t,{Z:()=>m});var s=i(20102),n=i(32448),r=i(92604),o=i(70586),a=i(60437),l=i(24470),u=i(98732),c=i(37549),d=i(29730),h=i(70272),f=i(5428);const p={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new h.u_(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>((0,o.Wi)(e.centroid)&&(e.centroid=(0,d.Y)(new f.Z,e.geometry,t.hasZ,t.hasM)),e.centroid)};class m{constructor(e){this.geometryInfo=e,this._boundsStore=new c.H,this._featuresById=new Map,this._markedIds=new Set,this.events=new n.Z,this.featureAdapter=p}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach((t=>{(0,o.pC)(t.geometry)&&t.geometry.coords&&(e+=t.geometry.coords.length)})),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t,i){for(const s of e){const e=this._boundsStore.get(s.objectId);e&&t((0,a.JR)(i,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}toArray(){return Array.from(this._featuresById.values())}forEach(e){this._featuresById.forEach((t=>e(t)))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,(e=>{t(this._featuresById.get(e))}))}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach(((t,i)=>{this._markedIds.has(i)||(e=!0,this._remove(t))})),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void r.Z.getLogger("esri.layers.graphics.data.FeatureStore").error(new s.Z("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let n;if(this._markedIds.add(t),i?(e.displayId=i.displayId,n=this._boundsStore.get(t),this._boundsStore.delete(t)):(0,o.pC)(this.onFeatureAdd)&&this.onFeatureAdd(e),(0,o.Wi)(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);n=(0,u.$)((0,o.pC)(n)?n:(0,l.Ue)(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),(0,o.pC)(n)&&this._boundsStore.set(t,n),this._featuresById.set(t,e)}_remove(e){return(0,o.pC)(this.onFeatureRemove)&&this.onFeatureRemove(e),this._markedIds.delete(e.objectId),this._boundsStore.delete(e.objectId),this._featuresById.delete(e.objectId),e}}},14478:(e,t,i)=>{i.r(t),i.d(t,{default:()=>W}),i(66577);var s=i(3172),n=i(66643),r=i(20102),o=i(92604),a=i(95330),l=i(17452),u=i(44547),c=i(37455),d=i(8744),h=i(40488),f=i(70272),p=i(5428),m=i(57191),g=i(37427),y=i(50245);const _=/^\s*"([\S\s]*)"\s*$/,b=/""/g,x=[","," ",";","|","\t"];function*S(e,t,i){let s=0;for(;s<=e.length;){const n=e.indexOf(t,s),r=e.substring(s,n>-1?n:void 0);s+=r.length+t.length,i&&!r.trim()||(yield r)}}function I(e){const t=e.includes("\r\n")?"\r\n":"\n";return S(e,t,!0)}function v(e,t){return S(e,t,!1)}function*w(e,t,i,s=(()=>Object.create(null))){let n="",r="",o=0,a=s(),l=0;e:for(const u of e){const e=v(u,i);for(const u of e)if(n+=r+u,r="",o+=F(u),o%2==0){if(o>0){const e=_.exec(n);if(!e){a=s(),l=0,n="",o=0;continue e}a[t[l]]=e[1].replace(b,'"'),l++}else a[t[l]]=n,l++;n="",o=0}else r=i;0===o?(yield a,a=s(),l=0):r="\n"}}function F(e){let t=0,i=0;for(i=e.indexOf('"',i);i>=0;)t++,i=e.indexOf('"',i+1);return t}var N=i(25278),E=i(14808);function T(e){const t=e.map((e=>e.toLowerCase()));return{longitudeFieldName:e[t.indexOf(q.find((e=>t.includes(e))))],latitudeFieldName:e[t.indexOf(Z.find((e=>t.includes(e))))]}}function z(e){if(!e.length)return"string";const t=/[^+-.,0-9]/;return e.map((e=>{let i=!1;if(""!==e){if(t.test(e))i=!0;else{let t=M(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")){if(t=Number(e),!isNaN(t))return"double";if(e.includes(",")){if(e=e.replace(",","."),t=Number(e),!isNaN(t))return"double";i=!0}else i=!0}else i=!0}return i?/^[-]?\d*[.,]?\d*$/.test(e)?"string":C(new Date(e),e)?"date":"string":"string"}})).reduce(((e,t)=>void 0===e||e===t?t:"string"===e||"string"===t?"string":"double"===e||"double"===t?"double":void 0))}function C(e,t){if(!e||"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))return!1;let i=!0;if(!R&&/\d+\W*$/.test(t)){const e=t.match(/[a-zA-Z]{2,}/);if(e){let t=!1,s=0;for(;!t&&s<=e.length;)t=!B.test(e[s]),s++;i=!t}}return i}const M=function(){const e=(0,E.lt)(),t=new RegExp("^"+e.regexp+"$"),i=new RegExp("["+e.group+"\\s\\xa0]","g"),s=e.factor;return n=>{const r=t.exec(n);if(e.factor=s,!r)return NaN;let o=r[1];if(!r[1]){if(!r[2])return NaN;o=r[2],e.factor*=-1}return o=o.replace(i,"").replace(e.decimal,"."),+o*e.factor}}(),B=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,R=Number.isNaN(new Date("technology 10").getTime()),Z=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point-y"],q=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point-x"];var O=i(99514),k=i(35671),L=i(82971);const A=(0,N.bU)("esriGeometryPoint"),j=["csv"],D=[0,0];class P{constructor(e,t){this.x=e,this.y=t}}class W{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){this._loadOptions=e;const[i]=await Promise.all([this._fetch(t.signal),this._checkProjection(e?.parsingOptions?.spatialReference)]),s=function(e,t){const i=t.parsingOptions||{},s={delimiter:i.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:i.latitudeField,longitudeFieldName:i.longitudeField}},n=I(e);let o=n.next().value;if(!o)throw new r.Z("csv-layer:empty-csv","CSV is empty",{csv:e});if(o=o.trim(),!i.delimiter){const e=function(e){const t=e.trim();let i=0,s="";for(const e of x){const n=t.split(e).length;n>i&&(i=n,s=e)}return""===s?null:s}(o);if(!e)throw new r.Z("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV");s.delimiter=e}const a=o.split(s.delimiter).filter((e=>!!e)),u=s.layerDefinition={name:(0,l.vt)(t.url,j)||"csv",drawingInfo:A,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:i.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:i.spatialReference||{wkid:102100}}};if(!i.latitudeField||!i.longitudeField){const e=T(a);if(!i.longitudeField&&!e.longitudeFieldName||!i.latitudeField&&!e.latitudeFieldName)throw new r.Z("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file");s.locationInfo={longitudeFieldName:i.longitudeField||e.longitudeFieldName,latitudeFieldName:i.latitudeField||e.latitudeFieldName}}const c=function(e,t,i,s){const n=[],r=w(e,i,t),o=[];for(const e of r){if(10===o.length)break;o.push(e)}for(const e of i)if(e===s.longitudeFieldName||e===s.latitudeFieldName)n.push({name:e,type:"esriFieldTypeDouble",alias:e});else{let t,i;switch(z(o.map((t=>t[e])))){case"integer":t="esriFieldTypeInteger";break;case"double":t="esriFieldTypeDouble";break;case"date":t="esriFieldTypeDate",i=36;break;default:t="esriFieldTypeString",i=255}n.push({name:e,type:t,alias:e,length:i})}return n}(n,s.delimiter,a,s.locationInfo);if(i.fields&&i.fields.length){const e=new Map;for(const t of i.fields)e.set(t.name.toLowerCase(),t);for(const t of c){const i=e.get(t.name.toLowerCase());if(i){const e=t.name;Object.assign(t,i),t.name=e}}}if(u.fields=c,!u.fields.some((e=>"esriFieldTypeOID"===e.type&&(u.objectIdField=e.name,!0)))){const e={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};u.objectIdField=e.name,u.fields.unshift(e)}if(u.timeInfo){const e=new O.Z(u.fields),t=u.timeInfo;if(t.startTimeField){const i=e.get(t.startTimeField);i?(t.startTimeField=i.name,i.type="esriFieldTypeDate"):t.startTimeField=null}if(t.endTimeField){const i=e.get(t.endTimeField);i?(t.endTimeField=i.name,i.type="esriFieldTypeDate"):t.endTimeField=null}if(t.trackIdField){const i=e.get(t.trackIdField);t.trackIdField=i?i.name:null}t.startTimeField||t.endTimeField||(u.timeInfo=null)}return s}(i,e);this._locationInfo=s.locationInfo,this._delimiter=s.delimiter,this._queryEngine=this._createQueryEngine(s);const n=await this._createFeatures(i);if(this._queryEngine.featureStore.addMany(n),s.layerDefinition.extent=this._queryEngine.fullExtent,s.layerDefinition.timeInfo){const{start:e,end:t}=this._queryEngine.timeExtent;s.layerDefinition.timeInfo.timeExtent=[e,t]}return s}async applyEdits(){throw new r.Z("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){return this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=(0,n.vr)(this._snapshotFeatures),this._snapshotTask.promise.then((e=>{this._queryEngine.featureStore.clear(),e&&this._queryEngine.featureStore.addMany(e)}),(e=>{this._queryEngine.featureStore.clear(),(0,a.D_)(e)||o.Z.getLogger("esri.layers.CSVLayer").error(new r.Z("csv-layer:refresh","An error occurred during refresh",{error:e}))})),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:i}=this._loadOptions;if(!t)throw new r.Z("csv-layer:invalid-source","url not defined");const n=(0,l.mN)(t);return(await(0,s.default)(n.path,{query:{...n.query,...i},responseType:"text",signal:e})).data}_createQueryEngine(e){const{objectIdField:t,fields:i,extent:s,timeInfo:n}=e.layerDefinition,r=new m.Z({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new y.q({fields:i,geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:n,objectIdField:t,spatialReference:s.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:r})}async _createFeatures(e){const{latitudeFieldName:t,longitudeFieldName:i}=this._locationInfo,{objectIdField:s,fieldsIndex:n,spatialReference:r}=this._queryEngine;let o=[];const a=[],l=n.fields.filter((e=>e.name!==s)).map((e=>e.name));let m=0;const g=I(e);g.next();const y={};for(const e of n.fields)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=(0,k.os)(e);void 0!==t&&(y[e.name]=t)}const _=w(g,l,this._delimiter,(0,N.Dm)(y,s));for(const e of _){const r=this._parseCoordinateValue(e[t]),l=this._parseCoordinateValue(e[i]);if(null!=l&&null!=r&&!isNaN(r)&&!isNaN(l)){e[t]=r,e[i]=l;for(const s in e)if(s!==t&&s!==i)if(n.isDateField(s)){const t=new Date(e[s]);e[s]=C(t,e[s])?t.getTime():null}else if(n.isNumericField(s)){const t=M(e[s]);isNaN(t)?e[s]=null:e[s]=t}e[s]=m,m++,o.push(new P(l,r)),a.push(e)}}if(!(0,d.fS)({wkid:4326},r))if((0,d.sS)(r))for(const e of o)[e.x,e.y]=(0,h.hG)(e.x,e.y,D);else o=(0,u.oj)(c.N,o,L.Z.WGS84,r,null,null);const b=[];for(let e=0;e<o.length;e++){const{x:t,y:i}=o[e],n=a[e];n[s]=e+1,b.push(new f.u_(new p.Z([],[t,i]),n,null,n[s]))}return b}_parseCoordinateValue(e){if(null==e||""===e)return null;let t=M(e);return(isNaN(t)||Math.abs(t)>181)&&(t=parseFloat(e)),t}async _checkProjection(e){try{await(0,g._W)(d.Zn,e)}catch{throw new r.Z("csv-layer:projection-not-supported","Projection not supported")}}}},25278:(e,t,i)=>{i.d(t,{Dm:()=>c,Hq:()=>d,MS:()=>h,bU:()=>a});var s=i(80442),n=i(22974),r=i(61159),o=i(58333);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.I4:"esriGeometryPolyline"===e?o.ET:o.lF}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let u=1;function c(e,t){if((0,s.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let i=`this.${t} = null;`;for(const t in e)i+=`this${l.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${u++} {\n constructor() {\n ${i};\n }\n }\n `)();return()=>new s}catch(i){return()=>({[t]:null,...e})}}function d(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.d9)(e)}}]}function h(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0},query:r.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1}}}},99514:(e,t,i)=>{i.d(t,{Z:()=>o});var s=i(35671);function n(e){return"oid"===e.type||"esriFieldTypeOID"===e.type}function r(e){return"global-id"===e.type||"esriFieldTypeGlobalID"===e.type}class o{constructor(e=[]){if(this.fields=[],this._fieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!e)return;this.fields=e;const t=[];for(const o of e){const e=o&&o.name;if(e){const l=a(e);this._fieldsMap.set(e,o),this._fieldsMap.set(l,o),t.push(l),"date"===(i=o).type||"esriFieldTypeDate"===i.type?(this.dateFields.push(o),this._dateFieldsSet.add(o)):(0,s.H7)(o)&&(this._numericFieldsSet.add(o),this.numericFields.push(o)),n(o)||r(o)||(o.editable=null==o.editable||!!o.editable,o.nullable=null==o.nullable||!!o.nullable)}}var i;t.sort(),this.uid=t.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)n(e)||r(e)||e.nullable||void 0!==(0,s.os)(e)||this._requiredFields.push(e)}return this._requiredFields}has(e){return null!=this.get(e)}get(e){return null!=e?this._fieldsMap.get(e)||this._fieldsMap.get(a(e)):void 0}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){const t=this.get(e);if(t)return t.name??void 0}}function a(e){return e.toLowerCase().trim()}},58333:(e,t,i)=>{i.d(t,{ET:()=>r,I4:()=>n,eG:()=>l,lF:()=>o,lj:()=>c,qP:()=>a,wW:()=>u});const s=[252,146,31,255],n={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},r={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},o={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},c={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
|
package/rest/geometry/cut.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import"../../geometry.js";import e from"../../request.js";import{urlToObject as t}from"../../core/urlUtils.js";import{getJsonType as r,fromJSON as s}from"../../geometry/support/jsonUtils.js";async function o(o,i,n,m){const p="string"==typeof o?t(o):o,a=i[0].spatialReference,u={...m,query:{...p.query,f:"json",sr:JSON.stringify(a),target:JSON.stringify({geometryType:r(i[0]),geometries:i}),cutter:JSON.stringify(n)}},c=await e(p.path+"/cut",u),{cutIndexes:f,geometries:g=[]}=c.data;return{cutIndexes:f,geometries:g.map((e=>{const t=s(e);return t.spatialReference=a,t}))}}export{o as cut};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import r from"../../request.js";import{urlToObject as t}from"../../core/urlUtils.js";import{getJsonType as e,getGeometryType as o}from"../../geometry/support/jsonUtils.js";async function i(o,i,f){const m="string"==typeof o?t(o):o,p=i[0].spatialReference,a=e(i[0]),u={...f,query:{...m.query,f:"json",sr:p.wkid?p.wkid:JSON.stringify(p),geometries:JSON.stringify(s(i))}};return n((await r(m.path+"/simplify",u)).data,a,p)}function s(r){return{geometryType:e(r[0]),geometries:r.map((r=>r.toJSON()))}}function n(r,t,e){const i=o(t);return r.map((r=>{const t=i.fromJSON(r);return t.spatialReference=e,t}))}export{i as simplify};
|