12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-121d41d5"],{3422:function(e,t,i){"use strict";i.d(t,"a",(function(){return m}));var s=i("a4ee"),a=i("fc29"),r=i("af40"),n=i("b2b2"),o=i("59b2"),l=(i("b50f"),i("c120"),i("cea0"),i("d386")),h=i("8188"),c=i("9180"),d=i("6431"),p=i("5e70"),b=i("9305");let u=class extends a["a"]{constructor(){super(...arguments),this._scaleRangeActive=!1,this.layerScaleRangeVisibilityQuery=!1,this.handles=new r["a"],this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.extent=null,this.graphicsCore=null,this.basemapTerrain=null,this.layerScaleEnabled=!0,this.suspended=!1,this.updating=!0}setup(e,t,i,s,a){this.graphicsCoreOwner=e,this.layer=t,this.queryGraphicUIDsInExtent=i,this.graphicsCore=s,this.basemapTerrain=a,this.updateScaleRangeActive();const r=this.graphicsCoreOwner.view.resourceController.scheduler;this.handles.add(r.registerTask(b["c"].SCALE_VISIBILITY,this))}destroy(){this.handles.destroy(),this.handles=null,this.graphicsCoreOwner=null,this.extent=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null}_setDirty(){this.updating||this._set("updating",!0)}setExtent(e){const t=this.graphicsCoreOwner.view.spatialReference,i=this.graphicsCoreOwner.view.basemapTerrain.spatialReference;if(t===i)this.extent=e;else{const s=Object(c["l"])();Object(h["n"])(e,t,s,i)?this.extent=s:this.extent=null}this._setDirty()}scaleRangeActive(){return this._scaleRangeActive}updateScaleRangeActive(){const e=this.layer,t=e.effectiveScaleRange;let i=this.layerScaleEnabled&&y(t.minScale,t.maxScale);e.labelingInfo&&!i&&(i=e.labelingInfo.some(e=>e&&y(e.minScale,e.maxScale)));const s=this._scaleRangeActive!==i;return this._scaleRangeActive=i,i&&!this.handles.has(g)&&this.basemapTerrain?(this.handles.add(this.basemapTerrain.on("scale-change",e=>this._scaleUpdateHandler(e)),g),this.layerScaleEnabled&&this.handles.add(this.basemapTerrain.on("tiles-visibility-changed",()=>this._setDirty()),g)):!i&&this.handles.has(g)&&this.handles.remove(g),s}get running(){return!(!this.graphicsCoreOwner.view.basemapTerrain||!this.updating)}runTask(){const e=this.graphicsCoreOwner.view.basemapTerrain;if(this.extent&&e&&e.ready&&this._scaleRangeActive&&this.layerScaleEnabled){if(!this.layerScaleRangeVisibilityQuery){this.layerScaleRangeVisibilityQuery=!0;const t=this.layer.effectiveScaleRange;e.queryVisibleScaleRange(this.extent,t.minScale,t.maxScale,e=>this._finishUpdate(e))}}else this._finishUpdate(!0)}_finishUpdate(e){this.layerScaleRangeVisibilityQuery=!1,this._set("suspended",!e),this._set("updating",!1)}_visibleAtLayerScale(e){const t=this.layer.effectiveScaleRange;return!this.layerScaleEnabled||Object(p["e"])(e,t.minScale||0,t.maxScale||0)}_visibleAtLabelScale(e,t){return Object(p["e"])(e,t.minScale||0,t.maxScale||0)}_graphicScale(e){let t;return Object(n["k"])(e.centroid)?t=e.centroid:Object(n["k"])(e.graphic.geometry)&&"point"===e.graphic.geometry.type&&(t=e.graphic.geometry),t?this.graphicsCoreOwner.view.basemapTerrain?this.graphicsCoreOwner.view.basemapTerrain.getScale(t):1:null}_graphicVisible(e){if(!this.layerScaleEnabled)return!0;const t=this._graphicScale(e);return this._visibleAtLayerScale(t)}updateVisibility(e){if(this._scaleRangeActive){const t=this._graphicVisible(e);return e.setVisibilityFlag(d["a"].SCALE_RANGE,t,d["b"].GRAPHIC)}return!1}updateGraphicLabelScaleVisibility(e){if(!this._scaleRangeActive)return!1;if(!e.labelGraphics||0===e.labelGraphics.length)return!1;const t=this._graphicScale(e),i=this._updateLabelScaleVisibility(e,t);return i&&(this.graphicsCoreOwner.view.deconflictor.setDirty(),this.graphicsCoreOwner.view.labeler.setDirty()),i}_updateLabelScaleVisibility(e,t){if(!e.labelGraphics||0===e.labelGraphics.length)return!1;const i=e.labelGraphics[0]._labelClass;if(i&&null!=i.minScale&&null!=i.maxScale){const s=this._visibleAtLabelScale(t,i);if(e.setVisibilityFlag(d["a"].SCALE_RANGE,s,d["b"].LABEL))return!0}return!1}_scaleUpdateHandler(e){if(this._setDirty(),this.graphicsCoreOwner.suspended)return;const t=e.extent,i=e.scale,s=this._visibleAtLayerScale(i);let a=!1;this.queryGraphicUIDsInExtent(t,e.spatialReference,e=>{const r=this.graphicsCore.getGraphics3DGraphicById(e);if(Object(n["j"])(r))return;const o=r.centroid;Object(n["k"])(o)&&(t[0]>o.x||t[1]>o.y||t[2]<o.x||t[3]<o.y)||(r.setVisibilityFlag(d["a"].SCALE_RANGE,s,d["b"].GRAPHIC)&&(a=!0),this._updateLabelScaleVisibility(r,i)&&(a=!0))}),a&&(this.graphicsCoreOwner.view.deconflictor.setDirty(),this.graphicsCoreOwner.view.labeler.setDirty())}layerMinMaxScaleChangeHandler(){this.updateScaleRangeActive()&&!this._scaleRangeActive?this.graphicsCore.modifyGraphics3DGraphicVisibilities(e=>e.clearVisibilityFlag(d["a"].SCALE_RANGE)):this._scaleRangeActive&&this.graphicsCore.updateAllGraphicsVisibility(),this._setDirty()}};function y(e,t){return e>0||t>0}Object(s["a"])([Object(o["b"])({constructOnly:!0})],u.prototype,"layerScaleEnabled",void 0),Object(s["a"])([Object(o["b"])({readOnly:!0})],u.prototype,"suspended",void 0),Object(s["a"])([Object(o["b"])({readOnly:!0})],u.prototype,"updating",void 0),u=Object(s["a"])([Object(l["a"])("esri.views.3d.layers.graphics.Graphics3DScaleVisibility")],u);const g="terrain-events",m=u},"461f":function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("b2b2"),a=i("d97e"),r=i("9392"),n=i("8152");const o={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t)=>new r["a"](t,e.attributes,null,e.objectId),getGeometry:e=>e.geometry,getCentroid:(e,t)=>(Object(s["j"])(e.centroid)&&(e.centroid=Object(a["a"])(new n["a"],e.geometry,t.hasZ,t.hasM)),e.centroid)}},"4c84":function(e,t,i){"use strict";i.d(t,"a",(function(){return Ze}));var s=i("a4ee"),a=(i("e06a"),i("b423"),i("261a"),i("b48d"),i("478c"),i("667b"),i("ff57"),i("da00")),r=(i("f976"),i("1fd7"),i("fc29")),n=i("c120"),o=i("ce50"),l=i("af40"),h=i("e92d"),c=i("28eb"),d=i("b2b2"),p=i("8a44"),b=i("f4cc"),u=i("5815"),y=i("3795"),g=i("59b2"),m=i("b50f"),f=(i("cea0"),i("d386")),O=i("0f1c"),v=i("e431"),j=i("0b2d"),_=i("8188"),S=i("4261"),C=i("9180"),w=i("a6a3"),x=i("1a54"),G=i("d3cf"),R=i("cf49");function E(e){return Object(d["j"])(e)||"simple"===e.type||"unique-value"===e.type||"class-breaks"===e.type||"dictionary"===e.type||"heatmap"===e.type}function I(e){if(Object(d["j"])(e))return null;if(!E(e))return new o["a"]("renderer-conversion-3d:unsupported-renderer",`Unsupported renderer of type '${e.type||e.declaredClass}'`,{renderer:e});switch(e.type){case"simple":return P(e);case"unique-value":return A(e);case"class-breaks":return L(e);case"dictionary":case"heatmap":return null}return null}function D(e,t){if(!t)return null;let i;if(i=Array.isArray(t)?t:[t],i.length>0){const t=i.map(e=>e.details.symbol.type||e.details.symbol.declaredClass).filter(e=>!!e);t.sort();const s=[];return t.forEach((e,i)=>{0!==i&&e===t[i-1]||s.push(e)}),new o["a"]("renderer-conversion-3d:unsupported-symbols",`Renderer contains symbols (${s.join(", ")}) which are not supported in 3D`,{renderer:e,symbolErrors:i})}return null}function P(e){return D(e,Object(R["a"])(e.symbol).error)}function A(e){const t=e.uniqueValueInfos.map(e=>Object(R["a"])(e.symbol).error).filter(e=>!!e),i=Object(R["a"])(e.defaultSymbol);return i.error&&t.unshift(i.error),D(e,t)}function L(e){const t=e.classBreakInfos.map(e=>Object(R["a"])(e.symbol).error).filter(e=>!!e),i=Object(R["a"])(e.defaultSymbol);return i.error&&t.unshift(i.error),D(e,t)}var k=i("82fa"),U=i("c128"),V=i("6e07"),M=i("0fe9"),B=i("7533"),F=i("35c9"),T=i("c919"),Y=i("a6c1"),z=i("8246");const N=B["a"].fromSimpleMarkerSymbol(Y["a"]),W=V["a"].fromSimpleLineSymbol(Y["c"]),X=F["a"].fromSimpleFillSymbol(Y["b"]),H=new M["a"]({symbolLayers:[new U["a"]({material:{color:z["a"]},edges:new T["a"]({size:"1px",color:z["b"]})})]});function q(e){if(Object(d["j"])(e))return null;switch(e.type){case"mesh":return H;case"point":case"multipoint":return N;case"polyline":return W;case"polygon":case"extent":return X}return null}var Z=i("1797"),$=i("6431"),J=i("e9d6"),Q=i("ce6d"),K=i("9392"),ee=i("8152"),te=i("461f");let ie=class extends r["a"]{constructor(e){super(e),this.events=new Q["a"],this.hasZ=null,this.hasM=null,this.objectIdField=null,this.spatialReference=null,this.featureAdapter={getAttribute:(e,t)=>"graphic"in e?e.graphic.attributes[t]:te["a"].getAttribute(e,t),getAttributes:e=>"graphic"in e?e.graphic.attributes:te["a"].getAttributes(e),getObjectId:e=>"graphic"in e?Object(x["g"])(e.graphic,this.objectIdField):te["a"].getObjectId(e),getGeometry:e=>"graphic"in e?e.getAsOptimizedGeometry(this.hasZ,this.hasM):te["a"].getGeometry(e),getCentroid:(e,t)=>{if("graphic"in e){let i=null;Object(d["k"])(e.centroid)?i=e.centroid:"point"===e.graphic.geometry.type&&Object(_["s"])(e.graphic.geometry,se,this.spatialReference)&&(i=se);const s=new Array(2+(t.hasZ?1:0)+(t.hasM?1:0));return Object(d["j"])(i)?(s[0]=0,s[1]=0,s[2]=0,s[3]=0):(s[0]=i.x,s[1]=i.y,t.hasZ&&(s[2]=i.hasZ?i.z:0),t.hasM&&(s[t.hasZ?3:2]=i.hasM?i.m:0)),new ee["a"]([],s)}return te["a"].getCentroid(e,t)},cloneWithGeometry:(e,t)=>"graphic"in e?new K["a"](t,this.featureAdapter.getAttributes(e),null,this.featureAdapter.getObjectId(e)):te["a"].cloneWithGeometry(e,t)}}forEach(e){this.forAllGraphics(t=>{e(t)})}forEachInBounds(e,t){this.getSpatialIndex().forEachInBounds(e,t)}forEachBounds(e,t,i){const s=this.getSpatialIndex();for(const a of e){const e=this.featureAdapter.getObjectId(a);Object(d["k"])(s.getBounds(e,i))&&t(i)}}};Object(s["a"])([Object(g["b"])({constructOnly:!0})],ie.prototype,"getSpatialIndex",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],ie.prototype,"forAllGraphics",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],ie.prototype,"hasZ",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],ie.prototype,"hasM",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],ie.prototype,"objectIdField",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],ie.prototype,"spatialReference",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],ie.prototype,"featureSpatialReference",void 0),ie=Object(s["a"])([Object(f["a"])("esri.views.3d.layers.graphics.Graphics3DFeatureStore")],ie);const se={type:"point",x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null},ae=ie;var re=i("e6bc");class ne{constructor(e){this.schedule=e,this.sharedResources=null,this.streamDataRequester=null,this.elevationProvider=null,this.renderer=null,this.stage=null,this.clippingExtent=null,this.renderCoordsHelper=null,this.overlaySR=null,this.layer=null,this.graphicsCoreOwner=null,this.localOriginFactory=null,this.featureExpressionInfoContext=null,this.screenSizePerspectiveEnabled=!0,this.slicePlaneEnabled=!1,this.physicalBasedRenderingEnabled=!1,this.isAsync=!1}}var oe=i("792b"),le=i("1a64"),he=i("6339");class ce extends he["a"]{constructor(e,t,i){super(e,t,i),this.calloutSymbolLayer=null,this.symbol.hasVisibleCallout()&&(this.calloutSymbolLayer=Object(le["a"])(this.symbol,t))}async doLoad(e){const t=this.calloutSymbolLayer?Object(oe["d"])(this.calloutSymbolLayer.load()):null;try{await super.doLoad(e),Object(b["v"])(e)}catch(s){var i;throw null==(i=this.calloutSymbolLayer)||i.abortLoad(),s}t&&await t}destroy(){super.destroy(),this.calloutSymbolLayer=Object(d["d"])(this.calloutSymbolLayer)}createGraphics3DGraphic(e,t){const i=super.createGraphics3DGraphic(e,t);if(Object(d["k"])(this.calloutSymbolLayer)&&Object(d["k"])(i)){const t=this._createCalloutGraphic(e);Object(d["k"])(t)&&i.addAuxiliaryGraphic(t)}return i}globalPropertyChanged(e,t){return!!super.globalPropertyChanged(e,t)&&(!this.calloutSymbolLayer||this.calloutSymbolLayer.globalPropertyChanged(e,t,e=>this._getCalloutGraphicLayer(e)))}updateGeometry(e,t){const i=super.updateGeometry(e,t);if(i&&this.calloutSymbolLayer){const i=this._getCalloutGraphicLayer(e);if(i)return this.calloutSymbolLayer.updateGeometry(i,t)}return i}_createCalloutGraphic(e){const t=e.renderingInfo,i={renderer:t.renderer,symbol:t.symbol,translation:[0,0,0],centerOffset:[0,0,0,0],screenOffset:[0,0],centerOffsetUnits:"world",elevationOffset:0,materialCollection:null};return e.renderingInfo=i,this.calloutSymbolLayer.createGraphics3DGraphic(e)}_getCalloutGraphicLayer(e){for(const t of e._auxiliaryGraphics)if(t.graphics3DSymbolLayer===this.calloutSymbolLayer)return t}}function de(e,t,i){let s;return s="point-3d"===e.type?ce:he["a"],new s(e,t,i)}var pe=i("e384");class be{constructor(e){this.graphicsCore=e,this.idToState=new Map,this.states=new Set;const t=e.owner.layer&&e.owner.layer.objectIdField;t?(this.getGraphicId=e=>Object(x["g"])(e,t),this.getGraphics3DGraphicById=e=>this.graphicsCore.getGraphics3DGraphicByObjectId(e)):(this.getGraphicId=e=>e.uid,this.getGraphics3DGraphicById=e=>this.graphicsCore.getGraphics3DGraphicById(e))}destroy(){this.idToState.clear(),this.states.forEach((e,t)=>this.remove(t))}add(e){const t={remove:()=>this.remove(e)};if(this.states.has(e))return t;const i=this.getGraphicId(e.graphic),s=this.getGraphics3DGraphicById(i);return this.states.has(e)||this.states.add(e),this._ensureStateList(i).push(e),e.displaying=!!Object(d["k"])(s)&&s.isVisible(),e.isDraped=!!Object(d["k"])(s)&&s.isDraped,e.tracking=!0,Object(d["k"])(s)&&e.emit("changed",{}),t}remove(e){if(this.states.has(e)){if(this.idToState.size){const t=this.getGraphicId(e.graphic),i=this.idToState.get(t);i&&(Object(m["j"])(i,e),0===i.length&&this.idToState.delete(t))}this.states.delete(e),e.tracking=!1,e.displaying=!1}}addGraphic(e){this._forEachState(e,t=>{t.displaying=e.isVisible(),t.isDraped=e.isDraped,t.emit("changed",{})})}removeGraphic(e){this._forEachState(e,e=>{e.displaying=!1,e.isDraped=!1})}updateGraphicGeometry(e){this._forEachState(e,e=>{e.emit("changed",{})})}updateGraphicVisibility(e){this._forEachState(e,t=>{t.displaying=e.isVisible()})}allGraphicsDeleted(){this.states.forEach(e=>{e.displaying=!1})}_ensureStateList(e){const t=this.idToState.get(e);if(t)return t;const i=new Array;return this.idToState.set(e,i),i}_forEachState(e,t){if(0===this.states.size||0===this.idToState.size)return;const i=this.getGraphicId(e.graphic),s=this.idToState.get(i);null!=s&&s.forEach(t)}}var ue=i("ba58"),ye=i("fa73"),ge=i("5e82"),me=i("ce76");let fe=class extends r["a"]{constructor(e){super(e),this._index=new me["a"](9,Object(n["a"])("esri-csp-restrictions")?e=>({minX:e.extent[0],minY:e.extent[1],maxX:e.extent[2],maxY:e.extent[3]}):[".extent[0]",".extent[1]",".extent[2]",".extent[3]"]),this._missing=new Set,this._boundsByFeature=new Map,this.spatialReference=null,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.updating=!1}setup(e){this._addMany(e)}destroy(){this._missing.clear(),this._index.destroy(),this._index=null,this._boundsByFeature.clear(),this._boundsByFeature=null}update(){this._missing.size>0&&(this._addMany(Array.from(this._missing.values())),this.updating=!1,this._missing.clear())}get updatingRemaining(){return this._missing.size}queryGraphicUIDsInExtent(e,t,i){t.equals(this.spatialReference)&&(Oe.minX=e[0],Oe.minY=e[1],Oe.maxX=e[2],Oe.maxY=e[3],this.update(),this._index.search(Oe,e=>i(e.graphic.uid)))}add(e){this._missing.add(e),this.updating=!0}remove(e){if(this._missing.delete(e))return void(this.updating=this._missing.size>0);this._index.remove(e);const t=Object(x["g"])(e.graphic,this._get("objectIdField"));null!=t&&this._boundsByFeature.delete(t)}_addMany(e){if(0===e.length)return;const t=this._get("objectIdField");for(const i of e){i.computeExtent(this.spatialReference);const e=Object(x["g"])(i.graphic,t);null!=e&&this._boundsByFeature.set(e,i.extent)}this._index.load(e)}clear(){this._index.clear(),this._missing.clear(),this._boundsByFeature.clear(),this.updating=!1}forEachInBounds(e,t){Oe.minX=e[0],Oe.minY=e[1],Oe.maxX=e[2],Oe.maxY=e[3],this.update(),this._index.search(Oe,e=>{t(e)})}getBounds(e,t){this.update();const i=this._boundsByFeature.get(e);return i?Object(S["s"])(t,i):null}};Object(s["a"])([Object(g["b"])({constructOnly:!0})],fe.prototype,"spatialReference",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],fe.prototype,"hasZ",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],fe.prototype,"hasM",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],fe.prototype,"objectIdField",void 0),Object(s["a"])([Object(g["b"])()],fe.prototype,"updating",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],fe.prototype,"updatingRemaining",null),fe=Object(s["a"])([Object(f["a"])("esri.views.3d.layers.graphics.SpatialIndex2D")],fe);const Oe={minX:0,minY:0,maxX:0,maxY:0};var ve=i("a803"),je=i("8048"),_e=i("8076"),Se=i("9250"),Ce=i("1942");const we=h["a"].getLogger("esri.views.3d.layers.support.StageLayerElevationProvider"),xe=1;let Ge=class extends(Q["a"].EventedMixin(r["a"])){constructor(e){super(e),this.elevationOffset=0,this._layerHandes=new l["a"]}initialize(){this.renderCoordsHelper=this.view.renderCoordsHelper,this.intersectLayers=[this.stageLayer],this.intersector=Object(Se["b"])(this.view.state.viewingMode),this.intersector.options.store=Ce["c"].MIN;const e=this._computeLayerExtent(this.stageLayer);this.zmin=e[2],this.zmax=e[5];const t=this.stageLayer.events;this._layerHandes.add([t.on("layerObjectAdded",e=>this._objectChanged(e.object)),t.on("layerObjectRemoved",e=>this._objectChanged(e.object)),t.on("objectGeometryAdded",e=>this._objectChanged(e.object)),t.on("objectGeometryRemoved",e=>this._objectChanged(e.object)),t.on("vertexAttrsUpdated",e=>this._objectChanged(e.object)),t.on("objectTransformation",e=>this._objectChanged(e))])}dispose(){this._layerHandes.destroy()}elevationInfoChanged(){const e=null!=this.layer?this.layer.elevationInfo:null;if(null!=e&&"on-the-ground"!==e.mode){const t=Object(je["g"])(this.layer.spatialReference),i=Object(_e["a"])(e.unit);this.elevationOffset=Object(d["u"])(e.offset,0)*i/t}else this.elevationOffset=0}getElevation(e,t,i,s){if(De[0]=e,De[1]=t,De[2]=i,!this.renderCoordsHelper.toRenderCoords(De,s,De))return we.error("could not project point for elevation alignment"),null;const a=this.elevationOffset,r=this.zmin+a,n=this.zmax+a;this.renderCoordsHelper.setAltitude(Pe,n,De),this.renderCoordsHelper.setAltitude(Ae,r,De);const o=e=>e.metadata&&e.metadata.isElevationSource;return this.intersector.reset(Pe,Ae,null),this.intersector.intersect(this.intersectLayers,null,xe,null,o),this.intersector.results.min.getIntersectionPoint(De)?this.renderCoordsHelper.getAltitude(De):null}_objectChanged(e){var t;if(null==(t=e.metadata)||!t.isElevationSource||!this.spatialReference)return;Object(S["k"])(Re),e.metadata.lastValidElevationBB.isEmpty()||this._expandExtent(e.metadata.lastValidElevationBB.min,e.metadata.lastValidElevationBB.max,Re);const i=e.boundingVolumeWorldSpace.min,s=e.boundingVolumeWorldSpace.max;this._expandExtent(i,s,Re),Object(S["F"])(Re,Ee),this.zmin=Math.min(this.zmin,Re[2]),this.zmax=Math.max(this.zmax,Re[5]),Ie.extent=Ee,Ie.spatialReference=this.spatialReference,this.emit("elevation-change",Ie),Object(v["m"])(e.metadata.lastValidElevationBB.min,i),Object(v["m"])(e.metadata.lastValidElevationBB.max,s)}_computeLayerExtent(e){return Object(S["k"])(Re),e.objects.forAll(e=>this._expandExtent(e.boundingVolumeWorldSpace.min,e.boundingVolumeWorldSpace.max,Re)),Re}_expandExtent(e,t,i){for(let s=0;s<8;++s)De[0]=1&s?e[0]:t[0],De[1]=2&s?e[1]:t[1],De[2]=4&s?e[2]:t[2],this.renderCoordsHelper.fromRenderCoords(De,De,this.spatialReference),Object(S["r"])(i,De);return i}};Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ge.prototype,"layer",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ge.prototype,"stageLayer",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ge.prototype,"view",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0,aliasOf:"view.spatialReference"})],Ge.prototype,"spatialReference",void 0),Ge=Object(s["a"])([Object(f["a"])("esri.views.3d.layers.support.StageLayerElevationProvider")],Ge);const Re=Object(S["k"])(),Ee=Object(C["n"])(),Ie={spatialReference:null,extent:Ee,context:"scene"},De=Object(j["f"])(),Pe=Object(j["f"])(),Ae=Object(j["f"])();var Le,ke=i("4b49"),Ue=i("9714"),Ve=i("b7c2"),Me=i("adf1"),Be=i("748fd"),Fe=i("9305"),Te=i("3af1"),Ye=i("4ae5"),ze=i("9fab"),Ne=i("21ba"),We=i("ddc2");const Xe=Object(j["f"])(),He=Object(S["h"])(),qe=h["a"].getLogger("esri.views.3d.layers.graphics.Graphics3DCore");let Ze=Le=class extends r["a"]{constructor(e){super(e),this.propertiesPool=new Ue["a"]({computedExtent:Te["a"]},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this.graphicStateTracking=null,this.symbolCreationContext=new ne((e,t)=>this._frameTask.schedule(e,t)),this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this.graphicsDrapedUids=new Set,this.graphicsBySymbol=new Map,this.symbolConversionCache=new Map,this.symbols=new Map,this.graphicsWithoutSymbol=new Map,this.graphicsWaitingForSymbol=new Map,this.graphicsUpdateId=0,this._handles=new l["a"],this._frameTask=Fe["a"],this.suspendSymbolCleanup=!1,this._spatialReference=null,this.arcadeOnDemand=null,this.rendererChangeAbortController=null,this.elevationInfoChangeAbortController=null,this.setupAbortController=null,this.elevationAlignment=null,this.scaleVisibility=null,this.filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this.featureStore=null,this.deconflictor=null,this.labeler=null,this.objectStates=null,this.viewElevationProvider=null,this.stageLayerElevationProvider=null,this.sharedSymbolResourcesOwnerHandle=null,this.whenGraphics3DGraphicRequests={},this.pendingUpdates=new Map,this.numberOfGraphics=0,this.numberOfGraphicsProvidingElevation=0,this.pendingAdds=0,this.pendingRemoves=0,this.pendingUpdatesPool=new p["a"]({allocator:e=>e||new Je,deallocator:e=>(e.clear(),e)}),this.symbolWarningLogged=!1,this.geometryWarningLogged=!1,this.objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new p["a"],this.preferredUpdatePolicy=Ve["m"].SYNC,this.forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=void 0,this._startCreateGraphics=!1}get spatialIndex(){var e;return this._spatialIndex||(this._spatialIndex=new fe({objectIdField:null==(e=this.owner.layer)?void 0:e.objectIdField,spatialReference:this._spatialReference,hasZ:this.hasZ,hasM:this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get effectiveUpdatePolicy(){return Object(d["k"])(this.currentRenderer)&&"dictionary"===this.currentRenderer.type?Ve["m"].ASYNC:Object(d["u"])(this.forcedUpdatePolicy,this.preferredUpdatePolicy)}get updating(){var e,t;return!!(this.graphicsWaitingForSymbol.size>0||this.running||null!=(e=this.elevationAlignment)&&e.updating||Object(d["k"])(this.scaleVisibility)&&this.scaleVisibility.updating||null!=(t=this.filterVisibility)&&t.updating||this.rendererChangeAbortController||this.elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating)}get running(){var e;return this.pendingUpdates.size>0||!(null==(e=this._spatialIndex)||!e.updating)}get suspendedOrOutsideOfView(){var e;return this.owner.suspended||(null==(e=this.owner.suspendInfo)?void 0:e.outsideOfView)}get updatingRemaining(){var e,t;return this.updating?this.pendingUpdates.size+.1*((null==(e=this._spatialIndex)?void 0:e.updatingRemaining)||0)+.1*((null==(t=this.elevationAlignment)?void 0:t.updatingRemaining)||0):0}get displayFeatureLimit(){const e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?e.graphics3D.minTotalNumberOfFeatures:0,i=e?e.graphics3D.maxTotalNumberOfFeatures:0,s=e?e.graphics3D.maxTotalNumberOfPrimitives:0,a=this.averageSymbolComplexity,r=Math.max(1,Object(d["k"])(a)?a.primitivesPerFeature:1),n=Object(d["k"])(a)&&a.drawCallsPerFeature>0?i/a.drawCallsPerFeature*.3:i,o=Math.ceil(s/r),l=Math.max(t,Math.min(i,o,n)),h=this._get("displayFeatureLimit");return h&&h.minimumTotalNumberOfFeatures===t&&h.maximumTotalNumberOfFeatures===i&&h.maximumTotalNumberOfPrimitives===s&&h.averageSymbolComplexity===a&&h.maximumNumberOfFeatures===l?h:{minimumTotalNumberOfFeatures:t,maximumTotalNumberOfFeatures:i,maximumTotalNumberOfPrimitives:s,averageSymbolComplexity:a,maximumNumberOfFeatures:l}}get averageSymbolComplexity(){const e=Object(ve["a"])(this.symbolComplexities),t=this._get("averageSymbolComplexity");return 0===e.numComplexities||Object(d["k"])(t)&&(e.estimated&&(t.primitivesPerFeature>=e.primitivesPerFeature||t.primitivesPerCoordinate>=e.primitivesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.primitivesPerFeature===e.primitivesPerFeature&&t.primitivesPerCoordinate===e.primitivesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e}get spatialReference(){return this._spatialReference}get usedMemory(){const e=Object(d["k"])(this.averageSymbolComplexity)&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this.numberOfGraphics:0;return this._usedMemory+e}get usedMemoryPerGraphic(){if(this._usedMemory&&this.numberOfGraphics)return Math.abs(this.pendingAdds-this.pendingRemoves)/this.numberOfGraphics>30?0:this._usedMemory/this.numberOfGraphics;if(Object(d["k"])(this.averageSymbolComplexity)){const e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return Math.max(0,(this.pendingAdds-this.pendingRemoves)*this.usedMemoryPerGraphic)}get symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}_getConvertedSymbol(e){if("web-style"===e.type)return e.clone();const t=this.symbolConversionCache.get(e.id);if(Object(d["k"])(t))return t;const i=Object(R["a"])(e,{retainId:!0,hasLabelingContext:this._hasLabelingContext(e)}),s=i.symbol||null;return Object(d["j"])(s)&&i.error&&qe.error(i.error.message),this.symbolConversionCache.set(e.id,s),s}_getSymbolComplexitiesUsedOrRenderer(e){if(Object(d["j"])(e))return[];const t=e.getSymbols(),i="backgroundFillSymbol"in e&&e.backgroundFillSymbol;if(!(i||t&&t.length))return[];const s=[],a=this._getSymbolComplexityUsedOrRenderer(i);Object(d["k"])(a)&&s.push(a);for(const r of t){const e=this._getSymbolComplexityUsedOrRenderer(r);Object(d["k"])(e)&&s.push(e)}return s}_getSymbolComplexityUsedOrRenderer(e){if(Object(d["j"])(e))return null;const t=this.symbols.get(e.id);if(Object(d["k"])(t))return t.complexity;const i=this._getConvertedSymbol(e);return Object(d["k"])(i)?Object(ve["b"])(i):null}_getSymbolComplexitiesUsed(){const e=[];return this.symbols.forEach(t=>{Object(d["k"])(t)&&e.push(t.complexity)}),e}initialize(){this._spatialReference=this.owner.view.spatialReference,this._set("featureStore",new ae({objectIdField:this.owner.layer&&this.owner.layer.objectIdField,hasZ:this.hasZ,hasM:this.hasM,spatialReference:this._spatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forAllGraphics:e=>this.graphics3DGraphics.forEach(e)}))}async setup(e){this.setupAbortController=new AbortController;const t=this.setupAbortController.signal;this._set("elevationAlignment",e.elevationAlignment),this._set("scaleVisibility",e.scaleVisibility),this._set("filterVisibility",e.filterVisibility),this._set("deconflictor",e.deconflictor),this._set("labeler",e.labeler),this._set("objectStates",e.objectStates);const i=this.owner.view;this.viewElevationProvider=new Z["b"](this._spatialReference,i),this._initializeStage(i,this.layer.uid),this.symbolCreationContext.sharedResources=i.sharedSymbolResources,this.sharedSymbolResourcesOwnerHandle=i.sharedSymbolResources.addGraphicsOwner(this.owner),Object(d["k"])(this.currentRenderer)&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.sharedSymbolResources.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=i.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Me["a"](i.renderSpatialReference),this.symbolCreationContext.elevationProvider=i.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e);const s=Object(J["f"])(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await Object(J["b"])(s,this._spatialReference,qe),Object(b["v"])(t),this.symbolCreationContext.screenSizePerspectiveEnabled=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings.physicallyBasedRenderingEnabled;const a="layer"in this.owner?["layer.screenSizePerspectiveEnabled,view.screenSizePerspectiveEnabled"]:"view.screenSizePerspectiveEnabled";this._handles.add([this.watch("suspendedOrOutsideOfView",()=>this._frameTask.reschedule(()=>this._updateLayerVisibility())),this.owner.watch(a,()=>{const e=i.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled;var t;e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,null==(t=this.labeler)||t.reset(),this.recreateAllGraphicsAndSymbols())}),this.owner.watch("slicePlaneEnabled",e=>this._slicePlaneEnabledChange(!!e)),this.owner.view.watch("pixelRatio",()=>this._pixelRatioChange()),this.owner.view.watch("qualitySettings.physicallyBasedRenderingEnabled",e=>this._physicalBasedRenderingChange(e)),Object(y["f"])(i.basemapTerrain,"tilingScheme",e=>{e.spatialReference.equals(this.symbolCreationContext.overlaySR)||(this.symbolCreationContext.overlaySR=i.basemapTerrain.spatialReference),this._handles.has("loaded-graphics")?this.recreateAllGraphics():this._handles.add([Object(y["b"])(this.owner,"loadedGraphics","change",e=>this._graphicsCollectionChanged(e),()=>this.recreateAllGraphics()),Object(y["b"])(this.owner,"loadedGraphics","after-changes",()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange(),()=>this._signalUpdatingDuringAsyncLoadedGraphicsChange())],"loaded-graphics")}),Object(y["g"])(this,"asyncUpdates",()=>this.runTask(Fe["e"]),!0),Object(y["a"])(this,"effectiveUpdatePolicy",e=>{Object(d["k"])(this.stageLayer)&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===Ve["m"].ASYNC,e===Ve["m"].SYNC&&this.runTask(Fe["e"])},!0)]),this._frameTask=i.resourceController.scheduler.registerTask(Fe["c"].GRAPHICS_CORE,this),this.owner.layer&&"featureReduction"in this.owner.layer&&this._handles.add(this.owner.watch("layer.featureReduction",()=>this.deconflictor.featureReductionChange())),this.notifyChange("averageSymbolComplexity");try{await this.rendererChange(this.layer.renderer)}catch{}Object(b["v"])(t),this.setupAbortController=null}_abortSetup(){this.setupAbortController&&(this.setupAbortController.abort(),this.setupAbortController=null)}destroy(){this._abortSetup(),this._abortRendererChange(),this._abortElevationInfoChange(),this.owner.view.deconflictor.removeGraphicsOwner(this),this.owner.view.labeler.removeGraphicsOwner(this),this._updatingPendingLoadedGraphicsChange=Object(d["s"])(this._updatingPendingLoadedGraphicsChange),this.clear(),this.graphicStateTracking=Object(d["d"])(this.graphicStateTracking),this.stage&&(this.stage.remove(this.stageLayer),this.stageLayer=null,this.stage=null),this._handles=Object(d["d"])(this._handles),this._frameTask.remove(),this._frameTask=Fe["a"],this._spatialReference=null,this._set("owner",null);for(const e in this.whenGraphics3DGraphicRequests)this.whenGraphics3DGraphicRequests[e].reject(new o["a"]("graphic:layer-destroyed","Layer has been destroyed"));this.whenGraphics3DGraphicRequests=null,this.sharedSymbolResourcesOwnerHandle=Object(d["s"])(this.sharedSymbolResourcesOwnerHandle),this.propertiesPool=Object(d["d"])(this.propertiesPool),this.pendingUpdatesPool=null,this.symbolConversionCache.clear(),this.objectIdInvisibleSet.clear(),this._spatialIndex=Object(d["d"])(this._spatialIndex),this._set("featureStore",Object(d["d"])(this.featureStore))}clear(){var e,t;null==(e=this.objectStates)||e.allGraphicsDeleted(),Object(d["k"])(this.graphicStateTracking)&&this.graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),null==(t=this._spatialIndex)||t.clear(),this.graphics3DGraphics.clear(),this.numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this.symbols.forEach(d["d"]),this.symbols.clear(),this.graphicsBySymbol.clear(),this.graphicsWithoutSymbol.clear(),this.graphicsWaitingForSymbol.clear(),this.pendingUpdates.clear(),this.pendingUpdatesPool.clear(),this.pendingAdds=0,this.pendingRemoves=0,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this.featureStore.events.emit("changed")}_initializeStage(e,t){this.stage=e._stage,this.stageLayer=new Be["a"]({isPickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t),this.stage.add(this.stageLayer);const i=this.stageLayer.events;i.on("objectTransformation",e=>this.notifyGraphicGeometryChanged(e.metadata.graphicUid)),i.on("visibilityChanged",e=>this.notifyGraphicVisibilityChanged(e.metadata.graphicUid)),i.on("objectGeometryAdded",e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid)),i.on("objectGeometryRemoved",e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid)),i.on("vertexAttrsUpdated",e=>this.notifyGraphicGeometryChanged(e.object.metadata.graphicUid))}notifyGraphicGeometryChanged(e){if(Object(d["j"])(this.graphicStateTracking)||Object(d["j"])(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(Object(d["j"])(this.graphicStateTracking)||Object(d["j"])(e))return;const t=this.graphics3DGraphics.get(e);t&&this.graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){const e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this.numberOfGraphics>e*Qe,i=!this.suspendedOrOutsideOfView&&!t;i!==this._visible&&(this._visible=i,i?(this.stageLayer.isPickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.isPickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.isVisible=this._visible&&(null==this.layer.opacity||this.layer.opacity>0)}getGraphics3DGraphicById(e){return this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){var t;return null!=(t=this.owner.layer)&&t.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer&&this.owner.layer.objectIdField){return Object(x["g"])(e,t)}get graphics3DGraphicsByObjectID(){const e=this.owner.layer&&this.owner.layer.objectIdField;if(!e)return null;const t=new Map;return this.graphics3DGraphics.forEach(i=>{if(!i)return;const s=i.graphic,a=this._getGraphicObjectID(s,e);Object(d["k"])(a)&&t.set(a,i)}),t}get labelsEnabled(){return!(!this.labeler||!this.labeler.layerLabelsEnabled())}async updateLabelingInfo(e){const t=this.deconflictor&&this.deconflictor.labelingInfoChange(e),i=this.labeler&&this.labeler.labelingInfoChange(e);await Object(b["j"])([t,i])}updateVisibilityInfo(){this.deconflictor&&this.deconflictor.labelingInfoChange(),this.labeler&&this.labeler.visibilityInfoChange()}get symbolUpdateType(){if(this.pendingUpdates.size>0)return"unknown";let e=0,t=0;return Object(c["c"])(this.symbols,(i,s)=>{if(Object(d["k"])(i)){const a=i.getFastUpdateStatus();if(a.loading>0)return!0;this.graphicsBySymbol.has(s)&&(t+=a.fast,e+=a.slow)}return!1})?"unknown":t>=0&&0===e?"fast":e>=0&&0===t?"slow":"mixed"}runTask(e){this._frameTask.processQueue(e),this._applyPendingUpdates(e),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining")}setObjectIdVisibility(e,t){t?this.objectIdInvisibleSet.delete(e):this.objectIdInvisibleSet.add(e);const i=this._findGraphics3DGraphicByObjectId(e);Object(d["k"])(i)&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(e){return Object(c["a"])(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(Object(d["j"])(e))return!1;const t=e.graphic,i=this._getGraphicObjectID(t),s=t.visible&&!this.owner.suspended&&(Object(d["j"])(i)||!this.objectIdInvisibleSet.has(i));return e.setVisibilityFlag($["a"].USER_SETTING,s,$["b"].GRAPHIC)}_whenGraphics3DGraphic(e){const t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);const i=this.whenGraphics3DGraphicRequests[e.uid];if(i)return i.promise;const s=Object(b["f"])();return this.whenGraphics3DGraphicRequests[e.uid]=s,s.promise}async _boundsForGraphics3DGraphic(e,t){const i=this._spatialReference,s=this.owner.view.renderSpatialReference,a=this.owner.view.basemapTerrain.spatialReference,r=(e,t,a)=>Object(_["p"])(e,s,t,e,i,t,a),n=(e,t,s)=>Object(_["p"])(e,a,t,e,i,t,s),o=this.viewElevationProvider?{service:this.viewElevationProvider,useViewElevation:Object(d["k"])(t)&&t.useViewElevation,minDemResolution:Object(d["k"])(t)&&t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await e.getProjectedBoundingBox(r,n,o,Object(d["i"])(t,"signal"));if(!l)return null;const h=l.boundingBox;if(l.requiresDrapedElevation){const e=this.symbolCreationContext.elevationProvider;if(e){Object(S["e"])(h,Xe);const t=Object(d["u"])(e.getElevation(Xe[0],Xe[1],0,i,"ground"),0);h[2]=Math.min(h[2],t),h[5]=Math.max(h[5],t)}}return{boundingBox:h,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(e,t){await Object(y["j"])(this.owner,"loadedGraphics");const i=this.owner.layer&&this.owner.layer.objectIdField,s=this.owner.loadedGraphics.find(t=>t===e||i&&t.attributes&&e.attributes&&t.attributes[i]===e.attributes[i]);if(!s)throw new o["a"]("internal:graphic-not-part-of-view","Graphic is not part of this view");const a=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){const i=this.graphics3DGraphics.get(e.uid);if(!i)return null;const s=i.computeAttachmentOrigin();if(0===s.render.num&&0===s.draped.num)return null;Object(v["y"])(Ke,0,0,0);let a=0;if(s.render.num>0){if(!Object(_["y"])(s.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,et,t))return null;Object(v["h"])(Ke,Ke,et),a++}if(s.draped.num>0){const[e,i]=s.draped.origin,r=Object(d["u"])(this.viewElevationProvider.getElevation(e,i,"ground"),0);if(Object(v["y"])(et,e,i,r),!Object(_["y"])(et,this.viewElevationProvider.spatialReference,et,t))return null;Object(v["h"])(Ke,Ke,et),a++}return a>1&&Object(v["g"])(Ke,Ke,1/a),new Ye["a"]({x:Ke[0],y:Ke[1],z:Ke[2],spatialReference:t})}getSymbolLayerSize(e,t){const i=this.symbols.get(e.id);if(Object(d["j"])(i))throw new o["a"]("internal:symbol-not-part-of-view","Symbol is not part of this view");const s=e.symbolLayers.indexOf(t);if(-1===s)throw new o["a"]("internal:missing-symbol-layer","Symbol layer is not in symbol");const a=i.getSymbolLayerSize(s);if(null==a)throw new o["a"]("internal:missing-size","Symbol layer has no valid size");return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){const t=e.graphic.uid,i=this.graphics3DGraphics.get(t);if(!Object(d["j"])(i)||!Object(d["j"])(this.graphicsWithoutSymbol.get(t)))switch(e.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,e);break;case"symbol":this._graphicUpdateSymbolHandler(i,e);break;case"attributes":break;case"transform":this._graphicUpdateTransformHandler(i,e)}}_graphicUpdateGeometryHandler(e,t){const i=t.graphic.geometry;if(Object(d["j"])(i))return void this._recreateGraphic(t.graphic);if(Object(d["j"])(e)){const e=t.graphic.symbol&&t.graphic.symbol.id;if(e){const t=this.symbols.get(e);if(Object(d["k"])(t)&&t.loadStatus===ge["a"].LOADING)return}return void this._recreateGraphic(t.graphic)}const s=e.graphics3DSymbol;!Object(d["j"])(t.newValue)&&s.updateGeometry(e,t.newValue)||this._recreateGraphic(e.graphic),this._expandComputedExtent(i)}_graphicUpdateSymbolHandler(e,t){const i=t.graphic,s=Object(d["k"])(e)?e.graphics3DSymbol:Object(d["k"])(t.oldValue)?this.symbols.get(t.oldValue.id):null;if(Object(d["j"])(s)||Object(d["j"])(t.newValue))return void this._recreateGraphic(i);const a=s.symbol,r=this._getConvertedSymbol(t.newValue);if(Object(d["k"])(r)&&(r.type!==a.type||"web-style"===r.type)||"web-style"===a.type)return void this._recreateGraphic(i);const n=this.graphicsBySymbol.get(a.id);if(n&&1!==n.size)return void this._recreateGraphic(i);const o=Object(O["a"])(a,r);if(Object(d["j"])(o))return void this._updateSymbolMapping(a.id,r);const l={diff:o,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(s.prepareSymbolPatch(l),!Object(O["d"])(l.diff))return void this._recreateGraphic(i);const h=this._getRenderingInfo(i);if(Object(d["j"])(h))return void this._recreateGraphic(i);const c=s.extentPadding;for(const d of l.symbolStatePatches)d();if(c!==s.extentPadding&&this._recomputeExtentPadding(),Object(d["k"])(e))for(const d of l.graphics3DGraphicPatches)d(e,h);this._updateSymbolMapping(a.id,r)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}_graphicUpdateTransformHandler(e,t){}recreateGraphics(e){this.suspendSymbolCleanup=!0,this.remove(e),this.add(e),this.suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===Ve["m"].SYNC&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){const t=this.graphicsUpdateId;return this.graphicsUpdateId++,this.graphicsWaitingForSymbol.set(e.uid,t),1===this.graphicsWaitingForSymbol.size&&this.notifyChange("updating"),t}_endGraphicUpdate(e){e&&(this.graphicsWaitingForSymbol.delete(e.uid),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let e=0;this.symbols.forEach(t=>{Object(d["k"])(t)&&(e=Math.max(e,t.extentPadding))}),this._set("extentPadding",e)}_expandComputedExtent(e){const t=He,i=e.spatialReference;Object(x["c"])(e,t);const s=this._spatialReference,a=Le.tmpVec;if(i.equals(s)||Object(_["B"])(t[0],t[1],0,i,a,s)&&(t[0]=a[0],t[1]=a[1],Object(_["B"])(t[3],t[4],0,i,a,s),t[3]=a[0],t[4]=a[1]),!(isFinite(t[0])&&isFinite(t[3])&&isFinite(t[1])&&isFinite(t[4])))return;const r=this.computedExtent;let n=null;const o=isFinite(t[2])&&isFinite(t[5]),l=o&&(!r||null==r.zmin||t[2]<r.zmin),h=o&&(!r||null==r.zmax||t[5]>r.zmax);r?(t[0]<r.xmin||t[1]<r.ymin||t[3]>r.xmax||t[4]>r.ymax||l||h)&&(n=this.propertiesPool.get("computedExtent"),n.xmin=Math.min(t[0],r.xmin),n.ymin=Math.min(t[1],r.ymin),n.xmax=Math.max(t[3],r.xmax),n.ymax=Math.max(t[4],r.ymax),n.spatialReference=s):(n=this.propertiesPool.get("computedExtent"),n.xmin=t[0],n.ymin=t[1],n.xmax=t[3],n.ymax=t[4],n.spatialReference=s),n&&(l&&(n.zmin=t[2]),h&&(n.zmax=t[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this.elevationInfoChangeAbortController&&(this.elevationInfoChangeAbortController.abort(),this.elevationInfoChangeAbortController=null)}async elevationInfoChange(){var e,t;this._abortElevationInfoChange();const i=new AbortController;this.elevationInfoChangeAbortController=i;const s=Object(J["f"])(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await Object(J["b"])(s,this._spatialReference,qe),Object(b["v"])(i),this.elevationInfoChangeAbortController=null,null==(e=this.labeler)||e.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("elevationInfo",t)?t.forEach(e=>{const t=e.graphic,i=e.labelGraphics;for(const s of i)s.graphics3DSymbolLayer.updateGraphicElevationContext(t,s)}):this._recreateSymbol(i)}),this.updateStageLayerElevationProvider(),null==(t=this.elevationAlignment)||t.elevationInfoChange()}updateStageLayerElevationProvider(){this.stageLayerElevationProvider?(this.layer.elevationInfo&&"relative-to-scene"===this.layer.elevationInfo.mode||0===this.numberOfGraphicsProvidingElevation)&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null):(!this.layer.elevationInfo||this.layer.elevationInfo&&"relative-to-scene"!==this.layer.elevationInfo.mode)&&this.numberOfGraphicsProvidingElevation>0&&(this.stageLayerElevationProvider=new Ge({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this.stageLayerElevationProvider))}_clearSymbolsAndGraphics(){var e,t,i,s,a;this.clear(),null==(e=this.filterVisibility)||e.clear(),null==(t=this.labeler)||t.reset(),null==(i=this.deconflictor)||i.clear(),null==(s=this.elevationAlignment)||s.clear(),null==(a=this.stageLayer)||a.invalidateSpatialQueryAccelerator(),this.stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this.stageLayerElevationProvider),this.stageLayerElevationProvider.dispose(),this.stageLayerElevationProvider=null)}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:t,view:i}=this.owner,s=i.basemapTerrain.tilingScheme&&t&&t.length?t.toArray():null;!e&&s||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),s&&(e?this.add(s):this.recreateGraphics(s))}_recreateSymbol(e){const t=this.graphicsBySymbol.get(e),i=[];t&&(t.forEach((e,t)=>{var s;const a=e.usedMemory;this._conditionalRemove(e,t),null==(s=this._spatialIndex)||s.remove(e),i.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,a),this._updateLayerVisibility(),this.featureStore.events.emit("changed")}),this.graphicsBySymbol.set(e,new Map));const s=this.symbols.get(e);Object(d["d"])(s),this.symbols.delete(e),this.add(i)}_recreateGraphicsForSymbol(e){const t=this.graphicsBySymbol.get(e);if(t){const e=[];t.forEach(t=>e.push(t.graphic)),this.recreateGraphics(e)}}_conditionalRemove(e,t){var i,s,a;this.graphicsDrapedUids.delete(t),null==(i=this.objectStates)||i.removeGraphic(e),null==(s=this.labeler)||s.removeGraphic(e),null==(a=this.deconflictor)||a.removeGraphic(e),Object(d["k"])(this.graphicStateTracking)&&this.graphicStateTracking.removeGraphic(e)}add(e){e&&0!==e.length&&(this.owner.view.basemapTerrain&&this.owner.view.basemapTerrain.tilingScheme?(this._updatePolicyForGraphics(e)===Ve["m"].ASYNC?this._addDelayed(e):this._addImmediate(e),this.notifyChange("updating")):qe.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===Ve["m"].SYNC&&("mesh"===this.layer.geometryType||null==this.layer.geometryType))for(const t of e)if(Object(d["k"])(t.geometry)&&"mesh"===t.geometry.type&&!t.geometry.loaded)return Ve["m"].ASYNC;return this.effectiveUpdatePolicy}_addImmediate(e){this.geometryWarningLogged=!1,this.symbolWarningLogged=!1;for(const t of e)this._addGraphic(t,this._getRenderingInfo(t,qe),Ve["m"].SYNC);this._cleanupSymbols(),this.labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(e){for(const t of e){const e=t.uid;let i=this.pendingUpdates.get(e);i?i.add?i.state!==$e.NEW&&i.abortController.abort():this.pendingAdds++:(i=this.pendingUpdatesPool.pushNew(),this.pendingAdds++,this.pendingUpdates.set(e,i)),i.add=t}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(e){this.effectiveUpdatePolicy===Ve["m"].ASYNC?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange("updating")}_removeImmediate(e){for(const t of e)this._removeGraphic(t);this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(e){for(const t of e){const e=t.uid,i=this.pendingUpdates.get(e);if(i)i.add&&(i.remove?i.add=null:this.pendingUpdates.delete(e),i.state===$e.LOADING&&i.abortController.abort(),this.pendingAdds--);else{const i=this.pendingUpdatesPool.pushNew();i.remove=t,this.pendingUpdates.set(e,i),this.pendingRemoves++}}0===this.pendingUpdates.size&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this.pendingUpdatesPool.clear(),this._cleanupSymbols(),(this.pendingAdds||this.pendingRemoves)&&qe.warn("pendingAdds/Removes in inconsistent state!"),this.pendingAdds=0,this.pendingRemoves=0}_applyPendingUpdates(e){var t;if(this.geometryWarningLogged=!1,this.symbolWarningLogged=!1,0===this.pendingUpdates.size&&null!=(t=this._spatialIndex)&&t.updating)this._spatialIndex.update();else{for(const[t,i]of this.pendingUpdates){if(e.done)break;i.add&&i.state===$e.NEW&&this._processPendingUpdateNew(i);let s=this.effectiveUpdatePolicy;if(!i.remove||i.add&&i.state!==$e.READY||(this.pendingRemoves--,e.madeProgress(),this._removeGraphic(i.remove),i.remove=null,s=Ve["m"].SYNC),i.add)switch(i.state){case $e.READY:this._addGraphic(i.add,i.renderingInfo,s),i.add=null,this.pendingAdds--,e.madeProgress();break;case $e.REJECTED:i.add=null,this.pendingAdds--;case $e.LOADING:}null==i.remove&&null==i.add&&this.pendingUpdates.delete(t)}0===this.pendingUpdates.size&&(this._finishPendingUpdates(),this.notifyChange("running"))}}_processPendingUpdateNew(e){if(!e.add)return void(e.state=$e.READY);const t=e.add.geometry;Object(d["k"])(t)&&"mesh"===t.type&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=$e.LOADING,e.abortController=new AbortController;const i=e.abortController.signal;try{await t.load({signal:i})}catch(s){return this._processPendingUpdateNewError(e,s)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,Object(b["m"])(t)?e.state=$e.NEW:e.state=$e.REJECTED}async _processPendingUpdateNewRenderingInfo(e){if(Object(d["j"])(this.layer.renderer)||"dictionary"!==this.layer.renderer.type)return e.renderingInfo=this._getRenderingInfo(e.add,qe),void(e.state=$e.READY);e.state=$e.LOADING,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(i){return e.abortController=null,void(Object(b["m"])(i)?e.state=$e.NEW:e.state=$e.REJECTED)}Object(d["j"])(t)||Object(d["j"])(t.symbol)?(qe&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,qe.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=$e.READY}_addGraphic(e,t,i){if(this.graphicsWithoutSymbol.set(e.uid,e),Object(d["j"])(t)||Object(d["j"])(t.symbol)||!Object(x["h"])(e))return;const s=t.symbol,a=this.getOrCreateGraphics3DSymbol(s,t.renderer);if(Object(d["j"])(a))return;this._expandComputedExtent(e.geometry);const r=this._beginGraphicUpdate(e),n=new re["a"](e,t,this.layer);let o=!1;const l=e=>{e===a.symbol.id&&(o=!0)};this._whenSymbolRemoved.push(l);const h=()=>{if(!this.destroyed){if(this._whenSymbolRemoved.removeUnordered(l),this.graphicsWaitingForSymbol.get(e.uid)!==r||o||a.destroyed||this.graphicSymbolSupported&&e.symbol&&e.symbol.id!==a.symbol.id)--a.referenced;else{const t=this._createGraphics3DGraphic(a,n);this._spatialIndex&&Object(d["k"])(t)&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}this.featureStore.events.emit("changed"),this.labeler&&this.owner.view.labeler.setDirty()}},c=t=>{this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),o||(Object(b["m"])(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e)))};i===Ve["m"].ASYNC?a.load(()=>this._frameTask.schedule(h),e=>this._frameTask.schedule(()=>c(e))):a.load(h,c)}_removeGraphic(e){const t=e.uid,i=this.graphics3DGraphics.get(t);if(i){var s;i.graphics3DSymbol.onRemoveGraphic(i);const e=i.usedMemory,a=i.isElevationSource;this._conditionalRemove(i,t),null==(s=this._spatialIndex)||s.remove(i);const r=i.graphics3DSymbol.symbol.id;this.graphicsBySymbol.get(r).delete(t),this.graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,e,a),i.destroy(),this.featureStore.events.emit("changed")}else this.graphicsWithoutSymbol.delete(t),this.graphicsWaitingForSymbol.delete(t),0===this.graphicsWaitingForSymbol.size&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(e){if(e instanceof ze["a"]||e instanceof Ne["a"]){const t=this.symbolCreationContext.layer;return!!t.labelingInfo&&t.labelingInfo.some(t=>t.symbol===e)}return!1}_hasValidSymbolCreationContext(e){return!(e instanceof ze["a"]&&!this._hasLabelingContext(e))||(qe.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(e,t){const i=e.geometry;if(Object(d["j"])(i))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!Object(_["b"])(i.spatialReference,this._spatialReference))return t&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&Object(d["k"])(e.symbol))return t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const s=this.rendererHasGeometryOperations?Object(G["c"])(e,this.layer):e;let a;return a=this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||Object(d["k"])(this.currentRenderer))?this.owner.getRenderingInfo(s,this.currentRenderer,Object(d["t"])(this.arcadeOnDemand)):{symbol:s.symbol||q(s.geometry)},Object(d["j"])(a)||Object(d["j"])(a.symbol)?(t&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,t.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){const i=e.geometry;if(Object(d["j"])(i))return qe&&!this.geometryWarningLogged&&(this.geometryWarningLogged=!0,qe.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&Object(d["k"])(e.symbol))return qe&&!this.symbolWarningLogged&&(this.symbolWarningLogged=!0,qe.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const s=this.rendererHasGeometryOperations?Object(G["c"])(e,this.layer):e;return this.owner.getRenderingInfoAsync(s,Object(d["t"])(this.currentRenderer),Object(d["t"])(this.arcadeOnDemand),t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;const i=this._getConvertedSymbol(e);if(!i)return null;let s;if(Object(d["k"])(t)&&"backgroundFillSymbol"in t&&t.backgroundFillSymbol){const e=Object(R["a"])(t.backgroundFillSymbol,{ignoreDrivers:!0});Object(d["k"])(e.symbol)&&"web-style"!==e.symbol.type&&"cim"!==e.symbol.type&&(s=e.symbol.symbolLayers)}const a=de(i,this.symbolCreationContext,s);return a.load(()=>{const e=a.extentPadding;e>this.extentPadding&&this._set("extentPadding",e),this.notifyChange("averageSymbolComplexity")},()=>{}),a}getOrCreateGraphics3DSymbol(e,t){let i=this.symbols.get(e.id);return void 0===i&&(i=e instanceof We["a"]?new pe["a"](e,e=>this._frameTask.schedule(e),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t),this.symbols.set(e.id,i)),Object(d["k"])(i)&&++i.referenced,i}trackGraphicState(e){return Object(d["j"])(this.graphicStateTracking)&&(this.graphicStateTracking=new be(this)),this.graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this.numberOfGraphics++,e.isElevationSource&&(this.numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,i=!1){this._usedMemory-=t,this.graphics3DGraphics.delete(e),this.numberOfGraphics--,i&&(this.numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){var i,s,a,r;const n=t.graphic;if(this.graphicsWithoutSymbol.delete(n.uid),!this.symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;const o=e.createGraphics3DGraphic(t);if(Object(d["j"])(o))return null;this._addGraphics3DGraphic(o);const l=e.symbol.id;this.graphicsBySymbol.has(l)||this.graphicsBySymbol.set(l,new Map),this.graphicsBySymbol.get(l).set(n.uid,o),o.isDraped&&this.graphicsDrapedUids.add(n.uid),o.centroid=null,Object(d["k"])(n.geometry)&&"point"!==n.geometry.type&&(o.centroid=Object(ue["a"])(n.geometry,this._spatialReference)),this._updateUserVisibility(o),Object(d["k"])(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(o),null==(i=this.filterVisibility)||i.updateVisibility(o),null==(s=this.deconflictor)||s.addGraphic(o),null==(a=this.labeler)||a.addGraphic(o),null==(r=this.objectStates)||r.addGraphic(o),this.deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,o),o.initialize(this.stage,this.stageLayer,this.owner),Object(d["k"])(this.graphicStateTracking)&&this.graphicStateTracking.addGraphic(o);const h=this.whenGraphics3DGraphicRequests[n.uid];return h&&(delete this.whenGraphics3DGraphicRequests[n.uid],h.resolve(o)),o}_abortRendererChange(){this.rendererChangeAbortController&&(this.rendererChangeAbortController.abort(),this.rendererChangeAbortController=null)}async rendererChange(e){if(this._abortRendererChange(),e!==this.currentRenderer)if(this._validateRenderer(e),Object(d["j"])(e)&&this._currentRendererChange(null,!1),E(e))if(Object(d["k"])(e)&&e.arcadeRequired){const t=new AbortController;this.rendererChangeAbortController=t;const{arcadeUtils:i}=await this._ensureArcade();Object(b["v"])(t),i.hasGeometryOperations(e)&&(await i.enableGeometryOperations(),Object(b["v"])(t)),this.effectiveUpdatePolicy===Ve["m"].ASYNC?await this._frameTask.schedule(()=>this._currentRendererChange(e,!0),t.signal):this._currentRendererChange(e,!0),this.rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===Ve["m"].ASYNC){const t=new AbortController;this.rendererChangeAbortController=t,await this._frameTask.schedule(()=>this._currentRendererChange(e,!1),t.signal),this.rendererChangeAbortController=null}else this._currentRendererChange(e,!1);else this._currentRendererChange(e,!1)}async _ensureArcade(){return Object(d["j"])(this.arcadeOnDemand)?(this.arcadeOnDemand=await Object(k["e"])(),this.arcadeOnDemand):this.arcadeOnDemand}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererHasGeometryOperations=t,this.symbolCreationContext.arcade=Object(d["t"])(this.arcadeOnDemand);const i=this.symbolCreationContext.renderer;if(e===i)return;if(this.symbolConversionCache.clear(),Object(d["j"])(e))return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const s=Object(O["a"])(i,e);this._updateUnchangedSymbolMappings(s,e,i),this.symbolCreationContext.renderer=e,Object(d["j"])(s)||("complete"===s.type?this.recreateAllGraphicsAndSymbols():"partial"===s.type&&(this._applyRendererDiff(s,e,i)?this._volatileGraphicsUpdated():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(e){for(const t in e.diff)switch(t){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"authoringInfo":case"fieldDelimiter":delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,i){e=e||[],t=t||[];const s=[];for(const a of t){const t=this.graphicsBySymbol.get(a.id);t&&t.forEach((r,n)=>{const o=r.graphic,l=this.layer instanceof w["a"]?this.layer:null,h=Object(d["t"])(this.arcadeOnDemand);if(a===i.defaultSymbol&&i.getSymbol(Object(G["c"])(o,l),{arcade:h})===i.defaultSymbol)return;const c=r.usedMemory;e.length||i.defaultSymbol?s.push(o):this.graphicsWithoutSymbol.set(n,o);const p=this.graphics3DGraphics.get(n);this._conditionalRemove(p,n),r.destroy(),t.delete(n),this._removeGraphics3DGraphic(n,c),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(e=>e(a.id))}(e.length||s.length)&&(this.graphicsWithoutSymbol.forEach(e=>s.push(e)),this.graphicsWithoutSymbol.clear(),this.add(s)),this._cleanupSymbols(),this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(e,t,i){const s=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(s||a){const r=a?a.added.map(e=>e.symbol):[],n=a?a.removed.map(e=>e.symbol):[];if(a)for(let e=0;e<a.changed.length;e++)r.push(a.changed[e].newValue.symbol),n.push(a.changed[e].oldValue.symbol);return s?(i.defaultSymbol&&n.push(i.defaultSymbol),t.defaultSymbol&&r.push(t.defaultSymbol)):i.defaultSymbol&&r.length&&n.push(t.defaultSymbol),this._applySymbolSetDiff(r,n,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,i){if("unique-value"!==(null==t?void 0:t.type)||"unique-value"!==(null==i?void 0:i.type)||Object(d["k"])(e)&&"partial"!==e.type)return[];const s=e=>Object(d["k"])(e)?e.id:null,a=e&&e.diff,r=a&&a.defaultSymbol,n=a&&a.uniqueValueInfos;let o;if(n)o=n.unchanged.map(e=>({oldId:s(e.oldValue.symbol),newId:s(e.newValue.symbol)}));else{o=[];for(const e of i.uniqueValueInfos){const i=s(e.symbol),a=t.uniqueValueInfos.find(t=>t.value===e.value);a&&i!==s(a.symbol)&&o.push({oldId:i,newId:s(a.symbol)})}}return!r&&i.defaultSymbol&&o.push({oldId:s(i.defaultSymbol),newId:s(t.defaultSymbol)}),o}_updateSymbolMapping(e,t){const i=Object(d["k"])(t)&&t?"string"==typeof t?t:t.id:null;if(!e||e===i)return;const s=this.graphicsBySymbol.get(e);this.graphicsBySymbol.delete(e),void 0!==s&&this.graphicsBySymbol.set(i,s);const a=this.symbols.get(e);if(void 0!==a&&(this.symbols.delete(e),this.symbols.set(i,a),Object(d["k"])(a))){const e="string"==typeof t?null:t;Object(d["k"])(e)?a.symbol=e:a.symbol.id=i}}_updateUnchangedSymbolMappings(e,t,i){const s=this._calculateUnchangedSymbolMapping(e,t,i);for(const{oldId:a,newId:r}of s)this._updateSymbolMapping(a,r)}_applyRendererDiff(e,t,i){if(this._diffHasSymbolChange(e))return!1;if(t instanceof a["a"]&&i instanceof a["a"]&&this._applyUniqueValueRendererDiff(e,t,i)&&0===Object.keys(e.diff).length)return!0;for(const[s]of this.graphicsBySymbol){const i=this.symbols.get(s);if(Object(d["k"])(i))switch(i.applyRendererDiff(e,t)){case ye["a"].Recreate_Symbol:this._recreateSymbol(s);break;case ye["a"].Recreate_Graphics:this._recreateGraphicsForSymbol(s);case ye["a"].Fast_Update:}}return!0}opacityChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("opacity",t)),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.isSliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged("slicePlaneEnabled",t)),this.deconflictor&&this.deconflictor.slicePlaneEnabledChange(),this.labeler&&this.labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){e!==this.symbolCreationContext.physicalBasedRenderingEnabled&&(this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",t)||this._recreateSymbol(i)}))}_pixelRatioChange(){this.forEachGraphics3DSymbol((e,t,i)=>{e.globalPropertyChanged("pixelRatio",t)||this._recreateSymbol(i)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=Object(u["b"])(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){const i=this.symbolCreationContext.clippingExtent,s=Object(C["l"])();return Object(ke["b"])(e,s,t)?this.symbolCreationContext.clippingExtent=Object(S["s"])(Object(S["h"])(),s):this.symbolCreationContext.clippingExtent=null,!Object(S["l"])(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(e){let t=!1;this.graphics3DGraphics.forEach(i=>{e(i)&&(t=!0)}),t&&(this.labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}forEachGraphics3DSymbol(e){for(const[t,i]of this.symbols){if(Object(d["j"])(i))return;e(i,this.graphicsBySymbol.get(t)||tt,t)}}updateAllGraphicsVisibility(){this.filterVisibility&&(this.filterVisibility.dirty=!0),this.modifyGraphics3DGraphicVisibilities(e=>{const t=this._updateUserVisibility(e),i=Object(d["k"])(this.scaleVisibility)&&this.scaleVisibility.updateVisibility(e);return t||i})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag($["a"].USER_SETTING,!1,$["b"].GRAPHIC))}_validateRenderer(e){const t=I(e);if(t){const e=`Renderer for layer '${this.layer.title?this.layer.title+", ":""}, id:${this.layer.id}' is not supported in a SceneView`;qe.warn(e,t.message)}}_volatileGraphicsUpdated(){var e;null==(e=this.labeler)||e.reset(),this.stageLayer.shaderTransformationChanged(),this.notifyChange("updating")}_cleanupSymbols(){if(this.graphicsWaitingForSymbol.size>0||this.suspendSymbolCleanup)return;let e=!1;this.symbols.forEach((t,i)=>{if(Object(d["j"])(t)||t.referenced>0)return;const s=this.graphicsBySymbol.get(i);s&&0!==s.size||(this.graphicsBySymbol.delete(i),this.symbols.delete(i),Object(d["d"])(t),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this.symbols.keys()].sort(),graphicsBySymbol:[...this.graphicsBySymbol.keys()].sort().map(e=>({symbolId:e,graphics:[...this.graphicsBySymbol.get(e).keys()].sort()})),graphicsWithoutSymbol:[...this.graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this.graphicsDrapedUids].sort(),pendingUpdates:this.pendingUpdates}),symbols:this.symbols,filterVisibility:this.filterVisibility,numPending:this.pendingUpdates.size,forceUpdatePolicy:e=>{this.forcedUpdatePolicy=e}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this.graphicsWithoutSymbol.size,pending:this.pendingUpdates.size}}};var $e;Ze.tmpVec=Object(j["f"])(),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"computedExtent",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"currentRenderer",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"rendererHasGeometryOperations",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"_frameTask",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"rendererChangeAbortController",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"elevationInfoChangeAbortController",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"setupAbortController",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"elevationAlignment",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"scaleVisibility",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"filterVisibility",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"_spatialIndex",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"extentPadding",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"_updatingPendingLoadedGraphicsChange",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"featureStore",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"deconflictor",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"labeler",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"objectStates",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"preferredUpdatePolicy",void 0),Object(s["a"])([Object(g["b"])()],Ze.prototype,"forcedUpdatePolicy",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"effectiveUpdatePolicy",null),Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ze.prototype,"elevationFeatureExpressionEnabled",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ze.prototype,"owner",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ze.prototype,"layer",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ze.prototype,"graphicSymbolSupported",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ze.prototype,"getRenderingInfoWithoutRenderer",void 0),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"updating",null),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"running",null),Object(s["a"])([Object(g["b"])({readOnly:!0})],Ze.prototype,"suspendedOrOutsideOfView",null),Object(s["a"])([Object(g["b"])({readOnly:!0,dependsOn:[]})],Ze.prototype,"updatingRemaining",null),Object(s["a"])([Object(g["b"])({readOnly:!0,dependsOn:["owner.view.qualitySettings.graphics3D.maxTotalNumberOfPrimitives","owner.view.qualitySettings.graphics3D.maxTotalNumberOfFeatures","averageSymbolComplexity"]})],Ze.prototype,"displayFeatureLimit",null),Object(s["a"])([Object(g["b"])({readOnly:!0,dependsOn:[]})],Ze.prototype,"averageSymbolComplexity",null),Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ze.prototype,"hasZ",void 0),Object(s["a"])([Object(g["b"])({constructOnly:!0})],Ze.prototype,"hasM",void 0),Ze=Le=Object(s["a"])([Object(f["a"])("esri.views.3d.layers.graphics.Graphics3DCore")],Ze),function(e){e[e.NEW=0]="NEW",e[e.LOADING=1]="LOADING",e[e.READY=2]="READY",e[e.REJECTED=3]="REJECTED"}($e||($e={}));class Je{constructor(){this.add=null,this.renderingInfo=null,this.state=$e.NEW,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=$e.NEW,this.abortController=null,this.remove=null}}const Qe=10,Ke=Object(j["f"])(),et=Object(j["f"])(),tt=new Map},ce76:function(e,t,i){"use strict";i.d(t,"a",(function(){return o}));var s=i("b50f"),a=i("b2b2"),r=i("8a44"),n=i("4637");class o{constructor(e=9,t){this.compareMinX=d,this.compareMinY=p,this._toBBox=function(e){return e},this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),v.prune(),j.prune(),_.prune(),S.prune()}all(e){this._all(this.data,e)}search(e,t){let i=this.data;const s=this._toBBox;if(f(e,i))for(v.clear();i;){for(let a=0,r=i.children.length;a<r;a++){const r=i.children[a],n=i.leaf?s(r):r;f(e,n)&&(i.leaf?t(r):m(e,n)?this._all(r,t):v.push(r))}i=v.pop()}}collides(e){let t=this.data;const i=this._toBBox;if(!f(e,t))return!1;for(v.clear();t;){for(let s=0,a=t.children.length;s<a;s++){const a=t.children[s],r=t.leaf?i(a):a;if(f(e,r)){if(t.leaf||m(e,r))return!0;v.push(a)}}t=v.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(0,e.length),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=new x([]),this}remove(e){if(!e)return this;let t,i=this.data,r=null,n=0,o=!1;const l=this._toBBox(e);for(_.clear(),S.clear();i||_.length>0;){var h;if(i||(i=Object(a["c"])(_.pop()),r=_.data[_.length-1],n=null!=(h=S.pop())?h:0,o=!0),i.leaf&&(t=Object(s["g"])(i.children,e,i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),_.push(i),this._condense(_),this;o||i.leaf||!m(i,l)?r?(n++,i=r.children[n],o=!1):i=null:(_.push(i),S.push(n),n=0,r=i,i=i.children[0])}return this}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let i=e;for(j.clear();i;){var s;if(!0===i.leaf)for(const e of i.children)t(e);else j.pushArray(i.children);i=null!=(s=j.pop())?s:null}}_build(e,t,i,s){const a=i-t+1;let r=this._maxEntries;if(a<=r){const s=new x(e.slice(t,i+1));return l(s,this._toBBox),s}s||(s=Math.ceil(Math.log(a)/Math.log(r)),r=Math.ceil(a/r**(s-1)));const n=new G([]);n.height=s;const o=Math.ceil(a/r),h=o*Math.ceil(Math.sqrt(r));O(e,t,i,h,this.compareMinX);for(let l=t;l<=i;l+=h){const t=Math.min(l+h-1,i);O(e,l,t,o,this.compareMinY);for(let i=l;i<=t;i+=o){const a=Math.min(i+o-1,t);n.children.push(this._build(e,i,a,s-1))}}return l(n,this._toBBox),n}_chooseSubtree(e,t,i,s){for(;s.push(t),!0!==t.leaf&&s.length-1!==i;){let i,s=1/0,a=1/0;for(let r=0,n=t.children.length;r<n;r++){const n=t.children[r],o=b(n),l=y(e,n)-o;l<a?(a=l,s=o<s?o:s,i=n):l===a&&o<s&&(s=o,i=n)}t=i||t.children[0]}return t}_insert(e,t,i){const s=this._toBBox,a=i?e:s(e);_.clear();const r=this._chooseSubtree(a,this.data,t,_);for(r.children.push(e),c(r,a);t>=0&&_.data[t].children.length>this._maxEntries;)this._split(_,t),t--;this._adjustParentBBoxes(a,_,t)}_split(e,t){const i=e.data[t],s=i.children.length,a=this._minEntries;this._chooseSplitAxis(i,a,s);const r=this._chooseSplitIndex(i,a,s);if(!r)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const n=i.children.splice(r,i.children.length-r),o=i.leaf?new x(n):new G(n);o.height=i.height,l(i,this._toBBox),l(o,this._toBBox),t?e.data[t-1].children.push(o):this._splitRoot(i,o)}_splitRoot(e,t){this.data=new G([e,t]),this.data.height=e.height+1,l(this.data,this._toBBox)}_chooseSplitIndex(e,t,i){let s,a,r;s=a=1/0;for(let n=t;n<=i-t;n++){const t=h(e,0,n,this._toBBox),o=h(e,n,i,this._toBBox),l=g(t,o),c=b(t)+b(o);l<s?(s=l,r=n,a=c<a?c:a):l===s&&c<a&&(a=c,r=n)}return r}_chooseSplitAxis(e,t,i){const s=e.leaf?this.compareMinX:d,a=e.leaf?this.compareMinY:p;this._allDistMargin(e,t,i,s)<this._allDistMargin(e,t,i,a)&&e.children.sort(s)}_allDistMargin(e,t,i,s){e.children.sort(s);const a=this._toBBox,r=h(e,0,t,a),n=h(e,i-t,i,a);let o=u(r)+u(n);for(let l=t;l<i-t;l++){const t=e.children[l];c(r,e.leaf?a(t):t),o+=u(r)}for(let l=i-t-1;l>=t;l--){const t=e.children[l];c(n,e.leaf?a(t):t),o+=u(n)}return o}_adjustParentBBoxes(e,t,i){for(let s=i;s>=0;s--)c(t.data[s],e)}_condense(e){for(let t=e.length-1;t>=0;t--){const i=e.data[t];if(0===i.children.length)if(t>0){const a=e.data[t-1],r=a.children;r.splice(Object(s["g"])(r,i,r.length,a.indexHint),1)}else this.clear();else l(i,this._toBBox)}}_initFormat(e){const t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this._toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){h(e,0,e.children.length,t,e)}function h(e,t,i,s,a){a||(a=new x([])),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(let r,n=t;n<i;n++)r=e.children[n],c(a,e.leaf?s(r):r);return a}function c(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function d(e,t){return e.minX-t.minX}function p(e,t){return e.minY-t.minY}function b(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function u(e){return e.maxX-e.minX+(e.maxY-e.minY)}function y(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function g(e,t){const i=Math.max(e.minX,t.minX),s=Math.max(e.minY,t.minY),a=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,a-i)*Math.max(0,r-s)}function m(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function f(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function O(e,t,i,s,r){const o=[t,i];for(;o.length;){const t=Object(a["c"])(o.pop()),i=Object(a["c"])(o.pop());if(t-i<=s)continue;const l=i+Math.ceil((t-i)/s/2)*s;Object(n["a"])(e,l,i,t,r),o.push(i,l,l,t)}}const v=new r["a"],j=new r["a"],_=new r["a"],S=new r["a"]({deallocator:void 0});class C{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class w extends C{constructor(){super(...arguments),this.height=1,this.indexHint=new s["a"]}}class x extends w{constructor(e){super(),this.children=e,this.leaf=!0}}class G extends w{constructor(e){super(),this.children=e,this.leaf=!1}}}}]);
- //# sourceMappingURL=chunk-121d41d5.9a9489b2.js.map
|