@arcgis/core 5.1.0-next.21 → 5.1.0-next.22
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/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -0
- package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +1 -0
- package/analysis/VolumeMeasurement/VolumeMeasurementInputUnits.d.ts +1 -0
- package/analysis/VolumeMeasurementAnalysis.d.ts +3 -2
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03d11c7056fea763cbac.js +1 -0
- package/assets/esri/core/workers/chunks/05e5b9082c0a396df7e5.js +1 -0
- package/assets/esri/core/workers/chunks/08445fcba84ed7c23b3f.js +1 -0
- package/assets/esri/core/workers/chunks/0c706cdff6eac940eaab.js +1 -0
- package/assets/esri/core/workers/chunks/10a8612e7b2c74a8ce9a.js +1 -0
- package/assets/esri/core/workers/chunks/{2ddb8bb00b3af83ebd7c.js → 14792047c5519dd89828.js} +1 -1
- package/assets/esri/core/workers/chunks/1a1e57267306c07e5bdb.js +1 -0
- package/assets/esri/core/workers/chunks/1bb5aa1e3693e0c68b18.js +1 -0
- package/assets/esri/core/workers/chunks/1cd091fa567fc4026356.js +1 -0
- package/assets/esri/core/workers/chunks/{3ed7f19f77a11fa4d047.js → 2063b49607a03f7718ee.js} +1 -1
- package/assets/esri/core/workers/chunks/{74a6d840813ac29b0bda.js → 209acb3ad16c99bb506c.js} +1 -1
- package/assets/esri/core/workers/chunks/21decfc1e477fb769204.js +1 -0
- package/assets/esri/core/workers/chunks/21e04705cad9fef1b01b.js +1 -0
- package/assets/esri/core/workers/chunks/23cb0611abe1031c513c.js +1 -0
- package/assets/esri/core/workers/chunks/285f3b07de852bfc1604.js +1 -0
- package/assets/esri/core/workers/chunks/2c61a53962093a331225.js +1 -0
- package/assets/esri/core/workers/chunks/2ecfd6edab796194bf88.js +1 -0
- package/assets/esri/core/workers/chunks/2f23af31b1190754ce13.js +1 -0
- package/assets/esri/core/workers/chunks/31eb59eae4c89b76e302.js +1 -0
- package/assets/esri/core/workers/chunks/3e61e7805dc6ff284831.js +1 -0
- package/assets/esri/core/workers/chunks/4150774059d67a8def74.js +1 -0
- package/assets/esri/core/workers/chunks/416c57df61fbd193078b.js +1 -0
- package/assets/esri/core/workers/chunks/46d28a0c20263012faff.js +1 -0
- package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js → 4754610760f3f634adf9.js} +2 -2
- package/assets/esri/core/workers/chunks/{f5cebeaad3e7d87d7997.js → 4fc6dd1423075e145b29.js} +1 -1
- package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js → 527547fa10d52cb3a7b1.js} +2 -2
- package/assets/esri/core/workers/chunks/5480d4cc342a2669a8ab.js +1 -0
- package/assets/esri/core/workers/chunks/{e8495c655a0a4f534636.js → 551fee27bf3abf0c41fd.js} +1 -1
- package/assets/esri/core/workers/chunks/576995021660e8b34705.js +1 -0
- package/assets/esri/core/workers/chunks/57e375d8a8db9fa57193.js +1 -0
- package/assets/esri/core/workers/chunks/5cbc12545f42a32fb960.js +1 -0
- package/assets/esri/core/workers/chunks/61ebbae0773fccc1f2bf.js +1 -0
- package/assets/esri/core/workers/chunks/63c297b6b7438f49e7ee.js +1 -0
- package/assets/esri/core/workers/chunks/{53f8c1d56ef3b24d2226.js → 6c853fd89f0e9f102c6e.js} +1 -1
- package/assets/esri/core/workers/chunks/{946698d9cefffdb63082.js → 6e32e7b2ea2ea1a1fc04.js} +1 -1
- package/assets/esri/core/workers/chunks/6f12854c5846edfe3239.js +1 -0
- package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js → 7189e03cc24f5c10865a.js} +2 -2
- package/assets/esri/core/workers/chunks/7c417d2bf432e4055b3d.js +30 -0
- package/assets/esri/core/workers/chunks/8021cb732f8136d87048.js +1 -0
- package/assets/esri/core/workers/chunks/84124c1a41a96192f81c.js +1 -0
- package/assets/esri/core/workers/chunks/845bbd82ddacbb62ad28.js +1 -0
- package/assets/esri/core/workers/chunks/868c8a152cb1452b9a94.js +1 -0
- package/assets/esri/core/workers/chunks/879ce85c50b0348056b2.js +1 -0
- package/assets/esri/core/workers/chunks/87a7d405a0b9a541d7f2.js +1 -0
- package/assets/esri/core/workers/chunks/9522430d34d29c1ffb1a.js +1 -0
- package/assets/esri/core/workers/chunks/9647f3983f955da21093.js +1 -0
- package/assets/esri/core/workers/chunks/9694b4b85168a38ca24b.js +1 -0
- package/assets/esri/core/workers/chunks/{83d913dab3c2b0d6a7cc.js → 9736299a4ac0e21f08a7.js} +1 -1
- package/assets/esri/core/workers/chunks/{e7bee85f28d7ec03825a.js → 973e3743cb7fdaa27f80.js} +1 -1
- package/assets/esri/core/workers/chunks/9b2d0d36ee6c04c347df.js +1 -0
- package/assets/esri/core/workers/chunks/{2662750d5761ed2d0eb7.js → 9e7eea56e96f012f9ff4.js} +1 -1
- package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js → a35d1be700ebd3109397.js} +2 -2
- package/assets/esri/core/workers/chunks/a4a4ce33de6432ba4dc3.js +1 -0
- package/assets/esri/core/workers/chunks/{aece665144aed2065ffc.js → a78ac951c00f090d9024.js} +1 -1
- package/assets/esri/core/workers/chunks/{0debabe324c873066885.js → aa3bdfd00f666c6cc521.js} +1 -1
- package/assets/esri/core/workers/chunks/{db5bbc240a1b8cd5af52.js → abc2471cfa9430ca5645.js} +1 -1
- package/assets/esri/core/workers/chunks/b2a67fe89f6505498bc3.js +1 -0
- package/assets/esri/core/workers/chunks/b4254fcb2051c873f2ba.js +1 -0
- package/assets/esri/core/workers/chunks/{a53fa34681efff8fc024.js → b859d98fa1c39f8e4099.js} +1 -1
- package/assets/esri/core/workers/chunks/c09bc36347e8eb9fff00.js +1 -0
- package/assets/esri/core/workers/chunks/c2cda93905f0a49a6931.js +1 -0
- package/assets/esri/core/workers/chunks/{3d0aa5f2db79c022243e.js → c794f7be868e53ca4a8c.js} +1 -1
- package/assets/esri/core/workers/chunks/cada79c174027f7a0df8.js +1 -0
- package/assets/esri/core/workers/chunks/d10c65cde3565d399275.js +1 -0
- package/assets/esri/core/workers/chunks/d44217de4c73475f9c66.js +1 -0
- package/assets/esri/core/workers/chunks/d587b7842091affdaac3.js +1 -0
- package/assets/esri/core/workers/chunks/d70678598f4080adfb39.js +1 -0
- package/assets/esri/core/workers/chunks/dad9c25f1b7cacf7b052.js +1 -0
- package/assets/esri/core/workers/chunks/{0facd2c143a04cc7c4ff.js → deee88e3f1641c6ef5db.js} +1 -1
- package/assets/esri/core/workers/chunks/e063cce778944fe97dd3.js +1 -0
- package/assets/esri/core/workers/chunks/e37e7ae2de974cef9a90.js +1 -0
- package/assets/esri/core/workers/chunks/e44ed205f74df34adb8b.js +1 -0
- package/assets/esri/core/workers/chunks/e6220c1fa887e21ffbbd.js +1 -0
- package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js → eaeb95be8d4032513247.js} +2 -2
- package/assets/esri/core/workers/chunks/{93515f52d9b5fa12bd04.js → eb4934d3a3b82316c7c6.js} +1 -1
- package/assets/esri/core/workers/chunks/{bfeab15d7ac9a2559fe5.js → f1c1f7583fa13dff9b5c.js} +1 -1
- package/assets/esri/core/workers/chunks/f27bbb4e26297d3c68de.js +1 -0
- package/assets/esri/core/workers/chunks/f4480636a910eaa4c531.js +1 -0
- package/assets/esri/core/workers/chunks/{5b991b0d4ca257291cb0.js → f5c5a9e771074f780fc8.js} +1 -1
- package/assets/esri/core/workers/chunks/f82a95c46f0d579d5bf5.js +1 -0
- package/assets/esri/core/workers/chunks/fb3a42cdd0d3105ec551.js +1 -0
- package/config.js +1 -1
- package/core/MultiOriginJSONSupport.d.ts +1 -1
- package/core/ReadOnlyMultiOriginJSONSupport.d.ts +5 -4
- package/geometry/FlatGeometry.js +1 -1
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +7 -9
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/raster/datasets/MRFRaster.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/package.json +2 -2
- package/renderers/VectorFieldRenderer.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/SDFHelper.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementError.d.ts +1 -0
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +1 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +1 -0
- package/views/3d/layers/Lyr3DWorker.js +1 -1
- package/views/3d/layers/SceneLayerWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/SelectionManager.d.ts +9 -9
- package/views/SelectionManager.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +24 -24
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/FeatureTemplates.d.ts +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Sketch/support/sketchUtils.js +1 -1
- package/assets/esri/core/workers/chunks/026c00ee272c64e53daf.js +0 -1
- package/assets/esri/core/workers/chunks/0883c4e63424d6746ada.js +0 -1
- package/assets/esri/core/workers/chunks/0987cb20148f65222b44.js +0 -1
- package/assets/esri/core/workers/chunks/0a1f88cf16bcbb53b371.js +0 -1
- package/assets/esri/core/workers/chunks/0ca405ca26676137a4be.js +0 -1
- package/assets/esri/core/workers/chunks/0ce968c89c35535da63e.js +0 -1
- package/assets/esri/core/workers/chunks/144c719d5ba9e3a30961.js +0 -1
- package/assets/esri/core/workers/chunks/1503ca177e2466ec0e87.js +0 -1
- package/assets/esri/core/workers/chunks/1597d7b380d510ff5252.js +0 -1
- package/assets/esri/core/workers/chunks/1880c3b293cdfa804625.js +0 -1
- package/assets/esri/core/workers/chunks/1bea32b02d35ddb9b118.js +0 -1
- package/assets/esri/core/workers/chunks/1d78ec98eef7fef08f86.js +0 -1
- package/assets/esri/core/workers/chunks/1e6271524602e159dbad.js +0 -1
- package/assets/esri/core/workers/chunks/1f96d597ba736e088168.js +0 -1
- package/assets/esri/core/workers/chunks/26e41b08efe77d247409.js +0 -1
- package/assets/esri/core/workers/chunks/297b58f29c496923e1f3.js +0 -1
- package/assets/esri/core/workers/chunks/2a2a9fa62969644ea200.js +0 -1
- package/assets/esri/core/workers/chunks/2b296378d21e4e3c11d4.js +0 -1
- package/assets/esri/core/workers/chunks/2cbcf34cf896a438999b.js +0 -1
- package/assets/esri/core/workers/chunks/394b645d51e7bf799382.js +0 -1
- package/assets/esri/core/workers/chunks/50ab9a3f8bbb268fae59.js +0 -1
- package/assets/esri/core/workers/chunks/5b2dd164dd84fd1ca4f7.js +0 -1
- package/assets/esri/core/workers/chunks/62c228ca16fdc7a2c695.js +0 -1
- package/assets/esri/core/workers/chunks/639202a461b17840a13f.js +0 -1
- package/assets/esri/core/workers/chunks/693d269637135047a0c4.js +0 -1
- package/assets/esri/core/workers/chunks/6a14ec2d2de6778a4e7a.js +0 -1
- package/assets/esri/core/workers/chunks/6d3467997b5d01630b08.js +0 -1
- package/assets/esri/core/workers/chunks/6dfcb0c804e63e87e311.js +0 -1
- package/assets/esri/core/workers/chunks/778ab9e4c3928b0d7d74.js +0 -1
- package/assets/esri/core/workers/chunks/8012fdc49a7a10982f78.js +0 -1
- package/assets/esri/core/workers/chunks/85e0fd618625a639387f.js +0 -1
- package/assets/esri/core/workers/chunks/86465d4bb185d7460087.js +0 -1
- package/assets/esri/core/workers/chunks/87e7378b242debbfd575.js +0 -1
- package/assets/esri/core/workers/chunks/90b19e60c056f32623e7.js +0 -1
- package/assets/esri/core/workers/chunks/9461f7225c42cf15a114.js +0 -1
- package/assets/esri/core/workers/chunks/978649cb6df99ee728be.js +0 -1
- package/assets/esri/core/workers/chunks/9f5f4da954228d876219.js +0 -1
- package/assets/esri/core/workers/chunks/a2323c957c8b2fe225b4.js +0 -1
- package/assets/esri/core/workers/chunks/a36a33f43610c3cd985b.js +0 -1
- package/assets/esri/core/workers/chunks/a381932eef77f4d80292.js +0 -1
- package/assets/esri/core/workers/chunks/b089947c9a492c96ca27.js +0 -1
- package/assets/esri/core/workers/chunks/b6e4c35b76379088035c.js +0 -1
- package/assets/esri/core/workers/chunks/b96dce64bdd7487e862a.js +0 -1
- package/assets/esri/core/workers/chunks/c4a78ab84186c7be599a.js +0 -1
- package/assets/esri/core/workers/chunks/c9d600dc6b6b5aafff1c.js +0 -1
- package/assets/esri/core/workers/chunks/ca33847a997ccfe8ddc2.js +0 -1
- package/assets/esri/core/workers/chunks/cca19c9564be2d02a277.js +0 -1
- package/assets/esri/core/workers/chunks/ccc2f2b3db008d8a495f.js +0 -1
- package/assets/esri/core/workers/chunks/d9f900975ac915a0f24f.js +0 -1
- package/assets/esri/core/workers/chunks/dd5d66f067e2386e0514.js +0 -1
- package/assets/esri/core/workers/chunks/eb4ffb72c9360062141c.js +0 -1
- package/assets/esri/core/workers/chunks/ebae903845643d60b44a.js +0 -1
- package/assets/esri/core/workers/chunks/ebb0372e8da0f75c09dd.js +0 -1
- package/assets/esri/core/workers/chunks/f349f64f683620bdf9b5.js +0 -30
- package/assets/esri/core/workers/chunks/f6fb87092bdf6bbf0769.js +0 -1
- package/assets/esri/core/workers/chunks/f76c2b09e6ba9d107898.js +0 -1
- package/assets/esri/core/workers/chunks/fcf962f3dec6b5440983.js +0 -1
- /package/assets/esri/core/workers/chunks/{43c8b1473695574c663e.js.LICENSE.txt → 4754610760f3f634adf9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{3861644c06cfebe8f40c.js.LICENSE.txt → 527547fa10d52cb3a7b1.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{b586f1021a27c5e1551a.js.LICENSE.txt → 7189e03cc24f5c10865a.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{3f812b0a28afb47aaaf0.js.LICENSE.txt → a35d1be700ebd3109397.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{13d1cb50232ae761425b.js.LICENSE.txt → eaeb95be8d4032513247.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1003],{1003(e,t,s){s.r(t),s.d(t,{default:()=>ge});var i=s(49186),n=s(5482),a=s(91429),r=s(49859),o=s(68197),l=s(5443),f=s(16930),c=s(73444),u=s(94778),h=s(14140);function p(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function d(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function m(e){const{axes:t}=e.domain,s=Object.keys(t),i=[],n=[];let a=-1,r=-1,o=[];for(let e=0;e<s.length;e++){const l=s[e];p(l)?a=e:d(l)&&(r=e);const f=t[l],c=[];if("values"in f){f.values.forEach(e=>c.push("string"==typeof e?new Date(e).getTime():e));const e=c[1]-c[0];i.push([c[0]-.5*e,c[c.length-1]+.5*e]),n.push(e)}else{const{start:e,stop:t,num:s}=f,a=(t-e)/(s-1);i.push([e-.5*a,t+.5*a]),n.push(a);for(let t=0;t<s;t++)c.push(e+a*t)}o.push({name:l,values:c,extent:[c[0],c[c.length-1]]})}a>-1&&-1===r?r=0===a?1:0:r>-1&&-1===a?a=0===r?1:0:-1===r&&-1===a&&(a=0,r=1),o=o.filter((e,t)=>!(t===a||t===r));const{referencing:c}=e.domain,u=c.find(e=>e.coordinates.includes(s[a])).system.id,h=u?.slice(u.lastIndexOf("/")+1),m=null==h||"CRS84"===h?4326:Number(h),g=new f.A({wkid:m}),[y,x]=i[a],[w,I]=i[r],v=new l.A({xmin:y,xmax:x,ymin:w,ymax:I,spatialReference:g});return{width:Math.round(v.width/n[a]),height:Math.round(v.height/n[r]),extent:v,dimensions:o}}function g(e){const t=(0,c.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function y(){return Math.round(255*Math.random())}function x(e){const t={},{parameters:s}=e;if(!s)return t;for(const[e,i]of Object.entries(s)){const{type:s,description:n,unit:a,categoryEncoding:r,observedProperty:l}=i;if("Parameter"===s&&(t[e]={},n&&(t[e].description=g(n)),a&&(t[e].unit=a.label?g(a.label):null,t[e].symbol=a.symbol?.value),r)){const s=Object.entries(r).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1}));let i=!1;l?.categories?.length&&(l.categories.forEach(e=>{if(!e.id)return;const t=e.id.slice(e.id.lastIndexOf("/")+1),n=s.find(e=>e.ClassName===t);if(!n)return;const a=e.label?g(e.label):null;if(n.Label=a,e.preferredColor){const t=o.A.fromHex(e.preferredColor);t&&(i=!0,n.Red=t.r,n.Green=t.g,n.Blue=t.b)}}),i&&s.forEach(e=>{null==e.Red&&(e.Red=y(),e.Green=y(),e.Blue=y())}));const n={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:s.map(e=>({attributes:e}))};i&&n.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=n}}return t}function w(e){let t=Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let i=0;i<e.length;i++){const n=e[i];null!=n&&(n<t&&(t=n),n>s&&(s=n))}return(0,u.X1)(t,s)}function I(e,t,s){const i=e.map((e,s)=>({name:e,count:t[s]})).sort((e,t)=>e.name>t.name?-1:1),n=(a=1,e=>a*=e.count);var a;const r=[...i.slice(1),{name:"",count:1}].reverse().map(n).reverse();let o=0;for(let n=e.length-1;n>=0;n--)o+=r[i.findIndex(({name:t})=>t===e[n])]*(s%t[n]),s=Math.floor(s/t[n]);return o}var v=s(74887),C=s(4366),b=s(47520),T=s(51927),S=s(45617),A=s(87186);let R=class extends r.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(e,t,s,i={}){if(!this._pixelBlockTiles){const{rasterInfo:n}=this,[a,r]=n.storageInfo.tileInfo.size,{sliceId:o}=i,{pixelBlocks:l}=this.source,f={pixelBlock:null==o?l[0]:l[o],useBilinear:"thematic"!==n.dataType,tileSize:{width:a,height:r},level:e,row:t,col:s},c=this.rasterJobHandler?this.rasterJobHandler.clipTile(f,i):(0,b.J$)(f);return Promise.resolve(c)}const n=this._pixelBlockTiles.get(`${e}/${t}/${s}`);return Promise.resolve(n)}async _open(e){const t=this.source,{pixelBlocks:s,attributeTable:i,statistics:n,histograms:a,name:r,nativeExtent:o,transform:c,colormap:u}=t,h=s[0],{width:p,height:d,pixelType:m}=h,g=t.extent??new l.A({xmin:-.5,ymin:.5,xmax:p-.5,ymax:d-.5,spatialReference:new f.A({wkid:3857})}),y=t.isPseudoSpatialReference??!t.extent,x={x:g.width/p,y:g.height/d},w={...t.keyProperties};t.dataType&&(w.DataType=t.dataType),t.bandInfos&&(w.BandProperties=t.bandInfos.map(e=>e.toJSON())),i&&(w.DataType="Thematic");const I=new A.A({width:p,height:d,pixelType:m,extent:g,nativeExtent:o,attributeTable:i,colormap:u,transform:c,pixelSize:x,spatialReference:g.spatialReference,bandCount:h.pixels.length,keyProperties:w,multidimensionalInfo:t.multidimensionalInfo,statistics:n,isPseudoSpatialReference:y,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(I),this.createRemoteDatasetStorageInfo(I,512,512),this._set("rasterInfo",I),this.updateTileInfo(),I.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,I.multidimensionalInfo):await this._buildInMemoryRaster(h,{width:512,height:512},e),I.multidimensionalInfo||(this.source=null),this.datasetName=r}async _buildInMemoryRaster(e,t,s){const{rasterInfo:n}=this,a=n.storageInfo.maximumPyramidLevel??0,r="thematic"!==n.dataType,o=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:a,useBilinear:r},s):Promise.resolve((0,b.lD)(e,t,a,r)),l=null!=n.statistics,f=null!=n.histograms,c=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},s):Promise.resolve((0,T.f4)(e)),u=await(0,v.Lx)([o,c]);if(!u[0].value&&u[1].value)throw new i.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,l||(n.statistics=u[1].value?.statistics),f||(n.histograms=u[1].value?.histograms)}async _buildMDimStats(e,t,s){for(let i=0;i<t.variables.length;i++){const n=t.variables[i];if(n.statistics)continue;const a=n.dimensions.map(e=>new S.A({variableName:n.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),r=(0,C.NG)(a,t),o=null==r?null:e[r];if(null==o)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},s):(0,T.eH)(o);n.statistics=l.statistics,n.histograms||(n.histograms=l.histograms)}}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],R.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,a.MZ)()],R.prototype,"source",void 0),(0,n.Cg)([(0,a.MZ)()],R.prototype,"url",null),R=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.InMemoryRaster")],R);const M=R;var O=s(22671);let k=class extends r.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,s,i={}){return this._inMemoryRaster.fetchRawTile(e,t,s,i)}async _open(e){const{extent:t,pixelBlocks:s,multidimensionalInfo:i,attributeTable:n,bandNames:a}=await this._fetchData(e),{statistics:r,histograms:o}=(0,T.eH)(s[0]),l=a?.map(e=>({BandName:e})),f={DataType:n?"Thematic":i?"Scientific":"Generic",BandProperties:l},c=new M({source:{extent:t,pixelBlocks:s,attributeTable:n?O.A.fromJSON(n):null,multidimensionalInfo:i,statistics:r,histograms:o,keyProperties:f,isPseudoSpatialReference:!1}});await c.open(),this._inMemoryRaster=c;const u=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",u.slice(0,u.indexOf("."))),this._set("rasterInfo",c.rasterInfo)}async _fetchData(e){const t=this.source??(await this.request(this.url,{signal:e?.signal})).data,s="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new i.A(s,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new i.A(s,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new i.A(s,"Missing domain referencing in the grid coverage data");const n=Object.values(t.ranges);for(let e=0;e<n.length;e++){const{axisNames:t,shape:a,type:r,values:o}=n[e];if(!("ndarray"===r.toLowerCase()&&o?.length&&t?.length&&a?.length))throw new i.A(s,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!p(t[t.length-1])||!d(t[t.length-2]))throw new i.A(s,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){const{width:t,height:s,extent:i,dimensions:n}=m(e),{ranges:a}=e,r=Object.keys(a).sort((e,t)=>e<t?-1:1),o=[];for(let e=0;e<r.length;e++){const t=r[e];n?.length&&o.push({name:t,dimensions:n})}const l=x(e);o.forEach(e=>l[e.name]&&Object.assign(e,l[e.name]));const f=o.length?{variables:o}:void 0,c=[];for(let e=0;e<r.length;e++){const i=r[e],{values:o,dataType:l,axisNames:f,shape:u}=a[i],p=u.length>2?e*u.slice(0,-2).reduce((e,t)=>e*t):0,d=f.slice(0,-2),m=u.slice(0,-2),g="float"===l?"f32":w(o),y=t*s,x=o.length/y;for(let i=0;i<x;i++){const a=h.A.createEmptyBand(g,y),r=new Uint8Array(y).fill(255);let l=!1;const f=i*y;for(let e=0;e<y;e++){const t=o[f+e];null==t?(r[e]=0,l=!0):a[e]=t}if(0===e||n?.length){const e=new h.A({width:t,height:s,mask:l?r:null,pixels:[a],pixelType:g});e.updateStatistics(),n?.length?c[I(d,m,i)+p]=e:c.push(e)}else{const e=c[i];e.pixels.push(a),l?e.mask&&(e.mask=h.A.combineBandMasks([e.mask,r])):e.mask=l?r:null}}}const u=Object.values(l).find(e=>e.attributeTable)?.attributeTable;return{extent:i,pixelBlocks:c,multidimensionalInfo:f,attributeTable:u,bandNames:f?void 0:r}}(t)}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],k.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],k.prototype,"source",void 0),k=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.CovJSONRaster")],k);const _=k;var F=s(44208),P=s(4576),B=s(21325),N=s(330),D=s(43163);function E(e,t){if(!e||!t)return null;const s=[];for(let i=0;i<e.length;i++)s.push(e[i]),s.push(t[i]);return s}function L(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new f.A({wkid:t});if(e=String(e).trim(),(0,B.jp)(e))return new f.A({wkt2:e});const s=e.toUpperCase();if(s.startsWith("COMPD_CS")){if(!s.includes("VERTCS")||!s.includes("GEOGCS")&&!s.startsWith("PROJCS"))return null;const i=s.indexOf("VERTCS"),n=s.indexOf("PROJCS"),a=n>-1?n:s.indexOf("GEOGCS");if(-1===a)return null;const r=e.slice(a,e.lastIndexOf("]",i)+1).trim(),o=e.slice(i,e.lastIndexOf("]")).trim();t=z(r);const l=new f.A(t?{wkid:t}:{wkt:r}),c=z(o);return c&&(l.vcsWkid=c),l}return s.startsWith("GEOGCS")||s.startsWith("PROJCS")?(t=z(e),new f.A(0!==t?{wkid:t}:{wkt:e})):null}function z(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),s=t[t.length-1].split(","),i=s[0]?.toLowerCase();if(("epsg"===i||"esri"===i)&&e.endsWith('"]]')){const e=Number(s[1]);if(!isNaN(e)&&0!==e)return e}return 0}function U(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((0,N.g7)(e,"SRS")){if(!t.spatialReference){const s=(0,N.mX)(e);t.spatialReference=L(s)}}else if((0,N.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:s,transform:i}=function(e){const t=(0,N.V6)(e,"GeodataXform"),s=L((0,N.v7)(t,"SpatialReference/WKID")||(0,N.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:s,transform:null};const i=(0,N.v7)(t,"PolynomialOrder")??1,n=(0,N.Ui)(t,"CoeffX/Double"),a=(0,N.Ui)(t,"CoeffY/Double"),r=(0,N.Ui)(t,"InverseCoeffX/Double"),o=(0,N.Ui)(t,"InverseCoeffY/Double"),l=E(n,a),f=E(r,o);return{spatialReference:s,transform:l&&f&&l.length&&f.length?new D.A({spatialReference:s,polynomialOrder:i,forwardCoefficients:l,inverseCoefficients:f}):null}}(e);t.transform=i,t.spatialReference||(t.spatialReference=s)}else(0,N.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,N.mX)(e));else if((0,N.g7)(e,"PAMRasterBand")){const s=function(e){const t=(0,N.v7)(e,"NoDataValue"),s=(0,N.V6)(e,"Histograms/HistItem"),i=(0,N.v7)(s,"HistMin"),n=(0,N.v7)(s,"HistMax"),a=(0,N.v7)(s,"BucketCount"),r=(0,N.mX)(s,"HistCounts")?.split("|").map(e=>Number(e));let o,l,f,c;(0,N.IC)(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":f=t;break;case"STATISTICS_STDDEV":c=t}});const u=(0,N.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:r?.length&&null!=i&&null!=n?{min:i,max:n,size:a||r.length,counts:r}:null,sourceBandIndex:u,statistics:null!=o&&null!=l?{min:o,max:l,avg:f,stddev:c}:null}}(e);null!=s.sourceBandIndex&&null==t.rasterBands[s.sourceBandIndex]?t.rasterBands[s.sourceBandIndex]=s:t.rasterBands.push(s)}});const s=t.rasterBands;if(s.length){const e=!!s[0].statistics;t.statistics=e?s.map(e=>e.statistics).filter(P.Ru):null;const i=!!s[0].histogram;t.histograms=i?s.map(e=>e.histogram).filter(P.Ru):null}return t}var J=s(20758);let H=class extends r.A{fetchRawTile(e,t,s,i={}){return this._inMemoryRaster.fetchRawTile(e,t,s,i)}async _open(e){const t=await this._fetchData(e);let{spatialReference:s,statistics:i,histograms:n,transform:a}=await this._fetchAuxiliaryData(e);const r=!s;r&&(s=new f.A({wkid:3857})),n?.length&&null==i&&(i=(0,T.Pg)(n));const{width:o,height:c}=t;let u=new l.A({xmin:-.5,ymin:.5-c,xmax:o-.5,ymax:.5,spatialReference:s});const h=a?a.forwardTransform(u):u;let p=!0;if(a){const e=a.forwardCoefficients;p=e&&0===e[1]&&0===e[2],p&&(a=null,u=h)}const d=new M({source:{extent:h,nativeExtent:u,transform:a,pixelBlocks:[t],statistics:i,histograms:n,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:r},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(d.ioConfig.skipMapInfo=!0),await d.open(),d.source=null,this._set("rasterInfo",d.rasterInfo),this._inMemoryRaster=d}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),s=(0,J.g)(t).toUpperCase();if("JPG"!==s&&"PNG"!==s&&"GIF"!==s&&"BMP"!==s)throw new i.A("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",s);const n=s.toLowerCase(),a="gif"===n||"bmp"===n||!(0,F.A)("ios"),r=await this.decodePixelBlock(t,{format:n,useCanvas:a,hasNoZlibMask:!0});if(null==r)throw new i.A("image-aux-raster:open","the data cannot be decoded");return r}async _fetchAuxiliaryData(e){const t=e?.signal,{skipExtensions:s=[],skipMapInfo:i}=this.ioConfig,n=i||s.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),a=this.datasetFormat,r="JPG"===a?"jgw":"PNG"===a?"pgw":"BMP"===a?"bpw":null,o=r&&s.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:t}),l=await(0,v.Lx)([n,o]);if(t?.aborted)throw(0,v.NK)();const f=U(l[0].value?.data);if(!f.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;f.transform=6===e?.length?new D.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return f}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],H.prototype,"datasetFormat",void 0),H=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.ImageAuxRaster")],H);const G=H;var q=s(97768),j=s(84952),V=s(86738),W=s(75414),X=s(20223),Z=s(87045),$=s(25943),Y=s(82371);let K=class extends r.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,s,i={}){const{storageInfo:n,extent:a}=this.rasterInfo,{transposeInfo:r}=n,o=null!=r&&!!i.transposedVariableName;if(this._slices&&!o&&null==i.sliceId)return null;const l=o?0:n.maximumPyramidLevel-e+this._levelOffset,f=`${this.url}/tile/${l}/${t}/${s}`,c={...this._slices?o?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,...i.refreshParameters};let u,h;if(n.isBsqTile){const e=(i.bandIds?.length?i.bandIds:[0,1,2]).map(e=>this.request(f,{query:{...c,bandId:e},responseType:"array-buffer",signal:i.signal})),t=await Promise.all(e),s=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),n=new Uint8Array(s);h=[];let a=0;for(const{data:e}of t)h.push(a),n.set(new Uint8Array(e),a),a+=e.byteLength;u=n.buffer}else u=(await this.request(f,{query:c,responseType:"array-buffer",signal:i.signal})).data;if(!u)return null;const p=o?r.tileSize:n.tileInfo.size,d=await this.decodePixelBlock(u,{width:p[0],height:p[1],planes:h?.length,offsets:h,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const m=n.blockBoundary[e];if("jpg"!==n.compression||s>m.minCol&&s<m.maxCol&&t>m.minRow&&t<m.maxRow)return d;const{origin:g,blockWidth:y,blockHeight:x}=n,{x:w,y:I}=this.getPyramidPixelSize(e),v=Math.round((a.xmin-g.x)/w)%y,C=Math.round((a.xmax-g.x)/w)%y||y,T=Math.round((g.y-a.ymax)/I)%x,S=Math.round((g.y-a.ymin)/I)%x||x,A=s===m.minCol?v:0,R=t===m.minRow?T:0,M=s===m.maxCol?C:y,O=t===m.maxRow?S:x;return(0,b.z$)(d,{x:A,y:R},{width:M-A,height:O-R}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const s=this._slices[e].multidimensionalDefinition;if(s.length===t.length&&!s.some(e=>{const s=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!s||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){const s=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),i=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),n=await Promise.all([s,i]);return n[0]&&n[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),n[1]?.[0]?.counts?.length||(n[1]=null),{statistics:n[0]||null,histograms:n[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let s=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===s)return null;let i=0;const{maximumPyramidLevel:n}=this.rasterInfo.storageInfo;let a=n-i+this._levelOffset;const r=s.srcLocation;for(;a>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(a,s.row,s.col,t))break}catch{}if(a--,i++,s=this.identifyPixelLocation(r,i,t.datumTransformation),null===s)return null}return-1===a||null==s?null:i}async _open(e){const t=e?.signal,s=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});s.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const n=s.data;if(this.sourceJSON=n,!n)throw new i.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!n.tileInfo)throw new i.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=n.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(n.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===n.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=n.name?.slice(n.name.indexOf("/")+1)??"";const a=await this._fetchRasterInfo({signal:t});if(null==a)throw new i.A("image-server-raster:open","cannot initialize image service");(0,Y.E9)(a,n);const r="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:s,maxScale:i,minLOD:n,maxLOD:a}=t;if(null!=n&&null!=a)return Z.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=n&&e<=a)});if(0!==s&&0!==i){const t=e=>Math.round(1e4*e)/1e4,n=s?t(s):1/0,a=i?t(i):-1/0;return Z.A.fromJSON({...e,lods:e.lods.filter(e=>{const s=t(e.scale);return s<=n&&s>=a})})}return Z.A.fromJSON(e)}(n.tileInfo,n):Z.A.fromJSON(n.tileInfo);(0,q.Lw)(r);const[o,l]=this._computeMinMaxLOD(a,r),{extent:f,pixelSize:c}=a,u=.001*Math.min(c.x,c.y);(c.x!==c.y||Math.abs(o.resolution-c.x)>u)&&(c.x=c.y=o.resolution,a.width=Math.ceil((f.xmax-f.xmin)/c.x-.1),a.height=Math.ceil((f.ymax-f.ymin)/c.y-.1));const h=o.level-l.level,[p,d]=r.size,m=[],g=[],{lods:y}=r;y.forEach((e,t)=>{e.level>=l.level&&e.level<=o.level&&m.push({x:e.resolution,y:e.resolution}),t<y.length-1&&g.push(Math.round(10*e.resolution/y[t+1].resolution)/10)}),m.sort((e,t)=>e.x-t.x);const x=this.computeBlockBoundary(f,p,d,r.origin,m,h),w=m.length>1?m.slice(1):null;let I;n.transposeInfo&&(I={tileSize:[n.transposeInfo.rows,n.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});const v=g.length<=1||g.length>=3&&g.slice(0,-1).every(e=>e===g[0])?g[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/h))/10,C=!!n.bsq&&"Raster"===this.tileType;if(a.storageInfo=new X.A({blockWidth:r.size[0],blockHeight:r.size[1],pyramidBlockWidth:r.size[0],pyramidBlockHeight:r.size[1],pyramidResolutions:w,pyramidScalingFactor:v,compression:r.format,origin:r.origin,firstPyramidLevel:1,maximumPyramidLevel:h,tileInfo:r,isBsqTile:C,transposeInfo:I,blockBoundary:x}),function(e){const{extent:t,spatialReference:s}=e;t.xmin>-1&&t.xmax>181&&s?.wkid&&s.isGeographic&&(e.nativeExtent=e.extent,e.transform=new W.A,e.extent=e.transform.forwardTransform(t))}(a),this._set("rasterInfo",a),n.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:a.storageInfo.tileInfo,parsedUrl:(0,j.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new $.d({layer:e})}}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,s=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),i=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),n=f.A.fromJSON(t.spatialReference||e.spatialReference),a=new V.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:n});return new A.A({width:s,height:i,bandCount:3,extent:l.A.fromJSON(e),spatialReference:n,pixelSize:a,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const s={...e,query:{...this.ioConfig.customFetchParameters,f:"json"}},i=(0,Y.Tw)(this.url,this.sourceJSON,s),n=t.hasMultidimensions?this.request(`${this.url}/slices`,s).then(e=>e.data?.slices).catch(()=>null):null,a=await Promise.all([i,n]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){const{pixelSize:s}=e,i=.5/e.width*s.x,{lods:n}=t,a=t.lodAt(Math.max.apply(null,n.map(e=>e.level))),r=t.lodAt(Math.min.apply(null,n.map(e=>e.level))),{tileType:o}=this;if("Map"===o)return this._levelOffset=n[0].level,[a,r];if("Raster"===o)return[n.find(e=>e.resolution===s.x)??a,r];const{minScale:l,maxScale:f}=this.sourceJSON;let c=a;f>0&&(c=n.find(e=>Math.abs(e.scale-f)<i),c||(c=n.filter(e=>e.scale>f).sort((e,t)=>e.scale>t.scale?1:-1)[0]??a));let u=r;return l>0&&(u=n.find(e=>Math.abs(e.scale-l)<i)??r,this._levelOffset=u.level-r.level),[c,u]}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],K.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,a.MZ)()],K.prototype,"tileType",void 0),K=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.ImageServerRaster")],K);const Q=K;var ee=s(10713);const te=new Map;te.set("Byte","u8"),te.set("Int8","s8"),te.set("UInt8","u8"),te.set("Int16","s16"),te.set("UInt16","u16"),te.set("Int32","s32"),te.set("UInt32","u32"),te.set("Float32","f32"),te.set("Float64","f32"),te.set("Double64","f32");const se=new Map;se.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),se.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),se.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),se.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),se.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let ie=class extends r.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(e,t,s,i={}){const{blockWidth:n,blockHeight:a,blockBoundary:r}=this.rasterInfo.storageInfo,o=r[e];if(!o||o.maxRow<t||o.maxCol<s||o.minRow>t||o.minCol>s)return null;const{bandCount:l,pixelType:f}=this.rasterInfo,{ranges:c,actualTileWidth:u,actualTileHeight:p}=this._getTileLocation(e,t,s);if(!c||0===c.length)return null;if(0===c[0].from&&0===c[0].to){const e=new Uint8Array(n*a);return new h.A({width:n,height:a,pixels:void 0,mask:e,validPixelCount:0})}const{bandIds:d}=this.ioConfig,m=this._getBandSegmentCount(),g=[];let y=0;for(y=0;y<m;y++)d&&!d.includes(y)||g.push(this.request(this._files.data,{range:{from:c[y].from,to:c[y].to},responseType:"array-buffer",signal:i.signal}));const x=await Promise.all(g),w=x.map(e=>e.data.byteLength).reduce((e,t)=>e+t),I=new Uint8Array(w),v=[];let C=0;for(y=0;y<m;y++)v.push(C),I.set(new Uint8Array(x[y].data),C),C+=x[y].data.byteLength;const b=se.get(this.rasterInfo.storageInfo.compression).decoderFormat,T=await this.decodePixelBlock(I.buffer,{width:n,height:a,format:b,planes:d?.length||l,offsets:v,pixelType:f}).catch(()=>null);if(null==T)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==b&&!T.mask&&(S=S[0],null!=S)){const e=T.width*T.height,t=new Uint8Array(e);if(Math.abs(S)>1e24)for(y=0;y<e;y++)Math.abs((T.pixels[0][y]-S)/S)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)T.pixels[0][y]!==S&&(t[y]=1);T.mask=t}let A=0,R=0;if(u!==n||p!==a){let e=T.mask;if(e)for(y=0;y<a;y++)if(R=y*n,y<p)for(A=u;A<n;A++)e[R+A]=0;else for(A=0;A<n;A++)e[R+A]=0;else for(e=new Uint8Array(n*a),T.mask=e,y=0;y<p;y++)for(R=y*n,A=0;A<u;A++)e[R+A]=1}return T}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,s=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:i,files:n}=this._parseHeader(s.data),{skipMapInfo:a,skipExtensions:r=[]}=this.ioConfig;if(!r.includes("aux.xml")&&!a){const t=await this._fetchAuxiliaryData(e);null!=t&&(i.statistics=t.statistics??i.statistics,i.histograms=t.histograms,t.histograms&&null==i.statistics&&(i.statistics=(0,T.Pg)(t.histograms)))}a&&this.updateImageSpaceRasterInfo(i),this._set("rasterInfo",i),this._files=n;const o=await this.request(n.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,s,i,n,a,r;if(ee.Z){for(s=new Uint8Array(e),n=new ArrayBuffer(e.byteLength),i=new Uint8Array(n),a=0;a<e.byteLength/4;a++)for(r=0;r<4;r++)i[4*a+r]=s[4*a+3-r];t=new Uint32Array(n)}else t=new Uint32Array(e);return t}(o.data);const{blockWidth:l,blockHeight:f}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:h}=this.rasterInfo,p=[],d=this._getBandSegmentCount();let m=0,g=-1;for(;m<this._storageIndex.length;){g++;const e=Math.ceil(u/l/c**g)-1,t=Math.ceil(h/f/c**g)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return se.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,s){const{blockWidth:i,blockHeight:n,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:r,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let f,c,u,h=0,p=0;for(u=0;u<e;u++)p=a**u,f=Math.ceil(r/i/p),c=Math.ceil(o/n/p),h+=f*c;p=a**e,f=Math.ceil(r/i/p),c=Math.ceil(o/n/p),h+=t*f+s,h*=4*l;const d=this._storageIndex.subarray(h,h+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=d[4*e]*2**32+d[4*e+1],g=m+d[4*e+2]*2**32+d[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:s<f-1?i:Math.ceil(r/p)-i*(f-1),actualTileHeight:t<c-1?n:Math.ceil(o/p)-n*(c-1)}}_parseHeader(e){const t=(0,N.V6)(e,"MRF_META/Raster");if(!t)throw new i.A("mrf:open","not a valid MRF format");const s=(0,N.V6)(t,"Size"),n=parseInt(s.getAttribute("x"),10),a=parseInt(s.getAttribute("y"),10),r=parseInt(s.getAttribute("c"),10),o=((0,N.mX)(t,"Compression")||"none").toLowerCase();if(!se.has(o))throw new i.A("mrf:open","currently does not support compression "+o);const c=(0,N.mX)(t,"DataType")||"UInt8",u=te.get(c);if(null==u)throw new i.A("mrf:open","currently does not support pixel type "+c);const h=(0,N.V6)(t,"PageSize"),p=parseInt(h.getAttribute("x"),10),d=parseInt(h.getAttribute("y"),10),m=(0,N.V6)(t,"DataValues");let g,y;if(m&&(y=m.getAttribute("NoData"),null!=y&&(g=y.trim().split(" ").map(e=>parseFloat(e)))),(0,N.V6)(e,"MRF_META/CachedSource"))throw new i.A("mrf:open","currently does not support MRF referencing other data files");const x=(0,N.V6)(e,"MRF_META/GeoTags"),w=(0,N.V6)(x,"BoundingBox");let I,v=!1;if(null!=w){const e=parseFloat(w.getAttribute("minx")),t=parseFloat(w.getAttribute("miny")),s=parseFloat(w.getAttribute("maxx")),i=parseFloat(w.getAttribute("maxy")),n=(0,N.mX)(x,"Projection")||"";let a=f.A.WGS84;if("LOCAL_CS[]"!==n)if(n.toLowerCase().startsWith("epsg:")){const e=Number(n.slice(5));isNaN(e)||0===e||(a=new f.A({wkid:e}))}else a=L(n)??f.A.WGS84;else v=!0,a=new f.A({wkid:3857});I=new l.A(e,t,s,i),I.spatialReference=a}else v=!0,I=new l.A({xmin:-.5,ymin:.5-a,xmax:n-.5,ymax:.5,spatialReference:new f.A({wkid:3857})});const C=(0,N.V6)(e,"MRF_META/Rsets"),b=parseInt(C?.getAttribute("scale")||"2",10),T=I.spatialReference,S=new X.A({origin:new V.A({x:I.xmin,y:I.ymax,spatialReference:T}),blockWidth:p,blockHeight:d,pyramidBlockWidth:p,pyramidBlockHeight:d,compression:o,pyramidScalingFactor:b}),R=new V.A({x:I.width/n,y:I.height/a,spatialReference:T}),M=new A.A({width:n,height:a,extent:I,isPseudoSpatialReference:v,spatialReference:T,bandCount:r,pixelType:u,pixelSize:R,noDataValue:g,storageInfo:S}),O=(0,N.mX)(e,"datafile"),k=(0,N.mX)(e,"IndexFile");return{rasterInfo:M,files:{mrf:this.url,index:k||this.url.replace(".mrf",".idx"),data:O||this.url.replace(".mrf",se.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return U(t)}catch{return null}}};(0,n.Cg)([(0,a.MZ)()],ie.prototype,"_files",void 0),(0,n.Cg)([(0,a.MZ)()],ie.prototype,"_storageIndex",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),ie=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.MRFRaster")],ie);const ne=ie;var ae=s(53966),re=s(9334);function oe(e){const t=e.fields,s=e.records,i=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",n=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),a=n.map(e=>e.name),r=[];let o=0,l=0;return s.forEach(e=>{const t={};for(t[i]=o++,l=1;l<a.length;l++)t[a[l]]=e[l-1];r.push({attributes:t})}),{displayFieldName:"",fields:n,features:r}}class le{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),s=3&t.getUint8(0);if(3!==s)return{header:{version:s},recordSet:null};const i=t.getUint32(4,!0),n=t.getUint16(8,!0),a=t.getUint16(10,!0),r={version:s,recordCount:i,headerByteCount:n,recordByteCount:a};let o=32;const l=[],f=[];let c;if(3===s){for(;13!==t.getUint8(o);)c=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,re.w)(new Uint8Array(e,o,11)),type:c,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(c)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;f.length<i&&e.byteLength-o>a;){const s=[];32===t.getUint8(o)?(o+=1,l.forEach(t=>{if("C"===t.type)s.push((0,re.w)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)s.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)s.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const i=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();s.push(new Date(parseInt(i.slice(0,4),10),parseInt(i.slice(4,6),10)-1,parseInt(i.slice(6,8),10)))}o+=t.length}),f.push(s)):o+=a}}return{header:r,fields:l,records:f,recordSet:oe({fields:l,records:f})}}}var fe=s(87877),ce=s(94213);const ue=(e,t)=>e.get(t)?.values,he=(e,t)=>e.get(t)?.values?.[0];let pe=class extends r.A{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,s,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,s))return null;const n=await this._fetchRawTiffTile(e,t,s,!1,i);if(null!=n&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,s,!0,i);null!=a&&a.pixels[0]instanceof Uint8Array&&(n.mask=a.pixels[0])}return n}async _open(e){const t=e?e.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!s)throw new i.A("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:n,firstIFDPos:a,isBigTiff:r}=(0,fe.uT)(s),o=[],c={fileChunk:s,posIFD:a,fileOffset:0};await this._readIFDs(o,c,n,r?8:4,t);const{imageInfo:u,rasterInfo:h}=function(e){const t=(0,fe.uc)(e),{width:s,height:i,tileWidth:n,tileHeight:a,planes:r,pixelType:o,compression:c,firstPyramidLevel:u,maximumPyramidLevel:h,pyramidBlockWidth:p,pyramidBlockHeight:d,pyramidResolutions:m,tileBoundary:g,affine:y,metadata:x}=t;let w=L(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),I=!!t.isPseudoGeographic;null==w&&(I=!0,w=new f.A({wkid:3857}));const v=new l.A({...t.extent,spatialReference:w}),C=new V.A(v?{x:v.xmin,y:v.ymax,spatialReference:w}:{x:0,y:0}),b=new X.A({blockWidth:n,blockHeight:a,pyramidBlockWidth:p,pyramidBlockHeight:d,compression:c,origin:C,firstPyramidLevel:u,maximumPyramidLevel:h,pyramidResolutions:m,blockBoundary:g}),T=new V.A({x:(v.xmax-v.xmin)/s,y:(v.ymax-v.ymin)/i,spatialReference:w}),S=x?{BandProperties:x.bandProperties,DataType:x.dataType}:{};let R=null;const M=he(e[0],"PHOTOMETRICINTERPRETATION"),O=ue(e[0],"COLORMAP");if(M<=3&&O?.length>3&&O.length%3==0){R=[];const e=O.length/3;for(let t=0;t<e;t++)R.push([t,O[t]>>>8,O[t+e]>>>8,O[t+2*e]>>>8])}const k=new A.A({width:s,height:i,bandCount:r,pixelType:o,pixelSize:T,storageInfo:b,spatialReference:w,isPseudoSpatialReference:I,keyProperties:S,extent:v,colormap:R,statistics:x?x.statistics:null});if(y?.length&&(k.nativeExtent=new l.A({xmin:-.5,ymin:.5-i,xmax:s-.5,ymax:.5,spatialReference:w}),k.transform=new D.A({polynomialOrder:1,forwardCoefficients:[y[2]+y[0]/2,y[5]-y[3]/2,y[0],y[3],-y[1],-y[4]]}),k.extent=k.transform.forwardTransform(k.nativeExtent),k.pixelSize=new V.A({x:(v.xmax-v.xmin)/s,y:(v.ymax-v.ymin)/i,spatialReference:w}),b.origin.x=-.5,b.origin.y=.5),m){const{x:e,y:t}=k.pixelSize;m.forEach(s=>{s.x*=e,s.y*=t})}return{imageInfo:t,rasterInfo:k}}(o),p=(0,fe.zS)(o),d=(0,fe.r9)(o);if(this._headerInfo={littleEndian:n,isBigTiff:r,ifds:o,pyramidIFDs:p,maskIFDs:d,...u},this._set("rasterInfo",h),!u.isSupported)throw new i.A("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new i.A("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");h.isPseudoSpatialReference&&ae.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const m=o[0].get("PREDICTOR")?.values?.[0],g=o[0].get("SAMPLEFORMAT")?.values?.[0];if(3===g&&2===m)throw new i.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:y,skipExtensions:x=[]}=this.ioConfig;if(!x.includes("aux.xml")&&!y){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,T.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const s=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new V.A({x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=s}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(t,h)}x.includes("vat.dbf")||1!==h.bandCount||"u8"!==h.pixelType||y||(h.attributeTable=await this._fetchAuxiliaryTable(e),null!=h.attributeTable&&(h.keyProperties.DataType="thematic")),y&&this.updateImageSpaceRasterInfo(h),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:s,fileOffset:i,posIFD:n}=e;return(n+8>=s.byteLength||n<0)&&(i=n+i,s=(await this.request(this.url,{range:{from:i,to:i+this._bufferSize},responseType:"array-buffer",signal:t})).data,n=0),{fileChunk:s,fileOffset:i,posIFD:n}}async _readIFDs(e,t,s,n=4,a){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,a);const r=await this._readIFD(t,s,ce.NB,n,a);if(!r?.ifd)throw new i.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(r.ifd),!r.nextIFD)return null;t.posIFD=r.nextIFD-t.fileOffset,await this._readIFDs(e,t,s,n,a)}async _readIFD(e,t,s=ce.NB,i=4,n){let{fileChunk:a,posIFD:r,fileOffset:o}=e;if(!e.fileChunk)return null;const l=(0,fe.JM)(a,t,r,o,s,i);if(l.success){const e=[];if(l.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,l.nextIFD,n),l.ifd?.has("GEOKEYDIRECTORY")){const e=l.ifd.get("GEOKEYDIRECTORY"),s=e?.values;if(s&&s.length>4){const i=s[0]+"."+s[1]+"."+s[2];r=e.valueOffset+6-o;const l=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:r,fileOffset:o},n),f=await this._readIFD(l,t,ce.YC,2,n);e.data=f?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[i]})}}return l}return l.requiredBufferSize?(a=(await this.request(this.url,{range:{from:o,to:o+r+l.requiredBufferSize+8},responseType:"array-buffer",signal:n})).data,a.byteLength<r+l.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,s,i,n))):null}async _fillOffsets(e,t,s,i){const n=e.filter(e=>null!=e.offlineOffsetSize);if(0===n.length)return;const a=n.map(e=>e.offlineOffsetSize),r=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let l=1===a.length||o-r<=this._bufferSize;if(!l&&a.length>1&&(a.sort((e,t)=>e[0]-t[0]),l=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o),l){const e=await this._fetchOffsets(r,Math.max(o,r+this._bufferSize),i);return void n.forEach(s=>(0,fe.Cr)(e,t,s,r))}const f=n.map(async e=>{const s=e.offlineOffsetSize,n=await this._fetchOffsets(s[0],s[1]+s[0],i);(0,fe.Cr)(n,t,e,s[0])});await Promise.all(f)}async _fetchOffsets(e,t,s){const i=[],n=this._chunkSize,a=Math.ceil((t-e)/n);let r=e;for(let e=0;e<a;e++)i.push(this.request(this.url,{range:{from:r,to:e===a-1?t:r+n-1},responseType:"array-buffer",signal:s})),r+=n;const o=await Promise.all(i);if(1===a)return o[0].data;const l=new Uint8Array(t-e+1);for(let e=0;e<a;e++)l.set(new Uint8Array(o[e].data),e*n);return l.buffer}async _fetchRawTiffTile(e,t,s,i,n={}){const a=this._getTileLocation(e,t,s,i);if(!a)return null;const{ranges:r,actualTileWidth:o,actualTileHeight:l,ifd:f}=a,c=r.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:n.signal})),u=await Promise.all(c),h=u.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===u.length?u[0].data:new ArrayBuffer(h),d=[0],m=[0];if(u.length>1){const e=new Uint8Array(p);for(let t=0,s=0;t<u.length;t++){const i=u[t].data;e.set(new Uint8Array(i),s),d[t]=s,s+=i.byteLength,m[t]=i.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:f,offsets:d,sizes:m},width:g,height:y,planes:null,pixelType:null});if(null==x)return null;if(o!==g||l!==y){let e=x.mask;if(e)for(let t=0;t<y;t++){const s=t*g;if(t<l)for(let t=o;t<g;t++)e[s+t]=0;else for(let t=0;t<g;t++)e[s+t]=0}else{e=new Uint8Array(g*y),x.mask=e;for(let t=0;t<l;t++){const s=t*g;for(let t=0;t<o;t++)e[s+t]=1}}}return x}_getTileLocation(e,t,s,i=!1){const{firstPyramidLevel:n,blockBoundary:a}=this.rasterInfo.storageInfo,r=0===e?0:e-(n-1),{_headerInfo:o}=this;if(!o)return null;const l=i?o.maskIFDs[r]:0===r?o?.ifds[0]:o?.pyramidIFDs[r-1];if(!l)return null;const f=(0,fe.XO)(l,o),c=ue(l,"TILEOFFSETS");if(void 0===c)return null;const u=ue(l,"TILEBYTECOUNTS"),{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[r];if(t>d||s>m||t<h||s<p)return null;const g=he(l,"IMAGEWIDTH"),y=he(l,"IMAGELENGTH"),x=he(l,"TILEWIDTH"),w=he(l,"TILELENGTH"),I=[];if(f){const{bandCount:e}=this.rasterInfo;for(let i=0;i<e;i++){const e=i*(d+1)*(m+1)+t*(m+1)+s;I[i]={from:c[e],to:c[e]+u[e]-1}}}else{const e=t*(m+1)+s;I.push({from:c[e],to:c[e]+u[e]-1})}for(let e=0;e<I.length;e++)if(null==I[e].from||!I[e].to||I[e].to<0)return null;return{ranges:I,ifd:l,actualTileWidth:s===m&&g%x||x,actualTileHeight:t===d&&y%w||w}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return U(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),s=le.parse(t);return s?.recordSet?O.A.fromJSON(s.recordSet):null}catch{return null}}};(0,n.Cg)([(0,a.MZ)()],pe.prototype,"_files",void 0),(0,n.Cg)([(0,a.MZ)()],pe.prototype,"_headerInfo",void 0),(0,n.Cg)([(0,a.MZ)()],pe.prototype,"_bufferSize",void 0),(0,n.Cg)([(0,a.MZ)()],pe.prototype,"_chunkSize",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],pe.prototype,"datasetFormat",void 0),pe=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.TIFFRaster")],pe);const de=pe,me=new Map;me.set("MRF",{desc:"Meta Raster Format",constructor:ne}),me.set("TIFF",{desc:"GeoTIFF",constructor:de}),me.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Q}),me.set("JPG",{desc:"JPG Raster Format",constructor:G}),me.set("PNG",{desc:"PNG Raster Format",constructor:G}),me.set("GIF",{desc:"GIF Raster Format",constructor:G}),me.set("BMP",{desc:"BMP Raster Format",constructor:G}),me.set("CovJSON",{desc:"COVJSON Raster Format",constructor:_}),me.set("MEMORY",{desc:"In Memory Raster Format",constructor:M});class ge{static get supportedFormats(){const e=new Set;return me.forEach((t,s)=>e.add(s)),e}static async open(e){const{url:t,ioConfig:s,source:n,sourceJSON:a}=e;let r=e.datasetFormat??s?.datasetFormat;null==r&&(t.includes(".")?r=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===n?.type?.toLowerCase()?r="CovJSON":n?.extent&&n.pixelblocks&&(r="MEMORY")),"OVR"===r||"TIF"===r?r="TIFF":"JPG"===r||"JPEG"===r||"JFIF"===r?r="JPG":"COVJSON"===r&&(r="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(r="RasterTileServer");const o={url:t,source:n,sourceJSON:a,datasetFormat:r,ioConfig:s??{bandIds:null,sampling:null}};if(Object.keys(o).forEach(e=>{null==o[e]&&delete o[e]}),r){if(!this.supportedFormats.has(r))throw new i.A("rasterfactory:open","not a supported format "+r);if("CRF"===r)throw new i.A("rasterfactory:open",`cannot open raster: ${t}`);const s=new(0,me.get(r).constructor)(o);return await s.open({signal:e.signal}),s}const l=Array.from(me.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e);let f=0;const c=()=>{if(r=l[f++],!r)return null;if("CRF"===r)return null;const t=new(0,me.get(r).constructor)(o);return t.open({signal:e.signal}).then(()=>t).catch(()=>c())};return c()}static register(e,t,s){me.has(e.toUpperCase())||me.set(e.toUpperCase(),{desc:t,constructor:s})}}},10333(e,t,s){s.d(t,{A:()=>r});var i=s(5482),n=s(25482),a=s(91429);let r=class extends n.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,i.Cg)([(0,a.MZ)()],r.prototype,"affectsPixelSize",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],r.prototype,"spatialReference",void 0),r=(0,i.Cg)([(0,a.$K)("esri.layers.raster.transforms.BaseRasterTransform")],r)},75414(e,t,s){s.d(t,{A:()=>l});var i,n=s(5482),a=s(91429),r=s(10333),o=s(93223);let l=i=class extends r.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new i({tolerance:this.tolerance})}};(0,n.Cg)([(0,o.e)({GCSShiftXform:"gcs-shift"})],l.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)()],l.prototype,"tolerance",void 0),l=i=(0,n.Cg)([(0,a.$K)("esri.layers.raster.transforms.GCSShiftTransform")],l)},43163(e,t,s){s.d(t,{A:()=>d});var i,n=s(5482),a=s(91429),r=s(5443),o=s(86738),l=s(10333),f=s(36005),c=s(43937),u=s(93223);function h(e,t,s){const{x:i,y:n}=t;if(s<2)return{x:e[0]+i*e[2]+n*e[4],y:e[1]+i*e[3]+n*e[5]};if(2===s){const t=i*i,s=n*n,a=i*n;return{x:e[0]+i*e[2]+n*e[4]+t*e[6]+a*e[8]+s*e[10],y:e[1]+i*e[3]+n*e[5]+t*e[7]+a*e[9]+s*e[11]}}const a=i*i,r=n*n,o=i*n,l=a*i,f=a*n,c=i*r,u=n*r;return{x:e[0]+i*e[2]+n*e[4]+a*e[6]+o*e[8]+r*e[10]+l*e[12]+f*e[14]+c*e[16]+u*e[18],y:e[1]+i*e[3]+n*e[5]+a*e[7]+o*e[9]+r*e[11]+l*e[13]+f*e[15]+c*e[17]+u*e[19]}}function p(e,t,s){const{xmin:i,ymin:n,xmax:a,ymax:o,spatialReference:l}=t;let f=[];if(s<2)f.push({x:i,y:o}),f.push({x:a,y:o}),f.push({x:i,y:n}),f.push({x:a,y:n});else{let e=10;for(let t=0;t<e;t++)f.push({x:i,y:n+(o-n)*t/(e-1)}),f.push({x:a,y:n+(o-n)*t/(e-1)});e=8;for(let t=1;t<=e;t++)f.push({x:i+(a-i)*t/e,y:n}),f.push({x:i+(a-i)*t/e,y:o})}f=f.map(t=>h(e,t,s));const c=f.map(e=>e.x),u=f.map(e=>e.y);return new r.A({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,u),ymax:Math.max.apply(null,u),spatialReference:l})}let d=i=class extends l.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){const{coeffX:s,coeffY:i}=t;if(!s?.length||!i?.length||s.length!==i.length)return null;const n=[];for(let e=0;e<s.length;e++)n.push(s[e]),n.push(i[e]);return n}writeForwardCoefficients(e,t,s){const i=[],n=[];for(let t=0;t<e?.length;t++)t%2==0?i.push(e[t]):n.push(e[t]);t.coeffX=i,t.coeffY=n}get inverseCoefficients(){let e=this._get("inverseCoefficients");const t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){const[t,s,i,n,a,r]=e,o=i*r-a*n,l=a*n-i*r;return[(a*s-t*r)/o,(i*s-t*n)/l,r/o,n/l,-a/o,-i/l]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){const{inverseCoeffX:s,inverseCoeffY:i}=t;if(!s?.length||!i?.length||s.length!==i.length)return null;const n=[];for(let e=0;e<s.length;e++)n.push(s[e]),n.push(i[e]);return n}writeInverseCoefficients(e,t,s){const i=[],n=[];for(let t=0;t<e?.length;t++)t%2==0?i.push(e[t]):n.push(e[t]);t.inverseCoeffX=i,t.inverseCoeffY=n}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){const t=h(this.forwardCoefficients,e,this.polynomialOrder);return new o.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){const t=h(this.inverseCoefficients,e,this.polynomialOrder);return new o.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new i({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,n.Cg)([(0,a.MZ)({json:{write:!0}})],d.prototype,"polynomialOrder",void 0),(0,n.Cg)([(0,a.MZ)()],d.prototype,"forwardCoefficients",void 0),(0,n.Cg)([(0,f.w)("forwardCoefficients",["coeffX","coeffY"])],d.prototype,"readForwardCoefficients",null),(0,n.Cg)([(0,c.K)("forwardCoefficients")],d.prototype,"writeForwardCoefficients",null),(0,n.Cg)([(0,a.MZ)({json:{write:!0}})],d.prototype,"inverseCoefficients",null),(0,n.Cg)([(0,f.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],d.prototype,"readInverseCoefficients",null),(0,n.Cg)([(0,c.K)("inverseCoefficients")],d.prototype,"writeInverseCoefficients",null),(0,n.Cg)([(0,a.MZ)()],d.prototype,"affectsPixelSize",null),(0,n.Cg)([(0,u.e)({PolynomialXform:"polynomial"})],d.prototype,"type",void 0),d=i=(0,n.Cg)([(0,a.$K)("esri.layers.raster.transforms.PolynomialTransform")],d)}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1003],{1003(e,t,s){s.r(t),s.d(t,{default:()=>ge});var i=s(49186),n=s(5482),a=s(91429),r=s(49859),o=s(68197),l=s(5443),f=s(16930),c=s(73444),u=s(94778),h=s(14140);function p(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function d(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function m(e){const{axes:t}=e.domain,s=Object.keys(t),i=[],n=[];let a=-1,r=-1,o=[];for(let e=0;e<s.length;e++){const l=s[e];p(l)?a=e:d(l)&&(r=e);const f=t[l],c=[];if("values"in f){f.values.forEach(e=>c.push("string"==typeof e?new Date(e).getTime():e));const e=c[1]-c[0];i.push([c[0]-.5*e,c[c.length-1]+.5*e]),n.push(e)}else{const{start:e,stop:t,num:s}=f,a=(t-e)/(s-1);i.push([e-.5*a,t+.5*a]),n.push(a);for(let t=0;t<s;t++)c.push(e+a*t)}o.push({name:l,values:c,extent:[c[0],c[c.length-1]]})}a>-1&&-1===r?r=0===a?1:0:r>-1&&-1===a?a=0===r?1:0:-1===r&&-1===a&&(a=0,r=1),o=o.filter((e,t)=>!(t===a||t===r));const{referencing:c}=e.domain,u=c.find(e=>e.coordinates.includes(s[a])).system.id,h=u?.slice(u.lastIndexOf("/")+1),m=null==h||"CRS84"===h?4326:Number(h),g=new f.A({wkid:m}),[y,x]=i[a],[w,I]=i[r],v=new l.A({xmin:y,xmax:x,ymin:w,ymax:I,spatialReference:g});return{width:Math.round(v.width/n[a]),height:Math.round(v.height/n[r]),extent:v,dimensions:o}}function g(e){const t=(0,c.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function y(){return Math.round(255*Math.random())}function x(e){const t={},{parameters:s}=e;if(!s)return t;for(const[e,i]of Object.entries(s)){const{type:s,description:n,unit:a,categoryEncoding:r,observedProperty:l}=i;if("Parameter"===s&&(t[e]={},n&&(t[e].description=g(n)),a&&(t[e].unit=a.label?g(a.label):null,t[e].symbol=a.symbol?.value),r)){const s=Object.entries(r).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1}));let i=!1;l?.categories?.length&&(l.categories.forEach(e=>{if(!e.id)return;const t=e.id.slice(e.id.lastIndexOf("/")+1),n=s.find(e=>e.ClassName===t);if(!n)return;const a=e.label?g(e.label):null;if(n.Label=a,e.preferredColor){const t=o.A.fromHex(e.preferredColor);t&&(i=!0,n.Red=t.r,n.Green=t.g,n.Blue=t.b)}}),i&&s.forEach(e=>{null==e.Red&&(e.Red=y(),e.Green=y(),e.Blue=y())}));const n={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:s.map(e=>({attributes:e}))};i&&n.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=n}}return t}function w(e){let t=Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let i=0;i<e.length;i++){const n=e[i];null!=n&&(n<t&&(t=n),n>s&&(s=n))}return(0,u.X1)(t,s)}function I(e,t,s){const i=e.map((e,s)=>({name:e,count:t[s]})).sort((e,t)=>e.name>t.name?-1:1),n=(a=1,e=>a*=e.count);var a;const r=[...i.slice(1),{name:"",count:1}].reverse().map(n).reverse();let o=0;for(let n=e.length-1;n>=0;n--)o+=r[i.findIndex(({name:t})=>t===e[n])]*(s%t[n]),s=Math.floor(s/t[n]);return o}var v=s(74887),C=s(4366),b=s(47520),T=s(51927),S=s(45617),A=s(87186);let R=class extends r.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(e,t,s,i={}){if(!this._pixelBlockTiles){const{rasterInfo:n}=this,[a,r]=n.storageInfo.tileInfo.size,{sliceId:o}=i,{pixelBlocks:l}=this.source,f={pixelBlock:null==o?l[0]:l[o],useBilinear:"thematic"!==n.dataType,tileSize:{width:a,height:r},level:e,row:t,col:s},c=this.rasterJobHandler?this.rasterJobHandler.clipTile(f,i):(0,b.J$)(f);return Promise.resolve(c)}const n=this._pixelBlockTiles.get(`${e}/${t}/${s}`);return Promise.resolve(n)}async _open(e){const t=this.source,{pixelBlocks:s,attributeTable:i,statistics:n,histograms:a,name:r,nativeExtent:o,transform:c,colormap:u}=t,h=s[0],{width:p,height:d,pixelType:m}=h,g=t.extent??new l.A({xmin:-.5,ymin:.5,xmax:p-.5,ymax:d-.5,spatialReference:new f.A({wkid:3857})}),y=t.isPseudoSpatialReference??!t.extent,x={x:g.width/p,y:g.height/d},w={...t.keyProperties};t.dataType&&(w.DataType=t.dataType),t.bandInfos&&(w.BandProperties=t.bandInfos.map(e=>e.toJSON())),i&&(w.DataType="Thematic");const I=new A.A({width:p,height:d,pixelType:m,extent:g,nativeExtent:o,attributeTable:i,colormap:u,transform:c,pixelSize:x,spatialReference:g.spatialReference,bandCount:h.pixels.length,keyProperties:w,multidimensionalInfo:t.multidimensionalInfo,statistics:n,isPseudoSpatialReference:y,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(I),this.createRemoteDatasetStorageInfo(I,512,512),this._set("rasterInfo",I),this.updateTileInfo(),I.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,I.multidimensionalInfo):await this._buildInMemoryRaster(h,{width:512,height:512},e),I.multidimensionalInfo||(this.source=null),this.datasetName=r}async _buildInMemoryRaster(e,t,s){const{rasterInfo:n}=this,a=n.storageInfo.maximumPyramidLevel??0,r="thematic"!==n.dataType,o=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:a,useBilinear:r},s):Promise.resolve((0,b.lD)(e,t,a,r)),l=null!=n.statistics,f=null!=n.histograms,c=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},s):Promise.resolve((0,T.f4)(e)),u=await(0,v.Lx)([o,c]);if(!u[0].value&&u[1].value)throw new i.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,l||(n.statistics=u[1].value?.statistics),f||(n.histograms=u[1].value?.histograms)}async _buildMDimStats(e,t,s){for(let i=0;i<t.variables.length;i++){const n=t.variables[i];if(n.statistics)continue;const a=n.dimensions.map(e=>new S.A({variableName:n.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),r=(0,C.NG)(a,t),o=null==r?null:e[r];if(null==o)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},s):(0,T.eH)(o);n.statistics=l.statistics,n.histograms||(n.histograms=l.histograms)}}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],R.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,a.MZ)()],R.prototype,"source",void 0),(0,n.Cg)([(0,a.MZ)()],R.prototype,"url",null),R=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.InMemoryRaster")],R);const M=R;var O=s(22671);let k=class extends r.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,s,i={}){return this._inMemoryRaster.fetchRawTile(e,t,s,i)}async _open(e){const{extent:t,pixelBlocks:s,multidimensionalInfo:i,attributeTable:n,bandNames:a}=await this._fetchData(e),{statistics:r,histograms:o}=(0,T.eH)(s[0]),l=a?.map(e=>({BandName:e})),f={DataType:n?"Thematic":i?"Scientific":"Generic",BandProperties:l},c=new M({source:{extent:t,pixelBlocks:s,attributeTable:n?O.A.fromJSON(n):null,multidimensionalInfo:i,statistics:r,histograms:o,keyProperties:f,isPseudoSpatialReference:!1}});await c.open(),this._inMemoryRaster=c;const u=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",u.slice(0,u.indexOf("."))),this._set("rasterInfo",c.rasterInfo)}async _fetchData(e){const t=this.source??(await this.request(this.url,{signal:e?.signal})).data,s="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new i.A(s,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new i.A(s,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new i.A(s,"Missing domain referencing in the grid coverage data");const n=Object.values(t.ranges);for(let e=0;e<n.length;e++){const{axisNames:t,shape:a,type:r,values:o}=n[e];if(!("ndarray"===r.toLowerCase()&&o?.length&&t?.length&&a?.length))throw new i.A(s,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!p(t[t.length-1])||!d(t[t.length-2]))throw new i.A(s,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){const{width:t,height:s,extent:i,dimensions:n}=m(e),{ranges:a}=e,r=Object.keys(a).sort((e,t)=>e<t?-1:1),o=[];for(let e=0;e<r.length;e++){const t=r[e];n?.length&&o.push({name:t,dimensions:n})}const l=x(e);o.forEach(e=>l[e.name]&&Object.assign(e,l[e.name]));const f=o.length?{variables:o}:void 0,c=[];for(let e=0;e<r.length;e++){const i=r[e],{values:o,dataType:l,axisNames:f,shape:u}=a[i],p=u.length>2?e*u.slice(0,-2).reduce((e,t)=>e*t):0,d=f.slice(0,-2),m=u.slice(0,-2),g="float"===l?"f32":w(o),y=t*s,x=o.length/y;for(let i=0;i<x;i++){const a=h.A.createEmptyBand(g,y),r=new Uint8Array(y).fill(255);let l=!1;const f=i*y;for(let e=0;e<y;e++){const t=o[f+e];null==t?(r[e]=0,l=!0):a[e]=t}if(0===e||n?.length){const e=new h.A({width:t,height:s,mask:l?r:null,pixels:[a],pixelType:g});e.updateStatistics(),n?.length?c[I(d,m,i)+p]=e:c.push(e)}else{const e=c[i];e.pixels.push(a),l?e.mask&&(e.mask=h.A.combineBandMasks([e.mask,r])):e.mask=l?r:null}}}const u=Object.values(l).find(e=>e.attributeTable)?.attributeTable;return{extent:i,pixelBlocks:c,multidimensionalInfo:f,attributeTable:u,bandNames:f?void 0:r}}(t)}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],k.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,a.MZ)({constructOnly:!0})],k.prototype,"source",void 0),k=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.CovJSONRaster")],k);const _=k;var F=s(44208),P=s(4576),B=s(21325),N=s(330),D=s(43163);function E(e,t){if(!e||!t)return null;const s=[];for(let i=0;i<e.length;i++)s.push(e[i]),s.push(t[i]);return s}function L(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new f.A({wkid:t});if(e=String(e).trim(),(0,B.jp)(e))return new f.A({wkt2:e});const s=e.toUpperCase();if(s.startsWith("COMPD_CS")){if(!s.includes("VERTCS")||!s.includes("GEOGCS")&&!s.startsWith("PROJCS"))return null;const i=s.indexOf("VERTCS"),n=s.indexOf("PROJCS"),a=n>-1?n:s.indexOf("GEOGCS");if(-1===a)return null;const r=e.slice(a,e.lastIndexOf("]",i)+1).trim(),o=e.slice(i,e.lastIndexOf("]")).trim();t=z(r);const l=new f.A(t?{wkid:t}:{wkt:r}),c=z(o);return c&&(l.vcsWkid=c),l}return s.startsWith("GEOGCS")||s.startsWith("PROJCS")?(t=z(e),new f.A(0!==t?{wkid:t}:{wkt:e})):null}function z(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),s=t[t.length-1].split(","),i=s[0]?.toLowerCase();if(("epsg"===i||"esri"===i)&&e.endsWith('"]]')){const e=Number(s[1]);if(!isNaN(e)&&0!==e)return e}return 0}function U(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((0,N.g7)(e,"SRS")){if(!t.spatialReference){const s=(0,N.mX)(e);t.spatialReference=L(s)}}else if((0,N.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:s,transform:i}=function(e){const t=(0,N.V6)(e,"GeodataXform"),s=L((0,N.v7)(t,"SpatialReference/WKID")||(0,N.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:s,transform:null};const i=(0,N.v7)(t,"PolynomialOrder")??1,n=(0,N.Ui)(t,"CoeffX/Double"),a=(0,N.Ui)(t,"CoeffY/Double"),r=(0,N.Ui)(t,"InverseCoeffX/Double"),o=(0,N.Ui)(t,"InverseCoeffY/Double"),l=E(n,a),f=E(r,o);return{spatialReference:s,transform:l&&f&&l.length&&f.length?new D.A({spatialReference:s,polynomialOrder:i,forwardCoefficients:l,inverseCoefficients:f}):null}}(e);t.transform=i,t.spatialReference||(t.spatialReference=s)}else(0,N.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,N.mX)(e));else if((0,N.g7)(e,"PAMRasterBand")){const s=function(e){const t=(0,N.v7)(e,"NoDataValue"),s=(0,N.V6)(e,"Histograms/HistItem"),i=(0,N.v7)(s,"HistMin"),n=(0,N.v7)(s,"HistMax"),a=(0,N.v7)(s,"BucketCount"),r=(0,N.mX)(s,"HistCounts")?.split("|").map(e=>Number(e));let o,l,f,c;(0,N.IC)(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":f=t;break;case"STATISTICS_STDDEV":c=t}});const u=(0,N.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:r?.length&&null!=i&&null!=n?{min:i,max:n,size:a||r.length,counts:r}:null,sourceBandIndex:u,statistics:null!=o&&null!=l?{min:o,max:l,avg:f,stddev:c}:null}}(e);null!=s.sourceBandIndex&&null==t.rasterBands[s.sourceBandIndex]?t.rasterBands[s.sourceBandIndex]=s:t.rasterBands.push(s)}});const s=t.rasterBands;if(s.length){const e=!!s[0].statistics;t.statistics=e?s.map(e=>e.statistics).filter(P.Ru):null;const i=!!s[0].histogram;t.histograms=i?s.map(e=>e.histogram).filter(P.Ru):null}return t}var J=s(20758);let H=class extends r.A{fetchRawTile(e,t,s,i={}){return this._inMemoryRaster.fetchRawTile(e,t,s,i)}async _open(e){const t=await this._fetchData(e);let{spatialReference:s,statistics:i,histograms:n,transform:a}=await this._fetchAuxiliaryData(e);const r=!s;r&&(s=new f.A({wkid:3857})),n?.length&&null==i&&(i=(0,T.Pg)(n));const{width:o,height:c}=t;let u=new l.A({xmin:-.5,ymin:.5-c,xmax:o-.5,ymax:.5,spatialReference:s});const h=a?a.forwardTransform(u):u;let p=!0;if(a){const e=a.forwardCoefficients;p=e&&0===e[1]&&0===e[2],p&&(a=null,u=h)}const d=new M({source:{extent:h,nativeExtent:u,transform:a,pixelBlocks:[t],statistics:i,histograms:n,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:r},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(d.ioConfig.skipMapInfo=!0),await d.open(),d.source=null,this._set("rasterInfo",d.rasterInfo),this._inMemoryRaster=d}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),s=(0,J.g)(t).toUpperCase();if("JPG"!==s&&"PNG"!==s&&"GIF"!==s&&"BMP"!==s)throw new i.A("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",s);const n=s.toLowerCase(),a="gif"===n||"bmp"===n||!(0,F.A)("ios"),r=await this.decodePixelBlock(t,{format:n,useCanvas:a,hasNoZlibMask:!0});if(null==r)throw new i.A("image-aux-raster:open","the data cannot be decoded");return r}async _fetchAuxiliaryData(e){const t=e?.signal,{skipExtensions:s=[],skipMapInfo:i}=this.ioConfig,n=i||s.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),a=this.datasetFormat,r="JPG"===a?"jgw":"PNG"===a?"pgw":"BMP"===a?"bpw":null,o=r&&s.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:t}),l=await(0,v.Lx)([n,o]);if(t?.aborted)throw(0,v.NK)();const f=U(l[0].value?.data);if(!f.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;f.transform=6===e?.length?new D.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return f}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],H.prototype,"datasetFormat",void 0),H=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.ImageAuxRaster")],H);const G=H;var q=s(97768),j=s(84952),V=s(86738),W=s(75414),X=s(20223),Z=s(87045),$=s(25943),Y=s(82371);let K=class extends r.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,s,i={}){const{storageInfo:n,extent:a}=this.rasterInfo,{transposeInfo:r}=n,o=null!=r&&!!i.transposedVariableName;if(this._slices&&!o&&null==i.sliceId)return null;const l=o?0:n.maximumPyramidLevel-e+this._levelOffset,f=`${this.url}/tile/${l}/${t}/${s}`,c={...this._slices?o?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,...i.refreshParameters};let u,h;if(n.isBsqTile){const e=(i.bandIds?.length?i.bandIds:[0,1,2]).map(e=>this.request(f,{query:{...c,bandId:e},responseType:"array-buffer",signal:i.signal})),t=await Promise.all(e),s=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),n=new Uint8Array(s);h=[];let a=0;for(const{data:e}of t)h.push(a),n.set(new Uint8Array(e),a),a+=e.byteLength;u=n.buffer}else u=(await this.request(f,{query:c,responseType:"array-buffer",signal:i.signal})).data;if(!u)return null;const p=o?r.tileSize:n.tileInfo.size,d=await this.decodePixelBlock(u,{width:p[0],height:p[1],planes:h?.length,offsets:h,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const m=n.blockBoundary[e];if("jpg"!==n.compression||s>m.minCol&&s<m.maxCol&&t>m.minRow&&t<m.maxRow)return d;const{origin:g,blockWidth:y,blockHeight:x}=n,{x:w,y:I}=this.getPyramidPixelSize(e),v=Math.round((a.xmin-g.x)/w)%y,C=Math.round((a.xmax-g.x)/w)%y||y,T=Math.round((g.y-a.ymax)/I)%x,S=Math.round((g.y-a.ymin)/I)%x||x,A=s===m.minCol?v:0,R=t===m.minRow?T:0,M=s===m.maxCol?C:y,O=t===m.maxRow?S:x;return(0,b.z$)(d,{x:A,y:R},{width:M-A,height:O-R}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const s=this._slices[e].multidimensionalDefinition;if(s.length===t.length&&!s.some(e=>{const s=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!s||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){const s=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),i=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),n=await Promise.all([s,i]);return n[0]&&n[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),n[1]?.[0]?.counts?.length||(n[1]=null),{statistics:n[0]||null,histograms:n[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let s=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===s)return null;let i=0;const{maximumPyramidLevel:n}=this.rasterInfo.storageInfo;let a=n-i+this._levelOffset;const r=s.srcLocation;for(;a>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(a,s.row,s.col,t))break}catch{}if(a--,i++,s=this.identifyPixelLocation(r,i,t.datumTransformation),null===s)return null}return-1===a||null==s?null:i}async _open(e){const t=e?.signal,s=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});s.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const n=s.data;if(this.sourceJSON=n,!n)throw new i.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!n.tileInfo)throw new i.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=n.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(n.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===n.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=n.name?.slice(n.name.indexOf("/")+1)??"";const a=await this._fetchRasterInfo({signal:t});if(null==a)throw new i.A("image-server-raster:open","cannot initialize image service");(0,Y.E9)(a,n);const r="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:s,maxScale:i,minLOD:n,maxLOD:a}=t;if(null!=n&&null!=a)return Z.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=n&&e<=a)});if(0!==s&&0!==i){const t=e=>Math.round(1e4*e)/1e4,n=s?t(s):1/0,a=i?t(i):-1/0;return Z.A.fromJSON({...e,lods:e.lods.filter(e=>{const s=t(e.scale);return s<=n&&s>=a})})}return Z.A.fromJSON(e)}(n.tileInfo,n):Z.A.fromJSON(n.tileInfo);(0,q.Lw)(r);const[o,l]=this._computeMinMaxLOD(a,r),{extent:f,pixelSize:c}=a,u=.001*Math.min(c.x,c.y);(c.x!==c.y||Math.abs(o.resolution-c.x)>u)&&(c.x=c.y=o.resolution,a.width=Math.ceil((f.xmax-f.xmin)/c.x-.1),a.height=Math.ceil((f.ymax-f.ymin)/c.y-.1));const h=o.level-l.level,[p,d]=r.size,m=[],g=[],{lods:y}=r;y.forEach((e,t)=>{e.level>=l.level&&e.level<=o.level&&m.push({x:e.resolution,y:e.resolution}),t<y.length-1&&g.push(Math.round(10*e.resolution/y[t+1].resolution)/10)}),m.sort((e,t)=>e.x-t.x);const x=this.computeBlockBoundary(f,p,d,r.origin,m,h),w=m.length>1?m.slice(1):null;let I;n.transposeInfo&&(I={tileSize:[n.transposeInfo.rows,n.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});const v=g.length<=1||g.length>=3&&g.slice(0,-1).every(e=>e===g[0])?g[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/h))/10,C=!!n.bsq&&"Raster"===this.tileType;if(a.storageInfo=new X.A({blockWidth:r.size[0],blockHeight:r.size[1],pyramidBlockWidth:r.size[0],pyramidBlockHeight:r.size[1],pyramidResolutions:w,pyramidScalingFactor:v,compression:r.format,origin:r.origin,firstPyramidLevel:1,maximumPyramidLevel:h,tileInfo:r,isBsqTile:C,transposeInfo:I,blockBoundary:x}),function(e){const{extent:t,spatialReference:s}=e;t.xmin>-1&&t.xmax>181&&s?.wkid&&s.isGeographic&&(e.nativeExtent=e.extent,e.transform=new W.A,e.extent=e.transform.forwardTransform(t))}(a),this._set("rasterInfo",a),n.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:a.storageInfo.tileInfo,parsedUrl:(0,j.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new $.d({layer:e})}}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,s=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),i=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),n=f.A.fromJSON(t.spatialReference||e.spatialReference),a=new V.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:n});return new A.A({width:s,height:i,bandCount:3,extent:l.A.fromJSON(e),spatialReference:n,pixelSize:a,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const s={...e,query:{...this.ioConfig.customFetchParameters,f:"json"}},i=(0,Y.Tw)(this.url,this.sourceJSON,s),n=t.hasMultidimensions?this.request(`${this.url}/slices`,s).then(e=>e.data?.slices).catch(()=>null):null,a=await Promise.all([i,n]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){const{pixelSize:s}=e,i=.5/e.width*s.x,{lods:n}=t,a=t.lodAt(Math.max.apply(null,n.map(e=>e.level))),r=t.lodAt(Math.min.apply(null,n.map(e=>e.level))),{tileType:o}=this;if("Map"===o)return this._levelOffset=n[0].level,[a,r];if("Raster"===o)return[n.find(e=>e.resolution===s.x)??a,r];const{minScale:l,maxScale:f}=this.sourceJSON;let c=a;f>0&&(c=n.find(e=>Math.abs(e.scale-f)<i),c||(c=n.filter(e=>e.scale>f).sort((e,t)=>e.scale>t.scale?1:-1)[0]??a));let u=r;return l>0&&(u=n.find(e=>Math.abs(e.scale-l)<i)??r,this._levelOffset=u.level-r.level),[c,u]}};(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],K.prototype,"datasetFormat",void 0),(0,n.Cg)([(0,a.MZ)()],K.prototype,"tileType",void 0),K=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.ImageServerRaster")],K);const Q=K;var ee=s(10713);const te=new Map;te.set("Byte","u8"),te.set("Int8","s8"),te.set("UInt8","u8"),te.set("Int16","s16"),te.set("UInt16","u16"),te.set("Int32","s32"),te.set("UInt32","u32"),te.set("Float32","f32"),te.set("Float64","f32"),te.set("Double64","f32");const se=new Map;se.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),se.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),se.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),se.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),se.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let ie=class extends r.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(e,t,s,i={}){const{blockWidth:n,blockHeight:a,blockBoundary:r}=this.rasterInfo.storageInfo,o=r[e];if(!o||o.maxRow<t||o.maxCol<s||o.minRow>t||o.minCol>s)return null;const{bandCount:l,pixelType:f}=this.rasterInfo,{ranges:c,actualTileWidth:u,actualTileHeight:p}=this._getTileLocation(e,t,s);if(!c||0===c.length)return null;if(c.some(e=>e.from>e.to)){const e=new Uint8Array(n*a);return new h.A({width:n,height:a,pixels:void 0,mask:e,validPixelCount:0})}const{bandIds:d}=this.ioConfig,m=this._getBandSegmentCount(),g=[];let y=0;for(y=0;y<m;y++)d&&!d.includes(y)||g.push(this.request(this._files.data,{range:{from:c[y].from,to:c[y].to},responseType:"array-buffer",signal:i.signal}));const x=await Promise.all(g),w=x.map(e=>e.data.byteLength).reduce((e,t)=>e+t),I=new Uint8Array(w),v=[];let C=0;for(y=0;y<m;y++)v.push(C),I.set(new Uint8Array(x[y].data),C),C+=x[y].data.byteLength;const b=se.get(this.rasterInfo.storageInfo.compression).decoderFormat,T=await this.decodePixelBlock(I.buffer,{width:n,height:a,format:b,planes:d?.length||l,offsets:v,pixelType:f}).catch(()=>null);if(null==T)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==b&&!T.mask&&(S=S[0],null!=S)){const e=T.width*T.height,t=new Uint8Array(e);if(Math.abs(S)>1e24)for(y=0;y<e;y++)Math.abs((T.pixels[0][y]-S)/S)>1e-6&&(t[y]=1);else for(y=0;y<e;y++)T.pixels[0][y]!==S&&(t[y]=1);T.mask=t}let A=0,R=0;if(u!==n||p!==a){let e=T.mask;if(e)for(y=0;y<a;y++)if(R=y*n,y<p)for(A=u;A<n;A++)e[R+A]=0;else for(A=0;A<n;A++)e[R+A]=0;else for(e=new Uint8Array(n*a),T.mask=e,y=0;y<p;y++)for(R=y*n,A=0;A<u;A++)e[R+A]=1}return T}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,s=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:i,files:n}=this._parseHeader(s.data),{skipMapInfo:a,skipExtensions:r=[]}=this.ioConfig;if(!r.includes("aux.xml")&&!a){const t=await this._fetchAuxiliaryData(e);null!=t&&(i.statistics=t.statistics??i.statistics,i.histograms=t.histograms,t.histograms&&null==i.statistics&&(i.statistics=(0,T.Pg)(t.histograms)))}a&&this.updateImageSpaceRasterInfo(i),this._set("rasterInfo",i),this._files=n;const o=await this.request(n.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,s,i,n,a,r;if(ee.Z){for(s=new Uint8Array(e),n=new ArrayBuffer(e.byteLength),i=new Uint8Array(n),a=0;a<e.byteLength/4;a++)for(r=0;r<4;r++)i[4*a+r]=s[4*a+3-r];t=new Uint32Array(n)}else t=new Uint32Array(e);return t}(o.data);const{blockWidth:l,blockHeight:f}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:h}=this.rasterInfo,p=[],d=this._getBandSegmentCount();let m=0,g=-1;for(;m<this._storageIndex.length;){g++;const e=Math.ceil(u/l/c**g)-1,t=Math.ceil(h/f/c**g)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return se.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,s){const{blockWidth:i,blockHeight:n,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:r,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let f,c,u,h=0,p=0;for(u=0;u<e;u++)p=a**u,f=Math.ceil(r/i/p),c=Math.ceil(o/n/p),h+=f*c;p=a**e,f=Math.ceil(r/i/p),c=Math.ceil(o/n/p),h+=t*f+s,h*=4*l;const d=this._storageIndex.subarray(h,h+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=d[4*e]*2**32+d[4*e+1],g=m+d[4*e+2]*2**32+d[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:s<f-1?i:Math.ceil(r/p)-i*(f-1),actualTileHeight:t<c-1?n:Math.ceil(o/p)-n*(c-1)}}_parseHeader(e){const t=(0,N.V6)(e,"MRF_META/Raster");if(!t)throw new i.A("mrf:open","not a valid MRF format");const s=(0,N.V6)(t,"Size"),n=parseInt(s.getAttribute("x"),10),a=parseInt(s.getAttribute("y"),10),r=parseInt(s.getAttribute("c"),10),o=((0,N.mX)(t,"Compression")||"none").toLowerCase();if(!se.has(o))throw new i.A("mrf:open","currently does not support compression "+o);const c=(0,N.mX)(t,"DataType")||"UInt8",u=te.get(c);if(null==u)throw new i.A("mrf:open","currently does not support pixel type "+c);const h=(0,N.V6)(t,"PageSize"),p=parseInt(h.getAttribute("x"),10),d=parseInt(h.getAttribute("y"),10),m=(0,N.V6)(t,"DataValues");let g,y;if(m&&(y=m.getAttribute("NoData"),null!=y&&(g=y.trim().split(" ").map(e=>parseFloat(e)))),(0,N.V6)(e,"MRF_META/CachedSource"))throw new i.A("mrf:open","currently does not support MRF referencing other data files");const x=(0,N.V6)(e,"MRF_META/GeoTags"),w=(0,N.V6)(x,"BoundingBox");let I,v=!1;if(null!=w){const e=parseFloat(w.getAttribute("minx")),t=parseFloat(w.getAttribute("miny")),s=parseFloat(w.getAttribute("maxx")),i=parseFloat(w.getAttribute("maxy")),n=(0,N.mX)(x,"Projection")||"";let a=f.A.WGS84;if("LOCAL_CS[]"!==n)if(n.toLowerCase().startsWith("epsg:")){const e=Number(n.slice(5));isNaN(e)||0===e||(a=new f.A({wkid:e}))}else a=L(n)??f.A.WGS84;else v=!0,a=new f.A({wkid:3857});I=new l.A(e,t,s,i),I.spatialReference=a}else v=!0,I=new l.A({xmin:-.5,ymin:.5-a,xmax:n-.5,ymax:.5,spatialReference:new f.A({wkid:3857})});const C=(0,N.V6)(e,"MRF_META/Rsets"),b=parseInt(C?.getAttribute("scale")||"2",10),T=I.spatialReference,S=new X.A({origin:new V.A({x:I.xmin,y:I.ymax,spatialReference:T}),blockWidth:p,blockHeight:d,pyramidBlockWidth:p,pyramidBlockHeight:d,compression:o,pyramidScalingFactor:b}),R=new V.A({x:I.width/n,y:I.height/a,spatialReference:T}),M=new A.A({width:n,height:a,extent:I,isPseudoSpatialReference:v,spatialReference:T,bandCount:r,pixelType:u,pixelSize:R,noDataValue:g,storageInfo:S}),O=(0,N.mX)(e,"datafile"),k=(0,N.mX)(e,"IndexFile");return{rasterInfo:M,files:{mrf:this.url,index:k||this.url.replace(".mrf",".idx"),data:O||this.url.replace(".mrf",se.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return U(t)}catch{return null}}};(0,n.Cg)([(0,a.MZ)()],ie.prototype,"_files",void 0),(0,n.Cg)([(0,a.MZ)()],ie.prototype,"_storageIndex",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),ie=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.MRFRaster")],ie);const ne=ie;var ae=s(53966),re=s(9334);function oe(e){const t=e.fields,s=e.records,i=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",n=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),a=n.map(e=>e.name),r=[];let o=0,l=0;return s.forEach(e=>{const t={};for(t[i]=o++,l=1;l<a.length;l++)t[a[l]]=e[l-1];r.push({attributes:t})}),{displayFieldName:"",fields:n,features:r}}class le{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),s=3&t.getUint8(0);if(3!==s)return{header:{version:s},recordSet:null};const i=t.getUint32(4,!0),n=t.getUint16(8,!0),a=t.getUint16(10,!0),r={version:s,recordCount:i,headerByteCount:n,recordByteCount:a};let o=32;const l=[],f=[];let c;if(3===s){for(;13!==t.getUint8(o);)c=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,re.w)(new Uint8Array(e,o,11)),type:c,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(c)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;f.length<i&&e.byteLength-o>a;){const s=[];32===t.getUint8(o)?(o+=1,l.forEach(t=>{if("C"===t.type)s.push((0,re.w)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)s.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)s.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const i=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();s.push(new Date(parseInt(i.slice(0,4),10),parseInt(i.slice(4,6),10)-1,parseInt(i.slice(6,8),10)))}o+=t.length}),f.push(s)):o+=a}}return{header:r,fields:l,records:f,recordSet:oe({fields:l,records:f})}}}var fe=s(87877),ce=s(94213);const ue=(e,t)=>e.get(t)?.values,he=(e,t)=>e.get(t)?.values?.[0];let pe=class extends r.A{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,s,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,s))return null;const n=await this._fetchRawTiffTile(e,t,s,!1,i);if(null!=n&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,s,!0,i);null!=a&&a.pixels[0]instanceof Uint8Array&&(n.mask=a.pixels[0])}return n}async _open(e){const t=e?e.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!s)throw new i.A("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:n,firstIFDPos:a,isBigTiff:r}=(0,fe.uT)(s),o=[],c={fileChunk:s,posIFD:a,fileOffset:0};await this._readIFDs(o,c,n,r?8:4,t);const{imageInfo:u,rasterInfo:h}=function(e){const t=(0,fe.uc)(e),{width:s,height:i,tileWidth:n,tileHeight:a,planes:r,pixelType:o,compression:c,firstPyramidLevel:u,maximumPyramidLevel:h,pyramidBlockWidth:p,pyramidBlockHeight:d,pyramidResolutions:m,tileBoundary:g,affine:y,metadata:x}=t;let w=L(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),I=!!t.isPseudoGeographic;null==w&&(I=!0,w=new f.A({wkid:3857}));const v=new l.A({...t.extent,spatialReference:w}),C=new V.A(v?{x:v.xmin,y:v.ymax,spatialReference:w}:{x:0,y:0}),b=new X.A({blockWidth:n,blockHeight:a,pyramidBlockWidth:p,pyramidBlockHeight:d,compression:c,origin:C,firstPyramidLevel:u,maximumPyramidLevel:h,pyramidResolutions:m,blockBoundary:g}),T=new V.A({x:(v.xmax-v.xmin)/s,y:(v.ymax-v.ymin)/i,spatialReference:w}),S=x?{BandProperties:x.bandProperties,DataType:x.dataType}:{};let R=null;const M=he(e[0],"PHOTOMETRICINTERPRETATION"),O=ue(e[0],"COLORMAP");if(M<=3&&O?.length>3&&O.length%3==0){R=[];const e=O.length/3;for(let t=0;t<e;t++)R.push([t,O[t]>>>8,O[t+e]>>>8,O[t+2*e]>>>8])}const k=new A.A({width:s,height:i,bandCount:r,pixelType:o,pixelSize:T,storageInfo:b,spatialReference:w,isPseudoSpatialReference:I,keyProperties:S,extent:v,colormap:R,statistics:x?x.statistics:null});if(y?.length&&(k.nativeExtent=new l.A({xmin:-.5,ymin:.5-i,xmax:s-.5,ymax:.5,spatialReference:w}),k.transform=new D.A({polynomialOrder:1,forwardCoefficients:[y[2]+y[0]/2,y[5]-y[3]/2,y[0],y[3],-y[1],-y[4]]}),k.extent=k.transform.forwardTransform(k.nativeExtent),k.pixelSize=new V.A({x:(v.xmax-v.xmin)/s,y:(v.ymax-v.ymin)/i,spatialReference:w}),b.origin.x=-.5,b.origin.y=.5),m){const{x:e,y:t}=k.pixelSize;m.forEach(s=>{s.x*=e,s.y*=t})}return{imageInfo:t,rasterInfo:k}}(o),p=(0,fe.zS)(o),d=(0,fe.r9)(o);if(this._headerInfo={littleEndian:n,isBigTiff:r,ifds:o,pyramidIFDs:p,maskIFDs:d,...u},this._set("rasterInfo",h),!u.isSupported)throw new i.A("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new i.A("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");h.isPseudoSpatialReference&&ae.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const m=o[0].get("PREDICTOR")?.values?.[0],g=o[0].get("SAMPLEFORMAT")?.values?.[0];if(3===g&&2===m)throw new i.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:y,skipExtensions:x=[]}=this.ioConfig;if(!x.includes("aux.xml")&&!y){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,T.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const s=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new V.A({x:(s.xmax-s.xmin)/t.width,y:(s.ymax-s.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=s}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(t,h)}x.includes("vat.dbf")||1!==h.bandCount||"u8"!==h.pixelType||y||(h.attributeTable=await this._fetchAuxiliaryTable(e),null!=h.attributeTable&&(h.keyProperties.DataType="thematic")),y&&this.updateImageSpaceRasterInfo(h),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:s,fileOffset:i,posIFD:n}=e;return(n+8>=s.byteLength||n<0)&&(i=n+i,s=(await this.request(this.url,{range:{from:i,to:i+this._bufferSize},responseType:"array-buffer",signal:t})).data,n=0),{fileChunk:s,fileOffset:i,posIFD:n}}async _readIFDs(e,t,s,n=4,a){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,a);const r=await this._readIFD(t,s,ce.NB,n,a);if(!r?.ifd)throw new i.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(r.ifd),!r.nextIFD)return null;t.posIFD=r.nextIFD-t.fileOffset,await this._readIFDs(e,t,s,n,a)}async _readIFD(e,t,s=ce.NB,i=4,n){let{fileChunk:a,posIFD:r,fileOffset:o}=e;if(!e.fileChunk)return null;const l=(0,fe.JM)(a,t,r,o,s,i);if(l.success){const e=[];if(l.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,l.nextIFD,n),l.ifd?.has("GEOKEYDIRECTORY")){const e=l.ifd.get("GEOKEYDIRECTORY"),s=e?.values;if(s&&s.length>4){const i=s[0]+"."+s[1]+"."+s[2];r=e.valueOffset+6-o;const l=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:r,fileOffset:o},n),f=await this._readIFD(l,t,ce.YC,2,n);e.data=f?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[i]})}}return l}return l.requiredBufferSize?(a=(await this.request(this.url,{range:{from:o,to:o+r+l.requiredBufferSize+8},responseType:"array-buffer",signal:n})).data,a.byteLength<r+l.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,s,i,n))):null}async _fillOffsets(e,t,s,i){const n=e.filter(e=>null!=e.offlineOffsetSize);if(0===n.length)return;const a=n.map(e=>e.offlineOffsetSize),r=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let l=1===a.length||o-r<=this._bufferSize;if(!l&&a.length>1&&(a.sort((e,t)=>e[0]-t[0]),l=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o),l){const e=await this._fetchOffsets(r,Math.max(o,r+this._bufferSize),i);return void n.forEach(s=>(0,fe.Cr)(e,t,s,r))}const f=n.map(async e=>{const s=e.offlineOffsetSize,n=await this._fetchOffsets(s[0],s[1]+s[0],i);(0,fe.Cr)(n,t,e,s[0])});await Promise.all(f)}async _fetchOffsets(e,t,s){const i=[],n=this._chunkSize,a=Math.ceil((t-e)/n);let r=e;for(let e=0;e<a;e++)i.push(this.request(this.url,{range:{from:r,to:e===a-1?t:r+n-1},responseType:"array-buffer",signal:s})),r+=n;const o=await Promise.all(i);if(1===a)return o[0].data;const l=new Uint8Array(t-e+1);for(let e=0;e<a;e++)l.set(new Uint8Array(o[e].data),e*n);return l.buffer}async _fetchRawTiffTile(e,t,s,i,n={}){const a=this._getTileLocation(e,t,s,i);if(!a)return null;const{ranges:r,actualTileWidth:o,actualTileHeight:l,ifd:f}=a,c=r.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:n.signal})),u=await Promise.all(c),h=u.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===u.length?u[0].data:new ArrayBuffer(h),d=[0],m=[0];if(u.length>1){const e=new Uint8Array(p);for(let t=0,s=0;t<u.length;t++){const i=u[t].data;e.set(new Uint8Array(i),s),d[t]=s,s+=i.byteLength,m[t]=i.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:f,offsets:d,sizes:m},width:g,height:y,planes:null,pixelType:null});if(null==x)return null;if(o!==g||l!==y){let e=x.mask;if(e)for(let t=0;t<y;t++){const s=t*g;if(t<l)for(let t=o;t<g;t++)e[s+t]=0;else for(let t=0;t<g;t++)e[s+t]=0}else{e=new Uint8Array(g*y),x.mask=e;for(let t=0;t<l;t++){const s=t*g;for(let t=0;t<o;t++)e[s+t]=1}}}return x}_getTileLocation(e,t,s,i=!1){const{firstPyramidLevel:n,blockBoundary:a}=this.rasterInfo.storageInfo,r=0===e?0:e-(n-1),{_headerInfo:o}=this;if(!o)return null;const l=i?o.maskIFDs[r]:0===r?o?.ifds[0]:o?.pyramidIFDs[r-1];if(!l)return null;const f=(0,fe.XO)(l,o),c=ue(l,"TILEOFFSETS");if(void 0===c)return null;const u=ue(l,"TILEBYTECOUNTS"),{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[r];if(t>d||s>m||t<h||s<p)return null;const g=he(l,"IMAGEWIDTH"),y=he(l,"IMAGELENGTH"),x=he(l,"TILEWIDTH"),w=he(l,"TILELENGTH"),I=[];if(f){const{bandCount:e}=this.rasterInfo;for(let i=0;i<e;i++){const e=i*(d+1)*(m+1)+t*(m+1)+s;I[i]={from:c[e],to:c[e]+u[e]-1}}}else{const e=t*(m+1)+s;I.push({from:c[e],to:c[e]+u[e]-1})}for(let e=0;e<I.length;e++)if(null==I[e].from||!I[e].to||I[e].to<0)return null;return{ranges:I,ifd:l,actualTileWidth:s===m&&g%x||x,actualTileHeight:t===d&&y%w||w}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return U(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),s=le.parse(t);return s?.recordSet?O.A.fromJSON(s.recordSet):null}catch{return null}}};(0,n.Cg)([(0,a.MZ)()],pe.prototype,"_files",void 0),(0,n.Cg)([(0,a.MZ)()],pe.prototype,"_headerInfo",void 0),(0,n.Cg)([(0,a.MZ)()],pe.prototype,"_bufferSize",void 0),(0,n.Cg)([(0,a.MZ)()],pe.prototype,"_chunkSize",void 0),(0,n.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],pe.prototype,"datasetFormat",void 0),pe=(0,n.Cg)([(0,a.$K)("esri.layers.raster.datasets.TIFFRaster")],pe);const de=pe,me=new Map;me.set("MRF",{desc:"Meta Raster Format",constructor:ne}),me.set("TIFF",{desc:"GeoTIFF",constructor:de}),me.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Q}),me.set("JPG",{desc:"JPG Raster Format",constructor:G}),me.set("PNG",{desc:"PNG Raster Format",constructor:G}),me.set("GIF",{desc:"GIF Raster Format",constructor:G}),me.set("BMP",{desc:"BMP Raster Format",constructor:G}),me.set("CovJSON",{desc:"COVJSON Raster Format",constructor:_}),me.set("MEMORY",{desc:"In Memory Raster Format",constructor:M});class ge{static get supportedFormats(){const e=new Set;return me.forEach((t,s)=>e.add(s)),e}static async open(e){const{url:t,ioConfig:s,source:n,sourceJSON:a}=e;let r=e.datasetFormat??s?.datasetFormat;null==r&&(t.includes(".")?r=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===n?.type?.toLowerCase()?r="CovJSON":n?.extent&&n.pixelblocks&&(r="MEMORY")),"OVR"===r||"TIF"===r?r="TIFF":"JPG"===r||"JPEG"===r||"JFIF"===r?r="JPG":"COVJSON"===r&&(r="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(r="RasterTileServer");const o={url:t,source:n,sourceJSON:a,datasetFormat:r,ioConfig:s??{bandIds:null,sampling:null}};if(Object.keys(o).forEach(e=>{null==o[e]&&delete o[e]}),r){if(!this.supportedFormats.has(r))throw new i.A("rasterfactory:open","not a supported format "+r);if("CRF"===r)throw new i.A("rasterfactory:open",`cannot open raster: ${t}`);const s=new(0,me.get(r).constructor)(o);return await s.open({signal:e.signal}),s}const l=Array.from(me.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e);let f=0;const c=()=>{if(r=l[f++],!r)return null;if("CRF"===r)return null;const t=new(0,me.get(r).constructor)(o);return t.open({signal:e.signal}).then(()=>t).catch(()=>c())};return c()}static register(e,t,s){me.has(e.toUpperCase())||me.set(e.toUpperCase(),{desc:t,constructor:s})}}},10333(e,t,s){s.d(t,{A:()=>r});var i=s(5482),n=s(25482),a=s(91429);let r=class extends n.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,i.Cg)([(0,a.MZ)()],r.prototype,"affectsPixelSize",null),(0,i.Cg)([(0,a.MZ)({json:{write:!0}})],r.prototype,"spatialReference",void 0),r=(0,i.Cg)([(0,a.$K)("esri.layers.raster.transforms.BaseRasterTransform")],r)},75414(e,t,s){s.d(t,{A:()=>l});var i,n=s(5482),a=s(91429),r=s(10333),o=s(93223);let l=i=class extends r.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new i({tolerance:this.tolerance})}};(0,n.Cg)([(0,o.e)({GCSShiftXform:"gcs-shift"})],l.prototype,"type",void 0),(0,n.Cg)([(0,a.MZ)()],l.prototype,"tolerance",void 0),l=i=(0,n.Cg)([(0,a.$K)("esri.layers.raster.transforms.GCSShiftTransform")],l)},43163(e,t,s){s.d(t,{A:()=>d});var i,n=s(5482),a=s(91429),r=s(5443),o=s(86738),l=s(10333),f=s(36005),c=s(43937),u=s(93223);function h(e,t,s){const{x:i,y:n}=t;if(s<2)return{x:e[0]+i*e[2]+n*e[4],y:e[1]+i*e[3]+n*e[5]};if(2===s){const t=i*i,s=n*n,a=i*n;return{x:e[0]+i*e[2]+n*e[4]+t*e[6]+a*e[8]+s*e[10],y:e[1]+i*e[3]+n*e[5]+t*e[7]+a*e[9]+s*e[11]}}const a=i*i,r=n*n,o=i*n,l=a*i,f=a*n,c=i*r,u=n*r;return{x:e[0]+i*e[2]+n*e[4]+a*e[6]+o*e[8]+r*e[10]+l*e[12]+f*e[14]+c*e[16]+u*e[18],y:e[1]+i*e[3]+n*e[5]+a*e[7]+o*e[9]+r*e[11]+l*e[13]+f*e[15]+c*e[17]+u*e[19]}}function p(e,t,s){const{xmin:i,ymin:n,xmax:a,ymax:o,spatialReference:l}=t;let f=[];if(s<2)f.push({x:i,y:o}),f.push({x:a,y:o}),f.push({x:i,y:n}),f.push({x:a,y:n});else{let e=10;for(let t=0;t<e;t++)f.push({x:i,y:n+(o-n)*t/(e-1)}),f.push({x:a,y:n+(o-n)*t/(e-1)});e=8;for(let t=1;t<=e;t++)f.push({x:i+(a-i)*t/e,y:n}),f.push({x:i+(a-i)*t/e,y:o})}f=f.map(t=>h(e,t,s));const c=f.map(e=>e.x),u=f.map(e=>e.y);return new r.A({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,u),ymax:Math.max.apply(null,u),spatialReference:l})}let d=i=class extends l.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){const{coeffX:s,coeffY:i}=t;if(!s?.length||!i?.length||s.length!==i.length)return null;const n=[];for(let e=0;e<s.length;e++)n.push(s[e]),n.push(i[e]);return n}writeForwardCoefficients(e,t,s){const i=[],n=[];for(let t=0;t<e?.length;t++)t%2==0?i.push(e[t]):n.push(e[t]);t.coeffX=i,t.coeffY=n}get inverseCoefficients(){let e=this._get("inverseCoefficients");const t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){const[t,s,i,n,a,r]=e,o=i*r-a*n,l=a*n-i*r;return[(a*s-t*r)/o,(i*s-t*n)/l,r/o,n/l,-a/o,-i/l]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){const{inverseCoeffX:s,inverseCoeffY:i}=t;if(!s?.length||!i?.length||s.length!==i.length)return null;const n=[];for(let e=0;e<s.length;e++)n.push(s[e]),n.push(i[e]);return n}writeInverseCoefficients(e,t,s){const i=[],n=[];for(let t=0;t<e?.length;t++)t%2==0?i.push(e[t]):n.push(e[t]);t.inverseCoeffX=i,t.inverseCoeffY=n}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){const t=h(this.forwardCoefficients,e,this.polynomialOrder);return new o.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){const t=h(this.inverseCoefficients,e,this.polynomialOrder);return new o.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new i({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,n.Cg)([(0,a.MZ)({json:{write:!0}})],d.prototype,"polynomialOrder",void 0),(0,n.Cg)([(0,a.MZ)()],d.prototype,"forwardCoefficients",void 0),(0,n.Cg)([(0,f.w)("forwardCoefficients",["coeffX","coeffY"])],d.prototype,"readForwardCoefficients",null),(0,n.Cg)([(0,c.K)("forwardCoefficients")],d.prototype,"writeForwardCoefficients",null),(0,n.Cg)([(0,a.MZ)({json:{write:!0}})],d.prototype,"inverseCoefficients",null),(0,n.Cg)([(0,f.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],d.prototype,"readInverseCoefficients",null),(0,n.Cg)([(0,c.K)("inverseCoefficients")],d.prototype,"writeInverseCoefficients",null),(0,n.Cg)([(0,a.MZ)()],d.prototype,"affectsPixelSize",null),(0,n.Cg)([(0,u.e)({PolynomialXform:"polynomial"})],d.prototype,"type",void 0),d=i=(0,n.Cg)([(0,a.$K)("esri.layers.raster.transforms.PolynomialTransform")],d)}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[926,4948],{66344(e,t,i){i.d(t,{q:()=>a});const s=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class n{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._users=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._users.clear(),this._db.clear()}register(e){this._users.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._users.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const i=this._db.get(e.id+t);return i?.size??0}put(e,t,i,n,o){t=e.id+t;const a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==i&&this._notifyRemove(t,a.entry,a.size,0)),n>this._maxSize)return void this._notifyRemove(t,i,n,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return s||console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,i,0,0);const u=1+Math.max(o,-4)- -3;this._db.set(t,new r(i,n,u)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t){t=e.id+t;const i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let s=i.entry.usedMemory;for(;s>this._maxSize;){const e=this._notifyRemove(t,i.entry,s,1);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}i.size=s,this._size+=s,e.size+=s,this._checkSize()}pop(e,t){t=e.id+t;const i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;const i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){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.forEach(i=>{const{id:n,name:r}=i;if(s.startsWith(n)){const i=t[r]||0;t[r]=i+e.size}})});const s={};this._users.forEach(e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!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.forEach(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._users.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(const[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,s){const n=this._users.get(e.split(o)[0])?.removeFunc,r=n?.(t,s,i);return"number"==typeof r?r:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._checkSizeLimits(this.maxSize)}setMaxSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){const i=t??this;if(i.size<=e)return;const s=t?.id;let n=!0;for(;n;){n=!1;for(const[r,a]of this._db)if(0===a.lifetime&&(!s||r.startsWith(s))){const s=t??this._users.get(r.split(o)[0]);if(this._purgeItem(r,a,s),i.size<=.9*e)return;n||=this._db.has(r)}}for(const[n,r]of this._db)if(!s||n.startsWith(s)){const s=t??this._users.get(n.split(o)[0]);if(this._purgeItem(n,r,s),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,1);null!=s&&s>0&&(this._size+=s,i&&(i.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new n(0);class r{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const o=":";class a{constructor(e,t){this.removeFunc=t,this._storage=new n,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy(),this._storage=null}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},67482(e,t,i){function s(e){return null!=a(e)||null!=o(e)}function n(e){return u.test(e)}function r(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let i=!0;if(d&&/\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=!l.test(e[s]),s++;i=!t}}return i}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=u.exec(e);if(!t?.groups)return null;const i=t.groups,s=+i.year,n=+i.month-1,r=+i.day,o=+(i.hours??"0"),a=+(i.minutes??"0"),l=+(i.seconds??"0");if(o>23)return null;if(a>59)return null;if(l>59)return null;const d=i.ms??"0",h=d?+d.padEnd(3,"0").slice(0,3):0;let c;if(i.isUTC||!i.offsetSign)c=Date.UTC(s,n,r,o,a,l,h);else{const e=+i.offsetHours,t=+i.offsetMinutes;c=6e4*("+"===i.offsetSign?-1:1)*(60*e+t)+Date.UTC(s,n,r,o,a,l,h)}return Number.isNaN(c)?null:c}i.d(t,{Br:()=>n,Cq:()=>s,_U:()=>r});const u=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,l=/^((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,d=!Number.isNaN(new Date("technology 10").getTime())},75503(e,t,i){i.d(t,{wq:()=>a});var s=i(4576),n=i(21818),r=(i(44208),i(15142)),o=i(11006);class a{constructor(e=9,t){this._compareMinX=c,this._compareMinY=f,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),I.prune(),S.prune(),v.prune(),B.prune()}all(e){u(this._data,e)}search(e,t){let i=this._data;const s=this._toBBox;if(b(e,i))for(I.clear();i;){for(let n=0,r=i.children.length;n<r;n++){const r=i.children[n],o=i.leaf?s(r):r;b(e,o)&&(i.leaf?t(r):_(e,o)?u(r,t):I.push(r))}i=I.pop()}}collides(e){let t=this._data;const i=this._toBBox;if(!b(e,t))return!1;for(I.clear();t;){for(let s=0,n=t.children.length;s<n;s++){const n=t.children[s],r=t.leaf?i(n):n;if(b(e,r)){if(t.leaf||_(e,r))return!0;I.push(n)}}t=I.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new T([]),this}remove(e){if(!e)return this;let t,i=this._data,r=null,o=0,a=!1;const u=this._toBBox(e);for(v.clear(),B.clear();i||v.length>0;){if(i||(i=v.pop(),r=v.data[v.length-1],o=B.pop()??0,a=!0),i.leaf&&(t=(0,s.qh)(i.children,(0,n.z)(e),i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),v.push(i),this._condense(v),this;a||i.leaf||!_(i,u)?r?(o++,i=r.children[o],a=!1):i=null:(v.push(i),B.push(o),o=0,r=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,i,s){const n=i-t+1;let r=this._maxEntries;if(n<=r){const s=new T(e.slice(t,i+1));return l(s,this._toBBox),s}s||(s=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(s-1)));const o=new z([]);o.height=s;const a=Math.ceil(n/r),u=a*Math.ceil(Math.sqrt(r));x(e,t,i,u,this._compareMinX);for(let n=t;n<=i;n+=u){const t=Math.min(n+u-1,i);x(e,n,t,a,this._compareMinY);for(let i=n;i<=t;i+=a){const n=Math.min(i+a-1,t);o.children.push(this._build(e,i,n,s-1))}}return l(o,this._toBBox),o}_insert(e,t,i){const s=this._toBBox,n=i?e:s(e);v.clear();const r=function(e,t,i,s){for(;s.push(t),!0!==t.leaf&&s.length-1!==i;){let i,s=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=m(o),u=y(e,o)-a;u<n?(n=u,s=a<s?a:s,i=o):u===n&&a<s&&(s=a,i=o)}t=i||t.children[0]}return t}(n,this._data,t,v);for(r.children.push(e),h(r,n);t>=0&&v.data[t].children.length>this._maxEntries;)this._split(v,t),t--;!function(e,t,i){for(let s=i;s>=0;s--)h(t.data[s],e)}(n,v,t)}_split(e,t){const i=e.data[t],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);const r=this._chooseSplitIndex(i,n,s);if(!r)return;const o=i.children.splice(r,i.children.length-r),a=i.leaf?new T(o):new z(o);a.height=i.height,l(i,this._toBBox),l(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this._data=new z([e,t]),this._data.height=e.height+1,l(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let s,n,r;s=n=1/0;for(let o=t;o<=i-t;o++){const t=d(e,0,o,this._toBBox),a=d(e,o,i,this._toBBox),u=g(t,a),l=m(t)+m(a);u<s?(s=u,r=o,n=l<n?l:n):u===s&&l<n&&(n=l,r=o)}return r}_chooseSplitAxis(e,t,i){const s=e.leaf?this._compareMinX:c,n=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,i,s)<this._allDistMargin(e,t,i,n)&&e.children.sort(s)}_allDistMargin(e,t,i,s){e.children.sort(s);const n=this._toBBox,r=d(e,0,t,n),o=d(e,i-t,i,n);let a=p(r)+p(o);for(let s=t;s<i-t;s++){const t=e.children[s];h(r,e.leaf?n(t):t),a+=p(r)}for(let s=i-t-1;s>=t;s--){const t=e.children[s];h(o,e.leaf?n(t):t),a+=p(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,s.qh)(r,i,r.length,n.indexHint),1)}else this.clear();else l(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function u(e,t){let i=e;for(S.clear();i;){if(!0===i.leaf)for(const e of i.children)t((0,n.z)(e));else S.pushArray(i.children);i=S.pop()??null}}function l(e,t){d(e,0,e.children.length,t,e)}function d(e,t,i,s,n){n||(n=new T([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<i;o++)r=e.children[o],h(n,e.leaf?s(r):r);return n}function h(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function c(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function m(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function y(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const i=Math.max(e.minX,t.minX),s=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,r-s)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function b(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function x(e,t,i,s,n){const r=[t,i];for(;r.length;){const t=r.pop(),i=r.pop();if(t-i<=s)continue;const a=i+Math.ceil((t-i)/s/2)*s;(0,o.q)(e,a,i,t,n),r.push(i,a,a,t)}}const I=new r.A,S=new r.A,v=new r.A,B=new r.A({deallocator:void 0});class M{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class F extends M{constructor(){super(...arguments),this.height=1,this.indexHint=new s.vW}}class T extends F{constructor(e){super(),this.children=e,this.leaf=!0}}class z extends F{constructor(e){super(),this.children=e,this.leaf=!1}}},36708(e,t,i){i.d(t,{C_:()=>c,OH:()=>p,Vh:()=>y,on:()=>h,pc:()=>g,wB:()=>u,z7:()=>l});var s=i(37955),n=i(36563),r=i(97768),o=i(74887),a=i(14012);function u(e,t,i={}){return d(e,t,i,f)}function l(e,t,i={}){return d(e,t,i,m)}function d(e,t,i={},s){let n=null;const o=i.once?(e,i)=>{s(e)&&((0,r.xt)(n),t(e,i))}:(e,i)=>{s(e)&&t(e,i)};if(n=(0,a.Cn)(e,o,i.sync,i.equals),i.initial){const t=e();o(t,t)}return n}function h(e,t,i,o={}){let a=null,l=null,d=null;function h(){a&&l&&(l.remove(),o.onListenerRemove?.(a),a=null,l=null)}function c(e){o.once&&o.once&&(0,r.xt)(d),i(e)}const f=u(e,(e,i)=>{h(),(0,s.wb)(e)&&(a=e,l=(0,s.on)(e,t,c),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return d=(0,n.hA)(()=>{f.remove(),h()}),d}function c(e,t){return function(e,t,i){if((0,o.G4)(i))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function u(){a=(0,r.xt)(a)}return new Promise((s,r)=>{a=(0,n.vE)([(0,o.u7)(i,()=>{u(),r((0,o.NK)())}),d(e,e=>{u(),s(e)},{sync:!1,once:!0},t??f)])})}(e,m,t)}function f(e){return!0}function m(e){return!!e}i(80559);const p={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},60408(e,t,i){function s(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function n(e){return void 0!==e.points}function r(e){return void 0!==e.x&&void 0!==e.y}function o(e){return void 0!==e.paths||void 0!==e.curvePaths}function a(e){return void 0!==e.rings||void 0!==e.curveRings}function u(e){return"object"==typeof e&&"vertexAttributes"in e}function l(e){return e?r(e)?"esriGeometryPoint":o(e)?"esriGeometryPolyline":a(e)?"esriGeometryPolygon":s(e)?"esriGeometryEnvelope":n(e)?"esriGeometryMultipoint":null:null}function d(e){return null!=e&&("hasZ"in e&&e.hasZ||"z"in e&&null!=e.z)}function h(e){return null!=e&&("hasM"in e&&e.hasM||"m"in e&&null!=e.m)}i.d(t,{$B:()=>l,Bi:()=>a,Pv:()=>d,Rg:()=>o,U9:()=>n,W0:()=>h,ZC:()=>s,fT:()=>r,uW:()=>u})},65864(e,t,i){i.d(t,{rS:()=>d,xD:()=>c});var s=i(5443),n=i(91075),r=i(48526),o=i(86738),a=i(39829),u=i(82799),l=i(60408);function d(e){return null==e?null:e instanceof n.A?e:(0,l.fT)(e)?o.A.fromJSON(e):(0,l.Rg)(e)?u.A.fromJSON(e):(0,l.Bi)(e)?a.A.fromJSON(e):(0,l.U9)(e)?r.A.fromJSON(e):(0,l.ZC)(e)?s.A.fromJSON(e):null}const h={esriGeometryPoint:o.A,esriGeometryPolyline:u.A,esriGeometryPolygon:a.A,esriGeometryEnvelope:s.A,esriGeometryMultipoint:r.A,esriGeometryMultiPatch:a.A};function c(e){return e&&h[e]||null}},6518(e,t,i){i.d(t,{F:()=>a});var s=i(44208),n=i(75503),r=i(19419);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.wq(9,(0,s.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((i,s)=>{e[t++]=s}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,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()))}}},83221(e,t,i){i.d(t,{A:()=>m});var s=i(4576),n=i(49186),r=i(65529),o=i(53966),a=i(70328),u=i(19419),l=i(90708),d=i(6518),h=i(51441),c=i(37730);const f=(0,a.vt)();class m{constructor(e){this.geometryInfo=e,this._boundsStore=new d.F,this._featuresById=new Map,this._usedMemory=0,this.events=new r.bk,this.featureAdapter=c.T}get usedMemory(){return this._usedMemory}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=>{null!=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)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,i,s,n]=this.fullBounds;return{xmin:t,ymin:i,xmax:s,ymax:n,spatialReference:(0,h.ag)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(s.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}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){for(const i of e){const e=this._boundsStore.get(i.objectId);e&&t((0,a.Jt)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let s;if(i?(e.displayId=i.displayId,s=this._boundsStore.get(t),this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);s=(0,l.jQ)(null!=s?s:(0,u.vt)(),e.geometry),null!=s&&this._boundsStore.set(t,s),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0}_upsert(e){const t=e?.objectId;if(null==t)return o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const i=this._featuresById.get(t);if(!i)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;const{geometry:s,attributes:r}=e;for(const e in r)i.attributes[e]=r[e];return s&&(i.geometry=s,this._boundsStore.set(t,(0,l.jQ)((0,u.vt)(),s)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}},37730(e,t,i){i.d(t,{T:()=>n});var s=i(43334);const n={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t,i)=>new s.Om(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)}},33032(e,t,i){i.d(t,{H:()=>n,L:()=>s});const s=1;function n(e,t){let i=0;for(const s of t){const t=s.attributes?.[e];"number"==typeof t&&isFinite(t)&&(i=Math.max(i,t))}return i}},29432(e,t,i){i.r(t),i.d(t,{default:()=>S});var s=i(49186),n=i(60408),r=i(21325),o=i(90708),a=i(33032),u=i(83221),l=i(31464),d=i(56390),h=i(64714),c=i(82832),f=i(95466),m=i(98453),p=i(30524),y=i(98623);const g=r.KK,_={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:r.KK},b={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:c.PC};function x(e){return(0,n.fT)(e)?null!=e.z:!!e.hasZ}function I(e){return(0,n.fT)(e)?null!=e.m:!!e.hasM}class S{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const t=[],{features:i}=e,n=this._inferLayerProperties(i,e.fields),r=e.fields||[],o=null!=e.hasM?e.hasM:!!n.hasM,c=null!=e.hasZ?e.hasZ:!!n.hasZ,x=!e.spatialReference&&!n.spatialReference,I=x?g:e.spatialReference||n.spatialReference,S=x?_:null,v=e.geometryType||n.geometryType,B=!v;let M=e.objectIdField||n.objectIdField,F=e.timeInfo;const T=new f.A(r);if(!B&&(x&&t.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!v))throw new s.A("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!M)throw new s.A("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&M!==n.objectIdField&&(t.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${M}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),M=n.objectIdField),M&&!n.objectIdField){const e=T.get(M);e?(M=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):r.unshift({alias:M,name:M,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const e of r){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),!e.name)throw new s.A("feature-layer:invalid-field-name","field name is missing",{field:e});if(e.name===M&&(e.type="esriFieldTypeOID"),!m.m.jsonValues.includes(e.type))throw new s.A("feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e});null==e.length&&(e.length=(0,p._b)(e))}const z={};for(const e of r)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=(0,p.lD)(e);void 0!==t&&(z[e.name]=t)}if(F){if(F.startTimeField){const e=T.get(F.startTimeField);e?(F.startTimeField=e.name,e.type="esriFieldTypeDate"):F.startTimeField=null}if(F.endTimeField){const e=T.get(F.endTimeField);e?(F.endTimeField=e.name,e.type="esriFieldTypeDate"):F.endTimeField=null}if(F.trackIdField){const e=T.get(F.trackIdField);e?F.trackIdField=e.name:(F.trackIdField=null,t.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:F}}))}F.startTimeField||F.endTimeField||(t.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:F}}),F=null)}const A=T.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??y.n$}:null;this._createDefaultAttributes=(0,h.Vx)(z,M);const w={warnings:t,featureErrors:[],layerDefinition:{...b,drawingInfo:(0,h.F0)(v),templates:(0,h.e2)(z),extent:S,geometryType:v,objectIdField:M,fields:r,hasZ:c,hasM:o,timeInfo:F,dateFieldsTimeReference:A},assignedObjectIds:{}},E={type:"object-id",fieldName:M};if(this._queryEngine=new d.do({fieldsIndex:f.A.fromLayerJSON({fields:r,timeInfo:F,dateFieldsTimeReference:A}),geometryType:v,hasM:o,hasZ:c,featureIdInfo:E,spatialReference:I,featureStore:new u.A({geometryType:v,hasM:o,hasZ:c}),timeInfo:F}),!i?.length)return this._nextObjectId=a.L,w;const R=(0,a.H)(M,i);return this._nextObjectId=R+1,await(0,l.Nk)(i,I),this._loadInitialFeatures(w,i)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([(0,c.$1)(t,i),(0,l.Nk)(e.adds,t),(0,l.Nk)(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,t){let i,s,r=null,o=null,a=null;for(const t of e){const e=t.geometry;if(null!=e&&(r||(r=(0,n.$B)(e)),o||(o=e.spatialReference),null==i&&(i=x(e)),null==s&&(s=I(e)),r&&o&&null!=i&&null!=s))break}if(t&&t.length){let e=null;t.some(t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s})&&(a=e.name)}return{geometryType:r,spatialReference:o,objectIdField:a,hasM:s,hasZ:i}}async _loadInitialFeatures(e,t){const{geometryType:i,hasM:s,hasZ:r,objectIdField:a,spatialReference:u,featureStore:d,fieldsIndex:h}=this._queryEngine,f=[],m={type:"object-id",fieldName:a};for(const s of t){if(null!=s.uid&&(e.assignedObjectIds[s.uid]=-1),s.geometry&&i!==(0,n.$B)(s.geometry)){e.featureErrors.push((0,c.Yx)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=(0,c.MB)(h,t,s.attributes,!0);r?e.featureErrors.push(r):(this._assignObjectId(t,s.attributes,!0),s.attributes=t,null!=s.uid&&(e.assignedObjectIds[s.uid]=s.attributes[a]),null!=s.geometry&&(s.geometry=(0,l.Cv)(s.geometry,s.geometry.spatialReference,u)),f.push(s))}d.addMany((0,o.Di)([],f,i,r,s,m));const{fullExtent:p,timeExtent:y}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=p,y){const{start:t,end:i}=y;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,n={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(n,t),i?.length&&this._applyUpdateEdits(n,i),s?.length){for(const e of s)n.deleteResults.push((0,c.bP)(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:r,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:o,featureEditResults:n}}_applyAddEdits(e,t){const{addResults:i}=e,{geometryType:s,hasM:r,hasZ:a,objectIdField:u,spatialReference:d,featureStore:h,featureIdInfo:f,fieldsIndex:m}=this._queryEngine,p=[];for(const r of t){if(r.geometry&&s!==(0,n.$B)(r.geometry)){i.push((0,c.Yx)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),o=(0,c.MB)(m,t,r.attributes);if(o)i.push(o);else{if(this._assignObjectId(t,r.attributes),r.attributes=t,null!=r.uid){const t=r.attributes[u];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??d;r.geometry=(0,l.Cv)((0,c.CR)(r.geometry,e),e,d)}p.push(r),i.push((0,c.bP)(r.attributes[u]))}}h.addMany((0,o.Di)([],p,s,a,r,f))}_applyUpdateEdits({updateResults:e},t){const{geometryType:i,hasM:s,hasZ:r,objectIdField:a,spatialReference:u,featureStore:d,fieldsIndex:h,featureIdInfo:f}=this._queryEngine;for(const m of t){const{attributes:t,geometry:p}=m,y=t?.[a];if(null==y){e.push((0,c.Yx)(`Identifier field ${a} missing`));continue}if(!d.has(y)){e.push((0,c.Yx)(`Feature with object id ${y} missing`));continue}const g=(0,o.oN)(d.getFeature(y),i,r,s);if(null!=p){if(i!==(0,n.$B)(p)){e.push((0,c.Yx)("Incorrect geometry type."));continue}const t=p.spatialReference??u;g.geometry=(0,l.Cv)((0,c.CR)(p,t),t,u)}if(t){const i=(0,c.MB)(h,g.attributes,t);if(i){e.push(i);continue}}d.add((0,o.E2)(g,i,r,s,f)),e.push((0,c.bP)(y))}}_assignObjectId(e,t,i=!1){const s=this._queryEngine.objectIdField;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}},64714(e,t,i){i.d(t,{F0:()=>a,Vx:()=>d,e2:()=>c,f:()=>f});var s=i(44208),n=i(4718),r=i(99352),o=i(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.Cb:"esriGeometryPolyline"===e?o.yM:o.WR}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function d(e,t){if((0,s.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let i=`this${h(t)} = null;`;for(const t in e)i+=`this${h(t)} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${i};\n }\n }\n `)();return()=>new s}catch(i){return()=>({[t]:null,...e})}}function h(e){return u.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.o8)(e)}}]}function f(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:r.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:t,supportsTrueCurveUpdateByTrueCurveClientsOnly:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},82832(e,t,i){i.d(t,{$1:()=>y,CR:()=>p,MB:()=>c,PC:()=>g,Yx:()=>u,bP:()=>d});var s=i(67482),n=i(21325),r=i(30524);class o{constructor(e){this.description=e,this.code=null}}class a{constructor(e){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new o(e)}}function u(e){return new a(e)}class l{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function d(e){return new l(e)}const h=new Set;function c(e,t,i,s=!1){h.clear();for(const n in i){const o=e.get(n);if(!o)continue;const a=f(o,i[n]);if(h.add(o.name),o&&(s||o.editable)){const e=(0,r.CJ)(o,a);if(e)return u((0,r.uo)(e,o,a));t[o.name]=a}}for(const t of e.requiredFields??[])if(!h.has(t.name))return u(`missing required field "${t.name}"`);return null}function f(e,t){let i=t;return(0,r.WA)(e)&&"string"==typeof t?i=parseFloat(t):(0,r.yM)(e)&&null!=t&&"string"!=typeof t?i=String(t):(0,r.vE)(e)&&"string"==typeof t&&(i=(0,s._U)(t)),(0,r.WX)(i)}let m;function p(e,t){if(!e||!(0,n.fn)(t))return e;if("rings"in e||"paths"in e){if(null==m)throw new TypeError("geometry engine not loaded");return m.simplify(t,e)}return e}async function y(e,t){!(0,n.fn)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==m&&(m=await i.e(1023).then(i.bind(i,81023))),m}()}const g={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]}},98453(e,t,i){i.d(t,{m:()=>s});const s=new(i(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},2272(e,t,i){i.d(t,{Dl:()=>l,gf:()=>h,jV:()=>u,lF:()=>d});var s=i(92602),n=i(70333),r=i(4718),o=i(84952),a=i(926);function u(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function l(e){return"string"==typeof e?(0,o.An)(e):(0,r.o8)(e)}function d(e,t,i){const s={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))s[n]=r.map(e=>d(e));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i?.[n]);s[n]=t?e:JSON.stringify(e)}else s[n]=t?r:JSON.stringify(r);else s[n]=r}return s}async function h(e,t,r){const o=function(e,t){return e?t&&(0,a.Qc)(e)?t:(0,a.getApiKey)(e)??n.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!n.id&&s.A.request.useIdentity&&await Promise.all([i.e(7632),i.e(6928),i.e(148)]).then(i.bind(i,50148));const u=await n.id.getCredential(e,r);return u?.token}},926(e,t,i){i.d(t,{Dd:()=>c,Jn:()=>f,Qc:()=>m,getApiKey:()=>d,getSessionToken:()=>h});var s=i(92602),n=i(11254),r=i(84952);const o=/^https?:\/\/(i?basemaps|basemapstyles)-api\.arcgis\.com\//i,a=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]),u=new Map;let l=null;function d(e){if(!m(e))return null;const t=t=>t instanceof RegExp?t.test(e):"string"==typeof t&&e.startsWith(t),i=s.A.apiKeys;if(Array.isArray(i.scopes))for(const e of i.scopes)if(Array.isArray(e.urls)){if(e.urls.some(t))return e.token}else if(t(e.urls))return e.token;return i.basemapStyles&&o.test(e)?i.basemapStyles:s.A.apiKey&&/^https?:\/\/.+\.arcgis\.com(\/|$)/i.test(e)?s.A.apiKey:null}async function h(e){if(!s.A.sessions?.basemap?.enabled||!o.test(e))return null;const t=d(e);if(!t)return null;l&&await l;const{styleFamily:i="arcgis",autoRefresh:r,duration:a=43200}=s.A.sessions.basemap,h=`${t}:${i}`,c=u.get(h);if(c&&(!r||c.endTime>Date.now()))return c.sessionToken;let f;l=(0,n.A)("https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/sessions/start",{cacheBust:!0,query:{durationSeconds:a,styleFamily:i,token:t}});try{f=(await l).data,f.endTime-=5e3,u.set(h,f)}finally{l=null}return f.sessionToken}function c(){return null!=s.A.apiKey||null!=s.A.apiKeys.basemapStyles}function f(e,t){return t?m(e):null!=d(e)}function m(e){const t=(0,r.$z)(e,!0);return!!t&&!a.has(t)&&!e.endsWith("/sharing/rest/generateToken")}},93470(e,t,i){i.d(t,{Cb:()=>r,HW:()=>d,JR:()=>n,JZ:()=>u,WR:()=>a,b6:()=>h,fT:()=>s,nC:()=>l,yM:()=>o});const s=[252,146,31,255],n=[153,153,153,255],r={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},a={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},u={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},d={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},h={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[926,4948],{66344(e,t,i){i.d(t,{q:()=>a});const s=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class n{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._users=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._users.clear(),this._db.clear()}register(e){this._users.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._users.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}getSize(e,t){const i=this._db.get(e.id+t);return i?.size??0}put(e,t,i,n,o){t=e.id+t;const a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==i&&this._notifyRemove(t,a.entry,a.size,0)),n>this._maxSize)return void this._notifyRemove(t,i,n,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return s||console.warn(`Refusing to cache entry with size ${n} for key ${t}`),void this._notifyRemove(t,i,0,0);const u=1+Math.max(o,-4)- -3;this._db.set(t,new r(i,n,u)),this._size+=n,e.size+=n,this._checkSize()}updateSize(e,t){t=e.id+t;const i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let s=i.entry.usedMemory;for(;s>this._maxSize;){const e=this._notifyRemove(t,i.entry,s,1);if(!(null!=e&&e>0))return void this._db.delete(t);s=e}i.size=s,this._size+=s,e.size+=s,this._checkSize()}pop(e,t){t=e.id+t;const i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;const i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){const i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){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.forEach(i=>{const{id:n,name:r}=i;if(s.startsWith(n)){const i=t[r]||0;t[r]=i+e.size}})});const s={};this._users.forEach(e=>{const i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!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.forEach(e=>e.resetHitRate())}clear(e){const t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._users.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(const[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,s){const n=this._users.get(e.split(o)[0])?.removeFunc,r=n?.(t,s,i);return"number"==typeof r?r:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._checkSizeLimits(this.maxSize)}setMaxSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){const i=t??this;if(i.size<=e)return;const s=t?.id;let n=!0;for(;n;){n=!1;for(const[r,a]of this._db)if(0===a.lifetime&&(!s||r.startsWith(s))){const s=t??this._users.get(r.split(o)[0]);if(this._purgeItem(r,a,s),i.size<=.9*e)return;n||=this._db.has(r)}}for(const[n,r]of this._db)if(!s||n.startsWith(s)){const s=t??this._users.get(n.split(o)[0]);if(this._purgeItem(n,r,s),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);const s=this._notifyRemove(e,t.entry,t.size,1);null!=s&&s>0&&(this._size+=s,i&&(i.size+=s),t.lives=t.lifetime,t.size=s,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new n(0);class r{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const o=":";class a{constructor(e,t){this.removeFunc=t,this._storage=new n,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy(),this._storage=null}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},67482(e,t,i){function s(e){return null!=a(e)||null!=o(e)}function n(e){return u.test(e)}function r(e){return a(e)??o(e)}function o(e){const t=new Date(e);return function(e,t){if(Number.isNaN(e.getTime()))return!1;let i=!0;if(d&&/\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=!l.test(e[s]),s++;i=!t}}return i}(t,e)?Number.isNaN(t.getTime())?null:t.getTime()-6e4*t.getTimezoneOffset():null}function a(e){const t=u.exec(e);if(!t?.groups)return null;const i=t.groups,s=+i.year,n=+i.month-1,r=+i.day,o=+(i.hours??"0"),a=+(i.minutes??"0"),l=+(i.seconds??"0");if(o>23)return null;if(a>59)return null;if(l>59)return null;const d=i.ms??"0",h=d?+d.padEnd(3,"0").slice(0,3):0;let c;if(i.isUTC||!i.offsetSign)c=Date.UTC(s,n,r,o,a,l,h);else{const e=+i.offsetHours,t=+i.offsetMinutes;c=6e4*("+"===i.offsetSign?-1:1)*(60*e+t)+Date.UTC(s,n,r,o,a,l,h)}return Number.isNaN(c)?null:c}i.d(t,{Br:()=>n,Cq:()=>s,_U:()=>r});const u=/^(?:(?<year>-?\d{4,})-(?<month>\d{2})-(?<day>\d{2}))(?:T(?<hours>\d{2}):(?<minutes>\d{2}):(?<seconds>\d{2})(?:\.(?<ms>\d+))?)?(?:(?<isUTC>Z)|(?:(?<offsetSign>\+|-)(?<offsetHours>\d{2}):(?<offsetMinutes>\d{2})))?$/,l=/^((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,d=!Number.isNaN(new Date("technology 10").getTime())},75503(e,t,i){i.d(t,{wq:()=>a});var s=i(4576),n=i(21818),r=(i(44208),i(15142)),o=i(11006);class a{constructor(e=9,t){this._compareMinX=c,this._compareMinY=f,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),I.prune(),S.prune(),v.prune(),B.prune()}all(e){u(this._data,e)}search(e,t){let i=this._data;const s=this._toBBox;if(b(e,i))for(I.clear();i;){for(let n=0,r=i.children.length;n<r;n++){const r=i.children[n],o=i.leaf?s(r):r;b(e,o)&&(i.leaf?t(r):_(e,o)?u(r,t):I.push(r))}i=I.pop()}}collides(e){let t=this._data;const i=this._toBBox;if(!b(e,t))return!1;for(I.clear();t;){for(let s=0,n=t.children.length;s<n;s++){const n=t.children[s],r=t.leaf?i(n):n;if(b(e,r)){if(t.leaf||_(e,r))return!0;I.push(n)}}t=I.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){const e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new T([]),this}remove(e){if(!e)return this;let t,i=this._data,r=null,o=0,a=!1;const u=this._toBBox(e);for(v.clear(),B.clear();i||v.length>0;){if(i||(i=v.pop(),r=v.data[v.length-1],o=B.pop()??0,a=!0),i.leaf&&(t=(0,s.qh)(i.children,(0,n.z)(e),i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),v.push(i),this._condense(v),this;a||i.leaf||!_(i,u)?r?(o++,i=r.children[o],a=!1):i=null:(v.push(i),B.push(o),o=0,r=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,i,s){const n=i-t+1;let r=this._maxEntries;if(n<=r){const s=new T(e.slice(t,i+1));return l(s,this._toBBox),s}s||(s=Math.ceil(Math.log(n)/Math.log(r)),r=Math.ceil(n/r**(s-1)));const o=new z([]);o.height=s;const a=Math.ceil(n/r),u=a*Math.ceil(Math.sqrt(r));x(e,t,i,u,this._compareMinX);for(let n=t;n<=i;n+=u){const t=Math.min(n+u-1,i);x(e,n,t,a,this._compareMinY);for(let i=n;i<=t;i+=a){const n=Math.min(i+a-1,t);o.children.push(this._build(e,i,n,s-1))}}return l(o,this._toBBox),o}_insert(e,t,i){const s=this._toBBox,n=i?e:s(e);v.clear();const r=function(e,t,i,s){for(;s.push(t),!0!==t.leaf&&s.length-1!==i;){let i,s=1/0,n=1/0;for(let r=0,o=t.children.length;r<o;r++){const o=t.children[r],a=m(o),u=y(e,o)-a;u<n?(n=u,s=a<s?a:s,i=o):u===n&&a<s&&(s=a,i=o)}t=i||t.children[0]}return t}(n,this._data,t,v);for(r.children.push(e),h(r,n);t>=0&&v.data[t].children.length>this._maxEntries;)this._split(v,t),t--;!function(e,t,i){for(let s=i;s>=0;s--)h(t.data[s],e)}(n,v,t)}_split(e,t){const i=e.data[t],s=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,s);const r=this._chooseSplitIndex(i,n,s);if(!r)return;const o=i.children.splice(r,i.children.length-r),a=i.leaf?new T(o):new z(o);a.height=i.height,l(i,this._toBBox),l(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this._data=new z([e,t]),this._data.height=e.height+1,l(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let s,n,r;s=n=1/0;for(let o=t;o<=i-t;o++){const t=d(e,0,o,this._toBBox),a=d(e,o,i,this._toBBox),u=g(t,a),l=m(t)+m(a);u<s?(s=u,r=o,n=l<n?l:n):u===s&&l<n&&(n=l,r=o)}return r}_chooseSplitAxis(e,t,i){const s=e.leaf?this._compareMinX:c,n=e.leaf?this._compareMinY:f;this._allDistMargin(e,t,i,s)<this._allDistMargin(e,t,i,n)&&e.children.sort(s)}_allDistMargin(e,t,i,s){e.children.sort(s);const n=this._toBBox,r=d(e,0,t,n),o=d(e,i-t,i,n);let a=p(r)+p(o);for(let s=t;s<i-t;s++){const t=e.children[s];h(r,e.leaf?n(t):t),a+=p(r)}for(let s=i-t-1;s>=t;s--){const t=e.children[s];h(o,e.leaf?n(t):t),a+=p(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const n=e.data[t-1],r=n.children;r.splice((0,s.qh)(r,i,r.length,n.indexHint),1)}else this.clear();else l(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this._compareMinX=new Function("a","b",t.join(e[0])),this._compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function u(e,t){let i=e;for(S.clear();i;){if(!0===i.leaf)for(const e of i.children)t((0,n.z)(e));else S.pushArray(i.children);i=S.pop()??null}}function l(e,t){d(e,0,e.children.length,t,e)}function d(e,t,i,s,n){n||(n=new T([])),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r,o=t;o<i;o++)r=e.children[o],h(n,e.leaf?s(r):r);return n}function h(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function c(e,t){return e.minX-t.minX}function f(e,t){return e.minY-t.minY}function m(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function y(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const i=Math.max(e.minX,t.minX),s=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,n-i)*Math.max(0,r-s)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function b(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function x(e,t,i,s,n){const r=[t,i];for(;r.length;){const t=r.pop(),i=r.pop();if(t-i<=s)continue;const a=i+Math.ceil((t-i)/s/2)*s;(0,o.q)(e,a,i,t,n),r.push(i,a,a,t)}}const I=new r.A,S=new r.A,v=new r.A,B=new r.A({deallocator:void 0});class M{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class F extends M{constructor(){super(...arguments),this.height=1,this.indexHint=new s.vW}}class T extends F{constructor(e){super(),this.children=e,this.leaf=!0}}class z extends F{constructor(e){super(),this.children=e,this.leaf=!1}}},36708(e,t,i){i.d(t,{C_:()=>c,OH:()=>p,Vh:()=>y,on:()=>h,pc:()=>g,wB:()=>u,z7:()=>l});var s=i(37955),n=i(36563),r=i(97768),o=i(74887),a=i(14012);function u(e,t,i={}){return d(e,t,i,f)}function l(e,t,i={}){return d(e,t,i,m)}function d(e,t,i={},s){let n=null;const o=i.once?(e,i)=>{s(e)&&((0,r.xt)(n),t(e,i))}:(e,i)=>{s(e)&&t(e,i)};if(n=(0,a.Cn)(e,o,i.sync,i.equals),i.initial){const t=e();o(t,t)}return n}function h(e,t,i,o={}){let a=null,l=null,d=null;function h(){a&&l&&(l.remove(),o.onListenerRemove?.(a),a=null,l=null)}function c(e){o.once&&o.once&&(0,r.xt)(d),i(e)}const f=u(e,(e,i)=>{h(),(0,s.wb)(e)&&(a=e,l=(0,s.on)(e,t,c),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return d=(0,n.hA)(()=>{f.remove(),h()}),d}function c(e,t){return function(e,t,i){if((0,o.G4)(i))return Promise.reject((0,o.NK)());const s=e();if(t?.(s))return Promise.resolve(s);let a=null;function u(){a=(0,r.xt)(a)}return new Promise((s,r)=>{a=(0,n.vE)([(0,o.u7)(i,()=>{u(),r((0,o.NK)())}),d(e,e=>{u(),s(e)},{sync:!1,once:!0},t??f)])})}(e,m,t)}function f(e){return!0}function m(e){return!!e}i(80559);const p={sync:!0},y={initial:!0},g={sync:!0,initial:!0}},60408(e,t,i){function s(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function n(e){return void 0!==e.points}function r(e){return void 0!==e.x&&void 0!==e.y}function o(e){return void 0!==e.paths||void 0!==e.curvePaths}function a(e){return void 0!==e.rings||void 0!==e.curveRings}function u(e){return"object"==typeof e&&"vertexAttributes"in e}function l(e){return e?r(e)?"esriGeometryPoint":o(e)?"esriGeometryPolyline":a(e)?"esriGeometryPolygon":s(e)?"esriGeometryEnvelope":n(e)?"esriGeometryMultipoint":null:null}function d(e){return null!=e&&("hasZ"in e&&e.hasZ||"z"in e&&null!=e.z)}function h(e){return null!=e&&("hasM"in e&&e.hasM||"m"in e&&null!=e.m)}i.d(t,{$B:()=>l,Bi:()=>a,Pv:()=>d,Rg:()=>o,U9:()=>n,W0:()=>h,ZC:()=>s,fT:()=>r,uW:()=>u})},65864(e,t,i){i.d(t,{rS:()=>d,xD:()=>c});var s=i(5443),n=i(91075),r=i(48526),o=i(86738),a=i(39829),u=i(82799),l=i(60408);function d(e){return null==e?null:e instanceof n.A?e:(0,l.fT)(e)?o.A.fromJSON(e):(0,l.Rg)(e)?u.A.fromJSON(e):(0,l.Bi)(e)?a.A.fromJSON(e):(0,l.U9)(e)?r.A.fromJSON(e):(0,l.ZC)(e)?s.A.fromJSON(e):null}const h={esriGeometryPoint:o.A,esriGeometryPolyline:u.A,esriGeometryPolygon:a.A,esriGeometryEnvelope:s.A,esriGeometryMultipoint:r.A,esriGeometryMultiPatch:a.A};function c(e){return e&&h[e]||null}},6518(e,t,i){i.d(t,{F:()=>a});var s=i(44208),n=i(75503),r=i(19419);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.wq(9,(0,s.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((i,s)=>{e[t++]=s}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=(0,r.Ie)();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,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()))}}},83221(e,t,i){i.d(t,{A:()=>m});var s=i(4576),n=i(49186),r=i(65529),o=i(53966),a=i(70328),u=i(19419),l=i(90708),d=i(6518),h=i(51441),c=i(37730);const f=(0,a.vt)();class m{constructor(e){this.geometryInfo=e,this._boundsStore=new d.F,this._featuresById=new Map,this._usedMemory=0,this.events=new r.bk,this.featureAdapter=c.T}get usedMemory(){return this._usedMemory}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=>{null!=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)}}getFullExtent(e){if(null==this.fullBounds)return null;const[t,i,s,n]=this.fullBounds;return{xmin:t,ymin:i,xmax:s,ymax:n,spatialReference:(0,h.ag)(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(s.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}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){for(const i of e){const e=this._boundsStore.get(i.objectId);e&&t((0,a.Jt)(f,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(null==t)return void o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e}));const i=this._featuresById.get(t);let s;if(i?(e.displayId=i.displayId,s=this._boundsStore.get(t),this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0):null!=this.onFeatureAdd&&this.onFeatureAdd(e),!e.geometry?.coords?.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);s=(0,l.jQ)(null!=s?s:(0,u.vt)(),e.geometry),null!=s&&this._boundsStore.set(t,s),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0}_upsert(e){const t=e?.objectId;if(null==t)return o.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new n.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const i=this._featuresById.get(t);if(!i)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;const{geometry:s,attributes:r}=e;for(const e in r)i.attributes[e]=r[e];return s&&(i.geometry=s,this._boundsStore.set(t,(0,l.jQ)((0,u.vt)(),s)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);const t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}},37730(e,t,i){i.d(t,{T:()=>n});var s=i(43334);const n={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t,i)=>new s.Om(t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)}},33032(e,t,i){i.d(t,{H:()=>n,L:()=>s});const s=1;function n(e,t){let i=0;for(const s of t){const t=s.attributes?.[e];"number"==typeof t&&isFinite(t)&&(i=Math.max(i,t))}return i}},29432(e,t,i){i.r(t),i.d(t,{default:()=>S});var s=i(49186),n=i(60408),r=i(21325),o=i(90708),a=i(33032),u=i(83221),l=i(31464),d=i(56390),h=i(64714),c=i(82832),f=i(95466),m=i(98453),p=i(30524),y=i(98623);const g=r.KK,_={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:r.KK},b={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0},queryBinsCapabilities:c.PC};function x(e){return(0,n.fT)(e)?null!=e.z:!!e.hasZ}function I(e){return(0,n.fT)(e)?null!=e.m:!!e.hasM}class S{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const t=[],{features:i}=e,n=this._inferLayerProperties(i,e.fields),r=e.fields||[],o=null!=e.hasM?e.hasM:!!n.hasM,c=null!=e.hasZ?e.hasZ:!!n.hasZ,x=!e.spatialReference&&!n.spatialReference,I=x?g:e.spatialReference||n.spatialReference,S=x?_:null,v=e.geometryType||n.geometryType,B=!v;let M=e.objectIdField||n.objectIdField,F=e.timeInfo;const T=new f.A(r);if(!B&&(x&&t.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!v))throw new s.A("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!M)throw new s.A("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&M!==n.objectIdField&&(t.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${M}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),M=n.objectIdField),M&&!n.objectIdField){const e=T.get(M);e?(M=e.name,e.type="esriFieldTypeOID",e.editable=!1,e.nullable=!1):r.unshift({alias:M,name:M,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const e of r){if(null==e.name&&(e.name=e.alias),null==e.alias&&(e.alias=e.name),!e.name)throw new s.A("feature-layer:invalid-field-name","field name is missing",{field:e});if(e.name===M&&(e.type="esriFieldTypeOID"),!m.m.jsonValues.includes(e.type))throw new s.A("feature-layer:invalid-field-type",`invalid type for field "${e.name}"`,{field:e});null==e.length&&(e.length=(0,p._b)(e))}const z={};for(const e of r)if("esriFieldTypeOID"!==e.type&&"esriFieldTypeGlobalID"!==e.type){const t=(0,p.lD)(e);void 0!==t&&(z[e.name]=t)}if(F){if(F.startTimeField){const e=T.get(F.startTimeField);e?(F.startTimeField=e.name,e.type="esriFieldTypeDate"):F.startTimeField=null}if(F.endTimeField){const e=T.get(F.endTimeField);e?(F.endTimeField=e.name,e.type="esriFieldTypeDate"):F.endTimeField=null}if(F.trackIdField){const e=T.get(F.trackIdField);e?F.trackIdField=e.name:(F.trackIdField=null,t.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:F}}))}F.startTimeField||F.endTimeField||(t.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:F}}),F=null)}const A=T.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??y.n$}:null;this._createDefaultAttributes=(0,h.Vx)(z,M);const w={warnings:t,featureErrors:[],layerDefinition:{...b,drawingInfo:(0,h.F0)(v),templates:(0,h.e2)(z),extent:S,geometryType:v,objectIdField:M,fields:r,hasZ:c,hasM:o,timeInfo:F,dateFieldsTimeReference:A},assignedObjectIds:{}},E={type:"object-id",fieldName:M};if(this._queryEngine=new d.do({fieldsIndex:f.A.fromLayerJSON({fields:r,timeInfo:F,dateFieldsTimeReference:A}),geometryType:v,hasM:o,hasZ:c,featureIdInfo:E,spatialReference:I,featureStore:new u.A({geometryType:v,hasM:o,hasZ:c}),timeInfo:F}),!i?.length)return this._nextObjectId=a.L,w;const R=(0,a.H)(M,i);return this._nextObjectId=R+1,await(0,l.Nk)(i,I),this._loadInitialFeatures(w,i)}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([(0,c.$1)(t,i),(0,l.Nk)(e.adds,t),(0,l.Nk)(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}queryAttributeBins(e,t={}){return this._queryEngine.executeAttributeBinsQuery(e,t.signal)}_inferLayerProperties(e,t){let i,s,r=null,o=null,a=null;for(const t of e){const e=t.geometry;if(null!=e&&(r||(r=(0,n.$B)(e)),o||(o=e.spatialReference),null==i&&(i=x(e)),null==s&&(s=I(e)),r&&o&&null!=i&&null!=s))break}if(t&&t.length){let e=null;t.some(t=>{const i="esriFieldTypeOID"===t.type,s=!t.type&&t.name&&"objectid"===t.name.toLowerCase();return e=t,i||s})&&(a=e.name)}return{geometryType:r,spatialReference:o,objectIdField:a,hasM:s,hasZ:i}}async _loadInitialFeatures(e,t){const{geometryType:i,hasM:s,hasZ:r,objectIdField:a,spatialReference:u,featureStore:d,fieldsIndex:h}=this._queryEngine,f=[],m={type:"object-id",fieldName:a};for(const s of t){if(null!=s.uid&&(e.assignedObjectIds[s.uid]=-1),s.geometry&&i!==(0,n.$B)(s.geometry)){e.featureErrors.push((0,c.Yx)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=(0,c.MB)(h,t,s.attributes,!0);r?e.featureErrors.push(r):(this._assignObjectId(t,s.attributes,!0),s.attributes=t,null!=s.uid&&(e.assignedObjectIds[s.uid]=s.attributes[a]),null!=s.geometry&&(s.geometry=(0,l.Cv)(s.geometry,s.geometry.spatialReference,u)),f.push(s))}d.addMany((0,o.Di)([],f,i,r,s,m));const{fullExtent:p,timeExtent:y}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=p,y){const{start:t,end:i}=y;e.layerDefinition.timeInfo.timeExtent=[t,i]}return e}async _applyEdits(e){const{adds:t,updates:i,deletes:s}=e,n={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(n,t),i?.length&&this._applyUpdateEdits(n,i),s?.length){for(const e of s)n.deleteResults.push((0,c.bP)(e));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:r,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();return{extent:r,timeExtent:o,featureEditResults:n}}_applyAddEdits(e,t){const{addResults:i}=e,{geometryType:s,hasM:r,hasZ:a,objectIdField:u,spatialReference:d,featureStore:h,featureIdInfo:f,fieldsIndex:m}=this._queryEngine,p=[];for(const r of t){if(r.geometry&&s!==(0,n.$B)(r.geometry)){i.push((0,c.Yx)("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),o=(0,c.MB)(m,t,r.attributes);if(o)i.push(o);else{if(this._assignObjectId(t,r.attributes),r.attributes=t,null!=r.uid){const t=r.attributes[u];e.uidToObjectId[r.uid]=t}if(null!=r.geometry){const e=r.geometry.spatialReference??d;r.geometry=(0,l.Cv)((0,c.CR)(r.geometry,e),e,d)}p.push(r),i.push((0,c.bP)(r.attributes[u]))}}h.addMany((0,o.Di)([],p,s,a,r,f))}_applyUpdateEdits({updateResults:e},t){const{geometryType:i,hasM:s,hasZ:r,objectIdField:a,spatialReference:u,featureStore:d,fieldsIndex:h,featureIdInfo:f}=this._queryEngine;for(const m of t){const{attributes:t,geometry:p}=m,y=t?.[a];if(null==y){e.push((0,c.Yx)(`Identifier field ${a} missing`));continue}if(!d.has(y)){e.push((0,c.Yx)(`Feature with object id ${y} missing`));continue}const g=(0,o.oN)(d.getFeature(y),i,r,s);if(null!=p){if(i!==(0,n.$B)(p)){e.push((0,c.Yx)("Incorrect geometry type."));continue}const t=p.spatialReference??u;g.geometry=(0,l.Cv)((0,c.CR)(p,t),t,u)}if(t){const i=(0,c.MB)(h,g.attributes,t);if(i){e.push(i);continue}}d.add((0,o.E2)(g,i,r,s,f)),e.push((0,c.bP)(y))}}_assignObjectId(e,t,i=!1){const s=this._queryEngine.objectIdField;i&&t&&isFinite(t[s])?e[s]=t[s]:e[s]=this._nextObjectId++}}},64714(e,t,i){i.d(t,{F0:()=>a,Vx:()=>d,e2:()=>c,f:()=>f});var s=i(44208),n=i(4718),r=i(99352),o=i(93470);function a(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?o.Cb:"esriGeometryPolyline"===e?o.yM:o.WR}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function d(e,t){if((0,s.A)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let i=`this${h(t)} = null;`;for(const t in e)i+=`this${h(t)} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${i};\n }\n }\n `)();return()=>new s}catch(i){return()=>({[t]:null,...e})}}function h(e){return u.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,n.o8)(e)}}]}function f(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:r.F,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:r.P,editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsTrueCurveUpdate:t,supportsTrueCurveUpdateByTrueCurveClientsOnly:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}},82832(e,t,i){i.d(t,{$1:()=>y,CR:()=>p,MB:()=>c,PC:()=>g,Yx:()=>u,bP:()=>d});var s=i(67482),n=i(21325),r=i(30524);class o{constructor(e){this.description=e,this.code=null}}class a{constructor(e){this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error=new o(e)}}function u(e){return new a(e)}class l{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function d(e){return new l(e)}const h=new Set;function c(e,t,i,s=!1){h.clear();for(const n in i){const o=e.get(n);if(!o)continue;const a=f(o,i[n]);if(h.add(o.name),o&&(s||o.editable)){const e=(0,r.CJ)(o,a);if(e)return u((0,r.uo)(e,o,a));t[o.name]=a}}for(const t of e.requiredFields??[])if(!h.has(t.name))return u(`missing required field "${t.name}"`);return null}function f(e,t){let i=t;return(0,r.WA)(e)&&"string"==typeof t?i=parseFloat(t):(0,r.yM)(e)&&null!=t&&"string"!=typeof t?i=String(t):(0,r.vE)(e)&&"string"==typeof t&&(i=(0,s._U)(t)),(0,r.WX)(i)}let m;function p(e,t){if(!e||!(0,n.fn)(t))return e;if("rings"in e||"paths"in e){if(null==m)throw new TypeError("geometry engine not loaded");return m.simplify(t,e)}return e}async function y(e,t){!(0,n.fn)(e)||"esriGeometryPolygon"!==t&&"esriGeometryPolyline"!==t||await async function(){return null==m&&(m=await i.e(1023).then(i.bind(i,81023))),m}()}const g={supportsAutoIntervalBin:!0,supportsFixedIntervalBin:!0,supportsFixedBoundariesBin:!0,supportsDateBin:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsNormalization:!0,supportedStatisticTypes:["COUNT","SUM","AVG","VAR","STDDEV","MIN","MAX","PERCENTILE_CONT","PERCENTILE_DISC","CentroidAggregate","EnvelopeAggregate","ConvexHullAggregate"],supportedNormalizationTypes:["field","log","naturalLog","percentOfTotal","squareRoot"]}},98453(e,t,i){i.d(t,{m:()=>s});const s=new(i(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},2272(e,t,i){i.d(t,{Dl:()=>l,gf:()=>h,jV:()=>u,lF:()=>d});var s=i(92602),n=i(70333),r=i(4718),o=i(84952),a=i(926);function u(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function l(e){return"string"==typeof e?(0,o.An)(e):(0,r.o8)(e)}function d(e,t,i){const s={};for(const n in e){if("declaredClass"===n)continue;const r=e[n];if(null!=r&&"function"!=typeof r)if(Array.isArray(r))s[n]=r.map(e=>d(e));else if("object"==typeof r)if(r.toJSON){const e=r.toJSON(i?.[n]);s[n]=t?e:JSON.stringify(e)}else s[n]=t?r:JSON.stringify(r);else s[n]=r}return s}async function h(e,t,r){const o=function(e,t){return e?t&&(0,a.Qc)(e)?t:(0,a.getApiKey)(e)??n.id?.findCredential(e)?.token:null}(e,t);if(o)return o;!n.id&&s.A.request.useIdentity&&await Promise.all([i.e(7632),i.e(6618),i.e(148)]).then(i.bind(i,50148));const u=await n.id.getCredential(e,r);return u?.token}},926(e,t,i){i.d(t,{Dd:()=>c,Jn:()=>f,Qc:()=>m,getApiKey:()=>d,getSessionToken:()=>h});var s=i(92602),n=i(11254),r=i(84952);const o=/^https?:\/\/(i?basemaps|basemapstyles)-api\.arcgis\.com\//i,a=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]),u=new Map;let l=null;function d(e){if(!m(e))return null;const t=t=>t instanceof RegExp?t.test(e):"string"==typeof t&&e.startsWith(t),i=s.A.apiKeys;if(Array.isArray(i.scopes))for(const e of i.scopes)if(Array.isArray(e.urls)){if(e.urls.some(t))return e.token}else if(t(e.urls))return e.token;return i.basemapStyles&&o.test(e)?i.basemapStyles:s.A.apiKey&&/^https?:\/\/.+\.arcgis\.com(\/|$)/i.test(e)?s.A.apiKey:null}async function h(e){if(!s.A.sessions?.basemap?.enabled||!o.test(e))return null;const t=d(e);if(!t)return null;l&&await l;const{styleFamily:i="arcgis",autoRefresh:r,duration:a=43200}=s.A.sessions.basemap,h=`${t}:${i}`,c=u.get(h);if(c&&(!r||c.endTime>Date.now()))return c.sessionToken;let f;l=(0,n.A)("https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/sessions/start",{cacheBust:!0,query:{durationSeconds:a,styleFamily:i,token:t}});try{f=(await l).data,f.endTime-=5e3,u.set(h,f)}finally{l=null}return f.sessionToken}function c(){return null!=s.A.apiKey||null!=s.A.apiKeys.basemapStyles}function f(e,t){return t?m(e):null!=d(e)}function m(e){const t=(0,r.$z)(e,!0);return!!t&&!a.has(t)&&!e.endsWith("/sharing/rest/generateToken")}},93470(e,t,i){i.d(t,{Cb:()=>r,HW:()=>d,JR:()=>n,JZ:()=>u,WR:()=>a,b6:()=>h,fT:()=>s,nC:()=>l,yM:()=>o});const s=[252,146,31,255],n=[153,153,153,255],r={type:"esriSMS",style:"esriSMSCircle",size:6,color:s,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},o={type:"esriSLS",style:"esriSLSSolid",width:.75,color:s},a={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},u={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},d={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},h={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4579,6061,6960,7992,9397],{61691(t,e,r){r.d(e,{G:()=>n});class n{*[Symbol.iterator](){let t=this.next();for(;t;)yield t,t=this.next()}}},76061(t,e,r){r.d(e,{S:()=>s});var n=r(61691);class s extends n.G{constructor(t){super(),this.m_iGeom=-1,this.m_aGeoms=t?t.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){const t=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,t}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},9093(t,e,r){function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}r.d(e,{o8:()=>s,vt:()=>n,zK:()=>i});const i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:s,create:n,fromValues:function(t,e,r,n,s,i,o,a,h,u,c,l,f,m,g,x){return[t,e,r,n,s,i,o,a,h,u,c,l,f,m,g,x]}},Symbol.toStringTag,{value:"Module"}))},69397(t,e,r){r.d(e,{Qf:()=>h,Qh:()=>o,RS:()=>s,Ul:()=>m,lM:()=>i,qK:()=>c});var n=r(34275);const s=16;function i(t){if(!t)return 0;let e=c;for(const r in t)t.hasOwnProperty(r)&&(e+=a(t[r],!1));return e}function o(t){if(!t)return 0;if("number"==typeof t[0])return h(t);if(Array.isArray(t))return function(t){const e=t.length;if(0===e||"number"==typeof t[0])return u(t,8);let r=l;for(let n=0;n<e;n++)r+=a(t[n]);return r}(t);let e=c;for(const r in t)t.hasOwnProperty(r)&&(e+=a(t[r]));return e}function a(t,e=!0){switch(typeof t){case"object":return e?o(t):c;case"string":return function(t){return 32+t.length}(t);case"number":return s;case"boolean":return 4;default:return 8}}function h(...t){return t.reduce((t,e)=>t+(e?(0,n.iu)(e)?e.byteLength+f:Array.isArray(e)?u(e,s):0:0),0)}function u(t,e){return l+t.length*e}const c=32,l=16,f=145,m=64},87992(t,e,r){r.d(e,{JR:()=>A,ME:()=>E,MY:()=>O,NO:()=>C,Nh:()=>_,V2:()=>F,_s:()=>R,e6:()=>Y,gh:()=>I,tr:()=>N,uX:()=>d});var n=r(5482),s=r(69397),i=r(16930),o=(r(70328),r(19419)),a=r(60408),h=r(21325),u=r(513),c=r(50954),l=r(79567),f=r(52006),m=r(49663),g=r(46068),x=r(92722);class d{constructor({type:t,spatialReference:e,vertexCount:r,vertexXY:n,vertexZ:s,vertexM:i,partCount:o,partOffsets:a,partFlags:h,segmentFlags:u,segmentIndices:c,segmentParams:l,segmentCountArc:f,segmentCountBezier:m}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=t,this.spatialReference=e,this.vertexCount=r,this.vertexXY=n,this.vertexZ=s,this.vertexM=i,this.partCount=o,this.partOffsets=a,this.partFlags=h,this.segmentFlags=u,this.segmentIndices=c,this.segmentParams=l,this.segmentCountArc=f,this.segmentCountBezier=m}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){const{segmentCount:t,segmentCountArc:e,segmentCountBezier:r}=this;return t&&t-e-r}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}hasCurves(){return null!=this.segmentFlags}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function t(t){return t?s.Ul+t.byteLength:0}return t(this.vertexXY)+t(this.vertexZ)+t(this.vertexM)+t(this.partOffsets)+t(this.partFlags)+t(this.segmentFlags)+t(this.segmentIndices)+t(this.segmentParams)}clone(){const{type:t,vertexCount:e,partCount:r,hasZ:n,hasM:s,segmentCountArc:i,segmentCountBezier:o}=this,a=F(t,e,r,n,s,this.hasCurves(),i,o);a.spatialReference=this.spatialReference;const{vertexXY:h,vertexZ:u,vertexM:c}=this;if(a.vertexXY.set(h.subarray(0,2*e),0),a.vertexZ?.set(u.subarray(0,e),0),a.vertexM?.set(c.subarray(0,e),0),this.isMultipart()){const{partOffsets:t,partFlags:e}=this;a.partFlags.set(e.subarray(0,r+1)),a.partOffsets.set(t.subarray(0,r+1))}if(this.hasCurves()){const{segmentFlags:t,segmentIndices:r,segmentParams:n,segmentParamCount:s}=this;a.segmentFlags.set(t.subarray(0,e),0),a.segmentIndices.set(r.subarray(0,e),0),a.segmentParams.set(n.subarray(0,s),0)}return a}equals(t){return this.equalsWithinTolerance(t,0)}equalsWithinTolerance(t,e){if(null==t)return!1;if(this===t)return!0;if(!(0,h.aI)(this.spatialReference,t.spatialReference))return!1;if(this.vertexCount!==t.vertexCount||this.partCount!==t.partCount)return!1;if(this.hasZ!==t.hasZ||this.hasM!==t.hasM)return!1;if(this.hasCurves()!==t.hasCurves()||this.segmentCountArc!==t.segmentCountArc||this.segmentCountBezier!==t.segmentCountBezier)return!1;const r=0===e?(t,e)=>t!==e||isNaN(t)!==isNaN(e):(t,r)=>Math.abs(t-r)>e||isNaN(t)!==isNaN(r);for(let e=0;e<this.vertexCount;++e)if(r(this.vertexXY[2*e],t.vertexXY[2*e])||r(this.vertexXY[2*e+1],t.vertexXY[2*e+1]))return!1;if(this.hasZ)for(let e=0;e<this.vertexCount;++e)if(r(this.vertexZ[e],t.vertexZ[e]))return!1;if(this.hasM)for(let e=0;e<this.vertexCount;++e)if(r(this.vertexM[e],t.vertexM[e]))return!1;for(let e=0;e<this.partCount;++e)if(this.partFlags[e]!==t.partFlags[e]||this.partOffsets[e]!==t.partOffsets[e])return!1;if(this.hasCurves()){for(let e=0;e<this.vertexCount;++e)if(this.segmentFlags[e]!==t.segmentFlags[e]||this.segmentIndices[e]!==t.segmentIndices[e])return!1;for(let e=0;e<this.segmentParamCount;++e)if(r(this.segmentParams[e],t.segmentParams[e]))return!1}return!0}get parts(){return this.isMultipart()?new p(this):[][Symbol.iterator]()}}class p{constructor(t){this.geometry=t,this.value=new y(t)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class y{constructor(t){this.geometry=t,this.index=-1,this._readVertex=b(t),this._segments=new v(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){const t=this.geometry.partOffsets;return t[this.index+1]-t[this.index]}}class v{constructor(t){this._part=t,this._partStart=0,this._partEnd=0,this._isPolygon="polygon"===t.geometry.type,this.value=new M(t.geometry)}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;const t=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=t&&this._isPolygon?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){const{index:t}=this._part,e=this._part.geometry.partOffsets;this._partStart=e[t],this._partEnd=e[t+1]-(this._isPolygon?1:2),this.value.indexOfStartVertex=this._partStart-1}}class M{constructor(t){this.geometry=t,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=b(t)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){const t=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===t)return this.end;const e=this.geometry.segmentParams;let r=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===t){const t=e[r++],n=e[r++],s=e[r++],i=e[r++];return{b:[this.end,[t,n],[s,i]]}}const n=e[r++],s=e[r++],i=e[r++],o=e[r++],a=e[r++],h=e[r++];r++,r++;const u=e[r++],c=e[r++];if(!Boolean(4&n)&&1===i)return{c:[this.end,[u,c]]};const l=2&n?0:1,f=1&n?0:1;return{a:[this.end,[a,h],l,f,o,s,i]}}}function C(t,e){const r={stack:[],error:void 0,hasError:!1};try{return e??=(0,o.Ie)(),(0,n.mS)(r,new P(t,["vertexZ","vertexM","spatialReference"]),!1),(0,o.bx)(e,function(t){let e;const{vertexCount:r,vertexXY:s,vertexZ:i,vertexM:a}=t,h=S(t);if(t.hasCurves()){const r={stack:[],error:void 0,hasError:!1};try{(0,n.mS)(r,new P(t,["vertexZ","vertexM"]),!1);const s=(0,o.Ie)();for(const e of t.parts){let t=e.startVertex;for(const{curve:r}of e.segments)(0,l.e)(s,t,r),t=(0,f.yP)(r)}const[i,a,u,c]=s;e={xmin:i,ymin:a,xmax:u,ymax:c,spatialReference:h}}catch(t){r.error=t,r.hasError=!0}finally{(0,n.hk)(r)}}else{let t,n,i,o;t=n=1/0,i=o=-1/0;for(let e=0;e<r;++e){const r=s[2*e],a=s[2*e+1];t=Math.min(t,r),i=Math.max(i,r),n=Math.min(n,a),o=Math.max(o,a)}e={xmin:t,ymin:n,xmax:i,ymax:o,spatialReference:h}}if(i){let t=1/0,r=-1/0;for(const e of i)t=Math.min(t,e),r=Math.max(r,e);e.zmin=t,e.zmax=r}if(a){let t=1/0,r=-1/0;for(const e of a)t=Math.min(t,e),r=Math.max(r,e);e.mmin=t,e.mmax=r}return e}(t)),e}catch(t){r.error=t,r.hasError=!0}finally{(0,n.hk)(r)}}function E(t){let e,r,n;if((0,a.fT)(t)){n="point";const{x:s,y:i,z:o,m:a}=t,h=[s,i];null!=o&&h.push(o),null!=a&&h.push(a),r=[[h]],e=1}else(0,a.U9)(t)?(n="multipoint",r=[t.points],e=t.points.length):(0,a.Rg)(t)?(n="polyline",r=t.curvePaths??t.paths,e=r.reduce((t,e)=>t+e.length,0)):(n="polygon",r=t.curveRings??t.rings,e=r.reduce((t,e)=>(0===e.length||(t+=e.length,w(e[0],(0,f.yP)(e.at(-1)))&&--t),t),0));const s=F(n,e,n.includes("point")?0:r.length,(0,a.Pv)(t),(0,a.W0)(t),(0,f.Ed)(t)),{hasZ:i,hasM:o,vertexXY:h,vertexZ:u,vertexM:c}=s;function l(t){h[2*g]=t[0],h[2*g+1]=t[1],i&&(u[g]=t[2]),o&&(c[g]=t[m]),++g}s.spatialReference=t.spatialReference??void 0;const m=s.hasZ?3:2;let g=0;if(!s.isMultipart()){if(!i&&!o){for(const[t,e]of r[0])h[2*g]=t,h[2*g+1]=e,++g;return s}for(const t of r[0])l(t);return s}const x="polygon"===n,{partOffsets:d}=s;let p=0;if(!s.hasCurves()){for(const t of r){if(d[p++]=g,0===t.length)continue;let e=t.length;if(x&&w(t[0],t.at(-1))&&--e,i||o)for(let r=0;r<e;++r)l(t[r]);else for(let r=0;r<e;++r){const[e,n]=t[r];h[2*g]=e,h[2*g+1]=n,++g}}return d[p]=g,s}function y(t){const e=v+t;if(e<=(s.segmentParams?.length??0))return;let r=e*T;r=20*Math.ceil(r/20);const n=s.segmentParams;s.segmentParams=new Float64Array(r),null!=n&&s.segmentParams.set(n)}let v=0;for(const t of r){if(s.partOffsets[p++]=g,0===t.length)continue;const e=t[0];let r=e;for(let e=1;e<t.length;++e){const n=t[e];l(r);const i=g-1;(0,f.wY)(n)?(y(10),++s.segmentCountArc,v=R(r,n,s,i,v),r=n.a[0]):(0,f.DA)(n)?(y(10),++s.segmentCountArc,v=Z(r,n,s,i,v),r=n.a[0]):(0,f.aO)(n)?(y(10),++s.segmentCountArc,v=Y(r,n,s,i,v),r=n.c[0]):(0,f.n1)(n)?(y(4),++s.segmentCountBezier,v=N(0,n,s,i,v),r=n.b[0]):r=n}x&&w(e,r)||l(r)}return s.partOffsets[p]=g,s}function I(t){const e=b(t),{vertexCount:r,partCount:n,hasZ:s,hasM:i}=t,o=S(t);if("point"===t.type){const[e,r]=t.vertexXY,n=t.vertexZ?.[0],s=t.vertexM?.[0];return{x:e,y:r,z:n,m:s,spatialReference:o}}let a=0;if("multipoint"===t.type){const t=[];for(;a<r;)t.push(e(a++));return{points:t,spatialReference:o,hasZ:s,hasM:i}}const h="polygon"===t.type;if(!t.hasCurves()){const r=new Array;for(let s=0;s<n;++s){const n=t.partOffsets[s+1],i=new Array;for(;a<n;)i.push(e(a++));h&&i.length>0&&i.push(i[0]),r.push(i)}return h?{rings:r,hasZ:s,hasM:i,spatialReference:o}:{paths:r,hasZ:s,hasM:i,spatialReference:o}}const u=new Array;for(const{segments:e,startVertex:r}of t.parts){const t=[r];for(const{curve:r}of e)t.push(r);u.push(t)}return h?{rings:[],curveRings:u,hasZ:s,hasM:i,spatialReference:o}:{paths:[],curvePaths:u,hasZ:s,hasM:i,spatialReference:o}}function _(t,{lengths:e,coords:r,hasZ:n,hasM:s},i){const o=t.includes("point")?0:e.length,a="polygon"===t,h="point"===t?1:e.reduce((t,e)=>t+e,0)-(a?o:0);n??=!1,s??=!1;const u=F(t,h,o,n,s,!1,0,0);if(u.spatialReference=i??void 0,!u.isMultipart()){for(let t=0,e=0;t<h;++t)u.vertexXY[2*t]=r[e++],u.vertexXY[2*t+1]=r[e++],n&&(u.vertexZ[t]=r[e++]),s&&(u.vertexM[t]=r[e++]);return u}const c=2+Number(n)+Number(s);let l=0,f=0;u.partOffsets[0]=0;for(const t of e){const e=u.partOffsets[f],i=e+t-Number(a);u.partOffsets[++f]=i;for(let t=e;t<i;++t)u.vertexXY[2*t]=r[l++],u.vertexXY[2*t+1]=r[l++],n&&(u.vertexZ[t]=r[l++]),s&&(u.vertexM[t]=r[l++]);a&&(l+=c)}return u}function A({type:t,vertexCount:e,vertexXY:r,vertexZ:n,vertexM:s,partCount:i,partOffsets:o,hasZ:a,hasM:h}){const u=new x.A([],[],a,h);i=Math.max(i,1);const c="polygon"===t;let l=0;for(let t=0;t<i;++t){const i=o?.[t+1]??e,f=u.coords.length;for(let t=l;t<i;++t)u.coords.push(r[2*t],r[2*t+1]),a&&u.coords.push(n[t]),h&&u.coords.push(s[t]);if(c){const t=l;u.coords.push(r[2*t],r[2*t+1]),a&&u.coords.push(n[t]),h&&u.coords.push(s[t])}u.lengths.push((u.coords.length-f)/u.stride),l=i}return"point"===t&&(u.lengths.length=0),u}function O(t,e){return"getSpatialReference"in t&&(e=function(t){if(null==t)return;const e=t.getText()||void 0,r=t.isCustomWkid()?0:t.getOldID();if(r<=0)return{wkt:e};let n=t.getLatestID();(n<=0||n===r)&&(n=void 0);const s=t.getVCS();if(null==s)return{wkid:r,latestWkid:n,wkt:e};const i=s.isCustomWkid()?0:s.getOldID();if(i<=0)return{wkt:e};let o=t.getLatestVerticalID();return(o<=0||o===i)&&(o=void 0),{wkid:r,wkt:e,latestWkid:n,vcsWkid:i,latestVcsWkid:o}}(t.getSpatialReference()),t=t.getGeometry()),new d({...t.toFlatGeometry(),spatialReference:e})}class P{constructor(t,e){this.target=t,this.keys=e,this.oldValues=e.map(e=>t[e]);for(const r of e)t[r]=void 0}[Symbol.dispose](){this.keys.map((t,e)=>{this.target[t]=this.oldValues[e]})}}function S({spatialReference:t}){return t instanceof i.A?t.toJSON():t}function b({vertexXY:t,vertexZ:e,vertexM:r}){return e?r?n=>[t[2*n],t[2*n+1],e[n],r[n]]:r=>[t[2*r],t[2*r+1],e[r]]:r?e=>[t[2*e],t[2*e+1],r[e]]:e=>[t[2*e],t[2*e+1]]}function w(t,e){return t.every((t,r)=>t===e[r])}function F(t,e,r,n,s,i,o,a){o??=0,a??=0;const h=new d({type:t,vertexCount:e,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:r,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:o,segmentCountBezier:a});let u=2*Float64Array.BYTES_PER_ELEMENT*e;n&&(u+=Float64Array.BYTES_PER_ELEMENT*e),s&&(u+=Float64Array.BYTES_PER_ELEMENT*e),h.isMultipart()&&(u+=(r+1)*Int32Array.BYTES_PER_ELEMENT,u+=(r+1)*Int8Array.BYTES_PER_ELEMENT),i&&(u+=e*Int8Array.BYTES_PER_ELEMENT,u+=e*Int32Array.BYTES_PER_ELEMENT,u+=h.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);const c=new ArrayBuffer(u);let l=0;return h.vertexXY=new Float64Array(c,l,2*e),l+=h.vertexXY.byteLength,n&&(h.vertexZ=new Float64Array(c,l,e),l+=h.vertexZ.byteLength),s&&(h.vertexM=new Float64Array(c,l,e),l+=h.vertexM.byteLength),i&&(h.segmentParams=new Float64Array(c,l,h.segmentParamCount),l+=h.segmentParams.byteLength,h.segmentIndices=new Int32Array(c,l,e),h.segmentIndices.fill(X),l+=h.segmentIndices.byteLength),h.isMultipart()&&(h.partOffsets=new Int32Array(c,l,r+1),l+=h.partOffsets.byteLength,h.partFlags=new Int8Array(c,l,r+1),l+=h.partFlags.byteLength,"polygon"===h.type&&h.partFlags.subarray(0,r).fill(1)),i&&(h.segmentFlags=new Int8Array(c,l,e),h.segmentFlags.fill(1),l+=h.segmentFlags.byteLength),h}function R(t,e,{segmentFlags:r,segmentIndices:n,segmentParams:s},i,o){r[i]=4,n[i]=o;const[a,[h,u],c,l,f,m,x]=e.a;let d=4;l||(d|=1),c||(d|=2);const p=(0,g.SW)(t,e),[y,v]=(0,g.Uk)(p,.5);return s[o++]=d,s[o++]=m,s[o++]=x,s[o++]=f,s[o++]=h,s[o++]=u,s[o++]=p.u2-p.u1,s[o++]=p.u1,s[o++]=y,s[o++]=v,o}function Z(t,e,{segmentFlags:r,segmentIndices:n,segmentParams:s},i,o){r[i]=4,n[i]=o;const a=(0,m.i)(t,e);return V(a,4,...(0,u.mq)(a,.5),s,o)}function Y(t,e,{segmentFlags:r,segmentIndices:n,segmentParams:s},i,o){return r[i]=4,n[i]=o,V((0,c.pM)(t,e),0,...e.c[1],s,o)}function V(t,e,r,n,s,i){const{cx:o,cy:a,thetaStart:h,thetaEnd:u,radius:c}=t;return h>u||(e|=1),Math.abs(u-h)<=Math.PI||(e|=2),s[i++]=e,s[i++]=c,s[i++]=1,s[i++]=0,s[i++]=o,s[i++]=a,s[i++]=u-h,s[i++]=h,s[i++]=r,s[i++]=n,i}function N(t,{b:[e,[r,n],[s,i]]},{segmentFlags:o,segmentIndices:a,segmentParams:h},u,c){return o[u]=2,a[u]=c,h[c++]=r,h[c++]=n,h[c++]=s,h[c++]=i,c}const T=1.61803,X=-1},7978(t,e,r){r.r(e),r.d(e,{execute:()=>o});var n=r(15756),s=r(83299);const i=new n.k;function o(t,e){const r=(0,s.fromGeometry)(t);return i.execute(r.getGeometry(),(0,s.fromGeometryToGXGeometry)(e),r.getSpatialReference())}},4197(t,e,r){r.d(e,{Vj:()=>u,cj:()=>h,jh:()=>i,l5:()=>a,xm:()=>o});var n=r(34275),s=r(9093);function i(t){return t<=n.y9?new Array(t).fill(0):new Float64Array(t)}function o(t){return((0,n.iu)(t)?t.byteLength/8:t.length)<=n.y9?Array.from(t):new Float64Array(t)}function a(t,e,r){return Array.isArray(t)?t.slice(e,e+r):t.subarray(e,e+r)}function h(t){return[...t]}function u(t){const e=(0,s.vt)();for(let r=0;r<16;++r)e[r]=t[r];return e}},70328(t,e,r){r.d(e,{BI:()=>v,DC:()=>l,Ej:()=>m,Ie:()=>p,Jt:()=>y,Ne:()=>g,RF:()=>c,aI:()=>C,fA:()=>o,gE:()=>h,hZ:()=>d,iT:()=>f,is:()=>M,qv:()=>E,vI:()=>x,vY:()=>a,v_:()=>I,vt:()=>i,w1:()=>u});var n=r(5443),s=(r(19419),r(4197));function i(t=I){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function o(t,e,r,n,s,o,a=i()){return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a[4]=s,a[5]=o,a}function a(t,e=i()){return function(t,e,r,n=i()){return d(n,E),function(t,e,r=0,n=e.length/3){let s=t[0],i=t[1],o=t[2],a=t[3],h=t[4],u=t[5];for(let t=0;t<n;t++)s=Math.min(s,e[r+3*t]),i=Math.min(i,e[r+3*t+1]),o=Math.min(o,e[r+3*t+2]),a=Math.max(a,e[r+3*t]),h=Math.max(h,e[r+3*t+1]),u=Math.max(u,e[r+3*t+2]);t[0]=s,t[1]=i,t[2]=o,t[3]=a,t[4]=h,t[5]=u}(n,t,e,r),n}(t,0,t.length/3,e)}function h(t,e=(0,s.jh)(24)){const[r,n,i,o,a,h]=t;return e[0]=r,e[1]=n,e[2]=i,e[3]=r,e[4]=n,e[5]=h,e[6]=r,e[7]=a,e[8]=i,e[9]=r,e[10]=a,e[11]=h,e[12]=o,e[13]=n,e[14]=i,e[15]=o,e[16]=n,e[17]=h,e[18]=o,e[19]=a,e[20]=i,e[21]=o,e[22]=a,e[23]=h,e}function u(t,e){const r=isFinite(t[2])||isFinite(t[5]);return new n.A(r?{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:e}:{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:e})}function c(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[3]),t[4]=Math.max(t[4],e[4]),t[5]=Math.max(t[5],e[5])}function l(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[3]=Math.max(t[3],e[2]),t[4]=Math.max(t[4],e[3])}function f(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}function m(t,e=[0,0,0]){return e[0]=function(t){return t[0]>=t[3]?0:t[3]-t[0]}(t),e[1]=function(t){return t[1]>=t[4]?0:t[4]-t[1]}(t),e[2]=function(t){return t[2]>=t[5]?0:t[5]-t[2]}(t),e}function g(t,e,r=t){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r!==t&&(r[3]=t[3],r[4]=t[4],r[5]=t[5]),r}function x(t,e,r=t){return r[3]=e[0],r[4]=e[1],r[5]=e[2],r!==t&&(r[0]=t[0],r[1]=t[1],r[2]=t[2]),t}function d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function p(t){return t?d(t,E):i(E)}function y(t,e){return t[0]=e[0],t[1]=e[1],t[2]=Number.NEGATIVE_INFINITY,t[3]=e[2],t[4]=e[3],t[5]=Number.POSITIVE_INFINITY,t}function v(t,e,r,n,s){return t[0]=e,t[1]=r,t[2]=Number.NEGATIVE_INFINITY,t[3]=n,t[4]=s,t[5]=Number.POSITIVE_INFINITY,t}function M(t){return 6===t.length}function C(t,e,r){if(null==t||null==e)return t===e;if(!M(t)||!M(e))return!1;if(r){for(let n=0;n<t.length;n++)if(!r(t[n],e[n]))return!1}else for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}const E=[1/0,1/0,1/0,-1/0,-1/0,-1/0],I=[0,0,0,0,0,0];i()},92722(t,e,r){r.d(e,{A:()=>s});var n=r(69397);class s{constructor(t=[],e=[],r=!1,n=!1){this.lengths=t??[],this.coords=e??[],this.hasZ=r,this.hasM=n}static fromJSON({lengths:t,coords:e,hasZ:r,hasM:n}){return new s(t,e,r||!1,n||!1)}static fromRect([t,e,r,n]){const i=r-t,o=n-e;return new s([5],[t,e,i,0,0,o,-i,0,0,-o])}get isPoint(){return 0===this.lengths.length&&this.coords.length>=2}get maxLength(){return Math.max(...this.lengths)}get size(){return this.isPoint?1:this.lengths.reduce((t,e)=>t+e,0)}get usedMemory(){return 64+(0,n.Qf)(this.lengths,this.coords)}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}area(){if(this.isPoint)return 0;let t=0,e=0;for(const r of this.lengths){if(r<3)continue;const{stride:n}=this;let s=this.coords[n*e],i=this.coords[n*e+1];for(let o=1;o<r;o+=1){const r=n*(e+o),a=this.coords[r],h=this.coords[r+1];t+=-.5*(a-s)*(h+i),s=a,i=h}e+=r}return t}forEachVertex(t){let e=0;if(this.isPoint)return t(this.coords[0],this.coords[1]);const{stride:r}=this;for(const n of this.lengths){for(let s=0;s<n;s++){const n=r*(e+s);t(this.coords[n],this.coords[n+1])}e+=n}}deltaDecode(){const t=this.clone(),{coords:e,lengths:r}=t;let n=0;const{stride:s}=this;for(const t of r){for(let r=1;r<t;r++){const t=s*(n+r);e[t]+=e[t-s],e[t+1]+=e[t+1-s]}n+=t}return t}clone(t){if(this.isPoint)return new s([],Array.from(this.coords.slice(0,this.stride)),this.hasZ,this.hasM);const e=Array.from(this.lengths),{stride:r,size:n}=this,i=this.coords.slice(0,n*r);return t?(t.set(i),new s(e,t)):new s(e,Array.from(i),this.hasZ,this.hasM)}justXY(){const{stride:t,size:e}=this;if(2===t)return this;const r=new Array(e*t);for(let e=0,n=0;e<r.length;e+=t)r[n++]=this.coords[e],r[n++]=this.coords[e+1];return new s(this.lengths,r,!1,!1)}}}}]);
|