@arcgis/core 4.27.0-next.20230420 → 4.27.0-next.20230421

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/WebMap.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{f64f95623d9296a91f95.js → 059ec6fd9b971de4b4c1.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{1fe31a412479815e5e2d.js → 10770939900946feb20d.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{5252f3cc244204edc299.js → 1216e939d363f96b6cc6.js} +1 -1
  7. package/assets/esri/core/workers/chunks/156dad2b7fed6749bae7.js +1 -0
  8. package/assets/esri/core/workers/chunks/15a97d3e42b00ac42984.js +1 -0
  9. package/assets/esri/core/workers/chunks/{d72c0c97cc4e30f1e4f2.js → 18704903814b9d73c708.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{852b4a6c0f3feb57cf54.js → 1db5e4c8244dbc21590c.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{f0953e41d1653e66ba57.js → 2a1a5a1969e80a10dcca.js} +1 -1
  12. package/assets/esri/core/workers/chunks/33b735faa582e6f39e9a.js +1 -0
  13. package/assets/esri/core/workers/chunks/34025ac04ca02531923a.js +1 -0
  14. package/assets/esri/core/workers/chunks/3e9f3479fd8558d9e3e3.js +1 -0
  15. package/assets/esri/core/workers/chunks/{d59274ac695dfcff1143.js → 46090b69e9161bc05141.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{1b647446a6a27798c5cf.js → 47bf38d910e71ac39bb8.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{3978f4f68ada540ee3a3.js → 4f8a09b61267e5e26712.js} +1 -1
  18. package/assets/esri/core/workers/chunks/5183ecab7eddae7b70e8.js +1 -0
  19. package/assets/esri/core/workers/chunks/{a5c33b24b7ee042cb473.js → 51a0d1dabe7415515c77.js} +2 -2
  20. package/assets/esri/core/workers/chunks/541e6efc3b491e507410.js +1 -0
  21. package/assets/esri/core/workers/chunks/5c64fd3bf057a1a5527f.js +1 -0
  22. package/assets/esri/core/workers/chunks/6047bdaf4855506f8fdb.js +1 -0
  23. package/assets/esri/core/workers/chunks/{b2358c2e27be7a5709cf.js → 6adb58f1bffc5d1c03bd.js} +1 -1
  24. package/assets/esri/core/workers/chunks/770940417e6ddbdbb9d6.js +1 -0
  25. package/assets/esri/core/workers/chunks/{1c1d8be85297c483a606.js → 77c98121223a144170e3.js} +1 -1
  26. package/assets/esri/core/workers/chunks/80117007d86be4eb3bc3.js +1 -0
  27. package/assets/esri/core/workers/chunks/838849b751805615833a.js +1 -0
  28. package/assets/esri/core/workers/chunks/{9ca395f7bc8d397b5240.js → 88197520501fcc20b6e8.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{89e8ba4fc325838bf1a9.js → 88f9dededcf60fd011ef.js} +1 -1
  30. package/assets/esri/core/workers/chunks/88fdd288ef799a7ac48a.js +1 -0
  31. package/assets/esri/core/workers/chunks/{f11ec68ceb7c973cde74.js → 8ae7fea9f7fda38dd207.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{0d080dd1ca6a71597409.js → 9265d4e9cfab2c7bbce5.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{8d41305509fedb3603ac.js → 94041a9ced04aa281d40.js} +1 -1
  34. package/assets/esri/core/workers/chunks/98540791fcef86069e44.js +1 -0
  35. package/assets/esri/core/workers/chunks/9c1b2f82877ff79969f5.js +1 -0
  36. package/assets/esri/core/workers/chunks/a7b3cd537c9127b5e65e.js +1 -0
  37. package/assets/esri/core/workers/chunks/{3d1c697182237807ab49.js → abea316f2eac0f3086ab.js} +1 -1
  38. package/assets/esri/core/workers/chunks/ad85ade6a2cfb56cf328.js +1 -0
  39. package/assets/esri/core/workers/chunks/{25862269952c1bda910f.js → b833b4ea2973bb16792e.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{e50d1afdc878258c437e.js → be4aa835a7abfc809126.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{4fed7c08b5f4de23bb75.js → c2ec6e904f96173a7b83.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{c25aa08b869f2777dc26.js → c4488a8d857c765da30e.js} +1 -1
  43. package/assets/esri/core/workers/chunks/c5c56b6d99db96a6755a.js +2 -0
  44. package/assets/esri/core/workers/chunks/{b28883e2a13f360310b3.js → c727d38f71e52bee17e1.js} +1 -1
  45. package/assets/esri/core/workers/chunks/cf315d255f0dc8d50f21.js +1 -0
  46. package/assets/esri/core/workers/chunks/cf7676fdc09ad4835680.js +1 -0
  47. package/assets/esri/core/workers/chunks/cfad34c949cbe8a31ef8.js +1 -0
  48. package/assets/esri/core/workers/chunks/{a2c9cb23f3e35e88da1d.js → d399b1b9cbf0737d1735.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{df7dcd035997881cf2ef.js → d5c8119d6d34628d3126.js} +1 -1
  50. package/assets/esri/core/workers/chunks/d6b6bb8aecc85d2a3f6b.js +1 -0
  51. package/assets/esri/core/workers/chunks/{8dfa32cc8453f85faab0.js → dd1f8bade9c5c3b7929b.js} +1 -1
  52. package/assets/esri/core/workers/chunks/e11e60759821746259c6.js +1 -0
  53. package/assets/esri/core/workers/chunks/{e4b65c5a4575a5c1c49f.js → e356c576f9a7521a49b3.js} +1 -1
  54. package/assets/esri/core/workers/chunks/f02edf71645eb33bf92f.js +1 -0
  55. package/assets/esri/core/workers/chunks/{3dff550c29115dd625fa.js → f1a4165c2710ca90e5ea.js} +1 -1
  56. package/assets/esri/core/workers/chunks/f57a3ee17869ced3dd33.js +1 -0
  57. package/assets/esri/core/workers/chunks/fc07f6e103d7f69a9909.js +1 -0
  58. package/chunks/WaterSurface.glsl.js +35 -20
  59. package/chunks/index.js +1 -1
  60. package/core/Loadable.js +1 -1
  61. package/core/Promise.js +1 -1
  62. package/core/accessorSupport/ensureType.js +1 -1
  63. package/core/accessorSupport/watch.js +1 -1
  64. package/core/accessorSupport/write.js +1 -1
  65. package/core/promiseUtils.js +1 -1
  66. package/core/watchUtils.js +1 -1
  67. package/core/workers/Connection.js +1 -1
  68. package/core/workers/RemoteClient.js +1 -1
  69. package/geometry/support/geodesicUtils.js +1 -1
  70. package/intl/messages.js +1 -1
  71. package/layers/graphics/data/attributeSupport.js +1 -1
  72. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  73. package/layers/mixins/ArcGISMapService.js +1 -1
  74. package/layers/support/PromiseQueue.js +1 -1
  75. package/layers/support/Sublayer.js +1 -1
  76. package/layers/support/TileKey.js +1 -1
  77. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  78. package/networks/Network.js +1 -1
  79. package/package.json +1 -1
  80. package/portal/schemas/definitions.js +1 -1
  81. package/request.js +1 -1
  82. package/support/revision.js +1 -1
  83. package/symbols/support/previewSymbol3D.js +1 -1
  84. package/symbols/support/styleUtils.js +1 -1
  85. package/symbols/support/symbolLayerUtils.js +1 -1
  86. package/symbols/support/utils.js +1 -1
  87. package/symbols/support/webStyleSymbolUtils.js +1 -1
  88. package/views/2d/engine/webgl/TextureManager.js +1 -1
  89. package/views/2d/layers/support/webStyleUtils.js +1 -1
  90. package/views/3d/input/SceneInputManager.js +1 -1
  91. package/views/3d/interactive/manipulatorUtils.js +1 -1
  92. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  93. package/views/3d/layers/graphics/ElevationQuery.js +1 -1
  94. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  95. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  96. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  97. package/views/3d/layers/graphics/polygonUtils.js +1 -1
  98. package/views/3d/layers/graphics/symbolComplexity.js +1 -1
  99. package/views/3d/layers/graphics/webStyleUtils.js +5 -0
  100. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  101. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  102. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  103. package/views/LayerViewManager.js +1 -1
  104. package/views/PopupView.js +1 -1
  105. package/views/SceneView.js +1 -1
  106. package/views/ViewAnimation.js +1 -1
  107. package/views/input/BrowserEventSource.js +1 -1
  108. package/views/input/InputManager.js +1 -1
  109. package/views/interactive/coordinateHelper.js +1 -1
  110. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  111. package/views/support/QueueProcessor.js +1 -1
  112. package/views/ui/DefaultUI.js +1 -1
  113. package/views/ui/UI.js +1 -1
  114. package/widgets/BasemapGallery/support/PortalBasemapsSource.js +1 -1
  115. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  116. package/widgets/Editor/Upload.js +1 -1
  117. package/widgets/Editor/deprecationUtils.js +1 -1
  118. package/widgets/Editor/modelUploadUtils.js +1 -1
  119. package/widgets/Editor.js +1 -1
  120. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  121. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  122. package/widgets/Feature/FeatureViewModel.js +1 -1
  123. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  124. package/widgets/Popup.js +1 -1
  125. package/assets/esri/core/workers/chunks/0cec1c16b25406858ae6.js +0 -1
  126. package/assets/esri/core/workers/chunks/27353056c3e4e8d8b8d3.js +0 -1
  127. package/assets/esri/core/workers/chunks/337d59d624ef8a89aae5.js +0 -1
  128. package/assets/esri/core/workers/chunks/4b6a903d4aeeb4eeb615.js +0 -1
  129. package/assets/esri/core/workers/chunks/4bf9bc8b52d618f395c5.js +0 -1
  130. package/assets/esri/core/workers/chunks/5ec4fedbbcbb0053cf74.js +0 -2
  131. package/assets/esri/core/workers/chunks/60e29d172a2dcf45e8d0.js +0 -1
  132. package/assets/esri/core/workers/chunks/68a15cc7c51645d31572.js +0 -1
  133. package/assets/esri/core/workers/chunks/778ecf61f07dafc51bbc.js +0 -1
  134. package/assets/esri/core/workers/chunks/7e67e071789c6d264280.js +0 -1
  135. package/assets/esri/core/workers/chunks/80d335bec34d60b7bbdc.js +0 -1
  136. package/assets/esri/core/workers/chunks/810da30f13151b72a293.js +0 -1
  137. package/assets/esri/core/workers/chunks/81485a5056aed94b3d8d.js +0 -1
  138. package/assets/esri/core/workers/chunks/8ebda132068f6b962dd9.js +0 -1
  139. package/assets/esri/core/workers/chunks/914a0c78c80aa897b1a1.js +0 -1
  140. package/assets/esri/core/workers/chunks/979ea2e3b1b164334634.js +0 -1
  141. package/assets/esri/core/workers/chunks/a0e92dd27c8f6b642dbf.js +0 -1
  142. package/assets/esri/core/workers/chunks/a6240bf258b3886a6661.js +0 -1
  143. package/assets/esri/core/workers/chunks/b1a8024bf8cdd0cd3884.js +0 -1
  144. package/assets/esri/core/workers/chunks/b366e0db9b5f27dd53a3.js +0 -1
  145. package/assets/esri/core/workers/chunks/c564055cb906857c8641.js +0 -1
  146. package/assets/esri/core/workers/chunks/c646dc9da08b509e39d6.js +0 -1
  147. package/assets/esri/core/workers/chunks/db5598944b691e43f13e.js +0 -1
  148. package/assets/esri/core/workers/chunks/eb163a2ddeb27c690308.js +0 -1
  149. package/assets/esri/core/workers/chunks/f05634909c9449533193.js +0 -1
  150. package/assets/esri/core/workers/chunks/fcebd70b089dea833c75.js +0 -1
  151. /package/assets/esri/core/workers/chunks/{a5c33b24b7ee042cb473.js.LICENSE.txt → 51a0d1dabe7415515c77.js.LICENSE.txt} +0 -0
  152. /package/assets/esri/core/workers/chunks/{5ec4fedbbcbb0053cf74.js.LICENSE.txt → c5c56b6d99db96a6755a.js.LICENSE.txt} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{bytesToUTF8 as e}from"../rasterDatasets/byteStreamUtils.js";import{J as t}from"../../../chunks/Jpg.js";import{load as n,decode as a}from"./Lerc.js";import{decode as i}from"./Lzw.js";import{convertNoDataToMask as s}from"./pixelRangeUtils.js";import r from"./TiffTags.js";import{isPlatformLittleEndian as l}from"./utils.js";import{Z as o}from"../../../chunks/Zlib.js";const f=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],u=4294967296,c=new Set([1,5,6,7,8,34712,34887]);function h(e,t){let n="unknown";return 3===e?n=64===t?"f64":"f32":1===e?1===t?n="u1":2===t?n="u2":4===t?n="u4":t<=8?n="u8":t<=16?n="u16":t<=32&&(n="u32"):2===e&&(t<=8?n="s8":t<=16?n="s16":t<=32&&(n="s32")),n}function g(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function E(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function I(e,t){return e.get(t)?.values}function T(e,t){return e.get(t)?.values}function p(e,t){return e.get(t)?.values?.[0]}function d(e,t){return e.get(t)?.values?.[0]}function w(e,t,n,a=0,i=r.TIFF_TAGS,s=4){const l=8===s,o=l?G(new DataView(e,n,8),0,t):new DataView(e,n,2).getUint16(0,t),f=4+2*s,u=l?8:2,c=u+o*f;if(n+c>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:c};const h=n+c+4<=e.byteLength?C(new DataView(e,n+c,8===s?8:4),0,t,8===s):null,g=n+u,E=new Map;let I,T,p,d,w,m=0,S=0;for(let y=0;y<o;y++){T=new DataView(e,g+f*y,f),p=T.getUint16(0,t),w=T.getUint16(2,t),d=r.getTagName(p,i);const n=[];2===s?(m=T.getUint16(4,t),S=T.getUint16(6,t)):4===s?(m=T.getUint32(4,t),S=T.getUint32(8,t)):8===s&&(m=C(T,4,t,!0),S=C(T,12,t,!0),n.push(T.getUint32(12,t)),n.push(T.getUint32(16,t))),I={id:p,type:w,valueCount:m,valueOffset:S,valueOffsets:n,values:null},L(e,t,I,a,!1,s),E.set(d,I)}return{success:!0,ifd:E,nextIFD:h,requiredBufferSize:c}}const m=(e,t)=>a(e,{inputOffset:t}).pixels[0];function S(e,t){if(1!==t&&2!==t&&4!==t)return e;const n=new Uint8Array(e),a=8/t,i=new Uint8Array(e.byteLength*a);let s=0;const r=2**t-1;for(let l=0;l<n.length;l++){const e=n[l];for(let n=0;n<a;n++)i[s++]=e<<t*n>>>8-t&r}return i.buffer}function y(e,n,a){const i=new t;i.parse(e),i.colorTransform=6===a?-1:0;const s=i.getData(i.width,i.height,1!==n);return new Uint8Array(s.buffer)}function A(e){const t=new o(e).getBytes(),n=new ArrayBuffer(t.length),a=new Uint8Array(n);return a.set(t),a}async function M(e,t,a,s,r){const o=l===t,f=d(a,"BITSPERSAMPLE"),u=d(a,"SAMPLESPERPIXEL"),c=d(a,"PHOTOMETRICINTERPRETATION"),E=h(d(a,"SAMPLEFORMAT")??1,f),I=d(a,"COMPRESSION")??1,T=g(E);let p,w,M;if(34887===I)return await n(),m(e,s);if(1===I)p=e.slice(s,s+r),w=new Uint8Array(p);else if(8===I||32946===I)w=new Uint8Array(e,s,r),w=A(w),p=w.buffer;else if(6===I)w=new Uint8Array(e,s,r),w=y(w,u,c),p=w.buffer;else if(7===I){const t=a.get("JPEGTABLES").values,n=t.length-2;w=new Uint8Array(n+r-2);for(let e=0;e<n;e++)w[e]=t[e];const i=new Uint8Array(e,s+2,r-2);for(let e=0;e<i.length;e++)w[n+e]=i[e];w=y(w,u,c),p=w.buffer}else{if(5!==I)throw new Error("tiff-decode: unsupport compression "+I);w=i(e,s,r,t),p=w.buffer}if(p=S(p,f),"u8"===E||"s8"===E||o)M=new T(p);else{p=new ArrayBuffer(w.length);const e=new Uint8Array(p);switch(E){case"u16":case"s16":for(let t=0;t<w.length;t+=2)e[t]=w[t+1],e[t+1]=w[t];break;case"u32":case"s32":case"f32":for(let t=0;t<w.length;t+=4)e[t]=w[t+3],e[t+1]=w[t+2],e[t+2]=w[t+1],e[t+3]=w[t]}M=new T(p)}return M}async function P(e,t,n){const a=T(n,"TILEOFFSETS");if(void 0===a)return null;const i=T(n,"TILEBYTECOUNTS"),{width:s,height:r,pixelType:l,tileWidth:o,tileHeight:f}=R([n]),u=D(n,t),c=d(n,"SAMPLESPERPIXEL")||t.planes,h=s*r,E=d(n,"BITSPERSAMPLE"),I=34887===(d(n,"COMPRESSION")??1),p=g(l),w=[];for(let g=0;g<c;g++)w.push(new p(h));let m,S,y,A,P,O,b,x,L,N,U,k,G;const F=Math.ceil(s/o);if(E%8==0)if(I&&u&&c>1){const l=Math.round(a.length/c);for(m=0;m<l;m++){O=Math.floor(m/F)*f,b=m%F*o,x=O*s+b;for(let l=0;l<c;l++){const u=m*c+l;if(0!==i[u])for(y=await M(e,t.littleEndian,n,a[u],i[u]),N=0,L=x,k=Math.min(o,s-b),U=Math.min(f,r-O),G=w[l],A=0;A<U;A++)for(L=x+A*s,N=A*o,P=0;P<k;P++,L++,N++)G[L]=y[N]}}}else for(m=0;m<a.length;m++)if(0!==i[m])for(O=Math.floor(m/F)*f,b=m%F*o,x=O*s+b,y=await M(e,t.littleEndian,n,a[m],i[m]),N=0,L=x,k=Math.min(o,s-b),U=Math.min(f,r-O),S=0;S<c;S++)if(G=w[S],u||I)for(A=0;A<U;A++)for(L=x+A*s,N=o*f*S+A*o,P=0;P<k;P++,L++,N++)G[L]=y[N];else for(A=0;A<U;A++)for(L=x+A*s,N=A*o*c+S,P=0;P<k;P++,L++,N+=c)G[L]=y[N];return{width:s,height:r,pixelType:l,pixels:w}}const O=(e,t,n)=>{const a=l===t.littleEndian,s=T(n,"STRIPOFFSETS");if(void 0===s)return null;const{width:r,height:o,pixelType:f}=R([n]),u=d(n,"SAMPLESPERPIXEL")||t.planes,c=d(n,"PHOTOMETRICINTERPRETATION"),h=r*o,E=d(n,"BITSPERSAMPLE"),I=g(f),p=new I(h*u),w=T(n,"STRIPBYTECOUNTS"),m=d(n,"ROWSPERSTRIP"),M=d(n,"COMPRESSION")??1;let P,O,b,x,L,D,N,U,k,G=m;if(E%8==0)for(P=0;P<s.length;P++){if(L=P*(m*r)*u,G=(P+1)*m>o?o-P*m:m,"u8"===f||"s8"===f||a)8===M||32946===M?(N=new Uint8Array(e,s[P],w[P]),N=A(N),D=N.buffer):6===M?(N=new Uint8Array(e,s[P],w[P]),N=y(N,u,c),D=N.buffer):5===M?(N=i(e,s[P],w[P],t.littleEndian),D=N.buffer):(w[P]!==G*r*u*E/8&&console.log("strip byte counts is different than expected"),D=e.slice(s[P],s[P]+w[P])),D=S(D,E),x=new I(D);else{switch(6===M||8===M||32946===M?(N=new Uint8Array(e,s[P],w[P]),U=A(N),D=U.buffer):(w[P]!==G*r*u*E/8&&console.log("strip byte counts is different than expected"),D=new ArrayBuffer(w[P]),N=new Uint8Array(e,s[P],w[P]),U=new Uint8Array(D)),f){case"u16":case"s16":for(b=0;b<N.length;b+=2)U[b]=N[b+1],U[b+1]=N[b];break;case"u32":case"s32":case"f32":for(b=0;b<N.length;b+=4)U[b]=N[b+3],U[b+1]=N[b+2],U[b+2]=N[b+1],U[b+3]=N[b]}D=S(D,E),x=new I(D)}p.set(x,L)}const F=[];if(1===u)F.push(p);else for(P=0;P<u;P++){for(k=new I(h),O=0;O<h;O++)k[O]=p[O*u+P];F.push(k)}return{width:r,height:o,pixelType:f,pixels:F}},b=(e,t,n)=>{if(!(e&&e.length>0&&t&&n))return null;let a,i,s;const r=e[0].length,l=e.length,o=new Uint8Array(r);for(let f=0;f<l;f++)if(a=e[f],i=t[f],s=n[f],0===f)for(let e=0;e<r;e++)o[e]=a[e]<i||a[e]>s?0:1;else for(let e=0;e<r;e++)o[e]&&(o[e]=a[e]<i||a[e]>s?0:1);return o},x=e=>{if(!e)return null;const t=e.match(/<Item(.*?)Item>/gi);if(!t||0===t.length)return null;const n=new Map;let a,i,s,r,l;for(let p=0;p<t.length;p++)a=t[p],i=a.slice("<Item ".length,a.indexOf(">")),r=a.indexOf("sample="),r>-1&&(l=a.slice(r+'sample="'.length,a.indexOf('"',r+'sample="'.length))),r=a.indexOf("name="),r>-1&&(i=a.slice(r+'name="'.length,a.indexOf('"',r+'name="'.length))),i&&(s=a.slice(a.indexOf(">")+1,a.indexOf("</Item>")).trim(),null!=l?n.has(i)?n.get(i)[l]=s:n.set(i,[s]):n.set(i,s)),l=null;const o=n.get("STATISTICS_MINIMUM"),f=n.get("STATISTICS_MAXIMUM"),u=n.get("STATISTICS_MEAN"),c=n.get("STATISTICS_STDDEV");let h=null;if(o&&f){h=[];for(let e=0;e<o.length;e++)h.push({min:parseFloat(o[e]),max:parseFloat(f[e]),avg:u&&parseFloat(u[e]),stddev:c&&parseFloat(c[e])})}const g=n.get("BandName"),E=n.get("WavelengthMin"),I=n.get("WavelengthMax");let T=null;if(g){T=[];for(let e=0;e<g.length;e++)T.push({BandName:g[e],WavelengthMin:E&&parseFloat(E[e]),WavelengthMax:I&&parseFloat(I[e])})}return{statistics:h,bandProperties:T,dataType:n.get("DataType"),rawMetadata:n}};function L(e,t,n,a=0,i=!1,s=4){if(n.values)return!0;const r=n.type,l=n.valueCount;let o=n.valueOffset,c=[];const h=f[r],g=8*h,E=l*h,I=l*f[r]*8;let T,p;const d=8===s?64:32,w=n.valueOffsets;if(I>d){if(E>(i?e.byteLength:e?e.byteLength-o+a:0))return n.offlineOffsetSize=[o,E],n.values=null,!1}if(I<=d){if(!t)if(d<=32)o>>>=32-I;else{const e=w?.length?w[0]:o>>>0,t=w?.length?w[1]:Math.round((o-e)/u);I<=32?(o=e>>>32-I,w[0]=o):(o=e*2**(32-I)+(t>>>32-I),w[0]=e,w[1]=t>>>32-I)}if(1===l&&g===d)c=[o];else if(64===d){const e=w?.length?w[0]:o>>>0,t=w?.length?w[1]:Math.round((o-e)/u);let n=e,a=32;for(p=1;p<=l;p++){const e=32-g*p%32;if(a<g){const i=n<<e>>>32-a,s=t<<32-a>>>32-a;n=t,c.push(i+s*2**(g-a)),a-=32-(g-a)}else c.push(n<<e>>>32-g),a-=g;0===a&&(a=32,n=t)}}else for(p=1;p<=l;p++){const e=32-g*p;c.push(o<<e>>>32-g)}}else{o-=a,i&&(o=0);for(let n=o;n<o+E;n+=h){switch(r){case 1:case 2:case 7:T=new DataView(e,n,1).getUint8(0);break;case 3:T=new DataView(e,n,2).getUint16(0,t);break;case 4:case 13:T=new DataView(e,n,4).getUint32(0,t);break;case 5:T=new DataView(e,n,4).getUint32(0,t)/new DataView(e,n+4,4).getUint32(0,t);break;case 6:T=new DataView(e,n,1).getInt8(0);break;case 8:T=new DataView(e,n,2).getInt16(0,t);break;case 9:T=new DataView(e,n,4).getInt32(0,t);break;case 10:T=new DataView(e,n,4).getInt32(0,t)/new DataView(e,n+4,4).getInt32(0,t);break;case 11:T=new DataView(e,n,4).getFloat32(0,t);break;case 12:T=new DataView(e,n,8).getFloat64(0,t);break;case 16:case 18:T=G(new DataView(e,n,8),0,t);break;case 17:T=F(new DataView(e,n,8),0,t);break;default:T=null}c.push(T)}}if(2===r){let e="";const t=c;for(c=[],p=0;p<t.length;p++)0===t[p]&&""!==e?(c.push(e),e=""):e+=String.fromCharCode(t[p]);""===e&&0!==c.length||c.push(e)}return n.values=c,!0}function R(e){const t=e[0],n=d(t,"TILEWIDTH"),a=d(t,"TILELENGTH"),i=d(t,"IMAGEWIDTH"),s=d(t,"IMAGELENGTH"),r=d(t,"BITSPERSAMPLE"),l=d(t,"SAMPLESPERPIXEL"),o=d(t,"SAMPLEFORMAT")??1,f=h(o,r),u=D(t),g=I(t,"GDAL_NODATA");let w=null;g?.length&&(w=g.map((e=>parseFloat(e))),w.some((e=>isNaN(e)))&&(w=null));const m=d(t,"COMPRESSION")??1;let S;switch(m){case 1:S="NONE";break;case 2:case 3:case 4:case 32771:S="CCITT";break;case 5:S="LZW";break;case 6:case 7:S="JPEG";break;case 32773:S="PACKBITS";break;case 8:case 32946:S="DEFLATE";break;case 34712:S="JPEG2000";break;case 34887:S="LERC";break;default:S=String(m)}let y=!0,A="";c.has(m)||(y=!1,A+="unsupported tag compression "+m),o>3&&(y=!1,A+="unsupported tag sampleFormat "+o),1!==r&&2!==r&&4!==r&&r%8!=0&&(y=!1,A+="unsupported tag bitsPerSample "+r);const M=p(t,"GEOASCIIPARAMS");let P;if(M){const e=M.split("|").find((e=>e.includes("ESRI PE String = "))),t=e?e.replace("ESRI PE String = ",""):"";P=t.startsWith("COMPD_CS")||t.startsWith("PROJCS")||t.startsWith("GEOGCS")?{wkid:null,wkt:t}:null}const O=T(t,"GEOTIEPOINTS"),b=T(t,"GEOPIXELSCALE"),L=T(t,"GEOTRANSMATRIX"),R=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let k,G,F=!1,C=!1;if(R){F=2===d(R,"GTRasterTypeGeoKey");const e=d(R,"GTModelTypeGeoKey");if(2===e){const e=d(R,"GeographicTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e}),P||32767!==e||(C=!0,P={wkid:4326})}else if(1===e){const e=d(R,"ProjectedCSTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e})}}if(b&&O&&O.length>=6?(k=[b[0],0,O[3]-O[0]*b[0],0,-Math.abs(b[1]),O[4]-O[1]*b[1]],F&&(k[2]-=.5*k[0]+.5*k[1],k[5]-=.5*k[3]+.5*k[4])):L&&16===L.length&&(k=F?[L[0],L[1],L[3]-.5*L[0],L[4],L[5],L[7]-.5*L[5]]:[L[0],L[1],L[3],L[4],L[5],L[7]]),k){const e=[{x:0,y:s},{x:0,y:0},{x:i,y:s},{x:i,y:0}];let t,n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let i=0;i<e.length;i++)t=E(e[i],k),n=t.x>n?n:t.x,r=t.x<r?r:t.x,a=t.y>a?a:t.y,l=t.y<l?l:t.y;G={xmin:n,xmax:r,ymin:a,ymax:l,spatialReference:P}}else G={xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:P};C&&(G.xmax-G.xmin>400||Math.max(Math.abs(G.xmin),Math.abs(G.xmax))>361)&&(P=null,G.spatialReference=null);const v=N(e);let B,W,H,Y,_;if(v.length>0){H=Math.round(Math.log(i/d(v[0],"IMAGEWIDTH"))/Math.LN2);const e=v[v.length-1];Y=Math.round(Math.log(i/d(e,"IMAGEWIDTH"))/Math.LN2),B=d(e,"TILEWIDTH"),W=d(e,"TILELENGTH")}B=null!=Y&&Y>0?B||n:null,W=null!=Y&&Y>0?W||a:null,n&&(_=[{maxCol:Math.ceil(i/n)-1,maxRow:Math.ceil(s/a)-1,minRow:0,minCol:0}],v.forEach((e=>{_.push({maxCol:Math.ceil(d(e,"IMAGEWIDTH")/d(e,"TILEWIDTH"))-1,maxRow:Math.ceil(d(e,"IMAGELENGTH")/d(e,"TILELENGTH"))-1,minRow:0,minCol:0})})));const K=p(e[0],"GDAL_METADATA"),X=x(K);A+=" "+V({width:i,height:s,tileWidth:n,tileHeight:a,planes:l,ifds:e});return{width:i,height:s,tileWidth:n,tileHeight:a,planes:l,isBSQ:u,pixelType:f,compression:S,noData:w,hasMaskBand:U(e).length===v.length+1,isSupported:y,message:A,extent:G,isPseudoGeographic:C,affine:b?null:k,firstPyramidLevel:H,maximumPyramidLevel:Y,pyramidBlockWidth:B,pyramidBlockHeight:W,tileBoundary:_,metadata:X}}function D(e,t){const n=I(e,"PLANARCONFIGURATION");return n?2===n[0]:!!t&&t.isBSQ}function N(e){return e.filter((e=>1===d(e,"NEWSUBFILETYPE")))}function U(e){return e.filter((e=>{const t=4==(4&(d(e,"NEWSUBFILETYPE")??0)),n=4===d(e,"PHOTOMETRICINTERPRETATION");return t&&n}))}function k(e){const{littleEndian:t,isBigTiff:n,firstIFDPos:a}=v(e);let i=a;const s=[];do{const a=B(e,t,i,0,r.TIFF_TAGS,n?8:4);if(!a.success)break;s.push(a.ifd),i=a.nextIFD}while(i>0);return{...R(s),littleEndian:t,isBigTiff:n,ifds:s,pyramidIFDs:N(s),maskIFDs:U(s)}}function G(e,t,n){const a=e.getUint32(t,n),i=e.getUint32(t+4,n);return n?i*u+a:a*u+i}function F(e,t,n){let a=n?e.getInt32(t,n):e.getUint32(t,n),i=n?e.getUint32(t+4,n):e.getInt32(t+4,n);const s=(n?a:i)>=0?1:-1;n?a*=s:i*=s;return s*(n?i*u+a:a*u+i)}function C(e,t,n,a){return a?G(e,t,n):e.getUint32(t,n)}function v(e){const t=new DataView(e,0,16),n=t.getUint16(0,!1);let a=null;if(18761===n)a=!0;else{if(19789!==n)throw new Error("unexpected endianess byte");a=!1}const i=t.getUint16(2,a);if(42!==i&&43!==i)throw new Error("unexpected tiff identifier");let s=4;const r=43===i;if(r){const e=t.getUint16(s,a);if(s+=2,8!==e)throw new Error("unsupported bigtiff version");if(0!==t.getUint16(s,a))throw new Error("unsupported bigtiff version");s+=2}return{littleEndian:a,isBigTiff:r,firstIFDPos:C(t,s,a,r)}}function B(t,n,a,i=0,s=r.TIFF_TAGS,l=4){const o=w(t,n,a,i,s,l);let f;const u=o.ifd;if(u){if(r.ifdTags.forEach(((e,a)=>{u.has(a)&&(f=u.get(a),f.data=w(t,n,f.valueOffset-i,i,e).ifd)})),u.has("GEOKEYDIRECTORY")){f=u.get("GEOKEYDIRECTORY");const e=f.values;if(e&&e.length>4){const a=e[0]+"."+e[1]+"."+e[2];f.data=w(t,n,f.valueOffset+6-i,i,r.GEO_KEYS,2).ifd,f.data&&f.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}if(u.has("XMP")){f=u.get("XMP");const t=f.values;"number"==typeof t[0]&&7===f.type&&(f.values=[e(new Uint8Array(t))])}}return o}function V(e){const{width:t,height:n,tileHeight:a,tileWidth:i}=e,s=e.planes,r=i?i*a:t*n,l=d(e.ifds[0],"BITSPERSAMPLE");let o="";return r*s>2**30/(l>8?l/8:1)&&(o=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),o}async function W(e,t){const{headerInfo:n,ifd:a,offsets:i,sizes:r}=t,l=[];for(let s=0;s<i.length;s++){const t=await M(e,n.littleEndian,a,i[s],r[s]||e.byteLength);l.push(t)}const o=D(a,n),f=d(a,"BITSPERSAMPLE"),u=h(d(a,"SAMPLEFORMAT")??1,f),c=d(a,"SAMPLESPERPIXEL")||n.planes,E=g(u),I=d(a,"TILEWIDTH"),T=d(a,"TILELENGTH"),p=d(a,"COMPRESSION")??1,w=I*T;let m;const S=[];let y=l[0];const A=34887===p;for(let s=0;s<c;s++){if(m=new E(w),o&&A){if(y=l[s],y.length)for(let e=0;e<w;e++)m[e]=y[e+s]}else if(y.length)if(o||A&&!o)m=y.slice(w*s,w*(s+1));else for(let e=0;e<w;e++)m[e]=y[e*c+s];S.push(m)}const P=n.noData?n.noData[0]:t.noDataValue,O=n.metadata?n.metadata.statistics:null,x=O?O.map((e=>e.min)):null,L=O?O.map((e=>e.max)):null,R={pixelType:u,width:I,height:T,pixels:S,noDataValue:P};return null!=P?s(R,P):x&&L&&t.applyMinMaxConstraint&&(R.mask=b(S,x,L)),R}async function H(e,t={}){const n=t.pyramidLevel||0,a=t.headerInfo||k(e),{ifds:i,noData:r}=a;if(0===i.length)throw new Error("no valid image file directory");const l=V(a);if(l)throw l;let o=null;const f=-1===n?i[i.length-1]:i[n],u=r??t.noDataValue;return o=a.tileWidth?await P(e,a,f):await O(e,a,f),o?(null!=u&&s(o,u),o):o}export{H as decode,W as decodeTileOrStrip,R as getImageInfo,U as getMaskIFDs,N as getPyramidIFDs,D as isBSQConfig,L as parseFieldValues,k as parseHeader,B as parseIFD,v as parseSignature};
5
+ import{bytesToUTF8 as e}from"../rasterDatasets/byteStreamUtils.js";import{J as t}from"../../../chunks/Jpg.js";import{load as n,decode as a}from"./Lerc.js";import{decode as i}from"./Lzw.js";import{convertNoDataToMask as s}from"./pixelRangeUtils.js";import r from"./TiffTags.js";import{isPlatformLittleEndian as l}from"./utils.js";import{Z as o}from"../../../chunks/Zlib.js";const f=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],u=4294967296,c=new Set([1,5,6,7,8,34712,34887]);function h(e,t){let n="unknown";return 3===e?n=64===t?"f64":"f32":1===e?1===t?n="u1":2===t?n="u2":4===t?n="u4":t<=8?n="u8":t<=16?n="u16":t<=32&&(n="u32"):2===e&&(t<=8?n="s8":t<=16?n="s16":t<=32&&(n="s32")),n}function g(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function E(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function T(e,t){return e.get(t)?.values}function I(e,t){return e.get(t)?.values}function p(e,t){return e.get(t)?.values?.[0]}function d(e,t){return e.get(t)?.values?.[0]}function w(e,t,n,a=0,i=r.TIFF_TAGS,s=4){const l=8===s,o=l?G(new DataView(e,n,8),0,t):new DataView(e,n,2).getUint16(0,t),f=4+2*s,u=l?8:2,c=u+o*f;if(n+c>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:c};const h=n+c+4<=e.byteLength?C(new DataView(e,n+c,8===s?8:4),0,t,8===s):null,g=n+u,E=new Map;let T,I,p,d,w,S=0,m=0;for(let y=0;y<o;y++){I=new DataView(e,g+f*y,f),p=I.getUint16(0,t),w=I.getUint16(2,t),d=r.getTagName(p,i);const n=[];2===s?(S=I.getUint16(4,t),m=I.getUint16(6,t)):4===s?(S=I.getUint32(4,t),m=I.getUint32(8,t)):8===s&&(S=C(I,4,t,!0),m=C(I,12,t,!0),n.push(I.getUint32(12,t)),n.push(I.getUint32(16,t))),T={id:p,type:w,valueCount:S,valueOffset:m,valueOffsets:n,values:null},L(e,t,T,a,!1,s),E.set(d,T)}return{success:!0,ifd:E,nextIFD:h,requiredBufferSize:c}}const S=(e,t)=>a(e,{inputOffset:t}).pixels[0];function m(e,t){if(1!==t&&2!==t&&4!==t)return e;const n=new Uint8Array(e),a=8/t,i=new Uint8Array(e.byteLength*a);let s=0;const r=2**t-1;for(let l=0;l<n.length;l++){const e=n[l];for(let n=0;n<a;n++)i[s++]=e<<t*n>>>8-t&r}return i.buffer}function y(e,n,a){const i=new t;i.parse(e),i.colorTransform=6===a?-1:0;const s=i.getData(i.width,i.height,1!==n);return new Uint8Array(s.buffer)}function A(e){const t=new o(e).getBytes(),n=new ArrayBuffer(t.length),a=new Uint8Array(n);return a.set(t),a}async function M(e,t,a,s,r){const o=l===t,f=d(a,"BITSPERSAMPLE"),u=d(a,"SAMPLESPERPIXEL"),c=d(a,"PHOTOMETRICINTERPRETATION"),E=h(d(a,"SAMPLEFORMAT")??1,f),T=d(a,"COMPRESSION")??1,I=g(E);let p,w,M;if(34887===T)return await n(),S(e,s);if(1===T)p=e.slice(s,s+r),w=new Uint8Array(p);else if(8===T||32946===T)w=new Uint8Array(e,s,r),w=A(w),p=w.buffer;else if(6===T)w=new Uint8Array(e,s,r),w=y(w,u,c),p=w.buffer;else if(7===T){const t=a.get("JPEGTABLES").values,n=t.length-2;w=new Uint8Array(n+r-2);for(let e=0;e<n;e++)w[e]=t[e];const i=new Uint8Array(e,s+2,r-2);for(let e=0;e<i.length;e++)w[n+e]=i[e];w=y(w,u,c),p=w.buffer}else{if(5!==T)throw new Error("tiff-decode: unsupport compression "+T);w=i(e,s,r,t),p=w.buffer}if(p=m(p,f),"u8"===E||"s8"===E||o)M=new I(p);else{p=new ArrayBuffer(w.length);const e=new Uint8Array(p);switch(E){case"u16":case"s16":for(let t=0;t<w.length;t+=2)e[t]=w[t+1],e[t+1]=w[t];break;case"u32":case"s32":case"f32":for(let t=0;t<w.length;t+=4)e[t]=w[t+3],e[t+1]=w[t+2],e[t+2]=w[t+1],e[t+3]=w[t]}M=new I(p)}return M}async function P(e,t,n){const a=I(n,"TILEOFFSETS");if(void 0===a)return null;const i=I(n,"TILEBYTECOUNTS"),{width:s,height:r,pixelType:l,tileWidth:o,tileHeight:f}=R([n]),u=D(n,t),c=d(n,"SAMPLESPERPIXEL")||t.planes,h=s*r,E=d(n,"BITSPERSAMPLE"),T=34887===(d(n,"COMPRESSION")??1),p=g(l),w=[];for(let g=0;g<c;g++)w.push(new p(h));let S,m,y,A,P,O,b,x,L,N,U,k,G;const F=Math.ceil(s/o);if(E%8==0)if(T&&u&&c>1){const l=Math.round(a.length/c);for(S=0;S<l;S++){O=Math.floor(S/F)*f,b=S%F*o,x=O*s+b;for(let l=0;l<c;l++){const u=S*c+l;if(0!==i[u])for(y=await M(e,t.littleEndian,n,a[u],i[u]),N=0,L=x,k=Math.min(o,s-b),U=Math.min(f,r-O),G=w[l],A=0;A<U;A++)for(L=x+A*s,N=A*o,P=0;P<k;P++,L++,N++)G[L]=y[N]}}}else for(S=0;S<a.length;S++)if(0!==i[S])for(O=Math.floor(S/F)*f,b=S%F*o,x=O*s+b,y=await M(e,t.littleEndian,n,a[S],i[S]),N=0,L=x,k=Math.min(o,s-b),U=Math.min(f,r-O),m=0;m<c;m++)if(G=w[m],u||T)for(A=0;A<U;A++)for(L=x+A*s,N=o*f*m+A*o,P=0;P<k;P++,L++,N++)G[L]=y[N];else for(A=0;A<U;A++)for(L=x+A*s,N=A*o*c+m,P=0;P<k;P++,L++,N+=c)G[L]=y[N];return{width:s,height:r,pixelType:l,pixels:w}}const O=(e,t,n)=>{const a=l===t.littleEndian,s=I(n,"STRIPOFFSETS");if(void 0===s)return null;const{width:r,height:o,pixelType:f}=R([n]),u=d(n,"SAMPLESPERPIXEL")||t.planes,c=d(n,"PHOTOMETRICINTERPRETATION"),h=r*o,E=d(n,"BITSPERSAMPLE"),T=g(f),p=new T(h*u),w=I(n,"STRIPBYTECOUNTS"),S=d(n,"ROWSPERSTRIP"),M=d(n,"COMPRESSION")??1;let P,O,b,x,L,D,N,U,k,G=S;if(E%8==0)for(P=0;P<s.length;P++){if(L=P*(S*r)*u,G=(P+1)*S>o?o-P*S:S,"u8"===f||"s8"===f||a)8===M||32946===M?(N=new Uint8Array(e,s[P],w[P]),N=A(N),D=N.buffer):6===M?(N=new Uint8Array(e,s[P],w[P]),N=y(N,u,c),D=N.buffer):5===M?(N=i(e,s[P],w[P],t.littleEndian),D=N.buffer):(w[P]!==G*r*u*E/8&&console.log("strip byte counts is different than expected"),D=e.slice(s[P],s[P]+w[P])),D=m(D,E),x=new T(D);else{switch(6===M||8===M||32946===M?(N=new Uint8Array(e,s[P],w[P]),U=A(N),D=U.buffer):(w[P]!==G*r*u*E/8&&console.log("strip byte counts is different than expected"),D=new ArrayBuffer(w[P]),N=new Uint8Array(e,s[P],w[P]),U=new Uint8Array(D)),f){case"u16":case"s16":for(b=0;b<N.length;b+=2)U[b]=N[b+1],U[b+1]=N[b];break;case"u32":case"s32":case"f32":for(b=0;b<N.length;b+=4)U[b]=N[b+3],U[b+1]=N[b+2],U[b+2]=N[b+1],U[b+3]=N[b]}D=m(D,E),x=new T(D)}p.set(x,L)}const F=[];if(1===u)F.push(p);else for(P=0;P<u;P++){for(k=new T(h),O=0;O<h;O++)k[O]=p[O*u+P];F.push(k)}return{width:r,height:o,pixelType:f,pixels:F}},b=(e,t,n)=>{if(!(e&&e.length>0&&t&&n))return null;let a,i,s;const r=e[0].length,l=e.length,o=new Uint8Array(r);for(let f=0;f<l;f++)if(a=e[f],i=t[f],s=n[f],0===f)for(let e=0;e<r;e++)o[e]=a[e]<i||a[e]>s?0:1;else for(let e=0;e<r;e++)o[e]&&(o[e]=a[e]<i||a[e]>s?0:1);return o},x=e=>{if(!e)return null;const t=e.match(/<Item(.*?)Item>/gi);if(!t||0===t.length)return null;const n=new Map;let a,i,s,r,l;for(let p=0;p<t.length;p++)a=t[p],i=a.slice(6,a.indexOf(">")),r=a.indexOf("sample="),r>-1&&(l=a.slice(r+8,a.indexOf('"',r+8))),r=a.indexOf("name="),r>-1&&(i=a.slice(r+6,a.indexOf('"',r+6))),i&&(s=a.slice(a.indexOf(">")+1,a.indexOf("</Item>")).trim(),null!=l?n.has(i)?n.get(i)[l]=s:n.set(i,[s]):n.set(i,s)),l=null;const o=n.get("STATISTICS_MINIMUM"),f=n.get("STATISTICS_MAXIMUM"),u=n.get("STATISTICS_MEAN"),c=n.get("STATISTICS_STDDEV");let h=null;if(o&&f){h=[];for(let e=0;e<o.length;e++)h.push({min:parseFloat(o[e]),max:parseFloat(f[e]),avg:u&&parseFloat(u[e]),stddev:c&&parseFloat(c[e])})}const g=n.get("BandName"),E=n.get("WavelengthMin"),T=n.get("WavelengthMax");let I=null;if(g){I=[];for(let e=0;e<g.length;e++)I.push({BandName:g[e],WavelengthMin:E&&parseFloat(E[e]),WavelengthMax:T&&parseFloat(T[e])})}return{statistics:h,bandProperties:I,dataType:n.get("DataType"),rawMetadata:n}};function L(e,t,n,a=0,i=!1,s=4){if(n.values)return!0;const r=n.type,l=n.valueCount;let o=n.valueOffset,c=[];const h=f[r],g=8*h,E=l*h,T=l*f[r]*8;let I,p;const d=8===s?64:32,w=n.valueOffsets;if(T>d){if(E>(i?e.byteLength:e?e.byteLength-o+a:0))return n.offlineOffsetSize=[o,E],n.values=null,!1}if(T<=d){if(!t)if(d<=32)o>>>=32-T;else{const e=w?.length?w[0]:o>>>0,t=w?.length?w[1]:Math.round((o-e)/u);T<=32?(o=e>>>32-T,w[0]=o):(o=e*2**(32-T)+(t>>>32-T),w[0]=e,w[1]=t>>>32-T)}if(1===l&&g===d)c=[o];else if(64===d){const e=w?.length?w[0]:o>>>0,t=w?.length?w[1]:Math.round((o-e)/u);let n=e,a=32;for(p=1;p<=l;p++){const e=32-g*p%32;if(a<g){const i=n<<e>>>32-a,s=t<<32-a>>>32-a;n=t,c.push(i+s*2**(g-a)),a-=32-(g-a)}else c.push(n<<e>>>32-g),a-=g;0===a&&(a=32,n=t)}}else for(p=1;p<=l;p++){const e=32-g*p;c.push(o<<e>>>32-g)}}else{o-=a,i&&(o=0);for(let n=o;n<o+E;n+=h){switch(r){case 1:case 2:case 7:I=new DataView(e,n,1).getUint8(0);break;case 3:I=new DataView(e,n,2).getUint16(0,t);break;case 4:case 13:I=new DataView(e,n,4).getUint32(0,t);break;case 5:I=new DataView(e,n,4).getUint32(0,t)/new DataView(e,n+4,4).getUint32(0,t);break;case 6:I=new DataView(e,n,1).getInt8(0);break;case 8:I=new DataView(e,n,2).getInt16(0,t);break;case 9:I=new DataView(e,n,4).getInt32(0,t);break;case 10:I=new DataView(e,n,4).getInt32(0,t)/new DataView(e,n+4,4).getInt32(0,t);break;case 11:I=new DataView(e,n,4).getFloat32(0,t);break;case 12:I=new DataView(e,n,8).getFloat64(0,t);break;case 16:case 18:I=G(new DataView(e,n,8),0,t);break;case 17:I=F(new DataView(e,n,8),0,t);break;default:I=null}c.push(I)}}if(2===r){let e="";const t=c;for(c=[],p=0;p<t.length;p++)0===t[p]&&""!==e?(c.push(e),e=""):e+=String.fromCharCode(t[p]);""===e&&0!==c.length||c.push(e)}return n.values=c,!0}function R(e){const t=e[0],n=d(t,"TILEWIDTH"),a=d(t,"TILELENGTH"),i=d(t,"IMAGEWIDTH"),s=d(t,"IMAGELENGTH"),r=d(t,"BITSPERSAMPLE"),l=d(t,"SAMPLESPERPIXEL"),o=d(t,"SAMPLEFORMAT")??1,f=h(o,r),u=D(t),g=T(t,"GDAL_NODATA");let w=null;g?.length&&(w=g.map((e=>parseFloat(e))),w.some((e=>isNaN(e)))&&(w=null));const S=d(t,"COMPRESSION")??1;let m;switch(S){case 1:m="NONE";break;case 2:case 3:case 4:case 32771:m="CCITT";break;case 5:m="LZW";break;case 6:case 7:m="JPEG";break;case 32773:m="PACKBITS";break;case 8:case 32946:m="DEFLATE";break;case 34712:m="JPEG2000";break;case 34887:m="LERC";break;default:m=String(S)}let y=!0,A="";c.has(S)||(y=!1,A+="unsupported tag compression "+S),o>3&&(y=!1,A+="unsupported tag sampleFormat "+o),1!==r&&2!==r&&4!==r&&r%8!=0&&(y=!1,A+="unsupported tag bitsPerSample "+r);const M=p(t,"GEOASCIIPARAMS");let P;if(M){const e=M.split("|").find((e=>e.includes("ESRI PE String = "))),t=e?e.replace("ESRI PE String = ",""):"";P=t.startsWith("COMPD_CS")||t.startsWith("PROJCS")||t.startsWith("GEOGCS")?{wkid:null,wkt:t}:null}const O=I(t,"GEOTIEPOINTS"),b=I(t,"GEOPIXELSCALE"),L=I(t,"GEOTRANSMATRIX"),R=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let k,G,F=!1,C=!1;if(R){F=2===d(R,"GTRasterTypeGeoKey");const e=d(R,"GTModelTypeGeoKey");if(2===e){const e=d(R,"GeographicTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e}),P||32767!==e||(C=!0,P={wkid:4326})}else if(1===e){const e=d(R,"ProjectedCSTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e})}}if(b&&O&&O.length>=6?(k=[b[0],0,O[3]-O[0]*b[0],0,-Math.abs(b[1]),O[4]-O[1]*b[1]],F&&(k[2]-=.5*k[0]+.5*k[1],k[5]-=.5*k[3]+.5*k[4])):L&&16===L.length&&(k=F?[L[0],L[1],L[3]-.5*L[0],L[4],L[5],L[7]-.5*L[5]]:[L[0],L[1],L[3],L[4],L[5],L[7]]),k){const e=[{x:0,y:s},{x:0,y:0},{x:i,y:s},{x:i,y:0}];let t,n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let i=0;i<e.length;i++)t=E(e[i],k),n=t.x>n?n:t.x,r=t.x<r?r:t.x,a=t.y>a?a:t.y,l=t.y<l?l:t.y;G={xmin:n,xmax:r,ymin:a,ymax:l,spatialReference:P}}else G={xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:P};C&&(G.xmax-G.xmin>400||Math.max(Math.abs(G.xmin),Math.abs(G.xmax))>361)&&(P=null,G.spatialReference=null);const v=N(e);let B,W,H,Y,_;if(v.length>0){H=Math.round(Math.log(i/d(v[0],"IMAGEWIDTH"))/Math.LN2);const e=v[v.length-1];Y=Math.round(Math.log(i/d(e,"IMAGEWIDTH"))/Math.LN2),B=d(e,"TILEWIDTH"),W=d(e,"TILELENGTH")}B=null!=Y&&Y>0?B||n:null,W=null!=Y&&Y>0?W||a:null,n&&(_=[{maxCol:Math.ceil(i/n)-1,maxRow:Math.ceil(s/a)-1,minRow:0,minCol:0}],v.forEach((e=>{_.push({maxCol:Math.ceil(d(e,"IMAGEWIDTH")/d(e,"TILEWIDTH"))-1,maxRow:Math.ceil(d(e,"IMAGELENGTH")/d(e,"TILELENGTH"))-1,minRow:0,minCol:0})})));const K=p(e[0],"GDAL_METADATA"),X=x(K);A+=" "+V({width:i,height:s,tileWidth:n,tileHeight:a,planes:l,ifds:e});return{width:i,height:s,tileWidth:n,tileHeight:a,planes:l,isBSQ:u,pixelType:f,compression:m,noData:w,hasMaskBand:U(e).length===v.length+1,isSupported:y,message:A,extent:G,isPseudoGeographic:C,affine:b?null:k,firstPyramidLevel:H,maximumPyramidLevel:Y,pyramidBlockWidth:B,pyramidBlockHeight:W,tileBoundary:_,metadata:X}}function D(e,t){const n=T(e,"PLANARCONFIGURATION");return n?2===n[0]:!!t&&t.isBSQ}function N(e){return e.filter((e=>1===d(e,"NEWSUBFILETYPE")))}function U(e){return e.filter((e=>{const t=4==(4&(d(e,"NEWSUBFILETYPE")??0)),n=4===d(e,"PHOTOMETRICINTERPRETATION");return t&&n}))}function k(e){const{littleEndian:t,isBigTiff:n,firstIFDPos:a}=v(e);let i=a;const s=[];do{const a=B(e,t,i,0,r.TIFF_TAGS,n?8:4);if(!a.success)break;s.push(a.ifd),i=a.nextIFD}while(i>0);return{...R(s),littleEndian:t,isBigTiff:n,ifds:s,pyramidIFDs:N(s),maskIFDs:U(s)}}function G(e,t,n){const a=e.getUint32(t,n),i=e.getUint32(t+4,n);return n?i*u+a:a*u+i}function F(e,t,n){let a=n?e.getInt32(t,n):e.getUint32(t,n),i=n?e.getUint32(t+4,n):e.getInt32(t+4,n);const s=(n?a:i)>=0?1:-1;n?a*=s:i*=s;return s*(n?i*u+a:a*u+i)}function C(e,t,n,a){return a?G(e,t,n):e.getUint32(t,n)}function v(e){const t=new DataView(e,0,16),n=t.getUint16(0,!1);let a=null;if(18761===n)a=!0;else{if(19789!==n)throw new Error("unexpected endianess byte");a=!1}const i=t.getUint16(2,a);if(42!==i&&43!==i)throw new Error("unexpected tiff identifier");let s=4;const r=43===i;if(r){const e=t.getUint16(s,a);if(s+=2,8!==e)throw new Error("unsupported bigtiff version");if(0!==t.getUint16(s,a))throw new Error("unsupported bigtiff version");s+=2}return{littleEndian:a,isBigTiff:r,firstIFDPos:C(t,s,a,r)}}function B(t,n,a,i=0,s=r.TIFF_TAGS,l=4){const o=w(t,n,a,i,s,l);let f;const u=o.ifd;if(u){if(r.ifdTags.forEach(((e,a)=>{u.has(a)&&(f=u.get(a),f.data=w(t,n,f.valueOffset-i,i,e).ifd)})),u.has("GEOKEYDIRECTORY")){f=u.get("GEOKEYDIRECTORY");const e=f.values;if(e&&e.length>4){const a=e[0]+"."+e[1]+"."+e[2];f.data=w(t,n,f.valueOffset+6-i,i,r.GEO_KEYS,2).ifd,f.data&&f.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}if(u.has("XMP")){f=u.get("XMP");const t=f.values;"number"==typeof t[0]&&7===f.type&&(f.values=[e(new Uint8Array(t))])}}return o}function V(e){const{width:t,height:n,tileHeight:a,tileWidth:i}=e,s=e.planes,r=i?i*a:t*n,l=d(e.ifds[0],"BITSPERSAMPLE");let o="";return r*s>2**30/(l>8?l/8:1)&&(o=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),o}async function W(e,t){const{headerInfo:n,ifd:a,offsets:i,sizes:r}=t,l=[];for(let s=0;s<i.length;s++){const t=await M(e,n.littleEndian,a,i[s],r[s]||e.byteLength);l.push(t)}const o=D(a,n),f=d(a,"BITSPERSAMPLE"),u=h(d(a,"SAMPLEFORMAT")??1,f),c=d(a,"SAMPLESPERPIXEL")||n.planes,E=g(u),T=d(a,"TILEWIDTH"),I=d(a,"TILELENGTH"),p=d(a,"COMPRESSION")??1,w=T*I;let S;const m=[];let y=l[0];const A=34887===p;for(let s=0;s<c;s++){if(S=new E(w),o&&A){if(y=l[s],y.length)for(let e=0;e<w;e++)S[e]=y[e+s]}else if(y.length)if(o||A&&!o)S=y.slice(w*s,w*(s+1));else for(let e=0;e<w;e++)S[e]=y[e*c+s];m.push(S)}const P=n.noData?n.noData[0]:t.noDataValue,O=n.metadata?n.metadata.statistics:null,x=O?O.map((e=>e.min)):null,L=O?O.map((e=>e.max)):null,R={pixelType:u,width:T,height:I,pixels:m,noDataValue:P};return null!=P?s(R,P):x&&L&&t.applyMinMaxConstraint&&(R.mask=b(m,x,L)),R}async function H(e,t={}){const n=t.pyramidLevel||0,a=t.headerInfo||k(e),{ifds:i,noData:r}=a;if(0===i.length)throw new Error("no valid image file directory");const l=V(a);if(l)throw l;let o=null;const f=-1===n?i[i.length-1]:i[n],u=r??t.noDataValue;return o=a.tileWidth?await P(e,a,f):await O(e,a,f),o?(null!=u&&s(o,u),o):o}export{H as decode,W as decodeTileOrStrip,R as getImageInfo,U as getMaskIFDs,N as getPyramidIFDs,D as isBSQConfig,L as parseFieldValues,k as parseHeader,B as parseIFD,v as parseSignature};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.27/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import r from"../request.js";import t from"../core/Error.js";import o from"../core/Loadable.js";import a from"../core/Logger.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{isAbortError as i}from"../core/promiseUtils.js";import{urlToObject as n}from"../core/urlUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import u from"../geometry/Extent.js";import p from"../geometry/SpatialReference.js";import{emitApplyEditsEvent as c}from"../layers/mixins/EditBusLayer.js";import{parse as m}from"../layers/support/arcgisLayerUrl.js";import y from"./support/TopologyValidationJobInfo.js";import{networkFromPortalItem as f}from"./support/utils.js";import h from"../rest/networks/support/QueryNamedTraceConfigurationsParameters.js";let w=class extends(s(o)){static fromPortalItem(e){return f(e)}constructor(e){super(e),this.id=null,this.title=null,this.layerUrl=null,this.dataElement=null,this.fullExtent=null,this.spatialReference=null,this.type=null,this.sourceJSON=null}initialize(){this.when().catch((e=>{i(e)||a.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}get datasetName(){return this.dataElement?.name??null}get owner(){return this.dataElement?.userIdentity??null}get schemaGeneration(){return this.dataElement?.schemaGeneration??null}get parsedUrl(){return n(this.layerUrl)}get featureServiceUrl(){const e=m(this.parsedUrl?.path);return e?.url?.path??null}get networkServiceUrl(){return this.featureServiceUrl?this.featureServiceUrl.replace(/\/FeatureServer/i,"/UtilityNetworkServer"):null}get layerId(){const e=this.parsedUrl&&m(this.parsedUrl.path);return null!=e?e.sublayer:null}get networkSystemLayers(){return null}async load(e){return this.addResolvingPromise(this._fetchDataElement(this.featureServiceUrl,this.layerId.toString(),e)),this.addResolvingPromise(this._fetchLayerMetaData(this.layerUrl,e)),this}getLayerIdBySourceId(e){if(this.dataElement){const r=this.dataElement.domainNetworks;for(const t of r){for(const r of t.edgeSources??[])if(r.sourceId===e)return r.layerId;for(const r of t.junctionSources??[])if(r.sourceId===e)return r.layerId}return null}return null}async queryNamedTraceConfigurations(e,r){const{queryNamedTraceConfigurations:t}=await import("../rest/networks/queryNamedTraceConfigurations.js"),o=this.networkServiceUrl,a=new h({...e});return(await t(o,a,{...r}))?.namedTraceConfigurations??null}async validateTopology(e,r){if(!e.validateArea)throw new t("network:undefined-validateArea","the network must have validateArea defined in the validate network topology parameters.");const{validateNetworkTopology:o}=await import("../rest/networks/validateNetworkTopology.js"),a=(await import("../rest/networks/support/ValidateNetworkTopologyParameters.js")).default.from(e),s=this.networkServiceUrl,i=this.featureServiceUrl,n=c(i,null,!0),l=await o(s,a,{...r});if(l?.serviceEdits){const e=[];for(const r of l.serviceEdits){const{editedFeatures:t}=r,o=t?.spatialReference?new p(t.spatialReference):null;e.push({layerId:r.layerId,editedFeatures:{adds:t?.adds||[],updates:t?.updates?.map((e=>({original:e[0],current:e[1]})))||[],deletes:t?.deletes||[],spatialReference:o}})}n.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],editedFeatures:e,exceededTransferLimit:!1})}return l}async submitTopologyValidationJob(e,r){if(!e.validateArea)throw new t("network:undefined-validateArea","the network must have validateArea defined in the validate network topology parameters.");if(!e.gdbVersion)throw new t("network:undefined-gdb-version","version must be defined");const{submitValidateNetworkTopologyJob:o}=await import("../rest/networks/validateNetworkTopology.js"),a=(await import("../rest/networks/support/ValidateNetworkTopologyParameters.js")).default.from(e),s=this.networkServiceUrl,i=this.featureServiceUrl?c(this.featureServiceUrl,null,!0):void 0,n=await o(s,a,{...r});return new y({statusUrl:n,editsResolver:i})}async _fetchLayerMetaData(e,t){const o=await r(e,{responseType:"json",query:{f:"json"},...t});this.sourceJSON=o.data,this.read(o.data,{origin:"service"})}async _fetchDataElement(e,t,o){if(this.dataElement)return;const a=await r(`${e}/queryDataElements`,{responseType:"json",query:{layers:JSON.stringify([t]),f:"json"},...o}).then((e=>e.data.layerDataElements?.[0]));a&&this.read(a,{origin:"service"})}};e([l({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}},service:{read:!0}},read:!1}})],w.prototype,"id",void 0),e([l({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}},service:{read:{source:"name"}}},read:!1}})],w.prototype,"title",void 0),e([l({type:String,nonNullable:!0,json:{origins:{"web-map":{read:{source:"url"},write:{target:"url",isRequired:!0}}},read:!1}})],w.prototype,"layerUrl",void 0),e([l({type:Object,json:{origins:{service:{read:!0}},read:!1}})],w.prototype,"dataElement",void 0),e([l({type:u,json:{origins:{service:{read:{source:"extent"}}},read:!1}})],w.prototype,"fullExtent",void 0),e([l({type:p,json:{origins:{service:{read:{source:"extent.spatialReference"}}},read:!1}})],w.prototype,"spatialReference",void 0),e([l({type:["utility","trace"],readOnly:!0,json:{read:!1,write:!1}})],w.prototype,"type",void 0),e([l({readOnly:!0})],w.prototype,"datasetName",null),e([l({readOnly:!0})],w.prototype,"owner",null),e([l({readOnly:!0})],w.prototype,"schemaGeneration",null),e([l({readOnly:!0})],w.prototype,"parsedUrl",null),e([l({readOnly:!0})],w.prototype,"featureServiceUrl",null),e([l({readOnly:!0})],w.prototype,"networkServiceUrl",null),e([l({readOnly:!0})],w.prototype,"layerId",null),e([l()],w.prototype,"sourceJSON",void 0),e([l({readOnly:!0})],w.prototype,"networkSystemLayers",null),w=e([d("esri.networks.Network")],w);const g=w;export{g as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../Graphic.js";import r from"../request.js";import o from"../core/Error.js";import a from"../core/Loadable.js";import s from"../core/Logger.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{isAbortError as n}from"../core/promiseUtils.js";import{urlToObject as l}from"../core/urlUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import p from"../geometry/Extent.js";import{fromJSON as c}from"../geometry/support/jsonUtils.js";import{emitApplyEditsEvent as m}from"../layers/mixins/EditBusLayer.js";import{parse as y}from"../layers/support/arcgisLayerUrl.js";import f from"./support/TopologyValidationJobInfo.js";import{networkFromPortalItem as h}from"./support/utils.js";import w from"../rest/networks/support/QueryNamedTraceConfigurationsParameters.js";import g from"../geometry/SpatialReference.js";let v=class extends(i(a)){static fromPortalItem(e){return h(e)}constructor(e){super(e),this.id=null,this.title=null,this.layerUrl=null,this.dataElement=null,this.fullExtent=null,this.spatialReference=null,this.type=null,this.sourceJSON=null}initialize(){this.when().catch((e=>{n(e)||s.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})}))}get datasetName(){return this.dataElement?.name??null}get owner(){return this.dataElement?.userIdentity??null}get schemaGeneration(){return this.dataElement?.schemaGeneration??null}get parsedUrl(){return l(this.layerUrl)}get featureServiceUrl(){const e=y(this.parsedUrl?.path);return e?.url?.path??null}get networkServiceUrl(){return this.featureServiceUrl?this.featureServiceUrl.replace(/\/FeatureServer/i,"/UtilityNetworkServer"):null}get layerId(){const e=this.parsedUrl&&y(this.parsedUrl.path);return null!=e?e.sublayer:null}get networkSystemLayers(){return null}async load(e){return this.addResolvingPromise(this._fetchDataElement(this.featureServiceUrl,this.layerId.toString(),e)),this.addResolvingPromise(this._fetchLayerMetaData(this.layerUrl,e)),this}getLayerIdBySourceId(e){if(this.dataElement){const t=this.dataElement.domainNetworks;for(const r of t){for(const t of r.edgeSources??[])if(t.sourceId===e)return t.layerId;for(const t of r.junctionSources??[])if(t.sourceId===e)return t.layerId}return null}return null}async queryNamedTraceConfigurations(e,t){const{queryNamedTraceConfigurations:r}=await import("../rest/networks/queryNamedTraceConfigurations.js"),o=this.networkServiceUrl,a=new w({...e});return(await r(o,a,{...t}))?.namedTraceConfigurations??null}async validateTopology(e,t){if(!e.validateArea)throw new o("network:undefined-validateArea","the network must have validateArea defined in the validate network topology parameters.");const{validateNetworkTopology:r}=await import("../rest/networks/validateNetworkTopology.js"),a=(await import("../rest/networks/support/ValidateNetworkTopologyParameters.js")).default.from(e),s=this.networkServiceUrl,i=this.featureServiceUrl,n=m(i,null,!0),l=await r(s,a,{...t});if(l?.serviceEdits){const e=[];for(const t of l.serviceEdits){const{editedFeatures:r}=t,o=r?.spatialReference?new g(r.spatialReference):null;e.push({layerId:t.layerId,editedFeatures:{adds:r?.adds?.map((e=>this._createEditedFeature(e,o)))||[],updates:r?.updates?.map((e=>({original:this._createEditedFeature(e[0],o),current:this._createEditedFeature(e[1],o)})))||[],deletes:r?.deletes?.map((e=>this._createEditedFeature(e,o)))||[],spatialReference:o}})}n.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],editedFeatures:e,exceededTransferLimit:!1})}return l}async submitTopologyValidationJob(e,t){if(!e.validateArea)throw new o("network:undefined-validateArea","the network must have validateArea defined in the validate network topology parameters.");if(!e.gdbVersion)throw new o("network:undefined-gdb-version","version must be defined");const{submitValidateNetworkTopologyJob:r}=await import("../rest/networks/validateNetworkTopology.js"),a=(await import("../rest/networks/support/ValidateNetworkTopologyParameters.js")).default.from(e),s=this.networkServiceUrl,i=this.featureServiceUrl?m(this.featureServiceUrl,null,!0):void 0,n=await r(s,a,{...t});return new f({statusUrl:n,editsResolver:i})}_createEditedFeature(e,r){return new t({attributes:e.attributes,geometry:c({...e.geometry,spatialReference:r})})}async _fetchLayerMetaData(e,t){const o=await r(e,{responseType:"json",query:{f:"json"},...t});this.sourceJSON=o.data,this.read(o.data,{origin:"service"})}async _fetchDataElement(e,t,o){if(this.dataElement)return;const a=await r(`${e}/queryDataElements`,{responseType:"json",query:{layers:JSON.stringify([t]),f:"json"},...o}).then((e=>e.data.layerDataElements?.[0]));a&&this.read(a,{origin:"service"})}};e([d({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}},service:{read:!0}},read:!1}})],v.prototype,"id",void 0),e([d({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}},service:{read:{source:"name"}}},read:!1}})],v.prototype,"title",void 0),e([d({type:String,nonNullable:!0,json:{origins:{"web-map":{read:{source:"url"},write:{target:"url",isRequired:!0}}},read:!1}})],v.prototype,"layerUrl",void 0),e([d({type:Object,json:{origins:{service:{read:!0}},read:!1}})],v.prototype,"dataElement",void 0),e([d({type:p,json:{origins:{service:{read:{source:"extent"}}},read:!1}})],v.prototype,"fullExtent",void 0),e([d({type:g,json:{origins:{service:{read:{source:"extent.spatialReference"}}},read:!1}})],v.prototype,"spatialReference",void 0),e([d({type:["utility","trace"],readOnly:!0,json:{read:!1,write:!1}})],v.prototype,"type",void 0),e([d({readOnly:!0})],v.prototype,"datasetName",null),e([d({readOnly:!0})],v.prototype,"owner",null),e([d({readOnly:!0})],v.prototype,"schemaGeneration",null),e([d({readOnly:!0})],v.prototype,"parsedUrl",null),e([d({readOnly:!0})],v.prototype,"featureServiceUrl",null),e([d({readOnly:!0})],v.prototype,"networkServiceUrl",null),e([d({readOnly:!0})],v.prototype,"layerId",null),e([d()],v.prototype,"sourceJSON",void 0),e([d({readOnly:!0})],v.prototype,"networkSystemLayers",null),v=e([u("esri.networks.Network")],v);const j=v;export{j as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.27.0-next.20230420",
3
+ "version": "4.27.0-next.20230421",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [