(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6c7a01e0"],{"82de":function(e,t,i){"use strict";i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return d}));var n=i("afe1"),r=i("0b2d"),s=i("8188"),o=i("f694");function a(e,t,i,r){const o=d(e,t,i),a=Object(n["d"])();return Object(s["d"])(i,o,a,r),a}const l=1,c=5-l;function d(e,t,i){const n=Object(r["f"])(),s=e[3],a=2**(Math.ceil(Math.log(s)*Math.LOG2E/c)*c+l);if(i.isGeographic){const t=a/Object(o["e"])(i).radius*180/Math.PI,r=Math.round(e[1]/t),s=Math.max(-90,Math.min(90,r*t)),l=t/Math.cos((Math.abs(s)-t/2)/180*Math.PI),c=Math.round(e[0]/l)*l;n[0]=c,n[1]=s}else{const t=Math.round(e[0]/a),i=Math.round(e[1]/a);n[0]=t*a,n[1]=i*a}const d=e[2]+t,h=Math.round(d/a);return n[2]=h*a,n}},9056:function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return st}));var n=i("a4ee"),r=i("792b"),s=i("2c4f"),o=i("e92d"),a=i("b2b2"),l=i("f4cc"),c=i("477c"),d=i("a915"),h=i("a21b"),u=i("8048"),p=i("59b2"),f=(i("b50f"),i("c120"),i("cea0"),i("d386")),b=i("e431"),g=i("47f8"),_=i("8188"),m=i("4261"),O=i("9180"),y=i("7289"),j=i("1a54"),S=i("e5ec"),v=i("4106"),x=(i("4338"),i("b5a9"),i("df3d"),i("c1da")),w=i("306f"),P=i("8076"),N=i("66af"),z=i("78ba");class I extends z["a"]{constructor(e){super("PointCloudWorker","transform",e)}getTransferList(e){const t=[e.geometryBuffer];if(Object(a["k"])(e.primaryAttributeData)&&e.primaryAttributeData.buffer&&t.push(e.primaryAttributeData.buffer),Object(a["k"])(e.modulationAttributeData)&&e.modulationAttributeData.buffer&&t.push(e.modulationAttributeData.buffer),Object(a["k"])(e.filterAttributesData))for(const i of e.filterAttributesData)Object(a["k"])(i)&&i.buffer&&t.push(i.buffer);for(const i of e.userAttributesData)i.buffer&&t.push(i.buffer);return t}}var C=i("ee9c");function R(e,t,i){for(let r=0;r=0&&(E[r]=!0,null!=A[n]?A[n].push(t[r]):A[n]=[t[r]])}for(let r=0;r=0&&(M[r]=!0,null!=k[n]?k[n].push(e[r]):k[n]=[e[r]])}const n=[];for(let r=0;r1||k[r][0]!==t[r])&&n.push({load:[t[r]],remove:k[r]});for(let r=0;r1||A[r][0]!==e[r])&&n.push({load:A[r],remove:[e[r]]});return n}const M=[!1],A=[null],E=[!1],k=[null];function F(e,t,i){let n=e;for(;n>0;){const e=t.indexOf(n);if(e>=0)return e;n=i.getParentId(n)}return t.indexOf(n)}function T(e,t,i){return e.sort((e,n)=>{if(0===e.load.length&&0===n.load.length)return 0;if(0===e.load.length)return-1;if(0===n.load.length)return 1;if(0===e.remove.length&&0===n.remove.length){const r=i.getRenderCenter(e.load[0]),s=i.getRenderCenter(n.load[0]);return Object(b["j"])(r,t)-Object(b["j"])(s,t)}if(0===e.remove.length)return-1;if(0===n.remove.length)return 1;if(1===e.load.length&&1===n.load.length){const r=i.getRenderCenter(e.load[0]),s=i.getRenderCenter(n.load[0]);return Object(b["j"])(r,t)-Object(b["j"])(s,t)}if(1===e.load.length)return-1;if(1===n.load.length)return 1;{const r=i.getRenderCenter(e.remove[0]),s=i.getRenderCenter(n.remove[0]);return Object(b["j"])(r,t)-Object(b["j"])(s,t)}})}function L(e,t,i){for(let n=0;nt&&1===r.remove.length&&V(e,r,i)}}function V(e,t,i){const n=[t.remove[0]],r=[];for(;1===n.length;){const e=n.pop();r.length=0;for(let s=0;s1?e.push({remove:[n[s]],load:r[s]}):n[s]=r[s][0]}var D=i("cee3");class q{constructor(e,t,i){this._pages=[],this.pageSize=0,this._nodeSR=null,this._renderSR=null,this._nodeSR=e,this._renderSR=t,this.pageSize=i}addPage(e,t,i=0){for(;this._pages.lengthH(e,t,i)}}function H(e,t,i){const n=e.index;if(!n.hasNodes(0,1))return;const r=e.queue;r.length=0,r.push(0);const s=e.masks;for(s.length=0,s.push(0);r.length>0;){const o=r.pop();let a=s.pop();const l=n.getNode(o),c=n.getRenderObb(o);let d=!0;if(null!=t.clippingBox){const i=1<0?d=!1:n<0&&(a|=i)}}if(i.predicate(o,l,d)){const e=l.firstChild,t=l.childCount;let c=!1;const d=G(e,n.pageSize),h=G(e+t-1,n.pageSize);for(let r=d;r<=h;r++)if(!n.hasPage(r)){i.pageMiss(o,r),c=!0;break}if(!c)for(let i=0;i({filterJSON:t.toJSON(),attributeInfo:Z(e.attributeStorageInfo,t.field)})):[]}function K(e){const t=e&&e.pointSizeAlgorithm;return t&&"splat"===t.type?t:null}function J(e){const t=e&&e.pointSizeAlgorithm;return t&&"fixed-size"===t.type?t:null}function Y(e){const t=e&&e.pointSizeAlgorithm;return!(!t||!t.type)&&"fixed-size"===t.type}function X(e,t){for(const i of e)if(i.name===t&&null!=i.attributeValues&&"UInt8"===i.attributeValues.valueType&&3===i.attributeValues.valuesPerElement)return{name:t,storageInfo:i,useElevation:!1};return null}function Z(e,t){for(const i of e)if(i.name===t){const e="embedded-elevation"===i.encoding;return{name:t,storageInfo:e?null:i,useElevation:e}}return"elevation"===t.toLowerCase()?{name:t,storageInfo:null,useElevation:!0}:null}var ee=i("05ff"),te=i("8d60");let ie=class extends te["a"]{constructor(e){super(e)}};Object(n["a"])([Object(p["b"])({constructOnly:!0,clonable:"reference"})],ie.prototype,"pointCloudMetadata",void 0),ie=Object(n["a"])([Object(f["a"])("esri.views.3d.layers.i3s.PointGraphic")],ie);var ne=i("8a44"),re=i("d791"),se=i("970c"),oe=i("0b2d"),ae=i("7577"),le=i("d18f"),ce=i("c649"),de=i("b7c2"),he=i("bea9");class ue{constructor(e){this._context=e,this._highlights=new Set}get hasHighlights(){return this._highlights.size>0}destroy(){this._highlights=null}add(e){const t=new pe(e);return this._highlights.add(t),this._enableSet(t),Object(ce["b"])(()=>this._removeSet(t))}_removeSet(e){this._disableSet(e),this._highlights.delete(e)}_enableSet(e){e.enabled||(e.enabled=!0,this._context.forEachNode(t=>this._enableSetForNode(e,t)))}_enableSetForNode(e,t){if(!e.enabled)return;const i=e.ids.get(t.id);i&&i.forEach(i=>this._context.addHighlight(t,i,e.id))}_disableSet(e){e.enabled&&(e.enabled=!1,this._context.forEachNode(t=>this._disableSetForNode(e,t)))}_disableSetForNode(e,t){e.enabled||this._context.removeHighlight(t,e.id)}nodeAdded(e){this._highlights.forEach(t=>this._enableSetForNode(t,e))}nodeRemoved(e){this._highlights.forEach(t=>this._disableSetForNode(t,e))}removeAll(){this._highlights.forEach(e=>this._disableSet(e))}}class pe{constructor(e){this.id=new he["a"](de["f"].Highlight),this.ids=new Map,this.enabled=!1;for(const t of e)Object(a["k"])(t)&&this._add(t.nodeId,t.pointId)}_add(e,t){const i=this.ids.get(e);i?i.add(t):this.ids.set(e,new Set([t]))}}var fe=i("a05b"),be=i("d272"),ge=i("6a07"),_e=i("fa1e"),me=i("9250"),Oe=i("1942"),ye=i("614d"),je=i("b7bd"),Se=i("c3a4"),ve=i("ca98"),xe=i("da35"),we=i("c829"),Pe=i("87b7"),Ne=i("bc58"),ze=i("d17d"),Ie=i("189c");class Ce extends ve["a"]{constructor(e,t,i){super(e,t,i)}initializeProgram(e){const t=Ce.shader.get(),i=this.configuration,n=t.build({output:i.output,slicePlaneEnabled:i.slicePlaneEnabled,sliceHighlightDisabled:!1,sliceEnabledForVertexPrograms:!0,drawScreenSize:i.drawScreenSize});return new we["a"](e.rctx,n,_e["a"])}initializePipeline(){return Object(Ie["g"])({depthTest:{func:ze["h"].LESS},depthWrite:Ie["e"],colorWrite:Ie["d"],stencilWrite:this.configuration.sceneHasOcludees?Pe["j"]:null,stencilTest:this.configuration.sceneHasOcludees?Pe["e"]:null})}}Ce.shader=new Se["a"](Ne["a"],()=>i.e("chunk-2d207ae6").then(i.bind(null,"a221")));class Re extends xe["a"]{constructor(){super(...arguments),this.output=fe["a"].Color,this.slicePlaneEnabled=!1,this.drawScreenSize=!1,this.sceneHasOcludees=!1}}Object(n["a"])([Object(xe["b"])({count:fe["a"].COUNT})],Re.prototype,"output",void 0),Object(n["a"])([Object(xe["b"])()],Re.prototype,"slicePlaneEnabled",void 0),Object(n["a"])([Object(xe["b"])()],Re.prototype,"drawScreenSize",void 0),Object(n["a"])([Object(xe["b"])()],Re.prototype,"sceneHasOcludees",void 0);var Me=i("7ce4"),Ae=i("0fa6"),Ee=i("3f3e");const ke={positions:[new Ee["a"](je["a"].POSITION,3,ze["k"].FLOAT,0,12)],colors:[new Ee["a"](je["a"].COLOR,3,ze["k"].UNSIGNED_BYTE,0,3,!0)]};class Fe{constructor(e){this._params=e,this.type=Oe["b"].PCL,this.isGround=!1,this._bindParameters={inverseViewport:[0,0],highlightDepthTexture:null},this._highlights=new ue({forEachNode:e=>this.forEachNode(e),addHighlight:(e,t,i)=>this._addHighlight(e,t,i),removeHighlight:(e,t)=>this._removeHighlight(e,t)}),this.canRender=!0,this.layerUid="",this._useFixedSizes=!1,this._scaleFactor=1,this._minSizePx=0,this._useRealWorldSymbolSizes=!1,this._size=0,this._sizePx=0,this._slicePlaneEnabled=!1,this._clipBox=Object(m["h"])(m["b"]),this._techniqueConfig=new Re,this.tempMatrix4=Object(se["a"])(),this.tempVec3=Object(g["c"])(),this.nodes=new ne["a"]}get needsHighlight(){return this._highlights.hasHighlights}initializeRenderContext(e){this._context=e,this._techniqueRep=this._context.shaderTechniqueRepository,e.requestRender()}uninitializeRenderContext(){}intersect(e,t,i,n){const r=Object(oe["f"])(),s=Object(oe["f"])(),o=Object(oe["f"])(),a=Object(oe["f"])(),l=Object(y["d"])(),c=e.camera.perScreenPixelRatio/2,d=e.camera.near,h=this._getSizeParams();Object(b["l"])(s,n,i);const u=1/Object(b["r"])(s);Object(b["g"])(s,s,u),Object(b["u"])(o,s),Object(ae["l"])(l,s[0],s[1],s[2],-Object(b["j"])(s,i));const p=new Ge,f=new Ge,g=new Array,_=Object(m["h"])(),O=Object(m["h"])(this._clipBox);Object(m["z"])(O,-i[0],-i[1],-i[2],O),this.nodes.forAll(y=>{const j=y.splatSize*this._scaleFactor;let S=Object(D["j"])(y.obb,l),v=Object(D["i"])(y.obb,l);S-=De(j,S+d,h,c,y.isLeaf),v-=De(j,v+d,h,c,y.isLeaf);const x=v<0,w=null!=p.dist&&null!=f.dist&&p.distv*u;if(x||w)return;const P=Ve(j,v+d,h,c,y.isLeaf);if(!Object(D["f"])(y.obb,i,s,P))return;const N=P*P;Object(D["n"])(y.obb,_),Object(m["z"])(_,-i[0],-i[1],-i[2],_);const z=!Object(m["f"])(O,_);Object(b["l"])(a,y.origin,i);const I=y.coordinates.length/3;for(let l=0;lN)continue;let v=_+d;const x=De(j,v,h,c,y.isLeaf);if(_-x<0)continue;v-=x;const w=Ve(j,v,h,c,y.isLeaf);if(S>w*w)continue;const P=(_-x)*u,I=e=>(e.point=qe(y,l,e.point),e.dist=P,e.normal=o,e.node=y,e.pointId=l,e.layerUid=this.layerUid,e);if((null==p.dist||Pf.dist)&&(null==t||t(i,n,P))&&I(f),e.options.store===Oe["c"].ALL&&(null==t||t(i,n,P))){const e=new Ge;g.push(I(e))}}});const j=e=>{const{layerUid:t,node:i,pointId:n}=e;return{point:e.point,layerUid:t,graphicUid:n,createGraphic:()=>this._params.createGraphic(i,n,e.point)}},S=(e,t)=>{const i=j(t);e.set(this.type,i,t.dist,t.normal)};if(Qe(p)){const t=e.results.min;(null==t.dist||p.distt.dist)&&S(t,f)}if(e.options.store===Oe["c"].ALL){const t=Object(le["f"])(i,n);for(const i of g){const n=Object(me["c"])(t);S(n,i),e.results.all.push(n)}}}prepareTechnique(e){if(0===this.nodes.length||e.pass!==ye["a"].MATERIAL&&e.pass!==ye["a"].MATERIAL_DEPTH&&e.pass!==ye["a"].MATERIAL_HIGHLIGHT)return null;this.nodes.forAll(t=>{null==t.vao&&this._initNode(e,t)});const t=this._getSizeParams();return this._techniqueConfig.drawScreenSize=t.drawScreenSpace,this._techniqueConfig.slicePlaneEnabled=this._slicePlaneEnabled,this._techniqueConfig.sceneHasOcludees=e.hasOccludees,this._techniqueConfig.output=e.pass===ye["a"].MATERIAL_DEPTH?fe["a"].Depth:e.pass===ye["a"].MATERIAL_HIGHLIGHT?fe["a"].Highlight:fe["a"].Color,this._techniqueRep.releaseAndAcquire(Ce,this._techniqueConfig,this._technique)}render(e,t){const i=e.rctx,n=i.useTechnique(t),r=this._clipBox,s=!Object(m["l"])(r,m["b"],(e,t)=>e===t);s||(Object(b["y"])(this.tempVec3,-1/0,-1/0,-1/0),n.setUniform3fv("clipMin",this.tempVec3),Object(b["y"])(this.tempVec3,1/0,1/0,1/0),n.setUniform3fv("clipMax",this.tempVec3)),n.setUniformMatrix4fv("proj",e.camera.projectionMatrix),e.pass===ye["a"].MATERIAL_DEPTH&&n.setUniform2fv("nearFar",e.camera.nearFar),e.isHighlightPass&&(this._bindParameters.inverseViewport[0]=1/e.camera.fullViewport[2],this._bindParameters.inverseViewport[1]=1/e.camera.fullViewport[3],this._bindParameters.highlightDepthTexture=e.highlightDepthTexture,Object(ge["b"])(n,this._bindParameters));const o=this._getSizeParams(),a=e.camera.pixelRatio;o.drawFixedSize&&n.setUniform2f("pointScale",o.fixedSize*a,e.camera.fullHeight);const l=this._slicePlaneEnabled?e.sliceHelper&&e.sliceHelper.plane:null;this.nodes.forAll(c=>{if(0===c.coordinates.length||e.isHighlightPass&&!c.highlights)return;if(n.setUniform2f("screenMinMaxSize",o.screenMinSize*a,Le(c.isLeaf)*a),!o.drawFixedSize){const t=c.splatSize*this._scaleFactor;n.setUniform2f("pointScale",t*a,e.camera.fullHeight/a)}const d=c.origin;s&&(Object(b["y"])(this.tempVec3,r[0]-d[0],r[1]-d[1],r[2]-d[2]),n.setUniform3fv("clipMin",this.tempVec3),Object(b["y"])(this.tempVec3,r[3]-d[0],r[4]-d[1],r[5]-d[2]),n.setUniform3fv("clipMax",this.tempVec3)),Object(re["g"])(this.tempMatrix4,d),Object(re["n"])(this.tempMatrix4,e.camera.viewMatrix,this.tempMatrix4),n.setUniformMatrix4fv("modelView",this.tempMatrix4),Object(be["b"])(n,t.configuration,l,{origin:d}),i.bindVAO(c.vao),e.isHighlightPass?this._renderHighlightFragments(i,c):i.drawArrays(ze["r"].POINTS,0,c.coordinates.length/3)})}_renderHighlightFragments(e,t){const i=t.highlights;if(Object(a["j"])(i))return;let n=Object(a["t"])(i[0].component),r=n+1;for(let o=1;o0&&e.drawArrays(ze["r"].POINTS,n,i),n=t}r=t+1}const s=r-n;s>0&&e.drawArrays(ze["r"].POINTS,n,s)}set useFixedSizes(e){this._useFixedSizes!==e&&(this._useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._useFixedSizes}set scaleFactor(e){this._scaleFactor!==e&&(this._scaleFactor=e,this._requestRender())}get scaleFactor(){return this._scaleFactor}set minSizePx(e){this._minSizePx!==e&&(this._minSizePx=e,this._requestRender())}get minSizePx(){return this._minSizePx}set useRealWorldSymbolSizes(e){this._useRealWorldSymbolSizes!==e&&(this._useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._useRealWorldSymbolSizes}set size(e){this._size!==e&&(this._size=e,this._requestRender())}get size(){return this._size}set sizePx(e){this._sizePx!==e&&(this._sizePx=e,this._requestRender())}get sizePx(){return this._sizePx}set clippingBox(e){Object(m["B"])(this._clipBox,e||m["b"])}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this.nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let t=null;return this.nodes.filterInPlace(i=>i.id!==e||(t=i,i.vao=Object(a["e"])(i.vao),this._highlights.nodeRemoved(i),!1)),this._requestRender(),t}forEachNode(e){this.nodes.forAll(e)}removeAll(){this.nodes.forAll(e=>e.vao=Object(a["e"])(e.vao)),this._highlights.removeAll(),this.nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,t,i){e.highlights=Ue(e.highlights,t,i),this._requestRender()}_removeHighlight(e,t){e.highlights=We(e.highlights,t),this._requestRender()}_initNode(e,t){const i=e.rctx;t.vao=new Ae["a"](i,_e["a"],ke,{positions:Me["a"].createVertex(i,ze["D"].STATIC_DRAW,t.coordinates),colors:Me["a"].createVertex(i,ze["D"].STATIC_DRAW,t.rgb)})}_requestRender(){this._context&&this._context.requestRender()}_getSizeParams(){const e=this._useFixedSizes,t=e&&!this._useRealWorldSymbolSizes;return{drawScreenSpace:t,drawFixedSize:e,fixedSize:t?this._sizePx:this._size,screenMinSize:e?0:this._minSizePx}}}function Te(e){return e.hasOwnProperty("splatSize")}function Le(e){return e?256:64}function Ve(e,t,i,n,r){if(i.drawScreenSpace)return i.fixedSize*t*n;const s=Le(r)*t*n;return i.drawFixedSize?Math.min(i.fixedSize/2,s):i.screenMinSize>0?Math.min(Math.max(i.screenMinSize*t*n,e/2),s):Math.min(e/2,s)}function De(e,t,i,n,r){return i.drawScreenSpace?0:Ve(e,t,i,n,r)}function qe(e,t,i){return Object(a["j"])(i)&&(i=Object(oe["f"])()),i[0]=e.origin[0]+e.coordinates[3*t],i[1]=e.origin[1]+e.coordinates[3*t+1],i[2]=e.origin[2]+e.coordinates[3*t+2],i}function He(e){return Object(a["k"])(e.component)?e.component:-1}function Ue(e,t,i){Object(a["j"])(e)&&(e=[]);const n={component:t,id:i};e.push(n);const r=He(n);let s=e.length-1;for(;s>0&&re.id!==t);return 0===i.length?null:i}class Ge{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function Qe(e){return Object(a["k"])(e.dist)&&Object(a["k"])(e.point)&&Object(a["k"])(e.pointId)&&Object(a["k"])(e.node)}var Be=i("f7f0"),$e=i("4b49"),Ke=i("2aa2"),Je=i("deae"),Ye=i("badc"),Xe=i("365a"),Ze=i("5e70"),et=i("9305");const tt=o["a"].getLogger("esri.views.3d.layers.PointCloudLayerView3D"),it=8,nt=Object(y["d"])();let rt=class extends(Object(Be["a"])(Object(N["a"])(Xe["a"]))){constructor(){super(...arguments),this.type="point-cloud-3d",this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._nodeScales=new Map,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new w["a"],this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[]}get pointScale(){const e=K(this.layer&&this.layer.renderer),t=1;return e&&null!=e.scaleFactor?e.scaleFactor:t}get useRealWorldSymbolSizes(){const e=J(this.layer&&this.layer.renderer),t=!1;return e&&null!=e.useRealWorldSymbolSizes?e.useRealWorldSymbolSizes:t}get pointSize(){const e=J(this.layer&&this.layer.renderer),t=0;return e&&null!=e.size?e.size:t}get inverseDensity(){const e=96;return this.layer&&this.layer.renderer?1*e/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=B(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.primaryAttribute.name);const i=$(this.layer);if(i)for(const n of i)t.add(n.attributeInfo.name);if(this.layer.outFields)for(const n of Object(x["u"])(this.layer.fieldsIndex,this.layer.outFields))t.add(n);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=Object(m["h"])(),t=this.view.renderSpatialReference;return Object($e["a"])(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;if(e&&"absolute-height"===e.mode){const t=Object(u["g"])(this.layer.spatialReference),i=Object(P["a"])(e.unit);return Object(a["u"])(e.offset,0)*i/t}return 0}initialize(){const e=this.view.resourceController;this._worker=new I(t=>e.schedule(t)),this.addResolvingPromise(this._worker.promise),this._tmpPoint=Object(j["j"])(0,0,0,this.layer.spatialReference),Object(C["d"])(this.layer),Object(C["c"])(this.layer,this.view),this._indexRequester=e.createStreamDataRequester(Ke["a"].I3S_INDEX),this._dataRequester=e.createStreamDataRequester(Ke["a"].I3S_DATA),this._initRenderer();const t=this._initNodePages(),i=this.view.resourceController.memoryController;this._memCache=i.newCache(this.layer.uid),this.updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),c["a"]),this.updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),c["a"]),this.updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),c["a"]),this.updatingHandles.add(()=>this.layer.filters,()=>this._reload(),c["a"]),this.updatingHandles.add(()=>this.layer.outFields,()=>this._reload(),c["a"]),this.updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded()),this.updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded()),this.handles.add([this.view.basemapTerrain.on("scale-change",e=>this._scaleUpdateHandler(e)),i.events.on("quality-changed",()=>this._setUpdateViewNeeded())]),this.addResolvingPromise(t),this.when(()=>{this.handles.add([e.scheduler.registerTask(et["c"].POINT_CLOUD_LAYER,this),e.scheduler.registerIdleStateCallbacks(()=>this._idleBegin(),()=>this._idleEnd()),this.updatingHandles.add(()=>this.suspended,e=>{e?this._clearNodeState():this._setUpdateViewNeeded()},c["a"])])},()=>{this.updatingHandles.removeAll(),this.handles.removeAll()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker&&(this._worker.destroy(),this._worker=null),this._destroyRenderer(),this._memCache.destroy(),this._memCache=null,this._codedDomainPopulationAbortController&&(this._codedDomainPopulationAbortController.abort(),this._codedDomainPopulationAbortController=null),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new Fe({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerUid=this.layer.uid,this.updatingHandles.add(()=>this._clippingBox,e=>this._renderer.clippingBox=e,c["a"]),this.updatingHandles.add(()=>this.suspended,e=>this._setPointsVisible(!e),c["a"]),this.updatingHandles.add(()=>this.pointScale,e=>this._renderer.scaleFactor=e,c["a"]),this._renderer.minSizePx=Math.sqrt(2),this.updatingHandles.add(()=>this.useRealWorldSymbolSizes,e=>this._renderer.useRealWorldSymbolSizes=e,c["a"]),this.updatingHandles.add(()=>this.pointSize,e=>{const t=Object(d["g"])(e);this._renderer.size=e,this._renderer.sizePx=t},c["a"]),this.updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._renderer.slicePlaneEnabled=e,c["a"]),this.updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),c["a"]),this.updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),c["a"]),this.updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor,e=>{this._lodFactor=e,this._setUpdateViewNeeded()},c["a"])}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i){const n=Object(a["k"])(e.pointIdFilterMap)?e.pointIdFilterMap[t]:t,r=this.view.computeMapPointFromVec3d(i),s=this._createGraphicAttributes(e,n);return new ie({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:n,epoch:this._nodeLoadEpoch},geometry:r,attributes:s,layer:this.layer,sourceLayer:this.layer})}_createGraphicAttributes(e,t){const i={};for(const n of e.attributes)this._encodeGraphicAttribute(n.attributeInfo,n.values,t,i);return i}_encodeGraphicAttribute(e,t,i,n){const r=e.storageInfo&&e.storageInfo.attributeValues,s=r?r.valuesPerElement:1;if(1===s)n[e.name]=t[i];else if("UInt8"===r.valueType&&s<=4){let r=0;const o=i*s;for(let e=o;e{if(!this._renderedNodes.has(i))return void this._nodeScales.delete(i);const n=this._index.getNode(i);Object(O["h"])(at,n.obb.center)&&this._nodeScales.set(i,e.scale)}),this._setUpdateViewNeeded()):this._nodeScales.clear()}_displayNodes(e){this._workQueue=R([...this._renderedNodes],e,this._index),T(this._workQueue,this.view.state.contentCamera.viewForward,this._index),L(this._workQueue,it,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach(({abortController:t})=>e.push(t)),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach(t=>t.load.forEach(t=>e.add(t)));const t=new Array,i=new Map;this._loadingNodes.forEach((n,r)=>{e.has(r)?i.set(r,n):t.push(n)}),this._loadingNodes=i;for(const{abortController:n}of t)n.abort();this._workQueue=this._workQueue.filter(e=>{for(const t of e.load)if(this._loadingNodes.has(t))return this._recalcWork=!0,!1;return!0}),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach(({abortController:e})=>e.abort()),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach(e=>this._removeFromRenderer(e)),this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get running(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.running}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const e=this._isRootNodeVisible();e!==this._layerIsVisible&&(this._layerIsVisible=e,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run(()=>this._updateWorkQueues());this._indexQueue.length>0&&e.run(()=>this._processIndexQueue()););this._processWorkQueue(e),this._idleQueue.runTask(e)}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then(t=>{this._index.addPage(e,t,this._elevationOffset),this._setUpdateViewNeeded()}).then(()=>{this._indexPagesLoading.delete(e)},()=>{this._indexPagesLoading.delete(e)}),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(Object(a["j"])(t))return;this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const e=this._workQueue.shift();if(!e.remove.find(e=>!this._renderedNodes.has(e)))return e;this._workQueue.push(e)}return null}_processWorkEntry(e){if(0!==e.load.length)Promise.all(e.load.map(e=>{const t=new AbortController,i=this._memCache.pop(e.toString());return Object(a["k"])(i)?this._loadingNodes.set(e,{abortController:t,promise:Promise.resolve(i)}):this._loadingNodes.has(e)||this._loadingNodes.set(e,{abortController:t,promise:this._loadNode(e,t.signal)}),this._loadingNodes.get(e).promise})).then(t=>{for(let i=0;i{}).then(()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&!this._idleQueue.running&&0===this._indexQueue.length&&0===this._loadingNodes.size&&(this._recalcWork=!1,this._setUpdateViewNeeded())}),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async _populateClassCodeCodedDomain(e,t){const i="CLASS_CODE",n=this.layer.fieldsIndex.get(i);if(!n||n.domain)return;if(-1===e.indexOf(n.name))return;const s=await Object(r["d"])(this.layer.queryCachedStatistics(i,{signal:t}));if(!1===s.ok)return;const o=s.value,a=o&&o.labels&&o.labels.labels;a&&Array.isArray(a)&&(n.domain=new v["a"]({name:"CLASS_CODE",codedValues:a.map(e=>new S["a"]({code:e.value,name:e.label}))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then(()=>{this._codedDomainPopulationAbortController=null})),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const i=this._splitGraphicsPerNode(e),n=this.layer.attributeStorageInfo,s=t.map(e=>Z(n,e)),o=async(e,t)=>{const i=this._index.getNode(t);await Object(r["b"])(s,async t=>{const n=t.useElevation?await this._loadElevationAttributeFromGeometry(i.resourceId):await this._loadAndParseAttribute(i,t);if(n)for(const i of e)if(this._isValidPointGraphic(i)){const e=i.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(t,n,e,i.attributes)}})},a=[];return i.forEach((e,t)=>{a.push(o(e,t))}),await Object(l["j"])(a),e}_isValidPointGraphic(e){return e instanceof ie&&e.pointCloudMetadata&&e.pointCloudMetadata.epoch===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const e=i.pointCloudMetadata,n=t.get(e.nodeId);n?n.push(i):t.set(e.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return Object(a["k"])(i)?Object(ee["d"])({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=Object(ee["e"])(t,await this._loadGeometry(e,null));return Object(ee["a"])(i,i.length/3)}highlight(e){if(!e)return{remove(){}};const t=s["a"].isCollection(e)?e.toArray():Array.isArray(e)?e:[e];return this._renderer.highlight(t.map(e=>this._graphicToPointDefinition(e)))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return null!=t&&null!=i?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new q(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=null!=e.nodesPerPage?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then(e=>{this._index.addPage(0,e,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()})}_loadNodePage(e){const t=new AbortController,i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then(t=>t.nodes.map((t,i)=>({resourceId:null!=t.resourceId?t.resourceId:e*this._index.pageSize+i,obb:t.obb,firstChild:t.firstChild,childCount:t.childCount,vertexCount:null!=t.vertexCount?t.vertexCount:t.pointCount,lodThreshold:null!=t.lodThreshold?t.lodThreshold:t.effectiveArea}))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;let e=this.inverseDensity/this._lodFactor*this._getLodMemoryFactor();const t=this.maximumPointCount*this._lodFactor*this._getLodMemoryFactor();let i=this._computeNodesForMinimumDensity(e),n=this._computePointCount(i),r=Math.sqrt(n/(.75*t));for(;n>t;)e*=r,i=this._computeNodesForMinimumDensity(e),n=this._computePointCount(i),r=Math.sqrt(2);return this._displayNodes(i),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i(e=n,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,n=this._clippingBox,r=t.viewForward,s=Object(b["j"])(r,t.eye),o=Object(y["f"])(r,-s,nt),a=t.perScreenPixelRatio/2,l=e*e,c=this._nodeIdArray;c.length=0;const{minScale:d,maxScale:h}=Object(Ze["a"])(this.layer),u=0===d&&0===h?e=>c.push(e):e=>{const t=this._getScale(e);Object(Ze["e"])(t,d,h)&&c.push(e)};return this._traverseVisible({frustum:i,clippingBox:n},{predicate:(e,t,i)=>{if(!i)return!1;if(0===t.childCount)return u(e),!1;const n=this._index.getRenderObb(e);return!(this._computeAveragePixelArea(n,t.lodThreshold,t.vertexCount,o,a)<=l)||(u(e),!1)},pageMiss:(e,t)=>{u(e),this._indexQueue.indexOf(t)<0&&this._indexQueue.push(t)}}),c}_getScale(e){let t=this._nodeScales.get(e);if(null==t){const i=this._index.getNode(e).obb.center;this._tmpPoint.x=i[0],this._tmpPoint.y=i[1],this._tmpPoint.z=i[2],t=this.view.basemapTerrain.getScale(this._tmpPoint),this._nodeScales.set(e,t)}return t}_computeAveragePixelArea(e,t,i,n,r){const s=1e-7,o=Math.max(s,Object(D["j"])(e,n));return t/(o*o)/(4*r*r)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw Object(l["m"])(i)||tt.error(i),i}}async _loadAdditionalUserAttributes(e,t,i){const n=this.layer.outFields;if(!n)return[];const r=Object(x["u"])(this.layer.fieldsIndex,n),s=new Set(e.map(e=>Object(a["k"])(e)?e.name:null)),o=this.layer.attributeStorageInfo,c=[];for(const a of r){if(s.has(a))continue;const e=Z(o,a);e&&c.push(t(e))}const d=await Object(l["k"])(c);return Object(l["v"])(i),Object(a["o"])(d,e=>e)}async _loadNodeAsync(e,t){const i=this._index.getNode(e),n=B(this.layer),r=$(this.layer),s=i.resourceId,o=async e=>{if(Object(a["j"])(e))return null;if(e.useElevation)return{attributeInfo:e,buffer:null};const i=await this._loadAttribute(s,e,t);return Object(a["k"])(i)?{attributeInfo:e,buffer:i}:null};return this._idleQueue.push(async()=>{const i=this._loadGeometry(s,t),{primaryAttribute:a,modulationAttribute:c}=n,d=o(a),h=o(c),u=r.map(e=>e.attributeInfo),p=u.map(e=>o(e)),f=this._loadAdditionalUserAttributes([a,c,...u],o,t),[b,g,_,m,O]=await Promise.all([i,d,h,Promise.all(p),f]);Object(l["v"])(t);const y={geometryBuffer:b,primaryAttributeData:g,modulationAttributeData:_,filterAttributesData:m,userAttributesData:O,schema:this.layer.store.defaultGeometrySchema,rendererInfo:n,filterInfo:r,obb:this._index.getRenderObb(e),elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(y,t)},t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(Object(a["j"])(t)||!t.storageInfo)return null;const n=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${n}`,i)}_requestNodePage(e,t){const i={f:"json",token:this.layer.apiKey};return this._indexRequester.request(e,"json",{query:i,signal:t})}_requestData(e,t){return this._dataRequester.request(e,"binary",{query:{token:this.layer.apiKey},signal:t})}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._nodeScales.delete(e),this._memCache.put(t.id.toString(),t,ot(t))}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),n=Math.sqrt(i.lodThreshold/i.vertexCount),r=this._index.getRenderObb(e);if(Te(t))return t.splatSize=n,t.obb=r,t.origin=Object(g["a"])(t.obb.center),t;const s=.01*Math.max(r.halfSize[0],r.halfSize[1],r.halfSize[2]);if(t.obb.halfSize[0]>r.halfSize[0]+s||t.obb.halfSize[1]>r.halfSize[1]+s||t.obb.halfSize[2]>r.halfSize[2]+s){if(this._maxLoggedBoxWarnings>0){const i=e=>`[${e.halfSize[0]}, ${e.halfSize[1]}, ${e.halfSize[2]}]`;tt.warn(`Node ${e} reported bounding box too small. got ${i(r)} but points cover ${i(t.obb)}`),0==--this._maxLoggedBoxWarnings&&tt.warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,t.obb)}return{id:e,coordinates:t.points,origin:Object(g["a"])(r.center),rgb:t.rgb,attributes:t.attributes,pointIdFilterMap:t.pointIdFilterMap,highlights:null,splatSize:n,obb:r,isLeaf:0===i.childCount}}getUsedMemory(){let e=0;return this._renderer.forEachNode(t=>{e+=lt,e+=Object(h["a"])(t.coordinates);for(const i of t.attributes){const t=i.values;Object(h["c"])(t.buffer)&&(e+=Object(h["a"])(t))}}),e}getUnloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce((e,t)=>e+this._index.getNode(t).vertexCount);let i=this._loadingNodes.size;for(let n=0;ne+this._index.getNode(t).vertexCount,0),maximumNumberOfFeatures:this.maximumPointCount,totalNumberOfFeatures:-1,core:null,"Loading Nodes":this._loadingNodes.size,"Index Queue":this._indexQueue.length,"Work Queue":this._workQueue.length,"Idle Queue":this._idleQueue.length}}get test(){return{index:this._index,visibleNodes:this._renderedNodes}}};Object(n["a"])([Object(p["b"])()],rt.prototype,"layer",void 0),Object(n["a"])([Object(p["b"])({readOnly:!0,aliasOf:"layer.parsedUrl.path"})],rt.prototype,"baseUrl",void 0),Object(n["a"])([Object(p["b"])({readOnly:!0})],rt.prototype,"pointScale",null),Object(n["a"])([Object(p["b"])({readOnly:!0})],rt.prototype,"useRealWorldSymbolSizes",null),Object(n["a"])([Object(p["b"])({readOnly:!0})],rt.prototype,"pointSize",null),Object(n["a"])([Object(p["b"])({readOnly:!0})],rt.prototype,"inverseDensity",null),Object(n["a"])([Object(p["b"])()],rt.prototype,"maximumPointCount",void 0),Object(n["a"])([Object(p["b"])({readOnly:!0})],rt.prototype,"availableFields",null),Object(n["a"])([Object(p["b"])({readOnly:!0})],rt.prototype,"_clippingBox",null),Object(n["a"])([Object(p["b"])({readOnly:!0})],rt.prototype,"_elevationOffset",null),Object(n["a"])([Object(p["b"])({type:Boolean})],rt.prototype,"slicePlaneEnabled",void 0),Object(n["a"])([Object(p["b"])()],rt.prototype,"updating",void 0),Object(n["a"])([Object(p["b"])(Je["a"])],rt.prototype,"updatingProgress",void 0),Object(n["a"])([Object(p["b"])({readOnly:!0})],rt.prototype,"updatingProgressValue",null),rt=Object(n["a"])([Object(f["a"])("esri.views.3d.layers.PointCloudLayerView3D")],rt);const st=rt;function ot(e){return 5*e.coordinates.length+128}const at=Object(O["l"])(),lt=160},ad73:function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),i.d(t,"b",(function(){return s}));var n=i("b2b2"),r=i("c1da");async function s(e,t=e.popupTemplate){if(!Object(n["k"])(t))return[];const i=await t.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:s}=t,{objectIdField:o,typeIdField:a,globalIdField:l,relationships:c}=e;if(i.includes("*"))return["*"];const d=s?await Object(r["n"])(e):[],h=Object(r["j"])(e.fieldsIndex,[...i,...d]);return a&&h.push(a),h&&o&&e.fieldsIndex.has(o)&&-1===h.indexOf(o)&&h.push(o),h&&l&&e.fieldsIndex.has(l)&&-1===h.indexOf(l)&&h.push(l),c&&c.forEach(t=>{const{keyField:i}=t;h&&i&&e.fieldsIndex.has(i)&&-1===h.indexOf(i)&&h.push(i)}),h}function o(e,t){return e.popupTemplate?e.popupTemplate:Object(n["k"])(t)&&t.defaultPopupTemplateEnabled&&Object(n["k"])(e.defaultPopupTemplate)?e.defaultPopupTemplate:null}},bc58:function(e,t,i){"use strict";i.d(t,"a",(function(){return h})),i.d(t,"b",(function(){return d}));var n=i("a05b"),r=i("d272"),s=i("6a07"),o=i("501b"),a=i("3886"),l=i("690a"),c=i("b7bd");function d(e){const t=new l["a"],i=e.output===n["a"].Color,d=e.output===n["a"].Depth,h=e.output===n["a"].Highlight;return t.extensions.add("GL_OES_standard_derivatives"),t.include(r["a"],e),t.attributes.add(c["a"].POSITION,"vec3"),t.attributes.add(c["a"].COLOR,"vec3"),t.vertex.uniforms.add("modelView","mat4").add("proj","mat4").add("screenMinMaxSize","vec2").add("pointScale","vec2").add("clipMin","vec3").add("clipMax","vec3"),d?(t.vertex.uniforms.add("nearFar","vec2"),t.varyings.add("depth","float")):e.output!==n["a"].Highlight&&t.varyings.add("vColor","vec3"),t.vertex.code.add(a["a"]` void main(void) { // Move clipped points outside of clipspace if (position.x < clipMin.x || position.y < clipMin.y || position.z < clipMin.z || position.x > clipMax.x || position.y > clipMax.y || position.z > clipMax.z) { gl_Position = vec4(0.0,0.0,0.0,2.0); gl_PointSize = 0.0; return; } if (rejectBySlice(position)) { gl_Position = vec4(0.0,0.0,0.0,2.0); gl_PointSize = 0.0; return; } // Position in camera space vec4 camera = modelView * vec4(position, 1.0); float pointSize = pointScale.x; vec4 position = proj * camera; ${e.drawScreenSize?a["a"]` float clampedScreenSize = pointSize;`:a["a"]` float pointRadius = 0.5 * pointSize; vec4 cameraOffset = camera + vec4(0.0, pointRadius, 0.0, 0.0); vec4 positionOffset = proj * cameraOffset; float radius = abs(positionOffset.y - position.y); float viewHeight = pointScale.y; // screen diameter = (2 * r / w) * (h / 2) float screenPointSize = (radius / position.w) * viewHeight; float clampedScreenSize = clamp(screenPointSize, screenMinMaxSize.x, screenMinMaxSize.y); // Shift towards camera, to move rendered point out of terrain i.e. to // the camera-facing end of the virtual point when considering it as a // 3D sphere. camera.xyz -= normalize(camera.xyz) * pointRadius * clampedScreenSize / screenPointSize; position = proj * camera;`} gl_PointSize = clampedScreenSize; gl_Position = position; ${d?a["a"]`depth = (-camera.z - nearFar[0]) / (nearFar[1] - nearFar[0]);`:""} ${i?a["a"]`vColor = color;`:""} } `),t.fragment.include(o["a"],e),h&&t.include(s["a"]),t.fragment.code.add(a["a"]` void main(void) { vec2 vOffset = gl_PointCoord - vec2(0.5, 0.5); float r2 = dot(vOffset, vOffset); if (r2 > 0.25) { discard; } ${d?a["a"]`gl_FragColor = float2rgba(depth);`:""} ${h?a["a"]`outputHighlight();`:""} ${i?a["a"]`gl_FragColor = vec4(vColor, 1.0);`:""} } `),t}const h=Object.freeze({__proto__:null,build:d})},ee9c:function(e,t,i){"use strict";i.d(t,"a",(function(){return L})),i.d(t,"b",(function(){return pe})),i.d(t,"c",(function(){return oe})),i.d(t,"d",(function(){return se})),i.d(t,"e",(function(){return ne})),i.d(t,"f",(function(){return ie})),i.d(t,"g",(function(){return X})),i.d(t,"h",(function(){return ee})),i.d(t,"i",(function(){return we})),i.d(t,"j",(function(){return R})),i.d(t,"k",(function(){return A})),i.d(t,"l",(function(){return D})),i.d(t,"m",(function(){return M})),i.d(t,"n",(function(){return Y})),i.d(t,"o",(function(){return $})),i.d(t,"p",(function(){return F})),i.d(t,"q",(function(){return K})),i.d(t,"r",(function(){return ue})),i.d(t,"s",(function(){return J})),i.d(t,"t",(function(){return V})),i.d(t,"u",(function(){return E})),i.d(t,"v",(function(){return ce})),i.d(t,"w",(function(){return fe})),i.d(t,"x",(function(){return de})),i.d(t,"y",(function(){return q}));var n=i("2eab"),r=i("b50f"),s=i("ce50"),o=i("c120"),a=i("b2b2"),l=i("f4cc"),c=i("a21b"),d=i("1c92"),h=i("dae5"),u=i("d791"),p=i("afe1"),f=i("04f0"),b=i("e764"),g=i("e431"),_=i("0b2d"),m=i("0fc4"),O=i("8188"),y=i("f694"),j=i("5996"),S=i("9180"),v=i("7f83"),x=i("69dd"),w=i("ad64"),P=i("82de"),N=i("ec13"),z=i("caf1"),I=i("cee3");function C(e){return e&&parseInt(e.substring(e.lastIndexOf("/")+1,e.length),10)}function R(e){if(Object(o["a"])("disable-feature:i3s-draco")||!e)return!1;for(const i of e)for(const e of i.geometryBuffers){var t;if("draco"===(null==(t=e.compressedAttributes)?void 0:t.encoding))return!0}return!1}function M(e,t,i,n,r,s){r.traverse(i,i=>{let r=i.mbs;t!==n&&(r=T,Object(O["o"])(i.mbs,n,r,t));const o=V(e,r);return o!==L.OUTSIDE&&(s(i,o),!0)})}function A(e,t,i){let n=0,r=0;for(let s=0;s=0===t&&(i[s]=i[n],s++),n++;i.length=s}const k=Object(S["l"])();function F(e,t){if(0===t.rotationScale[1]&&0===t.rotationScale[2]&&0===t.rotationScale[3]&&0===t.rotationScale[5]&&0===t.rotationScale[6]&&0===t.rotationScale[7])return k[0]=(e[0]-t.position[0])/t.rotationScale[0],k[1]=(e[1]-t.position[1])/t.rotationScale[4],k[2]=(e[2]-t.position[0])/t.rotationScale[0],k[3]=(e[3]-t.position[1])/t.rotationScale[4],k}const T=Object(m["e"])();var L;function V(e,t){const i=t[0],n=t[1],r=t[3],s=e[0]-i,o=i-e[2],a=e[1]-n,l=n-e[3],c=Math.max(s,o,0),d=Math.max(a,l,0),h=c*c+d*d;return h>r*r?L.OUTSIDE:h>0?L.INTERSECTS_CENTER_OUTSIDE:-Math.max(s,o,a,l)>r?L.INSIDE:L.INTERSECTS_CENTER_INSIDE}function D(e,t,i){const n=[],r=i&&i.missingFields,s=i&&i.originalFields;for(const o of e){const e=o.toLowerCase();let i=!1;for(const r of t)if(e===r.name.toLowerCase()){n.push(r.name),i=!0,s&&s.push(o);break}!i&&r&&r.push(o)}return n}async function q(e,t,i,n,o){if(0===t.length)return[];const l=e.attributeStorageInfo;if(Object(a["k"])(e.associatedLayer))try{return await U(e.associatedLayer,t,i,n)}catch(c){if(e.associatedLayer.loaded)throw c}if(l){const c=H(t,i,o);if(Object(a["j"])(c))throw new s["a"]("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const d=e.parsedUrl.path,h=await Promise.all(c.map(e=>G(d,l,e.node,e.indices,n).then(t=>{for(let i=0;i=0){let e=n.get(i.node);e||(e={node:i.node,indices:[],graphics:[]},r.push(e),n.set(i.node,e)),e.indices.push(a),e.graphics.push(o);for(let i=t;i>0;i--)s[i]=s[i-1];s[0]=i;break}}}return r}async function U(e,t,i,n){t.sort((e,t)=>e.attributes[i]-t.attributes[i]);const r=t.map(e=>e.attributes[i]),s=[],o=D(n,e.fields,{originalFields:s}),a=await W(e,r,o);for(let l=0;ln){const s=Object(r["n"])(t,n);return Promise.all(s.map(t=>W(e,t,i))).then(r["f"])}const o=new x["a"]({objectIds:t,outFields:i,orderByFields:[e.objectIdField]});return e.queryFeatures(o).then(e=>{if(e&&e.features&&e.features.length===t.length)return e.features.map(e=>e.attributes);throw new s["a"]("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer")})}function G(e,t,i,r,s){const o=[];for(const n of t)if(n&&-1!==s.indexOf(n.name)){const t=`${e}/nodes/${i.resources.attributes}/attributes/${n.key}/0`;o.push({url:t,storageInfo:n})}return Object(l["j"])(o.map(e=>Object(n["default"])(e.url,{responseType:"array-buffer"}).then(t=>Object(w["d"])(e.storageInfo,t.data)))).then(e=>{const t=[];for(const i of r){const n={};for(let t=0;t{if(!l)if(l=ze,Object(S["n"])(Ce),Object(a["k"])(e.serviceObb)){fe(e.serviceObb,i,Re,t,r),Object(I["d"])(Re,l);for(const e of l)Object(g["s"])(e,e,Ee),Object(S["q"])(Ce,e)}else{const n=e.mbs,s=n[3];Object(O["y"])(n,i,Me,t),Object(g["s"])(Me,Me,Ee),Me[2]+=r;for(let e=0;e<8;++e){const t=1&e?s:-s,i=2&e?s:-s,n=4&e?s:-s,r=l[e];Object(g["m"])(r,[Me[0]+t,Me[1]+i,Me[2]+n]),Object(S["q"])(Ce,r)}}};let d=1/0,h=-1/0;const p=e=>{if("replace"!==e.type)return;const i=e.geometry;if(!i.hasZ)return;Object(S["n"])(Ie);const r=i.spatialReference||n,s=i.rings.reduce((e,i)=>i.reduce((e,i)=>(Object(O["y"])(i,r,Me,t),Object(g["s"])(Me,Me,Ee),Object(S["q"])(Ie,Me),Math.min(Me[2],e)),e),1/0);c(),Object(S["w"])(Ce,Ie)&&(d=Math.min(d,s),h=Math.max(h,s))};if(s.forEach(e=>p(e)),d===1/0)return null;const f=(e,t,i)=>{Object(g["s"])(Me,i,o),e[t+0]=Me[0],e[t+1]=Me[1],e[t+2]=Me[2],t+=24,i[2]=d,Object(g["s"])(Me,i,o),e[t+0]=Me[0],e[t+1]=Me[1],e[t+2]=Me[2],t+=24,i[2]=h,Object(g["s"])(Me,i,o),e[t+0]=Me[0],e[t+1]=Me[1],e[t+2]=Me[2]};for(let a=0;a<8;++a)f(Ae.data,3*a,l[a]);return Object(I["c"])(Ae)}const Pe=Object(p["d"])(),Ne=Object(b["b"])(),ze=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],Ie=Object(S["l"])(),Ce=Object(S["l"])(),Re=Object(I["e"])(),Me=[0,0,0],Ae={data:new Array(72),size:3},Ee=Object(p["d"])()},f7f0:function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));var n=i("a4ee"),r=i("ce50"),s=i("b2b2"),o=(i("e92d"),i("cea0"),i("b50f"),i("c120"),i("2dd4"),i("d386")),a=i("c1da"),l=i("ad73");const c=e=>{let t=class extends e{_validateFetchPopupFeatures(e){const{layer:t}=this,{popupEnabled:i}=t;return i?Object(l["a"])(t,e)?void 0:new r["a"]("scenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{layer:t}):new r["a"]("scenelayerview3d:fetchPopupFeatures","Popups are disabled",{layer:t})}async prepareFetchPopupFeatures(e){}async fetchPopupFeatures(e,t){const i=this._validateFetchPopupFeatures(t);if(i)return Promise.reject(i);const n=Object(s["k"])(t)?t.clientGraphics:null;if(!n||0===n.length)return Promise.resolve([]);const r="scene"===this.layer.type&&Object(s["k"])(this.layer.associatedLayer)?this.layer.associatedLayer:this.layer,o=Object(a["u"])(this.layer.fieldsIndex,await Object(l["b"])(r,Object(l["a"])(this.layer,t)));await this.prepareFetchPopupFeatures(o);const c=new Set,d=[],h=[];for(const s of n)Object(a["s"])(o,s,c)?h.push(s):d.push(s);return 0===h.length?Promise.resolve(d):this.whenGraphicAttributes(h,[...c]).catch(()=>h).then(e=>d.concat(e))}};return t=Object(n["a"])([Object(o["a"])("esri.views.3d.layers.support.PopupSceneLayerView")],t),t}}}]); //# sourceMappingURL=chunk-6c7a01e0.0083f1d9.js.map