@arcgis/core 4.30.0-next.20240319 → 4.30.0-next.20240321

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 (119) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{ef19c4fabc3682fc7aa7.js → 0b1ccc2cfb7a6361eae6.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{2d0a01d0957b3e4512f6.js → 2cc832f9f5b10817f300.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{95d7b168991ddb3a96ca.js → 2fe91a15fcdae540babe.js} +1 -1
  5. package/assets/esri/core/workers/chunks/4be6d5660ec1c8ac7606.js +1 -0
  6. package/assets/esri/core/workers/chunks/4f854e0e3a65b768f6be.js +1 -0
  7. package/assets/esri/core/workers/chunks/505f35a02ac6a67a255b.js +1 -0
  8. package/assets/esri/core/workers/chunks/{51fc02ce8cab70b363b1.js → 5162ba2975b4b025590e.js} +1 -1
  9. package/assets/esri/core/workers/chunks/51700be6f50efba0bc82.js +1 -0
  10. package/assets/esri/core/workers/chunks/{766ca6ab0d11ab637278.js → 52274afa07468bc555aa.js} +1 -1
  11. package/assets/esri/core/workers/chunks/5628fa534b2560933230.js +1 -0
  12. package/assets/esri/core/workers/chunks/689a122c77b39e5c73eb.js +1 -0
  13. package/assets/esri/core/workers/chunks/7530fef3ee217643898e.js +1 -0
  14. package/assets/esri/core/workers/chunks/75bd66a0a1b42e057c1a.js +1 -0
  15. package/assets/esri/core/workers/chunks/7819a446d3c9749ff74f.js +1 -0
  16. package/assets/esri/core/workers/chunks/7ca976273f1f64f75aa7.js +1 -0
  17. package/assets/esri/core/workers/chunks/{36d697a3788b86f24588.js → 9403e2ee9c97488ce4f0.js} +1 -1
  18. package/assets/esri/core/workers/chunks/a0de5ad1d08f511cf3d8.js +1 -0
  19. package/assets/esri/core/workers/chunks/b3cd5f8691ba0b5b5729.js +1 -0
  20. package/assets/esri/core/workers/chunks/b3d905c6b100831ad3c4.js +1 -0
  21. package/assets/esri/core/workers/chunks/{50a7742a7e7f7eda5bee.js → df38774f63984be0a478.js} +1 -1
  22. package/assets/esri/core/workers/chunks/e22a13ff683d207e0434.js +1 -0
  23. package/assets/esri/core/workers/chunks/e93cc8cdeaaf81210dc2.js +1 -0
  24. package/assets/esri/core/workers/chunks/{ac8606f2e4719c96a732.js → ee1345b212cde1ff4755.js} +1 -1
  25. package/assets/esri/core/workers/chunks/eecb0064c5343e88bfde.js +1 -0
  26. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  27. package/geometry/support/normalizeUtils.js +1 -1
  28. package/interfaces.d.ts +33 -106
  29. package/layers/SceneLayer.js +1 -1
  30. package/layers/graphics/sources/support/QueryTask.js +1 -1
  31. package/package.json +1 -1
  32. package/rest/geoprocessor/utils.js +1 -1
  33. package/rest/utils.js +1 -1
  34. package/support/revision.js +1 -1
  35. package/views/2d/AnimationManager.js +1 -1
  36. package/views/2d/FrameTask.js +1 -1
  37. package/views/2d/engine/webgl/ClippingInfo.js +1 -1
  38. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  39. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueDebugLayerView.js +1 -1
  40. package/views/2d/input/MapViewInputManager.js +1 -1
  41. package/views/2d/input/handlers/KeyPan.js +1 -1
  42. package/views/2d/input/handlers/KeyRotate.js +1 -1
  43. package/views/2d/layers/BaseDynamicLayerView2D.js +1 -1
  44. package/views/2d/layers/BaseLayerView2D.js +1 -1
  45. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  46. package/views/2d/layers/CatalogDynamicGroupLayerView2D.js +1 -1
  47. package/views/2d/layers/CatalogLayerView2D.js +1 -1
  48. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  49. package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
  50. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  51. package/views/2d/layers/GroupLayerView2D.js +1 -1
  52. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  53. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  54. package/views/2d/layers/KMLLayerView2D.js +1 -1
  55. package/views/2d/layers/KnowledgeGraphLayerView2D.js +1 -1
  56. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  57. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  58. package/views/2d/layers/MediaLayerView2D.js +1 -1
  59. package/views/2d/layers/RouteLayerView2D.js +1 -1
  60. package/views/2d/layers/TileLayerView2D.js +1 -1
  61. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  62. package/views/2d/layers/VideoLayerView2D.js +1 -1
  63. package/views/2d/layers/WMSLayerView2D.js +1 -1
  64. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  65. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  66. package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
  67. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  68. package/views/2d/navigation/MapViewNavigation.js +1 -1
  69. package/views/2d/navigation/ZoomBox.js +1 -1
  70. package/views/2d/navigation/actions/Pan.js +1 -1
  71. package/views/2d/navigation/actions/Pinch.js +1 -1
  72. package/views/2d/support/clippingUtils.js +5 -0
  73. package/views/2d/support/hitTestUtils.js +1 -1
  74. package/views/2d/viewpointUtils.js +1 -1
  75. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  76. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  77. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  78. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  79. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  80. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  81. package/views/3d/layers/graphics/Labeler.js +1 -1
  82. package/views/3d/layers/graphics/labelPlacement.js +1 -1
  83. package/views/3d/terrain/TerrainRenderer.js +1 -1
  84. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  85. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  86. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  87. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  88. package/views/draw/DrawOperation.js +1 -1
  89. package/views/input/InputManager.js +1 -1
  90. package/views/input/keys.js +1 -1
  91. package/views/interactive/snapping/SnappingManager.js +1 -1
  92. package/widgets/BasemapLayerList.js +1 -1
  93. package/widgets/Editor/workflowUtils.js +1 -1
  94. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  95. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  96. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  97. package/widgets/FeatureTable.js +1 -1
  98. package/widgets/LayerList.js +1 -1
  99. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  100. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  101. package/widgets/OrientedImageryViewer.js +1 -1
  102. package/widgets/Popup.js +1 -1
  103. package/widgets/TableList.js +1 -1
  104. package/assets/esri/core/workers/chunks/13b6de78894ba1a70ace.js +0 -1
  105. package/assets/esri/core/workers/chunks/17a33c1eca0f2908b1a1.js +0 -1
  106. package/assets/esri/core/workers/chunks/187e056c251e69c9b5d2.js +0 -1
  107. package/assets/esri/core/workers/chunks/2427699e34e1895ed024.js +0 -1
  108. package/assets/esri/core/workers/chunks/4e9740f3955a8c45fb2d.js +0 -1
  109. package/assets/esri/core/workers/chunks/5c9e6d1a88fac48baf3a.js +0 -1
  110. package/assets/esri/core/workers/chunks/5f5f6bba98e5671e63a7.js +0 -1
  111. package/assets/esri/core/workers/chunks/7bba67d345da6eced804.js +0 -1
  112. package/assets/esri/core/workers/chunks/92fc6c48ff9f50a7351a.js +0 -1
  113. package/assets/esri/core/workers/chunks/955d7a0c8b2cdabfa8a3.js +0 -1
  114. package/assets/esri/core/workers/chunks/99283ac67e6b73695df7.js +0 -1
  115. package/assets/esri/core/workers/chunks/b9e8c2e2c5b4c9564319.js +0 -1
  116. package/assets/esri/core/workers/chunks/d344e99dd999aaaabbe3.js +0 -1
  117. package/assets/esri/core/workers/chunks/e78e92e024275eccea4e.js +0 -1
  118. package/assets/esri/core/workers/chunks/f7cfdba77cb614fd3725.js +0 -1
  119. package/assets/esri/core/workers/chunks/fc2a12f9e4068ab89628.js +0 -1
@@ -279,7 +279,7 @@ return fallOffFunction(vv, vn, 0.1);
279
279
 
280
280
  fragBlur = b / w_total;
281
281
  }
282
- `),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},46140:(e,t,r)=>{r.d(t,{R:()=>o});var i=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,a]=t.split("."),n=/^\s*\d+\s*$/;if(!o?.match||!n.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!a?.match||!n.test(a))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(o,10),l=parseInt(a,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>o,b5:()=>i});const a=/^devext.arcgis.com$/,n=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,a,n,/^jsapps.esri.com$/,s,l]},88340:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function a(){return i()}function n(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{Un:()=>d,fA:()=>o,uY:()=>c,vt:()=>i});const c=a(),d=n(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:n,unitX:s,unitY:l,zeros:a},Symbol.toStringTag,{value:"Module"}))},11868:(e,t,r)=>{r.d(t,{oe:()=>o});var i=r(34275);function o(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}},4832:(e,t,r)=>{r.d(t,{fetch:()=>cr});var i=r(61473),o=r(77690),a=r(29242),n=r(58083),s=r(9093),l=r(48163),c=r(38954),d=r(51850),u=r(70328),h=r(11868),m=r(13030),p=r(73354),f=r(50867),v=r(43609),g=r(51737),_=r(78358),x=r(21015),T=r(4399),E=r(84498),A=r(51530),b=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:b.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:b.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,o.lw)(c,s,l),(0,o.lw)(c,n,c),c}class y{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class M{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new y,this.numberOfVertices=0}}var R=r(78888),w=r(60999),C=r(86805),I=r(49186),O=r(53966);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var H=r(74887),P=r(46140),L=r(97146);async function D(e,t){const{data:r}=await(0,R.A)(e,{responseType:"image",...t});return r}var F=r(46610),B=r(89192),G=r(38168),U=r(44208),z=r(65529),V=r(97768),W=r(34275),j=r(84952),k=r(56058),q=r(2741);let $;var X,Y;(Y=X||(X={}))[Y.ETC1_RGB=0]="ETC1_RGB",Y[Y.ETC2_RGBA=1]="ETC2_RGBA",Y[Y.BC1_RGB=2]="BC1_RGB",Y[Y.BC3_RGBA=3]="BC3_RGBA",Y[Y.BC4_R=4]="BC4_R",Y[Y.BC5_RG=5]="BC5_RG",Y[Y.BC7_M6_RGB=6]="BC7_M6_RGB",Y[Y.BC7_M5_RGBA=7]="BC7_M5_RGBA",Y[Y.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Y[Y.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Y[Y.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Y[Y.ATC_RGB=11]="ATC_RGB",Y[Y.ATC_RGBA=12]="ATC_RGBA",Y[Y.FXT1_RGB=17]="FXT1_RGB",Y[Y.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Y[Y.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Y[Y.ETC2_EAC_R11=20]="ETC2_EAC_R11",Y[Y.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Y[Y.RGBA32=13]="RGBA32",Y[Y.RGB565=14]="RGB565",Y[Y.BGR565=15]="BGR565",Y[Y.RGBA4444=16]="RGBA4444";var Z=r(63907),J=r(21231),K=r(42293);let Q=null,ee=null;async function te(){return null==ee&&(ee=function(){if(null==$){const e=e=>(0,q.s)(`esri/libs/basisu/${e}`);$=r.e(9321).then(r.bind(r,49321)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return $}(),Q=await ee),ee}function re(e,t,r,i,o){const a=(0,K.IB)(t?Z.CQ.COMPRESSED_RGBA8_ETC2_EAC:Z.CQ.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ae(e,t,r,i,o,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[X.ETC2_RGBA,Z.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,Z.CQ.COMPRESSED_RGB8_ETC2]:c?i?[X.BC3_RGBA,Z.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,Z.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,Z.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(n(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.width=o,t.height=a,new J.g(e,t,{type:"compressed",levels:m})}var ne=r(69720),se=r(96672);const le=()=>O.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const de=ce("DXT1"),ue=ce("DXT3"),he=ce("DXT5");function me(e,t,r){if(e instanceof ImageData)return me(pe(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function pe(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var fe,ve,ge=r(620),_e=r(67171);class xe extends ne.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=se.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.A,this._parameters={...Ee,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,j.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,j.DB)(e.src)||(0,j.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new _e.R;return t.wrapMode=this._parameters.wrap??Z.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,W.mw)(e)||(0,W.mg)(e))return t.encoding===B.JS.KTX2_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.JS.BASIS_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Te(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new J.g(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,W.mg)(t)?this._loadFromPixelData(e,t):(0,W.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<fe.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return le().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return le().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,a;switch(i){case de:o=8,a=Z.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ue:o=16,a=Z.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case he:o=16,a=Z.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return le().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let n=1,s=r[4],l=r[3];(3&s||3&l)&&(le().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let m=r[1]+4;const p=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:s}=i;return t.samplingMode=o.levels.length>1?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new J.g(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ae(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ae(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,ge.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?Z.Ab.LUMINANCE:3===this._parameters.components?Z.Ab.RGB:Z.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new J.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await D(t,{signal:r});return(0,H.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,k.Sx)(t,t.src,!1,r);return(0,H.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=fe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",s),(0,V.xt)(l)},n=()=>{t.readyState>=fe.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},s=e=>{a(),o(e||new I.A("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",s);const l=(0,H.u7)(r,(()=>s((0,H.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?pe(e):e;let i=e.width,o=e.height;do{i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o}while(r>1048576||null!=t&&(i>t||o>t));return me(e,i,o)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return me(e,Math.round(e.width*i),Math.round(e.height*i))}(r,t)}const i=Te(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?Z.Ab.RGB:Z.Ab.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new J.g(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,V.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function Te(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(ve=fe||(fe={}))[ve.HAVE_NOTHING=0]="HAVE_NOTHING",ve[ve.HAVE_METADATA=1]="HAVE_METADATA",ve[ve.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",ve[ve.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",ve[ve.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Ee={wrap:{s:Z.pF.REPEAT,t:Z.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Ae=r(46540),be=r(24151),Se=r(1843),ye=r(49255),Me=r(96336),Re=r(62602),we=r(59469),Ce=r(25634),Ie=r(14903),Oe=r(14327),Ne=r(90644);const He=(0,Ne.p3)(Z.dn.SRC_ALPHA,Z.dn.ONE,Z.dn.ONE_MINUS_SRC_ALPHA,Z.dn.ONE_MINUS_SRC_ALPHA),Pe=(0,Ne.ox)(Z.dn.ONE,Z.dn.ONE),Le=(0,Ne.ox)(Z.dn.ZERO,Z.dn.ONE_MINUS_SRC_ALPHA);function De(e){return e===Oe.y.FrontFace?null:e===Oe.y.Alpha?Le:Pe}const Fe={factor:-1,units:-2};function Be(e,t=Z.MT.LESS){return e===Oe.y.NONE||e===Oe.y.FrontFace?t:Z.MT.LEQUAL}const Ge=(0,u.vt)();function Ue(e,t,r,i,o,a){if(e.visible)if(e.boundingInfo){(0,ge.vA)(e.type===se.X.Mesh);const n=t.tolerance;Ve(e.boundingInfo,r,i,n,o,a)}else{const t=e.attributes.get(Ae.r.POSITION),n=t.indices;ke(r,i,0,n.length/3,n,t,void 0,o,a)}}const ze=(0,d.vt)();function Ve(e,t,r,i,o,a){if(null==e)return;const n=function(e,t,r){return(0,c.s)(r,1/(t[0]-e[0]),1/(t[1]-e[1]),1/(t[2]-e[2]))}(t,r,ze);if((0,u.Ne)(Ge,e.bbMin),(0,u.vI)(Ge,e.bbMax),null!=o&&o.applyToAabb(Ge),function(e,t,r,i){return function(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(Ge,t,n,i)){const{primitiveIndices:n,position:s}=e,l=n?n.length:s.indices.length/3;if(l>Ye){const n=e.getChildren();if(void 0!==n){for(const e of n)Ve(e,t,r,i,o,a);return}}ke(t,r,0,l,s.indices,s,n,o,a)}}const We=(0,d.vt)(),je=(0,d.vt)();function ke(e,t,r,i,o,a,n,s,l){const d=(0,c.z)(je,t,e);if(n)return function(e,t,r,i,o,a,n,s,l){const{data:c,stride:d}=a,u=e[0],h=e[1],m=e[2],p=t[0],f=t[1],v=t[2];for(let e=r;e<i;++e){const t=n[e],r=3*t,i=d*o[r];let a=c[i],g=c[i+1],_=c[i+2];const x=d*o[r+1];let T=c[x],E=c[x+1],A=c[x+2];const b=d*o[r+2];let S=c[b],y=c[b+1],M=c[b+2];null!=s&&([a,g,_]=s.applyToVertex(a,g,_,e),[T,E,A]=s.applyToVertex(T,E,A,e),[S,y,M]=s.applyToVertex(S,y,M,e));const R=T-a,w=E-g,C=A-_,I=S-a,O=y-g,N=M-_,H=f*N-O*v,P=v*I-N*p,L=p*O-I*f,D=R*H+w*P+C*L;if(Math.abs(D)<=Ze)continue;const F=u-a,B=h-g,G=m-_,U=F*H+B*P+G*L;if(D>0){if(U<0||U>D)continue}else if(U>0||U<D)continue;const z=B*C-w*G,V=G*R-C*F,W=F*w-R*B,j=p*z+f*V+v*W;if(D>0){if(j<0||U+j>D)continue}else if(j>0||U+j<D)continue;const k=(I*z+O*V+N*W)/D;k>=0&&l(k,Xe(R,w,C,I,O,N,We),t,!1)}}(e,d,r,i,o,a,n,s,l);const{data:u,stride:h}=a;!function(e,t,r,i,o,a,n,s,l){const d=(0,c.z)(Je,t,e),u=Ke,h=()=>((0,c.z)(qe,u[1],u[0]),(0,c.z)($e,u[2],u[0]),(0,c.b)(We,qe,$e),(0,c.n)(We,We),We),m=Math.abs(d[0]),p=Math.abs(d[1]),f=Math.abs(d[2]),v=m>=p?m>=f?0:2:p>=f?1:2,g=v,_=d[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,E=d[x]/d[g],A=d[T]/d[g],b=1/d[g],S=Qe,y=et,M=tt;for(let t=r;t<i;++t){const r=3*t,i=o*a[r];(0,c.s)(u[0],n[i+0],n[i+1],n[i+2]);const d=o*a[r+1];(0,c.s)(u[1],n[d+0],n[d+1],n[d+2]);const m=o*a[r+2];(0,c.s)(u[2],n[m+0],n[m+1],n[m+2]),l&&((0,c.c)(u[0],l.applyToVertex(u[0][0],u[0][1],u[0][2],t)),(0,c.c)(u[1],l.applyToVertex(u[1][0],u[1][1],u[1][2],t)),(0,c.c)(u[2],l.applyToVertex(u[2][0],u[2][1],u[2][2],t))),(0,c.z)(S,u[0],e),(0,c.z)(y,u[1],e),(0,c.z)(M,u[2],e);const p=S[x]-E*S[g],f=S[T]-A*S[g],v=y[x]-E*y[g],_=y[T]-A*y[g],R=M[x]-E*M[g],w=M[T]-A*M[g],C=R*_-w*v,I=p*w-f*R,O=v*f-_*p;if((C<0||I<0||O<0)&&(C>0||I>0||O>0))continue;const N=C+I+O;if(0===N)continue;const H=C*(b*S[g])+I*(b*y[g])+O*(b*M[g]);if(H*Math.sign(N)<0)continue;const P=H/N;P>=0&&s(P,h(),t,!1)}}(e,t,r,i,h,o,u,l,s)}const qe=(0,d.vt)(),$e=(0,d.vt)();function Xe(e,t,r,i,o,a,n){return(0,c.s)(qe,e,t,r),(0,c.s)($e,i,o,a),(0,c.b)(n,qe,$e),(0,c.n)(n,n),n}const Ye=1e3,Ze=1e-7,Je=(0,d.vt)(),Ke=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],Qe=(0,d.vt)(),et=(0,d.vt)(),tt=(0,d.vt)();var rt=r(13464),it=r(76412),ot=r(57005);const at=new class{constructor(e=0){this.offset=e,this.sphere=(0,it.c)(),this.tmpVertex=(0,d.vt)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,c.s)(nt,e,t,r),a=(0,c.e)(o,o,i),n=this.offset/(0,c.l)(a);(0,c.r)(a,a,a,n);const s=this.objectTransform.inverse;return(0,c.e)(this.tmpVertex,a,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,c.l)(e);(0,c.r)(e,e,e,r);const i=this.offset/(0,c.l)(t);(0,c.r)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,c.l)((0,it.g)(e)),r=this.offset/t;return(0,c.r)((0,it.g)(this.sphere),(0,it.g)(e),(0,it.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,d.vt)(),this._tmpMbs=(0,it.c)(),this._tmpObb=new ot.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,c.l)(e)}applyToVertex(e,t,r){const i=(0,c.s)(nt,e,t,r),o=(0,c.s)(st,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,c.l)(o);return(0,c.r)(this._tmpVertex,i,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(o),u=Math.abs(a),h=Math.abs(n),m=Math.abs(s),p=.5*(1+Math.sign(r*a))*Math.min(l,u),f=.5*(1+Math.sign(i*n))*Math.min(c,h),v=.5*(1+Math.sign(o*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(p*p+f*f+v*v),E=Math.sign(l+r),A=Math.sign(c+i),b=Math.sign(d+o),S=Math.sign(u+a),y=Math.sign(h+n),M=Math.sign(m+s),R=this._totalOffset;if(T<R)return e[0]-=(1-E)*R,e[1]-=(1-A)*R,e[2]-=(1-b)*R,e[3]+=S*R,e[4]+=y*R,e[5]+=M*R,e;const w=R/Math.sqrt(g*g+_*_+x*x),C=R/T,I=C-w,O=-I;return e[0]+=r*(E*O+C),e[1]+=i*(A*O+C),e[2]+=o*(b*O+C),e[3]+=a*(S*I+w),e[4]+=n*(y*I+w),e[5]+=s*(M*I+w),e}applyToMbs(e){const t=(0,c.l)((0,it.g)(e)),r=this._totalOffset/t;return(0,c.r)((0,it.g)(this._tmpMbs),(0,it.g)(e),(0,it.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,ot.gm)(e,this._totalOffset,this._totalOffset,be.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.vt)()}applyToVertex(e,t,r){const i=(0,c.s)(nt,e,t,r),o=(0,c.g)(st,i,this.localOrigin),a=this.offset/(0,c.l)(o);return(0,c.r)(this.tmpVertex,i,o,a),this.tmpVertex}applyToAabb(e){const t=lt,r=ct,i=dt;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const a=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=e&1<<o?r[o]:t[o];a(i)}let n=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(n|=1<<e);if(0!==n&&7!==n)for(let e=0;e<8;++e)if(!(n&e)){for(let o=0;o<3;++o)i[o]=n&1<<o?0:e&1<<o?t[o]:r[o];a(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const nt=(0,d.vt)(),st=(0,d.vt)(),lt=(0,d.vt)(),ct=(0,d.vt)(),dt=(0,d.vt)();function ut(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length;r*=n;for(let e=0;e<s;++e){const t=2*o[e];a[r]=i[t],a[r+1]=i[t+1],r+=n}}function ht(e,t,r,i){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}}function mt(e,t,r,i=1){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}}function pt(e,t,r,i,o=1){const a=t.typedBuffer,n=t.typedBufferStride;if(i*=n,1===o)for(let t=0;t<r;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n}function ft(e,t,r,i,o,a){switch(e){case Ae.r.POSITION:{(0,ge.vA)(3===t.size);const i=o.getField(e,m.xs);(0,ge.vA)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o=1){if(!t)return void ht(e,r,i,o);const{data:a,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,d=s.length,u=t[0],h=t[1],m=t[2],p=t[4],f=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],E=t[13],A=t[14];i*=c;let b=0,S=0,y=0;const M=(0,n.tZ)(t)?e=>{b=a[e]+T,S=a[e+1]+E,y=a[e+2]+A}:e=>{const t=a[e],r=a[e+1],i=a[e+2];b=u*t+p*r+g*i+T,S=h*t+f*r+_*i+E,y=m*t+v*r+x*i+A};if(1===o)for(let e=0;e<d;++e)M(3*s[e]),l[i]=b,l[i+1]=S,l[i+2]=y,i+=c;else for(let e=0;e<d;++e){M(3*s[e]);for(let e=0;e<o;++e)l[i]=b,l[i+1]=S,l[i+2]=y,i+=c}}(t,r,i,a);break}case Ae.r.NORMAL:{(0,ge.vA)(3===t.size);const r=o.getField(e,m.xs);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void ht(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=l[0],m=l[1],p=l[2],f=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],E=!(0,n.ut)(l),A=1e-6,b=1-A;i*=d;let S=0,y=0,M=0;const R=(0,n.tZ)(l)?e=>{S=a[e],y=a[e+1],M=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];S=h*t+f*r+_*i,y=m*t+v*r+x*i,M=p*t+g*r+T*i};if(1===o)if(E)for(let e=0;e<u;++e){R(3*s[e]);const t=S*S+y*y+M*M;if(t<b&&t>A){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=y*e,c[i+2]=M*e}else c[i]=S,c[i+1]=y,c[i+2]=M;i+=d}else for(let e=0;e<u;++e)R(3*s[e]),c[i]=S,c[i+1]=y,c[i+2]=M,i+=d;else for(let e=0;e<u;++e){if(R(3*s[e]),E){const e=S*S+y*y+M*M;if(e<b&&e>A){const t=1/Math.sqrt(e);S*=t,y*=t,M*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=y,c[i+2]=M,i+=d}}(t,i,r,a);break}case Ae.r.NORMALCOMPRESSED:{(0,ge.vA)(2===t.size);const r=o.getField(e,m.mJ);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ut(t,r,a);break}case Ae.r.UV0:{(0,ge.vA)(2===t.size);const r=o.getField(e,m.gH);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ut(t,r,a);break}case Ae.r.COLOR:case Ae.r.SYMBOLCOLOR:{const r=o.getField(e,m.XP);(0,ge.vA)(!!r,`No buffer view for ${e}`),(0,ge.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,o=1){const{data:a,indices:n}=e,s=r.typedBuffer,l=r.typedBufferStride,c=n.length;if(i*=l,t!==a.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}}else{s[i]=a[0],s[i+1]=a[1],s[i+2]=a[2],s[i+3]=a[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,n=e[i/=4];i+=t;const d=c*o;for(let r=1;r<d;++r)e[i]=n,i+=t}}(t,t.size,r,a);break}case Ae.r.COLORFEATUREATTRIBUTE:{const r=o.getField(e,m.Y$);(0,ge.vA)(!!r,`No buffer view for ${e}`),(0,ge.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length,l=i[0];r*=n;for(let e=0;e<s;++e)a[r]=l,r+=n}(t,r,a);break}case Ae.r.TANGENT:{(0,ge.vA)(4===t.size);const r=o.getField(e,m.Eq);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void mt(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=l[0],m=l[1],p=l[2],f=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],E=!(0,n.ut)(l),A=1e-6,b=1-A;if(i*=d,1===o)for(let e=0;e<u;++e){const t=4*s[e],r=a[t],o=a[t+1],n=a[t+2],l=a[t+3];let u=h*r+f*o+_*n,S=m*r+v*o+x*n,y=p*r+g*o+T*n;if(E){const e=u*u+S*S+y*y;if(e<b&&e>A){const t=1/Math.sqrt(e);u*=t,S*=t,y*=t}}c[i]=u,c[i+1]=S,c[i+2]=y,c[i+3]=l,i+=d}else for(let e=0;e<u;++e){const t=4*s[e],r=a[t],n=a[t+1],l=a[t+2],u=a[t+3];let S=h*r+f*n+_*l,y=m*r+v*n+x*l,M=p*r+g*n+T*l;if(E){const e=S*S+y*y+M*M;if(e<b&&e>A){const t=1/Math.sqrt(e);S*=t,y*=t,M*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=y,c[i+2]=M,c[i+3]=u,i+=d}}(t,i,r,a);break}case Ae.r.PROFILERIGHT:case Ae.r.PROFILEUP:case Ae.r.PROFILEVERTEXANDNORMAL:case Ae.r.FEATUREVALUE:{(0,ge.vA)(4===t.size);const r=o.getField(e,m.Eq);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&mt(t,r,a)}}}class vt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(Ae.r.POSITION).indices.length}write(e,t,r,i,o){!function(e,t,r,i,o,a){for(const n of t.fields.keys()){const t=e.attributes.get(n),s=t?.indices;if(t&&s)ft(n,t,r,i,o,a);else if(n===Ae.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(Ae.r.POSITION)?.indices;if(t){const r=t.length,i=o.getField(n,m.XP);pt(e.objectAndLayerIdColor,i,r,a)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var gt=r(19245),_t=r(91829),xt=r(53466),Tt=r(72824),Et=r(35093),At=r(97220),bt=r(84867),St=r(39341),yt=r(34886);Z.MT.LESS,Z.MT.ALWAYS;const Mt={mask:255},Rt={function:{func:Z.MT.ALWAYS,ref:B.dd.OutlineVisualElementMask,mask:B.dd.OutlineVisualElementMask},operation:{fail:Z.eA.KEEP,zFail:Z.eA.KEEP,zPass:Z.eA.ZERO}},wt={function:{func:Z.MT.ALWAYS,ref:B.dd.OutlineVisualElementMask,mask:B.dd.OutlineVisualElementMask},operation:{fail:Z.eA.KEEP,zFail:Z.eA.KEEP,zPass:Z.eA.REPLACE}};Z.MT.EQUAL,B.dd.OutlineVisualElementMask,B.dd.OutlineVisualElementMask,Z.eA.KEEP,Z.eA.KEEP,Z.eA.KEEP,Z.MT.NOTEQUAL,B.dd.OutlineVisualElementMask,B.dd.OutlineVisualElementMask,Z.eA.KEEP,Z.eA.KEEP,Z.eA.KEEP;const Ct=[1,1,.5],It=[0,.6,.2],Ot=[0,1,.2];var Nt=r(28491);class Ht extends Tt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,d.ci)(Ct),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,d.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Me.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,d.fA)(.2,.2,.2),this.diffuse=(0,d.fA)(.8,.8,.8),this.externalColor=(0,_t.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.it.Less,this.textureAlphaMode=B.sf.Blend,this.textureAlphaCutoff=Et.H,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ie.m$.Occlude,this.isDecoration=!1}}Tt.gy;class Pt extends bt.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===be.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?xt.q.Default:xt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Pt.shader)}_initializeProgram(e,t){return new yt.B(e.rctx,t.get().build(this.configuration),St.D)}_makePipeline(e,t){const r=this.configuration,i=e===Oe.y.NONE,o=e===Oe.y.FrontFace;return(0,Ne.Ey)({blending:r.output!==ye.V.Color&&r.output!==ye.V.Alpha||!r.transparent?null:i?He:De(e),culling:Dt(r)?(0,Ne.Xt)(r.cullFace):null,depthTest:{func:Be(e,Lt(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ne.kn:null,colorWrite:Ne.wE,stencilWrite:r.hasOccludees?Mt:null,stencilTest:r.hasOccludees?t?wt:Rt:null,polygonOffset:i||o?null:(a=r.enableOffset,a?Fe:null)});var a}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Lt(e){return e===B.it.Lequal?Z.MT.LEQUAL:Z.MT.LESS}function Dt(e){return e.cullFace!==B.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Pt.shader=new At.$(Nt.D,(()=>r.e(5141).then(r.bind(r,5141))));var Ft=r(90237),Bt=r(99769),Gt=r(82991),Ut=r(46263);class zt extends Gt.nW{}(0,Ft._)([(0,Bt.W)({constValue:!0})],zt.prototype,"hasSliceHighlight",void 0),(0,Ft._)([(0,Bt.W)({constValue:!1})],zt.prototype,"hasSliceInVertexProgram",void 0),(0,Ft._)([(0,Bt.W)({constValue:Ut.c.Pass})],zt.prototype,"pbrTextureBindType",void 0);class Vt extends zt{constructor(){super(...arguments),this.output=ye.V.Color,this.alphaDiscardMode=B.sf.Opaque,this.doubleSidedMode=Re.W.None,this.pbrMode=we.A9.Disabled,this.cullFace=B.s2.None,this.transparencyPassType=Oe.y.NONE,this.normalType=Me.W.Attribute,this.textureCoordinateType=xt.q.None,this.customDepthTest=B.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Ft._)([(0,Bt.W)({count:ye.V.COUNT})],Vt.prototype,"output",void 0),(0,Ft._)([(0,Bt.W)({count:B.sf.COUNT})],Vt.prototype,"alphaDiscardMode",void 0),(0,Ft._)([(0,Bt.W)({count:Re.W.COUNT})],Vt.prototype,"doubleSidedMode",void 0),(0,Ft._)([(0,Bt.W)({count:we.A9.COUNT})],Vt.prototype,"pbrMode",void 0),(0,Ft._)([(0,Bt.W)({count:B.s2.COUNT})],Vt.prototype,"cullFace",void 0),(0,Ft._)([(0,Bt.W)({count:Oe.y.COUNT})],Vt.prototype,"transparencyPassType",void 0),(0,Ft._)([(0,Bt.W)({count:Me.W.COUNT})],Vt.prototype,"normalType",void 0),(0,Ft._)([(0,Bt.W)({count:xt.q.COUNT})],Vt.prototype,"textureCoordinateType",void 0),(0,Ft._)([(0,Bt.W)({count:B.it.COUNT})],Vt.prototype,"customDepthTest",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"spherical",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasVertexColors",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasSymbolColors",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasVerticalOffset",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasSlicePlane",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasSliceHighlight",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasColorTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasMetallicRoughnessTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasEmissionTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasOcclusionTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasNormalTexture",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasScreenSizePerspective",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasVertexTangents",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasOccludees",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"multipassEnabled",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasModelTransformation",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"offsetBackfaces",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"vvSize",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"vvColor",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"receiveShadows",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"receiveAmbientOcclusion",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"textureAlphaPremultiplied",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"instanced",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"instancedColor",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"instancedDoublePrecision",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"writeDepth",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"transparent",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"enableOffset",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"cullAboveGround",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"snowCover",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasColorTextureTransform",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasEmissionTextureTransform",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasNormalTextureTransform",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasOcclusionTextureTransform",void 0),(0,Ft._)([(0,Bt.W)()],Vt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Ft._)([(0,Bt.W)({constValue:!1})],Vt.prototype,"occlusionPass",void 0),(0,Ft._)([(0,Bt.W)({constValue:!0})],Vt.prototype,"hasVvInstancing",void 0),(0,Ft._)([(0,Bt.W)({constValue:!1})],Vt.prototype,"useCustomDTRExponentForWater",void 0),(0,Ft._)([(0,Bt.W)({constValue:!1})],Vt.prototype,"supportsTextureAtlas",void 0),(0,Ft._)([(0,Bt.W)({constValue:!0})],Vt.prototype,"useFillLights",void 0);var Wt=r(57323);class jt extends Pt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Me.W.Attribute,t.doubleSidedMode=Re.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,jt.shader)}}jt.shader=new At.$(Wt.R,(()=>r.e(9933).then(r.bind(r,39933))));class kt extends Ie.im{constructor(e){super(e,$t),this.supportsEdges=!0,this.produces=new Map([[rt.N.OPAQUE_MATERIAL,e=>((0,ye.XY)(e)||(0,ye.PJ)(e))&&!this.parameters.transparent],[rt.N.TRANSPARENT_MATERIAL,e=>((0,ye.XY)(e)||(0,ye.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[rt.N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,ye.XY)(e)||(0,ye.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._configuration=new Vt,this._vertexBufferLayout=function(e){const t=(0,Se.BP)().vec3f(Ae.r.POSITION);return e.normalType===Me.W.Compressed?t.vec2i16(Ae.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(Ae.r.NORMAL),e.hasVertexTangents&&t.vec4f(Ae.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(Ae.r.UV0),e.hasVertexColors&&t.vec4u8(Ae.r.COLOR),e.hasSymbolColors&&t.vec4u8(Ae.r.SYMBOLCOLOR),(0,U.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(Ae.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==ye.V.Shadow&&e!==ye.V.ShadowExcludeHighlight&&e!==ye.V.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,a="replace"===e.colorMixMode,n=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?a||n:r?a?s:n:l?a||n:a?s:n}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==ye.V.Color&&e!==ye.V.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Re.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Re.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Re.W.WindingOrder:Re.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?we.A9.Schematic:we.A9.Normal:we.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,c.s)(Qt,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case be.RT.Global:a=(0,c.n)(Jt,Qt);break;case be.RT.Local:a=(0,c.c)(Jt,Zt)}let n=0;const s=(0,c.f)(er,Qt,e.eye),l=(0,c.l)(s),d=(0,c.h)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,c.k)(a,d)),n+=(0,gt.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,c.h)(a,a,n),(0,c.t)(Kt,a,r.transform.inverseRotation),i=(0,c.f)(Xt,i,Kt),o=(0,c.f)(Yt,o,Kt)}var n;Ue(e,r,i,o,null!=(n=r.verticalOffset)?(at.offset=n,at):null,a)}createGLMaterial(e){return new qt(e)}createBufferWriter(){return new vt(this._vertexBufferLayout)}}class qt extends Ce.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==ye.V.Color&&this._output!==ye.V.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?jt:Pt,e)}}const $t=new class extends Ht{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Xt=(0,d.vt)(),Yt=(0,d.vt)(),Zt=(0,d.fA)(0,0,1),Jt=(0,d.vt)(),Kt=(0,d.vt)(),Qt=(0,d.vt)(),er=(0,d.vt)(),tr=()=>O.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function rr(e){throw new I.A("",`Request for object resource failed: ${e}`)}function ir(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(tr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(tr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(tr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(tr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else tr().warn("Indexed geometries must specify faces"),i=!1;break}default:tr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(tr().warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(tr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function or(e){const t=(0,u.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.iT)(t,r.bbMin),(0,u.iT)(t,r.bbMax))})),t}function ar(e){switch(e){case"mask":return B.sf.Mask;case"maskAndTransparency":return B.sf.MaskBlend;case"none":return B.sf.Opaque;default:return B.sf.Blend}}function nr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const sr=new P.R(1,2,"wosr");var lr=r(61765);async function cr(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.EM)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,w.Ke)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,H.QP)(i.error),rr(i.error.details.url)}(e,r,t);const i=await(0,w.Ke)((0,R.A)(e,t));if(!0===i.ok)return i.value.data;(0,H.QP)(i.error),rr(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],a=o.images[0].data;if(!a){tr().warn("Externally referenced texture data is not yet supported");continue}const n=o.encoding+";base64,"+a,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Z.pF.REPEAT,t:Z.pF.REPEAT},preMultiplyAlpha:ar(l)!==B.sf.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):D(n,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,C.iL)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,a=new N,n=e.resource,s=P.R.parse(n.version||"1.0","wosr");sr.validate(s);const l=n.model.name,c=n.model.geometries,u=n.materialDefinitions??{},h=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const n=c[e];if(!ir(n))continue;const s=nr(n),l=n.params.vertexAttributes,f=[],v=e=>{if("PerAttributeArray"===n.params.topology)return null;const t=n.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[Ae.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=v(e)??(0,L.tM)(_);f.push([e,new F.n(r,i,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!p.has(x)){const{image:e,parameters:t}=T,r=new xe(e,t);i.push(r),p.set(x,r)}const E=p.get(x),A=E?E.id:void 0,b=s.material;let S=a.get(b,x);if(null==S){const e=u[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=T?ar(T.alphaChannelUsage):void 0,n={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:A,initTextureTransparent:!0,doubleSided:!0,cullFace:B.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),S=new kt(n),a.set(b,x,S)}o.push(S);const y=new G.V(S,f);m+=f.find((e=>e[0]===Ae.r.POSITION))?.[1]?.indices.length??0,r.push(y)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:or(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const a=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,T.y)(new x.R(t.streamDataRequester),r.url,t,t.usePBR)),b=a.model.meta?.ESRI_proxyEllipsoid,y=a.meta.isEsriSymbolResource&&null!=b&&"EsriRealisticTreesStyle"===a.meta.ESRI_webstyle;y&&!a.customMeta.esriTreeRendering&&(a.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const a=o.attributes.position,l=a.count,u=(0,d.vt)(),h=(0,d.vt)(),p=(0,d.vt)(),f=new Uint8Array(4*l),v=new Float64Array(3*l),g=(0,n.B8)((0,s.vt)(),o.transform);let _=0,x=0;for(let n=0;n<l;n++){a.getVec(n,h),i.getVec(n,u),(0,c.e)(h,h,o.transform),(0,c.f)(p,h,t.center),(0,c.D)(p,p,t.radius);const s=p[2],l=(0,c.l)(p),d=Math.min(.45+.55*l*l,1);(0,c.D)(p,p,t.radius),null!==g&&(0,c.e)(p,p,g),(0,c.n)(p,p),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.m)(p,p,u,s>-1?.2:Math.min(-4*s-3.8,1)),v[_]=p[0],v[_+1]=p[1],v[_+2]=p[2],_+=3,f[x]=255*d,f[x+1]=255*d,f[x+2]=255*d,f[x+3]=255,x+=4}o.attributes.normal=new m.xs(v),o.attributes.color=new m.XP(f)}}}(a,b));const I=!!t.usePBR,O=a.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:y,mrrFactors:[...Ot]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...Ct]},U={...t.materialParameters,treeRendering:y},{engineResources:z,referenceBoundingBox:V}=function(e,t,r,i){const a=e.model,n=new Array,s=new Map,x=new Map,T=a.lods.length,b=(0,u.Ie)();return a.lods.forEach(((e,y)=>{const R=!0===i.skipHighLods&&(T>1&&0===y||T>3&&1===y)||!1===i.skipHighLods&&null!=i.singleLodIndex&&y!==i.singleLodIndex;if(R&&0!==y)return;const w=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=R?new kt({}):function(e,t,r,i,o,a,n){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),h=null!=t.attributes.texCoord0,m=null!=t.attributes.normal;if(null==u)return null;const p=function(e){switch(e){case"BLEND":return B.sf.Blend;case"MASK":return B.sf.Mask;case"OPAQUE":case null:case void 0:return B.sf.Opaque}}(u.alphaMode);if(!a.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!n.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;n.set(t,new xe((0,A.x3)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,A.x3)(e)&&r,encoding:(0,A.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,p!==B.sf.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/lr.T),f=u.color[1]**(1/lr.T),v=u.color[2]**(1/lr.T),g=u.emissiveFactor[0]**(1/lr.T),_=u.emissiveFactor[1]**(1/lr.T),x=u.emissiveFactor[2]**(1/lr.T),T=null!=u.textureColor&&h?n.get(u.textureColor):null,E=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:a,occlusionTexture:n}){return null==e&&null==t&&null==o&&(null==a||(0,c.j)(a,d.uY))&&null==n&&(null==i||1===i)&&(null==r||1===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion}),b=null!=u.normalTextureTransform?.scale?u.normalTextureTransform?.scale:l.Un;a.set(s,new kt({...i,transparent:p===B.sf.Blend,customDepthTest:B.it.Lequal,textureAlphaMode:p,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,v],ambient:[r,f,v],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?B.s2.None:B.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?Me.W.Attribute:Me.W.ScreenDerivative,castShadows:!0,receiveShadows:u.receiveShadows,receiveAmbientOcclusion:u.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&h?n.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&h?n.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&h?n.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&h?n.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:E?[...It]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:E,colorTextureTransformMatrix:S(u.colorTextureTransform),normalTextureTransformMatrix:S(u.normalTextureTransform),scale:[b[0],b[1]],occlusionTextureTransformMatrix:S(u.occlusionTextureTransform),emissiveTextureTransformMatrix:S(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(u.metallicRoughnessTextureTransform),...o}))}const f=a.get(s);if(r.stageResources.materials.push(f),h){const e=e=>{null!=e&&r.stageResources.textures.push(n.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(a,e,w,t,r,s,x),{geometry:n,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.x)(e.indices||r,e.primitiveType),a=(0,h.oe)(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.position;(0,p.a)(a,n,e.transform,3,s);const l=[[Ae.r.POSITION,new F.n(a,i,3,!0)]];if(null!=e.attributes.normal){const t=(0,h.oe)(3*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.normal;(0,o.Ge)(dr,e.transform),(0,p.b)(t,a,dr,3,n),l.push([Ae.r.NORMAL,new F.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=(0,h.oe)(4*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.tangent;(0,o.Ge)(dr,e.transform),(0,f.t)(t,a,dr,4,n),l.push([Ae.r.TANGENT,new F.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,h.oe)(2*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.texCoord0;(0,v.n)(t,o,2,a),l.push([Ae.r.UV0,new F.n(t,i,2,!0)])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.Eq?(0,f.s)(t,e.attributes.color,255):e.attributes.color instanceof m.XP?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.Uz&&(0,f.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.xs?(0,p.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.eI?(0,g.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.nS&&(0,p.s)(t,e.attributes.color,1/256,4)),l.push([Ae.r.COLOR,new F.n(t,i,4,!0)])}return{geometry:new G.V(t,l),vertexCount:r}}(e,null!=i?i:new kt({})),M=n.boundingInfo;null!=M&&0===y&&((0,u.iT)(b,M.bbMin),(0,u.iT)(b,M.bbMax)),null!=i&&(w.stageResources.geometries.push(n),w.numberOfVertices+=T)})),R||n.push(w)})),{engineResources:n,referenceBoundingBox:b}}(a,O,U,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:z,referenceBoundingBox:V,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}const dr=(0,a.vt)()},1843:(e,t,r)=>{r.d(t,{BP:()=>l,l5:()=>c});var i=r(13030),o=r(90239),a=r(620);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const o=this.stride;if(o%4==0){const a=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(a)}else{const a=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(a)}return this}get usedMemory(){return this.byteLength}dispose(){}}class s{constructor(e=null){this._stride=0,this._lastAligned=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:h(e[1].constructor)}))))}freeze(){return this}vec2f(e,t){return this._appendField(e,i.gH,t),this}vec2f64(e,t){return this._appendField(e,i.si,t),this}vec3f(e,t){return this._appendField(e,i.xs,t),this}vec3f64(e,t){return this._appendField(e,i.Xm,t),this}vec4f(e,t){return this._appendField(e,i.Eq,t),this}vec4f64(e,t){return this._appendField(e,i.Aj,t),this}mat3f(e,t){return this._appendField(e,i.jZ,t),this}mat3f64(e,t){return this._appendField(e,i.j0,t),this}mat4f(e,t){return this._appendField(e,i.Sx,t),this}mat4f64(e,t){return this._appendField(e,i.E$,t),this}vec4u8(e,t){return this._appendField(e,i.XP,t),this}f32(e,t){return this._appendField(e,i.Y$,t),this}f64(e,t){return this._appendField(e,i.qB,t),this}u8(e,t){return this._appendField(e,i.SL,t),this}u16(e,t){return this._appendField(e,i.h,t),this}i8(e,t){return this._appendField(e,i.bf,t),this}vec2i8(e,t){return this._appendField(e,i.D6,t),this}vec2i16(e,t){return this._appendField(e,i.mJ,t),this}vec2u8(e,t){return this._appendField(e,i.LC,t),this}vec4u16(e,t){return this._appendField(e,i.Uz,t),this}u32(e,t){return this._appendField(e,i.P,t),this}_appendField(e,t,r){if(this._fields.has(e))return void(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._stride+=i,this._fields.set(e,{size:i,constructor:t,offset:n,optional:r})}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new s;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,r)=>e._fields.set(r,t))),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach((t=>e=Math.max(e,(0,o.GJ)(t.constructor.ElementType)))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function l(){return new s}class c{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const r={...e,constructor:u(e.constructor)};this.fields.push([t,r])})),this.stride=e.stride}}const d=[i.Y$,i.gH,i.xs,i.Eq,i.jZ,i.Sx,i.qB,i.si,i.Xm,i.Aj,i.j0,i.E$,i.SL,i.LC,i.eI,i.XP,i.h,i.Yi,i.nS,i.Uz,i.P,i.An,i.H$,i.ml,i.bf,i.D6,i.m8,i.TX,i.Qt,i.mJ,i.Vp,i.E7,i.My,i.UL,i.zD,i.Y4];function u(e){return`${e.ElementType}_${e.ElementCount}`}function h(e){return m.get(e)}const m=new Map;d.forEach((e=>m.set(u(e),e)))},46686:(e,t,r)=>{r.d(t,{i$:()=>c,oD:()=>d,xJ:()=>l});var i=r(49255),o=r(33752),a=r(47286),n=r(2597);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.G("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
282
+ `),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},46140:(e,t,r)=>{r.d(t,{R:()=>o});var i=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,a]=t.split("."),n=/^\s*\d+\s*$/;if(!o?.match||!n.test(o))throw new i.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!a?.match||!n.test(a))throw new i.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(o,10),l=parseInt(a,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>o,b5:()=>i});const a=/^devext.arcgis.com$/,n=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,a,n,/^jsapps.esri.com$/,s,l]},88340:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function a(){return i()}function n(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{Un:()=>d,fA:()=>o,uY:()=>c,vt:()=>i});const c=a(),d=n(),u=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:d,UNIT_X:u,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:n,unitX:s,unitY:l,zeros:a},Symbol.toStringTag,{value:"Module"}))},11868:(e,t,r)=>{r.d(t,{oe:()=>o});var i=r(34275);function o(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}},4832:(e,t,r)=>{r.d(t,{fetch:()=>sr});var i=r(61473),o=r(77690),a=r(29242),n=r(58083),s=r(9093),l=r(48163),c=r(38954),d=r(51850),u=r(70328),h=r(11868),m=r(13030),p=r(73354),f=r(50867),v=r(43609),g=r(51737),_=r(78358),x=r(21015),T=r(4399),E=r(84498),A=r(51530),b=r(88340);function S(e){if(null==e)return null;const t=null!=e.offset?e.offset:b.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:b.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),c=(0,a.vt)();return(0,o.lw)(c,s,l),(0,o.lw)(c,n,c),c}class y{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class M{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new y,this.numberOfVertices=0}}var R=r(78888),w=r(60999),C=r(86805),I=r(49186),O=r(53966);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var H=r(74887),P=r(46140),L=r(97146);async function D(e,t){const{data:r}=await(0,R.A)(e,{responseType:"image",...t});return r}var F=r(46610),B=r(89192),G=r(38168),U=r(44208),z=r(65529),V=r(97768),W=r(34275),j=r(84952),k=r(56058),q=r(2741);let $;var X,Y;(Y=X||(X={}))[Y.ETC1_RGB=0]="ETC1_RGB",Y[Y.ETC2_RGBA=1]="ETC2_RGBA",Y[Y.BC1_RGB=2]="BC1_RGB",Y[Y.BC3_RGBA=3]="BC3_RGBA",Y[Y.BC4_R=4]="BC4_R",Y[Y.BC5_RG=5]="BC5_RG",Y[Y.BC7_M6_RGB=6]="BC7_M6_RGB",Y[Y.BC7_M5_RGBA=7]="BC7_M5_RGBA",Y[Y.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Y[Y.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Y[Y.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Y[Y.ATC_RGB=11]="ATC_RGB",Y[Y.ATC_RGBA=12]="ATC_RGBA",Y[Y.FXT1_RGB=17]="FXT1_RGB",Y[Y.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Y[Y.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Y[Y.ETC2_EAC_R11=20]="ETC2_EAC_R11",Y[Y.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Y[Y.RGBA32=13]="RGBA32",Y[Y.RGB565=14]="RGB565",Y[Y.BGR565=15]="BGR565",Y[Y.RGBA4444=16]="RGBA4444";var Z=r(63907),J=r(21231),K=r(42293);let Q=null,ee=null;async function te(){return null==ee&&(ee=function(){if(null==$){const e=e=>(0,q.s)(`esri/libs/basisu/${e}`);$=r.e(9321).then(r.bind(r,49321)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return $}(),Q=await ee),ee}function re(e,t,r,i,o){const a=(0,K.IB)(t?Z.CQ.COMPRESSED_RGBA8_ETC2_EAC:Z.CQ.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ae(e,t,r,i,o,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[X.ETC2_RGBA,Z.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,Z.CQ.COMPRESSED_RGB8_ETC2]:c?i?[X.BC3_RGBA,Z.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,Z.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,Z.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(n(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.width=o,t.height=a,new J.g(e,t,{type:"compressed",levels:m})}var ne=r(69720),se=r(96672);const le=()=>O.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function ce(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const de=ce("DXT1"),ue=ce("DXT3"),he=ce("DXT5");function me(e,t,r){if(e instanceof ImageData)return me(pe(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function pe(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var fe,ve,ge=r(620),_e=r(67171);class xe extends ne.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=se.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new z.A,this._parameters={...Ee,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,j.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,j.DB)(e.src)||(0,j.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new _e.R;return t.wrapMode=this._parameters.wrap??Z.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,W.mw)(e)||(0,W.mg)(e))return t.encoding===B.JS.KTX2_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.JS.BASIS_ENCODING?function(e,t){if(null==Q)return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Te(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new J.g(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,W.mw)(t)||(0,W.mg)(t))&&this._parameters.encoding===B.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,W.mg)(t)?this._loadFromPixelData(e,t):(0,W.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<fe.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return le().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return le().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,a;switch(i){case de:o=8,a=Z.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ue:o=16,a=Z.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case he:o=16,a=Z.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return le().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let n=1,s=r[4],l=r[3];(3&s||3&l)&&(le().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let m=r[1]+4;const p=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,m,h),p.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:p},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:s}=i;return t.samplingMode=o.levels.length>1?Z.Cj.LINEAR_MIPMAP_LINEAR:Z.Cj.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new J.g(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const o=ae(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==Q&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const o=ae(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,ge.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?Z.Ab.LUMINANCE:3===this._parameters.components?Z.Ab.RGB:Z.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new J.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await D(t,{signal:r});return(0,H.Te)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,k.Sx)(t,t.src,!1,r);return(0,H.Te)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=fe.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",s),(0,V.xt)(l)},n=()=>{t.readyState>=fe.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},s=e=>{a(),o(e||new I.A("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",s);const l=(0,H.u7)(r,(()=>s((0,H.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?pe(e):e;let i=e.width,o=e.height;do{i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o}while(r>1048576||null!=t&&(i>t||o>t));return me(e,i,o)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return me(e,Math.round(e.width*i),Math.round(e.height*i))}(r,t)}const i=Te(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this._parameters.components?Z.Ab.RGB:Z.Ab.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new J.g(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,V.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function Te(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(ve=fe||(fe={}))[ve.HAVE_NOTHING=0]="HAVE_NOTHING",ve[ve.HAVE_METADATA=1]="HAVE_METADATA",ve[ve.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",ve[ve.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",ve[ve.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Ee={wrap:{s:Z.pF.REPEAT,t:Z.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Ae=r(46540),be=r(24151),Se=r(1843),ye=r(49255),Me=r(96336),Re=r(62602),we=r(59469),Ce=r(25634),Ie=r(14903),Oe=r(14327),Ne=r(90644);const He=(0,Ne.p3)(Z.dn.SRC_ALPHA,Z.dn.ONE,Z.dn.ONE_MINUS_SRC_ALPHA,Z.dn.ONE_MINUS_SRC_ALPHA),Pe=(0,Ne.ox)(Z.dn.ONE,Z.dn.ONE),Le=(0,Ne.ox)(Z.dn.ZERO,Z.dn.ONE_MINUS_SRC_ALPHA);function De(e){return e===Oe.y.FrontFace?null:e===Oe.y.Alpha?Le:Pe}const Fe={factor:-1,units:-2};function Be(e,t=Z.MT.LESS){return e===Oe.y.NONE||e===Oe.y.FrontFace?t:Z.MT.LEQUAL}const Ge=(0,u.vt)();function Ue(e,t,r,i,o,a){if(!e.visible)return;const n=(0,c.z)(Ye,i,r);if(e.boundingInfo){(0,ge.vA)(e.type===se.X.Mesh);const i=t.tolerance;Ve(e.boundingInfo,r,n,i,o,a)}else{const t=e.attributes.get(Ae.r.POSITION),i=t.indices;!function(e,t,r,i,o,a,n,s,l){const d=t,u=Ze,h=Math.abs(d[0]),m=Math.abs(d[1]),p=Math.abs(d[2]),f=h>=m?h>=p?0:2:m>=p?1:2,v=f,g=d[v]<0?2:1,_=(f+g)%3,x=(f+(3-g))%3,T=d[_]/d[v],E=d[x]/d[v],A=1/d[v],b=Je,S=Ke,y=Qe;for(let t=r;t<i;++t){const r=3*t,i=n*o[r];(0,c.s)(u[0],a[i+0],a[i+1],a[i+2]);const d=n*o[r+1];(0,c.s)(u[1],a[d+0],a[d+1],a[d+2]);const h=n*o[r+2];(0,c.s)(u[2],a[h+0],a[h+1],a[h+2]),s&&((0,c.c)(u[0],s.applyToVertex(u[0][0],u[0][1],u[0][2],t)),(0,c.c)(u[1],s.applyToVertex(u[1][0],u[1][1],u[1][2],t)),(0,c.c)(u[2],s.applyToVertex(u[2][0],u[2][1],u[2][2],t))),(0,c.z)(b,u[0],e),(0,c.z)(S,u[1],e),(0,c.z)(y,u[2],e);const m=b[_]-T*b[v],p=b[x]-E*b[v],f=S[_]-T*S[v],g=S[x]-E*S[v],M=y[_]-T*y[v],R=y[x]-E*y[v],w=M*g-R*f,C=m*R-p*M,I=f*p-g*m;if((w<0||C<0||I<0)&&(w>0||C>0||I>0))continue;const O=w+C+I;if(0===O)continue;const N=w*(A*b[v])+C*(A*S[v])+I*(A*y[v]);if(N*Math.sign(O)<0)continue;const H=N/O;H>=0&&l(H,((0,c.z)(je,u[1],u[0]),(0,c.z)(ke,u[2],u[0]),(0,c.b)(We,je,ke),(0,c.n)(We,We),We),t,!1)}}(r,n,0,i.length/3,i,t.data,t.stride,o,a)}}const ze=(0,d.vt)();function Ve(e,t,r,i,o,a){if(null==e)return;const n=function(e,t){return(0,c.s)(t,1/e[0],1/e[1],1/e[2])}(r,ze);if((0,u.Ne)(Ge,e.bbMin),(0,u.vI)(Ge,e.bbMax),null!=o&&o.applyToAabb(Ge),function(e,t,r,i){return function(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,i)}(Ge,t,n,i)){const{primitiveIndices:n,position:s}=e,l=n?n.length:s.indices.length/3;if(l>$e){const n=e.getChildren();if(void 0!==n){for(const e of n)Ve(e,t,r,i,o,a);return}}!function(e,t,r,i,o,a,n,s,l,c){const d=e[0],u=e[1],h=e[2],m=t[0],p=t[1],f=t[2];for(let e=0;e<i;++e){const t=s[e],r=3*t,i=n*o[r];let v=a[i],g=a[i+1],_=a[i+2];const x=n*o[r+1];let T=a[x],E=a[x+1],A=a[x+2];const b=n*o[r+2];let S=a[b],y=a[b+1],M=a[b+2];null!=l&&([v,g,_]=l.applyToVertex(v,g,_,e),[T,E,A]=l.applyToVertex(T,E,A,e),[S,y,M]=l.applyToVertex(S,y,M,e));const R=T-v,w=E-g,C=A-_,I=S-v,O=y-g,N=M-_,H=p*N-O*f,P=f*I-N*m,L=m*O-I*p,D=R*H+w*P+C*L;if(Math.abs(D)<=Xe)continue;const F=d-v,B=u-g,G=h-_,U=F*H+B*P+G*L;if(D>0){if(U<0||U>D)continue}else if(U>0||U<D)continue;const z=B*C-w*G,V=G*R-C*F,W=F*w-R*B,j=m*z+p*V+f*W;if(D>0){if(j<0||U+j>D)continue}else if(j>0||U+j<D)continue;const k=(I*z+O*V+N*W)/D;k>=0&&c(k,qe(R,w,C,I,O,N,We),t,!1)}}(t,r,0,l,s.indices,s.data,s.stride,n,o,a)}}const We=(0,d.vt)(),je=(0,d.vt)(),ke=(0,d.vt)();function qe(e,t,r,i,o,a,n){return(0,c.s)(je,e,t,r),(0,c.s)(ke,i,o,a),(0,c.b)(n,je,ke),(0,c.n)(n,n),n}const $e=1e3,Xe=1e-7;const Ye=(0,d.vt)(),Ze=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()],Je=(0,d.vt)(),Ke=(0,d.vt)(),Qe=(0,d.vt)();var et=r(13464),tt=r(76412),rt=r(57005);const it=new class{constructor(e=0){this.offset=e,this.sphere=(0,tt.c)(),this.tmpVertex=(0,d.vt)()}applyToVertex(e,t,r){const i=this.objectTransform.transform,o=(0,c.s)(ot,e,t,r),a=(0,c.e)(o,o,i),n=this.offset/(0,c.l)(a);(0,c.r)(a,a,a,n);const s=this.objectTransform.inverse;return(0,c.e)(this.tmpVertex,a,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,c.l)(e);(0,c.r)(e,e,e,r);const i=this.offset/(0,c.l)(t);(0,c.r)(t,t,t,i)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,c.l)((0,tt.g)(e)),r=this.offset/t;return(0,c.r)((0,tt.g)(this.sphere),(0,tt.g)(e),(0,tt.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,d.vt)(),this._tmpMbs=(0,tt.c)(),this._tmpObb=new rt.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,c.l)(e)}applyToVertex(e,t,r){const i=(0,c.s)(ot,e,t,r),o=(0,c.s)(at,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,c.l)(o);return(0,c.r)(this._tmpVertex,i,o,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],i=e[1],o=e[2]+t,a=e[3],n=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(i),d=Math.abs(o),u=Math.abs(a),h=Math.abs(n),m=Math.abs(s),p=.5*(1+Math.sign(r*a))*Math.min(l,u),f=.5*(1+Math.sign(i*n))*Math.min(c,h),v=.5*(1+Math.sign(o*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(p*p+f*f+v*v),E=Math.sign(l+r),A=Math.sign(c+i),b=Math.sign(d+o),S=Math.sign(u+a),y=Math.sign(h+n),M=Math.sign(m+s),R=this._totalOffset;if(T<R)return e[0]-=(1-E)*R,e[1]-=(1-A)*R,e[2]-=(1-b)*R,e[3]+=S*R,e[4]+=y*R,e[5]+=M*R,e;const w=R/Math.sqrt(g*g+_*_+x*x),C=R/T,I=C-w,O=-I;return e[0]+=r*(E*O+C),e[1]+=i*(A*O+C),e[2]+=o*(b*O+C),e[3]+=a*(S*I+w),e[4]+=n*(y*I+w),e[5]+=s*(M*I+w),e}applyToMbs(e){const t=(0,c.l)((0,tt.g)(e)),r=this._totalOffset/t;return(0,c.r)((0,tt.g)(this._tmpMbs),(0,tt.g)(e),(0,tt.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,rt.gm)(e,this._totalOffset,this._totalOffset,be.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.vt)()}applyToVertex(e,t,r){const i=(0,c.s)(ot,e,t,r),o=(0,c.g)(at,i,this.localOrigin),a=this.offset/(0,c.l)(o);return(0,c.r)(this.tmpVertex,i,o,a),this.tmpVertex}applyToAabb(e){const t=nt,r=st,i=lt;for(let o=0;o<3;++o)t[o]=e[0+o]+this.localOrigin[o],r[o]=e[3+o]+this.localOrigin[o],i[o]=t[o];const o=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=o[t],e[t+3]=o[t];const a=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let o=0;o<3;++o)i[o]=e&1<<o?r[o]:t[o];a(i)}let n=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(n|=1<<e);if(0!==n&&7!==n)for(let e=0;e<8;++e)if(!(n&e)){for(let o=0;o<3;++o)i[o]=n&1<<o?0:e&1<<o?t[o]:r[o];a(i)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const ot=(0,d.vt)(),at=(0,d.vt)(),nt=(0,d.vt)(),st=(0,d.vt)(),lt=(0,d.vt)();function ct(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length;r*=n;for(let e=0;e<s;++e){const t=2*o[e];a[r]=i[t],a[r+1]=i[t+1],r+=n}}function dt(e,t,r,i){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,null==i||1===i)for(let e=0;e<l;++e){const t=3*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],r+=s}}function ut(e,t,r,i=1){const{data:o,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===i)for(let e=0;e<l;++e){const t=4*a[e];n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<i;++e)n[r]=o[t],n[r+1]=o[t+1],n[r+2]=o[t+2],n[r+3]=o[t+3],r+=s}}function ht(e,t,r,i,o=1){const a=t.typedBuffer,n=t.typedBufferStride;if(i*=n,1===o)for(let t=0;t<r;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)a[i]=e[0],a[i+1]=e[1],a[i+2]=e[2],a[i+3]=e[3],i+=n}function mt(e,t,r,i,o,a){switch(e){case Ae.r.POSITION:{(0,ge.vA)(3===t.size);const i=o.getField(e,m.xs);(0,ge.vA)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o=1){if(!t)return void dt(e,r,i,o);const{data:a,indices:s}=e,l=r.typedBuffer,c=r.typedBufferStride,d=s.length,u=t[0],h=t[1],m=t[2],p=t[4],f=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],E=t[13],A=t[14];i*=c;let b=0,S=0,y=0;const M=(0,n.tZ)(t)?e=>{b=a[e]+T,S=a[e+1]+E,y=a[e+2]+A}:e=>{const t=a[e],r=a[e+1],i=a[e+2];b=u*t+p*r+g*i+T,S=h*t+f*r+_*i+E,y=m*t+v*r+x*i+A};if(1===o)for(let e=0;e<d;++e)M(3*s[e]),l[i]=b,l[i+1]=S,l[i+2]=y,i+=c;else for(let e=0;e<d;++e){M(3*s[e]);for(let e=0;e<o;++e)l[i]=b,l[i+1]=S,l[i+2]=y,i+=c}}(t,r,i,a);break}case Ae.r.NORMAL:{(0,ge.vA)(3===t.size);const r=o.getField(e,m.xs);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void dt(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=l[0],m=l[1],p=l[2],f=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],E=!(0,n.ut)(l),A=1e-6,b=1-A;i*=d;let S=0,y=0,M=0;const R=(0,n.tZ)(l)?e=>{S=a[e],y=a[e+1],M=a[e+2]}:e=>{const t=a[e],r=a[e+1],i=a[e+2];S=h*t+f*r+_*i,y=m*t+v*r+x*i,M=p*t+g*r+T*i};if(1===o)if(E)for(let e=0;e<u;++e){R(3*s[e]);const t=S*S+y*y+M*M;if(t<b&&t>A){const e=1/Math.sqrt(t);c[i]=S*e,c[i+1]=y*e,c[i+2]=M*e}else c[i]=S,c[i+1]=y,c[i+2]=M;i+=d}else for(let e=0;e<u;++e)R(3*s[e]),c[i]=S,c[i+1]=y,c[i+2]=M,i+=d;else for(let e=0;e<u;++e){if(R(3*s[e]),E){const e=S*S+y*y+M*M;if(e<b&&e>A){const t=1/Math.sqrt(e);S*=t,y*=t,M*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=y,c[i+2]=M,i+=d}}(t,i,r,a);break}case Ae.r.NORMALCOMPRESSED:{(0,ge.vA)(2===t.size);const r=o.getField(e,m.mJ);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ct(t,r,a);break}case Ae.r.UV0:{(0,ge.vA)(2===t.size);const r=o.getField(e,m.gH);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ct(t,r,a);break}case Ae.r.COLOR:case Ae.r.SYMBOLCOLOR:{const r=o.getField(e,m.XP);(0,ge.vA)(!!r,`No buffer view for ${e}`),(0,ge.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,i,o=1){const{data:a,indices:n}=e,s=r.typedBuffer,l=r.typedBufferStride,c=n.length;if(i*=l,t!==a.length||4!==t)if(1!==o)if(4!==t)for(let e=0;e<c;++e){const t=3*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}else for(let e=0;e<c;++e){const t=4*n[e];for(let e=0;e<o;++e)s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=a[t+3],i+=l}return}for(let e=0;e<c;++e){const t=3*n[e];s[i]=a[t],s[i+1]=a[t+1],s[i+2]=a[t+2],s[i+3]=255,i+=l}}else{s[i]=a[0],s[i+1]=a[1],s[i+2]=a[2],s[i+3]=a[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,n=e[i/=4];i+=t;const d=c*o;for(let r=1;r<d;++r)e[i]=n,i+=t}}(t,t.size,r,a);break}case Ae.r.COLORFEATUREATTRIBUTE:{const r=o.getField(e,m.Y$);(0,ge.vA)(!!r,`No buffer view for ${e}`),(0,ge.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:i,indices:o}=e,a=t.typedBuffer,n=t.typedBufferStride,s=o.length,l=i[0];r*=n;for(let e=0;e<s;++e)a[r]=l,r+=n}(t,r,a);break}case Ae.r.TANGENT:{(0,ge.vA)(4===t.size);const r=o.getField(e,m.Eq);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,i,o=1){if(!t)return void ut(e,r,i,o);const{data:a,indices:s}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=s.length,h=l[0],m=l[1],p=l[2],f=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],E=!(0,n.ut)(l),A=1e-6,b=1-A;if(i*=d,1===o)for(let e=0;e<u;++e){const t=4*s[e],r=a[t],o=a[t+1],n=a[t+2],l=a[t+3];let u=h*r+f*o+_*n,S=m*r+v*o+x*n,y=p*r+g*o+T*n;if(E){const e=u*u+S*S+y*y;if(e<b&&e>A){const t=1/Math.sqrt(e);u*=t,S*=t,y*=t}}c[i]=u,c[i+1]=S,c[i+2]=y,c[i+3]=l,i+=d}else for(let e=0;e<u;++e){const t=4*s[e],r=a[t],n=a[t+1],l=a[t+2],u=a[t+3];let S=h*r+f*n+_*l,y=m*r+v*n+x*l,M=p*r+g*n+T*l;if(E){const e=S*S+y*y+M*M;if(e<b&&e>A){const t=1/Math.sqrt(e);S*=t,y*=t,M*=t}}for(let e=0;e<o;++e)c[i]=S,c[i+1]=y,c[i+2]=M,c[i+3]=u,i+=d}}(t,i,r,a);break}case Ae.r.PROFILERIGHT:case Ae.r.PROFILEUP:case Ae.r.PROFILEVERTEXANDNORMAL:case Ae.r.FEATUREVALUE:{(0,ge.vA)(4===t.size);const r=o.getField(e,m.Eq);(0,ge.vA)(!!r,`No buffer view for ${e}`),r&&ut(t,r,a)}}}class pt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(Ae.r.POSITION).indices.length}write(e,t,r,i,o){!function(e,t,r,i,o,a){for(const n of t.fields.keys()){const t=e.attributes.get(n),s=t?.indices;if(t&&s)mt(n,t,r,i,o,a);else if(n===Ae.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(Ae.r.POSITION)?.indices;if(t){const r=t.length,i=o.getField(n,m.XP);ht(e.objectAndLayerIdColor,i,r,a)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var ft=r(19245),vt=r(91829),gt=r(53466),_t=r(72824),xt=r(35093),Tt=r(97220),Et=r(84867),At=r(39341),bt=r(34886);Z.MT.LESS,Z.MT.ALWAYS;const St={mask:255},yt={function:{func:Z.MT.ALWAYS,ref:B.dd.OutlineVisualElementMask,mask:B.dd.OutlineVisualElementMask},operation:{fail:Z.eA.KEEP,zFail:Z.eA.KEEP,zPass:Z.eA.ZERO}},Mt={function:{func:Z.MT.ALWAYS,ref:B.dd.OutlineVisualElementMask,mask:B.dd.OutlineVisualElementMask},operation:{fail:Z.eA.KEEP,zFail:Z.eA.KEEP,zPass:Z.eA.REPLACE}};Z.MT.EQUAL,B.dd.OutlineVisualElementMask,B.dd.OutlineVisualElementMask,Z.eA.KEEP,Z.eA.KEEP,Z.eA.KEEP,Z.MT.NOTEQUAL,B.dd.OutlineVisualElementMask,B.dd.OutlineVisualElementMask,Z.eA.KEEP,Z.eA.KEEP,Z.eA.KEEP;const Rt=[1,1,.5],wt=[0,.6,.2],Ct=[0,1,.2];var It=r(28491);class Ot extends _t.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,d.ci)(Rt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,d.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Me.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,d.fA)(.2,.2,.2),this.diffuse=(0,d.fA)(.8,.8,.8),this.externalColor=(0,vt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.it.Less,this.textureAlphaMode=B.sf.Blend,this.textureAlphaCutoff=xt.H,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ie.m$.Occlude,this.isDecoration=!1}}_t.gy;class Nt extends Et.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===be.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?gt.q.Default:gt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Nt.shader)}_initializeProgram(e,t){return new bt.B(e.rctx,t.get().build(this.configuration),At.D)}_makePipeline(e,t){const r=this.configuration,i=e===Oe.y.NONE,o=e===Oe.y.FrontFace;return(0,Ne.Ey)({blending:r.output!==ye.V.Color&&r.output!==ye.V.Alpha||!r.transparent?null:i?He:De(e),culling:Pt(r)?(0,Ne.Xt)(r.cullFace):null,depthTest:{func:Be(e,Ht(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?Ne.kn:null,colorWrite:Ne.wE,stencilWrite:r.hasOccludees?St:null,stencilTest:r.hasOccludees?t?Mt:yt:null,polygonOffset:i||o?null:(a=r.enableOffset,a?Fe:null)});var a}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Ht(e){return e===B.it.Lequal?Z.MT.LEQUAL:Z.MT.LESS}function Pt(e){return e.cullFace!==B.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Nt.shader=new Tt.$(It.D,(()=>r.e(5141).then(r.bind(r,5141))));var Lt=r(90237),Dt=r(99769),Ft=r(82991),Bt=r(46263);class Gt extends Ft.nW{}(0,Lt._)([(0,Dt.W)({constValue:!0})],Gt.prototype,"hasSliceHighlight",void 0),(0,Lt._)([(0,Dt.W)({constValue:!1})],Gt.prototype,"hasSliceInVertexProgram",void 0),(0,Lt._)([(0,Dt.W)({constValue:Bt.c.Pass})],Gt.prototype,"pbrTextureBindType",void 0);class Ut extends Gt{constructor(){super(...arguments),this.output=ye.V.Color,this.alphaDiscardMode=B.sf.Opaque,this.doubleSidedMode=Re.W.None,this.pbrMode=we.A9.Disabled,this.cullFace=B.s2.None,this.transparencyPassType=Oe.y.NONE,this.normalType=Me.W.Attribute,this.textureCoordinateType=gt.q.None,this.customDepthTest=B.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Lt._)([(0,Dt.W)({count:ye.V.COUNT})],Ut.prototype,"output",void 0),(0,Lt._)([(0,Dt.W)({count:B.sf.COUNT})],Ut.prototype,"alphaDiscardMode",void 0),(0,Lt._)([(0,Dt.W)({count:Re.W.COUNT})],Ut.prototype,"doubleSidedMode",void 0),(0,Lt._)([(0,Dt.W)({count:we.A9.COUNT})],Ut.prototype,"pbrMode",void 0),(0,Lt._)([(0,Dt.W)({count:B.s2.COUNT})],Ut.prototype,"cullFace",void 0),(0,Lt._)([(0,Dt.W)({count:Oe.y.COUNT})],Ut.prototype,"transparencyPassType",void 0),(0,Lt._)([(0,Dt.W)({count:Me.W.COUNT})],Ut.prototype,"normalType",void 0),(0,Lt._)([(0,Dt.W)({count:gt.q.COUNT})],Ut.prototype,"textureCoordinateType",void 0),(0,Lt._)([(0,Dt.W)({count:B.it.COUNT})],Ut.prototype,"customDepthTest",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"spherical",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasVertexColors",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasSymbolColors",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasVerticalOffset",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasSlicePlane",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasSliceHighlight",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasColorTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasMetallicRoughnessTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasEmissionTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasOcclusionTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasNormalTexture",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasScreenSizePerspective",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasVertexTangents",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasOccludees",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"multipassEnabled",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasModelTransformation",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"offsetBackfaces",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"vvSize",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"vvColor",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"receiveShadows",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"receiveAmbientOcclusion",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"textureAlphaPremultiplied",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"instanced",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"instancedColor",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"instancedDoublePrecision",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"writeDepth",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"transparent",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"enableOffset",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"cullAboveGround",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"snowCover",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasColorTextureTransform",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasEmissionTextureTransform",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasNormalTextureTransform",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasOcclusionTextureTransform",void 0),(0,Lt._)([(0,Dt.W)()],Ut.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Lt._)([(0,Dt.W)({constValue:!1})],Ut.prototype,"occlusionPass",void 0),(0,Lt._)([(0,Dt.W)({constValue:!0})],Ut.prototype,"hasVvInstancing",void 0),(0,Lt._)([(0,Dt.W)({constValue:!1})],Ut.prototype,"useCustomDTRExponentForWater",void 0),(0,Lt._)([(0,Dt.W)({constValue:!1})],Ut.prototype,"supportsTextureAtlas",void 0),(0,Lt._)([(0,Dt.W)({constValue:!0})],Ut.prototype,"useFillLights",void 0);var zt=r(57323);class Vt extends Nt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Me.W.Attribute,t.doubleSidedMode=Re.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Vt.shader)}}Vt.shader=new Tt.$(zt.R,(()=>r.e(9933).then(r.bind(r,39933))));class Wt extends Ie.im{constructor(e){super(e,kt),this.supportsEdges=!0,this.produces=new Map([[et.N.OPAQUE_MATERIAL,e=>((0,ye.XY)(e)||(0,ye.PJ)(e))&&!this.parameters.transparent],[et.N.TRANSPARENT_MATERIAL,e=>((0,ye.XY)(e)||(0,ye.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[et.N.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,ye.XY)(e)||(0,ye.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._configuration=new Ut,this._vertexBufferLayout=function(e){const t=(0,Se.BP)().vec3f(Ae.r.POSITION);return e.normalType===Me.W.Compressed?t.vec2i16(Ae.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(Ae.r.NORMAL),e.hasVertexTangents&&t.vec4f(Ae.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(Ae.r.UV0),e.hasVertexColors&&t.vec4u8(Ae.r.COLOR),e.hasSymbolColors&&t.vec4u8(Ae.r.SYMBOLCOLOR),(0,U.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(Ae.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==ye.V.Shadow&&e!==ye.V.ShadowExcludeHighlight&&e!==ye.V.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,a="replace"===e.colorMixMode,n=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?a||n:r?a?s:n:l?a||n:a?s:n}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==ye.V.Color&&e!==ye.V.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Re.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Re.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Re.W.WindingOrder:Re.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?we.A9.Schematic:we.A9.Normal:we.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,c.s)(Jt,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case be.RT.Global:a=(0,c.n)(Yt,Jt);break;case be.RT.Local:a=(0,c.c)(Yt,Xt)}let n=0;const s=(0,c.f)(Kt,Jt,e.eye),l=(0,c.l)(s),d=(0,c.h)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,c.k)(a,d)),n+=(0,ft.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,c.h)(a,a,n),(0,c.t)(Zt,a,r.transform.inverseRotation),i=(0,c.f)(qt,i,Zt),o=(0,c.f)($t,o,Zt)}var n;Ue(e,r,i,o,null!=(n=r.verticalOffset)?(it.offset=n,it):null,a)}createGLMaterial(e){return new jt(e)}createBufferWriter(){return new pt(this._vertexBufferLayout)}}class jt extends Ce.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==ye.V.Color&&this._output!==ye.V.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,c.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Vt:Nt,e)}}const kt=new class extends Ot{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},qt=(0,d.vt)(),$t=(0,d.vt)(),Xt=(0,d.fA)(0,0,1),Yt=(0,d.vt)(),Zt=(0,d.vt)(),Jt=(0,d.vt)(),Kt=(0,d.vt)(),Qt=()=>O.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function er(e){throw new I.A("",`Request for object resource failed: ${e}`)}function tr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Qt().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Qt().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Qt().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Qt().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Qt().warn("Indexed geometries must specify faces"),i=!1;break}default:Qt().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Qt().warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Qt().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function rr(e){const t=(0,u.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.iT)(t,r.bbMin),(0,u.iT)(t,r.bbMax))})),t}function ir(e){switch(e){case"mask":return B.sf.Mask;case"maskAndTransparency":return B.sf.MaskBlend;case"none":return B.sf.Opaque;default:return B.sf.Blend}}function or(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const ar=new P.R(1,2,"wosr");var nr=r(61765);async function sr(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.EM)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,w.Ke)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,H.QP)(i.error),er(i.error.details.url)}(e,r,t);const i=await(0,w.Ke)((0,R.A)(e,t));if(!0===i.ok)return i.value.data;(0,H.QP)(i.error),er(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],a=o.images[0].data;if(!a){Qt().warn("Externally referenced texture data is not yet supported");continue}const n=o.encoding+";base64,"+a,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:Z.pF.REPEAT,t:Z.pF.REPEAT},preMultiplyAlpha:ir(l)!==B.sf.Opaque},d=null!=t&&t.disableTextures?Promise.resolve(null):D(n,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,C.iL)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,a=new N,n=e.resource,s=P.R.parse(n.version||"1.0","wosr");ar.validate(s);const l=n.model.name,c=n.model.geometries,u=n.materialDefinitions??{},h=e.textures;let m=0;const p=new Map;for(let e=0;e<c.length;e++){const n=c[e];if(!tr(n))continue;const s=or(n),l=n.params.vertexAttributes,f=[],v=e=>{if("PerAttributeArray"===n.params.topology)return null;const t=n.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[Ae.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,i=v(e)??(0,L.tM)(_);f.push([e,new F.n(r,i,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!p.has(x)){const{image:e,parameters:t}=T,r=new xe(e,t);i.push(r),p.set(x,r)}const E=p.get(x),A=E?E.id:void 0,b=s.material;let S=a.get(b,x);if(null==S){const e=u[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=T?ir(T.alphaChannelUsage):void 0,n={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:A,initTextureTransparent:!0,doubleSided:!0,cullFace:B.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),S=new Wt(n),a.set(b,x,S)}o.push(S);const y=new G.V(S,f);m+=f.find((e=>e[0]===Ae.r.POSITION))?.[1]?.indices.length??0,r.push(y)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:rr(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const a=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,T.y)(new x.R(t.streamDataRequester),r.url,t,t.usePBR)),b=a.model.meta?.ESRI_proxyEllipsoid,y=a.meta.isEsriSymbolResource&&null!=b&&"EsriRealisticTreesStyle"===a.meta.ESRI_webstyle;y&&!a.customMeta.esriTreeRendering&&(a.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const a=o.attributes.position,l=a.count,u=(0,d.vt)(),h=(0,d.vt)(),p=(0,d.vt)(),f=new Uint8Array(4*l),v=new Float64Array(3*l),g=(0,n.B8)((0,s.vt)(),o.transform);let _=0,x=0;for(let n=0;n<l;n++){a.getVec(n,h),i.getVec(n,u),(0,c.e)(h,h,o.transform),(0,c.f)(p,h,t.center),(0,c.D)(p,p,t.radius);const s=p[2],l=(0,c.l)(p),d=Math.min(.45+.55*l*l,1);(0,c.D)(p,p,t.radius),null!==g&&(0,c.e)(p,p,g),(0,c.n)(p,p),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.m)(p,p,u,s>-1?.2:Math.min(-4*s-3.8,1)),v[_]=p[0],v[_+1]=p[1],v[_+2]=p[2],_+=3,f[x]=255*d,f[x+1]=255*d,f[x+2]=255*d,f[x+3]=255,x+=4}o.attributes.normal=new m.xs(v),o.attributes.color=new m.XP(f)}}}(a,b));const I=!!t.usePBR,O=a.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:y,mrrFactors:[...Ct]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...Rt]},U={...t.materialParameters,treeRendering:y},{engineResources:z,referenceBoundingBox:V}=function(e,t,r,i){const a=e.model,n=new Array,s=new Map,x=new Map,T=a.lods.length,b=(0,u.Ie)();return a.lods.forEach(((e,y)=>{const R=!0===i.skipHighLods&&(T>1&&0===y||T>3&&1===y)||!1===i.skipHighLods&&null!=i.singleLodIndex&&y!==i.singleLodIndex;if(R&&0!==y)return;const w=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=R?new Wt({}):function(e,t,r,i,o,a,n){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),h=null!=t.attributes.texCoord0,m=null!=t.attributes.normal;if(null==u)return null;const p=function(e){switch(e){case"BLEND":return B.sf.Blend;case"MASK":return B.sf.Mask;case"OPAQUE":case null:case void 0:return B.sf.Opaque}}(u.alphaMode);if(!a.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!n.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;n.set(t,new xe((0,A.x3)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,A.x3)(e)&&r,encoding:(0,A.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,p!==B.sf.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/nr.T),f=u.color[1]**(1/nr.T),v=u.color[2]**(1/nr.T),g=u.emissiveFactor[0]**(1/nr.T),_=u.emissiveFactor[1]**(1/nr.T),x=u.emissiveFactor[2]**(1/nr.T),T=null!=u.textureColor&&h?n.get(u.textureColor):null,E=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:a,occlusionTexture:n}){return null==e&&null==t&&null==o&&(null==a||(0,c.j)(a,d.uY))&&null==n&&(null==i||1===i)&&(null==r||1===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion}),b=null!=u.normalTextureTransform?.scale?u.normalTextureTransform?.scale:l.Un;a.set(s,new Wt({...i,transparent:p===B.sf.Blend,customDepthTest:B.it.Lequal,textureAlphaMode:p,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,v],ambient:[r,f,v],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?B.s2.None:B.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?Me.W.Attribute:Me.W.ScreenDerivative,castShadows:!0,receiveShadows:u.receiveShadows,receiveAmbientOcclusion:u.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&h?n.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&h?n.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&h?n.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&h?n.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:E?[...wt]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:E,colorTextureTransformMatrix:S(u.colorTextureTransform),normalTextureTransformMatrix:S(u.normalTextureTransform),scale:[b[0],b[1]],occlusionTextureTransformMatrix:S(u.occlusionTextureTransform),emissiveTextureTransformMatrix:S(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:S(u.metallicRoughnessTextureTransform),...o}))}const f=a.get(s);if(r.stageResources.materials.push(f),h){const e=e=>{null!=e&&r.stageResources.textures.push(n.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(a,e,w,t,r,s,x),{geometry:n,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,E.x)(e.indices||r,e.primitiveType),a=(0,h.oe)(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.position;(0,p.a)(a,n,e.transform,3,s);const l=[[Ae.r.POSITION,new F.n(a,i,3,!0)]];if(null!=e.attributes.normal){const t=(0,h.oe)(3*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.normal;(0,o.Ge)(lr,e.transform),(0,p.b)(t,a,lr,3,n),l.push([Ae.r.NORMAL,new F.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=(0,h.oe)(4*r),{typedBuffer:a,typedBufferStride:n}=e.attributes.tangent;(0,o.Ge)(lr,e.transform),(0,f.t)(t,a,lr,4,n),l.push([Ae.r.TANGENT,new F.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,h.oe)(2*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.texCoord0;(0,v.n)(t,o,2,a),l.push([Ae.r.UV0,new F.n(t,i,2,!0)])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.Eq?(0,f.s)(t,e.attributes.color,255):e.attributes.color instanceof m.XP?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.Uz&&(0,f.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.xs?(0,p.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.eI?(0,g.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.nS&&(0,p.s)(t,e.attributes.color,1/256,4)),l.push([Ae.r.COLOR,new F.n(t,i,4,!0)])}return{geometry:new G.V(t,l),vertexCount:r}}(e,null!=i?i:new Wt({})),M=n.boundingInfo;null!=M&&0===y&&((0,u.iT)(b,M.bbMin),(0,u.iT)(b,M.bbMax)),null!=i&&(w.stageResources.geometries.push(n),w.numberOfVertices+=T)})),R||n.push(w)})),{engineResources:n,referenceBoundingBox:b}}(a,O,U,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:z,referenceBoundingBox:V,isEsriSymbolResource:a.meta.isEsriSymbolResource,isWosr:!1}}const lr=(0,a.vt)()},1843:(e,t,r)=>{r.d(t,{BP:()=>l,l5:()=>c});var i=r(13030),o=r(90239),a=r(620);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const o=this.stride;if(o%4==0){const a=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(a)}else{const a=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(a)}return this}get usedMemory(){return this.byteLength}dispose(){}}class s{constructor(e=null){this._stride=0,this._lastAligned=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:h(e[1].constructor)}))))}freeze(){return this}vec2f(e,t){return this._appendField(e,i.gH,t),this}vec2f64(e,t){return this._appendField(e,i.si,t),this}vec3f(e,t){return this._appendField(e,i.xs,t),this}vec3f64(e,t){return this._appendField(e,i.Xm,t),this}vec4f(e,t){return this._appendField(e,i.Eq,t),this}vec4f64(e,t){return this._appendField(e,i.Aj,t),this}mat3f(e,t){return this._appendField(e,i.jZ,t),this}mat3f64(e,t){return this._appendField(e,i.j0,t),this}mat4f(e,t){return this._appendField(e,i.Sx,t),this}mat4f64(e,t){return this._appendField(e,i.E$,t),this}vec4u8(e,t){return this._appendField(e,i.XP,t),this}f32(e,t){return this._appendField(e,i.Y$,t),this}f64(e,t){return this._appendField(e,i.qB,t),this}u8(e,t){return this._appendField(e,i.SL,t),this}u16(e,t){return this._appendField(e,i.h,t),this}i8(e,t){return this._appendField(e,i.bf,t),this}vec2i8(e,t){return this._appendField(e,i.D6,t),this}vec2i16(e,t){return this._appendField(e,i.mJ,t),this}vec2u8(e,t){return this._appendField(e,i.LC,t),this}vec4u16(e,t){return this._appendField(e,i.Uz,t),this}u32(e,t){return this._appendField(e,i.P,t),this}_appendField(e,t,r){if(this._fields.has(e))return void(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._stride+=i,this._fields.set(e,{size:i,constructor:t,offset:n,optional:r})}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new s;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,r)=>e._fields.set(r,t))),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach((t=>e=Math.max(e,(0,o.GJ)(t.constructor.ElementType)))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function l(){return new s}class c{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const r={...e,constructor:u(e.constructor)};this.fields.push([t,r])})),this.stride=e.stride}}const d=[i.Y$,i.gH,i.xs,i.Eq,i.jZ,i.Sx,i.qB,i.si,i.Xm,i.Aj,i.j0,i.E$,i.SL,i.LC,i.eI,i.XP,i.h,i.Yi,i.nS,i.Uz,i.P,i.An,i.H$,i.ml,i.bf,i.D6,i.m8,i.TX,i.Qt,i.mJ,i.Vp,i.E7,i.My,i.UL,i.zD,i.Y4];function u(e){return`${e.ElementType}_${e.ElementCount}`}function h(e){return m.get(e)}const m=new Map;d.forEach((e=>m.set(u(e),e)))},46686:(e,t,r)=>{r.d(t,{i$:()=>c,oD:()=>d,xJ:()=>l});var i=r(49255),o=r(33752),a=r(47286),n=r(2597);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.G("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
283
283
  return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
284
284
  }`)}function d(e,t){const{vertex:r}=e;switch(t.output){case i.V.Color:if(t.receiveShadows)return s(e),void r.code.add(n.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.V.LinearDepth:case i.V.Shadow:case i.V.ShadowHighlight:case i.V.ShadowExcludeHighlight:return e.include(o.em,t),s(e),l(e),c(e),void r.code.add(n.H`void forwardLinearDepth() {
285
285
  linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4543],{94543:(e,t,n)=>{n.r(t),n.d(t,{loadGLTFMesh:()=>I});var r=n(68197),o=n(78888),l=n(91869),s=n(34727),u=n(77690),a=n(29242),c=n(51850),i=n(91829),f=n(16939),p=n(80882),m=n(35063),d=n(51147),x=n(1193),g=n(13030),y=n(73354),T=n(50867),b=n(90239);Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t,n){const r=e.typedBuffer,o=e.typedBufferStride,l=t.typedBuffer,s=t.typedBufferStride,u=n?n.count:t.count;let a=(n?.dstIndex??0)*o,c=(n?.srcIndex??0)*s;for(let e=0;e<u;++e){for(let e=0;e<9;++e)r[a+e]=l[c+e];a+=o,c+=s}}},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t,n){const r=e.typedBuffer,o=e.typedBufferStride,l=t.typedBuffer,s=t.typedBufferStride,u=n?n.count:t.count;let a=(n?.dstIndex??0)*o,c=(n?.srcIndex??0)*s;for(let e=0;e<u;++e){for(let e=0;e<16;++e)r[a+e]=l[c+e];a+=o,c+=s}}},Symbol.toStringTag,{value:"Module"})),n(24045);var v=n(43609),h=n(51737),w=n(78358);function A(e,t){return new e(new ArrayBuffer(t*e.ElementCount*(0,b.GJ)(e.ElementType)))}var C=n(89414),B=n(21015),E=n(4399),S=n(84498),R=n(51530),M=n(61765),_=n(63907);async function I(e,t,n){const l=new B.R(function(e){const t=e?.resolveFile;return t?{busy:!1,request:async(e,n,r)=>{const l=t?.(e)??e,s="image"===n?"image":"binary"===n?"array-buffer":"json";return(await(0,o.A)(l,{responseType:s,signal:r?.signal,timeout:0})).data}}:null}(n)),u=(await(0,E.y)(l,t,n,!0)).model,a=u.lods.shift(),f=new Map,g=new Map;u.textures.forEach(((e,t)=>f.set(t,function(e){return new m.A({data:((0,R.x3)(e.data),e.data),wrap:k(e.parameters.wrap)})}(e)))),u.materials.forEach(((e,t)=>g.set(t,function(e,t){const n=new r.A(function(e,t){return(0,i.fA)(z(e[0]),z(e[1]),z(e[2]),t)}(e.color,e.opacity)),o=e.emissiveFactor?new r.A(function(e){return(0,c.fA)(z(e[0]),z(e[1]),z(e[2]))}(e.emissiveFactor)):null,l=e=>e?new d.A({scale:e.scale?[e.scale[0],e.scale[1]]:[1,1],rotation:(0,s.KJ)(e.rotation??0),offset:e.offset?[e.offset[0],e.offset[1]]:[0,0]}):null;return new p.A({color:n,colorTexture:t.get(e.textureColor),normalTexture:t.get(e.textureNormal),emissiveColor:o,emissiveTexture:t.get(e.textureEmissive),occlusionTexture:t.get(e.textureOcclusion),alphaMode:j(e.alphaMode),alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,metallic:e.metallicFactor,roughness:e.roughnessFactor,metallicRoughnessTexture:t.get(e.textureMetallicRoughness),colorTextureTransform:l(e.colorTextureTransform),normalTextureTransform:l(e.normalTextureTransform),occlusionTextureTransform:l(e.occlusionTextureTransform),emissiveTextureTransform:l(e.emissiveTextureTransform),metallicRoughnessTextureTransform:l(e.metallicRoughnessTextureTransform)})}(e,f))));const y=$(a);for(const e of y.parts)P(y,e,g);const{position:T,normal:b,tangent:v,color:h,texCoord0:w}=y.vertexAttributes,A={position:T.typedBuffer,normal:null!=b?b.typedBuffer:null,tangent:null!=v?v.typedBuffer:null,uv:null!=w?w.typedBuffer:null,color:null!=h?h.typedBuffer:null},S=(0,C.qD)(A,e,n);return{transform:S.transform,vertexSpace:S.vertexSpace,components:y.components,spatialReference:e.spatialReference,vertexAttributes:new x.H({position:S.vertexAttributes.position,normal:S.vertexAttributes.normal,tangent:S.vertexAttributes.tangent,color:A.color,uv:A.uv})}}function F(e,t){if(null==e)return"-";const n=e.typedBuffer;return`${(0,l.tE)(t,n.buffer,(()=>t.size))}/${n.byteOffset}/${n.byteLength}`}function O(e){return null!=e?e.toString():"-"}function $(e){let t=0;const n={color:!1,tangent:!1,normal:!1,texCoord0:!1},r=new Map,o=new Map,s=[];for(const u of e.parts){const{attributes:{position:e,normal:a,color:c,tangent:i,texCoord0:f}}=u,p=`\n ${F(e,r)}/\n ${F(a,r)}/\n ${F(c,r)}/\n ${F(i,r)}/\n ${F(f,r)}/\n ${O(u.transform)}\n `;let m=!1;const d=(0,l.tE)(o,p,(()=>(m=!0,{start:t,length:e.count})));m&&(t+=e.count),a&&(n.normal=!0),c&&(n.color=!0),i&&(n.tangent=!0),f&&(n.texCoord0=!0),s.push({gltf:u,writeVertices:m,region:d})}return{vertexAttributes:{position:A(g.Xm,t),normal:n.normal?A(g.xs,t):null,tangent:n.tangent?A(g.Eq,t):null,color:n.color?A(g.XP,t):null,texCoord0:n.texCoord0?A(g.gH,t):null},parts:s,components:[]}}function P(e,t,n){t.writeVertices&&function(e,t){const{position:n,normal:r,tangent:o,color:l,texCoord0:c}=e.vertexAttributes,i=t.region.start,{attributes:f,transform:p}=t.gltf,m=f.position.count;if((0,y.d)(n.slice(i,m),f.position,p),null!=f.normal&&null!=r){const e=(0,u.Ge)((0,a.vt)(),p),t=r.slice(i,m);(0,y.c)(t,f.normal,e),(0,s.or)(e)&&(0,y.e)(t,t)}else null!=r&&(0,h.f)(r,0,0,1,{dstIndex:i,count:m});if(null!=f.tangent&&null!=o){const e=(0,u.Ge)((0,a.vt)(),p),t=o.slice(i,m);(0,T.a)(t,f.tangent,e),(0,s.or)(e)&&(0,T.n)(t,t)}else null!=o&&(0,w.f)(o,0,0,1,1,{dstIndex:i,count:m});if(null!=f.texCoord0&&null!=c?(0,v.a)(c.slice(i,m),f.texCoord0):null!=c&&(0,v.f)(c,0,0,{dstIndex:i,count:m}),null!=f.color&&null!=l){const e=f.color,t=l.slice(i,m);if(4===e.elementCount)e instanceof g.Eq?(0,T.b)(t,e,255):e instanceof g.XP?(0,w.a)(t,e):e instanceof g.Uz&&(0,T.b)(t,e,1/256);else{(0,w.f)(t,255,255,255,255);const n=g.eI.fromTypedArray(t.typedBuffer,t.typedBufferStride);e instanceof g.xs?(0,y.f)(n,e,255):e instanceof g.eI?(0,h.a)(n,e):e instanceof g.nS&&(0,y.f)(n,e,1/256)}}else null!=l&&(0,w.f)(l.slice(i,m),255,255,255,255)}(e,t);const{indices:r,attributes:o,primitiveType:l,material:c}=t.gltf;let i=(0,S.x)(r||o.position.count,l);const p=t.region.start;if(p){const e=new Uint32Array(i);for(let t=0;t<i.length;t++)e[t]+=p;i=e}e.components.push(new f.A({name:t.gltf.name,faces:i,material:n.get(c),shading:o.normal?"source":"flat",trustSourceNormals:!0}))}function j(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend"}}function k(e){return{horizontal:q(e.s),vertical:q(e.t)}}function q(e){switch(e){case _.pF.CLAMP_TO_EDGE:return"clamp";case _.pF.MIRRORED_REPEAT:return"mirror";case _.pF.REPEAT:return"repeat"}}function z(e){return e**(1/M.T)*255}}}]);