@arcgis/core 5.0.0-next.130 → 5.0.0-next.131

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 (134) hide show
  1. package/applications/Components/OrientedImageryViewer/galleryUtils.d.ts +45 -15
  2. package/applications/Components/QuantityFormatter.d.ts +11 -11
  3. package/applications/Components/SelectionOperation.d.ts +11 -11
  4. package/applications/Components/SketchTooltipControls.d.ts +9 -9
  5. package/applications/Components/actionUtils.d.ts +2 -1
  6. package/applications/Components/analysisUtils.d.ts +27 -26
  7. package/applications/Components/applySetUtils.d.ts +40 -40
  8. package/applications/Components/arcadeEditorUtils.d.ts +3 -3
  9. package/applications/Components/arcadeFeatureUtils.d.ts +12 -12
  10. package/applications/Components/baUtils.d.ts +8 -8
  11. package/applications/Components/basemapUtils.d.ts +2 -2
  12. package/applications/Components/clipboard.d.ts +14 -14
  13. package/applications/Components/drawUtils.d.ts +3 -3
  14. package/applications/Components/editUtils.d.ts +14 -14
  15. package/applications/Components/featureUtils.d.ts +10 -10
  16. package/applications/Components/fieldFormatUtils.d.ts +2 -2
  17. package/applications/Components/fontUtils.d.ts +2 -2
  18. package/applications/Components/formatUtils.d.ts +2 -2
  19. package/applications/Components/getDefaultUnits.d.ts +2 -2
  20. package/applications/Components/gfxUtils.d.ts +5 -1
  21. package/applications/Components/imageryUtils.d.ts +35 -35
  22. package/applications/Components/layerOriginUtils.d.ts +5 -5
  23. package/applications/Components/layersEffectsJsonUtils.d.ts +2 -2
  24. package/applications/Components/previewSymbol2D.d.ts +2 -2
  25. package/applications/Components/rasterFunctionEditorUtils.d.ts +40 -40
  26. package/applications/Components/reactiveUtils.d.ts +14 -13
  27. package/applications/Components/sanitizerUtils.d.ts +2 -2
  28. package/applications/Components/stringUtils.d.ts +5 -5
  29. package/applications/Components/styleUtils.d.ts +2 -2
  30. package/applications/Components/svgUtils.d.ts +4 -4
  31. package/applications/Components/symbolUtils.d.ts +47 -11
  32. package/applications/Components/templateUtils.d.ts +73 -17
  33. package/applications/Components/templateUtils.js +1 -1
  34. package/applications/Components/testUtils.d.ts +3 -3
  35. package/applications/Components/unitUtils.d.ts +1 -1
  36. package/applications/Components/viewUtils.d.ts +2 -2
  37. package/applications/Components/webStyleSymbolUtils.d.ts +2 -2
  38. package/applications/Excalibur/imageryLayerUtils.d.ts +3 -3
  39. package/applications/Excalibur/videoViewUtils.d.ts +8 -8
  40. package/applications/Excalibur/widgetUtils.d.ts +2 -2
  41. package/applications/ExperienceBuilder/sketchUtils.d.ts +7 -7
  42. package/applications/KnowledgeStudio/dataModelVisualization.d.ts +20 -8
  43. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +21 -21
  44. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +35 -35
  45. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +9 -9
  46. package/applications/KnowledgeStudio/reshape.d.ts +40 -40
  47. package/applications/KnowledgeStudio/resourceSerializationUtils.d.ts +11 -11
  48. package/applications/MapViewer/layerUtils.d.ts +2 -2
  49. package/applications/MapViewer/mediaUtils.d.ts +13 -13
  50. package/applications/MapViewer/templateUtils.d.ts +20 -20
  51. package/applications/PortalApp/layerUtils.d.ts +2 -2
  52. package/applications/SceneViewer/colorUtils.d.ts +2 -2
  53. package/applications/SceneViewer/devEnvironmentUtils.d.ts +4 -3
  54. package/applications/SceneViewer/layerUtils.d.ts +3 -3
  55. package/applications/SceneViewer/sceneViewerUtils.d.ts +34 -34
  56. package/applications/SceneViewer/symbolUtils.d.ts +2 -2
  57. package/applications/Urban/LineImagePattern3D.d.ts +3 -2
  58. package/applications/Urban/imagePatternUtils.d.ts +4 -4
  59. package/applications/Urban/meshUtils.d.ts +2 -2
  60. package/applications/WebEditor/sketchUtils.d.ts +8 -8
  61. package/assets/esri/core/workers/RemoteClient.js +1 -1
  62. package/assets/esri/core/workers/chunks/1dcd057695f8db79eca2.js +1 -0
  63. package/assets/esri/core/workers/chunks/1f3074ab4dc6e2eff97e.js +1 -0
  64. package/assets/esri/core/workers/chunks/{5746140c33cb206ad4b8.js → 22181db586c6ccbcb279.js} +1 -1
  65. package/assets/esri/core/workers/chunks/58ef550435cef99d99ff.js +1 -0
  66. package/assets/esri/core/workers/chunks/{56e3c34ebdee61ff4b33.js → 75bf83c6367227712a11.js} +1 -1
  67. package/assets/esri/core/workers/chunks/844771d532b5352dc848.js +1 -0
  68. package/assets/esri/core/workers/chunks/{9332db133a0925d522fe.js → b9c9dd3621b92212b104.js} +1 -1
  69. package/assets/esri/core/workers/chunks/c3e4f8664988e50bda55.js +1 -0
  70. package/assets/esri/core/workers/chunks/cf100c80b75ba74b479c.js +1 -0
  71. package/assets/esri/core/workers/chunks/ef8cc520d3977759b80c.js +1 -0
  72. package/config.js +1 -1
  73. package/geometry/support/curves/curveUtils.js +1 -1
  74. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  75. package/graphic/graphicOriginUtils.js +1 -1
  76. package/kernel.js +1 -1
  77. package/layers/WMTSLayer.js +1 -1
  78. package/layers/graphics/editingSupport.js +1 -1
  79. package/layers/support/Sublayer.d.ts +3 -0
  80. package/package.json +1 -1
  81. package/rest/featureService/FeatureService.js +1 -1
  82. package/smartMapping/support/utils.js +1 -1
  83. package/support/revision.js +1 -1
  84. package/symbols/cim/GeometryWalker.js +1 -1
  85. package/symbols/cim/effects/EffectDashes.js +1 -1
  86. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  87. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  88. package/symbols/cim/rasterizingUtils.js +1 -1
  89. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  90. package/views/View.d.ts +13 -2
  91. package/views/draw/support/Reshape.js +1 -1
  92. package/views/draw/support/reshapeUtils.js +1 -1
  93. package/views/interactive/support/utils.js +1 -1
  94. package/widgets/Attribution/AttributionViewModel.d.ts +3 -1
  95. package/widgets/Attribution/AttributionViewModel.js +1 -1
  96. package/widgets/Attribution.d.ts +1 -1
  97. package/widgets/Attribution.js +1 -1
  98. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  99. package/widgets/Editor/EditorViewModel.d.ts +2 -22
  100. package/widgets/Editor/EditorViewModel.js +1 -1
  101. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  102. package/widgets/Editor/UpdateWorkflow.js +1 -1
  103. package/widgets/Editor/Workflow.js +1 -1
  104. package/widgets/Editor/support/SketchController.js +1 -1
  105. package/widgets/Editor/workflowUtils.js +1 -1
  106. package/widgets/Editor.d.ts +10 -15
  107. package/widgets/Editor.js +1 -1
  108. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +0 -15
  109. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  110. package/widgets/FeatureTable/support/types.d.ts +0 -1
  111. package/widgets/FeatureTable.d.ts +1 -19
  112. package/widgets/FeatureTable.js +1 -1
  113. package/widgets/HistogramRangeSlider.d.ts +1 -1
  114. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  115. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  116. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  117. package/widgets/PanoramicVideoViewer.js +1 -1
  118. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +1 -1
  119. package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
  120. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  121. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  122. package/widgets/PanoramicViewer/utils.js +1 -1
  123. package/widgets/Sketch/SketchViewModel.d.ts +4 -22
  124. package/widgets/Sketch/SketchViewModel.js +1 -1
  125. package/widgets/Sketch/support/PluginManager.js +1 -1
  126. package/widgets/Sketch.d.ts +10 -17
  127. package/widgets/Sketch.js +1 -1
  128. package/assets/esri/core/workers/chunks/5a8b3e5977c233d5c9d0.js +0 -1
  129. package/assets/esri/core/workers/chunks/71ad08a5b69cf2e6714e.js +0 -1
  130. package/assets/esri/core/workers/chunks/7ec83fc059325e207825.js +0 -1
  131. package/assets/esri/core/workers/chunks/a7d4d257f49f3b153c26.js +0 -1
  132. package/assets/esri/core/workers/chunks/bf2bfc0d78be8c185d58.js +0 -1
  133. package/assets/esri/core/workers/chunks/e081d6f21a2c01ccaf61.js +0 -1
  134. package/assets/esri/core/workers/chunks/eae1c098c16e2faaf90d.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3494],{20557(t,n,e){e.d(n,{Fm:()=>u,Hz:()=>d,JQ:()=>h,JZ:()=>y,ND:()=>M,R_:()=>a,U9:()=>f,fu:()=>o,nr:()=>p,oF:()=>i,rq:()=>c,z$:()=>l});const r=[["binary","application/octet-stream","bin",""]];function o(t,n){return null!=v(n.name,t?.supportedFormats??[])}function i(t,n){if(!t)return!1;const e=c(n,t.supportedFormats??[]);return null!=e&&t.editFormats.includes(e)}function a(t,n){return g(function(t,n){const e=t.toLowerCase();return m(n).find(t=>w(t)===e)}(t,n))}function s(t,n){return g(v(t,n))}function u(t,n){return w(function(t,n){return m(n).find(n=>g(n)===t)}(t,n))}function c(t,n){return s(t.name,n)??a(t.type,n)}function l(t,n,e){return a(t,e)??s(n,e)}function f({supportedFormats:t}){return l("model/gltf-binary","glb",t)}function h(t){const n=f(t);return null!=n&&t.editFormats.includes(n)}function d(t){if(!t)return null;const n=f(t),e=function({supportedFormats:t}){return l("model/gltf+json","gltf",t)}(t);let r=null;for(const o of t.queryFormats){if(o===n)return o;o===e&&(r=o)}return r}function p({supportedFormats:t}){return l("application/esri3do-SR_world","wld",t)}function M({supportedFormats:t}){return l("application/esri3do-SR_prj","prj",t)}function m(t){return[...r,...t]}function v(t,n){const e=t.toLowerCase();return m(n).find(t=>function(t){return t?.[2].split(",").map(t=>t.toLowerCase())??[]}(t).some(t=>e.endsWith(t)))}function g(t){return t?.[0]}function w(t){return t?.[1].toLowerCase()}function y(t){return t.tables?.find(t=>"assetMaps"===t.role)}},21060(t,n,e){e.d(n,{createImageSphere:()=>l,loadMeshes:()=>p,loadPyramid:()=>d,loadRaster:()=>f}),e(52106),e(11254),e(7762);var r=e(49186),o=(e(34727),e(74887)),i=e(40036),a=e(19211),s=e(35063),u=(e(27845),e(68548),e(28208)),c=e(66655);function l({data:t,center:n=u.ZH,size:e=u.vK,horizonPitch:r=0,horizonYaw:o=0,horizonRoll:c=0}){const l=n.clone();l.z=-e/2;const f=i.default.createSphere(l,{size:e,densificationFactor:2,vertexSpace:"georeferenced",material:new a.default({colorTexture:new s.default({data:t})})});if(f.components[0].trustSourceNormals=!0,f.vertexAttributes.uv){const t=f.vertexAttributes.uv.length??0;for(let n=0;n<t;n++)f.vertexAttributes.uv[2*n+0]=1-f.vertexAttributes.uv[2*n+0]}return f.rotate(r,c,o,{origin:f.extent.center}),f.centerAt(l),f}async function f(t,n){const e=await(0,c.Wn)(),r=await e.open({url:t,ioConfig:{skipExtensions:["jgw","aux.xml"],skipMapInfo:!0},...n});return(0,o.Te)(n),h(r,{url:t})}const h=(t,n)=>{if(!t)throw new r.A("panoramic-viewer:missing-raster","Raster data could not be loaded",n);return t};async function d(t,n,e){const r=await(0,c.DN)();return(0,o.Te)(e),new r({raster:t,horizonPitch:n.pitch,horizonYaw:n.yaw,horizonRoll:n.roll})}async function p(t,n){return t?.length?await Promise.all(t.map(t=>t.loadMesh(n))):[]}},24770(t,n,e){e.d(n,{$I:()=>m,AU:()=>d,g7:()=>M,i4:()=>l,ui:()=>f,up:()=>g,vt:()=>c,yo:()=>p});var r=e(34727),o=e(58083),i=e(67026),a=e(82534),s=e(35522),u=e(51850);function c(t=g){return[t[0],t[1],t[2],t[3]]}function l(t,n,e=c()){return(0,s.C)(e,t),e[3]=n,e}function f(t,n=c()){const e=(0,o.l)(w,t);return v(n,(0,r.KJ)((0,i.Xd)(n,e))),n}function h(t,n,e=c()){return(0,i.x8)(w,t,m(t)),(0,i.x8)(y,n,m(n)),(0,i.lw)(w,y,w),v(e,(0,r.KJ)((0,i.Xd)(e,w)))}function d(t,n,e,r=c()){return l(u.Cw,t,b),l(u.JP,n,x),l(u.Cb,e,A),h(b,x,b),h(b,A,r),r}function p(t){return t}function M(t){return t[3]}function m(t){return(0,r.kU)(t[3])}function v(t,n){return t[3]=n,t}const g=[0,0,1,0],w=(0,a.vt)(),y=(0,a.vt)(),b=(c(),c()),x=c(),A=c()},48353(t,n,e){e.d(n,{l:()=>c});var r=e(34727),o=e(58083),i=e(51850);function a(t,n,e){const r=Math.sin(t),o=Math.cos(t),i=Math.sin(n),a=Math.cos(n),s=e;return s[0]=-r,s[4]=-i*o,s[8]=a*o,s[12]=0,s[1]=o,s[5]=-i*r,s[9]=a*r,s[13]=0,s[2]=0,s[6]=a,s[10]=i,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1,s}var s=e(49208),u=e(21325);function c(t,n,e,r){const i=(0,s.Tp)(t,r);if(null==i)return!1;const c=i.source.spatialReferenceId,p=i.dest.spatialReferenceId;if(c===p&&!l(p)&&(0!==c||(0,u.aI)(t,r)))return(0,o.kN)(e,n),!0;if(l(p)){const t=s.w5[c][10],r=s.w5[10][p];return null!=t&&null!=r&&(t(n,0,h,0),r(h,0,d,0),a(f*h[0],f*h[1],e),e[12]=d[0],e[13]=d[1],e[14]=d[2],!0)}const M=l(c);if((3===p||11===p||2===p||5===p)&&(2===c||M||3===c||5===c)){const t=s.w5[c][10],r=s.w5[10][p];return null!=t&&null!=r&&(t(n,0,h,0),r(h,0,d,0),M?function(t,n,e){a(t,n,e),(0,o.mg)(e,e)}(f*h[0],f*h[1],e):(0,o.D_)(e),e[12]=d[0],e[13]=d[1],e[14]=d[2],!0)}return!1}function l(t){return 1===t||6===t||8===t||4===t}const f=(0,r.kU)(1),h=(0,i.vt)(),d=(0,i.vt)()},65806(t,n,e){e.d(n,{g:()=>a});var r=e(51850),o=e(91218),i=e(9762);function a(t,n,e,r){if((0,o.canProjectWithoutEngine)(t.spatialReference,e))return s[0]=t.x,s[1]=t.y,s[2]=t.z??0,(0,i.projectBuffer)(s,t.spatialReference,0,n,e,0);const a=(0,o.tryProject)(t,e,r);return!!a&&(n[0]=a.x,n[1]=a.y,n[2]=a.z??0,!0)}const s=(0,r.vt)()},66655(t,n,e){async function r(t){const n=(await e.e(8457).then(e.bind(e,38457)).then(t=>t.default)).getInstance();return await n.load(t)}async function o(){return c(await Promise.resolve().then(e.bind(e,40036)))}async function i(){return c(await Promise.resolve().then(e.bind(e,16939)))}async function a(){return c(await Promise.resolve().then(e.bind(e,19211)))}async function s(){return c(await Promise.resolve().then(e.bind(e,35063)))}async function u(){return(await Promise.resolve().then(e.bind(e,1193))).default}function c(t){return t.default??t}async function l(){const[t,n,e,c,l,f]=await Promise.all([o(),i(),a(),s(),u(),r()]);return{Mesh:t,MeshComponent:n,MeshMaterial:e,MeshTexture:c,MeshVertexAttributes:l,panoramicMeshManager:f}}async function f(){return c(await e.e(5243).then(e.bind(e,95243)))}async function h(){return c(await Promise.all([e.e(7373),e.e(3500),e.e(1003)]).then(e.bind(e,1003)))}e.d(n,{DN:()=>f,Wn:()=>h,Zg:()=>l})},67026(t,n,e){e.d(n,{A6:()=>M,Xd:()=>l,Xr:()=>d,hZ:()=>v,lw:()=>f,t2:()=>j,x8:()=>c});var r=e(29242),o=e(82534),i=e(51850),a=e(34304),s=e(35522),u=e(78955);function c(t,n,e){e*=.5;const r=Math.sin(e);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(e),t}function l(t,n){const e=2*Math.acos(n[3]),r=Math.sin(e/2);return r>(0,a.FD)()?(t[0]=n[0]/r,t[1]=n[1]/r,t[2]=n[2]/r):(t[0]=1,t[1]=0,t[2]=0),e}function f(t,n,e){const r=n[0],o=n[1],i=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=e[3];return t[0]=r*l+a*s+o*c-i*u,t[1]=o*l+a*u+i*s-r*c,t[2]=i*l+a*c+r*u-o*s,t[3]=a*l-r*s-o*u-i*c,t}function h(t,n,e,r){const o=n[0],i=n[1],s=n[2],u=n[3];let c,l,f,h,d,p=e[0],M=e[1],m=e[2],v=e[3];return l=o*p+i*M+s*m+u*v,l<0&&(l=-l,p=-p,M=-M,m=-m,v=-v),1-l>(0,a.FD)()?(c=Math.acos(l),f=Math.sin(c),h=Math.sin((1-r)*c)/f,d=Math.sin(r*c)/f):(h=1-r,d=r),t[0]=h*o+d*p,t[1]=h*i+d*M,t[2]=h*s+d*m,t[3]=h*u+d*v,t}function d(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t}function p(t,n){const e=n[0]+n[4]+n[8];let r;if(e>0)r=Math.sqrt(e+1),t[3]=.5*r,r=.5/r,t[0]=(n[5]-n[7])*r,t[1]=(n[6]-n[2])*r,t[2]=(n[1]-n[3])*r;else{let e=0;n[4]>n[0]&&(e=1),n[8]>n[3*e+e]&&(e=2);const o=(e+1)%3,i=(e+2)%3;r=Math.sqrt(n[3*e+e]-n[3*o+o]-n[3*i+i]+1),t[e]=.5*r,r=.5/r,t[3]=(n[3*o+i]-n[3*i+o])*r,t[o]=(n[3*o+e]+n[3*e+o])*r,t[i]=(n[3*i+e]+n[3*e+i])*r}return t}function M(t,n,e,r){const o=.5*Math.PI/180;n*=o,e*=o,r*=o;const i=Math.sin(n),a=Math.cos(n),s=Math.sin(e),u=Math.cos(e),c=Math.sin(r),l=Math.cos(r);return t[0]=i*u*l-a*s*c,t[1]=a*s*l+i*u*c,t[2]=a*u*c-i*s*l,t[3]=a*u*l+i*s*c,t}const m=u.C,v=u.hZ,g=u.WQ,w=f,y=u.hs,b=u.Om,x=u.Cc,A=u.Bw,C=A,P=u.m3,I=P,z=u.S8,j=u.t2,q=u.aI,F=(0,i.vt)(),N=(0,i.fA)(1,0,0),R=(0,i.fA)(0,1,0),Z=(0,o.vt)(),S=(0,o.vt)(),k=(0,r.vt)();Object.freeze(Object.defineProperty({__proto__:null,add:g,calculateW:function(t,n){const e=n[0],r=n[1],o=n[2];return t[0]=e,t[1]=r,t[2]=o,t[3]=Math.sqrt(Math.abs(1-e*e-r*r-o*o)),t},conjugate:d,copy:m,dot:b,equals:q,exactEquals:j,fromEuler:M,fromMat3:p,getAxisAngle:l,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},invert:function(t,n){const e=n[0],r=n[1],o=n[2],i=n[3],a=e*e+r*r+o*o+i*i,s=a?1/a:0;return t[0]=-e*s,t[1]=-r*s,t[2]=-o*s,t[3]=i*s,t},len:C,length:A,lerp:x,mul:w,multiply:f,normalize:z,random:function(t){const n=a.Ov,e=n(),r=n(),o=n(),i=Math.sqrt(1-e),s=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=s*Math.sin(2*Math.PI*o),t[3]=s*Math.cos(2*Math.PI*o),t},rotateX:function(t,n,e){e*=.5;const r=n[0],o=n[1],i=n[2],a=n[3],s=Math.sin(e),u=Math.cos(e);return t[0]=r*u+a*s,t[1]=o*u+i*s,t[2]=i*u-o*s,t[3]=a*u-r*s,t},rotateY:function(t,n,e){e*=.5;const r=n[0],o=n[1],i=n[2],a=n[3],s=Math.sin(e),u=Math.cos(e);return t[0]=r*u-i*s,t[1]=o*u+a*s,t[2]=i*u+r*s,t[3]=a*u-o*s,t},rotateZ:function(t,n,e){e*=.5;const r=n[0],o=n[1],i=n[2],a=n[3],s=Math.sin(e),u=Math.cos(e);return t[0]=r*u+o*s,t[1]=o*u-r*s,t[2]=i*u+a*s,t[3]=a*u-i*s,t},rotationTo:function(t,n,e){const r=(0,s.Om)(n,e);return r<-.999999?((0,s.$A)(F,N,n),(0,s.Il)(F)<1e-6&&(0,s.$A)(F,R,n),(0,s.S8)(F,F),c(t,F,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):((0,s.$A)(F,n,e),t[0]=F[0],t[1]=F[1],t[2]=F[2],t[3]=1+r,z(t,t))},scale:y,set:v,setAxes:function(t,n,e,r){const o=k;return o[0]=e[0],o[3]=e[1],o[6]=e[2],o[1]=r[0],o[4]=r[1],o[7]=r[2],o[2]=-n[0],o[5]=-n[1],o[8]=-n[2],z(t,p(t,o))},setAxisAngle:c,slerp:h,sqlerp:function(t,n,e,r,o,i){return h(Z,n,o,i),h(S,e,r,i),h(t,Z,S,2*i*(1-i)),t},sqrLen:I,squaredLength:P,str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}},Symbol.toStringTag,{value:"Module"}))},73836(t,n,e){e.d(n,{A:()=>d});var r=e(5482),o=e(69540),i=e(25482),a=e(91429),s=e(58083),u=e(9093),c=e(67026),l=e(82534),f=e(51850),h=e(24770);let d=class extends((0,o.OU)(i.o)){constructor(t){super(t),this.translation=(0,f.vt)(),this.rotationAxis=(0,f.ci)(h.up),this.rotationAngle=0,this.scale=(0,f.fA)(1,1,1)}get rotation(){return(0,h.i4)(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=(0,f.o8)((0,h.yo)(t)),this.rotationAngle=(0,h.g7)(t)}get localMatrix(){const t=(0,u.vt)();return(0,c.x8)(p,(0,h.yo)(this.rotation),(0,h.$I)(this.rotation)),(0,s.o1)(t,p,this.translation,this.scale),t}get localMatrixInverse(){return(0,s.B8)((0,u.vt)(),this.localMatrix)}equals(t){return this===t||null!=t&&(0,s.t2)(this.localMatrix,t.localMatrix)}};(0,r.Cg)([(0,a.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"translation",void 0),(0,r.Cg)([(0,a.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAxis",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],d.prototype,"rotationAngle",void 0),(0,r.Cg)([(0,a.MZ)({type:[Number],nonNullable:!0,json:{write:!0}})],d.prototype,"scale",void 0),(0,r.Cg)([(0,a.MZ)()],d.prototype,"rotation",null),(0,r.Cg)([(0,a.MZ)()],d.prototype,"localMatrix",null),(0,r.Cg)([(0,a.MZ)()],d.prototype,"localMatrixInverse",null),d=(0,r.Cg)([(0,a.$K)("esri.geometry.support.MeshTransform")],d);const p=(0,l.vt)()}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8902],{5443(t,n,i){i.d(n,{A:()=>y});var e,r=i(5482),s=i(799),a=i(91429),m=i(91075),h=i(86738),o=i(16930),u=i(94078),x=i(12176),c=i(21325),l=i(28735);function f(t,n,i){return null==n?i:null==i?n:t(n,i)}let y=e=class extends m.A{constructor(...t){super(...t),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(t,n,i,e,r){return function(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:"object"==typeof t?(t.spatialReference=null==t.spatialReference?o.A.WGS84:t.spatialReference,t):{xmin:t,ymin:n,xmax:i,ymax:e,spatialReference:r??o.A.WGS84}}static fromPoint(t){return new e({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const t=new h.A({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}get extent(){return this.clone()}get hasM(){return null!=this.mmin&&null!=this.mmax}get hasZ(){return null!=this.zmin&&null!=this.zmax}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(t){const n=this.center;return null!=t.z&&this.hasZ?this.offset(t.x-n.x,t.y-n.y,t.z-n.z):this.offset(t.x-n.x,t.y-n.y)}clone(){const t=new e;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,null!=this.zmin&&(t.zmin=this.zmin,t.zmax=this.zmax),null!=this.mmin&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const n=this.spatialReference,i=t.spatialReference;return n&&i&&!n.equals(i)&&(0,l.y7)(n,i)&&(t=n.isWebMercator?(0,l.Gh)(t):(0,l.ci)(t,!0)),"point"===t.type?(0,u.qz)(this,t):"extent"===t.type&&(0,u.gH)(this,t)}equals(t){if(this===t)return!0;if(null==t)return!1;const n=this.spatialReference,i=t.spatialReference;return n&&i&&!n.equals(i)&&(0,l.y7)(n,i)&&(t=n.isWebMercator?(0,l.Gh)(t):(0,l.ci)(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const n=.5*(1-t),i=this.width*n,e=this.height*n;if(this.xmin+=i,this.ymin+=e,this.xmax-=i,this.ymax-=e,this.hasZ){const t=(this.zmax-this.zmin)*n;this.zmin+=t,this.zmax-=t}if(this.hasM){const t=(this.mmax-this.mmin)*n;this.mmin+=t,this.mmax-=t}return this}intersects(t){if(null==t)return!1;"mesh"===t.type&&(t=t.extent);const n=this.spatialReference,i=t.spatialReference;return n&&i&&!(0,c.aI)(n,i)&&(0,l.y7)(n,i)&&(t=n.isWebMercator?(0,l.Gh)(t):(0,l.ci)(t,!0)),(0,x.xK)(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,n,i){return this.xmin+=t,this.ymin+=n,this.xmax+=t,this.ymax+=n,null!=i&&(this.zmin+=i,this.zmax+=i),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=f(Math.min,this.zmin,t.zmin),this.zmax=f(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=f(Math.min,this.mmin,t.mmin),this.mmax=f(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:null!=t&&this.intersects(t)?(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=f(Math.max,this.zmin,t.zmin),this.zmax=f(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=f(Math.max,this.mmin,t.mmin),this.mmax=f(Math.min,this.mmax,t.mmax)),this):null}toJSON(t){return this.write({},t)}_shiftCM(t=(0,c.Vp)(this.spatialReference)){if(!t||!this.spatialReference)return this;const n=this.spatialReference,i=this._getCM(t);if(i){const e=n.isWebMercator?(0,l.ci)(i):i;this.xmin-=i.x,this.xmax-=i.x,n.isWebMercator||(e.x=p(e.x,t).x),this.spatialReference=new o.A((0,s.HC)((n.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:e.x}))}return this}_getCM(t){let n=null;const[i,e]=t.valid,r=this.xmin,s=this.xmax;return r>=i&&r<=e&&s>=i&&s<=e||(n=this.center),n}_normalize(t,n,i){const e=this.spatialReference;if(!e)return this;const r=i??(0,c.Vp)(e);if(null==r)return this;const s=this._getParts(r).map(t=>t.extent);if(s.length<2)return s[0]||this;if(s.length>2)return t?this._shiftCM(r):this.set({xmin:r.valid[0],xmax:r.valid[1]});if(t)return this._shiftCM(r);if(n)return s;let a=!0,m=!0;return s.forEach(t=>{t.hasZ||(a=!1),t.hasM||(m=!1)}),{rings:s.map(t=>{const n=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(a){const i=(t.zmax-t.zmin)/2;for(let t=0;t<n.length;t++)n[t].push(i)}if(m){const i=(t.mmax-t.mmin)/2;for(let t=0;t<n.length;t++)n[t].push(i)}return n}),hasZ:a,hasM:m,spatialReference:e}}_getParts(t){let n=this.cache._parts;if(!n){n=[];const{ymin:i,ymax:r,spatialReference:s}=this,a=this.width,m=this.xmin,h=this.xmax;let o;t=t||(0,c.Vp)(s);const[u,x]=t.valid;o=p(this.xmin,t);const l=o.x,f=o.frameId;o=p(this.xmax,t);const y=o.x,M=o.frameId,g=l===y&&a>0;if(a>2*x){const t=new e(m<h?l:y,i,x,r,s),a=new e(u,i,m<h?y:l,r,s),o=new e(0,i,x,r,s),c=new e(u,i,0,r,s),p=[],g=[];t.contains(o)&&p.push(f),t.contains(c)&&g.push(f),a.contains(o)&&p.push(M),a.contains(c)&&g.push(M);for(let t=f+1;t<M;t++)p.push(t),g.push(t);n.push({extent:t,frameIds:[f]},{extent:a,frameIds:[M]},{extent:o,frameIds:p},{extent:c,frameIds:g})}else l>y||g?n.push({extent:new e(l,i,x,r,s),frameIds:[f]},{extent:new e(u,i,y,r,s),frameIds:[M]}):n.push({extent:new e(l,i,y,r,s),frameIds:[f]});this.cache._parts=n}const i=this.hasZ,r=this.hasM;if(i||r){const t={};i&&(t.zmin=this.zmin,t.zmax=this.zmax),r&&(t.mmin=this.mmin,t.mmax=this.mmax);for(let i=0;i<n.length;i++)n[i].extent.set(t)}return n}};function p(t,n){const[i,e]=n.valid,r=2*e;let s,a=0;return t>e?(s=Math.ceil(Math.abs(t-e)/r),t-=s*r,a=s):t<i&&(s=Math.ceil(Math.abs(t-i)/r),t+=s*r,a=-s),{x:t,frameId:a}}(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"cache",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"center",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"extent",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],y.prototype,"hasM",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],y.prototype,"hasZ",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"height",null),(0,r.Cg)([(0,a.MZ)({type:o.A,json:{write:!0},value:o.A.WGS84})],y.prototype,"spatialReference",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"width",null),(0,r.Cg)([(0,a.MZ)({type:Number,json:{type:[Number,String],write:{enabled:!0,allowNull:!0}}})],y.prototype,"xmin",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],y.prototype,"ymin",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{origins:{"web-scene":{write:!1}},read:t=>t??void 0,write:{overridePolicy(){return{enabled:this.hasM}}}}})],y.prototype,"mmin",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],y.prototype,"zmin",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],y.prototype,"xmax",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],y.prototype,"ymax",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{origins:{"web-scene":{write:!1}},read:t=>t??void 0,write:{overridePolicy(){return{enabled:this.hasM}}}}})],y.prototype,"mmax",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],y.prototype,"zmax",void 0),y=e=(0,r.Cg)([(0,a.$K)("esri.geometry.Extent")],y),y.prototype.toJSON.isDefaultToJSON=!0},12176(t,n,i){i.d(n,{Ql:()=>p,fA:()=>l,xB:()=>s,xK:()=>M});var e=i(94078);function r(t,n){return(0,e.qz)(t,n)}function s(t,n){const i=t.hasZ&&n.hasZ;let e,r,s;if(t.xmin<=n.xmin){if(e=n.xmin,t.xmax<e)return!1}else if(e=t.xmin,n.xmax<e)return!1;if(t.ymin<=n.ymin){if(r=n.ymin,t.ymax<r)return!1}else if(r=t.ymin,n.ymax<r)return!1;if(i&&n.hasZ)if(t.zmin<=n.zmin){if(s=n.zmin,t.zmax<s)return!1}else if(s=t.zmin,n.zmax<s)return!1;return!0}function a(t,n){const{points:i,hasZ:r}=n,s=r?e.F8:e.CW;for(const n of i)if(s(t,n))return!0;return!1}const m=[0,0],h=[0,0],o=[0,0],u=[0,0],x=[m,h,o,u],c=[[o,m],[m,h],[h,u],[u,o]];function l(t,n){return function(t,n){m[0]=t.xmin,m[1]=t.ymax,h[0]=t.xmax,h[1]=t.ymax,o[0]=t.xmin,o[1]=t.ymin,u[0]=t.xmax,u[1]=t.ymin;for(const t of x)if((0,e.t1)(n,t))return!0;for(const i of n){if(!i.length)continue;let n=i[0];if((0,e.CW)(t,n))return!0;for(let r=1;r<i.length;r++){const s=i[r];if((0,e.CW)(t,s)||y(n,s,c))return!0;n=s}}return!1}(t,n.rings)}function f(t,n){m[0]=t.xmin,m[1]=t.ymax,h[0]=t.xmax,h[1]=t.ymax,o[0]=t.xmin,o[1]=t.ymin,u[0]=t.xmax,u[1]=t.ymin;const i=n.paths;for(const n of i){if(!i.length)continue;let r=n[0];if((0,e.CW)(t,r))return!0;for(let i=1;i<n.length;i++){const s=n[i];if((0,e.CW)(t,s)||y(r,s,c))return!0;r=s}}return!1}function y(t,n,i){for(let e=0;e<i.length;e++)if(p(t,n,i[e][0],i[e][1]))return!0;return!1}function p(t,n,i,e,r){const[s,a]=t,[m,h]=n,[o,u]=i,[x,c]=e,l=x-o,f=s-o,y=m-s,p=c-u,M=a-u,g=h-a,z=p*y-l*g;if(0===z)return!1;const d=(l*M-p*f)/z,w=(y*M-g*f)/z;return d>=0&&d<=1&&w>=0&&w<=1&&(r&&(r[0]=s+d*(m-s),r[1]=a+d*(h-a)),!0)}function M(t){switch(t){case"esriGeometryEnvelope":case"extent":return s;case"esriGeometryMultipoint":case"multipoint":return a;case"esriGeometryPoint":case"point":return r;case"esriGeometryMultiPatch":case"multipatch":case"esriGeometryPolygon":case"polygon":return l;case"esriGeometryPolyline":case"polyline":return f}}},19419(t,n,i){i.d(n,{$9:()=>w,HY:()=>d,IO:()=>x,Ie:()=>R,Rj:()=>z,VL:()=>f,VY:()=>m,Wc:()=>p,aI:()=>C,bx:()=>c,fA:()=>a,fT:()=>l,gR:()=>v,gX:()=>M,ib:()=>g,nw:()=>u,qv:()=>Z,tK:()=>o,uJ:()=>y,vt:()=>r,w1:()=>h}),i(34727);var e=i(5443);function r(t=P){return[t[0],t[1],t[2],t[3]]}function s(t,n){return t!==n&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3]),t}function a(t,n,i,e,s=r()){return s[0]=t,s[1]=n,s[2]=i,s[3]=e,s}function m(t,n=r()){return n[0]=t.xmin,n[1]=t.ymin,n[2]=t.xmax,n[3]=t.ymax,n}function h(t,n,i=new e.A){return i.xmin=t[0],i.ymin=t[1],i.xmax=t[2],i.ymax=t[3],i.spatialReference=n,i}function o(t,n){n[0]<t[0]&&(t[0]=n[0]),n[0]>t[2]&&(t[2]=n[0]),n[1]<t[1]&&(t[1]=n[1]),n[1]>t[3]&&(t[3]=n[1])}function u(t,n){n<t[0]&&(t[0]=n),n>t[2]&&(t[2]=n)}function x(t,n){n<t[1]&&(t[1]=n),n>t[3]&&(t[3]=n)}function c(t,{xmin:n,ymin:i,xmax:e,ymax:r}){t[0]=Math.min(t[0],n),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function l(t,n,i){if(null!=n)if("length"in n)b(n)?(i[0]=Math.min(t[0],n[0]),i[1]=Math.min(t[1],n[1]),i[2]=Math.max(t[2],n[2]),i[3]=Math.max(t[3],n[3])):2!==n.length&&3!==n.length||(i[0]=Math.min(t[0],n[0]),i[1]=Math.min(t[1],n[1]),i[2]=Math.max(t[2],n[0]),i[3]=Math.max(t[3],n[1]));else switch(n.type){case"extent":i[0]=Math.min(t[0],n.xmin),i[1]=Math.min(t[1],n.ymin),i[2]=Math.max(t[2],n.xmax),i[3]=Math.max(t[3],n.ymax);break;case"point":i[0]=Math.min(t[0],n.x),i[1]=Math.min(t[1],n.y),i[2]=Math.max(t[2],n.x),i[3]=Math.max(t[3],n.y)}else s(i,t)}function f(t){return null==t||t[0]>=t[2]?0:t[2]-t[0]}function y(t){return null==t||t[1]>=t[3]?0:t[3]-t[1]}function p(t){return f(t)*y(t)}function M(t,n=[0,0]){return n[0]=(t[0]+t[2])/2,n[1]=(t[1]+t[3])/2,n}function g(t){const n=f(t),i=y(t);return Math.sqrt(n*n+i*i)}function z(t,n,i){return n>=t[0]&&i>=t[1]&&n<=t[2]&&i<=t[3]}function d(t,n){return Math.max(n[0],t[0])<=Math.min(n[2],t[2])&&Math.max(n[1],t[1])<=Math.min(n[3],t[3])}function w(t,n,i){return Math.max(n[0],t[0])-i<=Math.min(n[2],t[2])&&Math.max(n[1],t[1])-i<=Math.min(n[3],t[3])}function v(t,n){return n[0]>=t[0]&&n[2]<=t[2]&&n[1]>=t[1]&&n[3]<=t[3]}function R(t){return t?s(t,Z):r(Z)}function b(t){return null!=t&&4===t.length}function C(t,n){return b(t)&&b(n)?t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]:t===n}const Z=[1/0,1/0,-1/0,-1/0],P=[0,0,0,0]},52006(t,n,i){i.d(n,{$3:()=>y,DA:()=>u,Ed:()=>r,FD:()=>s,FG:()=>o,Xq:()=>h,aO:()=>m,n1:()=>a,tk:()=>l,wY:()=>x,yP:()=>c,zt:()=>f});var e=i(4576);function r(t){return"curveRings"in t&&!!t.curveRings?.length||"curvePaths"in t&&!!t.curvePaths?.length}function s(t){return"curveRings"in t?t.curveRings:t.curvePaths}function a(t){return"b"in t}function m(t){return"c"in t}function h(t){return Array.isArray(t)}function o(t){return"a"in t}function u(t){return"a"in t&&4===t.a.length}function x(t){return"a"in t&&7===t.a.length}function c(t){return h(t)?t:a(t)?t.b[0]:m(t)?t.c[0]:t.a[0]}function l(t){if(a(t)){const[n,i,e]=t.b;return{b:[[...n],[...i],[...e]]}}if(m(t)){const[n,i]=t.c;return{c:[[...n],[...i]]}}if(h(t))return[...t];if(u(t)){const[n,i,e,r]=t.a;return{a:[[...n],[...i],e,r]}}if(x(t)){const[n,i,e,r,s,a,m]=t.a;return{a:[[...n],[...i],e,r,s,a,m]}}return t}function f(t){return r(t)?"curveRings"in t?t.curveRings:t.curvePaths:"rings"in t?t.rings:t.paths}function y(t,n=0,i=1){let r=0;const s=t.length;let a=c(t[0]);for(let e=1;e<s;e++){const s=c(t[e]);r+=(s[n]-a[n])*(s[i]+a[i]),a=s}if(function(t){const n=t.length;return n>0&&!(0,e.aI)(c(t[0]),c(t[n-1]))}(t)){const e=c(t[0]);r+=(e[n]-a[n])*(e[i]+a[i])}return r>=0}},94078(t,n,i){i.d(n,{CW:()=>m,F8:()=>h,gH:()=>a,m3:()=>u,qz:()=>r,rL:()=>s,t1:()=>x});const e=[0,0];function r(t,n){return null!=n&&o(t,n.x,n.y,n.z)}function s(t,n){if(!n.points?.length)return!1;for(const i of n.points)if(!m(t,i))return!1;return!0}function a(t,n){const{xmin:i,ymin:e,zmin:r,xmax:s,ymax:a,zmax:m}=n;return t.hasZ&&n.hasZ?o(t,i,e,r)&&o(t,i,a,r)&&o(t,s,a,r)&&o(t,s,e,r)&&o(t,i,e,m)&&o(t,i,a,m)&&o(t,s,a,m)&&o(t,s,e,m):o(t,i,e)&&o(t,i,a)&&o(t,s,a)&&o(t,s,e)}function m(t,n){return o(t,n[0],n[1])}function h(t,n){return o(t,n[0],n[1],n[2])}function o(t,n,i,e){return n>=t.xmin&&n<=t.xmax&&i>=t.ymin&&i<=t.ymax&&(null==e||!t.hasZ||e>=t.zmin&&e<=t.zmax)}function u(t,n){return e[1]=n.y,e[0]=n.x,function(t,n){return x(t.rings,n)}(t,e)}function x(t,n){if(!t||t.length<1)return!1;if(function(t){return!Array.isArray(t[0][0])}(t))return c(!1,t,n);let i=!1;for(let e=0,r=t.length;e<r;e++)i=c(i,t[e],n);return i}function c(t,n,i){const[e,r]=i;let s=t,a=0;for(let t=0,i=n.length;t<i;t++){a++,a===i&&(a=0);const[m,h]=n[t],[o,u]=n[a];(h<r&&u>=r||u<r&&h>=r)&&m+(r-h)/(u-h)*(o-m)<e&&(s=!s)}return s}},95108(t,n,i){i.d(n,{$3:()=>o,Ng:()=>a,R3:()=>r,Yl:()=>h,gR:()=>s,m3:()=>x,t9:()=>m});var e=i(4576);function r(t,n){const i=n[0]-t[0],e=n[1]-t[1];if(t.length>2&&n.length>2){const r=t[2]-n[2];return Math.sqrt(i*i+e*e+r*r)}return Math.sqrt(i*i+e*e)}function s(t,n,i,e){const[r,s]=n,[a,m]=i,[h,o]=e,u=h-a,x=o-m,c=u*u+x*x,l=(r-a)*u+(s-m)*x,f=Math.min(1,Math.max(0,l/c));return t[0]=a+u*f,t[1]=m+x*f,t}function a(t,n,i,e,r,s){let a=i,m=e,h=r-a,o=s-m;if(0!==h||0!==o){const i=((t-a)*h+(n-m)*o)/(h*h+o*o);i>1?(a=r,m=s):i>0&&(a+=h*i,m+=o*i)}return h=t-a,o=n-m,h*h+o*o}function m(t,n){return function(t,n,i){const e=t[0]+i*(n[0]-t[0]),r=t[1]+i*(n[1]-t[1]);return t.length>2&&n.length>2?[e,r,t[2]+i*(n[2]-t[2])]:[e,r]}(t,n,.5)}function h(t){const n=t.length;let i=0;for(let e=0;e<n-1;++e)i+=r(t[e],t[e+1]);return i}function o(t,n=0,i=1){let e=0;const r=t.length;let s=t[0];for(let a=1;a<r;a++){const r=t[a];e+=(r[n]-s[n])*(r[i]+s[i]),s=r}if(u(t)){const r=t[0];e+=(r[n]-s[n])*(r[i]+s[i])}return e>=0}function u(t){const n=t.length;return n>0&&!(0,e.aI)(t[0],t[n-1])}function x(t){if("rings"in t)for(const n of t.rings)u(n)&&n.push(n[0].slice())}i(21325),i(52006)}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8902],{5443(t,n,i){i.d(n,{A:()=>y});var e,r=i(5482),s=i(799),a=i(91429),m=i(91075),h=i(86738),o=i(16930),u=i(94078),x=i(12176),c=i(21325),l=i(28735);function f(t,n,i){return null==n?i:null==i?n:t(n,i)}let y=e=class extends m.A{constructor(...t){super(...t),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(t,n,i,e,r){return function(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:"object"==typeof t?(t.spatialReference=null==t.spatialReference?o.A.WGS84:t.spatialReference,t):{xmin:t,ymin:n,xmax:i,ymax:e,spatialReference:r??o.A.WGS84}}static fromPoint(t){return new e({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const t=new h.A({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}get extent(){return this.clone()}get hasM(){return null!=this.mmin&&null!=this.mmax}get hasZ(){return null!=this.zmin&&null!=this.zmax}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(t){const n=this.center;return null!=t.z&&this.hasZ?this.offset(t.x-n.x,t.y-n.y,t.z-n.z):this.offset(t.x-n.x,t.y-n.y)}clone(){const t=new e;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,null!=this.zmin&&(t.zmin=this.zmin,t.zmax=this.zmax),null!=this.mmin&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const n=this.spatialReference,i=t.spatialReference;return n&&i&&!n.equals(i)&&(0,l.y7)(n,i)&&(t=n.isWebMercator?(0,l.Gh)(t):(0,l.ci)(t,!0)),"point"===t.type?(0,u.qz)(this,t):"extent"===t.type&&(0,u.gH)(this,t)}equals(t){if(this===t)return!0;if(null==t)return!1;const n=this.spatialReference,i=t.spatialReference;return n&&i&&!n.equals(i)&&(0,l.y7)(n,i)&&(t=n.isWebMercator?(0,l.Gh)(t):(0,l.ci)(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const n=.5*(1-t),i=this.width*n,e=this.height*n;if(this.xmin+=i,this.ymin+=e,this.xmax-=i,this.ymax-=e,this.hasZ){const t=(this.zmax-this.zmin)*n;this.zmin+=t,this.zmax-=t}if(this.hasM){const t=(this.mmax-this.mmin)*n;this.mmin+=t,this.mmax-=t}return this}intersects(t){if(null==t)return!1;"mesh"===t.type&&(t=t.extent);const n=this.spatialReference,i=t.spatialReference;return n&&i&&!(0,c.aI)(n,i)&&(0,l.y7)(n,i)&&(t=n.isWebMercator?(0,l.Gh)(t):(0,l.ci)(t,!0)),(0,x.xK)(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,n,i){return this.xmin+=t,this.ymin+=n,this.xmax+=t,this.ymax+=n,null!=i&&(this.zmin+=i,this.zmax+=i),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=f(Math.min,this.zmin,t.zmin),this.zmax=f(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=f(Math.min,this.mmin,t.mmin),this.mmax=f(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:null!=t&&this.intersects(t)?(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=f(Math.max,this.zmin,t.zmin),this.zmax=f(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=f(Math.max,this.mmin,t.mmin),this.mmax=f(Math.min,this.mmax,t.mmax)),this):null}toJSON(t){return this.write({},t)}_shiftCM(t=(0,c.Vp)(this.spatialReference)){if(!t||!this.spatialReference)return this;const n=this.spatialReference,i=this._getCM(t);if(i){const e=n.isWebMercator?(0,l.ci)(i):i;this.xmin-=i.x,this.xmax-=i.x,n.isWebMercator||(e.x=p(e.x,t).x),this.spatialReference=new o.A((0,s.HC)((n.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:e.x}))}return this}_getCM(t){let n=null;const[i,e]=t.valid,r=this.xmin,s=this.xmax;return r>=i&&r<=e&&s>=i&&s<=e||(n=this.center),n}_normalize(t,n,i){const e=this.spatialReference;if(!e)return this;const r=i??(0,c.Vp)(e);if(null==r)return this;const s=this._getParts(r).map(t=>t.extent);if(s.length<2)return s[0]||this;if(s.length>2)return t?this._shiftCM(r):this.set({xmin:r.valid[0],xmax:r.valid[1]});if(t)return this._shiftCM(r);if(n)return s;let a=!0,m=!0;return s.forEach(t=>{t.hasZ||(a=!1),t.hasM||(m=!1)}),{rings:s.map(t=>{const n=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(a){const i=(t.zmax-t.zmin)/2;for(let t=0;t<n.length;t++)n[t].push(i)}if(m){const i=(t.mmax-t.mmin)/2;for(let t=0;t<n.length;t++)n[t].push(i)}return n}),hasZ:a,hasM:m,spatialReference:e}}_getParts(t){let n=this.cache._parts;if(!n){n=[];const{ymin:i,ymax:r,spatialReference:s}=this,a=this.width,m=this.xmin,h=this.xmax;let o;t=t||(0,c.Vp)(s);const[u,x]=t.valid;o=p(this.xmin,t);const l=o.x,f=o.frameId;o=p(this.xmax,t);const y=o.x,M=o.frameId,g=l===y&&a>0;if(a>2*x){const t=new e(m<h?l:y,i,x,r,s),a=new e(u,i,m<h?y:l,r,s),o=new e(0,i,x,r,s),c=new e(u,i,0,r,s),p=[],g=[];t.contains(o)&&p.push(f),t.contains(c)&&g.push(f),a.contains(o)&&p.push(M),a.contains(c)&&g.push(M);for(let t=f+1;t<M;t++)p.push(t),g.push(t);n.push({extent:t,frameIds:[f]},{extent:a,frameIds:[M]},{extent:o,frameIds:p},{extent:c,frameIds:g})}else l>y||g?n.push({extent:new e(l,i,x,r,s),frameIds:[f]},{extent:new e(u,i,y,r,s),frameIds:[M]}):n.push({extent:new e(l,i,y,r,s),frameIds:[f]});this.cache._parts=n}const i=this.hasZ,r=this.hasM;if(i||r){const t={};i&&(t.zmin=this.zmin,t.zmax=this.zmax),r&&(t.mmin=this.mmin,t.mmax=this.mmax);for(let i=0;i<n.length;i++)n[i].extent.set(t)}return n}};function p(t,n){const[i,e]=n.valid,r=2*e;let s,a=0;return t>e?(s=Math.ceil(Math.abs(t-e)/r),t-=s*r,a=s):t<i&&(s=Math.ceil(Math.abs(t-i)/r),t+=s*r,a=-s),{x:t,frameId:a}}(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"cache",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"center",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"extent",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],y.prototype,"hasM",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],y.prototype,"hasZ",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"height",null),(0,r.Cg)([(0,a.MZ)({type:o.A,json:{write:!0},value:o.A.WGS84})],y.prototype,"spatialReference",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],y.prototype,"width",null),(0,r.Cg)([(0,a.MZ)({type:Number,json:{type:[Number,String],write:{enabled:!0,allowNull:!0}}})],y.prototype,"xmin",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],y.prototype,"ymin",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{origins:{"web-scene":{write:!1}},read:t=>t??void 0,write:{overridePolicy(){return{enabled:this.hasM}}}}})],y.prototype,"mmin",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],y.prototype,"zmin",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],y.prototype,"xmax",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0}})],y.prototype,"ymax",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{origins:{"web-scene":{write:!1}},read:t=>t??void 0,write:{overridePolicy(){return{enabled:this.hasM}}}}})],y.prototype,"mmax",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],y.prototype,"zmax",void 0),y=e=(0,r.Cg)([(0,a.$K)("esri.geometry.Extent")],y),y.prototype.toJSON.isDefaultToJSON=!0},12176(t,n,i){i.d(n,{Ql:()=>p,fA:()=>l,xB:()=>s,xK:()=>M});var e=i(94078);function r(t,n){return(0,e.qz)(t,n)}function s(t,n){const i=t.hasZ&&n.hasZ;let e,r,s;if(t.xmin<=n.xmin){if(e=n.xmin,t.xmax<e)return!1}else if(e=t.xmin,n.xmax<e)return!1;if(t.ymin<=n.ymin){if(r=n.ymin,t.ymax<r)return!1}else if(r=t.ymin,n.ymax<r)return!1;if(i&&n.hasZ)if(t.zmin<=n.zmin){if(s=n.zmin,t.zmax<s)return!1}else if(s=t.zmin,n.zmax<s)return!1;return!0}function a(t,n){const{points:i,hasZ:r}=n,s=r?e.F8:e.CW;for(const n of i)if(s(t,n))return!0;return!1}const m=[0,0],h=[0,0],o=[0,0],u=[0,0],x=[m,h,o,u],c=[[o,m],[m,h],[h,u],[u,o]];function l(t,n){return function(t,n){m[0]=t.xmin,m[1]=t.ymax,h[0]=t.xmax,h[1]=t.ymax,o[0]=t.xmin,o[1]=t.ymin,u[0]=t.xmax,u[1]=t.ymin;for(const t of x)if((0,e.t1)(n,t))return!0;for(const i of n){if(!i.length)continue;let n=i[0];if((0,e.CW)(t,n))return!0;for(let r=1;r<i.length;r++){const s=i[r];if((0,e.CW)(t,s)||y(n,s,c))return!0;n=s}}return!1}(t,n.rings)}function f(t,n){m[0]=t.xmin,m[1]=t.ymax,h[0]=t.xmax,h[1]=t.ymax,o[0]=t.xmin,o[1]=t.ymin,u[0]=t.xmax,u[1]=t.ymin;const i=n.paths;for(const n of i){if(!i.length)continue;let r=n[0];if((0,e.CW)(t,r))return!0;for(let i=1;i<n.length;i++){const s=n[i];if((0,e.CW)(t,s)||y(r,s,c))return!0;r=s}}return!1}function y(t,n,i){for(let e=0;e<i.length;e++)if(p(t,n,i[e][0],i[e][1]))return!0;return!1}function p(t,n,i,e,r){const[s,a]=t,[m,h]=n,[o,u]=i,[x,c]=e,l=x-o,f=s-o,y=m-s,p=c-u,M=a-u,g=h-a,z=p*y-l*g;if(0===z)return!1;const d=(l*M-p*f)/z,w=(y*M-g*f)/z;return d>=0&&d<=1&&w>=0&&w<=1&&(r&&(r[0]=s+d*(m-s),r[1]=a+d*(h-a)),!0)}function M(t){switch(t){case"esriGeometryEnvelope":case"extent":return s;case"esriGeometryMultipoint":case"multipoint":return a;case"esriGeometryPoint":case"point":return r;case"esriGeometryMultiPatch":case"multipatch":case"esriGeometryPolygon":case"polygon":return l;case"esriGeometryPolyline":case"polyline":return f}}},19419(t,n,i){i.d(n,{$9:()=>w,HY:()=>d,IO:()=>x,Ie:()=>v,Rj:()=>z,VL:()=>f,VY:()=>m,Wc:()=>p,aI:()=>C,bx:()=>c,fA:()=>a,fT:()=>l,gR:()=>b,gX:()=>M,ib:()=>g,nw:()=>u,qv:()=>Z,tK:()=>o,uJ:()=>y,vt:()=>r,w1:()=>h}),i(34727);var e=i(5443);function r(t=P){return[t[0],t[1],t[2],t[3]]}function s(t,n){return t!==n&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3]),t}function a(t,n,i,e,s=r()){return s[0]=t,s[1]=n,s[2]=i,s[3]=e,s}function m(t,n=r()){return n[0]=t.xmin,n[1]=t.ymin,n[2]=t.xmax,n[3]=t.ymax,n}function h(t,n,i=new e.A){return i.xmin=t[0],i.ymin=t[1],i.xmax=t[2],i.ymax=t[3],i.spatialReference=n,i}function o(t,n){n[0]<t[0]&&(t[0]=n[0]),n[0]>t[2]&&(t[2]=n[0]),n[1]<t[1]&&(t[1]=n[1]),n[1]>t[3]&&(t[3]=n[1])}function u(t,n){n<t[0]&&(t[0]=n),n>t[2]&&(t[2]=n)}function x(t,n){n<t[1]&&(t[1]=n),n>t[3]&&(t[3]=n)}function c(t,{xmin:n,ymin:i,xmax:e,ymax:r}){t[0]=Math.min(t[0],n),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function l(t,n,i){if(null!=n)if("length"in n)R(n)?(i[0]=Math.min(t[0],n[0]),i[1]=Math.min(t[1],n[1]),i[2]=Math.max(t[2],n[2]),i[3]=Math.max(t[3],n[3])):2!==n.length&&3!==n.length||(i[0]=Math.min(t[0],n[0]),i[1]=Math.min(t[1],n[1]),i[2]=Math.max(t[2],n[0]),i[3]=Math.max(t[3],n[1]));else switch(n.type){case"extent":i[0]=Math.min(t[0],n.xmin),i[1]=Math.min(t[1],n.ymin),i[2]=Math.max(t[2],n.xmax),i[3]=Math.max(t[3],n.ymax);break;case"point":i[0]=Math.min(t[0],n.x),i[1]=Math.min(t[1],n.y),i[2]=Math.max(t[2],n.x),i[3]=Math.max(t[3],n.y)}else s(i,t)}function f(t){return null==t||t[0]>=t[2]?0:t[2]-t[0]}function y(t){return null==t||t[1]>=t[3]?0:t[3]-t[1]}function p(t){return f(t)*y(t)}function M(t,n=[0,0]){return n[0]=(t[0]+t[2])/2,n[1]=(t[1]+t[3])/2,n}function g(t){const n=f(t),i=y(t);return Math.sqrt(n*n+i*i)}function z(t,n,i){return n>=t[0]&&i>=t[1]&&n<=t[2]&&i<=t[3]}function d(t,n){return Math.max(n[0],t[0])<=Math.min(n[2],t[2])&&Math.max(n[1],t[1])<=Math.min(n[3],t[3])}function w(t,n,i){return Math.max(n[0],t[0])-i<=Math.min(n[2],t[2])&&Math.max(n[1],t[1])-i<=Math.min(n[3],t[3])}function b(t,n){return n[0]>=t[0]&&n[2]<=t[2]&&n[1]>=t[1]&&n[3]<=t[3]}function v(t){return t?s(t,Z):r(Z)}function R(t){return null!=t&&4===t.length}function C(t,n){return R(t)&&R(n)?t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]:t===n}const Z=[1/0,1/0,-1/0,-1/0],P=[0,0,0,0]},52006(t,n,i){function e(t){return"curveRings"in t&&!!t.curveRings?.length||"curvePaths"in t&&!!t.curvePaths?.length}function r(t){return"curveRings"in t?t.curveRings:t.curvePaths}function s(t){return"b"in t}function a(t){return"c"in t}function m(t){return Array.isArray(t)}function h(t){return"a"in t}function o(t){return"a"in t&&4===t.a.length}function u(t){return"a"in t&&7===t.a.length}function x(t,n){return r(t).flat().some(t=>function(t,n){return!(m(t)||(s(t)?n.has("cubic-bezier"):a(t)?n.has("circular-arc"):!o(t)&&!u(t)||n.has("elliptic-arc")))}(t,n))}function c(t){return m(t)?t:s(t)?t.b[0]:a(t)?t.c[0]:t.a[0]}function l(t){if(s(t)){const[n,i,e]=t.b;return{b:[[...n],[...i],[...e]]}}if(a(t)){const[n,i]=t.c;return{c:[[...n],[...i]]}}if(m(t))return[...t];if(o(t)){const[n,i,e,r]=t.a;return{a:[[...n],[...i],e,r]}}if(u(t)){const[n,i,e,r,s,a,m]=t.a;return{a:[[...n],[...i],e,r,s,a,m]}}return t}i.d(n,{DA:()=>o,Ed:()=>e,FD:()=>r,FG:()=>h,V8:()=>x,Xq:()=>m,aO:()=>a,n1:()=>s,tk:()=>l,wY:()=>u,yP:()=>c}),i(4576)},94078(t,n,i){i.d(n,{CW:()=>m,F8:()=>h,gH:()=>a,m3:()=>u,qz:()=>r,rL:()=>s,t1:()=>x});const e=[0,0];function r(t,n){return null!=n&&o(t,n.x,n.y,n.z)}function s(t,n){if(!n.points?.length)return!1;for(const i of n.points)if(!m(t,i))return!1;return!0}function a(t,n){const{xmin:i,ymin:e,zmin:r,xmax:s,ymax:a,zmax:m}=n;return t.hasZ&&n.hasZ?o(t,i,e,r)&&o(t,i,a,r)&&o(t,s,a,r)&&o(t,s,e,r)&&o(t,i,e,m)&&o(t,i,a,m)&&o(t,s,a,m)&&o(t,s,e,m):o(t,i,e)&&o(t,i,a)&&o(t,s,a)&&o(t,s,e)}function m(t,n){return o(t,n[0],n[1])}function h(t,n){return o(t,n[0],n[1],n[2])}function o(t,n,i,e){return n>=t.xmin&&n<=t.xmax&&i>=t.ymin&&i<=t.ymax&&(null==e||!t.hasZ||e>=t.zmin&&e<=t.zmax)}function u(t,n){return e[1]=n.y,e[0]=n.x,function(t,n){return x(t.rings,n)}(t,e)}function x(t,n){if(!t||t.length<1)return!1;if(function(t){return!Array.isArray(t[0][0])}(t))return c(!1,t,n);let i=!1;for(let e=0,r=t.length;e<r;e++)i=c(i,t[e],n);return i}function c(t,n,i){const[e,r]=i;let s=t,a=0;for(let t=0,i=n.length;t<i;t++){a++,a===i&&(a=0);const[m,h]=n[t],[o,u]=n[a];(h<r&&u>=r||u<r&&h>=r)&&m+(r-h)/(u-h)*(o-m)<e&&(s=!s)}return s}},95108(t,n,i){i.d(n,{$3:()=>o,Ng:()=>a,R3:()=>r,Yl:()=>h,gR:()=>s,m3:()=>x,t9:()=>m});var e=i(4576);function r(t,n){const i=n[0]-t[0],e=n[1]-t[1];if(t.length>2&&n.length>2){const r=t[2]-n[2];return Math.sqrt(i*i+e*e+r*r)}return Math.sqrt(i*i+e*e)}function s(t,n,i,e){const[r,s]=n,[a,m]=i,[h,o]=e,u=h-a,x=o-m,c=u*u+x*x,l=(r-a)*u+(s-m)*x,f=Math.min(1,Math.max(0,l/c));return t[0]=a+u*f,t[1]=m+x*f,t}function a(t,n,i,e,r,s){let a=i,m=e,h=r-a,o=s-m;if(0!==h||0!==o){const i=((t-a)*h+(n-m)*o)/(h*h+o*o);i>1?(a=r,m=s):i>0&&(a+=h*i,m+=o*i)}return h=t-a,o=n-m,h*h+o*o}function m(t,n){return function(t,n,i){const e=t[0]+i*(n[0]-t[0]),r=t[1]+i*(n[1]-t[1]);return t.length>2&&n.length>2?[e,r,t[2]+i*(n[2]-t[2])]:[e,r]}(t,n,.5)}function h(t){const n=t.length;let i=0;for(let e=0;e<n-1;++e)i+=r(t[e],t[e+1]);return i}function o(t,n=0,i=1){let e=0;const r=t.length;let s=t[0];for(let a=1;a<r;a++){const r=t[a];e+=(r[n]-s[n])*(r[i]+s[i]),s=r}if(u(t)){const r=t[0];e+=(r[n]-s[n])*(r[i]+s[i])}return e>=0}function u(t){const n=t.length;return n>0&&!(0,e.aI)(t[0],t[n-1])}function x(t){if("rings"in t)for(const n of t.rings)u(n)&&n.push(n[0].slice())}i(21325),i(52006)}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5217,5243],{25217(t,e,i){i.r(e),i.d(e,{default:()=>u});var s=i(49186),a=i(74887),o=i(40036),n=i(16930),r=i(19211),l=i(35063),h=i(28208),c=i(66655);class u{constructor(t,e,i,o,u,m,f,d,w,g){this.level=t,this.row=e,this.column=i,this.horizontalFieldOfView=o,this.verticalFieldOfView=u,this.yaw=m,this.pitch=f,this.distance=d,this.horizonAngles=w,this.getPixelBlock=g,this._cache=null,this.loadMesh=async t=>{const{level:e,row:i,column:o,horizontalFieldOfView:u,verticalFieldOfView:m,yaw:f,pitch:d,distance:w}=this,{Mesh:g,MeshComponent:p,MeshVertexAttributes:M,panoramicMeshManager:x}=await(0,c.Zg)(),{faces:_,...v}=await x.getFacesWithVertexAttributes({distance:w,yaw:f,horizontalFieldOfView:u,pitch:d,verticalFieldOfView:m});(0,a.Te)(t);const y=await this.getPixelBlock(e,i,o,t);if((0,a.Te)(t),!y)throw new s.A("panoramic-viewer:missing-tile-data",`Tile data for level ${e}, row ${i}, column ${o} is missing`,{level:e,row:i,column:o});const z=await x.convertPixelBlockToImageData(y);(0,a.Te)(t);const b=new g({vertexAttributes:new M(v),components:[new p({faces:_,trustSourceNormals:!0,material:new r.default({colorTexture:new l.default({data:z})})})],spatialReference:n.A.WebMercator});return b.rotate(...this.horizonAngles,{origin:h.ZH}),await b.load(t),this._cache=b,this._cache},this.loadMeshAtDistance=async(t,e)=>{const i=this.distance;return this.distance=t,Math.abs(i-t)>1e-6&&this._cache?this._cache:await this.loadMesh(e)}}get loaded(){return null!==this._cache}get key(){return`${this.level}/${this.row}/${this.column}`}clone(){const{level:t,row:e,column:i,horizontalFieldOfView:s,verticalFieldOfView:a,yaw:n,pitch:r,distance:l,getPixelBlock:h,horizonAngles:c}=this,m=new u(t,e,i,s,a,n,r,l,c,h);if(this._cache){const{vertexAttributes:t,components:e,spatialReference:i}=this._cache,s=e?.map(({material:t,faces:e,trustSourceNormals:i})=>({material:t,faces:e?.slice(),trustSourceNormals:i}));m._cache=new o.default({components:s,vertexAttributes:t.clone(),spatialReference:i})}return m}}},95243(t,e,i){i.r(e),i.d(e,{default:()=>_});var s=i(5482),a=i(69622),o=i(49186),n=i(91429),r=i(5443),l=i(72545),h=i(28208);class c{constructor(){this._keys=[],this._map=new Map}set(t,e){let i=0;for(;i<this._keys.length&&this._keys[i]<t;)i++;return this._keys.splice(i,0,t),this._map.set(t,e),this}get(t){let e=this._keys[0];for(const i of this._keys)t>=i&&(e=i);return this._map.get(e)}clear(){this._keys=[],this._map.clear()}}function u(t){return((t+180)%360+360)%360-180}function m(t){return Math.max(-90,Math.min(90,t))}function f(t,e,i,s){const a=Math.min(Math.max(i,0),360),o=Math.min(Math.max(s,0),180),n=a/2,r=o/2,l=e-90,h=m(l-r),c=m(l+r),f=c>=90||h<=-90||a>=360,d=u(t);return{latMin:h,latMax:c,lonMin:u(d-n),lonMax:u(d+n),fullLongitude:f,hfov:a,vfov:o}}function d(t,e,i,s){if(Math.abs(e-t)>=360||Math.abs(s-i)>=360)return!0;function a(t,e){return t<=e?[[t,e]]:[[t,180],[-180,e]]}const o=a(t,e),n=a(i,s);for(const t of o)for(const e of n)if(!(t[1]<=e[0]||t[0]>=e[1]))return!0;return!1}function w(t,e,i,s){return!(e<=i||t>=s)}function g(t,e,i,s){const a=360/i,o=180/s,n=t*a-180,r=n+a,l=90-e*o,h=l-o;return{lonMinRaw:n,lonMaxRaw:r,lonMin:u(n),lonMax:u(r),latMin:h,latMax:l}}function p(t,[e,i],[s,a],o,n,r,l,h){const{latMin:c,latMax:u,lonMin:m,lonMax:p,fullLongitude:M}=f(n,r,l,h),x=s-e+1,_=a-i+1,v=[];for(let n=e;n<=s;n++){const{lonMin:e,lonMax:s}=g(n,i,x,_);if(M||d(m,p,e,s))for(let e=i;e<=a;e++){const{latMin:i,latMax:s}=g(n,e,x,_);if(!w(c,u,i,s))continue;const a=`${t}/${e}/${n}`,r=o.get(a);r&&v.push(r)}}return v}var M=i(25217);let x=class extends((0,l.G)(a.A)){constructor(t){super(t),this._maximumPyramidLevel=-1,this._pixelAngleToLevelMap=new c,this._tileMap=new Map,this.horizonPitch=0,this.horizonYaw=0,this.horizonRoll=0,this.raster=null,this._fetchRawTile=async(t,e,i,s)=>{await this._initJobHandler();const{pyramidBlockWidth:a,pyramidBlockHeight:o}=this.storageInfo,{minCol:n,maxCol:l,minRow:h,maxRow:c}=this.storageInfo.blockBoundary[t],u=l-n+1,m=c-h+1,f=i*this.imageSize[0]/u,d=e*this.imageSize[1]/m,w=Math.min((i+1)*this.imageSize[0]/u,this.imageSize[0]),g=Math.min((e+1)*this.imageSize[1]/m,this.imageSize[1]),p=w-f,M=g-d,x=new r.A({xmin:f-.5,ymin:.5-g,xmax:w-.5,ymax:.5-d,spatialReference:this.raster.rasterInfo.spatialReference}),{pixelBlock:_}=await this.raster.fetchPixels(x,a??p,o??M,s);return _},this.getLevelTiles=t=>{const e=[],{minCol:i,maxCol:s,minRow:a,maxRow:o}=this.storageInfo.blockBoundary[t];for(let n=a;n<=o;n++)for(let a=i;a<=s;a++){const i=this._tileMap.get(`${t}/${n}/${a}`);i&&e.push(i)}return e.length?e:null},this.getLevelWithPixelAngle=t=>this._pixelAngleToLevelMap.get(t)??0,this.getLowResolutionTiles=()=>{const t=this.maximumPyramidLevel;return t<0?null:this.getLevelTiles(t)},this.getTiles=(t,e,i,s,a)=>{const{minCol:o,minRow:n,maxCol:r,maxRow:l}=this.storageInfo.blockBoundary[t];return p(t,[o,n],[r,l],this._tileMap,e,i,s,a)}}initialize(){this._processLevels()}destroy(){this.raster.rasterJobHandler=null,this.raster=null,this._shutdownJobHandler(),this._tileMap.clear(),this._pixelAngleToLevelMap.clear()}async _initJobHandler(){this._rasterJobHandler||(await super._initJobHandler(),this.raster.rasterJobHandler=this._rasterJobHandler)}_processLevels(){const{blockBoundary:t,tileInfo:e}=this.storageInfo,i=t?.length;if(!i)throw new o.A("panoramic-viewer:missing-pyramid-resolutions","TIFF/MRF must have pyramid resolutions defined",{rasterId:this.raster.rasterId});this._tileMap.clear();for(let s=0;s<i;s++){const{maxCol:i,maxRow:a,minCol:o,minRow:n}=t[s],r=180/(a-n+1),l=360/(i-o+1),c=l/e.size[0];if(c>h.NU)break;this._pixelAngleToLevelMap.set(c,s);for(let t=n;t<=a;t++){const e=180-(t+.5)*r;for(let a=o;a<=i;a++){const i=(a+.5)*l-180;this._tileMap.set(`${s}/${t}/${a}`,new M.default(s,t,a,l,r,i,e,h.vK/2,[this.horizonPitch,this.horizonRoll,this.horizonYaw],this._fetchRawTile))}}this._maximumPyramidLevel=s}}get rasterInfo(){return this.raster.rasterInfo}get storageInfo(){return this.rasterInfo.storageInfo}get imageSize(){const{width:t,height:e}=this.rasterInfo;return[t,e]}get maximumPyramidLevel(){return this._maximumPyramidLevel}};(0,s.Cg)([(0,n.MZ)()],x.prototype,"horizonPitch",void 0),(0,s.Cg)([(0,n.MZ)()],x.prototype,"horizonYaw",void 0),(0,s.Cg)([(0,n.MZ)()],x.prototype,"horizonRoll",void 0),(0,s.Cg)([(0,n.MZ)()],x.prototype,"raster",void 0),x=(0,s.Cg)([(0,n.$K)("esri.widgets.PanoramicViewer.support.PanoramicTilePyramid")],x);const _=x}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5217],{25217(e,t,i){i.r(t),i.d(t,{default:()=>w});var a=i(49186),s=i(74887),c=i(40036),l=i(16930),o=i(19211),n=i(35063),r=i(28208),h=i(66655);class w{constructor(e,t,i,c,w,u,d,f,m,p){this.level=e,this.row=t,this.column=i,this.horizontalFieldOfView=c,this.verticalFieldOfView=w,this.yaw=u,this.pitch=d,this.distance=f,this.horizonAngles=m,this.getPixelBlock=p,this._cache=null,this.loadMesh=async e=>{const{level:t,row:i,column:c,horizontalFieldOfView:w,verticalFieldOfView:u,yaw:d,pitch:f,distance:m}=this,{Mesh:p,MeshComponent:v,MeshVertexAttributes:g,panoramicMeshManager:A}=await(0,h.Zg)(),{faces:x,...M}=await A.getFacesWithVertexAttributes({distance:m,yaw:d,horizontalFieldOfView:w,pitch:f,verticalFieldOfView:u});(0,s.Te)(e);const V=await this.getPixelBlock(t,i,c,e);if((0,s.Te)(e),!V)throw new a.A("panoramic-viewer:missing-tile-data",`Tile data for level ${t}, row ${i}, column ${c} is missing`,{level:t,row:i,column:c});const b=await A.convertPixelBlockToImageData(V);(0,s.Te)(e);const k=new p({vertexAttributes:new g(M),components:[new v({faces:x,trustSourceNormals:!0,material:new o.default({colorTexture:new n.default({data:b})})})],spatialReference:l.A.WebMercator});return k.rotate(...this.horizonAngles,{origin:r.ZH}),await k.load(e),this._cache=k,this._cache},this.loadMeshAtDistance=async(e,t)=>{const i=this.distance;return this.distance=e,Math.abs(i-e)>1e-6&&this._cache?this._cache:await this.loadMesh(t)}}get loaded(){return null!==this._cache}get key(){return`${this.level}/${this.row}/${this.column}`}clone(){const{level:e,row:t,column:i,horizontalFieldOfView:a,verticalFieldOfView:s,yaw:l,pitch:o,distance:n,getPixelBlock:r,horizonAngles:h}=this,u=new w(e,t,i,a,s,l,o,n,h,r);if(this._cache){const{vertexAttributes:e,components:t,spatialReference:i}=this._cache,a=t?.map(({material:e,faces:t,trustSourceNormals:i})=>({material:e,faces:t?.slice(),trustSourceNormals:i}));u._cache=new c.default({components:a,vertexAttributes:e.clone(),spatialReference:i})}return u}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7557,9938],{17136(e,t,n){n.d(t,{Y_:()=>R,O7:()=>k,el:()=>M});var r=n(92602),s=n(69052),i=n(49186),a=n(53966),o=n(39829),l=n(82799),u=n(16930),d=n(80754),c=n(21325),h=n(28735),p=n(11254),f=n(60408),m=n(65864),g=n(2272),y=n(84952),b=n(92300);const w=()=>a.A.getLogger("esri.geometry.support.normalizeUtils");function S(e){return"polygon"===e[0].type}function A(e){return"polyline"===e[0].type}function F(e,t,n){if(t){const t=function(e,t){if(!(e instanceof l.A||e instanceof o.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw w().error(e),new i.A("internal:geometry",e)}const n=(0,d.r8)(e),r=[];for(const e of n){const n=[];r.push(n),n.push([e[0][0],e[0][1]]);for(let r=0;r<e.length-1;r++){const s=e[r][0],i=e[r][1],a=e[r+1][0],o=e[r+1][1],l=Math.sqrt((a-s)*(a-s)+(o-i)*(o-i)),u=(o-i)/l,d=(a-s)/l,c=l/t;if(c>1){for(let e=1;e<=c-1;e++){const r=e*t,a=d*r+s,o=u*r+i;n.push([a,o])}const e=(l+Math.floor(c-1)*t)/2,r=d*e+s,a=u*e+i;n.push([r,a])}n.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new o.A({rings:r,spatialReference:e.spatialReference}):new l.A({paths:r,spatialReference:e.spatialReference})}(e,1e6);e=(0,h.ci)(t,!0)}return n&&(e=(0,d.kS)(e,n)),e}function v(e,t,n){if(Array.isArray(e)){const r=e[0];if(r>t){const n=(0,d.kd)(r,t);e[0]=r+n*(-2*t)}else if(r<n){const t=(0,d.kd)(r,n);e[0]=r+t*(-2*n)}}else{const r=e.x;if(r>t){const n=(0,d.kd)(r,t);e=e.clone().offset(n*(-2*t),0)}else if(r<n){const t=(0,d.kd)(r,n);e=e.clone().offset(t*(-2*n),0)}}return e}function E(e,t){let n=-1;for(let r=0;r<t.cutIndexes.length;r++){const s=t.cutIndexes[r],i=t.geometries[r],a=(0,d.r8)(i);for(let e=0;e<a.length;e++){const t=a[e];t.some(n=>{if(n[0]<180)return!0;{let n=0;for(let e=0;e<t.length;e++){const r=t[e][0];n=r>n?r:n}n=Number(n.toFixed(9));const r=-360*(0,d.kd)(n,180);for(let n=0;n<t.length;n++){const t=i.getPoint(e,n);i.setPoint(e,n,t.clone().offset(r,0))}return!0}})}if(s===n){if(S(e))for(const t of(0,d.r8)(i))e[s]=e[s].addRing(t);else if(A(e))for(const t of(0,d.r8)(i))e[s]=e[s].addPath(t)}else n=s,e[s]=i}return e}async function M(e,t,n){if(!Array.isArray(e))return M([e],t);t&&"string"!=typeof t&&w().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??r.A.geometryServiceUrl;let i,a,u,S,A,k,I,R,x=0;const $=[],P=[];for(const t of e)if(null!=t)if(i||(i=t.spatialReference,a=(0,c.Vp)(i),u=i.isWebMercator,k=u?102100:4326,S=d.j7[k].maxX,A=d.j7[k].minX,I=d.j7[k].plus180Line,R=d.j7[k].minus180Line),a)if("mesh"===t.type)P.push(t);else if("point"===t.type)P.push(v(t.clone(),S,A));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>v(e,S,A)),P.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,a);P.push(e.rings?new o.A(e):e)}else if(t.extent){const e=t.extent,n=(0,d.kd)(e.xmin,A)*(2*S);let r=0===n?t.clone():(0,d.kS)(t.clone(),n);e.offset(n,0);let{xmin:s,xmax:i}=e;s=Number(s.toFixed(9)),i=Number(i.toFixed(9)),e.intersects(I)&&i!==S?(x=i>x?i:x,r=F(r,u),$.push(r),P.push("cut")):e.intersects(R)&&s!==A?(x=i*(2*S)>x?i*(2*S):x,r=F(r,u,360),$.push(r),P.push("cut")):P.push(r)}else P.push(t.clone());else P.push(t);else P.push(t);let _=(0,d.kd)(x,S),L=-90;const C=_,O=new l.A;for(;_>0;){const e=360*_-180;O.addPath([[e,L],[e,-1*L]]),L*=-1,_--}if($.length>0&&C>0){const t=E($,await async function(e,t,n,r){const s=(0,g.Dl)(e),i=t[0].spatialReference,a={...r,responseType:"json",query:{...s.query,f:"json",sr:(0,c.YX)(i),target:JSON.stringify({geometryType:(0,f.$B)(t[0]),geometries:t}),cutter:JSON.stringify(n)}},o=await(0,p.A)(s.path+"/cut",a),{cutIndexes:l,geometries:u=[]}=o.data;return{cutIndexes:l,geometries:u.map(e=>{const t=(0,m.rS)(e);return t.spatialReference=i,t})}}(s,$,O,n)),r=[],i=[];for(let n=0;n<P.length;n++){const s=P[n];if("cut"!==s)i.push(s);else{const s=t.shift(),a=e[n];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&s.rings.length>=a.rings.length?(r.push(s),i.push("simplify")):i.push(u?(0,h.Gh)(s):s)}}if(!r.length)return i;const a=await async function(e,t,n){const r="string"==typeof e?(0,y.An)(e):e,s=t[0].spatialReference,i=(0,f.$B)(t[0]),a={...n,query:{...r.query,f:"json",sr:(0,c.YX)(s),geometries:JSON.stringify((0,b.X)(t))}},{data:o}=await(0,p.A)(r.path+"/simplify",a);return(0,b.V)(o.geometries,i,s)}(s,r,n),o=[];for(let e=0;e<i.length;e++){const t=i[e];"simplify"!==t?o.push(t):o.push(u?(0,h.Gh)(a.shift()):a.shift())}return o}const j=[];for(let e=0;e<P.length;e++){const t=P[e];if("cut"!==t)j.push(t);else{const e=$.shift();j.push(!0===u?(0,h.Gh)(e):e)}}return j}function k(e,t,n){const r=(0,c.Vp)(n);if(null==r)return e;const[s,i]=r.valid,a=2*i;let o=0,l=0;t>i?o=Math.ceil(Math.abs(t-i)/a):t<s&&(o=-Math.ceil(Math.abs(t-s)/a)),e>i?l=Math.ceil(Math.abs(e-i)/a):e<s&&(l=-Math.ceil(Math.abs(e-s)/a));let u=e+(o-l)*a;const d=u-t;return d>i?u-=a:d<s&&(u+=a),u}function I(e){const t=(0,c.Vp)(e);if(null==t)return null;const[n,r]=t.valid;return new s.hr(n,r)}const R=I(u.A.WGS84);I(u.A.WebMercator)},20557(e,t,n){n.d(t,{Fm:()=>l,Hz:()=>p,JQ:()=>h,JZ:()=>S,ND:()=>m,R_:()=>a,U9:()=>c,fu:()=>s,nr:()=>f,oF:()=>i,rq:()=>u,z$:()=>d});const r=[["binary","application/octet-stream","bin",""]];function s(e,t){return null!=y(t.name,e?.supportedFormats??[])}function i(e,t){if(!e)return!1;const n=u(t,e.supportedFormats??[]);return null!=n&&e.editFormats.includes(n)}function a(e,t){return b(function(e,t){const n=e.toLowerCase();return g(t).find(e=>w(e)===n)}(e,t))}function o(e,t){return b(y(e,t))}function l(e,t){return w(function(e,t){return g(t).find(t=>b(t)===e)}(e,t))}function u(e,t){return o(e.name,t)??a(e.type,t)}function d(e,t,n){return a(e,n)??o(t,n)}function c({supportedFormats:e}){return d("model/gltf-binary","glb",e)}function h(e){const t=c(e);return null!=t&&e.editFormats.includes(t)}function p(e){if(!e)return null;const t=c(e),n=function({supportedFormats:e}){return d("model/gltf+json","gltf",e)}(e);let r=null;for(const s of e.queryFormats){if(s===t)return s;s===n&&(r=s)}return r}function f({supportedFormats:e}){return d("application/esri3do-SR_world","wld",e)}function m({supportedFormats:e}){return d("application/esri3do-SR_prj","prj",e)}function g(e){return[...r,...e]}function y(e,t){const n=e.toLowerCase();return g(t).find(e=>function(e){return e?.[2].split(",").map(e=>e.toLowerCase())??[]}(e).some(e=>n.endsWith(e)))}function b(e){return e?.[0]}function w(e){return e?.[1].toLowerCase()}function S(e){return e.tables?.find(e=>"assetMaps"===e.role)}},20816(e,t,n){n.d(t,{TA:()=>s,We:()=>o,Z3:()=>i,ZJ:()=>l,w5:()=>u});var r=n(11254);const s=(0,n(13069).vD)(),i=new Map,a=new Map;async function o(e,t,n){if(!e||!n)return!1;if(!t)return!0;const s=new URL(e).host;let a=i.get(s);if(!a){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");a=(await(0,r.A)(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return a===t}async function l(e,t,r=!1){if(!e||!t)return!0;const i=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),o=a.get(i)?.entries();if(o)for(const[e,a]of o)if(a.name===t){const t=!a.stack?.hasForwardEdits();if(!t&&r){const[{deleteForwardEdits:t},{default:r}]=await Promise.all([n.e(2186).then(n.bind(n,32186)),n.e(2558).then(n.bind(n,32558))]),o=await t(i,e,new r({sessionId:s,moment:a.moment}));return o.success&&a.stack?.clearForwardEdits(),o.success}return t}return!0}function u(e,t){if(!e)return!1;const n=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),r=a.get(n)?.entries();if(r)for(const[e,n]of r)if(n.name===t)return"edit"===n.lockType;return!1}new Map},47685(e,t,n){n.d(t,{Mk:()=>f,Zk:()=>h,w6:()=>y});var r=n(5482),s=n(65529),i=n(4718),a=n(74887),o=n(91429),l=n(20816);const u=new s.bk;function d(e){return u.on("apply-edits",new WeakRef(e))}function c(e){return u.on("update-moment",new WeakRef(e))}function h(e,t,n=null,r=!1){const s=(0,a.Tw)();return r=null==t||r,u.emit("apply-edits",{serviceUrl:e,layerId:t,gdbVersion:n,mayReceiveServiceEdits:r,result:s.promise}),s}const p=Symbol();function f(e){return null!=e&&"object"==typeof e&&p in e}function m(e){return null!=e&&"object"==typeof e&&"gdbVersion"in e}function g(e,t,n){const r=new URL(e).host,s=l.Z3.get(r),i=e=>!e||e===s;return i(t)&&i(n)||t===n}const y=e=>{var t;const n=e;let s=class extends n{static{t=p}constructor(...e){super(...e),this[t]=!0,this._applyEditsHandler=e=>{const{serviceUrl:t,layerId:n,gdbVersion:r,mayReceiveServiceEdits:s,result:a}=e,o=t===this.url,l=null!=n&&null!=this.layerId&&n===this.layerId,u=m(this),d=m(this)&&g(t,r,this.gdbVersion);if(!o||u&&!d||!l&&!s)return;const c=a.then(e=>{if(this.lastEditsEventDate=new Date,l&&(e.addedFeatures.length||e.updatedFeatures.length||e.deletedFeatures.length||e.addedAttachments.length||e.updatedAttachments.length||e.deletedAttachments.length))return this.emit("edits",(0,i.o8)(e)),e;const n=e.editedFeatures?.find(({layerId:e})=>e===this.layerId);if(n){const{adds:t,updates:r,deletes:s}=n.editedFeatures,a={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:t?t.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],deletedFeatures:s?s.map(({attributes:e})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],updatedFeatures:r?r.map(({current:{attributes:e}})=>({objectId:this.objectIdField&&e[this.objectIdField],globalId:this.globalIdField&&e[this.globalIdField]})):[],editedFeatures:(0,i.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,i.o8)(e.historicMoment)};return this.emit("edits",a),a}const s={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:(0,i.o8)(e.editedFeatures),exceededTransferLimit:!1,historicMoment:(0,i.o8)(e.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,r,s.historicMoment)&&this.emit("edits",s),s}).then(e=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,r,e.historicMoment)&&(this.historicMoment=e.historicMoment),e));this.emit("apply-edits",{result:c})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:n,moment:r}=e,s=t===this.url,i=m(this),a=m(this)&&g(t,n,this.gdbVersion),o=m(this)&&!g(t,this.gdbVersion,null);s&&i&&a&&o&&"historicMoment"in this&&this.historicMoment!==r&&(this.historicMoment=r)},this.when().then(()=>{this.addHandles(d(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(c(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(e,t,n){return"historicMoment"in this&&this.historicMoment!==n&&(0,l.w5)(e,t)}};return(0,r.Cg)([(0,o.MZ)()],s.prototype,"lastEditsEventDate",void 0),s=(0,r.Cg)([(0,o.$K)("esri.layers.mixins.EditBusLayer")],s),s}},56512(e,t,n){function r(e){let t,n,r=[],s=!1;return function(...i){return s&&t===this&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}(i,r)||(n=e.apply(this,i),t=this,r=i,s=!0),n}}n.d(t,{B:()=>r})},69052(e,t,n){n.d(t,{hr:()=>s,ie:()=>l,uC:()=>o});var r=n(34727);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,n=!1){return i(this.range,this.min,this.max,e,t,n)}clamp(e,t=0){return(0,r.qE)(e-t,this.min,this.max)+t}monotonic(e,t,n){return e<t?t:t+a(this.range,e-t,n)}minimalMonotonic(e,t,n){return i(this.range,e,e+this.range,t,n)}center(e,t,n){return t=this.monotonic(e,t,n),this.normalize((e+t)/2,n)}diff(e,t,n){return this.monotonic(e,t,n)-e}shortestSignedDiff(e,t){e=this.normalize(e);const n=(t=this.normalize(t))-e,r=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(n)<Math.abs(r)?n:r}contains(e,t,n){return t=this.minimalMonotonic(e,t),(n=this.minimalMonotonic(e,n))>e&&n<t}}function i(e,t,n,r,s=0,i=!1){return(r-=s)<t?r+=a(e,t-r):r>n&&(r-=a(e,r-n)),i&&r===n&&(r=t),r+s}function a(e,t,n=0){return Math.ceil((t-n)/e)*e+n}const o=new s(0,2*Math.PI),l=(new s(-Math.PI,Math.PI),new s(0,360))},69938(e,t,n){n.d(t,{applyEdits:()=>B,uploadAssets:()=>H});var r=n(52106),s=n(7762),i=n(49186),a=n(4718),o=n(53966),l=n(91869),u=n(74887),d=n(84952),c=n(13069),h=n(17136),p=n(21325),f=n(56512),m=n(65864),g=n(4305),y=n(50954),b=n(52006),w=n(49663),S=n(46068),A=n(15507);const F=1e-6,v=[0,0];class E{constructor(e,t){this.curveStart=e,this.curveEnd=t,this.tStart=0,this.tEnd=0,this.tEndStack=[],this.arcEndStack=[]}get stackSize(){return this.tEndStack.length}initialize(e,t){this.tStart=0,this.arcStart=e,this.tEndStack.push(1),this.arcEndStack.push(t)}splitAt(e){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(e),this.arcEndStack.push(this.interpolate(e))}splitInHalf(){return this.splitAt((this.tStart+this.tEnd)/2)}pop(){this.tEnd=this.tEndStack.pop(),this.arcEnd=this.arcEndStack.pop()}next(){this.tStart=this.tEnd,this.arcStart=this.arcEnd}densify(e,{maxDeviation:t,maxSegmentLength:n,maxSegmentsPerCurve:r,minSegmentsPerCurve:s}){const i=n*n,a=t*t,o=1/r,l=this.interpolate(0),u=this.interpolate(1);(0,A.kb)(this.curveStart,l)>F&&e.push(l),this.initialize(l,u);const d=1/s;for(let e=s-1;e>0;e--){const t=e*d;this.pop(),this.splitAt(t)}for(;this.stackSize>0;)this.pop(),this.tStart===this.tEnd||this.tEnd-this.tStart<o||(0===i||!isFinite(i)||(0,A.kb)(this.arcStart,this.arcEnd)<i)&&(0===a||!isFinite(a)||this.getDeviation2()<a)?(e.push(this.arcEnd),this.next()):this.splitInHalf();return(0,A.kb)(this.curveEnd,u)>F&&e.push([...this.curveEnd]),e}}class M extends E{constructor(e,t){const[n,r,s]=t.b;super(e,n),this._controlPointsStack=[],this._curveControlPoints=[r,s],this._arcControlPoints=[r,s],this._controlPointsStack.push(this._arcControlPoints)}splitAt(e){const{arcStart:t,arcEnd:n,tStart:r,tEnd:s}=this,[i,a]=this._arcControlPoints,o=(e-r)/(s-r),l=(0,A.RS)([],t,i,o),u=(0,A.RS)(v,i,a,o),d=(0,A.RS)([],a,n,o),c=(0,A.RS)([],l,u,o),h=(0,A.RS)([],u,d,o),p=(0,A.RS)([],c,h,o);this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this._controlPointsStack.push([h,d]),this.tEndStack.push(e),this.arcEndStack.push(p),this._arcControlPoints[0]=l,this._arcControlPoints[1]=c,this._controlPointsStack.push(this._arcControlPoints)}pop(){super.pop(),this._arcControlPoints=this._controlPointsStack.pop()}interpolate(e){const{curveStart:t,curveEnd:n}=this,[r,s]=this._curveControlPoints;return(0,g.B4)(t,r,s,n,e)}getDeviation2(){const{arcStart:e,arcEnd:t}=this,[n,r]=this._arcControlPoints;return Math.max((0,A.yE)(n,e,t),(0,A.yE)(r,e,t))}}class k extends E{constructor(e,t){const[n]=t.a;super(e,n),this._derivedEllipse=(0,S.SW)(e,t)}pop(){super.pop(),this._tMid=(this.tStart+this.tEnd)/2,this._arcMid=this.interpolate(this._tMid)}splitInHalf(){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(this._tMid),this.arcEndStack.push(this._arcMid)}interpolate(e){return(0,S.Uk)(this._derivedEllipse,e)}getDeviation2(){return(0,A.yE)(this._arcMid,this.arcStart,this.arcEnd)}}function I(e,t,n,{cx:r,cy:s,radius:i,thetaStart:a,thetaEnd:o,isInvalid:l},{maxDeviation:u,maxSegmentLength:d,maxSegmentsPerCurve:c,minSegmentsPerCurve:h}){if(l)return e.push([...n]),e;const p=2*i,f=[r+i*Math.cos(a),s+i*Math.sin(a)],m=[r+i*Math.cos(o),s+i*Math.sin(o)];(0,A.kb)(t,f)>F&&e.push(f);const g=Math.abs(o-a),y=d>0&&d<p?2*Math.asin(d/p):g,b=u>0&&u<=i?2*Math.acos(1-u/i):g,w=Math.min(y,b),S=Math.min(c,Math.max(h,Math.ceil(Math.abs(g/w)))),v=1/S;for(let t=1;t<S;t++){const n=t*v,l=a*(1-n)+o*n;e.push([r+i*Math.cos(l),s+i*Math.sin(l)])}return e.push(m),(0,A.kb)(n,m)>F&&e.push([...n]),e}function R(e,t,n,r){return new M(t,n).densify(e,r)}function x(e,t,n,r){const s=(0,y.pM)(t,n),[i]=n.c;return I(e,t,i,s,r)}function $(e,t,n,r){const s=(0,w.i)(t,n),[i]=n.a;return I(e,t,i,s,r)}function P(e,t,n,r){const[s,i,a,o,l,u,d]=n.a;return 0===u||0===d?(e.push([...s]),e):new k(t,n).densify(e,r)}const _=(0,f.B)(e=>({maxDeviation:0,maxSegmentLength:100*e,maxSegmentsPerCurve:12e3,minSegmentsPerCurve:1}));async function L(e,t,r){const s=new Set(t);return await async function(e,t,r){let s=null;for(const a of e)if(a&&(0,b.Ed)(a)&&null==a.spatialReference.xyTolerance&&(0,b.V8)(a,t)){const e=a.spatialReference;if(!e)throw new i.A("geometry:missing-spatial-reference","Geometry contains an unsupported curve type, but it cannot be densified because it has no spatial reference.");const t=C(e);if(r.has(t))a.spatialReference=r.get(t);else{s||(s=await Promise.all([n.e(3661),n.e(1878),n.e(8885),n.e(5756),n.e(3299),n.e(9169)]).then(n.bind(n,78125)));const o=s.fromSpatialReference(e),l=o?.getTolerance();if(null==l)throw new i.A("geometry:missing-tolerance","Geometry contains an unsupported curve type, but it cannot be densified because the tolerance of its spatial reference is unknown. Set the `xyTolerance` property of the spatial reference.");const u=a.spatialReference.clone();u.read({xyTolerance:l}),a.spatialReference=u,r.set(t,u)}}}(e,s,r),e.map(e=>{if(!e||!(0,b.Ed)(e))return e;const n=e.spatialReference.xyTolerance;if(null==n)return e;const r=_(n);return(0,m.rS)(function(e,t,n){if(!(0,b.Ed)(e))return e;const r=new Set(t),s=function(e){return{maxSegmentLength:e.maxSegmentLength??0,maxDeviation:e.maxDeviation??0,maxSegmentsPerCurve:e.maxSegmentsPerCurve??12e3,minSegmentsPerCurve:Math.max(e.minSegmentsPerCurve??1,1)}}(n),i=(0,b.FD)(e),a=[];let o=!1;for(const e of i){const t=[];for(let n=0;n<e.length-1;n++){const i=n+1,a=[...(0,b.yP)(e[n])];0===n&&t.push(a);const l=e[i];(0,b.Xq)(l)?t.push([...l]):(0,b.n1)(l)&&!r.has("cubic-bezier")?R(t,a,l,s):(0,b.aO)(l)&&!r.has("circular-arc")?x(t,a,l,s):(0,b.DA)(l)&&!r.has("elliptic-arc")?$(t,a,l,s):(0,b.wY)(l)&&!r.has("elliptic-arc")?P(t,a,l,s):(t.push((0,b.tk)(l)),o=!0)}a.push(t)}return"curvePaths"in e?{...void 0!==e.hasZ?{hasZ:e.hasZ}:{},...void 0!==e.hasM?{hasM:e.hasM}:{},spatialReference:e.spatialReference,...o?{curvePaths:a}:{paths:a}}:{hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,...o?{curveRings:a}:{rings:a}}}(e,t,r))})}function C(e){if(null!=e.wkid)return`${e.wkid}`;if(null!=e.wkt)return e.wkt;const t="toJSON"in e&&"function"==typeof e.toJSON?e.toJSON():e;return JSON.stringify(t)}var O=n(47685),j=n(30524),T=n(20557),D=n(77548);function U(e){return null!=e?.applyEdits}const V=new WeakMap;async function B(e,t,n,r={}){let d;const h="gdbVersion"in e?e.gdbVersion:null,p=r.gdbVersion??h;if((0,O.Mk)(e)&&e.url)d=(0,O.Zk)(e.url,e.layerId,p,"original-and-current-features"===r.returnServiceEditsOption);else{d=(0,u.Tw)(),d.promise.then(t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)});const t={result:d.promise};e.emit("apply-edits",t)}try{const{results:u,edits:h}=await async function(e,t,n,r){if(await e.load(),!U(t))throw new i.A(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!(0,D.tk)(e))throw new i.A(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:a,options:u}=await async function(e,t,n){const r=(0,D.BR)(e),a=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),u=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),d=null!=e.infoFor3D;if(function(e,t,n,r,s,a){if(!(e&&(r||s)||n?.usingTelecomOperations))throw new i.A(`${a}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&n?.globalIdUsed&&!n.usingFeatureServiceEndpoint)throw new i.A(`${a}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new i.A(`${a}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!n?.globalIdUsed&&s)throw new i.A(`${a}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}(t,r,n,!!a,!!u,`${e.type}-layer`),!r.data.isVersioned&&n?.gdbVersion)throw new i.A(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!r.editing.supportsRollbackOnFailure&&n?.rollbackOnFailureEnabled)throw new i.A(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const h={...n};if(null!=h.rollbackOnFailureEnabled||r.editing.supportsRollbackOnFailure||(h.rollbackOnFailureEnabled=!0),h.rollbackOnFailureEnabled||"original-and-current-features"!==h.returnServiceEditsOption||(!1===h.rollbackOnFailureEnabled&&o.A.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),h.rollbackOnFailureEnabled=!0),!r.editing.supportsReturnServiceEditsInSourceSpatialReference&&h.returnServiceEditsInSourceSR)throw new i.A(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(h.returnServiceEditsInSourceSR&&"original-and-current-features"!==h.returnServiceEditsOption)throw new i.A(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const p=function(e,t,n){const r=function(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&s.A.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}(e);if(r.addFeatures?.length&&!t.operations.supportsAdd)throw new i.A(`${n}:unsupported-operation`,"Layer does not support adding features.");if(r.updateFeatures?.length&&!t.operations.supportsUpdate)throw new i.A(`${n}:unsupported-operation`,"Layer does not support updating features.");if(r.deleteFeatures?.length&&!t.operations.supportsDelete)throw new i.A(`${n}:unsupported-operation`,"Layer does not support deleting features.");return r.addFeatures=r.addFeatures.map(Z),r.updateFeatures=r.updateFeatures.map(Z),r.addAssetFeatures=[],r}(t,r,`${e.type}-layer`),f=n?.globalIdUsed||d,m=e.fields.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(f){const{globalIdField:t}=e;if(null==t)throw new i.A(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");p.addFeatures.forEach(e=>function(e,t){const{attributes:n}=e;null==n[t]&&(n[t]=(0,c.yS)())}(e,t))}p.addFeatures.forEach(t=>function(e,t,n,r){z(e,t,n,r),N(e,t)}(t,e,f,m)),p.updateFeatures.forEach(t=>function(e,t,n,r){z(e,t,n,r),N(e,t);const s=(0,D.BR)(t);if("geometry"in e&&null!=e.geometry&&!s?.editing.supportsGeometryUpdate)throw new i.A(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}(t,e,f,m)),p.deleteFeatures.forEach(t=>function(e,t,n,r){z(e,t,n,r)}(t,e,f,m)),p.addAttachments.forEach(t=>W(t,e)),p.updateAttachments.forEach(t=>W(t,e)),d&&await async function(e,t){const{infoFor3D:n}=t;if(null==n)return;if(!(0,T.JQ)(n))throw new i.A(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:r}=e;for(const t of e.addFeatures??[])q(t)&&r.push(t);for(const t of e.updateFeatures??[])q(t)&&r.push(t)}(p,e);const g=(0,l.tE)(V,e,()=>new Map);return{edits:await G(p,r.data.supportedCurveTypes??[],g),options:h}}(e,n,r);return a.addFeatures?.length||a.updateFeatures?.length||a.deleteFeatures?.length||a.addAttachments?.length||a.updateAttachments?.length||a.deleteAttachments?.length?{edits:a,results:await t.applyEdits(a,u)}:{edits:a,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}(e,t,n,r),p=e=>e.filter(e=>!e.error).map(a.o8),f={edits:h,addedFeatures:p(u.addFeatureResults),updatedFeatures:p(u.updateFeatureResults),deletedFeatures:p(u.deleteFeatureResults),addedAttachments:p(u.addAttachmentResults),updatedAttachments:p(u.updateAttachmentResults),deletedAttachments:p(u.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:u.editMoment?new Date(u.editMoment):null,globalIdToObjectId:r.globalIdToObjectId};return u.editedFeatureResults?.length&&(f.editedFeatures=u.editedFeatureResults),d.resolve(f),u}catch(e){throw d.reject(e),e}}function z(e,t,n,r){if(n){if("attributes"in e&&!e.attributes[t.globalIdField])throw new i.A(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new i.A(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(r.length&&"attributes"in e)for(const n of r){const r=e.attributes[n.name];if(void 0!==r&&!(0,j.OG)(n,r))throw new i.A(`${t.type}-layer:invalid-parameter`,`Big-integer field '${n.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new i.A(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new i.A(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function N(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:n}=e,{spatialReference:r,vertexSpace:s}=n,a=t.spatialReference,o="local"===s.type,l=(0,p.EA)(a),u=(0,p.aI)(a,r),d=u||(0,p.oT)(a)&&((0,p.oT)(r)||(0,p.K8)(r));if(!(o&&l&&d||!o&&!l&&u))throw new i.A(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${s.type} vertex space and a spatial reference wkid:${r.wkid} to a layer with a spatial reference wkid:${a.wkid} is not supported.`)}}function W(e,t){const{feature:n,attachment:r}=e;if(!n||"attributes"in n&&!n.attributes[t.globalIdField])throw new i.A(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in n)&&!n.globalId)throw new i.A(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new i.A(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new i.A(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name||r.name))throw new i.A(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&r.uploadId)throw new i.A(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof r.data){const e=(0,d.r$)(r.data);if(e&&!e.isBase64)throw new i.A(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function G(e,t,n){const r=e.addFeatures??[],s=e.updateFeatures??[],i=r.concat(s).map(e=>e.geometry),a=await L(i,t,n),o=await(0,h.el)(a),l=r.length,u=s.length;return o.slice(0,l).forEach((e,t)=>r[t].geometry=e),o.slice(l,l+u).forEach((e,t)=>s[t].geometry=e),e}function Z(e){const t=new r.A;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}function q(e){return"mesh"===e?.geometry?.type}function H(e,t,n,r){if(!U(t))throw new i.A(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new i.A(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(n,r)}},80754(e,t,n){n.d(t,{j7:()=>a,kS:()=>l,kd:()=>o,r8:()=>u});var r=n(82799),s=n(16930),i=n(60408);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new r.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator}),minus180Line:new r.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new r.A({paths:[[[180,-180],[180,180]]],spatialReference:s.A.WGS84}),minus180Line:new r.A({paths:[[[-180,-180],[-180,180]]],spatialReference:s.A.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const n=u(e);for(const e of n)for(const n of e)n[0]+=t;return e}function u(e){return(0,i.Bi)(e)?e.rings:e.paths}},92300(e,t,n){n.d(t,{V:()=>a,X:()=>i});var r=n(60408),s=n(65864);function i(e){return{geometryType:(0,r.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function a(e,t,n){const r=(0,s.xD)(t);return e.map(e=>{const t=r.fromJSON(e);return t.spatialReference=n,t})}}}]);
package/config.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.130";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
2
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.131";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{equals as n,sliceEquals as r}from"../../../core/arrayUtils.js";function t(n){return"curveRings"in n&&!!n.curveRings?.length||"curvePaths"in n&&!!n.curvePaths?.length}function u(n){return"curveRings"in n?n.curveRings:n.curvePaths}function e(n){return"b"in n}function c(n){return"c"in n}function i(n){return Array.isArray(n)}function o(n){return"a"in n}function s(n){return"a"in n&&4===n.a.length}function a(n){return"a"in n&&7===n.a.length}function f(n){return!(!n||!t(n))&&u(n).some(n=>n.some(n=>c(n)))}function g(n,r){return i(n)?i(r):e(n)?e(r):c(n)?c(r):s(n)?s(r):!!a(n)&&a(r)}function h(n){return i(n)?n:e(n)?n.b[0]:c(n)?n.c[0]:n.a[0]}function b(n){if(e(n)){const[r,t,u]=n.b;return{b:[[...r],[...t],[...u]]}}if(c(n)){const[r,t]=n.c;return{c:[[...r],[...t]]}}if(i(n))return[...n];if(s(n)){const[r,t,u,e]=n.a;return{a:[[...r],[...t],u,e]}}if(a(n)){const[r,t,u,e,c,i,o]=n.a;return{a:[[...r],[...t],u,e,c,i,o]}}return n}function l(n){return t(n)?"curveRings"in n?n.curveRings:n.curvePaths:"rings"in n?n.rings:n.paths}function v(n){return n.some(n=>!i(n))}function R(n,r=0,t=1){let u=0;const e=n.length;let c=h(n[0]);for(let i=1;i<e;i++){const e=h(n[i]);u+=(e[r]-c[r])*(e[t]+c[t]),c=e}if(m(n)){const e=h(n[0]);u+=(e[r]-c[r])*(e[t]+c[t])}return u>=0}function m(r){const t=r.length;return t>0&&!n(h(r[0]),h(r[t-1]))}function P(t,u){return i(t)&&i(u)?n(t,u):c(t)&&c(u)?n(t.c[0],u.c[0])&&n(t.c[1],u.c[1]):e(t)&&e(u)?n(t.b[0],u.b[0])&&n(t.b[1],u.b[1])&&n(t.b[2],u.b[2]):!(!o(t)||!o(u))&&(n(t.a[0],u.a[0])&&n(t.a[1],u.a[1])&&r(t.a,2,-1,u.a,2,-1))}export{b as cloneCurve,P as curveEquals,g as curvesAreSameType,u as getCurves,h as getEndpoint,l as getPaths,f as hasCircularArc,e as isBezierCurve,c as isCircularArc,R as isClockwise,i as isCoordinate,t as isCurvedGeometry,o as isEllipticArc,s as isEllipticArc4,a as isEllipticArc7,v as pathHasCurves};
2
+ import{equals as n,sliceEquals as r}from"../../../core/arrayUtils.js";function t(n){return"curveRings"in n&&!!n.curveRings?.length||"curvePaths"in n&&!!n.curvePaths?.length}function u(n){return"curveRings"in n?n.curveRings:n.curvePaths}function i(n){return"b"in n}function c(n){return"c"in n}function e(n){return Array.isArray(n)}function a(n){return"a"in n}function o(n){return"a"in n&&4===n.a.length}function s(n){return"a"in n&&7===n.a.length}function f(n,r){return u(n).flat().some(n=>b(n,r))}function b(n,r){return!e(n)&&(i(n)?!r.has("cubic-bezier"):c(n)?!r.has("circular-arc"):!(!o(n)&&!s(n))&&!r.has("elliptic-arc"))}function g(n){return!(!n||!t(n))&&u(n).some(n=>n.some(n=>c(n)))}function h(n,r){return e(n)?e(r):i(n)?i(r):c(n)?c(r):o(n)?o(r):!!s(n)&&s(r)}function v(n){return e(n)?n:i(n)?n.b[0]:c(n)?n.c[0]:n.a[0]}function l(n){if(i(n)){const[r,t,u]=n.b;return{b:[[...r],[...t],[...u]]}}if(c(n)){const[r,t]=n.c;return{c:[[...r],[...t]]}}if(e(n))return[...n];if(o(n)){const[r,t,u,i]=n.a;return{a:[[...r],[...t],u,i]}}if(s(n)){const[r,t,u,i,c,e,a]=n.a;return{a:[[...r],[...t],u,i,c,e,a]}}return n}function m(n){return t(n)?"curveRings"in n?n.curveRings:n.curvePaths:"rings"in n?n.rings:n.paths}function R(n){return n.some(n=>!e(n))}function p(t,u){return e(t)&&e(u)?n(t,u):c(t)&&c(u)?n(t.c[0],u.c[0])&&n(t.c[1],u.c[1]):i(t)&&i(u)?n(t.b[0],u.b[0])&&n(t.b[1],u.b[1])&&n(t.b[2],u.b[2]):!(!a(t)||!a(u))&&(n(t.a[0],u.a[0])&&n(t.a[1],u.a[1])&&r(t.a,2,-1,u.a,2,-1))}export{l as cloneCurve,p as curveEquals,h as curvesAreSameType,u as getCurves,v as getEndpoint,m as getPaths,g as hasCircularArc,f as hasUnsupportedCurve,i as isBezierCurve,c as isCircularArc,e as isCoordinate,t as isCurvedGeometry,a as isEllipticArc,o as isEllipticArc4,s as isEllipticArc7,R as pathHasCurves};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import t from"../../../core/Error.js";import{memoize as e}from"../../../core/memoize.js";import{fromJSON as s}from"../jsonUtils.js";import{interpolateCubicBezier as n}from"./bezierCurveUtils.js";import{deriveCircleFromCircularArc as i}from"./circularArcUtils.js";import{isCurvedGeometry as r,getCurves as a,getPaths as c,isClockwise as o,getEndpoint as h,isCoordinate as u,isBezierCurve as p,isCircularArc as l,isEllipticArc4 as m,isEllipticArc7 as f,cloneCurve as d}from"./curveUtils.js";import{deriveCircleFromEllipticArc4 as S}from"./ellipticArc4Utils.js";import{deriveEllipse as v,interpolateEllipse as E}from"./ellipticArc7Utils.js";import{interpolateSegment as g,pointToSegmentDistance2 as x,distance2 as M}from"./mathUtils.js";const P={maxSegmentLength:0,maxDeviation:0,maxSegmentsPerCurve:12e3,minSegmentsPerCurve:1},k=100,C=1e-6,_=[0,0],y=new Set;function w(t){return{maxSegmentLength:t.maxSegmentLength??P.maxSegmentLength,maxDeviation:t.maxDeviation??P.maxDeviation,maxSegmentsPerCurve:t.maxSegmentsPerCurve??P.maxSegmentsPerCurve,minSegmentsPerCurve:Math.max(t.minSegmentsPerCurve??P.minSegmentsPerCurve,1)}}class R{constructor(t,e){this.curveStart=t,this.curveEnd=e,this.tStart=0,this.tEnd=0,this.tEndStack=[],this.arcEndStack=[]}get stackSize(){return this.tEndStack.length}initialize(t,e){this.tStart=0,this.arcStart=t,this.tEndStack.push(1),this.arcEndStack.push(e)}splitAt(t){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(t),this.arcEndStack.push(this.interpolate(t))}splitInHalf(){return this.splitAt((this.tStart+this.tEnd)/2)}pop(){this.tEnd=this.tEndStack.pop(),this.arcEnd=this.arcEndStack.pop()}next(){this.tStart=this.tEnd,this.arcStart=this.arcEnd}densify(t,{maxDeviation:e,maxSegmentLength:s,maxSegmentsPerCurve:n,minSegmentsPerCurve:i}){const r=s*s,a=e*e,c=1/n,o=this.interpolate(0),h=this.interpolate(1);M(this.curveStart,o)>C&&t.push(o),this.initialize(o,h);const u=1/i;for(let p=i-1;p>0;p--){const t=p*u;this.pop(),this.splitAt(t)}for(;this.stackSize>0;)this.pop(),this.tStart===this.tEnd||this.tEnd-this.tStart<c||(0===r||!isFinite(r)||M(this.arcStart,this.arcEnd)<r)&&(0===a||!isFinite(a)||this.getDeviation2()<a)?(t.push(this.arcEnd),this.next()):this.splitInHalf();return M(this.curveEnd,h)>C&&t.push([...this.curveEnd]),t}}class b extends R{constructor(t,e){const[s,n,i]=e.b;super(t,s),this._controlPointsStack=[],this._curveControlPoints=[n,i],this._arcControlPoints=[n,i],this._controlPointsStack.push(this._arcControlPoints)}splitAt(t){const{arcStart:e,arcEnd:s,tStart:n,tEnd:i}=this,[r,a]=this._arcControlPoints,c=(t-n)/(i-n),o=g([],e,r,c),h=g(_,r,a,c),u=g([],a,s,c),p=g([],o,h,c),l=g([],h,u,c),m=g([],p,l,c);this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this._controlPointsStack.push([l,u]),this.tEndStack.push(t),this.arcEndStack.push(m),this._arcControlPoints[0]=o,this._arcControlPoints[1]=p,this._controlPointsStack.push(this._arcControlPoints)}pop(){super.pop(),this._arcControlPoints=this._controlPointsStack.pop()}interpolate(t){const{curveStart:e,curveEnd:s}=this,[i,r]=this._curveControlPoints;return n(e,i,r,s,t)}getDeviation2(){const{arcStart:t,arcEnd:e}=this,[s,n]=this._arcControlPoints;return Math.max(x(s,t,e),x(n,t,e))}}class j extends R{constructor(t,e){const[s]=e.a;super(t,s),this._derivedEllipse=v(t,e)}pop(){super.pop(),this._tMid=(this.tStart+this.tEnd)/2,this._arcMid=this.interpolate(this._tMid)}splitInHalf(){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(this._tMid),this.arcEndStack.push(this._arcMid)}interpolate(t){return E(this._derivedEllipse,t)}getDeviation2(){return x(this._arcMid,this.arcStart,this.arcEnd)}}function Z(t,e,s,{cx:n,cy:i,radius:r,thetaStart:a,thetaEnd:c,isInvalid:o},{maxDeviation:h,maxSegmentLength:u,maxSegmentsPerCurve:p,minSegmentsPerCurve:l}){if(o)return t.push([...s]),t;const m=2*r,f=[n+r*Math.cos(a),i+r*Math.sin(a)],d=[n+r*Math.cos(c),i+r*Math.sin(c)];M(e,f)>C&&t.push(f);const S=Math.abs(c-a),v=u>0&&u<m?2*Math.asin(u/m):S,E=h>0&&h<=r?2*Math.acos(1-h/r):S,g=Math.min(v,E),x=Math.min(p,Math.max(l,Math.ceil(Math.abs(S/g)))),P=1/x;for(let M=1;M<x;M++){const e=M*P,s=a*(1-e)+c*e;t.push([n+r*Math.cos(s),i+r*Math.sin(s)])}return t.push(d),M(s,d)>C&&t.push([...s]),t}function D(t,e,s,n){return new b(e,s).densify(t,n)}function z(t,e,s,n){const r=i(e,s),[a]=s.c;return Z(t,e,a,r,n)}function A(t,e,s,n){const i=S(e,s),[r]=s.a;return Z(t,e,r,i,n)}function L(t,e,s,n){const[i,r,a,c,o,h,u]=s.a;return 0===h||0===u?(t.push([...i]),t):new j(e,s).densify(t,n)}function U(t,e,s,n){return u(s)?(t.push([...s]),t):p(s)?D(t,e,s,n):l(s)?z(t,e,s,n):m(s)?A(t,e,s,n):L(t,e,s,n)}function T(t,e={}){if(!r(t))return t;const s=w(e),n=a(t),i=[];for(const r of n){const t=[];for(let e=0;e<r.length-1;e++){const n=e+1,i=[...h(r[e])];0===e&&t.push(i);U(t,i,r[n],s)}i.push(t)}return"curvePaths"in t?{...void 0!==t.hasZ?{hasZ:t.hasZ}:{},...void 0!==t.hasM?{hasM:t.hasM}:{},paths:i,spatialReference:t.spatialReference}:{...void 0!==t.hasZ?{hasZ:t.hasZ}:{},...void 0!==t.hasM?{hasM:t.hasM}:{},rings:i,spatialReference:t.spatialReference}}const I=e(t=>({maxDeviation:0,maxSegmentLength:t*k,maxSegmentsPerCurve:12e3,minSegmentsPerCurve:1}));function J(t,e,s){if(!r(t))return t;const n=new Set(e),i=w(s),c=a(t),o=[];let S=!1;for(const r of c){const t=[];for(let e=0;e<r.length-1;e++){const s=e+1,a=[...h(r[e])];0===e&&t.push(a);const c=r[s];u(c)?t.push([...c]):p(c)&&!n.has("cubic-bezier")?D(t,a,c,i):l(c)&&!n.has("circular-arc")?z(t,a,c,i):m(c)&&!n.has("elliptic-arc")?A(t,a,c,i):f(c)&&!n.has("elliptic-arc")?L(t,a,c,i):(t.push(d(c)),S=!0)}o.push(t)}return"curvePaths"in t?{...void 0!==t.hasZ?{hasZ:t.hasZ}:{},...void 0!==t.hasM?{hasM:t.hasM}:{},spatialReference:t.spatialReference,...S?{curvePaths:o}:{paths:o}}:{hasZ:t.hasZ,hasM:t.hasM,spatialReference:t.spatialReference,...S?{curveRings:o}:{rings:o}}}async function N(t,e,n,i){const a=new Set(e);return await O(t,a,n,i),t.map(t=>{if(!t||!r(t))return t;const e=t.spatialReference.xyTolerance;if(null==e)return t;const i=I(e),c=!n&&H(t)?y:a;return s(J(t,c,i))})}async function O(e,s,n,i){let c=null;for(const o of e){if(!o||!r(o)||null!=o.spatialReference.xyTolerance)continue;const e=!n&&H(o)?y:s;if(a(o).flat().some(t=>F(t,e))){const e=o.spatialReference;if(!e)throw new t("geometry:missing-spatial-reference","Geometry contains an unsupported curve type, but it cannot be densified because it has no spatial reference.");const s=G(e);if(i.has(s))o.spatialReference=i.get(s);else{c||(c=await import("../../operators/support/apiConverter.js"));const n=c.fromSpatialReference(e),r=n?.getTolerance();if(null==r)throw new t("geometry:missing-tolerance","Geometry contains an unsupported curve type, but it cannot be densified because the tolerance of its spatial reference is unknown. Set the `xyTolerance` property of the spatial reference.");const a=o.spatialReference.clone();a.read({xyTolerance:r}),o.spatialReference=a,i.set(s,a)}}}}function H(t){if(!r(t))return!1;const e=c(t);if(e.length<2)return!1;const s=o(e[0])?o:t=>!o(t);for(let n=1;n<e.length;n++)if(s(e[n]))return!0;return!1}function F(t,e){return!u(t)&&(p(t)?!e.has("cubic-bezier"):l(t)?!e.has("circular-arc"):!(!m(t)&&!f(t))&&!e.has("elliptic-arc"))}function G(t){if(null!=t.wkid)return`${t.wkid}`;if(null!=t.wkt)return t.wkt;const e="toJSON"in t&&"function"==typeof t.toJSON?t.toJSON():t;return JSON.stringify(e)}export{T as densifyCurvedGeometry,N as densifyUnsupportedCurves,I as getAutoDensifyOptions,G as getCacheKey,J as selectiveDensifyCurvedGeometryJSON};
2
+ import t from"../../../core/Error.js";import{memoize as e}from"../../../core/memoize.js";import{fromJSON as s}from"../jsonUtils.js";import{interpolateCubicBezier as n}from"./bezierCurveUtils.js";import{deriveCircleFromCircularArc as i}from"./circularArcUtils.js";import{isCurvedGeometry as r,hasUnsupportedCurve as a,getCurves as o,getEndpoint as c,isCoordinate as h,isBezierCurve as u,isCircularArc as p,isEllipticArc4 as l,isEllipticArc7 as m,cloneCurve as d}from"./curveUtils.js";import{deriveCircleFromEllipticArc4 as f}from"./ellipticArc4Utils.js";import{deriveEllipse as S,interpolateEllipse as v}from"./ellipticArc7Utils.js";import{interpolateSegment as E,pointToSegmentDistance2 as g,distance2 as x}from"./mathUtils.js";const M={maxSegmentLength:0,maxDeviation:0,maxSegmentsPerCurve:12e3,minSegmentsPerCurve:1},P=100,k=1e-6,C=[0,0];function _(t){return{maxSegmentLength:t.maxSegmentLength??M.maxSegmentLength,maxDeviation:t.maxDeviation??M.maxDeviation,maxSegmentsPerCurve:t.maxSegmentsPerCurve??M.maxSegmentsPerCurve,minSegmentsPerCurve:Math.max(t.minSegmentsPerCurve??M.minSegmentsPerCurve,1)}}class y{constructor(t,e){this.curveStart=t,this.curveEnd=e,this.tStart=0,this.tEnd=0,this.tEndStack=[],this.arcEndStack=[]}get stackSize(){return this.tEndStack.length}initialize(t,e){this.tStart=0,this.arcStart=t,this.tEndStack.push(1),this.arcEndStack.push(e)}splitAt(t){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(t),this.arcEndStack.push(this.interpolate(t))}splitInHalf(){return this.splitAt((this.tStart+this.tEnd)/2)}pop(){this.tEnd=this.tEndStack.pop(),this.arcEnd=this.arcEndStack.pop()}next(){this.tStart=this.tEnd,this.arcStart=this.arcEnd}densify(t,{maxDeviation:e,maxSegmentLength:s,maxSegmentsPerCurve:n,minSegmentsPerCurve:i}){const r=s*s,a=e*e,o=1/n,c=this.interpolate(0),h=this.interpolate(1);x(this.curveStart,c)>k&&t.push(c),this.initialize(c,h);const u=1/i;for(let p=i-1;p>0;p--){const t=p*u;this.pop(),this.splitAt(t)}for(;this.stackSize>0;)this.pop(),this.tStart===this.tEnd||this.tEnd-this.tStart<o||(0===r||!isFinite(r)||x(this.arcStart,this.arcEnd)<r)&&(0===a||!isFinite(a)||this.getDeviation2()<a)?(t.push(this.arcEnd),this.next()):this.splitInHalf();return x(this.curveEnd,h)>k&&t.push([...this.curveEnd]),t}}class R extends y{constructor(t,e){const[s,n,i]=e.b;super(t,s),this._controlPointsStack=[],this._curveControlPoints=[n,i],this._arcControlPoints=[n,i],this._controlPointsStack.push(this._arcControlPoints)}splitAt(t){const{arcStart:e,arcEnd:s,tStart:n,tEnd:i}=this,[r,a]=this._arcControlPoints,o=(t-n)/(i-n),c=E([],e,r,o),h=E(C,r,a,o),u=E([],a,s,o),p=E([],c,h,o),l=E([],h,u,o),m=E([],p,l,o);this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this._controlPointsStack.push([l,u]),this.tEndStack.push(t),this.arcEndStack.push(m),this._arcControlPoints[0]=c,this._arcControlPoints[1]=p,this._controlPointsStack.push(this._arcControlPoints)}pop(){super.pop(),this._arcControlPoints=this._controlPointsStack.pop()}interpolate(t){const{curveStart:e,curveEnd:s}=this,[i,r]=this._curveControlPoints;return n(e,i,r,s,t)}getDeviation2(){const{arcStart:t,arcEnd:e}=this,[s,n]=this._arcControlPoints;return Math.max(g(s,t,e),g(n,t,e))}}class w extends y{constructor(t,e){const[s]=e.a;super(t,s),this._derivedEllipse=S(t,e)}pop(){super.pop(),this._tMid=(this.tStart+this.tEnd)/2,this._arcMid=this.interpolate(this._tMid)}splitInHalf(){this.tEndStack.push(this.tEnd),this.arcEndStack.push(this.arcEnd),this.tEndStack.push(this._tMid),this.arcEndStack.push(this._arcMid)}interpolate(t){return v(this._derivedEllipse,t)}getDeviation2(){return g(this._arcMid,this.arcStart,this.arcEnd)}}function b(t,e,s,{cx:n,cy:i,radius:r,thetaStart:a,thetaEnd:o,isInvalid:c},{maxDeviation:h,maxSegmentLength:u,maxSegmentsPerCurve:p,minSegmentsPerCurve:l}){if(c)return t.push([...s]),t;const m=2*r,d=[n+r*Math.cos(a),i+r*Math.sin(a)],f=[n+r*Math.cos(o),i+r*Math.sin(o)];x(e,d)>k&&t.push(d);const S=Math.abs(o-a),v=u>0&&u<m?2*Math.asin(u/m):S,E=h>0&&h<=r?2*Math.acos(1-h/r):S,g=Math.min(v,E),M=Math.min(p,Math.max(l,Math.ceil(Math.abs(S/g)))),P=1/M;for(let x=1;x<M;x++){const e=x*P,s=a*(1-e)+o*e;t.push([n+r*Math.cos(s),i+r*Math.sin(s)])}return t.push(f),x(s,f)>k&&t.push([...s]),t}function j(t,e,s,n){return new R(e,s).densify(t,n)}function Z(t,e,s,n){const r=i(e,s),[a]=s.c;return b(t,e,a,r,n)}function D(t,e,s,n){const i=f(e,s),[r]=s.a;return b(t,e,r,i,n)}function z(t,e,s,n){const[i,r,a,o,c,h,u]=s.a;return 0===h||0===u?(t.push([...i]),t):new w(e,s).densify(t,n)}function A(t,e,s,n){return h(s)?(t.push([...s]),t):u(s)?j(t,e,s,n):p(s)?Z(t,e,s,n):l(s)?D(t,e,s,n):z(t,e,s,n)}function L(t,e={}){if(!r(t))return t;const s=_(e),n=o(t),i=[];for(const r of n){const t=[];for(let e=0;e<r.length-1;e++){const n=e+1,i=[...c(r[e])];0===e&&t.push(i);A(t,i,r[n],s)}i.push(t)}return"curvePaths"in t?{...void 0!==t.hasZ?{hasZ:t.hasZ}:{},...void 0!==t.hasM?{hasM:t.hasM}:{},paths:i,spatialReference:t.spatialReference}:{...void 0!==t.hasZ?{hasZ:t.hasZ}:{},...void 0!==t.hasM?{hasM:t.hasM}:{},rings:i,spatialReference:t.spatialReference}}const U=e(t=>({maxDeviation:0,maxSegmentLength:t*P,maxSegmentsPerCurve:12e3,minSegmentsPerCurve:1}));function T(t,e,s){if(!r(t))return t;const n=new Set(e),i=_(s),a=o(t),f=[];let S=!1;for(const r of a){const t=[];for(let e=0;e<r.length-1;e++){const s=e+1,a=[...c(r[e])];0===e&&t.push(a);const o=r[s];h(o)?t.push([...o]):u(o)&&!n.has("cubic-bezier")?j(t,a,o,i):p(o)&&!n.has("circular-arc")?Z(t,a,o,i):l(o)&&!n.has("elliptic-arc")?D(t,a,o,i):m(o)&&!n.has("elliptic-arc")?z(t,a,o,i):(t.push(d(o)),S=!0)}f.push(t)}return"curvePaths"in t?{...void 0!==t.hasZ?{hasZ:t.hasZ}:{},...void 0!==t.hasM?{hasM:t.hasM}:{},spatialReference:t.spatialReference,...S?{curvePaths:f}:{paths:f}}:{hasZ:t.hasZ,hasM:t.hasM,spatialReference:t.spatialReference,...S?{curveRings:f}:{rings:f}}}async function I(t,e,n){const i=new Set(e);return await J(t,i,n),t.map(t=>{if(!t||!r(t))return t;const n=t.spatialReference.xyTolerance;if(null==n)return t;const i=U(n);return s(T(t,e,i))})}async function J(e,s,n){let i=null;for(const o of e)if(o&&r(o)&&null==o.spatialReference.xyTolerance&&a(o,s)){const e=o.spatialReference;if(!e)throw new t("geometry:missing-spatial-reference","Geometry contains an unsupported curve type, but it cannot be densified because it has no spatial reference.");const s=N(e);if(n.has(s))o.spatialReference=n.get(s);else{i||(i=await import("../../operators/support/apiConverter.js"));const r=i.fromSpatialReference(e),a=r?.getTolerance();if(null==a)throw new t("geometry:missing-tolerance","Geometry contains an unsupported curve type, but it cannot be densified because the tolerance of its spatial reference is unknown. Set the `xyTolerance` property of the spatial reference.");const c=o.spatialReference.clone();c.read({xyTolerance:a}),o.spatialReference=c,n.set(s,c)}}}function N(t){if(null!=t.wkid)return`${t.wkid}`;if(null!=t.wkt)return t.wkt;const e="toJSON"in t&&"function"==typeof t.toJSON?t.toJSON():t;return JSON.stringify(e)}export{L as densifyCurvedGeometry,I as densifyUnsupportedCurves,U as getAutoDensifyOptions,N as getCacheKey,T as selectiveDensifyCurvedGeometryJSON};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{isSubtypeGroupLayer as r}from"../layers/support/layerUtils.js";function e(r){return r&&"layer"in r?r.layer:void 0}function o(o){let t=e(o.origin);return r(t)&&(t=t.findSublayerForFeature(o)),t??o.sourceLayer??o.layer}export{o as getGraphicLayer,e as getGraphicOriginLayer};
2
+ import{isSubtypeGroupLayer as r,isLinkChartLayer as e,isKnowledgeGraphLayer as o,isKnowledgeGraphSublayer as a}from"../layers/support/layerUtils.js";function t(r){return r&&"layer"in r?r.layer:void 0}function u(u){let i=t(u.origin);return r(i)?i=i.findSublayerForFeature(u):(e(i)||o(i))&&a(u.sourceLayer)&&(i=u.sourceLayer),i??u.sourceLayer??u.layer}export{u as getGraphicLayer,t as getGraphicOriginLayer};
package/kernel.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.130",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
2
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.131",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../request.js";import{isSome as r}from"../core/arrayUtils.js";import i from"../core/Collection.js";import s from"../core/Error.js";import{clone as a}from"../core/lang.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{getDeepValue as l}from"../core/object.js";import{throwIfAbortError as n}from"../core/promiseUtils.js";import{watch as m,sync as p,on as c}from"../core/reactiveUtils.js";import{urlToObject as u,objectToQuery as y}from"../core/urlUtils.js";import{property as d,subclass as h}from"../core/accessorSupport/decorators.js";import f from"../geometry/Extent.js";import v from"./Layer.js";import g from"./WebTileLayer.js";import{BlendLayer as w}from"./mixins/BlendLayer.js";import{OperationalLayer as I}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{RefreshableLayer as S}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as M}from"./mixins/ScaleRangeLayer.js";import{createTileBitmap as T}from"./support/imageBitmapUtils.js";import P from"./support/TileInfo.js";import b from"./support/TileInfoTilemapCache.js";import{WMTSLayerInfo as j}from"./support/WMTSLayerInfo.js";import x from"./support/WMTSSublayer.js";import{getTileUrlFromResourceUrls as E,getTileUrlTemplateFromResourceUrls as C,parseResourceInfo as _,parseText as U,validateCapabilities as R,parseCapabilities as O}from"./support/wmtsUtils.js";import{reader as A}from"../core/accessorSupport/decorators/reader.js";import{writer as W}from"../core/accessorSupport/decorators/writer.js";var F;const V={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},B=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let $=F=class extends(w(S(M(I(L(o(v))))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([m(()=>this.activeLayer,(e,t)=>{t&&!this.sublayers?.includes(t)&&(t.layer=null,t.parent=null),e&&(e.layer=this,e.parent=this)},p),c(()=>this.sublayers,"after-add",({item:e})=>{e.layer=this,e.parent=this},p),c(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=null,e.parent=null},p),m(()=>this.sublayers,(e,t)=>{if(t)for(const r of t)r.layer=null,r.parent=null;if(e)for(const r of e)r.layer=this,r.parent=this},p)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(n).then(()=>this._fetchService(e)).catch(e=>{throw n(e),new s("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new x);let i=t.layers.find(e=>e.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=i?.layerIdentifier;let o=null;const l=i?.tileMatrixSet;l&&(Array.isArray(l)?l.length&&(o=l[0]):o=l);const n=s?.format,m=s?.style;return new x({id:a,imageFormat:n,styleId:m,tileMatrixSetId:o})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=l("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return K(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(r)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new b(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r?.tileInfo,s=e.fullExtent,a=new j({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new g({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,r,i,s={}){const{signal:a}=s,o=this.getTileUrl(e,r,i),{data:l}=await t(o,{responseType:"image",signal:a});return l}async fetchImageBitmapTile(e,r,i,s={}){const{signal:a}=s;if(this.fetchTile!==F.prototype.fetchTile){const t=await this.fetchTile(e,r,i,s);return T(t,e,r,i,a)}const o=this.getTileUrl(e,r,i),{data:l}=await t(o,{responseType:"blob",signal:a});return T(l,e,r,i,a)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=i?.tileInfo?.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let o=this.resourceInfo?"":E({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);if(!o){o=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)}return o=this._appendCustomLayerParameters(o),o}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const r=C({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(r)return r}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";return V[r.toLowerCase()]&&(s=V[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){if(this.resourceInfo)return"KVP"!==this.resourceInfo.serviceMode||this.url.includes("?")||(this.url+="?"),_(this.resourceInfo),void this.read(this.resourceInfo,{origin:"service"});let t=null;try{const{data:r}=await this._getCapabilities(this.serviceMode,e);t=U(r),R(t)}catch{const r="KVP"===this.serviceMode?"RESTful":"KVP";try{const{data:i}=await this._getCapabilities(r,e);t=U(i),R(t),this.serviceMode=r}catch(o){throw new s("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:o})}}const{serviceMode:r,url:i}=this,a=O(t,{serviceMode:r,url:i});this.read(a,{origin:"service"})}async _getCapabilities(e,r){const i=this._getCapabilitiesUrl(e);return await t(i,{...r,responseType:"text"})}_getTileMatrixSetById(e){const t=this.findSublayerById(this.activeLayer.id);return t?.tileMatrixSets?.find(({id:t})=>t===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...a(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=u(e),i={...r.query,...t},s=y(i);return""===s?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=u(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const e=`/${this.version}/WMTSCapabilities.xml`,r=new RegExp(e,"i");t=t.replace(r,""),t+=e;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=u(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(e=>{r[e.toLowerCase()]=t[e]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const t=Object.keys(r);t.length&&(e=e?a(e):{},t.forEach(t=>{e.hasOwnProperty(t)||B.has(t)||(e[t]=r[t])}))}return e}};function K(e,t){return e.map(e=>{const r=new x;return r.read(e,t),r})}e([d()],$.prototype,"dimensionMap",void 0),e([d()],$.prototype,"layerMap",void 0),e([d({type:x,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],$.prototype,"activeLayer",void 0),e([A("service","activeLayer",["layers"])],$.prototype,"readActiveLayerFromService",null),e([A(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],$.prototype,"readActiveLayerFromItemOrWebDoc",null),e([W(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:P},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],$.prototype,"writeActiveLayer",null),e([d({type:String,value:"",json:{write:!0}})],$.prototype,"copyright",void 0),e([d({type:["show","hide"]})],$.prototype,"listMode",void 0),e([d({json:{read:!0,write:!0}})],$.prototype,"blendMode",void 0),e([d({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],$.prototype,"customParameters",void 0),e([A(["portal-item","web-document"],"customParameters")],$.prototype,"readCustomParameters",null),e([d({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],$.prototype,"customLayerParameters",void 0),e([d({type:f,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],$.prototype,"fullExtent",void 0),e([d({readOnly:!0})],$.prototype,"fullExtents",null),e([d({type:["WebTiledLayer"]})],$.prototype,"operationalLayerType",void 0),e([d()],$.prototype,"resourceInfo",void 0),e([d()],$.prototype,"serviceMode",void 0),e([A(["portal-item","web-document"],"serviceMode",["templateUrl"])],$.prototype,"readServiceMode",null),e([d({type:i.ofType(x)})],$.prototype,"sublayers",void 0),e([A("service","sublayers",["layers"])],$.prototype,"readSublayersFromService",null),e([d({readOnly:!0})],$.prototype,"supportedSpatialReferences",null),e([d({readOnly:!0})],$.prototype,"tilemapCache",null),e([d({json:{read:{source:"title"}}})],$.prototype,"title",null),e([d({json:{read:!1},readOnly:!0,value:"wmts"})],$.prototype,"type",void 0),e([d({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],$.prototype,"url",null),e([d()],$.prototype,"version",void 0),$=F=e([h("esri.layers.WMTSLayer")],$);const k=$;export{k as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import{isSome as r}from"../core/arrayUtils.js";import i from"../core/Collection.js";import s from"../core/Error.js";import{clone as a}from"../core/lang.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{watch as n,sync as m,on as p}from"../core/reactiveUtils.js";import{urlToObject as c,objectToQuery as u}from"../core/urlUtils.js";import{property as y,subclass as d}from"../core/accessorSupport/decorators.js";import h from"../geometry/Extent.js";import f from"./Layer.js";import v from"./WebTileLayer.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as I}from"./mixins/PortalLayer.js";import{RefreshableLayer as L}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{createTileBitmap as M}from"./support/imageBitmapUtils.js";import T from"./support/TileInfo.js";import P from"./support/TileInfoTilemapCache.js";import{WMTSLayerInfo as b}from"./support/WMTSLayerInfo.js";import j from"./support/WMTSSublayer.js";import{getTileUrlFromResourceUrls as x,getTileUrlTemplateFromResourceUrls as E,parseResourceInfo as _,parseText as C,validateCapabilities as U,parseCapabilities as R}from"./support/wmtsUtils.js";import{reader as O}from"../core/accessorSupport/decorators/reader.js";import{writer as A}from"../core/accessorSupport/decorators/writer.js";var W;const F={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},V=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let B=W=class extends(g(L(S(w(I(o(f))))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([n(()=>this.activeLayer,(e,t)=>{t&&!this.sublayers?.includes(t)&&(t.layer=null,t.parent=null),e&&(e.layer=this,e.parent=this)},m),p(()=>this.sublayers,"after-add",({item:e})=>{e.layer=this,e.parent=this},m),p(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=null,e.parent=null},m),n(()=>this.sublayers,(e,t)=>{if(t)for(const r of t)r.layer=null,r.parent=null;if(e)for(const r of e)r.layer=this,r.parent=this},m)])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(l).then(()=>this._fetchService(e)).catch(e=>{throw l(e),new s("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new j);let i=t.layers.find(e=>e.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=i?.layerIdentifier;let o=null;const l=i?.tileMatrixSet;l&&(Array.isArray(l)?l.length&&(o=l[0]):o=l);const n=s?.format,m=s?.style;return new j({id:a,imageFormat:n,styleId:m,tileMatrixSetId:o})}writeActiveLayer(e,t,r,i){const{activeLayer:s,loaded:a}=this,{id:o,tileMatrixSet:l,tileMatrixSetId:n,imageFormat:m,styleId:p}=s;t.templateUrl=a?this.getUrlTemplate(o,n,m,p):void 0,t.tileInfo=a?l?.tileInfo?.toJSON(i)??null:void 0,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:o,tileMatrixSet:n}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return $(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(r)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new P(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r?.tileInfo,s=e.fullExtent,a=new b({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new v({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,r,i,s={}){const{signal:a}=s,o=this.getTileUrl(e,r,i),{data:l}=await t(o,{responseType:"image",signal:a});return l}async fetchImageBitmapTile(e,r,i,s={}){const{signal:a}=s;if(this.fetchTile!==W.prototype.fetchTile){const t=await this.fetchTile(e,r,i,s);return M(t,e,r,i,a)}const o=this.getTileUrl(e,r,i),{data:l}=await t(o,{responseType:"blob",signal:a});return M(l,e,r,i,a)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=i?.tileInfo?.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let o=this.resourceInfo?"":x({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);if(!o){o=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)}return o=this._appendCustomLayerParameters(o),o}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const r=E({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(r)return r}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";const a=r.toLowerCase();return F[a]&&(s=F[a]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){if(this.resourceInfo)return"KVP"!==this.resourceInfo.serviceMode||this.url.includes("?")||(this.url+="?"),_(this.resourceInfo),void this.read(this.resourceInfo,{origin:"service"});let t=null;try{const{data:r}=await this._getCapabilities(this.serviceMode,e);t=C(r),U(t)}catch{const r="KVP"===this.serviceMode?"RESTful":"KVP";try{const{data:i}=await this._getCapabilities(r,e);t=C(i),U(t),this.serviceMode=r}catch(o){throw new s("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:o})}}const{serviceMode:r,url:i}=this,a=R(t,{serviceMode:r,url:i});this.read(a,{origin:"service"})}async _getCapabilities(e,r){const i=this._getCapabilitiesUrl(e);return await t(i,{...r,responseType:"text"})}_getTileMatrixSetById(e){const t=this.findSublayerById(this.activeLayer.id);return t?.tileMatrixSets?.find(({id:t})=>t===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...a(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=c(e),i={...r.query,...t},s=u(i);return""===s?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=c(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const e=`/${this.version}/WMTSCapabilities.xml`,r=new RegExp(e,"i");t=t.replace(r,""),t+=e;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=c(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(e=>{r[e.toLowerCase()]=t[e]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const t=Object.keys(r);t.length&&(e=e?a(e):{},t.forEach(t=>{e.hasOwnProperty(t)||V.has(t)||(e[t]=r[t])}))}return e}};function $(e,t){return e.map(e=>{const r=new j;return r.read(e,t),r})}e([y()],B.prototype,"dimensionMap",void 0),e([y()],B.prototype,"layerMap",void 0),e([y({type:j,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],B.prototype,"activeLayer",void 0),e([O("service","activeLayer",["layers"])],B.prototype,"readActiveLayerFromService",null),e([O(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],B.prototype,"readActiveLayerFromItemOrWebDoc",null),e([A(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:T},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],B.prototype,"writeActiveLayer",null),e([y({type:String,value:"",json:{write:!0}})],B.prototype,"copyright",void 0),e([y({type:["show","hide"]})],B.prototype,"listMode",void 0),e([y({json:{read:!0,write:!0}})],B.prototype,"blendMode",void 0),e([y({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],B.prototype,"customParameters",void 0),e([O(["portal-item","web-document"],"customParameters")],B.prototype,"readCustomParameters",null),e([y({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],B.prototype,"customLayerParameters",void 0),e([y({type:h,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],B.prototype,"fullExtent",void 0),e([y({readOnly:!0})],B.prototype,"fullExtents",null),e([y({type:["WebTiledLayer"]})],B.prototype,"operationalLayerType",void 0),e([y()],B.prototype,"resourceInfo",void 0),e([y()],B.prototype,"serviceMode",void 0),e([O(["portal-item","web-document"],"serviceMode",["templateUrl"])],B.prototype,"readServiceMode",null),e([y({type:i.ofType(j)})],B.prototype,"sublayers",void 0),e([O("service","sublayers",["layers"])],B.prototype,"readSublayersFromService",null),e([y({readOnly:!0})],B.prototype,"supportedSpatialReferences",null),e([y({readOnly:!0})],B.prototype,"tilemapCache",null),e([y({json:{read:{source:"title"}}})],B.prototype,"title",null),e([y({json:{read:!1},readOnly:!0,value:"wmts"})],B.prototype,"type",void 0),e([y({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],B.prototype,"url",null),e([y()],B.prototype,"version",void 0),B=W=e([d("esri.layers.WMTSLayer")],B);const K=B;export{K as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{createResolver as o}from"../../core/promiseUtils.js";import{dataComponents as n}from"../../core/urlUtils.js";import{generateBracedUUID as d}from"../../core/uuid.js";import{normalizeCentralMeridian as l}from"../../geometry/support/normalizeUtils.js";import{isGeographic as u,equals as p,isWGS84 as c,isWebMercator as m}from"../../geometry/support/spatialReferenceUtils.js";import{densifyUnsupportedCurves as h}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{isEditBusLayer as f,emitApplyEditsEvent as y}from"../mixins/EditBusLayer.js";import{isHostedAgolService as g}from"../support/arcgisLayerUrl.js";import{isValidFieldValue as b}from"../support/fieldUtils.js";import{isGlbSupportedEditFormat as w}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as F,getEffectiveLayerCapabilities as A}from"../support/layerUtils.js";function v(e){return null!=e?.applyEdits}const I=()=>s.getLogger("esri.layers.graphics.editingSupport"),$=new WeakMap;async function E(e,t,a,s={}){let i;const n="gdbVersion"in e?e.gdbVersion:null,d=s.gdbVersion??n;if(f(e)&&e.url)i=y(e.url,e.layerId,d,"original-and-current-features"===s.returnServiceEditsOption);else{i=o(),i.promise.then(t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)});const t={result:i.promise};e.emit("apply-edits",t)}try{const{results:o,edits:n}=await S(e,t,a,s),d=e=>e.filter(e=>!e.error).map(r),l={edits:n,addedFeatures:d(o.addFeatureResults),updatedFeatures:d(o.updateFeatureResults),deletedFeatures:d(o.deleteFeatureResults),addedAttachments:d(o.addAttachmentResults),updatedAttachments:d(o.updateAttachmentResults),deletedAttachments:d(o.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:o.editMoment?new Date(o.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return o.editedFeatureResults?.length&&(l.editedFeatures=o.editedFeatureResults),i.resolve(l),o}catch(l){throw i.reject(l),l}}async function S(e,t,r,s){if(await e.load(),!v(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!F(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:o}=await R(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,o)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function R(e,t,r){const s=A(e),o=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),d=null!=e.infoFor3D;if(V(t,s,r,!!o,!!n,`${e.type}-layer`),!s.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!s.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const l={...r};if(null!=l.rollbackOnFailureEnabled||s.editing.supportsRollbackOnFailure||(l.rollbackOnFailureEnabled=!0),l.rollbackOnFailureEnabled||"original-and-current-features"!==l.returnServiceEditsOption||(!1===l.rollbackOnFailureEnabled&&I().warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),l.rollbackOnFailureEnabled=!0),!s.editing.supportsReturnServiceEditsInSourceSpatialReference&&l.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(l.returnServiceEditsInSourceSR&&"original-and-current-features"!==l.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=D(t,s,`${e.type}-layer`),p=r?.globalIdUsed||d,c=e.fields.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach(e=>B(e,t))}u.addFeatures.forEach(t=>U(t,e,p,c)),u.updateFeatures.forEach(t=>L(t,e,p,c)),u.deleteFeatures.forEach(t=>k(t,e,p,c)),u.addAttachments.forEach(t=>T(t,e)),u.updateAttachments.forEach(t=>T(t,e)),d&&await z(u,e);const m=i($,e,()=>new Map),h=!g(e.url);return{edits:await M(u,s.data.supportedCurveTypes??[],h,m),options:l}}function O(e,t,r,s){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(s.length&&"attributes"in e)for(const i of s){const r=e.attributes[i.name];if(void 0!==r&&!b(i,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${i.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function j(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:r}=e,{spatialReference:s,vertexSpace:i}=r,o=t.spatialReference,n="local"===i.type,d=u(o),l=p(o,s),h=l||c(o)&&(c(s)||m(s));if(!(n&&d&&h||!n&&!d&&l))throw new a(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${i.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${o.wkid} is not supported.`)}}function U(e,t,a,r){O(e,t,a,r),j(e,t)}function k(e,t,a,r){O(e,t,a,r)}function L(e,t,r,s){O(e,t,r,s),j(e,t);const i=A(t);if("geometry"in e&&null!=e.geometry&&!i?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function T(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=n(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function B(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=d())}async function M(e,t,a,r){const s=e.addFeatures??[],i=e.updateFeatures??[],o=s.concat(i).map(e=>e.geometry),n=await h(o,t,a,r),d=await l(n),u=s.length,p=i.length;return d.slice(0,u).forEach((e,t)=>s[t].geometry=e),d.slice(u,u+p).forEach((e,t)=>i[t].geometry=e),e}function G(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function D(e,t,r){const s=G(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(x),s.updateFeatures=s.updateFeatures.map(x),s.addAssetFeatures=[],s}function V(e,t,r,s,i,o){if(!(e&&(s||i)||r?.usingTelecomOperations))throw new a(`${o}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed&&!r.usingFeatureServiceEndpoint)throw new a(`${o}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&i)throw new a(`${o}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new a(`${o}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function x(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function z(e,t){const{infoFor3D:r}=t;if(null==r)return;if(!w(r))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:s}=e;for(const a of e.addFeatures??[])C(a)&&s.push(a);for(const a of e.updateFeatures??[])C(a)&&s.push(a)}function C(e){return"mesh"===e?.geometry?.type}function W(e,t,r,s){if(!v(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{E as applyEdits,V as checkEditingCapabilities,G as normalizeCollections,D as normalizeEdits,M as processGeometries,x as shallowCloneFeature,W as uploadAssets};
2
+ import e from"../../Graphic.js";import t from"../../core/Collection.js";import a from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import s from"../../core/Logger.js";import{getOrCreateMapValue as i}from"../../core/MapUtils.js";import{createResolver as o}from"../../core/promiseUtils.js";import{dataComponents as n}from"../../core/urlUtils.js";import{generateBracedUUID as d}from"../../core/uuid.js";import{normalizeCentralMeridian as l}from"../../geometry/support/normalizeUtils.js";import{isGeographic as u,equals as p,isWGS84 as c,isWebMercator as m}from"../../geometry/support/spatialReferenceUtils.js";import{densifyUnsupportedCurves as h}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{isEditBusLayer as f,emitApplyEditsEvent as y}from"../mixins/EditBusLayer.js";import{isValidFieldValue as g}from"../support/fieldUtils.js";import{isGlbSupportedEditFormat as b}from"../support/infoFor3D.js";import{getEffectiveEditingEnabled as w,getEffectiveLayerCapabilities as F}from"../support/layerUtils.js";function A(e){return null!=e?.applyEdits}const v=()=>s.getLogger("esri.layers.graphics.editingSupport"),I=new WeakMap;async function $(e,t,a,s={}){let i;const n="gdbVersion"in e?e.gdbVersion:null,d=s.gdbVersion??n;if(f(e)&&e.url)i=y(e.url,e.layerId,d,"original-and-current-features"===s.returnServiceEditsOption);else{i=o(),i.promise.then(t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)});const t={result:i.promise};e.emit("apply-edits",t)}try{const{results:o,edits:n}=await E(e,t,a,s),d=e=>e.filter(e=>!e.error).map(r),l={edits:n,addedFeatures:d(o.addFeatureResults),updatedFeatures:d(o.updateFeatureResults),deletedFeatures:d(o.deleteFeatureResults),addedAttachments:d(o.addAttachmentResults),updatedAttachments:d(o.updateAttachmentResults),deletedAttachments:d(o.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:o.editMoment?new Date(o.editMoment):null,globalIdToObjectId:s.globalIdToObjectId};return o.editedFeatureResults?.length&&(l.editedFeatures=o.editedFeatureResults),i.resolve(l),o}catch(l){throw i.reject(l),l}}async function E(e,t,r,s){if(await e.load(),!A(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!w(e))throw new a(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:o}=await S(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,o)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function S(e,t,r){const s=F(e),o=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),d=null!=e.infoFor3D;if(D(t,s,r,!!o,!!n,`${e.type}-layer`),!s.data.isVersioned&&r?.gdbVersion)throw new a(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!s.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const l={...r};if(null!=l.rollbackOnFailureEnabled||s.editing.supportsRollbackOnFailure||(l.rollbackOnFailureEnabled=!0),l.rollbackOnFailureEnabled||"original-and-current-features"!==l.returnServiceEditsOption||(!1===l.rollbackOnFailureEnabled&&v().warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),l.rollbackOnFailureEnabled=!0),!s.editing.supportsReturnServiceEditsInSourceSpatialReference&&l.returnServiceEditsInSourceSR)throw new a(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(l.returnServiceEditsInSourceSR&&"original-and-current-features"!==l.returnServiceEditsOption)throw new a(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const u=G(t,s,`${e.type}-layer`),p=r?.globalIdUsed||d,c=e.fields.filter(e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8);if(p){const{globalIdField:t}=e;if(null==t)throw new a(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");u.addFeatures.forEach(e=>T(e,t))}u.addFeatures.forEach(t=>j(t,e,p,c)),u.updateFeatures.forEach(t=>k(t,e,p,c)),u.deleteFeatures.forEach(t=>U(t,e,p,c)),u.addAttachments.forEach(t=>L(t,e)),u.updateAttachments.forEach(t=>L(t,e)),d&&await x(u,e);const m=i(I,e,()=>new Map);return{edits:await B(u,s.data.supportedCurveTypes??[],m),options:l}}function R(e,t,r,s){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(s.length&&"attributes"in e)for(const i of s){const r=e.attributes[i.name];if(void 0!==r&&!g(i,r))throw new a(`${t.type}-layer:invalid-parameter`,`Big-integer field '${i.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new a(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new a(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function O(e,t){if("geometry"in e&&"mesh"===e.geometry?.type&&null!=t.infoFor3D&&null!=t.spatialReference){const{geometry:r}=e,{spatialReference:s,vertexSpace:i}=r,o=t.spatialReference,n="local"===i.type,d=u(o),l=p(o,s),h=l||c(o)&&(c(s)||m(s));if(!(n&&d&&h||!n&&!d&&l))throw new a(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${i.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${o.wkid} is not supported.`)}}function j(e,t,a,r){R(e,t,a,r),O(e,t)}function U(e,t,a,r){R(e,t,a,r)}function k(e,t,r,s){R(e,t,r,s),O(e,t);const i=F(t);if("geometry"in e&&null!=e.geometry&&!i?.editing.supportsGeometryUpdate)throw new a(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function L(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&!!s.data.name)&&!s.name)throw new a(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new a(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=n(s.data);if(e&&!e.isBase64)throw new a(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function T(e,t){const{attributes:a}=e;null==a[t]&&(a[t]=d())}async function B(e,t,a){const r=e.addFeatures??[],s=e.updateFeatures??[],i=r.concat(s).map(e=>e.geometry),o=await h(i,t,a),n=await l(o),d=r.length,u=s.length;return n.slice(0,d).forEach((e,t)=>r[t].geometry=e),n.slice(d,d+u).forEach((e,t)=>s[t].geometry=e),e}function M(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&t.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function G(e,t,r){const s=M(e);if(s.addFeatures?.length&&!t.operations.supportsAdd)throw new a(`${r}:unsupported-operation`,"Layer does not support adding features.");if(s.updateFeatures?.length&&!t.operations.supportsUpdate)throw new a(`${r}:unsupported-operation`,"Layer does not support updating features.");if(s.deleteFeatures?.length&&!t.operations.supportsDelete)throw new a(`${r}:unsupported-operation`,"Layer does not support deleting features.");return s.addFeatures=s.addFeatures.map(V),s.updateFeatures=s.updateFeatures.map(V),s.addAssetFeatures=[],s}function D(e,t,r,s,i,o){if(!(e&&(s||i)||r?.usingTelecomOperations))throw new a(`${o}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed&&!r.usingFeatureServiceEndpoint)throw new a(`${o}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&i)throw new a(`${o}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new a(`${o}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function V(t){const a=new e;return t.attributes||(t.attributes={}),a.geometry=t.geometry,a.attributes=t.attributes,a}async function x(e,t){const{infoFor3D:r}=t;if(null==r)return;if(!b(r))throw new a(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:s}=e;for(const a of e.addFeatures??[])z(a)&&s.push(a);for(const a of e.updateFeatures??[])z(a)&&s.push(a)}function z(e){return"mesh"===e?.geometry?.type}function C(e,t,r,s){if(!A(t))throw new a(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new a(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}export{$ as applyEdits,D as checkEditingCapabilities,M as normalizeCollections,G as normalizeEdits,B as processGeometries,V as shallowCloneFeature,C as uploadAssets};
@@ -1122,6 +1122,9 @@ export default class Sublayer extends SublayerSuperclass {
1122
1122
  * Reloads the properties for the sublayer.
1123
1123
  * Use this function after modifying the sublayer's [url](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Sublayer/#url) after it was loaded.
1124
1124
  *
1125
+ * > [!WARNING]
1126
+ * > Note: If replacing a [MapImageLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/MapImageLayer/) sublayer with a new [url](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Sublayer/#url) and then calling `reload`, the new layer must have the same schema as the the sublayer's map service.
1127
+ *
1125
1128
  * @param options - An object with the following properties.
1126
1129
  * @returns A promise that resolves when the sublayer is reloaded.
1127
1130
  * @since 4.34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.0.0-next.130",
3
+ "version": "5.0.0-next.131",
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": [
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../config.js";import{id as s}from"../../kernel.js";import r from"../../request.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import{IdentifiableMixin as o}from"../../core/Identifiable.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import{clone as l}from"../../core/lang.js";import{Loadable as u}from"../../core/Loadable.js";import{throwIfAborted as d,throwIfAbortError as p}from"../../core/promiseUtils.js";import{property as c,subclass as m}from"../../core/accessorSupport/decorators.js";import y from"../../geometry/SpatialReference.js";import{curveTypeDict as h}from"../../geometry/support/typeUtils.js";import{getFeatureJSON as f,getFeatureIds as b,getAttachmentEditsJSON as v,isProtectedOrPrivateVersionError as g,unpackEditResultData as j,createEditedFeatures as S}from"../../layers/graphics/applyEditsUtils.js";import{checkEditingCapabilities as C,normalizeEdits as T,processGeometries as A}from"../../layers/graphics/editingSupport.js";import{emitApplyEditsEvent as E}from"../../layers/mixins/EditBusLayer.js";import{isHostedAgolService as F}from"../../layers/support/arcgisLayerUrl.js";import{ensureCredentialIfSignedIn as O}from"../../layers/support/featureLayerUtils.js";import{getOwningPortalUrl as I}from"../../layers/support/layerUtils.js";import{getFeatureLayerCapabilities as w,allCurveTypes as R}from"../../layers/support/serviceCapabilitiesUtils.js";import U from"../../portal/PortalItem.js";import{getUserPrivileges as P}from"../../portal/support/portalItemUtils.js";import{isSecureProxyService as D}from"../../portal/support/urlUtils.js";import{parseUrl as V,asValidOptions as G,encode as _}from"../utils.js";import{unapplyEditsZUnitScaling as k}from"../query/operations/editsZScale.js";import{readBoolean as x,readNumber as M}from"../support/jsonUtils.js";import{isSafeToEditVersion as N,isVersionInEditSession as L,currentSessionId as J}from"../../versionManagement/support/versionManagementUtils.js";import{reader as Q}from"../../core/accessorSupport/decorators/reader.js";function q(e,t){const s=t.id;return{id:s,name:t.name,url:`${e}/${s}`,type:t.type||"Table"}}function H(e){return{data:W(e),sync:K(e),operations:B(e.capabilities,e),query:$(e),editing:Z(e)}}function W(e){const t=x(e,"supportsTrueCurve",!1);return{isDataVersioned:x(e,"hasVersionedData",!1),isDataBranchVersioned:x(e,"hasBranchVersionedData",!1),supportsTrueCurve:t,supportedCurveTypes:X(e,t)}}function B(e,t){const s=e?e.toLowerCase().split(",").map(e=>e.trim()):[],r=s.includes("query"),i=s.includes("editing")&&!t.datesInUnknownTimezone;let a=i&&s.includes("create"),o=i&&s.includes("delete"),n=i&&s.includes("update");return i&&!(a||o||n)&&(a=o=n=!0),{supportsAdd:a,supportsDelete:o,supportsEditing:i,supportsChangeTracking:s.includes("changetracking"),supportsQuery:r,supportsQueryDataElements:x(t,"supportsQueryDataElements",!1),supportsQueryDomains:x(t,"supportsQueryDomains",!1),supportsQueryContingentValues:x(t,"supportsQueryContingentValues",!1),supportsSync:s.includes("sync"),supportsUpdate:n}}function $(e){return{maxRecordCountFactor:M(e,"maxRecordCountFactor",void 0),maxRecordCount:M(e,"maxRecordCount",void 0),supportsTrueCurveWithPBF:z(e)}}function z(e){return!!Array.isArray(e.supportedTrueCurvePbfFeatureEncodings)&&e.supportedTrueCurvePbfFeatureEncodings.includes("esriDefault")}function Z(e){const t=e?.advancedEditingCapabilities;return{supportsAsyncApplyEdits:x(t,"supportsAsyncApplyEdits",!1),supportsGlobalId:x(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:x(t,"supportsReturnServiceEditsInSourceSR",!1),supportsSharedTemplates:x(e,"supportsSharedTemplates",!1)||x(e,"hasSharedTemplates",!1),supportsSplit:x(t,"supportsSplit",!1),supportsTrueCurveUpdate:x(e,"allowTrueCurvesUpdates",!1),supportsTrueCurveUpdateByTrueCurveClientsOnly:x(e,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0)}}function K(e){const t=e?.syncCapabilities,s=t?.supportedSyncDataOptions;return{supportsAsync:x(t,"supportsAsync",!1),supportedSyncDataOptions:{annotations:!(1&~s),dimensions:!(2&~s),contingentValues:!(4&~s),attributeRules:!(8&~s),utilityNetworkSystem:!(16&~s),annotationFullModel:!(32&~s),include3DObjects:!(64&~s),utilityNetworkMissingLayers:!(128&~s),preserveTrueCurves:!(256&~s)}}}function X(e,t){return Array.isArray(e.supportedCurveTypes)?e.supportedCurveTypes.map(e=>h.fromJSON(e)).filter(i):t?R:[]}let Y=class extends(n(o(u))){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.userTypeExtensions=[],this.layerInfos=null,this.tableInfos=null,this.capabilities=null,this._layerTableIndex=new Map,this._xyToleranceCache=new Map}read(e,t){this.sourceJSON=e,super.read(e,t)}get utilityNetworkUrl(){if(this.sourceJSON)for(const e of this.sourceJSON.layers)if("Utility Network Layer"===e.type)return`${this.url}/${e.id}`;return null}get versionManagementServiceUrl(){return this.sourceJSON?.hasBranchVersionedData&&!D(this.url)?this.url.replace(/\/FeatureServer/i,"/VersionManagementServer"):null}readLayerInfos(e,t){return(t.layers||[]).map(e=>{const{type:t,geometryType:s}=e;return{...q(this.url,e),type:t||"Feature Layer",geometryType:s}})}readTableInfos(e,t){return(t.tables||[]).map(e=>q(this.url,e))}readCapabilities(e,t){return H(t)}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=l(e),{operations:s}=t;return this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=!0,t):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=!0),t)}get loaded(){return super.loaded}get _isHostedAgolService(){return F(this.url)}load(e){return this.addResolvingPromise(this._fetchService(this.url,e).then(()=>this._setUserPrivileges(e))),Promise.resolve(this)}async fetchAllLayersAndTables(e){return await this.load(e),this._fetchLayersAndTablesPromise||=this._fetchLayersAndTables(this.url),d(e),this._fetchLayersAndTablesPromise}async applyEdits(e,t){let s=null;try{const{results:r,edits:i,editedFeatures:a}=await this._internalApplyEdits(e,t),o=e=>e.filter(e=>!e.error).map(l);let n=0;return r.map(e=>{s=E(this.url,e.id,t?.gdbVersion,!0);const r={edits:i[n],addedFeatures:o(e.addFeatureResults),updatedFeatures:o(e.updateFeatureResults),deletedFeatures:o(e.deleteFeatureResults),addedAttachments:o(e.addAttachmentResults),updatedAttachments:o(e.updateAttachmentResults),deletedAttachments:o(e.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:e.editMoment?new Date(e.editMoment):null};n+=1,a.length>0&&(r.editedFeatures=a),s.resolve(r),s=null}),r}catch(r){throw s&&s.reject(r),r}}async _setUserPrivileges(e){if(t.userPrivilegesApplied)try{const{features:{fullEdit:t},content:{updateItem:s}}=await this._fetchUserPrivileges(this.sourceJSON.serviceItemId,e);this._set("userHasFullEditingPrivileges",t),this._set("userHasUpdateItemPrivileges",s)}catch(s){p(s)}}async _fetchUserPrivileges(e,t){const r=!0,i=!1,a=!1;if(!e)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};let o,n,l;try{o=await I(this.url,t)}catch(u){p(u)}try{const e=null!=t?t.signal:null;n=await(s?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(u){p(u)}if(!n)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};try{if(l=new U({id:e,portal:{url:o}}),await l.load(t),l.portal.user)return P(l)}catch(u){p(u)}return{features:{edit:r,fullEdit:i},content:{updateItem:a}}}async _internalApplyEdits(e,t){await O(this.url);const s=t?.globalIdUsed??!1,a=y.fromJSON(this.sourceJSON.spatialReference),{edits:o,options:n}=await this._processApplyEditsParams(e,t),l=await Promise.all(o.map(async e=>{const t=e.addFeatures?.map(e=>f({spatialReference:a},e,null))??[],r=(await Promise.all(t)).filter(i),o=r.length>0?r:null,n=e.updateFeatures?.map(e=>f({spatialReference:a},e,null))??[],l=(await Promise.all(n)).filter(i),u=l.length>0?l:null,d=b(e.identifierFields,e.deleteFeatures,s),p=d.length>0?d:null;k(o,u,a);const c=await v(e.identifierFields,e);let m=null;if(c){m={adds:c.adds.length>0?c.adds:void 0,updates:c.updates.length>0?c.updates:void 0,deletes:c.deletes.length>0?c.deletes:void 0}}const y={};return e.deleteAssociations&&(y.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(y.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(y.divideGroupedObjects=e.divideGroupedObjects),{id:e.id,adds:o,updates:u,deletes:p,attachments:m,...y}})),u={gdbVersion:n?.gdbVersion,rollbackOnFailure:!0,useGlobalIds:s,returnEditMoment:!0,honorSequenceOfEdits:n?.honorSequenceOfEdits,trueCurveClient:n?.editsRespectTrueCurves,usePreviousEditMoment:n?.usePreviousEditMoment,returnServiceEditsInSourceSR:!1,returnServiceEditsOption:"originalAndCurrentFeatures",async:!1};await N(this.url,t?.gdbVersion,!0);const d=L(this.url,t?.gdbVersion||null);u.edits=JSON.stringify(l);const p=V(this.url),c=G(p.query,{query:_({...u,f:"json"}),method:"post"});let m;d&&(c.authMode="immediate",c.query.sessionId=J);try{m=await r(this.url+"/applyEdits",c)}catch(h){if(!g(h))throw h;c.authMode="immediate",m=await r(this.url+"/applyEdits",c)}return{...ee(m),edits:o}}async _processApplyEditsParams(e,t){const s={...t,usingFeatureServiceEndpoint:!0,usingTelecomOperations:e.some(e=>e.deleteAssociations||e.combineGroupedObjects||e.divideGroupedObjects)};return{edits:await Promise.all(e.map(async e=>{const t=this.effectiveCapabilities,r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),i=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments);if(C(e,t,s,!!r,!!i,"feature-service"),!t.data.isDataVersioned&&s?.gdbVersion)throw new a("feature-service:invalid-parameter","'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isDataVersioned'");const o=T(e,t,"feature-service"),n={};if(e.deleteAssociations&&(n.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(n.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(n.divideGroupedObjects=e.divideGroupedObjects),!e.identifierFields){await this.fetchAllLayersAndTables();const t=this._layerTableIndex.get(e.id);t&&(e.identifierFields={globalIdField:t.globalIdField,objectIdField:t.objectIdField})}const l=await A(o,t.data.supportedCurveTypes,this._isHostedAgolService,this._xyToleranceCache);return{id:e.id,...l,...n,identifierFields:e.identifierFields}})),options:s}}async _fetchService(e,t){if(this.sourceJSON)return void this.read(this.sourceJSON,{url:V(e)});const s=await r(e,{responseType:"json",query:{f:"json"},...t});this.read(s.data,{url:V(e)})}async _fetchLayersAndTables(e){const t=`${e}/layers`,s=await r(t,{responseType:"json",query:{f:"json"}});return{layers:s.data.layers.map(e=>{const{type:t,geometryType:s}=e,r=q(this.url,e),i=w(e,r.url);return this._layerTableIndex.set(e.id,e),{...r,type:t||"Feature Layer",geometryType:s,capabilities:i}}),tables:s.data.tables.map(e=>{const t=q(this.url,e),s=w(e,t.url);return this._layerTableIndex.set(e.id,e),{...t,capabilities:s}})}}};function ee(e){const t=e.data,s=[];return{results:t.map(e=>{const t={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment},r=j(t),i=e.editedFeatures,a=i?.spatialReference?new y({wkid:i?.spatialReference.wkid,wkt:i?.spatialReference.wkt,latestWkid:i?.spatialReference.latestWkid,latestVcsWkid:i?.spatialReference.latestVcsWkid,vcsWkid:i?.spatialReference.vcsWkid}):null,o=i?S(i,a):null;o&&s.push({layerId:e.id,editedFeatures:o});const n={};return e.divideGroupedObjectResults&&(n.divideGroupedObjectResults=e.divideGroupedObjectResults),e.combineGroupedObjectResults&&(n.combineGroupedObjectResults=e.combineGroupedObjectResults),{id:e.id,editedFeatures:o,...r,...n}}),editedFeatures:s}}e([c()],Y.prototype,"url",void 0),e([c()],Y.prototype,"sourceJSON",void 0),e([c()],Y.prototype,"userHasFullEditingPrivileges",void 0),e([c()],Y.prototype,"userHasUpdateItemPrivileges",void 0),e([c({readOnly:!0})],Y.prototype,"utilityNetworkUrl",null),e([c({readOnly:!0})],Y.prototype,"versionManagementServiceUrl",null),e([c()],Y.prototype,"userTypeExtensions",void 0),e([c({json:{read:{source:["layers"]}}})],Y.prototype,"layerInfos",void 0),e([Q("layerInfos",["layers"])],Y.prototype,"readLayerInfos",null),e([c({json:{read:{source:["tables"]}}})],Y.prototype,"tableInfos",void 0),e([Q("tableInfos",["tables"])],Y.prototype,"readTableInfos",null),e([c({readOnly:!0,json:{read:{source:["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"]}}})],Y.prototype,"capabilities",void 0),e([Q("capabilities",["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"])],Y.prototype,"readCapabilities",null),e([c({readOnly:!0})],Y.prototype,"effectiveCapabilities",null),e([c()],Y.prototype,"_isHostedAgolService",null),Y=e([m("esri.rest.featureService.FeatureService")],Y);const te=Y;export{te as default};
2
+ import{__decorate as e}from"tslib";import t from"../../config.js";import{id as s}from"../../kernel.js";import r from"../../request.js";import{isSome as i}from"../../core/arrayUtils.js";import a from"../../core/Error.js";import{IdentifiableMixin as o}from"../../core/Identifiable.js";import{JSONSupportMixin as n}from"../../core/JSONSupport.js";import{clone as l}from"../../core/lang.js";import{Loadable as u}from"../../core/Loadable.js";import{throwIfAborted as d,throwIfAbortError as p}from"../../core/promiseUtils.js";import{property as c,subclass as m}from"../../core/accessorSupport/decorators.js";import y from"../../geometry/SpatialReference.js";import{curveTypeDict as h}from"../../geometry/support/typeUtils.js";import{getFeatureJSON as f,getFeatureIds as b,getAttachmentEditsJSON as v,isProtectedOrPrivateVersionError as g,unpackEditResultData as j,createEditedFeatures as S}from"../../layers/graphics/applyEditsUtils.js";import{checkEditingCapabilities as C,normalizeEdits as T,processGeometries as A}from"../../layers/graphics/editingSupport.js";import{emitApplyEditsEvent as E}from"../../layers/mixins/EditBusLayer.js";import{ensureCredentialIfSignedIn as F}from"../../layers/support/featureLayerUtils.js";import{getOwningPortalUrl as O}from"../../layers/support/layerUtils.js";import{getFeatureLayerCapabilities as I,allCurveTypes as w}from"../../layers/support/serviceCapabilitiesUtils.js";import R from"../../portal/PortalItem.js";import{getUserPrivileges as U}from"../../portal/support/portalItemUtils.js";import{isSecureProxyService as P}from"../../portal/support/urlUtils.js";import{parseUrl as D,asValidOptions as V,encode as G}from"../utils.js";import{unapplyEditsZUnitScaling as k}from"../query/operations/editsZScale.js";import{readBoolean as _,readNumber as x}from"../support/jsonUtils.js";import{isSafeToEditVersion as M,isVersionInEditSession as N,currentSessionId as L}from"../../versionManagement/support/versionManagementUtils.js";import{reader as J}from"../../core/accessorSupport/decorators/reader.js";function Q(e,t){const s=t.id;return{id:s,name:t.name,url:`${e}/${s}`,type:t.type||"Table"}}function q(e){return{data:W(e),sync:Z(e),operations:B(e.capabilities,e),query:H(e),editing:z(e)}}function W(e){const t=_(e,"supportsTrueCurve",!1);return{isDataVersioned:_(e,"hasVersionedData",!1),isDataBranchVersioned:_(e,"hasBranchVersionedData",!1),supportsTrueCurve:t,supportedCurveTypes:K(e,t)}}function B(e,t){const s=e?e.toLowerCase().split(",").map(e=>e.trim()):[],r=s.includes("query"),i=s.includes("editing")&&!t.datesInUnknownTimezone;let a=i&&s.includes("create"),o=i&&s.includes("delete"),n=i&&s.includes("update");return i&&!(a||o||n)&&(a=o=n=!0),{supportsAdd:a,supportsDelete:o,supportsEditing:i,supportsChangeTracking:s.includes("changetracking"),supportsQuery:r,supportsQueryDataElements:_(t,"supportsQueryDataElements",!1),supportsQueryDomains:_(t,"supportsQueryDomains",!1),supportsQueryContingentValues:_(t,"supportsQueryContingentValues",!1),supportsSync:s.includes("sync"),supportsUpdate:n}}function H(e){return{maxRecordCountFactor:x(e,"maxRecordCountFactor",void 0),maxRecordCount:x(e,"maxRecordCount",void 0),supportsTrueCurveWithPBF:$(e)}}function $(e){return!!Array.isArray(e.supportedTrueCurvePbfFeatureEncodings)&&e.supportedTrueCurvePbfFeatureEncodings.includes("esriDefault")}function z(e){const t=e?.advancedEditingCapabilities;return{supportsAsyncApplyEdits:_(t,"supportsAsyncApplyEdits",!1),supportsGlobalId:_(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:_(t,"supportsReturnServiceEditsInSourceSR",!1),supportsSharedTemplates:_(e,"supportsSharedTemplates",!1)||_(e,"hasSharedTemplates",!1),supportsSplit:_(t,"supportsSplit",!1),supportsTrueCurveUpdate:_(e,"allowTrueCurvesUpdates",!1),supportsTrueCurveUpdateByTrueCurveClientsOnly:_(e,"onlyAllowTrueCurveUpdatesByTrueCurveClients",!0)}}function Z(e){const t=e?.syncCapabilities,s=t?.supportedSyncDataOptions;return{supportsAsync:_(t,"supportsAsync",!1),supportedSyncDataOptions:{annotations:!(1&~s),dimensions:!(2&~s),contingentValues:!(4&~s),attributeRules:!(8&~s),utilityNetworkSystem:!(16&~s),annotationFullModel:!(32&~s),include3DObjects:!(64&~s),utilityNetworkMissingLayers:!(128&~s),preserveTrueCurves:!(256&~s)}}}function K(e,t){return Array.isArray(e.supportedCurveTypes)?e.supportedCurveTypes.map(e=>h.fromJSON(e)).filter(i):t?w:[]}let X=class extends(n(o(u))){constructor(e){super(e),this.url=null,this.sourceJSON=null,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.userTypeExtensions=[],this.layerInfos=null,this.tableInfos=null,this.capabilities=null,this._layerTableIndex=new Map,this._xyToleranceCache=new Map}read(e,t){this.sourceJSON=e,super.read(e,t)}get utilityNetworkUrl(){if(this.sourceJSON)for(const e of this.sourceJSON.layers)if("Utility Network Layer"===e.type)return`${this.url}/${e.id}`;return null}get versionManagementServiceUrl(){return this.sourceJSON?.hasBranchVersionedData&&!P(this.url)?this.url.replace(/\/FeatureServer/i,"/VersionManagementServer"):null}readLayerInfos(e,t){return(t.layers||[]).map(e=>{const{type:t,geometryType:s}=e;return{...Q(this.url,e),type:t||"Feature Layer",geometryType:s}})}readTableInfos(e,t){return(t.tables||[]).map(e=>Q(this.url,e))}readCapabilities(e,t){return q(t)}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=l(e),{operations:s}=t;return this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=!0,t):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=!0),t)}get loaded(){return super.loaded}load(e){return this.addResolvingPromise(this._fetchService(this.url,e).then(()=>this._setUserPrivileges(e))),Promise.resolve(this)}async fetchAllLayersAndTables(e){return await this.load(e),this._fetchLayersAndTablesPromise||=this._fetchLayersAndTables(this.url),d(e),this._fetchLayersAndTablesPromise}async applyEdits(e,t){let s=null;try{const{results:r,edits:i,editedFeatures:a}=await this._internalApplyEdits(e,t),o=e=>e.filter(e=>!e.error).map(l);let n=0;return r.map(e=>{s=E(this.url,e.id,t?.gdbVersion,!0);const r={edits:i[n],addedFeatures:o(e.addFeatureResults),updatedFeatures:o(e.updateFeatureResults),deletedFeatures:o(e.deleteFeatureResults),addedAttachments:o(e.addAttachmentResults),updatedAttachments:o(e.updateAttachmentResults),deletedAttachments:o(e.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:e.editMoment?new Date(e.editMoment):null};n+=1,a.length>0&&(r.editedFeatures=a),s.resolve(r),s=null}),r}catch(r){throw s&&s.reject(r),r}}async _setUserPrivileges(e){if(t.userPrivilegesApplied)try{const{features:{fullEdit:t},content:{updateItem:s}}=await this._fetchUserPrivileges(this.sourceJSON.serviceItemId,e);this._set("userHasFullEditingPrivileges",t),this._set("userHasUpdateItemPrivileges",s)}catch(s){p(s)}}async _fetchUserPrivileges(e,t){const r=!0,i=!1,a=!1;if(!e)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};let o,n,l;try{o=await O(this.url,t)}catch(u){p(u)}try{const e=null!=t?t.signal:null;n=await(s?.getCredential(`${o}/sharing`,{prompt:!1,signal:e}))}catch(u){p(u)}if(!n)return{features:{edit:r,fullEdit:i},content:{updateItem:a}};try{if(l=new R({id:e,portal:{url:o}}),await l.load(t),l.portal.user)return U(l)}catch(u){p(u)}return{features:{edit:r,fullEdit:i},content:{updateItem:a}}}async _internalApplyEdits(e,t){await F(this.url);const s=t?.globalIdUsed??!1,a=y.fromJSON(this.sourceJSON.spatialReference),{edits:o,options:n}=await this._processApplyEditsParams(e,t),l=await Promise.all(o.map(async e=>{const t=e.addFeatures?.map(e=>f({spatialReference:a},e,null))??[],r=(await Promise.all(t)).filter(i),o=r.length>0?r:null,n=e.updateFeatures?.map(e=>f({spatialReference:a},e,null))??[],l=(await Promise.all(n)).filter(i),u=l.length>0?l:null,d=b(e.identifierFields,e.deleteFeatures,s),p=d.length>0?d:null;k(o,u,a);const c=await v(e.identifierFields,e);let m=null;if(c){m={adds:c.adds.length>0?c.adds:void 0,updates:c.updates.length>0?c.updates:void 0,deletes:c.deletes.length>0?c.deletes:void 0}}const y={};return e.deleteAssociations&&(y.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(y.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(y.divideGroupedObjects=e.divideGroupedObjects),{id:e.id,adds:o,updates:u,deletes:p,attachments:m,...y}})),u={gdbVersion:n?.gdbVersion,rollbackOnFailure:!0,useGlobalIds:s,returnEditMoment:!0,honorSequenceOfEdits:n?.honorSequenceOfEdits,trueCurveClient:n?.editsRespectTrueCurves,usePreviousEditMoment:n?.usePreviousEditMoment,returnServiceEditsInSourceSR:!1,returnServiceEditsOption:"originalAndCurrentFeatures",async:!1};await M(this.url,t?.gdbVersion,!0);const d=N(this.url,t?.gdbVersion||null);u.edits=JSON.stringify(l);const p=D(this.url),c=V(p.query,{query:G({...u,f:"json"}),method:"post"});let m;d&&(c.authMode="immediate",c.query.sessionId=L);try{m=await r(this.url+"/applyEdits",c)}catch(h){if(!g(h))throw h;c.authMode="immediate",m=await r(this.url+"/applyEdits",c)}return{...Y(m),edits:o}}async _processApplyEditsParams(e,t){const s={...t,usingFeatureServiceEndpoint:!0,usingTelecomOperations:e.some(e=>e.deleteAssociations||e.combineGroupedObjects||e.divideGroupedObjects)};return{edits:await Promise.all(e.map(async e=>{const t=this.effectiveCapabilities,r=e&&(e.addFeatures||e.updateFeatures||e.deleteFeatures),i=e&&(e.addAttachments||e.updateAttachments||e.deleteAttachments);if(C(e,t,s,!!r,!!i,"feature-service"),!t.data.isDataVersioned&&s?.gdbVersion)throw new a("feature-service:invalid-parameter","'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isDataVersioned'");const o=T(e,t,"feature-service"),n={};if(e.deleteAssociations&&(n.deleteAssociations=e.deleteAssociations),e.combineGroupedObjects&&(n.combineGroupedObjects=e.combineGroupedObjects),e.divideGroupedObjects&&(n.divideGroupedObjects=e.divideGroupedObjects),!e.identifierFields){await this.fetchAllLayersAndTables();const t=this._layerTableIndex.get(e.id);t&&(e.identifierFields={globalIdField:t.globalIdField,objectIdField:t.objectIdField})}const l=await A(o,t.data.supportedCurveTypes,this._xyToleranceCache);return{id:e.id,...l,...n,identifierFields:e.identifierFields}})),options:s}}async _fetchService(e,t){if(this.sourceJSON)return void this.read(this.sourceJSON,{url:D(e)});const s=await r(e,{responseType:"json",query:{f:"json"},...t});this.read(s.data,{url:D(e)})}async _fetchLayersAndTables(e){const t=`${e}/layers`,s=await r(t,{responseType:"json",query:{f:"json"}});return{layers:s.data.layers.map(e=>{const{type:t,geometryType:s}=e,r=Q(this.url,e),i=I(e,r.url);return this._layerTableIndex.set(e.id,e),{...r,type:t||"Feature Layer",geometryType:s,capabilities:i}}),tables:s.data.tables.map(e=>{const t=Q(this.url,e),s=I(e,t.url);return this._layerTableIndex.set(e.id,e),{...t,capabilities:s}})}}};function Y(e){const t=e.data,s=[];return{results:t.map(e=>{const t={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment},r=j(t),i=e.editedFeatures,a=i?.spatialReference?new y({wkid:i?.spatialReference.wkid,wkt:i?.spatialReference.wkt,latestWkid:i?.spatialReference.latestWkid,latestVcsWkid:i?.spatialReference.latestVcsWkid,vcsWkid:i?.spatialReference.vcsWkid}):null,o=i?S(i,a):null;o&&s.push({layerId:e.id,editedFeatures:o});const n={};return e.divideGroupedObjectResults&&(n.divideGroupedObjectResults=e.divideGroupedObjectResults),e.combineGroupedObjectResults&&(n.combineGroupedObjectResults=e.combineGroupedObjectResults),{id:e.id,editedFeatures:o,...r,...n}}),editedFeatures:s}}e([c()],X.prototype,"url",void 0),e([c()],X.prototype,"sourceJSON",void 0),e([c()],X.prototype,"userHasFullEditingPrivileges",void 0),e([c()],X.prototype,"userHasUpdateItemPrivileges",void 0),e([c({readOnly:!0})],X.prototype,"utilityNetworkUrl",null),e([c({readOnly:!0})],X.prototype,"versionManagementServiceUrl",null),e([c()],X.prototype,"userTypeExtensions",void 0),e([c({json:{read:{source:["layers"]}}})],X.prototype,"layerInfos",void 0),e([J("layerInfos",["layers"])],X.prototype,"readLayerInfos",null),e([c({json:{read:{source:["tables"]}}})],X.prototype,"tableInfos",void 0),e([J("tableInfos",["tables"])],X.prototype,"readTableInfos",null),e([c({readOnly:!0,json:{read:{source:["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"]}}})],X.prototype,"capabilities",void 0),e([J("capabilities",["hasVersionedData","hasSharedTemplates","hasBranchVersionedData","capabilities","supportsQueryDataElements","supportsQueryDomains","supportsQueryContingentValues","maxRecordCountFactor","maxRecordCount","advancedEditingCapabilities","supportsApplyEditsWithGlobalIds","syncCapabilities","datesInUnknownTimezone"])],X.prototype,"readCapabilities",null),e([c({readOnly:!0})],X.prototype,"effectiveCapabilities",null),X=e([m("esri.rest.featureService.FeatureService")],X);const ee=X;export{ee as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- import{convertDateTimeFieldFormatToIntlOptions as t,convertDateFormatToIntlOptions as e,formatDate as n,formatTimestamp as r,formatTimeOnly as o,formatDateOnly as i}from"../../intl/date.js";import{isDateField as s,isDateOnlyField as a,isTimestampOffsetField as l}from"../../layers/support/fieldUtils.js";import{getWellKnownBasemapId as u}from"../../support/basemapUtils.js";import{loadArcade as f}from"../../support/loadArcade.js";import{utc as c}from"../../time/constants.js";import{getTimeZoneFormattingOptions as m}from"../../time/timeZoneUtils.js";const d=",",p={light:["streets","gray","topo","terrain","oceans","osm","gray-vector","streets-vector","topo-vector","streets-relief-vector","streets-navigation-vector","topo-3d","navigation-3d","streets-3d","osm-3d","gray-3d"],dark:["satellite","hybrid","dark-gray","dark-gray-vector","streets-night-vector","navigation-dark-3d","streets-dark-3d","dark-gray-3d"]},g="percent-of-total",y="field",h={exclude:["median"]},v={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864e5},T=new Set(["integer","small-integer"]);let w,Z=null;const $=["date","date-only","timestamp-offset"];function C(t){return s(t)||a(t)||l(t)}async function U(t,e){if(!t)return null;if(!w){const t=await import("../../core/sql/WhereClauseCache.js").then(t=>t.WhereClauseCache);w=new t(50,500)}return w.get(t,e)}async function S(t){const{field:e,field2:n,field3:r,normalizationField:o,valueExpression:i,fields:s}=t;let a=[];if(i){if(!Z){const{arcadeUtils:t}=await f();Z=t}a=Z.extractFieldNames(i)}return e&&a.push(e),n&&a.push(n),r&&a.push(r),o&&a.push(o),s&&a.push(...s),a}async function F(t,e){const n=[];for(const r of t)if(r){const t=await U(r,e),o=t?.fieldNames;o&&n.push(...o)}return[...new Set(n)]}function j(t){let e=t.normalizationType;return e||(t.normalizationField?e=y:null!=t.normalizationTotal&&(e=g)),e??void 0}function k(t){return String(t).padStart(2,"0")}function D(t,e,n){let r;if("date"===e||"number"===e){"number"===e&&(t=new Date(t));r=`TIMESTAMP'${n?t.getFullYear():t.getUTCFullYear()}-${k((n?t.getMonth():t.getUTCMonth())+1)}-${k(n?t.getDate():t.getUTCDate())} ${k(n?t.getHours():t.getUTCHours())}:${k(n?t.getMinutes():t.getUTCMinutes())}:${k(n?t.getSeconds():t.getUTCSeconds())}'`}else r=t;return r}function N(t,e,n,r){const{hasQueryEngine:o}=t,i=`(${D(n,b(t,n),o)} - ${D(e,b(t,e),o)})`;let s=v[r],a="/";s<1&&(s=1/s,a="*");return{sqlExpression:1===s?i:`(${i} ${a} ${s})`,sqlWhere:null}}function b(t,e){if(e instanceof Date)return"date";if("number"==typeof e)return"number";if("string"==typeof e){const n=t.getField(e);if("<now>"===e.toLowerCase())return;if(s(n))return"field"}}function M(t,e=p){for(const n in e)if(e[n].includes(t))return n}function x(t,e,n=!0){let r=null;return t&&("string"==typeof t?e.includes(t)&&(r=t):r=u(t)),n?r||"gray":r}function z(t,e){const n=e&&t.getField(e);return!!n&&T.has(n.type)}function E(t){return`cast(${t} as float)`}function q(s,a){const{format:l,fieldFormat:u,timeZoneOptions:f,fieldType:d}=a??{},p=u?t(u):null;let g,y;if(f&&({timeZone:g,timeZoneName:y}=m(f.layerTimeZone,f.datesInUnknownTimezone,f.viewTimeZone,p||e(l||"short-date-short-time"),d)),"string"==typeof s&&isNaN(Date.parse("time-only"===d?`1970-01-01T${s}Z`:s)))return s;switch(d){case"date-only":{const t=p||e(l||"short-date");return"string"==typeof s?i(s,{...t}):n(s,{...t,timeZone:c})}case"time-only":{const t=p||e(l||"short-time");return"string"==typeof s?o(s,t):n(s,{...t,timeZone:c})}case"timestamp-offset":{if(!g&&"string"==typeof s&&new Date(s).toISOString()!==s)return s;const t=l||p||f?p||e(l||"short-date-short-time"):void 0,o=t?{...t,timeZone:g,timeZoneName:y}:void 0;return"string"==typeof s?r(s,o):n(s,o)}default:{const t=l||p||f?p||e(l||"short-date-short-time"):void 0;return n("string"==typeof s?new Date(s):s,t?{...t,timeZone:g,timeZoneName:y}:void 0)}}}export{E as castIntegerFieldToFloat,$ as dateTypes,p as defaultBasemapGroups,h as defaultStatisticTypes,d as fieldDelimiter,q as formatAnyDate,M as getBasemapGroup,x as getBasemapId,N as getDateDiffSQL,b as getDateType,F as getFieldsFromWhereClauses,S as getFieldsList,j as getNormalizationType,U as getWhereClause,C as isAnyDateField,z as isIntegerField,v as unitValueInDays};
2
+ import{convertDateTimeFieldFormatToIntlOptions as t,convertDateFormatToIntlOptions as e,formatDate as n,formatTimestamp as o,formatTimeOnly as r,formatDateOnly as i}from"../../intl/date.js";import{isDateField as s,isDateOnlyField as a,isTimestampOffsetField as l}from"../../layers/support/fieldUtils.js";import{getWellKnownBasemapId as u}from"../../support/basemapUtils.js";import{loadArcade as c}from"../../support/loadArcade.js";import{utc as f}from"../../time/constants.js";import{getTimeZoneFormattingOptions as d}from"../../time/timeZoneUtils.js";const m=",",p={light:["streets","gray","topo","terrain","oceans","osm","gray-vector","streets-vector","topo-vector","streets-relief-vector","streets-navigation-vector","topo-3d","navigation-3d","streets-3d","osm-3d","gray-3d"],dark:["satellite","hybrid","dark-gray","dark-gray-vector","streets-night-vector","navigation-dark-3d","streets-dark-3d","dark-gray-3d"]},g="percent-of-total",h="field",y={exclude:["median"]},v={years:365,months:30,days:1,hours:1/24,minutes:1/1440,seconds:1/86400,milliseconds:1/864e5},T=new Set(["integer","small-integer"]);let w,Z=null;const $=["date","date-only","timestamp-offset"];function C(t){return s(t)||a(t)||l(t)}async function U(t,e){if(!t)return null;if(!w){const t=await import("../../core/sql/WhereClauseCache.js").then(t=>t.WhereClauseCache);w=new t(50,500)}return w.get(t,e)}async function F(t){const{field:e,field2:n,field3:o,normalizationField:r,valueExpression:i,fields:s}=t;let a=[];if(i){if(!Z){const{arcadeUtils:t}=await c();Z=t}a=Z.extractFieldNames(i)}return e&&a.push(e),n&&a.push(n),o&&a.push(o),r&&a.push(r),s&&a.push(...s),a}async function j(t,e){const n=[];for(const o of t)if(o){const t=await U(o,e),r=t?.fieldNames;r&&n.push(...r)}return[...new Set(n)]}function k(t){let e=t.normalizationType;return e||(t.normalizationField?e=h:null!=t.normalizationTotal&&(e=g)),e??void 0}function S(t){return String(t).padStart(2,"0")}function b(t,e,n){let o;if("date"===e||"number"===e){"number"===e&&(t=new Date(t));o=`TIMESTAMP'${n?t.getFullYear():t.getUTCFullYear()}-${S((n?t.getMonth():t.getUTCMonth())+1)}-${S(n?t.getDate():t.getUTCDate())} ${S(n?t.getHours():t.getUTCHours())}:${S(n?t.getMinutes():t.getUTCMinutes())}:${S(n?t.getSeconds():t.getUTCSeconds())}'`}else o=t;return o}function M(t,e,n,o){const{hasQueryEngine:r}=t,i=`(${b(n,x(t,n),r)} - ${b(e,x(t,e),r)})`;let s=v[o],a="/";s<1&&(s=1/s,a="*");return{sqlExpression:1===s?i:`(${i} ${a} ${s})`,sqlWhere:null}}function x(t,e){if(e instanceof Date)return"date";if("number"==typeof e)return"number";if("string"==typeof e){const n=t.getField(e);if("<now>"===e.toLowerCase())return;if(s(n))return"field"}}function z(t,e=p){for(const n in e)if(e[n].includes(t))return n}function D(t,e,n=!0){let o=null;return t&&("string"==typeof t?e.includes(t)&&(o=t):o=u(t)),n?o||"gray":o}function N(t,e){const n=e&&t.getField(e);return!!n&&T.has(n.type)}function E(t){return`cast(${t} as float)`}function q(s,a){const{format:l,fieldFormat:u,timeZoneOptions:c,fieldType:m}=a??{},p=u?t(u):null;let g,h;switch(c&&({timeZone:g,timeZoneName:h}=d(c.layerTimeZone,c.datesInUnknownTimezone,c.viewTimeZone,p||e(l||"short-date-short-time"),m)),m){case"date-only":{const t=p||e(l||"short-date");return"string"==typeof s?i(s,{...t}):n(s,{...t,timeZone:f})}case"time-only":{const t=p||e(l||"short-time");return"string"==typeof s?r(s,t):n(s,{...t,timeZone:f})}case"timestamp-offset":{const t=l||p||c?p||e(l||"short-date-short-time"):void 0,r=t?{...t,timeZone:g,timeZoneName:h}:void 0;return"string"==typeof s?o(s,r):n(s,r)}default:{const t=l||p||c?p||e(l||"short-date-short-time"):void 0;return n("string"==typeof s?new Date(s):s,t?{...t,timeZone:g,timeZoneName:h}:void 0)}}}export{E as castIntegerFieldToFloat,$ as dateTypes,p as defaultBasemapGroups,y as defaultStatisticTypes,m as fieldDelimiter,q as formatAnyDate,z as getBasemapGroup,D as getBasemapId,M as getDateDiffSQL,x as getDateType,j as getFieldsFromWhereClauses,F as getFieldsList,k as getNormalizationType,U as getWhereClause,C as isAnyDateField,N as isIntegerField,v as unitValueInDays};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
2
- const c="20260219",a="dc4d6bfe50db04bcc4b18f132908aa2a0597ace5";export{c as buildDate,a as commitHash};
2
+ const c="20260220",e="0ef9ef354028ec245e209cd0689c29c9745a6141";export{c as buildDate,e as commitHash};